diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 92ebd43cc4..9b99205145 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "CyberChef", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bookworm", + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. "features": { diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 8a3aff54b3..a45c6a9cbc 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -15,7 +15,7 @@ jobs: - name: Set node version uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' - name: Install run: | diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 296e60b99a..fdadab345e 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -14,7 +14,7 @@ jobs: - name: Set node version uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' - name: Install run: | diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index a77f4984b3..1f945bed25 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -21,7 +21,7 @@ jobs: - name: Set node version uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' - name: Install run: | diff --git a/Dockerfile b/Dockerfile index ba605fd719..c37826f469 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # Modifier --platform=$BUILDPLATFORM limits the platform to "BUILDPLATFORM" during buildx multi-platform builds # This is because npm "chromedriver" package is not compatiable with all platforms # For more info see: https://docs.docker.com/build/building/multi-platform/#cross-compilation -FROM --platform=$BUILDPLATFORM node:18-alpine AS builder +FROM --platform=$BUILDPLATFORM node:20-alpine AS builder WORKDIR /app diff --git a/README.md b/README.md index 89f0371d5b..a8d8cb03ff 100755 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ CyberChef is built to support ## Node.js support -CyberChef is built to fully support Node.js `v16`. For more information, see the ["Node API" wiki page](https://github.com/gchq/CyberChef/wiki/Node-API) +CyberChef is built to fully support Node.js `v20`. For more information, see the ["Node API" wiki page](https://github.com/gchq/CyberChef/wiki/Node-API) ## Contributing diff --git a/babel.config.js b/babel.config.js index deab910842..30ad89e1ab 100644 --- a/babel.config.js +++ b/babel.config.js @@ -22,6 +22,9 @@ module.exports = function(api) { "regenerator": true } ] - ] + ], + "generatorOpts": { + "importAttributesKeyword": "with" + } }; }; diff --git a/package.json b/package.json index 9191ab6f03..c09c3ebddd 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "browserslist": [ "Chrome >= 50", "Firefox >= 38", - "node >= 16" + "node >= 20" ], "devDependencies": { "@babel/core": "^7.24.7", diff --git a/src/core/ChefWorker.js b/src/core/ChefWorker.js index a43993f925..43f595f396 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 3ce40aa4d6..ba7c35e8f9 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/lib/Magic.mjs b/src/core/lib/Magic.mjs index 14111ec733..ad407de690 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 88b3f834ae..82b5f61e19 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/web/index.js b/src/web/index.js index 90142b3420..110f0d2bf0 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 b96047fc82..03313ac7e2 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 e6f8bd72d9..070d78d718 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";