Contributing
Workflow
Section titled “Workflow”- Branch from
mainusing a conventional prefix:feat/,fix/,chore/,docs/,refactor/,test/ - Open a pull request — never push directly to
main - Wait for all CI checks to pass (Build, Test, E2E)
- Squash merge and delete the branch
Commit format
Section titled “Commit format”Use Conventional Commits:
type(scope): concise titleCommon types: feat, fix, chore, docs, refactor, test. Scope is optional.
Pre-commit hooks
Section titled “Pre-commit hooks”lefthook runs automatically on git commit:
- lint —
oxlintchecks for errors - format —
oxfmt --checkverifies formatting
If the format check fails, run:
pnpm formatThen re-stage and commit.
pnpm test # Vitest unit testspnpm e2e # Playwright end-to-end tests (requires local stack running)CI runs both. A PR cannot be merged until all checks are green.
Database migrations
Section titled “Database migrations”When you change the Drizzle schema in packages/db/src/schema/:
- Generate the migration:
pnpm --filter @inntrig/db db:generate - Review the generated SQL in
packages/db/migrations/ - Apply locally:
pnpm --filter @inntrig/db db:migrate - Migrations run automatically on API startup in production — no manual step needed
Adding a new audit standard
Section titled “Adding a new audit standard”Standards are data-driven. To add a new standard:
- Add seed data in
packages/db/src/seed.ts— define the standard and its criteria - Set
config.criterionFieldsto define what attributes each criterion has (e.g.levelfor WCAG 2.x) - Set
config.resultFieldsto define custom result controls (e.g.scorefor WCAG 3.0). Omit for standard pass/fail/na/todo. - Run the seed:
npx tsx packages/db/src/seed.ts
No TypeScript code changes needed — the UI renders controls from config.
Updating the OpenAPI spec
Section titled “Updating the OpenAPI spec”The spec is hand-authored in apps/api/src/openapi.ts. When you add or change an API endpoint:
- Update the spec in
openapi.tsto match - Verify at
http://localhost:3001/docs - The spec is served at runtime — there is no generated file to commit
Package manager
Section titled “Package manager”Use pnpm only. Do not use npm or yarn.