Skip to content

deps: better-sqlite3 13.x, and stop forcing a source build - #127

Merged
moshest merged 1 commit into
mainfrom
claude/bump-better-sqlite3
Aug 31, 2026
Merged

deps: better-sqlite3 13.x, and stop forcing a source build#127
moshest merged 1 commit into
mainfrom
claude/bump-better-sqlite3

Conversation

@moshest

@moshest moshest commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

Two changes that only make sense together.

1. better-sqlite3 11.9.1 → 13.0.3. 11.10.0 does not work on Node 24 — it builds, then package-builder.test.ts hangs until the vitest worker is killed. That was the blocker recorded in #123. 13.0.3 is fine there.

2. Drop better-sqlite3 from root pnpm.onlyBuiltDependencies. 13.x removed prebuild-install and now ships prebuilt binaries inside the package (gypfile: false, no install script). Our config still forced pnpm to build it — so with the bump alone, every install would compile from source on both Node versions. Removing the entry lets the shipped binaries be used.

Measured

Clean install of each, in a fresh worktree, reproduced twice:

install / lint / build / test tests source compiles
Node 22.22.2 all 0 221/221 + 41/41 0
Node 24.20.0 all 0 221/221 + 41/41 0

So installs get faster on both versions, not slower — and Node 24 is now unblocked.

Correction to #123

That commit blamed the missing Node 24 prebuild for the failure. That was wrong. 13.x also compiles from source on Node 24 when forced, and passes — so the absent prebuild wasn't the cause. The 11.x code itself is what doesn't work there. Recording it here so the reasoning in the history isn't misleading.

Risk

better-sqlite3 stays an optionalDependency, and the sql.js WebAssembly fallback in database.ts is untouched — a failed native load still degrades rather than breaks. API surface used by this repo is only .prepare(), .exec(), .transaction(), .close(), all stable across these majors.

Follow-up

Node 22 → 24 is now a one-line change, if wanted. Not included here: this PR should be revertable on its own.

Test plan

  • Node 22: install --no-frozen-lockfile, lint, build, test — all pass
  • Node 24: install, build, test — all pass
  • Verified packages/context resolves 13.0.3
  • Verified zero node-gyp rebuild invocations on both
  • Changeset added (published package)

Generated by Claude Code

Two changes that only make sense together.

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. That was the
blocker recorded in #123. 13.0.3 is fine there.

13.x also drops prebuild-install and ships prebuilt binaries inside the
package (gypfile: false, no install script). Our root pnpm
onlyBuiltDependencies still listed better-sqlite3, which forces pnpm to build
it anyway — so with the bump alone, every install would compile from source
on both Node versions. Removing that entry lets the shipped binaries be used.

Measured on a clean install of each, twice, in a fresh worktree:

  Node 22.22.2  install/lint/build/test all 0, 221/221 + 41/41,
                0 source compiles
  Node 24.20.0  install/build/test all 0, 221/221 + 41/41,
                0 source compiles

This also corrects the explanation given in #123. That commit blamed the
missing Node 24 prebuild for the failure. It 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 in
database.ts is unchanged, so a failed native load still degrades rather than
breaks.

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

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9af9649

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@neuledge/context Patch
@neuledge/registry Patch

Not sure what this means? Click here to learn what changesets are.

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

@moshest
moshest marked this pull request as ready for review August 31, 2026 23:27
@moshest
moshest merged commit cc56537 into main Aug 31, 2026
4 checks passed
@moshest
moshest deleted the claude/bump-better-sqlite3 branch August 31, 2026 23:27
@github-actions github-actions Bot mentioned this pull request Aug 31, 2026
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