From b1d279ea7b957a17688d9c7a524d80e976d5c1f2 Mon Sep 17 00:00:00 2001 From: Kili Date: Mon, 23 Feb 2026 09:46:43 +0100 Subject: [PATCH 1/3] Sync CI workflows toward upstream gchq setup --- .editorconfig | 4 + .github/workflows/master.yml | 150 +++++++------------------ .github/workflows/pull_requests.yml | 80 +++++++------- .github/workflows/releases.yml | 163 ++++++++++++++++------------ 4 files changed, 183 insertions(+), 214 deletions(-) diff --git a/.editorconfig b/.editorconfig index b50059bb..cef4cab0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,3 +12,7 @@ indent_size = 4 [{package.json,.travis.yml,nightwatch.json}] indent_style = space indent_size = 2 + +[.github/**.yml] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f31dc3c9..d4cf35c0 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -2,129 +2,61 @@ name: "Master Build, Test & Deploy" on: workflow_dispatch: - inputs: - nightly: - description: "Tag build as nightly" - required: false - default: "false" push: branches: - - master - schedule: - # Weekly build and publish to keep images fresh - - cron: '0 3 * * 1' + - master -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - PLATFORMS: linux/amd64,linux/arm64 - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - PLATFORMS: linux/amd64,linux/arm64 +permissions: + contents: read jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set node version - uses: actions/setup-node@v3 - with: - node-version: '18.x' + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" - - name: Install - run: | - export DETECT_CHROMEDRIVER_VERSION=true - npm install - npm run setheapsize + - name: Install + run: | + export DETECT_CHROMEDRIVER_VERSION=true + npm install + npm run setheapsize - - name: Lint - run: npx grunt lint + - name: Lint + run: npx grunt lint - - name: Unit Tests - run: | - npm test - npm run testnodeconsumer + - name: Unit Tests + run: | + npm test + npm run testnodeconsumer - - name: Production Build - if: success() - run: npx grunt prod --msg="Version 10 is here! Read about the new features here" + - name: Production Build + if: success() + run: npx grunt prod --msg="" - - name: Generate sitemap - run: npx grunt exec:sitemap + - name: Generate sitemap + run: npx grunt exec:sitemap - - name: UI Tests - if: success() - run: | - sudo apt-get install xvfb - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + - name: UI Tests + if: success() + run: | + sudo apt-get install xvfb + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui - - name: Prepare for GitHub Pages - if: success() - run: npx grunt copy:ghPages + - name: Prepare for GitHub Pages + if: success() + run: npx grunt copy:ghPages - - name: Deploy to GitHub Pages - if: success() && github.ref == 'refs/heads/master' - uses: crazy-max/ghaction-github-pages@v3 - with: - target_branch: gh-pages - build_dir: ./build/prod - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - docker-images: - name: Build & Publish Docker Images - runs-on: ubuntu-latest - needs: main - if: github.ref == 'refs/heads/master' - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set extra tags - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.nightly }}" = "true" ]; then - echo "EXTRA_TAGS=type=raw,value=nightly" >> $GITHUB_ENV - else - echo "EXTRA_TAGS=" >> $GITHUB_ENV - fi - - - name: Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=raw,value=latest - type=sha,format=long - ${{ env.EXTRA_TAGS }} - - - name: Build and push multi-arch image - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - platforms: ${{ env.PLATFORMS }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + - name: Deploy to GitHub Pages + if: success() && github.ref == 'refs/heads/master' + uses: crazy-max/ghaction-github-pages@v3 + with: + target_branch: gh-pages + build_dir: ./build/prod + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 296e60b9..12d18ad2 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -1,5 +1,8 @@ name: "Pull Requests" +permissions: + contents: read + on: workflow_dispatch: pull_request: @@ -9,47 +12,50 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set node version - uses: actions/setup-node@v3 - with: - node-version: '18.x' + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" - - name: Install - run: | - export DETECT_CHROMEDRIVER_VERSION=true - npm install - npm run setheapsize + - name: Install + run: | + export DETECT_CHROMEDRIVER_VERSION=true + npm install + npm run setheapsize - - name: Lint - run: npx grunt lint + - name: Lint + run: npx grunt lint - - name: Unit Tests - run: | - npm test - npm run testnodeconsumer + - name: Unit Tests + run: | + npm test + npm run testnodeconsumer - - name: Production Build - if: success() - run: npx grunt prod + - name: Production Build + if: success() + run: npx grunt prod - - name: Production Image Build - if: success() - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - # Not being uploaded to any registry, use a simple name to allow Buildah to build correctly. - image: cyberchef - containerfiles: ./Dockerfile - platforms: linux/amd64 - oci: true - # Webpack seems to use a lot of open files, increase the max open file limit to accomodate. - extra-args: | - --ulimit nofile=10000 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: UI Tests - if: success() - run: | - sudo apt-get install xvfb - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Production Image Build + if: success() + id: build-image + uses: docker/build-push-action@v6 + with: + context: . + push: false + tags: cyberchef:pr + platforms: linux/amd64,linux/arm64 + + - name: UI Tests + if: success() + run: | + sudo apt-get install xvfb + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index a77f4984..57cc7211 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -4,7 +4,10 @@ on: workflow_dispatch: push: tags: - - 'v*' + - "v*" + +permissions: + contents: read env: REGISTRY: ghcr.io @@ -16,81 +19,105 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set node version - uses: actions/setup-node@v3 - with: - node-version: '18.x' + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" - - name: Install - run: | - export DETECT_CHROMEDRIVER_VERSION=true - npm ci - npm run setheapsize + - name: Install + run: | + export DETECT_CHROMEDRIVER_VERSION=true + npm ci + npm run setheapsize - - name: Lint - run: npx grunt lint + - name: Lint + run: npx grunt lint - - name: Unit Tests - run: | - npm test - npm run testnodeconsumer + - name: Unit Tests + run: | + npm test + npm run testnodeconsumer - - name: Production Build - run: npx grunt prod + - name: Production Build + run: npx grunt prod - - name: UI Tests - run: | - sudo apt-get install xvfb - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + - name: UI Tests + run: | + sudo apt-get install xvfb + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui - - name: Image Metadata - id: image-metadata - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{major}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{version}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Production Image Build - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - tags: ${{ steps.image-metadata.outputs.tags }} - labels: ${{ steps.image-metadata.outputs.labels }} - containerfiles: ./Dockerfile - platforms: linux/amd64,linux/arm64 - oci: true - # enable build layer caching between platforms - layers: true - # Webpack seems to use a lot of open files, increase the max open file limit to accomodate. - extra-args: | - --ulimit nofile=10000 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Publish to GHCR - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: ${{ env.REGISTRY }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} + - name: Image Metadata + id: image-metadata + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}} - - name: Upload Release Assets - id: upload-release-assets - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/prod/*.zip - tag: ${{ github.ref }} - overwrite: true - file_glob: true - body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details." + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_PASSWORD }} - - name: Publish to NPM - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} + - name: Publish to GHCR + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.image-metadata.outputs.tags }} + labels: ${{ steps.image-metadata.outputs.labels }} + platforms: linux/amd64,linux/arm64 + + - name: Upload Release Assets + id: upload-release-assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/prod/*.zip + tag: ${{ github.ref }} + overwrite: true + file_glob: true + body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details." + + npm-publish: + permissions: + id-token: write + contents: read + needs: main + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + + - name: Install + run: npm ci + + - name: Create machine generated files + run: npm run node + + - name: Reset node version ready for publish + uses: actions/setup-node@v4 + with: + node-version: 24.5 + registry-url: "https://registry.npmjs.org" + + - name: Publish to NPM + run: npm publish From 67180d90a538c99befaaca7feac3fc1be51881a9 Mon Sep 17 00:00:00 2001 From: Kili Date: Mon, 23 Feb 2026 09:59:54 +0100 Subject: [PATCH 2/3] Fix flaky JPath/JWT operation tests for stricter runtimes --- tests/operations/tests/Code.mjs | 2 +- tests/operations/tests/JWTSign.mjs | 72 ++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/tests/operations/tests/Code.mjs b/tests/operations/tests/Code.mjs index c62c7630..d568757a 100644 --- a/tests/operations/tests/Code.mjs +++ b/tests/operations/tests/Code.mjs @@ -322,7 +322,7 @@ TestRegister.addTests([ ] } ], - expectedMatch: /^Invalid JPath expression: jsonPath: self is not defined:/ + expectedMatch: /^Invalid JPath expression: Unexpected "\{" at character 1/ }, { name: "CSS selector", diff --git a/tests/operations/tests/JWTSign.mjs b/tests/operations/tests/JWTSign.mjs index a7752138..395a8196 100644 --- a/tests/operations/tests/JWTSign.mjs +++ b/tests/operations/tests/JWTSign.mjs @@ -15,26 +15,52 @@ const inputObject = JSON.stringify({ }, null, 4); const hsKey = "secret_cat"; -const rsKey = `-----BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw -33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW -+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB -AoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS -3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5Cp -uGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE -2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0 -GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0K -Su5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY -6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5 -fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523 -Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aP -FaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw== ------END RSA PRIVATE KEY-----`; -const esKey = `-----BEGIN PRIVATE KEY----- -MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgevZzL1gdAFr88hb2 -OF/2NxApJCzGCEDdfSp6VQO30hyhRANCAAQRWz+jn65BtOMvdyHKcvjBeBSDZH2r -1RTwjmYSi9R/zpBnuQ4EiMnCqfMPWiZqB4QdbAd0E7oH50VpuZ1P087G +const rsKey = `-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnBZHfKzx27jc+ +9cFPj3b42HO8auxjtlpJpiWgMluSJi8ECrN3iIODf5H9xf1Np61+4xtz3SDKibdA +XgB9rhXRz6LcRNN962QtIvKriI+Mr9EEaAwNFYziZ8bhDVgawheWCqSJO0DjDDDk +0CTbfl7SeIhcTuoPXeWFQICUsyc6w3uE+KWnnPZnK9l3R02ssBjsqQhf3LZ9bz04 +52ahhuBg1BgBOIeu8Y8hzTAjsOuMDZ7XV8MbEpcmOYRy46vEjRTl3ZIpYoS0v5st +M60swjnPiv43oBAsziVddIJWnh+TnBacnuhHl7amuGCLspogftJGefuGDNxIJOLH +mPaO5R7vAgMBAAECggEADZn32SZQBIaI7SWF8Ju3OvZvdffrnAFH9o8YJwLf/k5O +NVQ19cMtTwgrPcAy5igJoG9Zlew+en46Mkl2iO+/bB9n7MUGmKLLvpaQqAW9weA2 +E6bWksyig0/t1yE0fzrPLa/JuSSqcNOua0JP8TZS+dxL1vd0c1wpX7uI9nhHxn9Q +OJNY6N+ebeIjEugYJaeaLWj6cQ1x9V0+JealQtlra4Xex/CwczqPLKD01bdPe/Fn +5iLG8/dIofHz+615UTC52vwKaL2JiWUHX9gBlahrZYOuhxJQ1RRAf03+Ij2hyUwa +tOKglPZIhDajALfU3qSfOfRHnMKpakdA9tiZ1TTIvQKBgQD5lUvlZOfY/WdkHl3u +RnF3g/lWT4dRzdcezeYkLAdYcu5Q1ExVlYPezA9tYD2uR7cziJy/em1v0tPXzCSL ++BGB8/Ds4wg3QYnV8RXgI/4XxXf2iNbfJEfJ74nxza1/9L9Bnvg1OZLcdagu+Ria +p8y3hWzbBie52o0T8s/KDo2/PQKBgQDs9hseyloiDqsmW7hfLw+AiH1IGwXgK53b +ZeBwtASr7SYD1Ej0xFZ5SZ/OukjdDAQoyrivpjPcCjXxR1eoCA857S/+sSRPk+Gw +3+9lWys7jd4VEWvQgV7PKwGGVc1Ku/aKjNbNnu4HxbQfb7bJZnvoW8WqsqHhT/2z +bFnuYVD5mwKBgQC88adpXECg5wX0p4CYuD+CKSkDjGV3KoumyF1oGOTesvNzwaSg +TfZtHrK3LNrFK4mnu85erwJWW5cAkY1BYWVvqgtEaoN3wWflzQOwkc70lAvDWcjB +WSf32h3mLr0gV1rLBNwG/zUNLQ1LskxMGKhEbv//t+MvMiMHbRSddPMeSQKBgQDm +H8QKzP1nodM4905AshVeAC+a/RNhtzogvfmPumPnC/IlOd54RsysEYIvY94rPeY0 +L1vYyZIHmar1XRGVz+3plZ1MvX/EAJvoCDIXvshnl8kbsMWBwoHus5dRfLZYY950 +g36ARl5oEepxtS5QvUSMTcPTmJN5mxOJUiqsRLo9DQKBgQDyOatwmZLrWs8Sipet +pdJpPnBJ1TE+Dm1WmaUfmjoXJxi07Bfikex5ybqqed49s5TSb2OBU4eG/yVLQcix +ik0m4tG0NSEJ/EgfwUxdteHSjGmWnuiK0r3oAz6ffE32RfqvEoFRcCh/H8MdkVtg +ErVnxmpzv5elRSZ/DUn2uygxgA== -----END PRIVATE KEY-----`; +const es256Key = `-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIA3ISxaDm/NdIVmkuAWR5VTNNj2PTpe+eWhv2rUhNE9joAoGCCqGSM49 +AwEHoUQDQgAEY5Iad2fwtKm40eqg+hx4sxwsZwKm0WP/GDNGAPUisD3H2AlLedYE ++xZ8cehEKjddb6Bftv0I3PLGFMBQIyE0pA== +-----END EC PRIVATE KEY-----`; +const es384Key = `-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDAp0jx0wSk6L2od/DbovYvrhG/AKXAFpqaQ7/u8tgg7w0lBHWrA9yHF +YG1Z0k5lEACgBwYFK4EEACKhZANiAASYGNRZMaBebhOkwML7V4JJgiXqukoopqun +xXWTCEw4qCEqydsXE6TFVB2RJ0+hpjoK00XqVVvyv8fw6ZYH9y5dHmj0RsnBMrAm +oOhhUpXlZWsfiY97db80mKCp7n2MkNw= +-----END EC PRIVATE KEY-----`; +const es512Key = `-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIARI9C6QrByhpJ8paMAgKyz6piOIEF2wDxlPEFcVC3ZHSo4crE2Uc5 +E94EOuLNnKs/TinGMiTUhbefpfETI5SML4qgBwYFK4EEACOhgYkDgYYABADka9q3 +ZXy2j1ml6fQqFbG6ryD2+2Cu43xxDeEoec9PW4Dfe/hmkluYwSv15X5+VhBx36sh +Jeh34sXjACyMVXfLGQGS3Puxol0c1nyC1uv9ecxLJmWUtUmPm9Uz87tb3vhI636x +8YT3MpqHkOZnDm4CiG09QIS9ROUHKH/BGQ7QtH/9yA== +-----END EC PRIVATE KEY-----`; TestRegister.addTests([ { @@ -88,7 +114,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "ES256", "{}"], + args: [es256Key, "ES256", "{}"], }, { op: "JWT Decode", @@ -103,7 +129,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "ES384", "{}"], + args: [es384Key, "ES384", "{}"], }, { op: "JWT Decode", @@ -118,7 +144,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "ES512", "{}"], + args: [es512Key, "ES512", "{}"], }, { op: "JWT Decode", @@ -163,7 +189,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "RS512", "{}"], + args: [rsKey, "RS512", "{}"], }, { op: "JWT Decode", From 37c65ee4be48003c2089cfcc21dd2a75183cbf32 Mon Sep 17 00:00:00 2001 From: Kili Date: Mon, 23 Feb 2026 10:07:36 +0100 Subject: [PATCH 3/3] 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";