Drop better-sqlite3 to remove deprecated prebuild-install (#75)#76
Merged
Drop better-sqlite3 to remove deprecated prebuild-install (#75)#76
Conversation
npm was warning on every install that [email protected] is no longer maintained. prebuild-install ships as a transitive dependency of better-sqlite3 and upstream PR #1446 to replace it is still open, so we switch to Node's built-in node:sqlite module (stable in Node 24, experimental in Node 22/23) and remove the better-sqlite3 dep entirely. - src/sqlite.ts: uses DatabaseSync from node:sqlite. The one-shot ExperimentalWarning about SQLite on Node 22/23 is silenced for that specific warning; other warnings pass through unchanged. - package.json: engines.node bumped to >=22 (Node 20 EOL 2026-04-30), better-sqlite3 and @types/better-sqlite3 removed, @types/node added (it was coming in transitively via @types/better-sqlite3). - tests/providers/opencode.test.ts: fixture DB creation switched to node:sqlite (API parity for the CREATE TABLE + INSERT + prepare path we use). End-user install footprint shrinks from 167 to 40 packages and prints zero deprecation warnings. Credit: @primeminister for the report.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #75.
Summary
better-sqlite3with Node's built-innode:sqlite(stable in Node 24, experimental in Node 22 / 23). Upstream better-sqlite3 #1446 to replaceprebuild-installis still open, so a drop-in swap is the fastest path to a clean install.engines.nodebumped from>=20to>=22(Node 20 reaches EOL on 2026-04-30 andnode:sqliteis only available from 22 onwards).node:sqliteis loaded is silenced for that specific warning only. Other warnings still surface.Reproduction of the original issue (0.7.2)
After this change
Package count drops from 167 to 40. Zero deprecation warnings.
Changes
src/sqlite.ts--DatabaseSyncfromnode:sqlitebehind the sameSqliteDatabasefacade we already had, so call sites (src/providers/cursor.ts,src/providers/opencode.ts) are untouched. Includes a narrowprocess.emitshim that suppresses only theExperimentalWarningwhose message matches/SQLite/i, leaving every other warning intact.package.json-- removedbetter-sqlite3(wasoptionalDependencies), removed@types/better-sqlite3, added@types/node(was coming in transitively), bumpedengines.node.tests/providers/opencode.test.ts-- fixture DB creation swapped tonode:sqlite. API parity for theCREATE TABLE+INSERT+preparepaths we touch, so test bodies are unchanged.Test plan
npx tsc --noEmitcleannpm run buildclean (dist/cli.js 205 KB)npx vitest run-> 230 / 230 passingnpm pack && npm install ./codeburn-0.7.3.tgzin a throwaway project -> 40 packages installed, zero deprecation noticescodeburn status/codeburn today/codeburn reportall render as beforeCompatibility
Node 20 users will see a clear upgrade message when they try to load a SQLite-backed provider. Node 22+ users see no change in behaviour beyond the faster install.
Credit to @primeminister for reporting this.