Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to Node 22, enable corepack to manage yarn versions #4351

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VARIANT=18
ARG VARIANT=22
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:dev-${VARIANT}

COPY .tmux.conf /home/node/.tmux.conf
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/setup-node-yarn-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ description: Runs all the setup steps required to have the proper Node version a
runs:
using: composite
steps:
# Corepack must be enabled _before_ running setup-node, otherwise the caching setup will error
- name: Enable corepack
run: corepack enable
shell: bash

- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
22.12.0
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.1.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ logFilters:
level: discard

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.1.cjs
2 changes: 1 addition & 1 deletion adminSiteServer/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe("OwidAdminApp", () => {
)
expect(nodeVersion.status).toBe(200)
const text = await nodeVersion.text()
expect(text).toBe("v18.16.0")
expect(text).toBe("v22.12.0")
})

it("should be able to edit a chart via the api", async () => {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
dockerfile: Dockerfile
args:
# [Choice] Node.js version: 16, 14, 12
VARIANT: 18
VARIANT: 22
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
#USER_UID: 1000
#USER_GID: 1000
Expand Down
6 changes: 3 additions & 3 deletions docs/local-typescript-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This local environment requires some manual setup. For a faster way to get start

You need the following to be able to compile the grapher project and run the tests or use our Storybook:

- [Node 18](https://nodejs.org/en/)
- [Node 22](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/)

All further dependencies will be automatically installed by the yarn package manager.
Expand Down Expand Up @@ -50,10 +50,10 @@ Note: on Windows we strongly recommend using the [Windows Subsystem for Linux](h

(this will pick up the right version from `.nvmrc`)

5. Install yarn:
5. Enable [Corepack](https://nodejs.org/docs/latest-v22.x/api/corepack.html), which provides `yarn` versions:

```sh
npm install -g yarn
corepack enable
```

6. Run yarn inside the repo folder to install dependencies:
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"private": true,
"version": "3.0.0",
"engines": {
"node": ">=18.16"
"node": ">=22.10"
},
"packageManager": "yarn@4.1.1",
"packageManager": "yarn@4.5.3",
"scripts": {
"batchTagWithGpt": "tsx --tsconfig tsconfig.tsx.json baker/batchTagWithGpt.ts",
"buildCoverage": "jest --coverage=true --coverageProvider=v8",
Expand Down Expand Up @@ -248,7 +248,8 @@
"wrangler": "^3.81.0"
},
"resolutions": {
"@types/node": "20.8.3"
"@types/node": "20.8.3",
"whatwg-url": "14.1.0"
},
"prettier": {
"trailingComma": "es5",
Expand Down
90 changes: 16 additions & 74 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13826,13 +13826,6 @@ __metadata:
languageName: node
linkType: hard

"lodash.sortby@npm:^4.7.0":
version: 4.7.0
resolution: "lodash.sortby@npm:4.7.0"
checksum: 10/38df19ae28608af2c50ac342fc1f414508309d53e1d58ed9adfb2c3cd17c3af290058c0a0478028d932c5404df3d53349d19fa364ef6bed6145a6bc21320399e
languageName: node
linkType: hard

"lodash@npm:^4.0.1, lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.21":
version: 4.17.21
resolution: "lodash@npm:4.17.21"
Expand Down Expand Up @@ -16261,10 +16254,10 @@ __metadata:
languageName: node
linkType: hard

"punycode@npm:^2.1.0, punycode@npm:^2.1.1":
version: 2.1.1
resolution: "punycode@npm:2.1.1"
checksum: 10/939daa010c2cacebdb060c40ecb52fef0a739324a66f7fffe0f94353a1ee83e3b455e9032054c4a0c4977b0a28e27086f2171c392832b59a01bd948fd8e20914
"punycode@npm:^2.1.0, punycode@npm:^2.1.1, punycode@npm:^2.3.1":
version: 2.3.1
resolution: "punycode@npm:2.3.1"
checksum: 10/febdc4362bead22f9e2608ff0171713230b57aff9dddc1c273aa2a651fbd366f94b7d6a71d78342a7c0819906750351ca7f2edd26ea41b626d87d6a13d1bd059
languageName: node
linkType: hard

Expand Down Expand Up @@ -19374,28 +19367,12 @@ __metadata:
languageName: node
linkType: hard

"tr46@npm:^1.0.1":
version: 1.0.1
resolution: "tr46@npm:1.0.1"
dependencies:
punycode: "npm:^2.1.0"
checksum: 10/6e80d75480cb6658f7f283c15f5f41c2d4dfa243ca99a0e1baf3de6cc823fc4c829f89782a7a11e029905781fccfea42d08d8a6674ba7948c7dbc595b6f27dd3
languageName: node
linkType: hard

"tr46@npm:^3.0.0":
version: 3.0.0
resolution: "tr46@npm:3.0.0"
"tr46@npm:^5.0.0":
version: 5.0.0
resolution: "tr46@npm:5.0.0"
dependencies:
punycode: "npm:^2.1.1"
checksum: 10/b09a15886cbfaee419a3469081223489051ce9dca3374dd9500d2378adedbee84a3c73f83bfdd6bb13d53657753fc0d4e20a46bfcd3f1b9057ef528426ad7ce4
languageName: node
linkType: hard

"tr46@npm:~0.0.3":
version: 0.0.3
resolution: "tr46@npm:0.0.3"
checksum: 10/8f1f5aa6cb232f9e1bdc86f485f916b7aa38caee8a778b378ffec0b70d9307873f253f5cbadbe2955ece2ac5c83d0dc14a77513166ccd0a0c7fe197e21396695
punycode: "npm:^2.3.1"
checksum: 10/29155adb167d048d3c95d181f7cb5ac71948b4e8f3070ec455986e1f34634acae50ae02a3c8d448121c3afe35b76951cd46ed4c128fd80264280ca9502237a3e
languageName: node
linkType: hard

Expand Down Expand Up @@ -19799,11 +19776,11 @@ __metadata:

"typescript@patch:typescript@npm%3A>=3 < 6#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A~5.7.2#optional!builtin<compat/typescript>":
version: 5.7.2
resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=5adc0c"
resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=5786d5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/ff27fc124bceb8969be722baa38af945b2505767cf794de3e2715e58f61b43780284060287d651fcbbdfb6f917f4653b20f4751991f17e0706db389b9bb3f75d
checksum: 10/d75ca10141afc64fd3474b41a8b082b640555bed388d237558aed64e5827ddadb48f90932c7f4205883f18f5bcab8b6a739a2cfac95855604b0dfeb34bc2f3eb
languageName: node
linkType: hard

Expand Down Expand Up @@ -20469,20 +20446,6 @@ __metadata:
languageName: node
linkType: hard

"webidl-conversions@npm:^3.0.0":
version: 3.0.1
resolution: "webidl-conversions@npm:3.0.1"
checksum: 10/b65b9f8d6854572a84a5c69615152b63371395f0c5dcd6729c45789052296df54314db2bc3e977df41705eacb8bc79c247cee139a63fa695192f95816ed528ad
languageName: node
linkType: hard

"webidl-conversions@npm:^4.0.2":
version: 4.0.2
resolution: "webidl-conversions@npm:4.0.2"
checksum: 10/594187c36f2d7898f89c0ed3b9248a095fa549ecc1befb10a97bc884b5680dc96677f58df5579334d8e0d1018e5ef075689cfa2a6c459f45a61a9deb512cb59e
languageName: node
linkType: hard

"webidl-conversions@npm:^7.0.0":
version: 7.0.0
resolution: "webidl-conversions@npm:7.0.0"
Expand All @@ -20506,34 +20469,13 @@ __metadata:
languageName: node
linkType: hard

"whatwg-url@npm:^11.0.0":
version: 11.0.0
resolution: "whatwg-url@npm:11.0.0"
"whatwg-url@npm:14.1.0":
version: 14.1.0
resolution: "whatwg-url@npm:14.1.0"
dependencies:
tr46: "npm:^3.0.0"
tr46: "npm:^5.0.0"
webidl-conversions: "npm:^7.0.0"
checksum: 10/dfcd51c6f4bfb54685528fb10927f3fd3d7c809b5671beef4a8cdd7b1408a7abf3343a35bc71dab83a1424f1c1e92cc2700d7930d95d231df0fac361de0c7648
languageName: node
linkType: hard

"whatwg-url@npm:^5.0.0":
version: 5.0.0
resolution: "whatwg-url@npm:5.0.0"
dependencies:
tr46: "npm:~0.0.3"
webidl-conversions: "npm:^3.0.0"
checksum: 10/f95adbc1e80820828b45cc671d97da7cd5e4ef9deb426c31bcd5ab00dc7103042291613b3ef3caec0a2335ed09e0d5ed026c940755dbb6d404e2b27f940fdf07
languageName: node
linkType: hard

"whatwg-url@npm:^7.0.0":
version: 7.1.0
resolution: "whatwg-url@npm:7.1.0"
dependencies:
lodash.sortby: "npm:^4.7.0"
tr46: "npm:^1.0.1"
webidl-conversions: "npm:^4.0.2"
checksum: 10/769fd35838b4e50536ae08d836472e86adbedda1d5493ea34353c55468147e7868b91d2535b59e01a9e7331ab7e4cdfdf5490c279c045da23c327cf33e32f755
checksum: 10/3afd325de6cf3a367820ce7c3566a1f78eb1409c4f27b1867c74c76dab096d26acedf49a8b9b71db53df7d806ec2e9ae9ed96990b2f7d1abe6ecf1fe753af6eb
languageName: node
linkType: hard

Expand Down
Loading