diff --git a/progress.txt b/progress.txt new file mode 100644 index 0000000..37055d3 --- /dev/null +++ b/progress.txt @@ -0,0 +1,28 @@ +## Codebase Patterns +- Vite configs use `.mts` extension (not `.ts`) to avoid ESM/CJS conflict with electron-forge's externalize-deps plugin +- electron-trpc uses `exposeElectronTRPC()` in preload and `createIPCHandler({ router, windows })` in main; renderer uses `ipcLink()` from `electron-trpc/renderer` +- appRouter lives at `src/main/router/index.ts`; renderer client at `src/renderer/lib/trpc.ts` +- `@/*` path alias maps to `src/renderer/*` (configured in tsconfig.json paths) +- All DB tables use `CREATE TABLE IF NOT EXISTS` for non-destructive migrations +- All IDs are UUIDs generated via `crypto.randomUUID()` +- TypeScript strict mode + noUncheckedIndexedAccess enabled; always account for possible undefined on array access + +--- + +## 2026-02-19 - US-003 +- What was implemented: + - Installed: electron-trpc, @trpc/server, @trpc/client, @trpc/react-query, @tanstack/react-query, zod + - Created `src/main/router/index.ts` with full appRouter: stub routers for health, clients, projects, tasks, checkpoints, notes, ai + - Updated `src/preload/index.ts` to call `exposeElectronTRPC()` + - Updated `src/main/index.ts` to call `createIPCHandler({ router: appRouter, windows: [win] })`; `createWindow()` now returns `BrowserWindow` + - Created `src/renderer/lib/trpc.ts` with `createTRPCReact()` + - Updated `src/renderer/index.tsx` to wrap app in `TRPCProvider` + `QueryClientProvider` + - Updated `src/renderer/routes/index.tsx` to call `trpc.health.ping.useQuery()` and display 'tRPC IPC bridge: pong' +- Files changed: package.json, package-lock.json, prd.json, src/main/index.ts, src/main/router/index.ts (new), src/preload/index.ts, src/renderer/index.tsx, src/renderer/lib/trpc.ts (new), src/renderer/routes/index.tsx +- **Learnings for future iterations:** + - electron-trpc `exposeElectronTRPC` is imported from `electron-trpc/main` (not a separate package) + - `ipcLink` is imported from `electron-trpc/renderer` in the renderer process + - `createTRPCReact()` requires importing the AppRouter type from the main process router — this is a type-only import so it doesn't bundle main process code into renderer + - The TRPCProvider must wrap QueryClientProvider (or be a sibling); both need the same queryClient instance + - Stub routers return empty arrays or null — they will be replaced in US-005 through US-008 +---