# Contributor handoff — d3/d3

> Canonical page: https://codevetter.com/unpack/d3/agent-handoff

# Contributor handoff — d3/d3

Scanned commit ca958d45217b4c15332d971b935451a6d4c978f4 (2026-05-28). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Edit the barrel, the docs, and the release wiring. Do not vendor algorithm source into this repo. Read package.json, src/index.js, rollup.config.js, docs/.vitepress/config.ts, and the two tests before changing exports or pages. Use yarn. Build dist before any docs command. Never run the postpublish script unless a human explicitly asked to publish and push tags. The link test is strict about .md suffixes and header slugs.
- Read first: package.json (exports, files, scripts, dependency list), src/index.js, bundle.js, rollup.config.js, docs/.vitepress/config.ts, docs/.vitepress/theme/index.ts, test/d3-test.js, test/docs-test.js, prebuild.sh from line 628, and .github/workflows/test.yml plus deploy.yml. API.md and the root README are not the API. — [package.json#L23-91](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L23-L91) [src/index.js#L1-30](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/src/index.js#L1-L30) [API.md#L1-3](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/API.md#L1-L3) [README.md#L16-21](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/README.md#L16-L21)
- Safe edits are docs markdown, docs/components Vue examples, sidebar and api index entries, the barrel export list, and Rollup banner or output tweaks. Unsafe or out of scope: copying d3-selection or d3-geo implementations into src/, committing dist/ or docs/public versioned bundles, editing yarn.lock by hand, and running npm publish or the postpublish git push. — [src/index.js#L1-2](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/src/index.js#L1-L2) [package.json#L84-85](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L84-L85) [.gitignore#L5-7](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/.gitignore#L5-L7)
- Install and test with yarn, not a second lockfile: CI uses yarn --frozen-lockfile and setup-node cache: yarn. The local test command is yarn test, which needs the d3-* packages installed because d3-test.js dynamic-imports every dependency. Node on CI is 20 even though engines says >=12. — [.github/workflows/test.yml#L14-23](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/.github/workflows/test.yml#L14-L23) [package.json#L83-91](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L83-L91) [test/d3-test.js#L10-13](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/test/d3-test.js#L10-L13)
- Before yarn docs:dev or yarn docs:build, run yarn prepublishOnly so dist/d3.mjs exists for the Vite alias. A full asset mirror also needs a checkout of d3/d3.github.com at build/d3.github.com, which deploy.yml does and test.yml does not. prebuild.sh will not stop on the first missing historical file. — [docs/.vitepress/config.ts#L26-28](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/.vitepress/config.ts#L26-L28) [package.json#L84-86](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L84-L86) [.github/workflows/deploy.yml#L18-29](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/.github/workflows/deploy.yml#L18-L29) [prebuild.sh#L1-2](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/prebuild.sh#L1-L2)
- When adding a module, update all of: package.json dependencies, src/index.js, prebuild.sh node_modules cp lines, .gitignore, a docs page, docs/api.md links, and themeConfig.sidebar. Then run yarn test. The parity test only covers the first two; the link test covers the docs links; the copy list and sidebar are unchecked. — [test/d3-test.js#L10-18](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/test/d3-test.js#L10-L18) [docs/.vitepress/config.ts#L56-68](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/.vitepress/config.ts#L56-L68) [prebuild.sh#L631-634](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/prebuild.sh#L631-L634)
- Anchor trap: docs-test.js requires internal links to use a .md suffix in the source even though the site uses cleanUrls. Header slugs lower-case, turn runs of spaces into single hyphens, and delete other punctuation. If a heading's slug is wrong or unstable, add an explicit {#anchor} rather than fighting the regex. Protocol links are ignored, so external URLs are not validated. — [test/docs-test.js#L21-58](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/test/docs-test.js#L21-L58) [docs/.vitepress/config.ts#L10](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/.vitepress/config.ts#L10)
- ESLint trap: root ecmaVersion is 8, test ecmaVersion is 11 with mocha and browser env. New syntax in src/ or rollup.config.js can fail the root config even if Node 20 accepts it. The test workflow's compact formatter must keep matching .github/eslint.json or annotations break; the regex expects "path: line N, col N, Error - message (rule)". — [.eslintrc.json#L1-7](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/.eslintrc.json#L1-L7) [test/.eslintrc.json#L1-13](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/test/.eslintrc.json#L1-L13) [.github/eslint.json#L5-14](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/.github/eslint.json#L5-L14)
- Version trap: the user-visible version is package.json version, inlined as __APP_VERSION__ and written into the Rollup banner. The CDN filename written by prebuild is the major line d3.v7.js, not the full 7.9.0. Bumping the minor version does not rename that file. CHANGES.md is only for major releases; patch notes belong in GitHub releases. — [package.json#L1-3](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L1-L3) [docs/.vitepress/config.ts#L31-33](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/.vitepress/config.ts#L31-L33) [prebuild.sh#L628-629](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/prebuild.sh#L628-L629) [CHANGES.md#L1-5](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/CHANGES.md#L1-L5) [rollup.config.js#L16-22](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/rollup.config.js#L16-L22)
- Do not treat globalThis.d3 in the theme as a library API. enhanceApp sets it for console testing on the docs site only. Library consumers get the package exports or the UMD global created by the bundle's name: "d3". — [docs/.vitepress/theme/index.ts#L10-12](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/.vitepress/theme/index.ts#L10-L12) [rollup.config.js#L16-20](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/rollup.config.js#L16-L20)
- Map and plot examples depend on devDependencies topojson-client and @observablehq/plot and on network at runtime or build time. Editing WorldMap, UsMap, or PlotRender without those packages installed, or without dist/d3.mjs, will not typecheck or render. There is no browser test to catch a broken example; verify by running the docs build. — [docs/components/WorldMap.vue#L3-5](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/components/WorldMap.vue#L3-L5) [docs/components/PlotRender.js#L1-2](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/docs/components/PlotRender.js#L1-L2) [package.json#L70-79](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L70-L79)
- Publishing to npm is not automated in .github/workflows. The only publish-adjacent automation is postpublish's git push and git push --tags, plus prepublishOnly's destructive rm -rf dist. Treat both as release steps that require an explicit human request. (inferred) — [package.json#L84-85](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/package.json#L84-L85) [.github/workflows/deploy.yml#L1-6](https://github.com/d3/d3/blob/ca958d45217b4c15332d971b935451a6d4c978f4/.github/workflows/deploy.yml#L1-L6)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
