From 96d047e5984b27cf15b27468c93c41118651caec Mon Sep 17 00:00:00 2001 From: 142vip Date: Thu, 19 Dec 2024 15:03:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8corepack=E7=AE=A1?= =?UTF-8?q?=E7=90=86PNM=E7=89=88=E6=9C=AC=EF=BC=8C=E9=94=81=E5=AE=9A?= =?UTF-8?q?=E4=B8=BApnpm@9.6.0=EF=BC=8C=E5=A2=9E=E5=8A=A0ci=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E6=94=AF=E6=8C=81=E5=BF=AB=E9=80=9F=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +++- pnpm-workspace.yaml | 2 +- scripts/ci | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 scripts/ci diff --git a/package.json b/package.json index 468123d9f94e..5d48465c4c87 100644 --- a/package.json +++ b/package.json @@ -59,8 +59,10 @@ "type": "git", "url": "https://github.com/midwayjs/midway.git" }, + "packageManager": "pnpm@9.6.0", "engines": { - "node": ">= 16.0.0" + "node": ">= 16.0.0", + "pnpm": "9.6.0" }, "license": "MIT", "collective": { diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a7a093248406..9c2e9d889ff1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: - 'packages/*' - 'packages-serverless/*' - - 'packages-resource/*' \ No newline at end of file + - 'packages-resource/*' diff --git a/scripts/ci b/scripts/ci new file mode 100755 index 000000000000..a0e8f6522d06 --- /dev/null +++ b/scripts/ci @@ -0,0 +1,18 @@ +#!/bin/bash +## +## 依赖安装脚本 +## 使用: +## ./scripts/ci +## + +# NPM源 +NPM_REGISTRY="https://mirrors.tencent.com/npm/" + +## 获取所有参数 +echo "运行命令: export COREPACK_NPM_REGISTRY=$NPM_REGISTRY && corepack enable pnpm && pnpm i --registry $NPM_REGISTRY --frozen-lockfile $*" + +# 导出corepack环境变量,安装pnpm版本 +export COREPACK_NPM_REGISTRY=$NPM_REGISTRY && corepack enable pnpm + +# 安装项目依赖 +pnpm i --registry $NPM_REGISTRY --frozen-lockfile "$@" From e36bd4f051b4590daafc45677eb52a46a3badf5a Mon Sep 17 00:00:00 2001 From: 142vip Date: Thu, 19 Dec 2024 15:18:18 +0800 Subject: [PATCH 2/4] chore: update --- .github/workflows/precheck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/precheck.yml b/.github/workflows/precheck.yml index 6f0a9cc24611..2bfd5fe3ab1b 100644 --- a/.github/workflows/precheck.yml +++ b/.github/workflows/precheck.yml @@ -26,7 +26,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 9 + version: 9.6.0 run_install: false - name: Use Node.js ${{ matrix.node-version }} @@ -35,7 +35,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - run: pnpm install + - run: ./scripts/ci - run: pnpm build --if-present - run: pnpm lint - run: pnpm lint:cycle From 9a077f8eeb458a5ac67910b11e81711301816eb9 Mon Sep 17 00:00:00 2001 From: 142vip Date: Thu, 19 Dec 2024 15:20:48 +0800 Subject: [PATCH 3/4] chore: update --- .github/workflows/nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 93a9b17e8a93..8b0acaf9f960 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -87,7 +87,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 9 + version: 9.6.0 run_install: false - name: Use Node.js ${{ matrix.node-version }} @@ -110,7 +110,7 @@ jobs: container-name: 'mqtt' - name: Install dependencies - run: pnpm install + run: ./scripts/ci - name: Install codecov run: pnpm add -g codecov From 9fc756c6ddd5f04727db3d6217bcbbc37a56ba5b Mon Sep 17 00:00:00 2001 From: 142vip Date: Thu, 19 Dec 2024 18:53:26 +0800 Subject: [PATCH 4/4] chore: update --- scripts/ci | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/ci b/scripts/ci index a0e8f6522d06..d71dd3317239 100755 --- a/scripts/ci +++ b/scripts/ci @@ -6,13 +6,13 @@ ## # NPM源 -NPM_REGISTRY="https://mirrors.tencent.com/npm/" +#NPM_REGISTRY="https://mirrors.tencent.com/npm/" ## 获取所有参数 -echo "运行命令: export COREPACK_NPM_REGISTRY=$NPM_REGISTRY && corepack enable pnpm && pnpm i --registry $NPM_REGISTRY --frozen-lockfile $*" +echo "运行命令: corepack enable pnpm && pnpm i --frozen-lockfile $*" -# 导出corepack环境变量,安装pnpm版本 -export COREPACK_NPM_REGISTRY=$NPM_REGISTRY && corepack enable pnpm +# 安装pnpm版本 +corepack enable pnpm # 安装项目依赖 -pnpm i --registry $NPM_REGISTRY --frozen-lockfile "$@" +pnpm i --frozen-lockfile "$@"