Contributing
This doc covers the conventions for working on Groundwork itself, as a template maintainer or contributor. Building a storefront from it is a different job. It's the checklist to run before opening a pull request (format, lint, typecheck, coverage, build: the same commands CI runs), the TypeScript and colocated-test conventions the codebase follows, and what's expected of commit messages and doc updates for a public behavior change.
It's for anyone contributing directly to the Groundwork template repository. A buyer extending their own fork for a client project sets that fork's conventions themselves, while this doc governs main. Afterwards you'll know what Husky's pre-commit and pre-push hooks already catch, and what you still need to check by hand before CI does.
Related: Testing for the detail behind the test:coverage step in the pre-PR checklist, and Troubleshooting for gotchas you might hit while running that checklist locally.
Source: CONTRIBUTING.md
Conventions for working on this template itself (as opposed to a storefront built from it).
Setup
npm install
npm run dev
The dev server runs against Mock.shop out of the box, so no store credentials are needed to work on the template.
Before opening a pull request
Run the full check suite locally. It's the same thing CI runs:
npm run format:check
npm run lint
npm run typecheck
npm run test:coverage
npm run build
A pre-commit hook (Husky + lint-staged) auto-formats and lints staged files, and a pre-push hook runs typecheck and test. These catch most issues before CI does, but CI is the source of truth.
Conventions
- TypeScript everywhere, strict mode. Avoid
anywhere a real type is available. - Colocated tests:
Thing.ts→Thing.test.ts, next to each other. See docs/TESTING.md. app/lib/stays framework-light: prefer plain functions over React-specific abstractions there, so logic is easy to unit test without rendering.- No commented-out code in commits. Delete it; Git history is the changelog.
- Public behavior changes (new routes, new required env vars, changed script behavior) should update the relevant doc in
docs/or the README in the same PR.
Commit messages
Use a short, imperative summary line: Add cart line item quantity limits, never Added or Adds. Add a body if the "why" isn't obvious from the diff.
Releasing changes to consumers of the template
Because this is distributed as a starter template rather than a versioned package, treat main as always-shippable: anyone forking or generating from this repo at any commit should get a working, tested project.