1.9 KiB
1.9 KiB
Frontend AGENTS
This directory is a Vite + React + TypeScript frontend. Follow the current split between pages, shared state/helpers, auth context, and reusable UI.
Frontend layout
src/pages: route-level screens and page-scoped state modules.src/lib: API helpers, cache helpers, schedule utilities, shared types, and test files.src/auth: authentication context/provider.src/components/layout: page shell/layout components.src/components/ui: reusable UI primitives.src/index.css: global styles.
Real frontend commands
Run these from front/:
npm run devnpm run buildnpm run previewnpm run cleannpm run lintnpm run test
Run this from the repository root for OSS publishing:
node scripts/deploy-front-oss.mjsnode scripts/deploy-front-oss.mjs --dry-runnode scripts/deploy-front-oss.mjs --skip-build
Important:
npm run lintis the current TypeScript check because it runstsc --noEmit.- There is no separate ESLint script.
- There is no separate
typecheckscript beyondnpm run lint. - OSS publishing uses
scripts/deploy-front-oss.mjs, which reads credentials from environment variables or the repository root.envfile, with.env.oss.localkept only as a legacy fallback.
Frontend rules
- Keep route behavior in
src/pagesand shared non-UI logic insrc/lib. - Add or update tests next to the state/helper module they exercise, following the existing
*.test.tspattern. - Preserve the current Vite alias usage:
@/*resolves from thefront/directory root. - If a change depends on backend API behavior, verify the proxy expectations in
vite.config.tsbefore hardcoding URLs. - Use the existing
npm run build,npm run test, andnpm run lintcommands for validation; do not invent a separate frontend verification command. - For release work, let the deployer agent publish
front/distthroughscripts/deploy-front-oss.mjsinstead of manual object uploads.