BetterFrame/server/package.json
Mitchell R 936e6170a6
feat(store): Postgres adapter foundation + BF_DB selector (phase 1)
Lays groundwork for sqlite|postgres backend selection without yet
converting Repository. Adds:

- db-adapter.ts: async DbAdapter interface (run/get/all/exec/transaction)
- sqlite-adapter.ts: wraps node:sqlite sync API in Promise-returning shape,
  caches prepared statements
- pg-adapter.ts: pg Pool + ? → $N placeholder rewrite + RETURNING-id
  capture + savepoint-nested transactions
- service-store config: driver (sqlite|postgres), pgUrl
- BF_DB env override, plumbed via envStr

Selecting BF_DB=postgres throws at init() until the Repository is
converted off DatabaseSync. This commit ships the foundation only.

Next phases (separate commits):
  2. Convert Repository methods sync → async via DbAdapter
  3. Update every caller to await
  4. Split MIGRATIONS into sqlite + portable / pg-specific sets
  5. UUIDv7 IDs for new tables on PG path

Adds deps: pg ^8.13.1, uuidv7 ^1.0.2, @types/pg ^8.20.0
2026-05-18 22:50:48 +02:00

46 lines
1.2 KiB
JSON

{
"name": "@betterframe/server",
"version": "0.1.0",
"private": true,
"description": "BetterFrame backend — BSB v9 service plugins.",
"license": "AGPL-3.0-only OR Commercial",
"type": "module",
"files": [
"lib/**/*",
"README.md",
"bsb-plugin.json",
"bsb-tests.json"
],
"scripts": {
"build": "cross-env NODE_OPTIONS=\"--import tsx\" bsb-plugin-cli build && cross-env NODE_OPTIONS=\"--import tsx\" node src/scripts/copy-web-static.ts",
"clean": "bsb-plugin-cli clean",
"start": "bsb-plugin-cli start",
"dev": "cross-env NODE_OPTIONS=\"--import tsx\" bsb-plugin-cli dev",
"test": "bsb-plugin-cli test",
"schemas:export": "node --enable-source-maps lib/scripts/export-schemas.js"
},
"bsb": {},
"dependencies": {
"@anyvali/js": "^0.2.0",
"@bsb/base": "^9.1.11",
"@types/ws": "^8.18.1",
"argon2": "^0.44.0",
"h3": "^2.0.1-rc.22",
"jsx-htmx": "^2.0.2",
"mqtt": "^5.10.4",
"onvif": "^0.8.1",
"otpauth": "^9.5.1",
"pg": "^8.13.1",
"uuidv7": "^1.0.2",
"ws": "^8.20.0"
},
"devDependencies": {
"@types/node": "^25.0.0",
"@types/pg": "^8.20.0",
"tsx": "^4.21.0",
"typescript": "^6.0.3"
},
"peerDependencies": {
"@bsb/base": "^9.1.11"
}
}