root - fix: allow Node 24+ in engines.node - #488
Conversation
- engines.node "^22.18.0" -> "^22.18.0 || >=24.0.0" "^22.18.0" resolves to >=22.18.0 <23.0.0, so it excludes Node 24 and 26 even though .nvmrc pins 24 and .github/workflows/tests.yml runs the suite on 22, 24, and 26. The package was declaring unsupported the exact versions it tests on. The constraint was introduced in 6.1.3 (6.1.2 declared ">=20") and looks like a dropped clause rather than an intentional narrowing: the sibling package docula uses "^22.18.0 || >=24.0.0", which allows 22.18+ and 24+ while skipping the odd-numbered 23 line. This restores that form. Consumer impact: installing a package that depends on writr under Node 24+ with engine-strict=true currently fails with ERR_PNPM_UNSUPPORTED_ENGINE before any code runs. Surfaced downstream in jaredwray/ecto#389. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i8MS4p9jRHqTWqGW6JXQE
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #488 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 518 518
Branches 144 144
=========================================
Hits 518 518 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The harness-parity "Browser smoke (Chromium)" step ran the browser installer from the repo root, where playwright-core is not a dependency. npx therefore fetched the newest release from the registry instead of using the copy the smoke test actually loads. browser-smoke.mjs resolves playwright-core from writr-rs/crates/writr-node (createRequire against that package.json), which pins ^1.61.1 -> 1.61.1 -> chromium-headless-shell revision 1228. playwright-core 1.62.0 published 2026-07-24 and installs revision 1234, so the installer downloaded 1234 while the launcher looked for 1228: browserType.launch: Executable doesn't exist at .../ms-playwright/chromium_headless_shell-1228/... Running the installer from crates/writr-node with pnpm exec uses the pinned binary, so installer and launcher always agree and the step cannot drift again when a new playwright-core ships. This break is independent of the engines.node change in this branch: it is latent on main, which last ran writr-rs on 2026-07-16, eight days before 1.62.0 was published. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i8MS4p9jRHqTWqGW6JXQE
|
What failedThe job downloaded browser build 1234 and then tried to launch 1228. WhyTwo different
const require = createRequire(join(nodeDir, "package.json"));
const { chromium } = require("playwright-core");but the workflow step has no Why it started now
The fix-npx playwright-core install chromium --with-deps || npx playwright install chromium --with-deps
+(cd writr-rs/crates/writr-node && pnpm exec playwright-core install chromium --with-deps)
Verified locally: Generated by Claude Code |
Please check if the PR fulfills these requirements
package.jsonmetadata fix; no source change, so no new tests. The existing suite passes unchanged (186 tests, 100% statements/functions/lines).What kind of change does this PR introduce?
Bug fix —
engines.nodecurrently excludes the Node versions this package is actually tested on and shipped for.Summary
^22.18.0resolves to>=22.18.0 <23.0.0, so it excludes Node 24 and 26.Why this looks unintended
The repo already treats 24 as its primary target, and the declaration contradicts that in three places:
.nvmrc24.github/workflows/tests.ymlnode-version: ['22', '24', '26'].github/workflows/code-coverage.yml,deploy-site.ymlnode-version: 24engines.node(before this PR)^22.18.0— excludes 24 and 26So the package declares as unsupported the exact versions its own CI exercises.
It also appears to be a dropped clause rather than a deliberate narrowing:
engines.node6.1.2>=206.1.3^22.18.06.1.4^22.18.0The sibling package
doculauses^22.18.0 || >=24.0.0— allow 22.18+ and 24+, skip the odd-numbered 23 line. This PR restores that form, which matches the intent the rest of the repo already expresses.Consumer impact
Installing any package that depends on
writrunder Node 24+ withengine-strict=truecurrently aborts withERR_PNPM_UNSUPPORTED_ENGINEbefore any code runs. Default installs are unaffected, since pnpm and npm only enforceengineswhen strict mode is on — which is why this went unnoticed.Surfaced downstream in jaredwray/ecto#389, where
ectodepends onwritrand supports Node 22/24/26. Becauseectodeclareswritr: ^6.1.2, consumers already resolve to6.1.4, so they are exposed today.Verification
pnpm install --frozen-lockfilecleanpnpm buildpassespnpm test:cipasses — 186 tests, 100% statements / 100% functions / 100% lines / 98.76% branches (unchanged frommain)No lockfile change —
enginesdoes not affect resolution.Generated by Claude Code