From 6895f6c3f4c52839fe90cd781035e1a9cdbcd5eb Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Sat, 28 Feb 2026 06:42:39 +0000 Subject: [PATCH] Upgrade Node.js requirement from v20 to v22 Node.js v20 (Iron) will reach end-of-life on April 30, 2026. So we do the follow works: - Update all GitHub Actions workflows to use node-version: 22 - Add engines field to package.json requiring Node >=22 - Update AGENTS.md to document Node 22+ requirement - Add .nvmrc with version 22 for nvm/fnm users Ref: https://github.com/nodejs/Release Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> --- .github/workflows/pr-tests.yml | 2 +- .github/workflows/pre-release-build.yml | 2 +- .github/workflows/tagged-release.yml | 2 +- .github/workflows/verify-configs.yml | 2 +- .nvmrc | 1 + AGENTS.md | 2 +- package-lock.json | 3 +++ package.json | 3 +++ 8 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 3e04694c..7d35ad4e 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 - run: npm ci - run: npm test - run: npm run lint diff --git a/.github/workflows/pre-release-build.yml b/.github/workflows/pre-release-build.yml index f0b1be6c..6da6eccc 100644 --- a/.github/workflows/pre-release-build.yml +++ b/.github/workflows/pre-release-build.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 cache: 'npm' cache-dependency-path: '**/package-lock.json' - name: Detect Node version diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 5fbd42f1..6f1e9e20 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 - run: npm ci - uses: actions/setup-python@v6 diff --git a/.github/workflows/verify-configs.yml b/.github/workflows/verify-configs.yml index 74193d55..85d6d79b 100644 --- a/.github/workflows/verify-configs.yml +++ b/.github/workflows/verify-configs.yml @@ -12,6 +12,6 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 - run: npm ci - run: npm run verify diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..2bd5a0a9 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/AGENTS.md b/AGENTS.md index b31f157e..a66f3c6e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -226,7 +226,7 @@ The extension supports multiple AI providers: ### Build Issues -- Build failures: Check Node.js version (requires Node 20+), clear caches and rebuild. +- Build failures: Check Node.js version (requires Node 22+), clear caches and rebuild. - macOS/Linux: `rm -rf node_modules && npm ci && rm -rf node_modules/.cache build/ dist/` - Windows (PowerShell): `Remove-Item -Recurse -Force node_modules, build, dist; if (Test-Path node_modules\.cache) { Remove-Item -Recurse -Force node_modules\.cache }; npm ci` - "Module not found" errors: Usually indicate missing `npm ci` diff --git a/package-lock.json b/package-lock.json index 5d174f05..98ddbdcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -84,6 +84,9 @@ "thread-loader": "^4.0.4", "webpack": "^5.92.1", "webpack-bundle-analyzer": "^4.10.2" + }, + "engines": { + "node": ">=22" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index e7cc439d..ae9d60d7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "name": "chatgptbox", + "engines": { + "node": ">=22" + }, "scripts": { "build": "node build.mjs --production", "build:safari": "bash ./safari/build.sh",