Skip to content

Commit 72d07e1

Browse files
hyriousBlackHole1
andauthored
chore(project): migrate to pnpm (netless-io#1442)
* chore(project): migrate to pnpm * Update .github/workflows/check-code.yml Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update .github/workflows/deploy-storybook.yml Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update .github/workflows/deploy-web-dev-cn.yml Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update .github/workflows/deploy-web-dev-us.yml Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update .github/workflows/deploy-web-prod-cn.yml Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update .github/workflows/deploy-web-prod-us.yml Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update cspell.config.js Co-authored-by: Black-Hole <158blackhole@gmail.com> * Update ci scripts Co-authored-by: Black-Hole <158blackhole@gmail.com>
1 parent 61e2327 commit 72d07e1

43 files changed

Lines changed: 18965 additions & 17673 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslint.common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const eslintCommon = {
22
base: {
33
parser: "@typescript-eslint/parser",
44
parserOptions: {
5-
project: "tsconfig.json",
5+
project: ["./tsconfig.json"],
66
ecmaVersion: 2018,
77
sourceType: "module",
88
},
@@ -12,7 +12,7 @@ const eslintCommon = {
1212
"plugin:@typescript-eslint/recommended",
1313
"plugin:@typescript-eslint/recommended-requiring-type-checking",
1414
"plugin:prettier/recommended",
15-
"plugin:eslint-comments/recommended"
15+
"plugin:eslint-comments/recommended",
1616
],
1717
plugins: ["@netless", "prettier", "@typescript-eslint", "eslint-comments"],
1818
rules: {
@@ -239,8 +239,8 @@ const eslintCommon = {
239239
ignore: [],
240240
},
241241
],
242-
'react/jsx-sort-props': [
243-
'error',
242+
"react/jsx-sort-props": [
243+
"error",
244244
{
245245
callbacksLast: true,
246246
shorthandFirst: true,

.github/workflows/check-code.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ jobs:
5050
flat-web:
5151
- 'web/flat-web/**/*.(ts|tsx)'
5252
53-
- name: Install NodeJS
54-
uses: actions/setup-node@v2
53+
- name: Install PNPM
54+
uses: pnpm/action-setup@v2.0.1
5555
with:
56-
node-version: "16"
56+
version: latest
57+
run_install: true
5758

5859
- name: Install changed package dependencies and build packages
5960
run: |-
6061
if node ./scripts/ci/install-changed-package-dependencies.js; then
6162
# failure automatically retries 3 times
62-
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
63+
pnpm bootstrap || pnpm bootstrap || pnpm bootstrap
6364
fi
6465
env:
6566
components: ${{ steps.filter.outputs.components }}
@@ -69,15 +70,15 @@ jobs:
6970
flatWeb: ${{ steps.filter.outputs.flat-web }}
7071

7172
- name: Build renderer
72-
run: yarn workspace renderer-app build
73+
run: pnpm --filter renderer-app build
7374
if: steps.filter.outputs.renderer == 'true'
7475

7576
- name: Build main
76-
run: yarn workspace flat build
77+
run: pnpm --filter flat build
7778
if: steps.filter.outputs.main == 'true'
7879

7980
- name: Build flat-web
80-
run: yarn workspace flat-web build
81+
run: pnpm --filter flat-web build
8182
if: steps.filter.outputs.flat-web == 'true'
8283

8384
- name: Check i18n

.github/workflows/check-spell.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
node-version: "16"
2020

2121
- name: Install cspell
22-
run: yarn global add cspell
22+
run: npm i -g cspell
2323

2424
- name: Check cspell
25-
run: yarn run check-spelling
25+
run: npm run check-spelling

.github/workflows/deploy-storybook.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v2
1616

17-
- name: Install NodeJS
18-
uses: actions/setup-node@v2
17+
- name: Install PNPM
18+
uses: pnpm/action-setup@v2.0.1
1919
with:
20-
node-version: "16"
20+
version: latest
21+
run_install: true
2122

2223
- uses: actions/cache@v2
23-
id: yarn-cache
24+
id: pnpm-cache
2425
with:
25-
key: yarn-storybook-v1-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
26+
key: pnpm-storybook-v1-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
2627
path: |
2728
./node_modules
2829
./packages/**/node_modules
@@ -31,19 +32,19 @@ jobs:
3132
run: |-
3233
if node ./scripts/ci/install-changed-package-dependencies.js; then
3334
# failure automatically retries 3 times
34-
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
35+
pnpm bootstrap || pnpm bootstrap || pnpm bootstrap
3536
fi
3637
env:
3738
components: true
38-
if: steps.yarn-cache.outputs.cache-hit != 'true'
39+
if: steps.pnpm-cache.outputs.cache-hit != 'true'
3940

4041
- name: Build Types
4142
# it must be added here, otherwise when the cache matches, there will be flat-types not found
42-
run: yarn workspace flat-types build
43-
if: steps.yarn-cache.outputs.cache-hit == 'true'
43+
run: pnpm --filter flat-types build
44+
if: steps.pnpm-cache.outputs.cache-hit == 'true'
4445

4546
- name: Build Storybook
46-
run: yarn workspace flat-components build
47+
run: pnpm --filter flat-components build
4748

4849
- name: Deploy Storybook
4950
uses: peaceiris/actions-gh-pages@v3

.github/workflows/deploy-web-dev-cn.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v2
2323

24+
- name: Install PNPM
25+
uses: pnpm/action-setup@v2.0.1
26+
with:
27+
version: latest
28+
run_install: true
29+
2430
- name: Install dependencies
2531
run: |
2632
node ./scripts/ci/remove-workspace-packages.js web
2733
node ./scripts/ci/remove-package-scripts-hooks.js
2834
# failure automatically retries 3 times
29-
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
35+
pnpm bootstrap || pnpm bootstrap || pnpm bootstrap
3036
3137
- name: Build flat web development
32-
run: yarn workspace flat-web build:cn -m development
38+
run: pnpm --filter flat-web build:cn -m development
3339

3440
- name: Log in to Docker Hub
3541
uses: docker/login-action@v1

.github/workflows/deploy-web-dev-us.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v2
2323

24+
- name: Install PNPM
25+
uses: pnpm/action-setup@v2.0.1
26+
with:
27+
version: latest
28+
run_install: true
29+
2430
- name: Install dependencies
2531
run: |
2632
node ./scripts/ci/remove-workspace-packages.js web
2733
node ./scripts/ci/remove-package-scripts-hooks.js
2834
# failure automatically retries 3 times
29-
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
35+
pnpm bootstrap || pnpm bootstrap || pnpm bootstrap
3036
3137
- name: Build flat web development
32-
run: yarn workspace flat-web build:us -m development
38+
run: pnpm --filter flat-web build:us -m development
3339

3440
- name: Log in to Docker Hub
3541
uses: docker/login-action@v1

.github/workflows/deploy-web-prod-cn.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v2
2323

24+
- name: Install PNPM
25+
uses: pnpm/action-setup@v2.0.1
26+
with:
27+
version: latest
28+
run_install: true
29+
2430
- name: Install dependencies
2531
run: |
2632
node ./scripts/ci/remove-workspace-packages.js web
2733
node ./scripts/ci/remove-package-scripts-hooks.js
2834
# failure automatically retries 3 times
29-
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
35+
pnpm bootstrap || pnpm bootstrap || pnpm bootstrap
3036
3137
- name: Build flat web production
32-
run: yarn workspace flat-web build:cn -m production
38+
run: pnpm --filter flat-web build:cn -m production
3339

3440
- name: Log in to Docker Hub
3541
uses: docker/login-action@v1

.github/workflows/deploy-web-prod-us.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v2
2323

24+
- name: Install PNPM
25+
uses: pnpm/action-setup@v2.0.1
26+
with:
27+
version: latest
28+
run_install: true
29+
2430
- name: Install dependencies
2531
run: |
2632
node ./scripts/ci/remove-workspace-packages.js web
2733
node ./scripts/ci/remove-package-scripts-hooks.js
2834
# failure automatically retries 3 times
29-
yarn run bootstrap || yarn run bootstrap || yarn run bootstrap
35+
pnpm bootstrap || pnpm bootstrap || pnpm bootstrap
3036
3137
- name: Build flat web production
32-
run: yarn workspace flat-web build:us -m production
38+
run: pnpm --filter flat-web build:us -m production
3339

3440
- name: Log in to Docker Hub
3541
uses: docker/login-action@v1

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn run check-spelling
5-
yarn run lint
4+
pnpm check-spelling
5+
pnpm lint

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
"directory": "packages/flat-types",
3232
"changeProcessCWD": true
3333
}
34-
]
34+
],
35+
"typescript.tsdk": "node_modules/typescript/lib"
3536
}

0 commit comments

Comments
 (0)