Skip to content

refactor(core): drop inline mapping diagrams from dts-generator#400

Merged
mizdra merged 1 commit into
mainfrom
refactor/drop-dts-generator-mapping-diagrams
May 11, 2026
Merged

refactor(core): drop inline mapping diagrams from dts-generator#400
mizdra merged 1 commit into
mainfrom
refactor/drop-dts-generator-mapping-diagrams

Conversation

@mizdra
Copy link
Copy Markdown
Owner

@mizdra mizdra commented May 11, 2026

Summary

Remove the inline ASCII diagrams in packages/core/src/dts-generator.ts that explained the correspondence between the generated code and the mappings.

That information is now covered well enough by:

  • Concrete generated output: the inline snapshots in packages/core/src/dts-generator.test.ts
  • Design rationale: docs/ts-plugin-internals.md

Keeping the diagrams in the source meant paying a synchronization cost across three places (code, snapshot, and docs) every time the mapping shape changed. Drop the diagrams and let the snapshots be the single source of truth for the concrete shape.

Changes

  • packages/core/src/dts-generator.ts: Delete the mapping diagram comments adjacent to each code-generation branch (-180 lines in this file). No logic changes.

Test plan

  • vp check (lint / format / typecheck) passes
  • vp test --project unit packages/core/src/dts-generator.test.ts passes (no behavioral change)

🤖 Generated with Claude Code

@mizdra mizdra added the Type: Refactoring A code change that neither fixes a bug nor adds a feature label May 11, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

⚠️ No Changeset found

Latest commit: 5e2872f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

The diagrams duplicated information that is now better served by the
snapshot tests in dts-generator.test.ts (for the concrete generated
shape) and docs/ts-plugin-internals.md (for the design rationale).
Keeping them in sync with every change was extra maintenance cost.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mizdra mizdra force-pushed the refactor/drop-dts-generator-mapping-diagrams branch from 8f6a114 to 5e2872f Compare May 11, 2026 15:52
@mizdra mizdra merged commit ad81574 into main May 11, 2026
20 checks passed
@mizdra mizdra deleted the refactor/drop-dts-generator-mapping-diagrams branch May 11, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactoring A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant