diff --git a/.fatherrc.ts b/.fatherrc.ts index 7414da0..bf16cd3 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -1,10 +1,6 @@ + import { defineConfig } from 'father'; export default defineConfig({ - platform: 'browser', - cjs: { output: 'lib' }, - esm: { - output: 'es', - alias: { 'rc-util/lib': 'rc-util/es' }, - }, -}); + plugins: ['@rc-component/father-plugin'], +}); \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d4ffe42 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "21:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: less + versions: + - 4.1.0 diff --git a/.husky/pre-commit b/.husky/pre-commit index 7d0de5d..d24fdfc 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -lint-staged +npx lint-staged diff --git a/README.md b/README.md index f4607fb..7b52abd 100644 --- a/README.md +++ b/README.md @@ -5,28 +5,26 @@ Switch ui component for react. [![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Dependencies][david-image]][david-url] -[![DevDependencies][david-dev-image]][david-dev-url] [![npm download][download-image]][download-url] +[![build status][github-actions-image]][github-actions-url] +[![Test coverage][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [npm-image]: http://img.shields.io/npm/v/rc-switch.svg?style=flat-square [npm-url]: http://npmjs.org/package/rc-switch [travis-image]: https://img.shields.io/travis/react-component/switch/master?style=flat-square -[travis-url]: https://travis-ci.org/react-component/switch -[circleci-image]: https://img.shields.io/circleci/react-component/switch/master?style=flat-square -[circleci-url]: https://circleci.com/gh/react-component/switch -[coveralls-image]: https://img.shields.io/coveralls/react-component/switch.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/react-component/switch?branch=master +[travis-url]: https://travis-ci.com/react-component/switch +[github-actions-image]: https://github.com/react-component/switch/workflows/CI/badge.svg +[github-actions-url]: https://github.com/react-component/switch/actions +[codecov-image]: https://img.shields.io/codecov/c/github/react-component/switch/master.svg?style=flat-square +[codecov-url]: https://app.codecov.io/gh/react-component/switch [david-url]: https://david-dm.org/react-component/switch [david-image]: https://david-dm.org/react-component/switch/status.svg?style=flat-square [david-dev-url]: https://david-dm.org/react-component/switch?type=dev [david-dev-image]: https://david-dm.org/react-component/switch/dev-status.svg?style=flat-square [download-image]: https://img.shields.io/npm/dm/rc-switch.svg?style=flat-square [download-url]: https://npmjs.org/package/rc-switch -[bundlephobia-url]: https://bundlephobia.com/result?p=rc-switch +[bundlephobia-url]: https://bundlephobia.com/package/rc-switch [bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-switch ## Install @@ -44,8 +42,8 @@ export default () => ; ## Compatibility | [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Electron](http://godban.github.io/browsers-support-badges/)
Electron | -| --- | --- | --- | --- | --- | -| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | ## API @@ -69,7 +67,7 @@ npm install npm start ``` -Online demo: http://react-component.github.io/switch/examples/ +Online demo: http://react-component.github.io/switch/ ## License diff --git a/package.json b/package.json index 96b2962..659654c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-switch", - "version": "4.0.0", + "version": "4.1.0", "description": "switch ui component for react", "keywords": [ "react", @@ -8,6 +8,15 @@ "react-switch", "switch" ], + "homepage": "http://github.com/react-component/switch", + "bugs": { + "url": "http://github.com/react-component/switch/issues" + }, + "repository": { + "type": "git", + "url": "git@github.com:react-component/switch.git" + }, + "license": "MIT", "main": "lib/index", "module": "./es/index", "files": [ @@ -15,40 +24,34 @@ "es", "lib" ], - "homepage": "http://github.com/react-component/switch", - "repository": { - "type": "git", - "url": "git@github.com:react-component/switch.git" - }, - "bugs": { - "url": "http://github.com/react-component/switch/issues" - }, - "license": "MIT", "scripts": { - "start": "dumi dev", + "compile": "father build && lessc assets/index.less assets/index.css", "docs:build": "dumi build", "docs:deploy": "gh-pages -d .doc", - "compile": "father build && lessc assets/index.less assets/index.css", "gh-pages": "npm run docs:build && npm run docs:deploy", - "prepublishOnly": "npm run compile && np --yolo --no-publish", - "postpublish": "npm run gh-pages", "lint": "eslint .", "lint-staged": "lint-staged", - "test": "umi-test", - "coverage": "father test --coverage", - "prepare": "husky install" + "prepare": "husky install", + "prepublishOnly": "npm run compile && np --yolo --no-publish", + "postpublish": "npm run gh-pages", + "start": "dumi dev", + "test": "umi-test" }, "lint-staged": { "**/*.{js,jsx,tsx,ts,md,json}": [ - "prettier --write", - "git add" + "prettier --write" ] }, + "dependencies": { + "@babel/runtime": "^7.21.0", + "classnames": "^2.2.1", + "rc-util": "^5.30.0" + }, "devDependencies": { + "@rc-component/father-plugin": "^1.0.0", "@types/classnames": "^2.2.10", "@types/jest": "^26.0.4", "@umijs/fabric": "^3.0.0", - "coveralls": "^3.0.6", "dumi": "^1.1.0", "enzyme": "^3.0.0", "enzyme-adapter-react-16": "^1.0.1", @@ -58,8 +61,9 @@ "gh-pages": "^4.0.0", "husky": "^8.0.1", "less": "^3.11.1", - "lint-staged": "^13.0.3", + "lint-staged": "^13.2.1", "np": "^7.1.0", + "prettier": "^2.8.8", "react": "^16.0.0", "react-dom": "^16.0.0", "react-test-renderer": "^16.0.0", @@ -68,10 +72,5 @@ "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" - }, - "dependencies": { - "@babel/runtime": "^7.10.1", - "classnames": "^2.2.1", - "rc-util": "^5.0.1" } }