optimize: 包管理工具,使用 `pnpm` 替换掉 `lerna` (#395)
parent
8bb2d62c45
commit
1a3918b402
|
@ -17,17 +17,26 @@ jobs:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
- macos
|
- macos
|
||||||
node:
|
node:
|
||||||
- 16
|
- 22
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout'
|
- name: 'Checkout'
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: 'Setup Node.js environment'
|
- name: 'Setup Node.js "${{ matrix.node }}.x" environment'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
registry-url: https://npm.pkg.github.com/
|
registry-url: https://npm.pkg.github.com/
|
||||||
|
|
||||||
|
- name: 'Setup pnpm'
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
|
- name: 'Setup Python environment (Mac) Because of electron-builder install-app-deps requires Python setup tools'
|
||||||
|
if: matrix.os == 'macos'
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
- name: 'Get package info'
|
- name: 'Get package info'
|
||||||
id: package-info
|
id: package-info
|
||||||
uses: luizfelipelaviola/get-package-info@v1
|
uses: luizfelipelaviola/get-package-info@v1
|
||||||
|
@ -41,19 +50,7 @@ jobs:
|
||||||
echo "github.ref = ${{ github.ref }}";
|
echo "github.ref = ${{ github.ref }}";
|
||||||
echo "github.ref_name = ${{ github.ref_name }}";
|
echo "github.ref_name = ${{ github.ref_name }}";
|
||||||
|
|
||||||
- name: 'npm install -g lerna@6/yarn'
|
- name: 'npm -v | pnpm -v | python --version'
|
||||||
run: |
|
|
||||||
echo "======================================================================";
|
|
||||||
echo "npm install -g lerna@6";
|
|
||||||
echo "--------------------";
|
|
||||||
npm install -g lerna@6;
|
|
||||||
|
|
||||||
echo "======================================================================";
|
|
||||||
echo "npm install -g yarn";
|
|
||||||
echo "--------------------";
|
|
||||||
npm install -g yarn;
|
|
||||||
|
|
||||||
- name: 'npm -v | yarn -v | lerna -v'
|
|
||||||
run: |
|
run: |
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "npm -v";
|
echo "npm -v";
|
||||||
|
@ -61,24 +58,24 @@ jobs:
|
||||||
npm -v;
|
npm -v;
|
||||||
|
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "yarn -v";
|
echo "pnpm -v";
|
||||||
echo "--------------------";
|
echo "--------------------";
|
||||||
yarn -v;
|
pnpm -v;
|
||||||
|
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "lerna -v";
|
echo "python --version";
|
||||||
echo "--------------------";
|
echo "--------------------";
|
||||||
lerna -v;
|
python --version;
|
||||||
|
|
||||||
- name: 'lerna bootstrap'
|
- name: 'pnpm install'
|
||||||
run: |
|
run: |
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
dir || ls -lah;
|
dir || ls -lah;
|
||||||
|
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "lerna bootstrap --npm-client=yarn";
|
echo "pnpm install";
|
||||||
echo "--------------------";
|
echo "--------------------";
|
||||||
lerna bootstrap --npm-client=yarn;
|
pnpm install;
|
||||||
|
|
||||||
- name: 'npm run electron:build'
|
- name: 'npm run electron:build'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -22,17 +22,26 @@ jobs:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
- macos
|
- macos
|
||||||
node:
|
node:
|
||||||
- 16
|
- 22
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout'
|
- name: 'Checkout'
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: 'Setup Node.js environment'
|
- name: 'Setup Node.js "${{ matrix.node }}.x" environment'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
registry-url: https://npm.pkg.github.com/
|
registry-url: https://npm.pkg.github.com/
|
||||||
|
|
||||||
|
- name: 'Setup pnpm'
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
|
- name: 'Setup Python environment (Mac) Because of electron-builder install-app-deps requires Python setup tools'
|
||||||
|
if: matrix.os == 'macos'
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
- name: 'Get package info'
|
- name: 'Get package info'
|
||||||
id: package-info
|
id: package-info
|
||||||
uses: luizfelipelaviola/get-package-info@v1
|
uses: luizfelipelaviola/get-package-info@v1
|
||||||
|
@ -46,19 +55,7 @@ jobs:
|
||||||
echo "github.ref = ${{ github.ref }}";
|
echo "github.ref = ${{ github.ref }}";
|
||||||
echo "github.ref_name = ${{ github.ref_name }}";
|
echo "github.ref_name = ${{ github.ref_name }}";
|
||||||
|
|
||||||
- name: 'npm install -g lerna@6/yarn'
|
- name: 'npm -v | pnpm -v | python --version'
|
||||||
run: |
|
|
||||||
echo "======================================================================";
|
|
||||||
echo "npm install -g lerna@6";
|
|
||||||
echo "--------------------";
|
|
||||||
npm install -g lerna@6;
|
|
||||||
|
|
||||||
echo "======================================================================";
|
|
||||||
echo "npm install -g yarn";
|
|
||||||
echo "--------------------";
|
|
||||||
npm install -g yarn;
|
|
||||||
|
|
||||||
- name: 'npm -v | yarn -v | lerna -v'
|
|
||||||
run: |
|
run: |
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "npm -v";
|
echo "npm -v";
|
||||||
|
@ -66,24 +63,24 @@ jobs:
|
||||||
npm -v;
|
npm -v;
|
||||||
|
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "yarn -v";
|
echo "pnpm -v";
|
||||||
echo "--------------------";
|
echo "--------------------";
|
||||||
yarn -v;
|
pnpm -v;
|
||||||
|
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "lerna -v";
|
echo "python --version";
|
||||||
echo "--------------------";
|
echo "--------------------";
|
||||||
lerna -v;
|
python --version;
|
||||||
|
|
||||||
- name: 'lerna bootstrap'
|
- name: 'pnpm install'
|
||||||
run: |
|
run: |
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
dir || ls -lah;
|
dir || ls -lah;
|
||||||
|
|
||||||
echo "======================================================================";
|
echo "======================================================================";
|
||||||
echo "lerna bootstrap --npm-client=yarn";
|
echo "pnpm install";
|
||||||
echo "--------------------";
|
echo "--------------------";
|
||||||
lerna bootstrap --npm-client=yarn;
|
pnpm install;
|
||||||
|
|
||||||
- name: 'npm run electron:build'
|
- name: 'npm run electron:build'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
cd ../
|
|
||||||
|
|
||||||
node -v
|
|
||||||
|
|
||||||
npm install -g cnpm --registry=https://registry.npmmirror.com
|
|
||||||
|
|
||||||
cnpm install -g lerna@6
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
cd ../
|
||||||
|
|
||||||
|
node -v
|
||||||
|
|
||||||
|
npm install -g pnpm --registry=https://registry.npmmirror.com
|
|
@ -2,4 +2,4 @@ cd ../
|
||||||
|
|
||||||
node -v
|
node -v
|
||||||
|
|
||||||
lerna bootstrap
|
pnpm install
|
18
lerna.json
18
lerna.json
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
"packages": [
|
|
||||||
"packages/*"
|
|
||||||
],
|
|
||||||
"command": {
|
|
||||||
"publish": {
|
|
||||||
"ignoreChanges": [
|
|
||||||
"*.md",
|
|
||||||
"config",
|
|
||||||
"doc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"bootstrap": {
|
|
||||||
"ignore": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"version": "1.8.9"
|
|
||||||
}
|
|
|
@ -1,11 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "dev-sidecar-parent",
|
"name": "dev-sidecar-parent",
|
||||||
|
"packageManager": "pnpm@9.13.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0"
|
||||||
"dependencies": {
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"lerna": "^6.6.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"test": "mocha"
|
"test": "mocha"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docmirror/mitmproxy": "^1.8.9",
|
"@docmirror/mitmproxy": "workspace:*",
|
||||||
"agentkeepalive": "^2.1.1",
|
"agentkeepalive": "^2.1.1",
|
||||||
"babel-preset-es2020": "^1.0.2",
|
"babel-preset-es2020": "^1.0.2",
|
||||||
"charset": "^1.0.0",
|
"charset": "^1.0.0",
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
"electron:icons-black": "electron-icon-builder --input=./public/logo/win-black.png --output=build/black --flatten"
|
"electron:icons-black": "electron-icon-builder --input=./public/logo/win-black.png --output=build/black --flatten"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docmirror/dev-sidecar": "^1.8.9",
|
"@docmirror/dev-sidecar": "workspace:*",
|
||||||
"@docmirror/mitmproxy": "^1.8.9",
|
"@docmirror/mitmproxy": "workspace:*",
|
||||||
"@mihomo-party/sysproxy": "^2.0.4",
|
"@mihomo-party/sysproxy": "^2.0.4",
|
||||||
"@natmri/platform-napi": "^0.0.7",
|
"@natmri/platform-napi": "^0.0.7",
|
||||||
"adm-zip": "^0.5.5",
|
"adm-zip": "^0.5.5",
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
"@vue/eslint-config-standard": "^5.1.2",
|
"@vue/eslint-config-standard": "^5.1.2",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"electron": "^17.4.11",
|
"electron": "^17.4.11",
|
||||||
"electron-builder": "^23.0.3",
|
"electron-builder": "^25.0.6",
|
||||||
"electron-devtools-installer": "^3.1.0",
|
"electron-devtools-installer": "^3.1.0",
|
||||||
"electron-icon-builder": "^2.0.1",
|
"electron-icon-builder": "^2.0.1",
|
||||||
"eslint": "^6.7.2",
|
"eslint": "^6.7.2",
|
||||||
|
|
|
@ -15,6 +15,7 @@ module.exports = {
|
||||||
title: 'DevSidecar-给开发者的边车辅助工具',
|
title: 'DevSidecar-给开发者的边车辅助工具',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
lintOnSave: false,
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({ 'global.GENTLY': true }),
|
new webpack.DefinePlugin({ 'global.GENTLY': true }),
|
||||||
|
|
Loading…
Reference in New Issue