Use the Node.js version in .nvmrc and run commands from the
repository root.
corepack enable
pnpm installWorkspace packages and examples use local workspace:* dependencies. Do not
install dependencies from an individual package or example.
CI checks are Nx targets. Nx caches deterministic results in .nx/cache, so
unchanged local tasks and later CI runs can replay them.
pnpm run validateRun a narrower target while developing:
pnpm test
pnpm typecheck
pnpm docs:check
pnpm package:check
pnpm bundle:checkThe unit suite inventories callback surfaces from every published package. Public callbacks use primary data plus one context/options bag and never exceed two arguments. New external-protocol or service-method exceptions require an explicit classification in the contract, not a broader allowlist.
Pull-request CI runs the cached Nx target graph, the locked comparison bundle gate, and these uncached browser matrices in parallel:
- four chart-library comparison shards;
- four stress-workload shards.
Conformance runs as regression monitoring outside normal validation. One
deterministically rotated standard shard runs nightly, all eight standard
shards run weekly, and a manual run can select all shards or reproduce one
exact shard. Add the full-conformance label to a risky pull request to run
the complete standard matrix against that pull request; later commits rerun
it while the label remains.
Browser measurements are not cached because their results depend on the browser environment. Install Chromium before running a browser suite locally:
pnpm browser:install
pnpm conformance:quick -- --shard=1/8
pnpm benchmark -- --profile=ci --chart=line
pnpm benchmark:stress:quick -- --workload=raw-lineRunnable examples are virtual projects assembled from fenced code blocks. The entry fence declares the project group and execution environment:
```tsx group=letter-frequency env=charts-react file=/src/App.tsx entry
export default function App() {
return <div />
}
```
```ts group=letter-frequency file=/src/data.ts collapsed
export const rows = []
```groupidentifies every file in one project.envselects the dependency, bootstrap, and rendering contract. Charts docs usecharts,charts-react, orcharts-octane.fileis the virtual project path.entrymarks the one visible file loaded by the environment.collapsedkeeps supporting source inspectable without making it the active file. Do not puthiddenon an authored fence; environments alone may add invariant hidden files.
Declare env only on the entry fence. A charts entry default-exports a chart
definition from a .ts or .tsx file. A charts-react entry default-exports a
React component from a .tsx file. A charts-octane entry default-exports an
Octane component from a .tsrx file. All three environments support additional
inspectable .ts and .tsx files; Octane groups may also contain .tsrx
components.
Project-relative imports must stay within /src. Each environment exposes an
explicit dependency set:
charts:@tanstack/charts,d3-geo,d3-scale, andd3-shape.charts-react: the Charts dependencies plusreactandreact-dom.charts-octane: the Charts dependencies plusoctane.
Keep data preparation, scale choices, definitions, and application behavior in inspectable files. The environment may hide only invariant bootstrap such as HTML, the DOM root, package metadata, and error handling.
Plain code fences remain intentional excerpts or API signatures and do not get
run controls. pnpm docs:check validates grouped metadata, relative imports,
entry exports, strict types, public package imports, and Octane client/server
compilation.
Add and commit a changeset for every user-visible package change:
pnpm changesetChoose the release impact and write the summary that should appear in the changelog. All twelve public Charts packages form one fixed release group, so one package change advances every package to the same version. Documentation, tests, benchmarks, and build-only changes do not need a changeset unless they alter the published package contract.
Do not edit package versions, generated package changelogs, or release tags by hand. The automated version pull request owns those changes.
Every push to main starts the release workflow:
- When pending changesets exist, Changesets creates or updates
ci: Version Packages. The generated pull request does not repeat the browser benchmark matrix. - Review and merge that pull request when the release is ready. It updates all public package versions, consumes the changesets, synchronizes the root and package changelogs, updates release-facing docs, and refreshes the lockfile.
- The merge starts the same workflow again. With no pending changesets, the publisher checks npm and builds fresh, consumer-tested tarballs only when the coordinated version is unpublished.
- npm trusted publishing uses the workflow's OIDC identity to publish core, then React, before compact scales and the remaining nine adapters with provenance. The repository has no long-lived npm token.
- After all twelve registry entries report the expected integrity and
attestations, the workflow creates one annotated
vX.Y.Ztag and GitHub release from the root changelog.
The chart comparison, stress, and catalog-index checks still run on main, but
they are independent from npm publication. Scheduled conformance monitoring is
also independent from release publication. User-visible package
work must pass normal validation in its feature pull request before merging.
Never move or reuse a release tag. If publishing succeeds but tag or GitHub
release creation fails, rerun the failed Release workflow; its registry
preflight resumes finalization without republishing existing versions.
Changing the repository name or
.github/workflows/release.yml requires updating the trusted-publisher
configuration for all twelve packages on npm.