- App source lives in
src/withcomponents/(UI),hooks/(logic hooks),commands/(SysEx/USB ops),services/(I/O + side effects), andlib/utilities. Entry issrc/main.tsx, styles insrc/styles/andsrc/index.css, PWA service worker insrc/sw.ts. - Tests sit in
src/test/using Vitest + Testing Library; end-to-end specs live incypress/e2e/. Static assets are inpublic/andsrc/assets/. Vite/Tailwind config is invite.config.tsandtailwind.config.js.
yarn install— install deps (repo targets Node >= 21.1 + Yarn 4; usecorepack enableif needed).yarn dev— run Vite dev server (HMR on port 5173 by default).yarn build— production bundle todist/.yarn preview— serve the built bundle locally.yarn typecheck— TypeScript no-emit check.yarn test/yarn test:watch— Vitest suite undersrc/test/.yarn lint— ESLint (Preact config).yarn pwa-check— ensuresdist/containssw.jsandmanifest.webmanifest.
- TypeScript + Preact with TSX; prefer functional components. Component files and exports use
PascalCase, hooksuseCamelCase, utilitiescamelCase. - Prettier formatting (2-space indent, semicolons on, single quotes via ESLint). Avoid orphaned default exports; favor named exports for reuse.
- Tailwind is used for layout/styling; keep variants/classes close to the elements they affect and co-locate component-specific styles with the component.
- Place unit/integration specs beside code in
src/test/with*.test.tsor*.test.tsx. Prefer Testing Library queries over DOM selectors; stub network/USB surfaces inservices/. - E2E specs live in
cypress/e2e/; use fixtures fromcypress/fixtures/and add custom commands incypress/support/commands.ts. - Cover new user-visible behaviors and edge cases (file operations, PWA offline paths). Keep tests deterministic—mock time and random sources when relevant.
- Commit history mixes imperative statements and Conventional Commits (
feat: ...,Fix ...). Prefer imperative, present-tense subjects; include a type prefix when it clarifies scope. - Pull requests: describe the change and rationale, note affected areas (UI, file operations, PWA), link issues, and include before/after screenshots or recordings for UI tweaks. Call out test coverage added or why it is not needed.