-
Notifications
You must be signed in to change notification settings - Fork 563
chore: Move yarn to pnpm #2604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Move yarn to pnpm #2604
Changes from 30 commits
cd17fea
94928d3
06c438f
3dd6109
57df6ad
1328488
a11943f
7c0d89a
3e9bf83
eab805d
93ef342
5fef10f
17cb86b
be30722
17dc652
2c54fef
e3f114d
53e3c8d
cb0a45f
2164faa
d9d3bdc
678e139
85937fb
117a2de
a258eea
8c7c6bd
93d4b23
5df7229
e2641e5
1fb791d
ea83476
0878792
97af1fc
f689e8d
9130c10
45b7d3e
7f7786b
453bcb4
785180c
f873f36
c7a4726
b6fbb48
bac32dc
d5e1c45
2476bd5
204a3b9
641b90f
69be028
4c7855c
00fd7f6
6accb34
10ceb13
08ed679
9a1812b
575b007
b2312a4
05e57aa
a4a8bdd
c209f99
f23fa76
85d71d6
c93d567
0dcb9ac
d0e1fd9
a3b2a9d
2aee729
a225ec6
d7295b1
65480b2
fe3c341
558e3a4
4346c2a
1b1206c
2751be2
b911921
78d2eab
236e3f7
2375aee
b4abf33
f78e3c8
dea9f69
0246d88
7748e4a
2e98aa8
0b4e66b
7bde01f
85c720a
c2105d5
29f5586
b2878f5
b482692
29817c8
7c30462
66d0836
ac50696
975cd0d
2952e0b
efe90e3
b4d666e
2d1b4b5
edb904c
1aae1df
e6f7f9e
4563bd3
6fdbf1b
d19e438
ba1c0db
b4bf627
11c65c1
9052ecd
45d50a3
552edab
936f7f5
6ef56dd
e2f8181
41dc4d4
21ab4fc
4cfe3ca
e87a8bc
ee4a718
41cc5a5
d0a18fd
7e8eb5b
24529b6
9ee507d
1253061
2caa710
b730fca
39e25f6
13ecc59
9ab7b58
00a3cfb
dcf1a8e
cdbe91e
a7d83c7
d1197bd
4bddeb9
96affb3
3d7bf4b
dcdb3cc
0ad1e48
0d2eecb
c7ff463
9f120c6
239a31f
f14b4b8
97832e6
c886d82
445487c
271cbba
b46ee7d
e1bba62
c621134
01380f1
fd99aa3
99c2eb9
602a12c
2516e77
edabeed
93ce28a
adfdaef
42c11b7
9228bdf
fd62a33
6f86430
deceec8
4e5860b
b2a8ca7
9722934
b0ac028
468d8b0
7178fc7
cec9ea8
7a1b82b
f179683
e798cd0
ed35abd
6223ab1
89b9765
4eb5d12
e61e2a1
fdbfa8a
0889460
e9456c9
a639746
88e4b74
a8c296c
3210085
eced43d
a901f9a
b8fc8a8
fc69afc
05709da
7e8eebf
ef421e2
8955c71
c536d25
033de5f
165e5f0
ce3164d
87cc0e0
8bb67ff
9bc3dea
6c1aed7
568ac90
94ba302
553aa2f
1906ed6
46b3317
be6fdb2
5092482
685cdbb
7ed8c55
fa55b55
5df4f2b
8368387
ba69837
2035651
4d4d3f7
90e8565
e07498d
73d4171
4b089ea
57a1f0e
afafbf9
caa5898
6edea66
0c693f7
a782da6
eade5ad
7c32367
f01c6e6
d5443df
c40d5f1
d8f4d6c
9aceeac
63c2819
c6da4d1
063f34c
6beecf8
e10f118
06b0a96
eedf05d
9bb9fa0
79976c3
175d457
e14844a
590695a
730d835
1983667
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,9 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'yarn' | ||
cache-dependency-path: web/yarn.lock | ||
|
||
- name: Install PNPM | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not use the officially provided There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "When downloading the relevant environment, it seems that there are some restrictions. Maybe it can be solved by storing it in the warehouse through some link, but I don‘t find it. This picture is the reason why the three people are useless. Action is prohibited. It clearly meets the requirements he said, but it can't be used."` @guoqqqi You can look at the pictures. If anyone can solve it, it's best. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, it seems to be due to some permissions of the Apache repository.🤣 |
||
run: npm i -g [email protected] | ||
|
||
- name: Setup golang environment | ||
uses: actions/setup-go@v3 | ||
|
@@ -84,14 +85,20 @@ jobs: | |
cypress-${{ runner.os }}-cypress-cache0 | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
run: pnpm install --unsafe-perm | ||
|
||
- name: Install Cypress binary | ||
run: pnpx cypress install | ||
|
||
- run: pnpx browserslist@latest --update-db | ||
- run: npx browserslist@latest --update-db | ||
|
||
- name: Start frontend then test | ||
run: | | ||
yarn start-server-and-test 'cross-env SERVE_ENV=test UMI_UI=none MOCK=none SERVE_URL_TEST=http://localhost:9000 yarn start' http-get://localhost:8000 'cross-env CYPRESS_SERVE_ENV=test SERVE_URL_TEST=http://localhost:9000 yarn cypress run --spec "**/e2e/${{matrix.folderPrefix}}/**.cy.js"' | ||
pnpm start-server-and-test 'cross-env SERVE_ENV=test UMI_UI=none MOCK=none SERVE_URL_TEST=http://localhost:9000 pnpm start' http-get://localhost:8000 'cross-env CYPRESS_SERVE_ENV=test SERVE_URL_TEST=http://localhost:9000 pnpm cypress run --spec "**/e2e/${{matrix.folderPrefix}}/**.cy.js"' | ||
|
||
- name: Report e2e coverage | ||
run: npx nyc report --reporter=text-summary | ||
run: pnpx nyc report --reporter=text-summary | ||
|
||
- name: Upload coverage to Codecov | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,16 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'yarn' | ||
cache-dependency-path: web/yarn.lock | ||
|
||
- name: Install PNPM | ||
run: npm i -g [email protected] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
- name: Change the NPM Settings for PNPM | ||
run: npm config set strict-peer-dependencies=false | ||
- run: npm config set auto-install-peers=true | ||
|
||
- name: Install dependencies | ||
run: pnpm install --unsafe-perm | ||
|
||
- name: Setup golang environment | ||
uses: actions/setup-go@v3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,18 +37,23 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
cache-dependency-path: web/yarn.lock | ||
|
||
- name: Install PNPM | ||
run: npm i -g [email protected] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
- name: Change the NPM Settings for PNPM | ||
run: npm config set strict-peer-dependencies=false | ||
- run: npm config set auto-install-peers=true | ||
|
||
# Install dependencies | ||
- name: Install dependencies | ||
working-directory: web | ||
run: CYPRESS_INSTALL_BINARY=0 yarn | ||
run: CYPRESS_INSTALL_BINARY=0 pnpm install --unsafe-perm | ||
|
||
- name: Lint | ||
working-directory: web | ||
run: yarn run lint:js && yarn run lint:style | ||
run: pnpm lint:js && pnpm lint:style | ||
|
||
- name: Build the Dashboard | ||
working-directory: web | ||
run: yarn build | ||
run: pnpm build |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ ARG APISIX_DASHBOARD_VERSION=master | |
|
||
RUN set -x \ | ||
&& apk add --no-cache --virtual .builddeps git \ | ||
&& git clone https://github.com/apache/apisix-dashboard.git -b ${APISIX_DASHBOARD_VERSION} /usr/local/apisix-dashboard \ | ||
&& git clone https://github.com/FangSen9000/apisix-dashboard.git -b ${APISIX_DASHBOARD_VERSION} /usr/local/apisix-dashboard \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I keep it as it is, the original warehouse that has not been changed will only report an error. In order to prove that my change is effective, I link to my changed warehouse. Just like RPM workflow. Before merging, please remind me to change it back. |
||
&& cd /usr/local/apisix-dashboard && git clean -Xdf \ | ||
&& rm -f ./.githash && git log --pretty=format:"%h" -1 > ./.githash | ||
|
||
|
@@ -46,9 +46,15 @@ COPY --from=pre-build /usr/local/apisix-dashboard . | |
|
||
WORKDIR /usr/local/apisix-dashboard/web | ||
|
||
RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config set registry https://registry.npmmirror.com/ ; fi \ | ||
&& yarn install \ | ||
&& yarn build | ||
RUN npm i pnpm -g | ||
|
||
RUN npm config set strict-peer-dependencies=false | ||
|
||
RUN npm config set auto-install-peers=true | ||
|
||
RUN if [ "$ENABLE_PROXY" = "true" ] ; then pnpm config set registry https://registry.npmmirror.com/ ; fi \ | ||
&& pnpm install --unsafe-perm \ | ||
&& pnpm build | ||
|
||
FROM alpine:latest as prod | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
. "$(dirname "$0")/_/husky.sh" | ||
|
||
cd web | ||
yarn lint-staged | ||
pnpm lint-staged |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,6 @@ Dockerfile* | |
LICENSE | ||
.eslintcache | ||
*.lock | ||
yarn-error.log | ||
pnpm-error.log | ||
.history | ||
CNAME |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,41 +5,42 @@ | |
"description": "Dashboard for Apache APISIX", | ||
"scripts": { | ||
"prepare": "cd .. && husky install web/.husky", | ||
"analyze": "cross-env ANALYZE=1 yarn run build", | ||
"build": "cp -R ./node_modules/monaco-editor ./public/ && umi build", | ||
"dev": "yarn run start:dev", | ||
"fetch:blocks": "pro fetch-blocks --branch antd@4 && yarn run prettier", | ||
"analyze": "cross-env ANALYZE=1 pnpm run build", | ||
"build": "cp -R ./node_modules/.pnpm/[email protected]/node_modules/monaco-editor ./public/ && umi build", | ||
"dev": "pnpm run start:dev", | ||
"fetch:blocks": "pro fetch-blocks --branch antd@4 && pnpm run prettier", | ||
"i18n-remove": "pro i18n-remove --locale=zh-CN --write", | ||
"postinstall": "umi g tmp", | ||
"lint": "umi g tmp && yarn run lint:js && yarn run lint:style && yarn run lint:prettier", | ||
"lint": "umi g tmp && pnpm run lint:js && pnpm run lint:style && pnpm run lint:prettier", | ||
"lint-staged": "lint-staged", | ||
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", | ||
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && yarn run lint:style", | ||
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && pnpm run lint:style", | ||
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", | ||
"lint:prettier": "prettier --check \"**/*\" --end-of-line auto", | ||
"lint:style": "stylelint --fix \"src/**/*.less\"", | ||
"prettier": "prettier -c --write \"**/*\"", | ||
"site": "yarn run fetch:blocks && yarn run build", | ||
"start": "cp -R ./node_modules/monaco-editor ./public/ && umi dev", | ||
"start:e2e": "cross-env SERVE_ENV=test yarn run start", | ||
"test:e2e": "start-server-and-test 'cross-env SERVE_ENV=test yarn start' http-get://localhost:8000 cypress:run-ci", | ||
"test-plugin:e2e": "start-server-and-test 'cross-env SERVE_ENV=test yarn start' http-get://localhost:8000 cypress:run-plugin-ci", | ||
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none yarn run start", | ||
"start:no-mock": "cross-env MOCK=none yarn run start", | ||
"start:no-ui": "cross-env UMI_UI=none yarn run start", | ||
"start:pre": "cross-env REACT_APP_ENV=pre yarn run start", | ||
"start:test": "cross-env REACT_APP_ENV=test MOCK=none yarn run start", | ||
"site": "pnpm run fetch:blocks && pnpm run build", | ||
"start": "cp -R ./node_modules/.pnpm/[email protected]/node_modules/monaco-editor ./public/ && umi dev", | ||
"start:umi-dev": "umi dev", | ||
"start:e2e": "cross-env SERVE_ENV=test pnpm run start", | ||
"test:e2e": "start-server-and-test 'cross-env SERVE_ENV=test pnpm start' http-get://localhost:8000 cypress:run-ci", | ||
"test-plugin:e2e": "start-server-and-test 'cross-env SERVE_ENV=test pnpm start' http-get://localhost:8000 cypress:run-plugin-ci", | ||
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none pnpm run start", | ||
"start:no-mock": "cross-env MOCK=none pnpm run start", | ||
"start:no-ui": "cross-env UMI_UI=none pnpm run start", | ||
"start:pre": "cross-env REACT_APP_ENV=pre pnpm run start", | ||
"start:test": "cross-env REACT_APP_ENV=test MOCK=none pnpm run start", | ||
"test:component": "umi test ./src/components", | ||
"tsc": "tsc", | ||
"cypress:open": "cross-env CYPRESS_SERVE_ENV=test cypress open", | ||
"cypress:open-dev": "cross-env CYPRESS_SERVE_ENV=dev cypress open", | ||
"cypress:run-ci": "cross-env CYPRESS_SERVE_ENV=test cypress run", | ||
"cypress:run-plugin-ci": "cross-env CYPRESS_SERVE_ENV=test cypress run --spec 'cypress/e2e/plugin/*.cy.js'" | ||
"cypress:run-ci": "cross-env CYPRESS_SERVE_ENV=test cypress run --browser chrome", | ||
"cypress:run-plugin-ci": "cross-env CYPRESS_SERVE_ENV=test cypress run --browser chrome --spec 'cypress/e2e/plugin/*.cy.js'" | ||
}, | ||
"license": "Apache-2.0", | ||
"lint-staged": { | ||
"**/*.less": "stylelint", | ||
"**/*.{js,jsx,ts,tsx}": "yarn run lint-staged:js", | ||
"**/*.{js,jsx,ts,tsx}": "pnpm run lint-staged:js", | ||
"**/*.{js,jsx,tsx,ts,less,md,json}": [ | ||
"prettier --write" | ||
] | ||
|
@@ -55,17 +56,25 @@ | |
"@ant-design/pro-table": "2.30.1", | ||
"@antv/x6": "^1.18.5", | ||
"@antv/x6-react-components": "^1.1.7", | ||
"@babel/core": "^7.0.1", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/runtime-corejs2": "^7.10.3", | ||
"@monaco-editor/react": "^4.3.1", | ||
"@rjsf/antd": "2.2.0", | ||
"@rjsf/core": "2.2.0", | ||
"@types/js-yaml": "^4.0.0", | ||
"@umijs/route-utils": "^2.2.0", | ||
"ajv": "^7.0.3", | ||
"ajv-formats": "^1.5.1", | ||
"antd": "^4.4.0", | ||
"antd-dayjs-webpack-plugin": "1.0.0", | ||
"babel-loader": "^8.0.2", | ||
"base-64": "^1.0.0", | ||
"classnames": "^2.2.6", | ||
"dayjs": "1.8.28", | ||
"core-js": "^2.5.7", | ||
"dayjs": "1.8.30", | ||
"dotenv": "^16.0.1", | ||
"dva-core": "1.6.0-beta.7", | ||
"file-saver": "^2.0.5", | ||
"js-beautify": "^1.13.0", | ||
"js-yaml": "^4.0.0", | ||
|
@@ -76,17 +85,25 @@ | |
"path-to-regexp": "2.4.0", | ||
"qs": "^6.9.0", | ||
"query-string": "^6.13.7", | ||
"re2": "^1.15.4", | ||
"react": "^16.8.6", | ||
"react-copy-to-clipboard": "^5.0.3", | ||
"react-device-detect": "^1.12.1", | ||
"react-dom": "^16.8.6", | ||
"react-helmet-async": "^1.0.4", | ||
"react-is": ">= 16.8.0", | ||
"react-router": "^4.3.1 || ^5.0.0", | ||
"redbox-react": "1.x", | ||
"redux": "4.x", | ||
"start-server-and-test": "^1.11.5", | ||
"styled-components": "^5.2.1", | ||
"typescript": ">= 2.7", | ||
"umi": "^3.1.2", | ||
"umi-request": "^1.0.8", | ||
"url-regex-safe": "^3.0.0", | ||
"use-merge-value": "^1.0.1", | ||
"uuid": "7.0.3", | ||
"webpack": "^4.40.0 || ^5.0.0", | ||
"yaml": "^1.10.0" | ||
}, | ||
"devDependencies": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we should let the API7 community merge my changes to the build script before merging this pr.
api7/apisix-build-tools#232
(if I keep it as it is, the original warehouse that has not been changed will only report an error. In order to prove that my changes are effective, I link to my modified build script warehouse.)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BZP told me that the build tool can be changed after the dashboard is merged.
I think we can also do this. After all, it only affects the detection of RPM packaging workflow.