mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
`better-sqlite3@^11` has no Node-26 prebuilds and fails its node-gyp source
build against current V8, breaking `npm i ruflo@latest` on Node 26.
The runtime already had a sql.js / RVF fallback in `database-provider.ts`,
but `sqlite-backend.ts` carried a top-level `import Database from
'better-sqlite3'`. ESM evaluated that on import, so missing native module
threw `ERR_MODULE_NOT_FOUND` before any provider selection could happen.
- `sqlite-backend.ts`: type-only static import; runtime load deferred to
`initialize()` via `await import('better-sqlite3')`, with an actionable
error if missing.
- `package.json`: `better-sqlite3` moved from `dependencies` →
`optionalDependencies`, bumped to `^12.9.0` (Node-26 prebuilds available).
Verified: install survives without better-sqlite3 (auto-falls back to
RVF, store/get round-trips OK); native path still works end-to-end with
better-sqlite3@12.9.0 installed.
Closes #1867
Co-Authored-By: RuFlo <ruv@ruv.net>