diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 02fb8b0fa2..1df72d64c0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "Node.js", // "Officially" maintained node devcontainer image from Microsoft // https://github.com/devcontainers/templates/tree/main/src/javascript-node - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. "features": { diff --git a/.github/actions/draft-release/Dockerfile b/.github/actions/draft-release/Dockerfile index 6502df98b7..3d98d23eaa 100644 --- a/.github/actions/draft-release/Dockerfile +++ b/.github/actions/draft-release/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-bullseye +FROM node:22-bullseye RUN apt-get update RUN apt-get install -y jq diff --git a/.github/workflows/coveralls-code-coverage.yml b/.github/workflows/coveralls-code-coverage.yml index 70e51b2438..265f9afdd6 100644 --- a/.github/workflows/coveralls-code-coverage.yml +++ b/.github/workflows/coveralls-code-coverage.yml @@ -31,8 +31,6 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - # Even though we're currently deploying on Node 20, we run coverage test on Node 22 - # to work around https://github.com/bcoe/v8-coverage/pull/2. node-version: 22 env: NPM_CONFIG_ENGINE_STRICT: 'false' diff --git a/.github/workflows/daily-tests.yml b/.github/workflows/daily-tests.yml index 0af24d80ba..f642ee16ee 100644 --- a/.github/workflows/daily-tests.yml +++ b/.github/workflows/daily-tests.yml @@ -31,7 +31,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Core tests if: always() diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index ee36a2e2da..64cfcc84fa 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -19,7 +19,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Danger run: npm run danger ci diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index a4d6c964b2..c391f9421c 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -19,7 +19,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Build run: npm run build-docs diff --git a/.github/workflows/test-bug-run-badge.yml b/.github/workflows/test-bug-run-badge.yml index 98f4df0e9b..ae4e21f5c2 100644 --- a/.github/workflows/test-bug-run-badge.yml +++ b/.github/workflows/test-bug-run-badge.yml @@ -40,7 +40,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 cypress: false - name: Output debug info diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index bcaab4010b..ac1c3e18af 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -26,7 +26,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 cypress: true - name: Run tests diff --git a/.github/workflows/test-integration-22.yml b/.github/workflows/test-integration-22.yml deleted file mode 100644 index 43c2dba7e2..0000000000 --- a/.github/workflows/test-integration-22.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Integration@node 22 -on: - pull_request: - types: [opened, reopened, synchronize] - push: - branches-ignore: - - 'gh-pages' - - 'dependabot/**' - -jobs: - test-integration-22: - runs-on: ubuntu-latest - env: - PAT_EXISTS: ${{ secrets.GH_PAT != '' }} - - services: - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: ci_test - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: ./.github/actions/setup - with: - node-version: 22 - env: - NPM_CONFIG_ENGINE_STRICT: 'false' - - - name: Integration Tests (with PAT) - if: ${{ env.PAT_EXISTS == 'true' }} - uses: ./.github/actions/integration-tests - with: - github-token: '${{ secrets.GH_PAT }}' - - - name: Integration Tests (with workflow token) - if: ${{ env.PAT_EXISTS == 'false' }} - uses: ./.github/actions/integration-tests - with: - github-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index fc65f55fad..f2d86a0b0f 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -35,7 +35,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Integration Tests (with PAT) if: ${{ env.PAT_EXISTS == 'true' }} diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index 9f2d7dfadd..94a14b72df 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -17,7 +17,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: ESLint if: always() diff --git a/.github/workflows/test-main-22.yml b/.github/workflows/test-main-22.yml deleted file mode 100644 index 20559ac650..0000000000 --- a/.github/workflows/test-main-22.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Main@node 22 -on: - pull_request: - types: [opened, reopened, synchronize] - push: - branches-ignore: - - 'gh-pages' - - 'dependabot/**' - -jobs: - test-main-22: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: ./.github/actions/setup - with: - node-version: 22 - env: - NPM_CONFIG_ENGINE_STRICT: 'false' - - - name: Core tests - uses: ./.github/actions/core-tests diff --git a/.github/workflows/test-main.yml b/.github/workflows/test-main.yml index d5888b2651..abb1cd6aee 100644 --- a/.github/workflows/test-main.yml +++ b/.github/workflows/test-main.yml @@ -22,7 +22,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Core tests uses: ./.github/actions/core-tests diff --git a/.github/workflows/test-package-cli.yml b/.github/workflows/test-package-cli.yml index 194e279e32..de2be291c9 100644 --- a/.github/workflows/test-package-cli.yml +++ b/.github/workflows/test-package-cli.yml @@ -18,6 +18,7 @@ jobs: include: - node: '20' - node: '22' + - node: '24' steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test-package-lib.yml b/.github/workflows/test-package-lib.yml index dc9e5e8dbd..45b7230aa2 100644 --- a/.github/workflows/test-package-lib.yml +++ b/.github/workflows/test-package-lib.yml @@ -15,8 +15,11 @@ jobs: include: - node: '20' npm: '^10' - engine-strict: 'true' + engine-strict: 'false' - node: '22' + npm: '^11' + engine-strict: 'true' + - node: '24' npm: '^11' engine-strict: 'false' steps: diff --git a/.github/workflows/test-services-22.yml b/.github/workflows/test-services-22.yml deleted file mode 100644 index 5f47dc86c9..0000000000 --- a/.github/workflows/test-services-22.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Services@node 22 -on: - pull_request: - types: [opened, edited, reopened, synchronize] - push: - branches: - - 'gh-readonly-queue/**' - -jobs: - test-services-22: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: ./.github/actions/setup - with: - node-version: 22 - env: - NPM_CONFIG_ENGINE_STRICT: 'false' - - - name: Service tests (triggered from local branch) - if: github.event.pull_request.head.repo.full_name == github.repository - uses: ./.github/actions/service-tests - with: - github-token: '${{ secrets.GH_PAT }}' - librariesio-tokens: '${{ secrets.SERVICETESTS_LIBRARIESIO_TOKENS }}' - obs-user: '${{ secrets.SERVICETESTS_OBS_USER }}' - obs-pass: '${{ secrets.SERVICETESTS_OBS_PASS }}' - pepy-key: '${{ secrets.SERVICETESTS_PEPY_KEY }}' - reddit-client-id: '${{ secrets.SERVICETESTS_REDDIT_CLIENT_ID }}' - reddit-client-secret: '${{ secrets.SERVICETESTS_REDDIT_CLIENT_SECRET }}' - sl-insight-user-uuid: '${{ secrets.SERVICETESTS_SL_INSIGHT_USER_UUID }}' - sl-insight-api-token: '${{ secrets.SERVICETESTS_SL_INSIGHT_API_TOKEN }}' - twitch-client-id: '${{ secrets.SERVICETESTS_TWITCH_CLIENT_ID }}' - twitch-client-secret: '${{ secrets.SERVICETESTS_TWITCH_CLIENT_SECRET }}' - youtube-api-key: '${{ secrets.SERVICETESTS_YOUTUBE_API_KEY }}' - - - name: Service tests (triggered from fork) - if: github.event.pull_request.head.repo.full_name != github.repository - uses: ./.github/actions/service-tests - with: - github-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/test-services.yml b/.github/workflows/test-services.yml index a44021266e..f8d85a1c60 100644 --- a/.github/workflows/test-services.yml +++ b/.github/workflows/test-services.yml @@ -17,7 +17,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Service tests (triggered from local branch) if: github.event.pull_request.head.repo.full_name == github.repository diff --git a/.github/workflows/update-github-api.yml b/.github/workflows/update-github-api.yml index 33718a9cfc..b4d067d81e 100644 --- a/.github/workflows/update-github-api.yml +++ b/.github/workflows/update-github-api.yml @@ -19,7 +19,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 20 + node-version: 22 - name: Check for new GitHub API version run: node scripts/update-github-api.js diff --git a/Dockerfile b/Dockerfile index 265277cbd5..01ba8b8a94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine AS builder +FROM node:22-alpine AS builder RUN npm install -g "npm@^10" @@ -22,7 +22,7 @@ RUN npm run build \ # Use multi-stage build to reduce size -FROM node:20-alpine +FROM node:22-alpine ARG version=dev ENV DOCKER_SHIELDS_VERSION=$version diff --git a/README.md b/README.md index 40a3591587..622e094af4 100644 --- a/README.md +++ b/README.md @@ -98,8 +98,7 @@ If you intend on reporting or contributing a fix related to security vulnerabili [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/badges/shields?quickstart=1) -1. Install Node 20 or later. You can use the [package manager][] of your choice. - Tests need to pass in Node 20 and 22. +1. Install Node 22. You can use the [package manager][] of your choice. 2. Clone this repository. 3. Run `npm ci` to install the dependencies. 4. Run `npm start` to start the badge server and the frontend dev server. diff --git a/doc/TUTORIAL.md b/doc/TUTORIAL.md index 9abfbefdd6..5a0ecb2bd8 100644 --- a/doc/TUTORIAL.md +++ b/doc/TUTORIAL.md @@ -25,7 +25,7 @@ and learn about the [GitHub workflow](http://try.github.io/). #### Node, NPM -Node >=20 and NPM 9.x or 10.x is required. If you don't already have them, +Node 22 and NPM 10.x or 11.x is required. If you don't already have them, install node and npm: https://nodejs.org/en/download/ ### Setup a dev install diff --git a/doc/self-hosting.md b/doc/self-hosting.md index f7b56f66b1..8d3f4555da 100644 --- a/doc/self-hosting.md +++ b/doc/self-hosting.md @@ -4,13 +4,13 @@ This document describes how to host your own shields server either from source o ## Installing from Source -You will need Node 20 or later, which you can install using a +You will need Node 22, which you can install using a [package manager][]. On Ubuntu / Debian: ```sh -curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -; sudo apt-get install -y nodejs +curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -; sudo apt-get install -y nodejs ``` ```sh diff --git a/package-lock.json b/package-lock.json index 50d6661df2..8088c8867e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -126,8 +126,8 @@ "url": "^0.11.4" }, "engines": { - "node": "^20 || ^22", - "npm": "^9 || ^10 || ^11" + "node": "^22", + "npm": "^10 || ^11" } }, "badge-maker": { diff --git a/package.json b/package.json index 8ee46fbaf6..6294b6acf2 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "pretest": "cross-env BASE_URL=http://localhost:8080 run-s --silent defs", "test": "run-s --silent --continue-on-error lint test:package test:core test:entrypoint check-types:package prettier:check", "check-types:package": "tsd badge-maker", - "depcheck": "check-node-version --node \">= 20.0\"", + "depcheck": "check-node-version --node \"^22\"", "prebuild": "run-s --silent depcheck", "defs": "node scripts/export-openapi-cli.js", "build": "rimraf public && run-s defs docusaurus:build", @@ -214,8 +214,8 @@ "url": "^0.11.4" }, "engines": { - "node": "^20 || ^22", - "npm": "^9 || ^10 || ^11" + "node": "^22", + "npm": "^10 || ^11" }, "type": "module", "collective": {