Contributing
Set up the repository, run its checks, and contribute code, benchmarks and docs.
Mutative's goal is efficient immutable updates. The focus is on performance and on APIs that make development easier, and pull requests that help with either are welcome. For a larger change, open an issue or a discussion first.
Development Workflow
- Clone the repository, and use Node.js 22 or 24 with the pnpm version that
package.jsondeclares. - Run
pnpm installto install all the dependencies. - Run
pnpm testto run the tests, orpnpm test --watchfor an interactive test watcher. - Run
pnpm format,pnpm lintandpnpm type-checkbefore you commit. - Run
pnpm committo write a commit message in the Conventional Commits format. - Create a pull request.
Builds, packages and benchmarks
Building and validating Mutative describes the build pipeline, the package checks, the bundle size limits and the generated API reference. The benchmark suite compares the current build with Mutative 1.3.0, Immer and hand-written reducers, and describes the regression budgets that CI checks: run pnpm benchmark:immer:check to validate every workload and pnpm benchmark:immer to measure them.
Docs
- The website lives in
website/. Runpnpm start:docsfrom the repository root to preview it, andpnpm buildinwebsite/to export it and check its links. - Code examples that import from
mutative, and from no other module thanmutativeandimmer, run as tests, with Vitest'sexpect: keep such examples complete, and leave the imports out of fragments that are not meant to run. pnpm build:docregenerates the API reference indocs/from the TSDoc comments of the source, and CI checks that it is up to date.- Write each Markdown paragraph and list item on a single line.
Edit on GitHub
Last updated on by unadlib