Skip to content

Commit 541e4e9

Browse files
committed
fix: package updates + test:coverage
1 parent 4af3b76 commit 541e4e9

File tree

4 files changed

+333
-244
lines changed

4 files changed

+333
-244
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,43 @@ jobs:
1515

1616
- uses: actions/setup-node@v1
1717
with:
18-
node-version: '12'
18+
node-version: '18'
1919

20-
- name: cache package-lock.json
20+
- name: cache pnpm-lock.yaml
2121
uses: actions/cache@v2
2222
with:
2323
path: package-temp-dir
2424
key: lock-${{ github.sha }}
2525

26-
- name: create package-lock.json
27-
run: npm i --package-lock-only
26+
- name: create pnpm-lock.yaml
27+
run: |
28+
npm install --global pnpm@7
29+
pnpm config set store-dir .pnpm-store
2830
2931
- name: hack for singe file
3032
run: |
3133
if [ ! -d "package-temp-dir" ]; then
3234
mkdir package-temp-dir
3335
fi
34-
cp package-lock.json package-temp-dir
36+
cp pnpm-lock.yaml package-temp-dir
3537
- name: cache node_modules
3638
id: node_modules_cache_id
3739
uses: actions/cache@v2
3840
with:
3941
path: node_modules
40-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
42+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
4143

4244
- name: install
4345
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
44-
run: npm ci
46+
run: pnpm install
4547

4648
lint:
4749
runs-on: ubuntu-latest
4850
steps:
4951
- name: checkout
5052
uses: actions/checkout@master
5153

52-
- name: restore cache from package-lock.json
54+
- name: restore cache from pnpm-lock.yaml
5355
uses: actions/cache@v2
5456
with:
5557
path: package-temp-dir
@@ -59,10 +61,10 @@ jobs:
5961
uses: actions/cache@v2
6062
with:
6163
path: node_modules
62-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
64+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
6365

6466
- name: lint
65-
run: npm run lint
67+
run: pnpm lint
6668

6769
needs: setup
6870

@@ -72,7 +74,7 @@ jobs:
7274
- name: checkout
7375
uses: actions/checkout@master
7476

75-
- name: restore cache from package-lock.json
77+
- name: restore cache from pnpm-lock.yaml
7678
uses: actions/cache@v2
7779
with:
7880
path: package-temp-dir
@@ -82,10 +84,10 @@ jobs:
8284
uses: actions/cache@v2
8385
with:
8486
path: node_modules
85-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
87+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
8688

8789
- name: compile
88-
run: npm run compile
90+
run: pnpm compile
8991

9092
needs: setup
9193

@@ -95,7 +97,7 @@ jobs:
9597
- name: checkout
9698
uses: actions/checkout@master
9799

98-
- name: restore cache from package-lock.json
100+
- name: restore cache from pnpm-lock.yaml
99101
uses: actions/cache@v2
100102
with:
101103
path: package-temp-dir
@@ -105,9 +107,9 @@ jobs:
105107
uses: actions/cache@v2
106108
with:
107109
path: node_modules
108-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110+
key: node_modules-${{ hashFiles('**/package-temp-dir/pnpm-lock.yaml') }}
109111

110112
- name: coverage
111-
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)
113+
run: pnpm test:coverage && bash <(curl -s https://codecov.io/bash)
112114

113115
needs: setup

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-field-form",
3-
"version": "1.29.1",
3+
"version": "2.0.0",
44
"type": "module",
55
"description": "React Form Component",
66
"engines": {
@@ -35,6 +35,7 @@
3535
"start": "export NODE_OPTIONS=--openssl-legacy-provider && dumi dev",
3636
"docs:build": "export NODE_OPTIONS=--openssl-legacy-provider && dumi build",
3737
"docs:deploy": "gh-pages -d docs-dist",
38+
"build": "pnpm compile",
3839
"compile": "father-build",
3940
"deploy": "pnpm run docs:build && pnpm run docs:deploy",
4041
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
@@ -53,7 +54,7 @@
5354
"dependencies": {
5455
"@babel/runtime": "^7.18.0",
5556
"async-validator": "^4.1.0",
56-
"rc-util": "^5.8.0"
57+
"rc-util": "^5.29.3"
5758
},
5859
"devDependencies": {
5960
"@testing-library/jest-dom": "^5.16.4",
@@ -63,29 +64,30 @@
6364
"@types/jest": "^29.2.5",
6465
"@types/lodash": "^4.14.135",
6566
"@types/node": "^18.15.11",
66-
"@types/react": "^18.0.0",
67+
"@types/react": "^18.0.32",
6768
"@types/react-dom": "^18.0.0",
6869
"@umijs/fabric": "^2.5.2",
6970
"@umijs/test": "4.0.61",
7071
"@vitejs/plugin-react": "^3.1.0",
71-
"@vitest/ui": "^0.29.3",
72+
"@vitest/coverage-c8": "^0.29.8",
73+
"@vitest/ui": "^0.29.8",
7274
"dumi": "^1.1.0",
7375
"eslint": "^7.18.0",
7476
"father": "4.1.7",
7577
"father-build": "^1.18.6",
7678
"gh-pages": "^3.1.0",
7779
"jest": "^29.3.1",
7880
"np": "^5.0.3",
79-
"prettier": "^2.1.2",
81+
"prettier": "^2.8.7",
8082
"react": "18.2.0",
8183
"react-dnd": "^8.0.3",
8284
"react-dnd-html5-backend": "^8.0.3",
8385
"react-dom": "18.2.0",
8486
"react-redux": "^4.4.10",
8587
"redux": "^3.7.2",
8688
"ts-node": "^10.9.1",
87-
"typescript": "5.0.2",
88-
"vite": "^4.2.0",
89-
"vitest": "^0.29.3"
89+
"typescript": "5.0.3",
90+
"vite": "^4.2.1",
91+
"vitest": "^0.29.8"
9092
}
9193
}

0 commit comments

Comments
 (0)