diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 89633bf993fe..562f9aafb3a7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node/.devcontainer/base.Dockerfile +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/main/containers/javascript-node/.devcontainer/base.Dockerfile -# [Choice] Node.js version: 16, 14, 12 -ARG VARIANT="16-buster" +# [Choice] Node.js version +ARG VARIANT="18-buster" FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # [Optional] Uncomment this section to install additional OS packages. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4a9cd18743e1..12ab2462a3b9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,8 +5,8 @@ "name": "docs.github.com", "build": { "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick a Node version: 12, 14, 16 - "args": { "VARIANT": "16" } + // Update 'VARIANT' to pick a Node version + "args": { "VARIANT": "18" } }, // Set *default* container specific settings.json values on container create. diff --git a/.github/actions/node-npm-setup/action.yml b/.github/actions/node-npm-setup/action.yml index d00faed4088a..c92092159111 100644 --- a/.github/actions/node-npm-setup/action.yml +++ b/.github/actions/node-npm-setup/action.yml @@ -11,10 +11,10 @@ runs: path: node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }} - - name: Setup node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install dependencies diff --git a/.github/workflows/azure-prod-build-deploy.yml b/.github/workflows/azure-prod-build-deploy.yml index c4a3be7c09db..1a0d29b230e8 100644 --- a/.github/workflows/azure-prod-build-deploy.yml +++ b/.github/workflows/azure-prod-build-deploy.yml @@ -55,10 +55,10 @@ jobs: # To prevent issues with cloning early access content later persist-credentials: 'false' - - name: Setup node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Clone docs-early-access diff --git a/.github/workflows/azure-staging-build-deploy.yml b/.github/workflows/azure-staging-build-deploy.yml index cb93698b8e6b..388e507f6f03 100644 --- a/.github/workflows/azure-staging-build-deploy.yml +++ b/.github/workflows/azure-staging-build-deploy.yml @@ -73,10 +73,10 @@ jobs: # Image tag is unique to each workflow run so that it always triggers a new deployment echo "DOCKER_IMAGE=${{ secrets.NONPROD_REGISTRY_SERVER }}/${{ env.IMAGE_REPO }}:${{ env.COMMIT_REF }}-${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV - - name: Setup node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Clone docs-early-access diff --git a/.github/workflows/browser-test.yml b/.github/workflows/browser-test.yml index fcb89286ca72..d3cf5623b8ed 100644 --- a/.github/workflows/browser-test.yml +++ b/.github/workflows/browser-test.yml @@ -51,10 +51,10 @@ jobs: - name: Checkout uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install dependencies diff --git a/.github/workflows/content-changes-table-comment.yml b/.github/workflows/content-changes-table-comment.yml index 8c21198c1705..b90a93166353 100644 --- a/.github/workflows/content-changes-table-comment.yml +++ b/.github/workflows/content-changes-table-comment.yml @@ -56,10 +56,10 @@ jobs: APP_NAME_SEED: ${{ secrets.PREVIEW_ENV_NAME_SEED }} run: .github/actions-scripts/get-preview-app-info.sh - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install temporary dependencies diff --git a/.github/workflows/docs-review-collect.yml b/.github/workflows/docs-review-collect.yml index 00b31d483088..eba67ee3796d 100644 --- a/.github/workflows/docs-review-collect.yml +++ b/.github/workflows/docs-review-collect.yml @@ -22,10 +22,10 @@ jobs: - name: Check out repo content uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install dependencies diff --git a/.github/workflows/os-ready-for-review.yml b/.github/workflows/os-ready-for-review.yml index eb0216f674ad..7c6acf5d72b3 100644 --- a/.github/workflows/os-ready-for-review.yml +++ b/.github/workflows/os-ready-for-review.yml @@ -46,10 +46,10 @@ jobs: - name: Check out repo content uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install dependencies diff --git a/.github/workflows/package-lock-lint.yml b/.github/workflows/package-lock-lint.yml index 4cc35b486981..eedfea32297a 100644 --- a/.github/workflows/package-lock-lint.yml +++ b/.github/workflows/package-lock-lint.yml @@ -27,10 +27,11 @@ jobs: - name: Check out repo uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' + cache: npm - name: Run check run: | diff --git a/.github/workflows/ready-for-doc-review.yml b/.github/workflows/ready-for-doc-review.yml index 5d6ffb64d6fe..3519df178005 100644 --- a/.github/workflows/ready-for-doc-review.yml +++ b/.github/workflows/ready-for-doc-review.yml @@ -22,10 +22,10 @@ jobs: - name: Check out repo content uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install dependencies diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index f0cbe44eebcd..427d2325bc8d 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -101,13 +101,13 @@ jobs: uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # Set up npm and run npm ci to get custom husky githooks error - # messages if they exist. We could also remove these two steps + # messages if they exist. We could also remove these steps # because currently we have no hooks with customer error messages. # See pull #32064 where they were removed. - - name: Setup node + - name: Setup Node.js uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: - node-version: '16.17.0' + node-version-file: '.node-version' cache: npm - name: Install dependencies run: npm ci diff --git a/.node-version b/.node-version index 1c2b43343f0b..d939939b2596 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.2.0 \ No newline at end of file +18.13.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c8372313f2f..a3c8ec603b80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ For more information about using a codespace for working on GitHub documentation - Using the command line: - [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them. -2. Install or update to **Node.js v16**. For more information, see [the development guide](contributing/development.md). +2. Install or update to **Node.js**, at the version specified in `.node-version`. For more information, see [the development guide](contributing/development.md). 3. Create a working branch and start with your changes! diff --git a/Dockerfile b/Dockerfile index 214c05df996d..0b90316e98be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,9 @@ # -------------------------------------------------------------------------------- # BASE IMAGE # -------------------------------------------------------------------------------- -FROM node:16.18.0-alpine@sha256:f16544bc93cf1a36d213c8e2efecf682e9f4df28429a629a37aaf38ecfc25cf4 as base +# To update the sha, run `docker pull node:$VERSION-alpine` +# look for something like: `Digest: sha256:0123456789abcdef` +FROM node:18.13.0-alpine@sha256:fda98168118e5a8f4269efca4101ee51dd5c75c0fe56d8eb6fad80455c2f5827 as base # This directory is owned by the node user ARG APP_HOME=/home/node/app @@ -24,7 +26,7 @@ COPY --chown=node:node package.json package-lock.json ./ RUN npm ci --no-optional --registry https://registry.npmjs.org/ # For Next.js v12+ -# This the appropriate necessary extra for node:16-alpine +# This the appropriate necessary extra for node:VERSION-alpine # Other options are https://www.npmjs.com/search?q=%40next%2Fswc RUN npm i @next/swc-linux-x64-musl --no-save diff --git a/Dockerfile.openapi_decorator b/Dockerfile.openapi_decorator index 6014681b41da..dc25ee8a159c 100644 --- a/Dockerfile.openapi_decorator +++ b/Dockerfile.openapi_decorator @@ -1,4 +1,4 @@ -FROM node:14-alpine +FROM node:18.13.0-alpine RUN apk add --no-cache git python make g++ diff --git a/contributing/development.md b/contributing/development.md index ee88816545ce..a5b7cfedd4e1 100644 --- a/contributing/development.md +++ b/contributing/development.md @@ -8,7 +8,7 @@ This site is powered by Node.js! :sparkles: :turtle: :rocket: :sparkles: It runs on macOS, Windows, and Linux environments. -You'll need Node.js version 16 to run the site. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](https://github.com/nodenv/nodenv#readme) for instructions on switching Node.js versions. +You'll need Node.js to run the site. Check the version in `.node-version`. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](https://github.com/nodenv/nodenv#readme) for instructions on switching Node.js versions. Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following: diff --git a/contributing/node-versions.md b/contributing/node-versions.md index 934f75157737..d47f374967c0 100644 --- a/contributing/node-versions.md +++ b/contributing/node-versions.md @@ -1,8 +1,6 @@ # Node Versions -In [development](contributing/development.md) environments this site will run on Node.js versions `12 - 14`. - -In [staging and production](contributing/deployments.md) environments this site runs on Node.js 14, the [Active LTS version](https://nodejs.org/en/about/releases/) from 2020-10-27 to 2021-10-26). +This site will run on the Node.js version specified in `.node-version`. When updating to a new Node.js version, consider the following files: @@ -32,10 +30,11 @@ sudo chown -R $(whoami) /usr/local/sbin If you're using another operating system, or did not use Homebrew to install nodenv, see these [upgrade instructions](https://github.com/nodenv/nodenv#installation). -To install Node.js 14 and make it your default version, run this command: +To install Node.js and make it your default version, run this command: ```sh -nodenv install 14.13.0 && nodenv global 14.13.0 +VERSION=`cat .node-version` +nodenv install $VERSION && nodenv global $VERSION ``` You may sometimes see a warning when running npm scripts with nodenv: