From 67e19165ed95d3a1bee8a055134bb3eada800fb4 Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Mon, 17 Nov 2025 17:25:44 +0000 Subject: [PATCH 1/3] Add support for Node 24 (LTS) --- .browserslistrc | 2 +- .nvmrc | 2 +- Dockerfile | 2 +- docs/CONTRIBUTING.md | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index 34024b108..d1464e84b 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -13,4 +13,4 @@ iOS >= 11 ie 11 [node] -node 22 +node 24 diff --git a/.nvmrc b/.nvmrc index deed13c01..b03f40867 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/jod +lts/krypton diff --git a/Dockerfile b/Dockerfile index edc4afb2a..d1eb5da1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG PARENT_VERSION=latest-22 +ARG PARENT_VERSION=latest-24 ARG PORT=3000 ARG PORT_DEBUG=9229 diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f530d1bc7..1b944b5f0 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -32,7 +32,7 @@ If your bug is with the plugin, ensure you are running the plugin in a supported - A short and clear description of the issue. Explain the current behaviour along with the expected behaviour. - A step-by-step guide that details how we can reproduce your issue - A text copy (not a screenshot) of any error messages and stack traces -- The version of your runtime (e.g. Node 22.11.0) +- The version of your runtime (e.g. Node 24.0.0 or Node 22.11.0) - If the issue is with a form, a copy of the form definition (JSON) file **What we will provide:** diff --git a/package-lock.json b/package-lock.json index 5a1e071b1..39ac69550 100644 --- a/package-lock.json +++ b/package-lock.json @@ -135,7 +135,7 @@ "webpack-cli": "^6.0.1" }, "engines": { - "node": "^22.11.0", + "node": "^22.11.0 || ^24.0.0", "npm": "^10.9.0" } }, diff --git a/package.json b/package.json index dff498f36..8d00ee8ea 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "url": "git+https://github.com/DEFRA/forms-engine-plugin.git" }, "engines": { - "node": "^22.11.0", + "node": ">=22.11.0 <25.0.0", "npm": "^10.9.0" }, "license": "SEE LICENSE IN LICENSE", From 7f9b49f4856b9a23b5f51a0e0203391cc040cfed Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Mon, 17 Nov 2025 17:25:58 +0000 Subject: [PATCH 2/3] Add test pipeline to verify compatibility between node versions --- .github/workflows/check-pull-request.yml | 34 +++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/check-pull-request.yml b/.github/workflows/check-pull-request.yml index 84ad3c703..d960dd6fb 100644 --- a/.github/workflows/check-pull-request.yml +++ b/.github/workflows/check-pull-request.yml @@ -16,11 +16,13 @@ concurrency: jobs: build: - name: Build + name: Build (Node ${{ matrix.node-version }}) runs-on: ubuntu-24.04 strategy: fail-fast: false + matrix: + node-version: ['22', '23', '24'] steps: - name: Check out code @@ -31,14 +33,14 @@ jobs: id: npm-install-cache with: enableCrossOsArchive: true - key: npm-install-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + key: npm-install-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} path: node_modules - name: Cache build uses: actions/cache@v4 with: enableCrossOsArchive: true - key: npm-build-${{ runner.os }}-${{ github.sha }} + key: npm-build-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.sha }} path: | .public .server @@ -46,7 +48,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: .nvmrc + node-version: ${{ matrix.node-version }} - name: Install dependencies if: steps.npm-install-cache.outputs.cache-hit != 'true' @@ -56,7 +58,7 @@ jobs: run: npm run build lint: - name: ${{ matrix.task.description }} + name: ${{ matrix.task.description }} (Node ${{ matrix.node-version }}) runs-on: ubuntu-24.04 needs: [build] @@ -69,6 +71,7 @@ jobs: fail-fast: false matrix: + node-version: ['22', '23', '24'] task: - description: Prettier name: lint-prettier @@ -103,7 +106,7 @@ jobs: with: enableCrossOsArchive: true fail-on-cache-miss: false - key: npm-install-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + key: npm-install-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} path: node_modules - name: Cache task @@ -111,19 +114,19 @@ jobs: uses: actions/cache@v4 with: enableCrossOsArchive: true - key: ${{ matrix.task.name }}-${{ runner.os }} + key: ${{ matrix.task.name }}-${{ runner.os }}-node${{ matrix.node-version }} path: ${{ matrix.task.cache }} - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: .nvmrc + node-version: ${{ matrix.node-version }} - name: Run lint task run: ${{ matrix.task.run }} tasks: - name: ${{ matrix.task.description }} + name: ${{ matrix.task.description }} (Node ${{ matrix.node-version }}) runs-on: ubuntu-24.04 needs: [build] @@ -131,6 +134,7 @@ jobs: fail-fast: false matrix: + node-version: ['22', '23', '24'] task: - description: Unit tests name: test-unit @@ -146,7 +150,7 @@ jobs: with: enableCrossOsArchive: true fail-on-cache-miss: false - key: npm-install-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + key: npm-install-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} path: node_modules - name: Restore build @@ -154,7 +158,7 @@ jobs: with: enableCrossOsArchive: true fail-on-cache-miss: false - key: npm-build-${{ runner.os }}-${{ github.sha }} + key: npm-build-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.sha }} path: | .public .server @@ -162,14 +166,14 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: .nvmrc + node-version: ${{ matrix.node-version }} - name: Cache task if: ${{ matrix.task.cache }} uses: actions/cache@v4 with: enableCrossOsArchive: true - key: ${{ matrix.task.name }}-${{ runner.os }}-${{ github.sha }} + key: ${{ matrix.task.name }}-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.sha }} path: ${{ matrix.task.cache }} - name: Run task @@ -179,7 +183,7 @@ jobs: if: ${{ always() }} uses: actions/upload-artifact@v4 with: - name: ${{ matrix.task.description }} coverage + name: ${{ matrix.task.description }} coverage (Node ${{ matrix.node-version }}) path: coverage if-no-files-found: ignore @@ -204,7 +208,7 @@ jobs: with: enableCrossOsArchive: true fail-on-cache-miss: false - key: test-unit-${{ runner.os }}-${{ github.sha }} + key: test-unit-${{ runner.os }}-node24-${{ github.sha }} path: coverage - name: SonarCloud Scan From 8bcad34c0c9cce66edf9d50f061fef2ced8d982e Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Mon, 17 Nov 2025 17:40:17 +0000 Subject: [PATCH 3/3] fix build issue --- package-lock.json | 2 +- src/server/plugins/nunjucks/types.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f65ae0e27..bb62f6447 100644 --- a/package-lock.json +++ b/package-lock.json @@ -134,7 +134,7 @@ "webpack-cli": "^6.0.1" }, "engines": { - "node": "^22.11.0 || ^24.0.0", + "node": ">=22.11.0 <25.0.0", "npm": "^10.9.0" } }, diff --git a/src/server/plugins/nunjucks/types.js b/src/server/plugins/nunjucks/types.js index 2ad7ad3d7..b9bc8f774 100644 --- a/src/server/plugins/nunjucks/types.js +++ b/src/server/plugins/nunjucks/types.js @@ -26,7 +26,5 @@ */ /** - * @import { config } from '~/src/config/index.js' * @import { FormContext } from '~/src/server/plugins/engine/types.js' - * @import { PluginOptions } from '~/src/server/plugins/engine/plugin.js' */