- Monorepo with workspaces in
packages/*. packages/plugin/: Electron main (src/main.ts), preload (src/preload.ts), shared types (src/shared.ts), state (src/store.ts), builds todist/.packages/client/: Web client wrapper (src/index.ts) with generated types insrc/generated/, builds todist/.- Tests live under
packages/*/__tests__/and*.test.ts.
npm run dev— Rollup watch builds for plugin and client.npm run build— Full build: sync README, roll outputs, generate/copy types.npm test— Run Jest (ts-jest) across workspaces, writes coverage tocoverage/.npm run typecheck --workspaces— TypeScript strict checks without emit.npm run clean --workspaces— Removedist/outputs in each package.
- Language: TypeScript (strict), target ES2020. Two-space indentation.
- Filenames: lowercase, concise (e.g.,
main.ts,preload.ts,shared.ts). - Types/Interfaces: PascalCase; variables/functions: camelCase; constants: UPPER_SNAKE only when appropriate.
- IPC channels: namespace under
recall-desktop:*(seepackages/plugin/src/shared.ts). - Prefer explicit types, narrow unions, and small, focused modules.
- Framework: Jest with ts-jest. Place tests in
__tests__/and name*.test.ts. - Mock
window.recallDesktopfor client tests and Electron/IPC for main process logic. - Run
npm test; coverage is collected frompackages/*/src/**/*.ts(excluding d.ts and some indexes).
- Commits: short imperative subject (≤72 chars), optional body for rationale. Conventional Commits not required.
- PRs: include summary, linked issues, test plan, and logs/screenshots for ToDesktop Builder/plugin behavior when relevant.
- Required before merge:
npm run buildandnpm testpass; types generate without errors.
- Keep Node/Electron access in main; expose only minimal, validated APIs via preload.
- Add new IPC by updating
shared.ts→main.ts(ipcMain) →preload.ts→client/src/index.ts. - Plugin preferences live in
packages/plugin/package.jsonundertodesktop.preferences; mirror changes instore.ts.