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 <qwen-coder@alibabacloud.com>
This commit is contained in:
秦奇 2026-05-09 15:23:45 +08:00
parent 8130770b37
commit 30cfbaa36f
6 changed files with 7 additions and 7 deletions

View file

@ -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')],

View file

@ -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();

View file

@ -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;

View file

@ -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",

View file

@ -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,

View file

@ -34,6 +34,6 @@
"vite": "^5.0.0"
},
"engines": {
"node": ">=20"
"node": ">=22"
}
}