Skip to content

Drop better-sqlite3 to remove deprecated prebuild-install (#75)#76

Merged
AgentSeal merged 1 commit intomainfrom
fix/drop-prebuild-install
Apr 18, 2026
Merged

Drop better-sqlite3 to remove deprecated prebuild-install (#75)#76
AgentSeal merged 1 commit intomainfrom
fix/drop-prebuild-install

Conversation

@AgentSeal
Copy link
Copy Markdown
Collaborator

Fixes #75.

Summary

  • Replaces better-sqlite3 with Node's built-in node:sqlite (stable in Node 24, experimental in Node 22 / 23). Upstream better-sqlite3 #1446 to replace prebuild-install is still open, so a drop-in swap is the fastest path to a clean install.
  • engines.node bumped from >=20 to >=22 (Node 20 reaches EOL on 2026-04-30 and node:sqlite is only available from 22 onwards).
  • The experimental-SQLite warning that Node 22/23 prints the first time node:sqlite is loaded is silenced for that specific warning only. Other warnings still surface.

Reproduction of the original issue (0.7.2)

$ npm install codeburn
npm warn deprecated [email protected]: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.

After this change

$ npm install codeburn
added 40 packages, and audited 41 packages in 3s
found 0 vulnerabilities

Package count drops from 167 to 40. Zero deprecation warnings.

Changes

  • src/sqlite.ts -- DatabaseSync from node:sqlite behind the same SqliteDatabase facade we already had, so call sites (src/providers/cursor.ts, src/providers/opencode.ts) are untouched. Includes a narrow process.emit shim that suppresses only the ExperimentalWarning whose message matches /SQLite/i, leaving every other warning intact.
  • package.json -- removed better-sqlite3 (was optionalDependencies), removed @types/better-sqlite3, added @types/node (was coming in transitively), bumped engines.node.
  • tests/providers/opencode.test.ts -- fixture DB creation swapped to node:sqlite. API parity for the CREATE TABLE + INSERT + prepare paths we touch, so test bodies are unchanged.

Test plan

  • npx tsc --noEmit clean
  • npm run build clean (dist/cli.js 205 KB)
  • npx vitest run -> 230 / 230 passing
  • npm pack && npm install ./codeburn-0.7.3.tgz in a throwaway project -> 40 packages installed, zero deprecation notices
  • codeburn status / codeburn today / codeburn report all render as before
  • OpenCode + Cursor providers still load their SQLite data

Compatibility

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.

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.
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​types/​node@​25.6.0 ⏵ 22.19.17100 +110081 +195100

View full report

@AgentSeal AgentSeal merged commit b232b3c into main Apr 18, 2026
2 checks passed
@AgentSeal AgentSeal deleted the fix/drop-prebuild-install branch April 18, 2026 08:39
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.

Use of deprecated module can lead to security issues: npm warn deprecated [email protected]

2 participants