- Install better-sqlite3 + drizzle-orm as runtime deps; drizzle-kit + @types/better-sqlite3 as devDeps
- Define 5 tables in src/main/db/schema.ts: clients, projects, tasks, checkpoints, notes
- All IDs are TEXT (UUID); types inferred via InferSelectModel/InferInsertModel
- initDb() in src/main/db/index.ts opens adiuva.db at app.getPath('userData'), runs CREATE TABLE IF NOT EXISTS (non-destructive push), enables WAL mode
- Call initDb() in main process app ready handler
- Externalize better-sqlite3 in vite.main.config.mts; add AutoUnpackNativesPlugin to forge.config.ts
- Add drizzle.config.ts for drizzle-kit CLI support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
320 B
TypeScript
15 lines
320 B
TypeScript
import { defineConfig } from 'vite';
|
|
|
|
// https://vitejs.dev/config
|
|
export default defineConfig({
|
|
build: {
|
|
rollupOptions: {
|
|
// Externalize native Node modules — they're rebuilt by electron-forge
|
|
external: ['better-sqlite3'],
|
|
output: {
|
|
entryFileNames: 'main.js',
|
|
},
|
|
},
|
|
},
|
|
});
|