From a2ba8d28511ec752122b5fef99d599b1688248f2 Mon Sep 17 00:00:00 2001 From: LB Date: Mon, 4 Nov 2024 18:32:28 +1000 Subject: [PATCH] Update to Node 22 (active LTS) Include a refinement of how to use Node in the development instructions, avoid writing the Node/Python version multiple times. Update CI files to reference the nvmrc file. - See https://nodejs.org/en/blog/release/v22.11.0 - See https://github.com/wagtail/wagtail/issues/12531 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish.yml | 2 +- .nvmrc | 2 +- .readthedocs.yaml | 2 +- docs/development.rst | 7 ++++--- package-lock.json | 2 +- package.json | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0678d50a..02d7fd53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.nvmrc' cache: 'npm' - uses: actions/setup-python@v5 with: @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.nvmrc' cache: 'npm' - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2cf383fc..39c63474 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 20 + node-version-file: '.nvmrc' cache: npm - name: Install Node dependencies diff --git a/.nvmrc b/.nvmrc index 209e3ef4..2bd5a0a9 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +22 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9863b229..d0b9bfa3 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,7 +7,7 @@ build: os: ubuntu-22.04 tools: python: '3.12' - nodejs: '20' + nodejs: '22' jobs: post_install: - make install-frontend diff --git a/docs/development.rst b/docs/development.rst index 1abc7948..84d3c488 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -7,8 +7,9 @@ Development =========== -For local development you need a system with Node v20.x, Python3, and Git. -It is strongly recommended to use a Python virtual environment (`venv`_). +For local development you need a system with Node v22.x, Python3, and Git. +It is strongly recommended to use a Python virtual environment (`venv`_) and +you use `fnm `_ to manage your Node versions. The build process derives the version from repository data, so it's necessary to clone the repository and not just download a single snapshot. @@ -81,7 +82,7 @@ rather than using the shortcuts in the Makefile. Assume the commands below are all run in PowerShell. These instructions will also work on Mac or Linux without make installed as well. -First, be sure to install Python 3, and Node 20. +First, be sure to install Python, and Node. `fnm `_ is really useful for managing multiple versions of Node on Windows. diff --git a/package-lock.json b/package-lock.json index c42c16a6..8a800baa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "webpack-cli": "^5.1.4" }, "engines": { - "node": ">=20" + "node": ">=22" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 5dc7cb5a..b8845af6 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "lint": "npm run lint:js && npm run lint:css" }, "engines": { - "node": ">=20" + "node": ">=22" }, "prettier": { "singleQuote": true,