Repository navigation
chore: require Node.js 22 and test Node.js 22 and 24 on Ubuntu, Windows and macOS #171
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Test dependencies are installed without a lockfile and without install scripts. | ||
| package-lock=false | ||
| ignore-scripts=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "information-accessibility-skill-workspace", | ||
| "private": true, | ||
| "description": "Development workspace for verification. The installable CLI package is shared/skill/package.json.", | ||
| "scripts": { | ||
| "sync": "node scripts/sync-distributions.mjs --write", | ||
| "verify": "node scripts/verify-all.mjs" | ||
| }, | ||
| "devDependencies": { | ||
| "exceljs": "4.4.0" | ||
| }, | ||
| "engines": { | ||
| "node": ">=22" | ||
| }, | ||
| "license": "MIT" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ | |
| } | ||
| }, | ||
| "engines": { | ||
| "node": ">=20" | ||
| "node": ">=22" | ||
| }, | ||
| "license": "MIT" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import assert from "node:assert/strict"; | ||
| import fs from "node:fs"; | ||
| import path from "node:path"; | ||
| import { spawnSync } from "node:child_process"; | ||
| import test from "node:test"; | ||
| import { fileURLToPath } from "node:url"; | ||
|
|
||
| const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); | ||
| const skillRoot = path.join(root, "codex/skills/information-accessibility-practice"); | ||
| const readText = (...parts) => fs.readFileSync(path.join(root, ...parts), "utf8").replace(/\r\n/gu, "\n"); | ||
| const readJson = (...parts) => JSON.parse(readText(...parts)); | ||
|
|
||
| const skillPackage = readJson("shared/skill/package.json"); | ||
| const minimumMajor = Number(/^>=(\d+)$/u.exec(skillPackage.engines.node)?.[1]); | ||
|
|
||
| test("the Node.js baseline is declared once per surface and agrees everywhere", () => { | ||
| // Node.js 20 reached end of life on 2026-04-30. | ||
| assert.ok(Number.isInteger(minimumMajor) && minimumMajor >= 22, `engines.node must be >=N with N of at least 22: ${skillPackage.engines.node}`); | ||
| const workspace = readJson("package.json"); | ||
| assert.equal(workspace.private, true); | ||
| assert.equal(workspace.engines.node, skillPackage.engines.node); | ||
| assert.equal(workspace.devDependencies.exceljs, skillPackage.dependencies.exceljs); | ||
| assert.equal(readJson("shared/skill/references/web-capabilities.json").dependencies.node, skillPackage.engines.node); | ||
| const doctor = spawnSync(process.execPath, [path.join(skillRoot, "scripts/accessibility-audit.mjs"), "doctor", "--format", "json"], { cwd: root, encoding: "utf8" }); | ||
| assert.equal(doctor.status, 0, doctor.stderr || doctor.stdout); | ||
| const reported = JSON.parse(doctor.stdout).node; | ||
| assert.equal(reported.required, skillPackage.engines.node); | ||
| assert.equal(reported.supported, Number.parseInt(process.versions.node, 10) >= minimumMajor); | ||
| }); | ||
|
|
||
| test("documentation states the same minimum Node.js major", () => { | ||
| for (const file of ["README.md", "README.en.md", "docs/installing.md", "docs/version-support.md"]) { | ||
| const stated = [...readText(file).matchAll(/Node\.js (\d+)(?:以上| or later)/gu)].map((match) => Number(match[1])); | ||
| assert.ok(stated.length > 0, `${file} states no Node.js minimum`); | ||
| assert.ok(stated.every((major) => major === minimumMajor), `${file} states Node.js ${stated.join(", ")}`); | ||
| } | ||
| }); | ||
|
|
||
| test("CI tests every supported Node.js major on Ubuntu, Windows and macOS and runs nothing older", () => { | ||
| const verify = readText(".github/workflows/verify.yml"); | ||
| const nodes = JSON.parse(/node:\s*(\[[^\]]*\])/u.exec(verify)?.[1] ?? "[]"); | ||
| const systems = (/os:\s*\[([^\]]*)\]/u.exec(verify)?.[1] ?? "").split(",").map((item) => item.trim()); | ||
| assert.ok(nodes.includes(minimumMajor), `the verify matrix omits Node.js ${minimumMajor}`); | ||
| assert.ok(nodes.every((major) => major >= minimumMajor), `the verify matrix lists ${nodes.join(", ")}`); | ||
| assert.deepEqual(systems, ["ubuntu-latest", "windows-latest", "macos-latest"]); | ||
| for (const file of fs.readdirSync(path.join(root, ".github/workflows")).filter((name) => name.endsWith(".yml"))) { | ||
| for (const match of readText(".github/workflows", file).matchAll(/node-version:\s*(\d+)\s*$/gmu)) { | ||
| assert.ok(Number(match[1]) >= minimumMajor, `${file} runs Node.js ${match[1]}`); | ||
| } | ||
| } | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-files.jsonnow ships this test, but therootFilesallow-list inscripts/build-release.mjsstill excludes the newly required rootpackage.jsonand.npmrc. In every generated source release,node scripts/verify-all.mjstherefore reaches this line and fails withENOENTforpackage.json; the documentednpm run verifycannot start either. Add the workspace files to the release allow-list and inventory, or keep the shipped verifier independent of files excluded from the archive.Useful? React with 👍 / 👎.