From 3fd16d0c23f3613037520ca1b2880397b593a4b7 Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Fri, 27 Jun 2025 23:10:23 +0800 Subject: [PATCH] refactor!: bump required node version to 20.19+, 22.12+ --- eslint.config.js | 5 +++++ package.json | 2 +- src/config.ts | 2 +- tsconfig.json | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 3146d76..df529da 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -22,6 +22,11 @@ export default tseslint.config( ...globals.node } }, + settings: { + node: { + version: '^20.19.0 || >=22.12.0' + } + }, rules: { 'prettier/prettier': 'warn', '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }], diff --git a/package.json b/package.json index 3f091cf..4bebd0d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "node.d.ts" ], "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^20.19.0 || >=22.12.0" }, "packageManager": "pnpm@10.12.4", "author": "Alex Wei", diff --git a/src/config.ts b/src/config.ts index 8468b3e..69d836a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -343,7 +343,7 @@ async function bundleConfigFile(fileName: string, isESM: boolean): Promise<{ cod absWorkingDir: process.cwd(), entryPoints: [fileName], write: false, - target: ['node18'], + target: ['node20'], platform: 'node', bundle: true, format: isESM ? 'esm' : 'cjs', diff --git a/tsconfig.json b/tsconfig.json index f56ac22..b8ef499 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,13 @@ { "compilerOptions": { - "target": "ES2022", + "target": "ES2023", "module": "ESNext", "lib": ["ESNext"], "sourceMap": false, "strict": true, "allowJs": true, "esModuleInterop": true, - "moduleResolution": "Node", + "moduleResolution": "bundler", "resolveJsonModule": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true,