- Node.js 22.22.2 or later, or 24.15 or later.
- pnpm 12. The
packageManagerfield inpackage.jsonpins the exact version. If a global pnpm 10 fails withFailed to switch pnpm to v12, upgrade the global pnpm to version 12.
In the repo root, install the dependencies and build the library:
pnpm install
pnpm buildThe playground in demo/ is a Vite app that imports the library from lib/, so it needs a pnpm build first. To start it, run:
pnpm --filter rd3t-demo devTo pick up library changes as you make them, run pnpm build:watch in a second terminal. For more on the playground, see demo/README.md.
To try your changes in your own app instead, run npm link in the repo root, then npm link react-d3-tree in your app's root.
CI runs these commands on every push and pull request. Run them before you push:
pnpm lint
pnpm fmt:check # `pnpm fmt` fixes formatting
pnpm build
pnpm check:package
pnpm test
pnpm test:smoke
pnpm --filter rd3t-demo typecheck
pnpm --filter rd3t-demo test
pnpm --filter rd3t-demo buildpnpm test enforces coverage thresholds, so add tests with new code.
Open pull requests against master. The library is published to npm, so a change must not break apps on the same major version: keep the exports, props, defaults, and shipped types backwards compatible.