Skip to content

build: require node 24.18 and pin dependency install scripts - #675

Merged
dcalhoun merged 2 commits into
trunkfrom
build/node-24-18
Sep 17, 2026
Merged

dcalhoun merged 2 commits into
trunkfrom
build/node-24-18

Conversation

@dcalhoun

@dcalhoun dcalhoun commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

What?

Upgrade the project to Node.js v24.18.

Why?

Unblock #660 and align with the
WordPress/gutenberg project.

How?

Bump the .nvmrc configuration file. Add additional configuration for npm
version, supported engines/devEngines, and allowedScripts.

🤖 Agent summary

build: require node 24.18 to match gutenberg

.nvmrc moves from 20 to 24.18, the version Gutenberg pins. Node 24.18 ships npm 11.16.0, which is also the npm floor Gutenberg declares.

The motivation is dependabot's Vitest 5 bump, which requires Node >= 22.12. vite is already ^8.0.16, past Vitest 5's >= 6.4.0 floor, so Node was the only blocker.

Three fields enforce the requirement, because each covers a different gap:

wrong Node/npm on npm install wrong Node/npm on npm run <script>
engines alone npm warn EBADENGINE no effect
engines + engine-strict npm error EBADENGINE, aborts no effect
devEngines npm error EBADDEVENGINES, aborts npm error EBADDEVENGINES, aborts

devEngines is the stronger of the two, but it is ignored by npm 10.8.2 — the npm bundled with Node 20 — so on its own it would miss exactly the contributors this PR moves away from. Verified: with devEngines in place, npm run test:unit under Node 20 runs all 231 tests without complaint. engine-strict is what every npm version honors, so it is the one that actually stops a Node 20 install. Gutenberg carries the same combination.

build: review and pin dependency install scripts

npm 11.16 reports which dependencies run install scripts and lets the project record a decision per package. Approved the five that produce or select a native binary the toolchain needs (electron, fsevents, @parcel/watcher, unrs-resolver, fs-ext-extra-prebuilt) and denied core-js, whose postinstall only prints a funding notice.

Entries are pinned to the reviewed version, so a bump that changes one of these scripts warns again rather than inheriting the earlier approval.

strict-allow-scripts is deliberately left off. It would turn an unapproved script from a warning into a hard install failure, at the cost of breaking CI on every dependency bump touching those packages until someone re-approves.

Verification

Ran on Node 24.18.0 after a clean npm ci:

  • make lint-js — clean
  • make test-js — 17 files, 231 tests passing
  • make build REFRESH_JS_BUILD=1 — succeeds (the rebuilt bundle is not part of this PR)
  • npm ci — no allow-scripts warnings remain, core-js's banner is gone, electron still downloads its binary
  • npm ci under Node 20 — fails with EBADENGINE, as intended

Testing Instructions

N/A, no user-facing changes.

Accessibility Testing Instructions

N/A, no user-facing changes.

Screenshots or screencast

N/A, no user-facing changes.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the [Type] Build Tooling Issues or PRs related to build tooling label Sep 17, 2026
dcalhoun and others added 2 commits September 16, 2026 21:56
Gutenberg develops against Node 24.18, while this project was pinned to
Node 20. Matching it keeps the toolchains aligned and clears the Node
22.12 floor that Vitest 5 requires.

`engines`, `devEngines`, and `engine-strict` mirror Gutenberg's setup so
an unsupported Node or npm version fails the install outright instead of
surfacing later as an obscure runtime error. The three cover different
gaps: `devEngines` also guards `npm run`, but is ignored by the npm 10
that ships with Node 20, so `engine-strict` is what stops the very
version this commit moves away from.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
npm 11.16 reports which dependencies run install scripts and lets the
project record a decision for each. Approve the five that produce or
select a native binary the toolchain needs, and deny core-js, whose
postinstall only prints a funding notice.

Entries are pinned to the reviewed version, so a bump that changes one of
these scripts warns again rather than inheriting the earlier approval.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wpmobilebot

Copy link
Copy Markdown

XCFramework Build

This PR's XCFramework is available for testing. Add the following to your Package.swift:

.package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/675")

Built from 3297824

@dcalhoun
dcalhoun marked this pull request as ready for review September 17, 2026 02:05
@dcalhoun
dcalhoun requested review from a team and oguzkocer September 17, 2026 02:05
@dcalhoun
dcalhoun merged commit afa8adc into trunk Sep 17, 2026
26 checks passed
@dcalhoun
dcalhoun deleted the build/node-24-18 branch September 17, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants