rename the companion-type suffix from Json to Data, and stop recognizing the old one - #232
Merged
Merged
Conversation
…ing the old one A declaration named `XJson` published every generated name as `X` — the TypeScript type, the Zod consts, the JSON Schema id, and what a reference to it resolves as. The recognized suffix is `Data` now, with the same mechanics: suffix-only, exact case, and `XData` publishes as `X` everywhere a name is read. `Json` is not recognized at all — a hard switch, taken after auditing the consuming workspace and finding no Json-suffixed declaration to migrate. Recognition lives in one place where it lived in two. The reference-resolution arm was behaviourally identical to the stripping seam once the guard sits there, so it now routes through the same function instead of repeating the suffix, and a grep finds no other name-level suffix reading. Stripping never empties a name: a type named exactly `Data` keeps it. The old code lacked that guard — `Json` alone stripped to the empty string — so it is new, not preserved. Pinned from both directions: `SomethingData` publishes as `Something` on all three surfaces including reference resolution, and `SomethingJson` publishes as itself, so the old convention is provably gone rather than merely undocumented. Eleven fixtures migrated to the new suffix; one incidental `Json`-named fixture about JSON Schema itself was respelled to match its siblings; the docs' naming-convention sections and worked examples move with it. just fmt, just check, just quick, doctests, just lint-all across all 68 toggles, and the test powerset across all 68 in four partitions — all green.
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.
A declaration named
XJsonpublished every generated name asX— theTypeScript type, the Zod consts, the JSON Schema id, and what a reference to it
resolves as. The recognized suffix is
Datanow, with the same mechanics:suffix-only, exact case, and
XDatapublishes asXeverywhere a name isread.
Jsonis not recognized at all — a hard switch, taken after auditing theconsuming workspace and finding no Json-suffixed declaration to migrate.
Recognition lives in one place where it lived in two. The reference-resolution
arm was behaviourally identical to the stripping seam once the guard sits
there, so it now routes through the same function instead of repeating the
suffix, and a grep finds no other name-level suffix reading.
Stripping never empties a name: a type named exactly
Datakeeps it. The oldcode lacked that guard —
Jsonalone stripped to the empty string — so it isnew, not preserved.
Pinned from both directions:
SomethingDatapublishes asSomethingon allthree surfaces including reference resolution, and
SomethingJsonpublishesas itself, so the old convention is provably gone rather than merely
undocumented. Eleven fixtures migrated to the new suffix; one incidental
Json-named fixture about JSON Schema itself was respelled to match itssiblings; the docs' naming-convention sections and worked examples move with
it.
just fmt, just check, just quick, doctests, just lint-all across all 68
toggles, and the test powerset across all 68 in four partitions — all green.