Thanks for your interest. The repo is small enough that one PR can move the needle β there's no big-rewrite-in-progress, so almost everything is fair game.
# Node and pnpm versions are pinned via .nvmrc and packageManager.
corepack enable
nvm use # or fnm use / asdf install β anything that reads .nvmrc
pnpm installThe first install also bootstraps the pre-commit hook (lint + format on
staged files via simple-git-hooks + lint-staged).
| Script | What it does |
|---|---|
pnpm dev |
tsup in watch mode β rebuilds dist/ on save. |
pnpm build |
Production build (ESM + CJS + .d.ts + sourcemaps). |
pnpm typecheck |
tsc --noEmit against the strict config. |
pnpm lint |
ESLint v9 flat config. |
pnpm lint:fix |
Same, with autofix. |
pnpm format |
Prettier 3. |
pnpm test |
Vitest in interactive watch. |
pnpm test run |
Single Vitest run. |
pnpm test:coverage |
Vitest with v8 coverage (thresholds enforced at 90%). |
pnpm docs |
Generate the TypeDoc API site into docs/api. |
pnpm size |
size-limit budget check (ESM β€ 2 kB, CJS β€ 2.5 kB, brotli). |
pnpm clean |
Wipe dist/, coverage/, .tsbuildinfo. |
-
pnpm typecheck && pnpm lint && pnpm test run && pnpm buildis green. -
New behaviour has a test; bug fixes have a regression test.
-
If shipped behaviour changed, add a changeset:
pnpm changeset
Pick the smallest bump that's correct (
patchfor fixes,minorfor non-breaking additions,majorfor breaking changes β and updateBREAKING_CHANGES.mdif so). -
Commits follow Conventional Commits (
feat:,fix:,docs:,chore:,ci:,build:,refactor:,test:,deps:). One logical change per commit.
Maintainers don't npm publish from a laptop β pushes to main are
handled by .github/workflows/release.yml:
- As changesets land on
main, the workflow opens a "Version Packages" PR that bumpspackage.jsonand updatesCHANGELOG.mdfrom the pending changesets. - When that PR merges, the workflow publishes to npm via trusted
publishing (OIDC β no long-lived
NPM_TOKENin repo secrets) with provenance attestation enabled.
If something blocks the automation (e.g. registry outage), the manual fallback is:
pnpm install
pnpm changeset version # consume changesets, bump version, update changelog
pnpm install # refresh lockfile
git commit -am "chore(release): version packages"
pnpm release # changeset publish
git push --follow-tagsBut this should be rare.
This project follows the Contributor Covenant 2.1. Be kind, assume good intent, and give people a chance to fix their work.