Skip to content

Rename the remaining index files - #185

Merged
dave-hillier merged 1 commit into
mainfrom
rename-index-files
Sep 24, 2026
Merged

dave-hillier merged 1 commit into
mainfrom
rename-index-files

Conversation

@dave-hillier

Copy link
Copy Markdown
Owner

Follows #154. The project rule is no index files, and these were the last ones:

  • src/index.ts / src/index.d.ts → src/replot.ts / src/replot.d.ts
  • src/scales/index.js / src/scales/index.d.ts → src/scales/registry.js / src/scales/registry.d.ts (upstream still calls it scales/index.js, so a re-sync has to map it across)
  • test/plots/index.ts → test/plots/registry.ts

test/plots/index.html stays, because it is the page the dev server serves at /, not a module.

Consumers see no change: the replot and replot/react specifiers are the same. Only the internal dist paths move, and package.json main, module, types, exports and sideEffects point at dist/esm/replot.js and dist/types/replot.d.ts. The tsconfig paths, the Vite and docs aliases, bundle.js, docs/data/api.data.ts and CONTRIBUTING.md are updated to match. CONTRIBUTING.md also said tests resolve replot to src/index.js, which was wrong, and it now says what the tsconfig paths do.

This also carries the copy-declarations dead-skip removal from #184. The change is identical, so whichever merges second applies cleanly.

Checks: tsc, eslint and prettier are clean, mocha gives 1818 passing, 2 pending with no snapshot changes, and the smoke test passes (pack, install, and import both entries through a bundler, TypeScript and UMD). publint --strict and attw pass, and the docs build works. The regenerated api-index.json is byte-identical.

🤖 Generated with Claude Code

The project does not use index files, so these get names that say what
they hold:

- src/index.ts and src/index.d.ts become src/replot.ts and
  src/replot.d.ts, the package entry. The published specifiers are
  unchanged; only the dist paths in package.json move, to
  dist/esm/replot.js and dist/types/replot.d.ts.
- src/scales/index.js and src/scales/index.d.ts become
  src/scales/registry.js and src/scales/registry.d.ts, after the scale
  registry and kind symbols they define. Upstream still calls this file
  scales/index.js, so a re-sync has to map it across.
- test/plots/index.ts becomes test/plots/registry.ts, the snapshot test
  registry.

test/plots/index.html stays, as it is the page the Vite dev server
serves at the root, not a module.

Also drops the skip for src/react/index.d.ts from copy-declarations,
since that file no longer exists, and corrects the note in
CONTRIBUTING.md on how the tests resolve the package.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dave-hillier
dave-hillier merged commit 9189209 into main Sep 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant