Skip to content

Commit a5ac4bd

Browse files
authored
chore: migrate to father 4 (#27)
1 parent f556a8f commit a5ac4bd

File tree

4 files changed

+31
-15
lines changed

4 files changed

+31
-15
lines changed

.fatherrc.js

-9
This file was deleted.

.fatherrc.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'father';
2+
3+
export default defineConfig({
4+
platform: 'browser',
5+
cjs: { output: 'lib' },
6+
esm: {
7+
output: 'es',
8+
alias: { 'rc-util/lib': 'rc-util/es' },
9+
},
10+
});

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
lint-staged

package.json

+17-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@
3434
"docs:deploy": "gh-pages -d .doc",
3535
"compile": "father build && lessc assets/index.less assets/index.css",
3636
"gh-pages": "npm run docs:build && father doc deploy",
37-
"prepublishOnly": "npm run compile && np --yolo --no-publish && npm run gh-pages",
37+
"prepublishOnly": "npm run compile && np --yolo --no-publish",
38+
"postpublish": "npm run gh-pages",
3839
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
3940
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
4041
"pretty-quick": "pretty-quick",
41-
"test": "father test",
42-
"coverage": "father test --coverage"
42+
"lint-staged": "lint-staged",
43+
"test": "umi-test test",
44+
"coverage": "father test --coverage",
45+
"prepare": "husky install"
4346
},
4447
"dependencies": {
4548
"@babel/runtime": "^7.11.1",
@@ -59,17 +62,19 @@
5962
"cross-env": "^7.0.2",
6063
"dumi": "^1.1.0",
6164
"eslint": "^7.0.0",
62-
"father": "^2.13.4",
65+
"father": "^4",
6366
"father-build": "^1.18.6",
6467
"gh-pages": "^3.1.0",
65-
"husky": "^4.2.5",
68+
"husky": "^8.0.1",
6669
"less": "^3.10.3",
70+
"lint-staged": "^13.0.3",
6771
"np": "^7.0.0",
6872
"prettier": "^2.0.5",
6973
"pretty-quick": "^3.0.0",
7074
"react": "^18.0.0",
7175
"react-dom": "^18.0.0",
72-
"typescript": "^4.0.5"
76+
"typescript": "^4.0.5",
77+
"umi-test": "^1.9.7"
7378
},
7479
"peerDependencies": {
7580
"react": ">=16.0.0",
@@ -80,6 +85,12 @@
8085
"pre-commit": "pretty-quick --staged"
8186
}
8287
},
88+
"lint-staged": {
89+
"**/*.{js,jsx,tsx,ts,md,json}": [
90+
"prettier --write",
91+
"git add"
92+
]
93+
},
8394
"cnpm": {
8495
"mode": "npm"
8596
},

0 commit comments

Comments
 (0)