2.0 KiB
2.0 KiB
Repository Guidelines
Project Structure & Module Organization
src/: SvelteKit application source.src/routes/: File-based routes and server handlers (e.g.,+page.server.ts).src/lib/: Shared UI and server modules (components/,server/,assets/).src/tests/: Test helpers and stubs; unit tests live alongside code and matchsrc/**/*.test.ts.static/: Public assets served as-is.build/: Production build output (generated).trips.db: Local SQLite database for development.
Build, Test, and Development Commands
npm run dev: Start the Vite dev server.npm run build: Create a production build.npm run preview: Serve the production build locally.npm run check: Typecheck withsvelte-check.npm run lint: Run ESLint onsrc.npm run format: Format with Prettier (Svelte + Tailwind plugins).npm run test: Run Vitest once.npm run test:watch: Watch mode for Vitest.npm run test:coverage: Coverage forsrc/lib/server/**/*.ts(db layer excluded).
Coding Style & Naming Conventions
- Indentation: tabs (see
.prettierrc). - Quotes: single quotes; trailing commas disabled.
- Svelte components use
.svelte; TypeScript modules use.ts. - Routes follow SvelteKit conventions (e.g.,
+page.svelte,+layout.server.ts). - Use
$libalias forsrc/libimports.
Testing Guidelines
- Framework: Vitest with
nodeenvironment. - Test file pattern:
src/**/*.test.ts. - Keep tests near the code they cover; use
src/tests/stubsfor runtime stubbing.
Commit & Pull Request Guidelines
- Commit messages currently follow a light “scope) message” pattern, e.g.,
trips) adding package-tours optiontrip) adding support for lodgings
- PRs should include a clear description of intent, testing performed (or why not), and any relevant screenshots for UI changes.
Configuration & Environment
- Copy
.env.exampleto.envfor local secrets and auth settings. - SQLite data lives in
trips.db; avoid committing local data changes unless intentional.