Contributing Guide¶
Prerequisites¶
- .NET 10 SDK, Deno 2.x, just, lefthook
(all pinned in
mise.toml; runmise installif you use mise) uvfor the docs site (brew install uvormise use uv)
Setup¶
This installs git hooks (lefthook) that format-check on commit and type-check
on push; see .lefthook.yml. CI (ci-cd.yml, typescript-ci.yml,
contract-tests.yml) is still the source of truth and runs the full suites.
Daily Commands¶
Run just (no arguments) to list all recipes, or just --list.
just format # format .NET + TypeScript
just check # format-check + type-check everything, no fixes
just test # .NET tests + TypeScript unit tests, in parallel
just test-contract # build & run samples/ContractApi, run the Deno contract suite against it
just test-all # check + test + test-contract (what CI runs)
Narrower recipes (format-dotnet, format-ts, test-dotnet, test-ts,
lint, clean) are also available; see the justfile.
Equivalent plain commands, if you don't have just:
dotnet build --configuration Release
dotnet test --configuration Release
dotnet csharpier format .
cd clients/typescript && deno task test
Docs¶
The site is built with mkdocs (Material) and served from GitHub Pages.
If you change C# XML doc comments, regenerate the API reference first:
dotnet build JsonApiToolkit/JsonApiToolkit.csproj -c Release -o JsonApiToolkit/bin/docs
dotnet tool run dotnet-api-docs -- --input JsonApiToolkit/bin/docs --output docs/api --strict
Tests¶
Tests live in JsonApiToolkit.Tests/ and use xUnit + EF Core in-memory databases. Integration tests spin up a TestServer via HostBuilder; see existing tests in Integration/ for the pattern.
Naming: MethodName_Scenario_ExpectedBehavior (e.g. ApplyPagination_WithPageSizeZero_ClampsToOne).
When adding behavior, add tests covering the happy path, boundaries, and error conditions.
Commits¶
Conventional Commits, enforced indirectly by Release Please:
| Prefix | Bump | Notes |
|---|---|---|
fix: |
patch | |
feat: |
minor | |
feat!: / fix!: |
major | breaking change |
perf:, refactor:, docs:, build:, ci:, test:, style: |
none | shows in changelog |
chore: |
none | hidden from changelog |
Branch names: feat/, fix/, refactor/, docs/, test/, chore/, etc.
Pull Requests¶
- Branch from
main. - Format (
dotnet csharpier format .) and run tests locally. - Open a PR with a descriptive title and summary.
- CI must pass.
- At least one approving review is required.
Releases¶
Handled by Release Please. Merging to main updates a release PR that accumulates changes. Merging the release PR cuts a GitHub Release, publishes to NuGet, and bumps the version in JsonApiToolkit.csproj and mkdocs.yaml.
Questions¶
Open an issue: https://github.com/intility/json-api-toolkit/issues