-
Notifications
You must be signed in to change notification settings - Fork 563
chore: Move from yarn to pnpm (WIP) #2590
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
Changes from 244 commits
364d270
0486d0a
75f402e
c3e0f40
ef6026f
3e062f1
e3c00e8
e2a68cd
08a5ce8
ed33ac1
b0c6b0c
8ce4b9d
1297af8
bf4137e
23f2c47
dbbaf82
36c868b
7d33f24
f53272d
2a797fa
f43391e
4dbb699
4eebea8
69bc225
c07f47d
23738dd
541bcd9
46e4635
eac64f6
a52cb2a
7d9f331
79bbad8
d313ede
748d486
538cd77
5d22ace
7546cd0
7345aa8
b3188ec
fe6eac6
2708425
a01d23b
b55ef76
8c67153
38c891f
20ba054
57dced9
c1d1c41
07c209d
61b0874
6d09d60
a4d3ffd
5507a0a
128f707
335761a
f2a0b59
8b75445
bfa7428
2aae424
ce31d86
3eb98fd
edc1e6a
8edfe70
12e0069
ec0ef77
ec6491d
97aaeb1
b6388a6
ea6a24d
f420ee6
b79b38f
e14e8a4
eb00ea1
0912da0
7a33de0
08d27f0
85fe659
5cff551
85122d3
1cc34c8
933729d
81937af
140600c
0a375d1
fd041c8
4e60619
0a68eee
4d5ce04
be55845
3b895fb
9ca040f
8a2ebe5
8e4b129
0a7c3f4
5e41947
60f0389
1cfee05
349333f
7d37fa2
4549712
422a490
e169fa5
083f84a
ffe7747
ce77ac0
8959b98
bba1053
852be16
3e42b1f
8018be9
ab45299
7ea2bc8
7ded78b
c15ad90
19d64c6
89bd5c3
de1069f
7a216f0
d57a62c
6ef9214
6c1294a
5965d67
97175b1
91dafba
a299199
7fdaa38
91ff912
f8da835
c84a3c2
515f809
8a3b94e
14adc98
eb3aa3d
c7d1d46
056e6d9
98fb668
f6ffd64
1d77119
b9c1850
439cd8b
ef60455
0f7c701
c9619a4
82bf88c
678f4d7
fe82c73
daffa03
748fd9c
e394f7c
c913211
3e0e448
6cebf00
f45c96f
5f37257
716cfa8
4b2a7ca
ad245fc
37a4641
503fda4
1ebcc0d
f9ec2d6
c14ef1c
2d5f097
626f972
1b9542e
7d71c4c
4b9d8f5
878ce9b
a050942
01a391f
b489e56
482471e
db43759
0f6ae73
adfe31a
7e624a1
9ba38a9
04b0147
57bff5b
e6d0543
df207ef
27cb9dd
4eee7e4
dd8f798
e7dbdc9
da32914
cb86285
fe842f5
e136cf2
05ad68e
0e79e01
55178ed
f3b3a7a
d934bd9
85ecbeb
ed8c867
1a4372d
59f8357
5c8e1f0
263006f
4de462c
09ad150
7576581
ae311e0
c031057
972b9e4
a015d7d
c764516
39532cd
37cbef2
8037ee2
31f6c7d
c8b6b28
c2f2b24
47716d3
eed1b85
6ac5d46
f5fc6be
9fd6da5
2e4507a
f6dd5e5
d4641a1
8e52183
636d3be
837c3c4
62d8284
004825f
c805edb
c5dc44a
f9d19c6
0b0ebee
b8de989
c3a9a88
860da13
ee3d81c
10f52a9
7864d37
431d481
b5dbdb0
c775f38
f2c874d
74b0283
db658d2
e26f401
e51511f
ef64443
9da677d
1643ac7
bcd0098
6efd3e7
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,7 +49,7 @@ jobs: | |
run: | | ||
export VERSION=${{ steps.branch_env.outputs.version }} | ||
sudo gem install --no-document fpm | ||
git clone https://github.com/api7/apisix-build-tools.git | ||
git clone https://github.com/FangSen9000/apisix-build-tools.git | ||
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. Note that we should let the API7 community merge my changes to the build script before merging this pr. |
||
|
||
# move codes under build tool | ||
mkdir ./apisix-build-tools/apisix-dashboard | ||
|
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 | ||
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. Have you checked out this https://github.com/pnpm/action-setup? I think this might be a little better. But, anyway, let's run through the test first. 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. Let me first say a good news. Yesterday's problem has been solved. The reason is that he didn't use Chrome browser to run it. Just add a setting. `"For example, I just found that it seems that many errors in file format are related to yarn. Many workflow files have been perfected around this. Then, the pnpm directly downloaded by GitHub does not seem to support node.js12. It describes that the downloaded pnpm does not support NPM below 14 (in fact, you can install a low-level package and ask him to support it, but it feels that it will be troublesome. I am afraid there are more problems.) Only 14 and 16 can be built when building tests. " "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 haven't started to look at it. I'm afraid this is also very troublesome. 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."` @SkyeYoung I mentioned this problem. You can look at the pictures. If anyone can solve it, it's best. |
||
|
||
- name: Setup golang environment | ||
uses: actions/setup-go@v3 | ||
|
@@ -84,14 +85,19 @@ jobs: | |
cypress-${{ runner.os }}-cypress-cache0 | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
run: pnpm install | ||
|
||
- name: Install Cypress binary | ||
run: pnpx cypress install | ||
|
||
- run: pnpx browserslist@latest --update-db | ||
|
||
- name: Start frontend then test | ||
run: | | ||
yarn start-server-and-test 'cross-env SERVE_ENV=test yarn start' http-get://localhost:8000 'cross-env CYPRESS_SERVE_ENV=test yarn cypress run --spec "**/integration/${{matrix.folderPrefix}}/**.spec.js"' | ||
pnpm start-server-and-test 'cross-env SERVE_ENV=test pnpm start' http-get://localhost:8000 'cross-env CYPRESS_SERVE_ENV=test pnpm cypress run --browser chrome --spec "**/integration/${{matrix.folderPrefix}}/**.spec.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] | ||
|
||
- 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 --frozen-lockfile | ||
|
||
- 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] | ||
|
||
- 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 | ||
|
||
- 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 \ | ||
&& 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\" --syntax 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/integration/plugin/*.spec.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/integration/plugin/*.spec.js'" | ||
}, | ||
"license": "Apache-2.0", | ||
"lint-staged": { | ||
"**/*.less": "stylelint --syntax less", | ||
"**/*.{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,16 +56,21 @@ | |
"@ant-design/pro-table": "2.30.1", | ||
"@antv/x6": "^1.18.5", | ||
"@antv/x6-react-components": "^1.1.7", | ||
"@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", | ||
"base-64": "^1.0.0", | ||
"classnames": "^2.2.6", | ||
"dayjs": "1.8.28", | ||
"core-js": "^2.5.7", | ||
"dayjs": "1.8.30", | ||
"dva-core": "1.6.0-beta.7", | ||
"file-saver": "^2.0.5", | ||
"js-beautify": "^1.13.0", | ||
"js-yaml": "^4.0.0", | ||
|
@@ -75,18 +81,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": "^1.0.2", | ||
"use-merge-value": "^1.0.1", | ||
"uuid": "7.0.3", | ||
"webpack": "^4.40.0 || ^5.0.0", | ||
"yaml": "^1.10.0" | ||
}, | ||
"devDependencies": { | ||
|
Uh oh!
There was an error while loading. Please reload this page.