Mutative

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.json declares.
  • Run pnpm install to install all the dependencies.
  • Run pnpm test to run the tests, or pnpm test --watch for an interactive test watcher.
  • Run pnpm format, pnpm lint and pnpm type-check before you commit.
  • Run pnpm commit to 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/. Run pnpm start:docs from the repository root to preview it, and pnpm build in website/ to export it and check its links.
  • Code examples that import from mutative, and from no other module than mutative and immer, run as tests, with Vitest's expect: keep such examples complete, and leave the imports out of fragments that are not meant to run.
  • pnpm build:doc regenerates the API reference in docs/ 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

On this page