|
1 | 1 | # Repository Guidelines |
2 | 2 |
|
3 | 3 | ## Project Structure & Module Organization |
4 | | -- `app/`: Next.js App Router pages, layouts, and global styles (`app/globals.css`, `app/editor-theme.css`). |
5 | | -- `components/`: shared UI components and providers. |
6 | | -- `hooks/`: reusable React hooks (keep hook names `useThing`). |
7 | | -- `lib/`: utilities and shared helpers. |
8 | | -- `public/`: static assets served by Next.js. |
9 | | -- `test/`: unit and visual tests plus utilities and setup. |
10 | | -- `src-tauri/`: Tauri desktop shell and Rust configuration. |
| 4 | +- `src/`: Solid frontend application. |
| 5 | + - `src/components/`: shared Solid UI and feature components. |
| 6 | + - `src/routes/`: route-level screens and global route styles. |
| 7 | + - `src/state/`: app state stores. |
| 8 | + - `src/lib/`: utilities, Tauri helpers, markdown helpers, and i18n. |
| 9 | +- `public/`: static assets served by Vite. |
| 10 | +- `src-tauri/`: Tauri desktop shell and Rust commands. |
| 11 | +- `test/`: Vitest and Playwright coverage, helpers, and docs. |
11 | 12 |
|
12 | 13 | ## Build, Test, and Development Commands |
13 | | -- `pnpm dev`: start the Next.js dev server (Turbopack). |
14 | | -- `pnpm build`: production build. |
15 | | -- `pnpm start`: serve the production build. |
16 | | -- `pnpm lint`: run ESLint (`next lint`). |
| 14 | +- `pnpm dev`: start the Solid + Vite dev server. |
| 15 | +- `pnpm build`: production build and TypeScript check. |
| 16 | +- `pnpm start`: preview the production build. |
| 17 | +- `pnpm lint`: run TypeScript checking. |
17 | 18 | - `pnpm test`: run Vitest once. |
18 | 19 | - `pnpm test:watch`: Vitest watch mode. |
19 | 20 | - `pnpm test:ui`: Vitest UI. |
20 | 21 | - `pnpm test:visual`: Playwright visual regression tests. |
21 | 22 | - `pnpm test:visual:ui`: Playwright UI runner. |
22 | | -- `npx tsx test/run-all-tests.ts`: run the full test suite with reporting. |
| 23 | +- `pnpm tauri dev`: run the desktop shell in development. |
| 24 | +- `pnpm tauri build`: build the desktop app. |
23 | 25 |
|
24 | 26 | ## Coding Style & Naming Conventions |
25 | | -- TypeScript + React (Next.js). Follow existing file patterns and keep diffs minimal. |
26 | | -- Indentation: 2 spaces in TS/TSX; align JSX props vertically when multi-line. |
27 | | -- Components: `PascalCase` exports; files are typically kebab-case (match the folder). |
28 | | -- Hooks: functions named `useThing`, stored in `hooks/`. |
29 | | -- Linting: follow ESLint rules from `eslint.config.mjs`; fix lint before PRs. |
| 27 | +- TypeScript + Solid. Keep diffs focused and consistent with nearby files. |
| 28 | +- Indentation: 2 spaces in TS/TSX and CSS. |
| 29 | +- Components: `PascalCase` exports; filenames are typically kebab-case or grouped by feature. |
| 30 | +- Shared state lives in `src/state/`; generic helpers live in `src/lib/`. |
| 31 | +- Prefer small composable helpers over framework-heavy abstractions. |
30 | 32 |
|
31 | 33 | ## Testing Guidelines |
32 | | -- Unit tests live in `test/components/*.test.tsx` (Vitest + React Testing Library). |
33 | | -- Visual regression tests live in `test/visual/*.spec.ts` (Playwright). |
34 | | -- Use `test/setup.ts` and `test/utils/` for shared helpers. |
35 | | -- If visuals change intentionally, update snapshots: `pnpm test:visual --update-snapshots`. |
| 34 | +- Unit and integration tests live in `test/components`, `test/hooks`, and `test/lib`. |
| 35 | +- Visual regression tests live in `test/visual/*.spec.ts`. |
| 36 | +- Use `test/setup.ts` and `test/utils/` for shared test setup. |
| 37 | +- If visuals change intentionally, update snapshots with `pnpm test:visual --update-snapshots`. |
| 38 | +- WebKit snapshots are optional locally and can be enabled with `PLAYWRIGHT_ENABLE_WEBKIT=1`. |
36 | 39 |
|
37 | 40 | ## Commit & Pull Request Guidelines |
38 | 41 | - Commit messages follow conventional commits: `type(scope): subject`. |
39 | | - Examples: `chore(deps): ...`, `ci(test): ...`. |
40 | | -- PRs should include: a concise description, linked issue (if any), and screenshots for UI changes. |
41 | | -- Note test coverage in the PR body (e.g., `pnpm test`, `pnpm test:visual`). |
| 42 | +- PRs should include a concise description, linked issue if any, and screenshots for UI changes. |
| 43 | +- Mention validation in the PR body, for example `pnpm test`, `pnpm test:visual`, or `pnpm build`. |
42 | 44 |
|
43 | 45 | ## Configuration Notes |
44 | | -- App config is in `next.config.ts`; tooling config in `vitest.config.ts` and `playwright.config.ts`. |
45 | | -- Prefer `pnpm` for dependency changes; keep `pnpm-lock.yaml` in sync. |
| 46 | +- Frontend config lives in `vite.config.ts`, `vitest.config.ts`, and `playwright.config.ts`. |
| 47 | +- Tauri config lives in `src-tauri/tauri.conf.json` and `src-tauri/Cargo.toml`. |
| 48 | +- Prefer `pnpm` for dependency changes and keep `pnpm-lock.yaml` in sync. |
0 commit comments