# AGENTS.md React SPA built with Vite. Replace the bracketed bits with your details. ## Stack - React 18 + TypeScript strict, bundled by Vite 5. Runtime: Node 20.x. - Package manager: **pnpm 9.x**. Tests: Vitest + Testing Library. - Lint/format: ESLint + Prettier. ## Project Structure - `src/` — components, hooks, and the typed API client in `src/api/`. - `src/main.tsx` / `index.html` — Vite entry point and HTML shell. - `*.test.tsx` — tests co-located next to the code they cover. - `vite.config.ts`, `tsconfig.json` — build and type config. - `.env.example` — template for `VITE_`-prefixed client vars. ## Setup ```bash pnpm install cp .env.example .env # Vite exposes only VITE_* vars; never commit .env ``` ## Commands ```bash pnpm dev # vite dev server (http://localhost:5173) pnpm build # tsc -b && vite build -> dist/ pnpm preview # serve the production build locally pnpm test # vitest run pnpm test -- --watch # vitest watch pnpm lint # eslint . --max-warnings=0 pnpm typecheck # tsc --noEmit ``` ## Code style - Always use function components + hooks; class components are not allowed. - Keep components pure; side effects go in `useEffect` or event handlers. - Only `VITE_`-prefixed env vars reach the client, so always keep secrets out of any env var the bundle can read. Example — a small, testable component: ```tsx type Props = { items: string[] }; export function ItemList({ items }: Props) { if (items.length === 0) return
Empty list
; return