From 37c65ee4be48003c2089cfcc21dd2a75183cbf32 Mon Sep 17 00:00:00 2001 From: Kili Date: Mon, 23 Feb 2026 10:07:36 +0100 Subject: [PATCH] Migrate project runtime from Node 18 to Node 24 --- .github/workflows/dependency-review.yml | 2 +- .github/workflows/master.yml | 2 +- .github/workflows/pull_requests.yml | 2 +- .github/workflows/releases.yml | 6 +++--- .github/workflows/security-auto-fix.yml | 2 +- package.json | 11 +++++++---- src/core/ChefWorker.js | 2 +- src/core/Recipe.mjs | 2 +- src/core/config/scripts/generateConfig.mjs | 2 +- src/core/config/scripts/generateOpsIndex.mjs | 2 +- src/core/config/scripts/newMinorVersion.mjs | 2 +- src/core/config/scripts/newOperation.mjs | 2 +- src/core/lib/Magic.mjs | 2 +- src/node/api.mjs | 2 +- src/node/config/scripts/generateNodeIndex.mjs | 2 +- src/web/index.js | 4 ++-- src/web/static/sitemap.mjs | 2 +- tests/node/tests/Categories.mjs | 4 ++-- 18 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 31d58583..28f072fb 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -44,7 +44,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 24 cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index d4cf35c0..c2d93276 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -18,7 +18,7 @@ jobs: - name: Set node version uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 24 registry-url: "https://registry.npmjs.org" - name: Install diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 12d18ad2..10d4e725 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -17,7 +17,7 @@ jobs: - name: Set node version uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 24 registry-url: "https://registry.npmjs.org" - name: Install diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 57cc7211..e67c1bcf 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -24,7 +24,7 @@ jobs: - name: Set node version uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 24 registry-url: "https://registry.npmjs.org" - name: Install @@ -104,7 +104,7 @@ jobs: - name: Set node version uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 24 registry-url: "https://registry.npmjs.org" - name: Install @@ -116,7 +116,7 @@ jobs: - name: Reset node version ready for publish uses: actions/setup-node@v4 with: - node-version: 24.5 + node-version: 24 registry-url: "https://registry.npmjs.org" - name: Publish to NPM diff --git a/.github/workflows/security-auto-fix.yml b/.github/workflows/security-auto-fix.yml index 4063e924..2027af2c 100644 --- a/.github/workflows/security-auto-fix.yml +++ b/.github/workflows/security-auto-fix.yml @@ -44,7 +44,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 24 cache: 'npm' - name: Cache node modules diff --git a/package.json b/package.json index 00a700fc..9092053f 100644 --- a/package.json +++ b/package.json @@ -193,16 +193,16 @@ "start": "npx grunt dev", "build": "npx grunt prod", "node": "npx grunt node", - "repl": "node --experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-experimental-fetch --no-warnings src/node/repl.mjs", - "test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs", + "repl": "node --no-experimental-fetch --no-warnings src/node/repl.mjs", + "test": "npx grunt configTests && node --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs", "testnodeconsumer": "npx grunt testnodeconsumer", "testui": "npx grunt testui", "testuidev": "npx nightwatch --env=dev", "lint": "npx grunt lint", "lint:grammar": "cspell ./src", "postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup && npx grunt exec:fixJimpModule", - "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs", - "minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs", + "newop": "node src/core/config/scripts/newOperation.mjs", + "minor": "node src/core/config/scripts/newMinorVersion.mjs", "getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'", "setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048", "security:audit": "npm audit", @@ -211,5 +211,8 @@ "security:triage": "node scripts/vulnerability-triage.js", "security:triage:json": "node scripts/vulnerability-triage.js --json", "security:check": "npm run security:triage && npm run lint" + }, + "engines": { + "node": ">=24" } } diff --git a/src/core/ChefWorker.js b/src/core/ChefWorker.js index a43993f9..43f595f3 100644 --- a/src/core/ChefWorker.js +++ b/src/core/ChefWorker.js @@ -7,7 +7,7 @@ */ import Chef from "./Chef.mjs"; -import OperationConfig from "./config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "./config/OperationConfig.json" with { type: "json" }; import OpModules from "./config/modules/OpModules.mjs"; import loglevelMessagePrefix from "loglevel-message-prefix"; diff --git a/src/core/Recipe.mjs b/src/core/Recipe.mjs index 3ce40aa4..ba7c35e8 100755 --- a/src/core/Recipe.mjs +++ b/src/core/Recipe.mjs @@ -4,7 +4,7 @@ * @license Apache-2.0 */ -import OperationConfig from "./config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "./config/OperationConfig.json" with { type: "json" }; import OperationError from "./errors/OperationError.mjs"; import Operation from "./Operation.mjs"; import DishError from "./errors/DishError.mjs"; diff --git a/src/core/config/scripts/generateConfig.mjs b/src/core/config/scripts/generateConfig.mjs index 64c7cb81..5deac2d8 100644 --- a/src/core/config/scripts/generateConfig.mjs +++ b/src/core/config/scripts/generateConfig.mjs @@ -20,7 +20,7 @@ const dir = path.join(process.cwd() + "/src/core/config/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: generateConfig.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/generateConfig.mjs"); + console.log("Example> node src/core/config/scripts/generateConfig.mjs"); process.exit(1); } diff --git a/src/core/config/scripts/generateOpsIndex.mjs b/src/core/config/scripts/generateOpsIndex.mjs index d8dd6a70..d58fe32a 100644 --- a/src/core/config/scripts/generateOpsIndex.mjs +++ b/src/core/config/scripts/generateOpsIndex.mjs @@ -17,7 +17,7 @@ const dir = path.join(process.cwd() + "/src/core/config/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: generateOpsIndex.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/generateOpsIndex.mjs"); + console.log("Example> node src/core/config/scripts/generateOpsIndex.mjs"); process.exit(1); } diff --git a/src/core/config/scripts/newMinorVersion.mjs b/src/core/config/scripts/newMinorVersion.mjs index 67754890..598f31df 100644 --- a/src/core/config/scripts/newMinorVersion.mjs +++ b/src/core/config/scripts/newMinorVersion.mjs @@ -18,7 +18,7 @@ const dir = path.join(process.cwd() + "/src/core/config/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: newMinorVersion.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/newMinorVersion.mjs"); + console.log("Example> node src/core/config/scripts/newMinorVersion.mjs"); process.exit(1); } diff --git a/src/core/config/scripts/newOperation.mjs b/src/core/config/scripts/newOperation.mjs index 1686f6eb..ffeb3df7 100644 --- a/src/core/config/scripts/newOperation.mjs +++ b/src/core/config/scripts/newOperation.mjs @@ -20,7 +20,7 @@ const dir = path.join(process.cwd() + "/src/core/operations/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: newOperation.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/newOperation.mjs"); + console.log("Example> node src/core/config/scripts/newOperation.mjs"); process.exit(1); } diff --git a/src/core/lib/Magic.mjs b/src/core/lib/Magic.mjs index 14111ec7..ad407de6 100644 --- a/src/core/lib/Magic.mjs +++ b/src/core/lib/Magic.mjs @@ -1,4 +1,4 @@ -import OperationConfig from "../config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "../config/OperationConfig.json" with { type: "json" }; import Utils, { isWorkerEnvironment } from "../Utils.mjs"; import Recipe from "../Recipe.mjs"; import Dish from "../Dish.mjs"; diff --git a/src/node/api.mjs b/src/node/api.mjs index 88b3f834..82b5f61e 100644 --- a/src/node/api.mjs +++ b/src/node/api.mjs @@ -10,7 +10,7 @@ import NodeDish from "./NodeDish.mjs"; import NodeRecipe from "./NodeRecipe.mjs"; -import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "../core/config/OperationConfig.json" with { type: "json" }; import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils.mjs"; import ExcludedOperationError from "../core/errors/ExcludedOperationError.mjs"; diff --git a/src/node/config/scripts/generateNodeIndex.mjs b/src/node/config/scripts/generateNodeIndex.mjs index 981c9b79..f586a475 100644 --- a/src/node/config/scripts/generateNodeIndex.mjs +++ b/src/node/config/scripts/generateNodeIndex.mjs @@ -23,7 +23,7 @@ const dir = path.join(`${process.cwd()}/src/node`); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: generateNodeIndex.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/node/config/scripts/generateNodeIndex.mjs"); + console.log("Example> node src/node/config/scripts/generateNodeIndex.mjs"); process.exit(1); } diff --git a/src/web/index.js b/src/web/index.js index 90142b34..110f0d2b 100755 --- a/src/web/index.js +++ b/src/web/index.js @@ -17,8 +17,8 @@ import * as CanvasComponents from "../core/lib/CanvasComponents.mjs"; // CyberChef import App from "./App.mjs"; -import Categories from "../core/config/Categories.json" assert {type: "json"}; -import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"}; +import Categories from "../core/config/Categories.json" with { type: "json" }; +import OperationConfig from "../core/config/OperationConfig.json" with { type: "json" }; /** diff --git a/src/web/static/sitemap.mjs b/src/web/static/sitemap.mjs index b96047fc..03313ac7 100644 --- a/src/web/static/sitemap.mjs +++ b/src/web/static/sitemap.mjs @@ -1,5 +1,5 @@ import sm from "sitemap"; -import OperationConfig from "../../core/config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "../../core/config/OperationConfig.json" with { type: "json" }; /** diff --git a/tests/node/tests/Categories.mjs b/tests/node/tests/Categories.mjs index e6f8bd72..070d78d7 100644 --- a/tests/node/tests/Categories.mjs +++ b/tests/node/tests/Categories.mjs @@ -1,6 +1,6 @@ import TestRegister from "../../lib/TestRegister.mjs"; -import Categories from "../../../src/core/config/Categories.json" assert {type: "json"}; -import OperationConfig from "../../../src/core/config/OperationConfig.json" assert {type: "json"}; +import Categories from "../../../src/core/config/Categories.json" with { type: "json" }; +import OperationConfig from "../../../src/core/config/OperationConfig.json" with { type: "json" }; import it from "../assertionHandler.mjs"; import assert from "assert";