Development
Scripts, lint and format rules, commit hooks and the checks to run.
Scripts
Run from the repository root.
| Command | What it does |
|---|---|
pnpm dev | Every app in parallel |
pnpm dev:server | The API on port 8080 |
pnpm dev:app | The web app on port 5173, proxying /api to the API |
pnpm dev:web | The marketing site on port 5174 |
pnpm dev:docs | This site on port 3001 |
pnpm build | Build every app |
pnpm build:extension | Build the extension for Chrome and Firefox |
pnpm lint, pnpm lint:fix | oxlint |
pnpm format, pnpm format:check | oxfmt |
Lint and format
- oxlint reads
.oxlintrc.json. Thecorrectnesscategory is an error, imports must be sorted (perfectionist/sort-imports, fixed bypnpm lint:fix), and a few rules are off because the code relies on what they forbid, such as thechildrenprop of TanStack Form fields. - oxfmt reads
.oxfmtrc.json: no semicolons, single quotes, 100 columns.apps/webhas its own config and keeps semicolons and double quotes. Markdown and MDX are not formatted.
Go code in apps/server is formatted with gofmt and is not part of either
tool.
Commits
pnpm install sets up two git hooks with husky.
| Hook | Runs | Effect |
|---|---|---|
pre-commit | lint-staged | oxlint and oxfmt on the staged JS and TS files, oxfmt on staged JSON, CSS and YAML |
commit-msg | commitlint | Rejects a message that is not a conventional commit |
A message looks like type(scope): subject, for example
fix(server): refuse a stale revision. The types are the conventional ones:
feat, fix, docs, chore, refactor, test, ci, build, perf,
style and revert. The release workflow reads
these messages to choose the next version and to write the changelog.
Checks before a change
pnpm lint && pnpm format:check
pnpm --filter @montara-pass/app run typecheck
pnpm --filter @montara-pass/extension run typecheck
pnpm --filter @montara-pass/docs run typecheck
pnpm --filter @montara-pass/server run testThe server's integration test needs a real database; see Migrations.
Adding a page to the web app
Routes are files under apps/app/src/routes. A new file such as
(app)/reports/index.tsx becomes /reports, inside the signed-in shell, and
src/routeTree.gen.ts is regenerated by the dev server or the build. That file
is generated: do not edit it.
Adding a docs page
Pages are MDX files under apps/docs/content/docs. The file path is the URL,
title in the frontmatter is the heading, and the folder's meta.json sets
the order in the sidebar.