diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb6ed919..f1ef6165 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,11 +71,11 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - - name: Setup Node.js - uses: actions/setup-node@v5 + - name: Setup pnpm and Node.js + uses: pnpm/setup@v2 with: - node-version: '24' - package-manager-cache: false + runtime: node@24 + install: false - name: Verify runner architecture shell: bash @@ -86,9 +86,6 @@ jobs: exit 1 fi - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - name: Get pnpm store directory shell: bash run: | @@ -103,9 +100,9 @@ jobs: ${{ runner.os }}-arm64-pnpm-store- - name: Install dependencies - run: | - echo "node-linker=hoisted" >> .npmrc - pnpm install --frozen-lockfile + env: + PNPM_CONFIG_NODE_LINKER: hoisted + run: pnpm install --frozen-lockfile # Rust native parser:目标架构与 electron-builder --arm64 保持一致 - name: Setup Rust toolchain @@ -197,14 +194,11 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - - name: Setup Node.js - uses: actions/setup-node@v5 + - name: Setup pnpm and Node.js + uses: pnpm/setup@v2 with: - node-version: '24' - package-manager-cache: false - - - name: Setup pnpm - uses: pnpm/action-setup@v4 + runtime: node@24 + install: false - name: Get pnpm store directory shell: bash @@ -231,9 +225,9 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: | - echo "node-linker=hoisted" >> .npmrc - pnpm install --frozen-lockfile + env: + PNPM_CONFIG_NODE_LINKER: hoisted + run: pnpm install --frozen-lockfile # Rust native parser:Windows release 仅构建 x64(与 electron-builder --win 默认一致) - name: Setup Rust toolchain @@ -314,14 +308,11 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - - name: Setup Node.js - uses: actions/setup-node@v5 + - name: Setup pnpm and Node.js + uses: pnpm/setup@v2 with: - node-version: '24' - package-manager-cache: false - - - name: Setup pnpm - uses: pnpm/action-setup@v4 + runtime: node@24 + install: false - name: Get pnpm store directory shell: bash @@ -337,9 +328,9 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: | - echo "node-linker=hoisted" >> .npmrc - pnpm install --frozen-lockfile + env: + PNPM_CONFIG_NODE_LINKER: hoisted + run: pnpm install --frozen-lockfile - name: Inject CLI version run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7690e499..3dd4aee3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,14 +25,11 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - - name: Setup Node.js - uses: actions/setup-node@v5 + - name: Setup pnpm and Node.js + uses: pnpm/setup@v2 with: - node-version: '24' - package-manager-cache: false - - - name: Setup pnpm - uses: pnpm/action-setup@v4 + runtime: node@24 + install: false - name: Get pnpm store directory shell: bash diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 2c910cff..00000000 --- a/.npmrc +++ /dev/null @@ -1,5 +0,0 @@ -# Keep dependency resolution consistent for future installs. -resolution-mode=highest - -# 历史项目依赖兼容:保留 hoist 行为,避免安装结构变化带来回归 -shamefully-hoist=true diff --git a/README.md b/README.md index 8c1b6e7d..80294b97 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ For complete contributor instructions, see the [Development Guide](https://docs. ### Requirements - Node.js >= 24 < 25 -- pnpm >= 9 < 10 +- pnpm >= 11 < 12 ### Setup diff --git a/README.zh-CN.md b/README.zh-CN.md index 7f6ec0aa..88240044 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -97,7 +97,7 @@ ChatLab 是一个基于 pnpm monorepo 的工程,桌面端使用 Electron + Vue ### 环境要求 - Node.js >= 24 < 25 -- pnpm >= 9 < 10 +- pnpm >= 11 < 12 ### 启动步骤 diff --git a/docs/cn/contributing/development.md b/docs/cn/contributing/development.md index 9c1f5edd..ed278b66 100644 --- a/docs/cn/contributing/development.md +++ b/docs/cn/contributing/development.md @@ -16,7 +16,7 @@ title: 开发指南 ## 环境要求 - Node.js `>=24 <25` -- pnpm `>=9 <10` +- pnpm `>=11 <12` 安装依赖: diff --git a/docs/en/contributing/development.md b/docs/en/contributing/development.md index b01bd7c3..588fcc09 100644 --- a/docs/en/contributing/development.md +++ b/docs/en/contributing/development.md @@ -16,7 +16,7 @@ This guide is for contributors who want to work on ChatLab code. It covers local ## Requirements - Node.js `>=24 <25` -- pnpm `>=9 <10` +- pnpm `>=11 <12` Install dependencies: diff --git a/package.json b/package.json index 605a1c31..1eeb1739 100644 --- a/package.json +++ b/package.json @@ -8,21 +8,10 @@ "url": "git+https://github.com/ChatLab/ChatLab.git" }, "author": "digua ", - "packageManager": "pnpm@9.15.9", + "packageManager": "pnpm@11.21.0", "engines": { "node": ">=24 <25", - "pnpm": ">=9 <10" - }, - "pnpm": { - "onlyBuiltDependencies": [ - "better-sqlite3", - "electron" - ], - "peerDependencyRules": { - "allowedVersions": { - "echarts-wordcloud@2.1.0>echarts": "6" - } - } + "pnpm": ">=11 <12" }, "scripts": { "dev": "node scripts/dev-select.mjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1eba43ae..83faadcb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -192,10 +192,6 @@ importers: zod: specifier: ^3.24.4 version: 3.25.76 - optionalDependencies: - '@node-rs/jieba': - specifier: ^2.0.1 - version: 2.0.1 devDependencies: '@openchatlab/config': specifier: workspace:* @@ -233,6 +229,10 @@ importers: tsx: specifier: ^4.21.0 version: 4.21.0 + optionalDependencies: + '@node-rs/jieba': + specifier: ^2.0.1 + version: 2.0.1 apps/desktop: dependencies: @@ -396,10 +396,6 @@ importers: zod: specifier: ^3.24.4 version: 3.25.76 - optionalDependencies: - '@node-rs/jieba': - specifier: ^2.0.1 - version: 2.0.1 devDependencies: '@openchatlab/config': specifier: workspace:* @@ -416,6 +412,10 @@ importers: tsup: specifier: ^8.5.0 version: 8.5.1(jiti@2.7.0)(postcss@8.5.19)(tsx@4.21.0)(typescript@6.0.3)(yaml@2.8.2) + optionalDependencies: + '@node-rs/jieba': + specifier: ^2.0.1 + version: 2.0.1 packages/node-runtime: dependencies: @@ -473,10 +473,6 @@ importers: yauzl: specifier: ^3.4.0 version: 3.4.0 - optionalDependencies: - '@node-rs/jieba': - specifier: ^2.0.1 - version: 2.0.1 devDependencies: '@types/better-sqlite3': specifier: ^7.6.13 @@ -484,6 +480,10 @@ importers: '@types/yauzl': specifier: ^3.4.0 version: 3.4.0 + optionalDependencies: + '@node-rs/jieba': + specifier: ^2.0.1 + version: 2.0.1 packages/parser: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5e83252e..7e2d088f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,3 +2,21 @@ packages: - 'packages/**' - 'apps/*' - 'docs' + +# Keep dependency resolution and hoisting consistent across local and CI installs. +resolutionMode: highest +shamefullyHoist: true + +allowBuilds: + better-sqlite3: true + electron: true + electron-winstaller: false + esbuild: false + onnxruntime-node: false + protobufjs: false + sharp: false + vue-demi: false + +peerDependencyRules: + allowedVersions: + 'echarts-wordcloud@2.1.0>echarts': '6'