- src/db/index.ts: initDb/getDb/closeDb using node-sqlite3-wasm (pure WASM, no VS build required) - src/db/migrations/001-initial.ts: creates all 9 tables with FK constraints and CHECK constraints - tests/db.test.ts: 10 tests verifying WAL mode, FK cascade, all table columns, and constraint enforcement - Switched from better-sqlite3 (requires Visual Studio on Windows) to node-sqlite3-wasm Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
954 B
JSON
38 lines
954 B
JSON
{
|
|
"name": "display-middleware",
|
|
"version": "1.0.0",
|
|
"description": "Middleware backend for ESP32 e-paper display system",
|
|
"main": "dist/index.js",
|
|
"scripts": {
|
|
"dev": "tsx watch src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest"
|
|
},
|
|
"dependencies": {
|
|
"bcrypt": "^5.1.1",
|
|
"better-sqlite3": "^9.6.0",
|
|
"cors": "^2.8.6",
|
|
"express": "^4.22.1",
|
|
"jsonwebtoken": "^9.0.3",
|
|
"mqtt": "^5.15.1",
|
|
"node-sqlite3-wasm": "^0.8.55",
|
|
"pg": "^8.20.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/bcrypt": "^5.0.2",
|
|
"@types/better-sqlite3": "^7.6.13",
|
|
"@types/cors": "^2.8.19",
|
|
"@types/express": "^4.17.25",
|
|
"@types/jsonwebtoken": "^9.0.10",
|
|
"@types/node": "^20.19.39",
|
|
"@types/pg": "^8.20.0",
|
|
"@types/supertest": "^6.0.3",
|
|
"supertest": "^6.3.4",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "^5.9.3",
|
|
"vitest": "^1.6.1"
|
|
}
|
|
}
|