Skip to content

ci: build and publish on Node 22 LTS - #123

Merged
moshest merged 1 commit into
mainfrom
claude/node-upgrade
Aug 25, 2026
Merged

ci: build and publish on Node 22 LTS#123
moshest merged 1 commit into
mainfrom
claude/node-upgrade

Conversation

@moshest

@moshest moshest commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Node 20 is end-of-life, and all five workflow steps still pinned it — including the one that publishes @neuledge/context to npm. This moves them to Node 22 LTS.

Why 22 and not 24

I tested both against the real suite rather than picking by recency:

install build test
Node 24.19.0 ok ok FAIL — 187/221, exit 1
Node 22.23.2 ok ok 221/221 + 41/41, exit 0

Node 24 fails on the native dependency:

prebuild-install warn install No prebuilt binaries found
  (target=24.19.0 runtime=node arch=x64 libc= platform=linux)

better-sqlite3@11.10.0 ships no Node 24 binary, so it falls back to node-gyp rebuild. The compile succeeds, but package-builder.test.ts — the file that leans hardest on SQLite — then hangs until vitest kills the worker:

[vitest-pool]: Timeout terminating forks worker for test files
  .../packages/context/src/package-builder.test.ts

Node 22 uses a real prebuilt binary, so nothing compiles from source, and the whole suite is green.

This is the same class of failure behind the "40 pre-existing failures" reported on #117, which turned out to be Node v26 against this same better-sqlite3.

Path to Node 24

Not a dead end, just a different change. better-sqlite3@13.0.3 declares engines: { node: ">=22" } — so this bump is the prerequisite for that upgrade, not a detour around it. Sequence:

  1. Node 20 → 22 (this PR)
  2. better-sqlite3 11 → 13 (two majors; needs its own review and a changeset)
  3. Node 22 → 24, once a prebuild exists for it

Deliberately not included

No engines field on the published package. Adding one would newly restrict installs for users still on Node 20 — a user-facing change that needs its own PR and a changeset, not a silent rider on a CI bump.

Test plan

  • Full suite on Node 24.19.0 — reproduced the failure
  • Full suite on Node 22.23.2 — clean install, 221/221 + 41/41
  • ci.yml exercised by this PR's own checks
  • registry-update.yml — will dispatch from this branch with {"since": "2"} before merge, as with ci: update actions off the deprecated Node 20 runtime #122

Generated by Claude Code

Node 20 reached end of life, and all five workflow steps still pinned it —
including the one that publishes @neuledge/context to npm.

Node 22 rather than the newest LTS, because I tested both against the real
suite:

  Node 24.19.0  install ok, build ok, TESTS FAIL
                prebuild-install finds no binary for target=24.19.0, falls
                back to node-gyp, and package-builder.test.ts then hangs
                until the vitest worker is killed: 187/221 tests, exit 1.
  Node 22.23.2  install ok, build ok, 221/221 and 41/41, exit 0, and a real
                prebuilt binary so nothing compiles from source.

better-sqlite3 11.10.0 simply has no Node 24 prebuild. Reaching Node 24 means
first moving better-sqlite3 to 13.x, which itself declares engines
node >= 22 — so this bump is the prerequisite for that upgrade, not a
detour around it.

Leaves the published package's own constraints alone: no `engines` field is
added here, since that would newly restrict installs for users still on
Node 20 and belongs in its own change with a changeset.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c4c1cc8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@moshest
moshest marked this pull request as ready for review August 25, 2026 23:38
@moshest
moshest merged commit efa171b into main Aug 25, 2026
4 checks passed
@moshest
moshest deleted the claude/node-upgrade branch August 25, 2026 23:38
moshest added a commit that referenced this pull request Aug 31, 2026
node22.log and node24.log were local verification output from testing the
Node bump, committed by mistake in #123. That diff was reviewed with
`git diff --stat` before `git add -A`, and `git diff` only reports tracked
modifications — so two untracked log files were invisible at review time and
then swept in.

Adds *.log to .gitignore so the same slip cannot repeat.
moshest added a commit that referenced this pull request Aug 31, 2026
better-sqlite3 11.10.0 does not work on Node 24: it builds, then
package-builder.test.ts hangs until the vitest worker is killed. 13.0.3 is
fine there.

13.x also drops prebuild-install and ships prebuilt binaries inside the
package (gypfile: false, no install script), while our root pnpm
onlyBuiltDependencies still listed better-sqlite3 and forced a build anyway.
Removing that entry lets the shipped binaries be used, so installs get faster
rather than slower.

Measured on clean installs, reproduced independently after the first worktree
was lost: Node 22.22.2 and Node 24.20.0 both 221/221 + 41/41 with zero source
compiles. The nightly publish path was validated separately by dispatching
registry-update.yml from this branch with {"since": "2"} — run #195, success.

This corrects the explanation in #123, which blamed the missing Node 24
prebuild. That was not the cause: 13.x compiles from source on Node 24 too
when forced, and passes. The 11.x code itself is what does not work there.

better-sqlite3 stays an optionalDependency and the sql.js fallback is
unchanged, so a failed native load still degrades rather than breaks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants