|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for considering a contribution to coverage-tracker. This is a small, |
| 4 | +self-hostable project — most changes should be small too. |
| 5 | + |
| 6 | +## Project layout |
| 7 | + |
| 8 | +This repo has **three independent `package.json`s**, each with its own |
| 9 | +dependencies: |
| 10 | + |
| 11 | +| Directory | What it is | |
| 12 | +| ------------------------- | ----------------------------------------------------- | |
| 13 | +| `/` (root) | The Cloudflare Worker — Hono API + cron rollup | |
| 14 | +| `dashboard/` | SvelteKit 5 dashboard, builds into the Worker | |
| 15 | +| `.github/actions/report/` | The reporting GitHub Action (parses coverage reports) | |
| 16 | + |
| 17 | +Install and work on each independently: |
| 18 | + |
| 19 | +```bash |
| 20 | +npm install # root (Worker) |
| 21 | +npm --prefix dashboard install # dashboard |
| 22 | +npm --prefix .github/actions/report install |
| 23 | +``` |
| 24 | + |
| 25 | +See the root [README.md](README.md#development) for the full local dev loop |
| 26 | +(`wrangler.json`, `.dev.vars`, D1 migrations, `npm run dev`). |
| 27 | + |
| 28 | +## Before opening a PR |
| 29 | + |
| 30 | +Run these at the root, unless you only touched one sub-project: |
| 31 | + |
| 32 | +```bash |
| 33 | +npm run lint # ESLint (root) |
| 34 | +npm run format:check # Prettier (root) |
| 35 | +npm run typecheck # tsc --noEmit |
| 36 | +npm test # vitest, real D1 bindings via @cloudflare/vitest-pool-workers |
| 37 | +``` |
| 38 | + |
| 39 | +Or check formatting across all three projects at once: |
| 40 | + |
| 41 | +```bash |
| 42 | +npm run format:all:check |
| 43 | +``` |
| 44 | + |
| 45 | +CI (`.github/workflows/ci.yml` and `action-test.yml`) runs the equivalent |
| 46 | +checks plus Playwright e2e tests and an Action self-test — a PR won't merge |
| 47 | +until those are green. |
| 48 | + |
| 49 | +## Architecture invariants |
| 50 | + |
| 51 | +Before touching auth, routing, or the D1 schema, read |
| 52 | +[CLAUDE.md](CLAUDE.md) — it documents the non-negotiable invariants for this |
| 53 | +project (single Worker serving both the SPA and the API, why `/api/*` must |
| 54 | +never sit behind a Cloudflare Access application, the two-table coverage |
| 55 | +rollup contract, etc.). PRs that violate one of those invariants will be |
| 56 | +asked to change regardless of whether the tests pass. |
| 57 | + |
| 58 | +## Commit messages |
| 59 | + |
| 60 | +This repo uses [Conventional Commits](https://www.conventionalcommits.org/): |
| 61 | +`feat:`, `fix:`, `chore:`, `docs:`, `ci:`, `test:`, `refactor:`, optionally |
| 62 | +scoped (`fix(report): ...`). Look at `git log` for examples. |
| 63 | + |
| 64 | +## Code review |
| 65 | + |
| 66 | +[docs/CODEOWNERS](docs/CODEOWNERS) lists who reviews changes to specific |
| 67 | +paths. Secret scanning runs automatically via GitGuardian — don't commit |
| 68 | +`.dev.vars`, `wrangler.json`, or any real credentials (see the templates: |
| 69 | +`.dev.vars.example`, `wrangler.example.jsonc`). |
| 70 | + |
| 71 | +## License |
| 72 | + |
| 73 | +By contributing, you agree your contribution is licensed under this repo's |
| 74 | +[MIT License](LICENSE). |
0 commit comments