Files
stack/packages/storage/package.json
Jarvis 72e365438c refactor(storage): replace better-sqlite3 with PGlite adapter
Eliminates the `prebuild-install` deprecation warning that appears during
`mosaic gateway install` by removing `better-sqlite3` from the dependency
graph entirely and replacing the SqliteAdapter with a PGlite-based adapter
that mirrors the same interface and test coverage.

- New `PgliteAdapter` in `packages/storage/src/adapters/pglite.ts` using
  `@electric-sql/pglite` with JSONB columns and pg-style `$N` placeholders
- Ported all 18 adapter tests to `pglite.test.ts` (in-memory PGlite instances)
- Deleted `sqlite.ts` and `sqlite.test.ts`
- Updated `StorageConfig` discriminated union: `sqlite` → `pglite` with optional
  `dataDir` (absent = in-memory)
- `packages/storage/index.ts` re-exports `PgliteAdapter` and registers it
- CLI install wizard writes `{ type: 'pglite', dataDir: '…/storage-pglite' }`
- Removed `better-sqlite3` and `@types/better-sqlite3` from storage deps;
  added `@electric-sql/pglite@^0.2.17`
- Removed `pnpm.onlyBuiltDependencies: ["better-sqlite3"]` from root package.json
- Bump `@mosaic/storage` 0.0.2 → 0.0.3
- Bump `@mosaic/gateway` 0.0.3 → 0.1.0 (minor — storage dialect change)

Breaking: local-tier `data.db` SQLite files are not migrated. Clean break.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 16:44:48 -05:00

40 lines
866 B
JSON

{
"name": "@mosaic/storage",
"version": "0.0.3",
"repository": {
"type": "git",
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",
"directory": "packages/storage"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"lint": "eslint src",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests"
},
"dependencies": {
"@electric-sql/pglite": "^0.2.17",
"@mosaic/db": "workspace:^",
"@mosaic/types": "workspace:*"
},
"devDependencies": {
"typescript": "^5.8.0",
"vitest": "^2.0.0"
},
"publishConfig": {
"registry": "https://git.mosaicstack.dev/api/packages/mosaic/npm/",
"access": "public"
},
"files": [
"dist"
]
}