From 30cfbaa36fc859182aeda201699e35f7b0ed77b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E5=A5=87?= Date: Sat, 9 May 2026 15:23:45 +0800 Subject: [PATCH] chore: align Node 22 floor across all shipping artifacts Reviewer (tanzhenxin) flagged five surfaces where the >=22 engine bump leaked: SDK package metadata, web-templates engines, /doctor runtime check, main bundler target, and SDK bundler target. Each was a separate escape hatch letting Node 18/20 consumers install or run the artifact on an unsupported runtime. - packages/sdk-typescript/package.json: engines.node >=18.0.0 -> >=22.0.0 - packages/web-templates/package.json: engines.node >=20 -> >=22 - packages/cli/src/utils/doctorChecks.ts: MIN_NODE_MAJOR 20 -> 22 - esbuild.config.js: target node20 -> node22 (main CLI bundle) - packages/sdk-typescript/scripts/build.js: target node18 -> node22 (esm + cjs) - packages/cli/src/utils/doctorChecks.test.ts: rename test label to v22+ Generated with AI Co-authored-by: Qwen-Coder --- esbuild.config.js | 2 +- packages/cli/src/utils/doctorChecks.test.ts | 2 +- packages/cli/src/utils/doctorChecks.ts | 2 +- packages/sdk-typescript/package.json | 2 +- packages/sdk-typescript/scripts/build.js | 4 ++-- packages/web-templates/package.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/esbuild.config.js b/esbuild.config.js index e84b6223b..c7aafb463 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -79,7 +79,7 @@ esbuild outfile: 'dist/cli.js', platform: 'node', format: 'esm', - target: 'node20', + target: 'node22', external, packages: 'bundle', inject: [path.resolve(__dirname, 'scripts/esbuild-shims.js')], diff --git a/packages/cli/src/utils/doctorChecks.test.ts b/packages/cli/src/utils/doctorChecks.test.ts index 262fa63fc..391cbf0ae 100644 --- a/packages/cli/src/utils/doctorChecks.test.ts +++ b/packages/cli/src/utils/doctorChecks.test.ts @@ -75,7 +75,7 @@ describe('runDoctorChecks', () => { expect(categories).toContain('Git'); }); - it('should pass Node.js version check for v20+', async () => { + it('should pass Node.js version check for v22+', async () => { const results = await runDoctorChecks(mockContext); const nodeCheck = results.find((r) => r.name === 'Node.js version'); expect(nodeCheck).toBeDefined(); diff --git a/packages/cli/src/utils/doctorChecks.ts b/packages/cli/src/utils/doctorChecks.ts index 6422bb5c1..8ac408746 100644 --- a/packages/cli/src/utils/doctorChecks.ts +++ b/packages/cli/src/utils/doctorChecks.ts @@ -17,7 +17,7 @@ import { } from '@qwen-code/qwen-code-core'; import { t } from '../i18n/index.js'; -const MIN_NODE_MAJOR = 20; +const MIN_NODE_MAJOR = 22; function checkNodeVersion(): DoctorCheckResult { const version = process.version; diff --git a/packages/sdk-typescript/package.json b/packages/sdk-typescript/package.json index 584eb37c3..2d123d487 100644 --- a/packages/sdk-typescript/package.json +++ b/packages/sdk-typescript/package.json @@ -43,7 +43,7 @@ "author": "Qwen Team", "license": "Apache-2.0", "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" }, "dependencies": { "@modelcontextprotocol/sdk": "^1.25.1", diff --git a/packages/sdk-typescript/scripts/build.js b/packages/sdk-typescript/scripts/build.js index beda8b0e7..90c6f4277 100755 --- a/packages/sdk-typescript/scripts/build.js +++ b/packages/sdk-typescript/scripts/build.js @@ -50,7 +50,7 @@ await esbuild.build({ bundle: true, format: 'esm', platform: 'node', - target: 'node18', + target: 'node22', outfile: join(rootDir, 'dist', 'index.mjs'), external: ['@modelcontextprotocol/sdk'], sourcemap: false, @@ -68,7 +68,7 @@ await esbuild.build({ bundle: true, format: 'cjs', platform: 'node', - target: 'node18', + target: 'node22', outfile: join(rootDir, 'dist', 'index.cjs'), external: ['@modelcontextprotocol/sdk'], sourcemap: false, diff --git a/packages/web-templates/package.json b/packages/web-templates/package.json index 08980ef78..fb6c75426 100644 --- a/packages/web-templates/package.json +++ b/packages/web-templates/package.json @@ -34,6 +34,6 @@ "vite": "^5.0.0" }, "engines": { - "node": ">=20" + "node": ">=22" } }