refactor(core): drop inline mapping diagrams from dts-generator#400
Merged
Conversation
|
4 tasks
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>
8f6a114 to
5e2872f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the inline ASCII diagrams in
packages/core/src/dts-generator.tsthat explained the correspondence between the generated code and the mappings.That information is now covered well enough by:
packages/core/src/dts-generator.test.tsdocs/ts-plugin-internals.mdKeeping 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) passesvp test --project unit packages/core/src/dts-generator.test.tspasses (no behavioral change)🤖 Generated with Claude Code