[DRAFT] In house JsonSchema to TS generator - #1382
Open
JuanGalilea wants to merge 20 commits into
Open
JuanGalilea wants to merge 20 commits into
JuanGalilea wants to merge 20 commits into
Conversation
JuanGalilea
force-pushed
the
json-schema-to-ts-in-house
branch
from
September 8, 2026 10:11
d212525 to
e7c03f1
Compare
JuanGalilea
force-pushed
the
json-schema-to-ts-in-house
branch
from
September 9, 2026 11:58
9c2467e to
1406406
Compare
JuanGalilea
marked this pull request as ready for review
September 9, 2026 15:14
JuanGalilea
requested review from
DaveHanns,
l2ysho and
szaganek
as code owners
September 9, 2026 15:14
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.
base generator and tons of testing added.
actor generate-schema-typesInstall size change (
node scripts/report-install-size.mjs)AI
/show-mebelowReplaces the
json-schema-to-typescriptdependency with an in-house schema→TypeScript compiler (src/lib/schema-to-ts/, zero runtime deps — onlynode:crypto), and reframes the CLI flag surface around a single--perspective.The pipeline
Two orthogonal signals come out: diagnostics = fidelity lost (something became
unknown), notices = schema lint with no type impact. Neither feeds the hash.The
supplied/receivedsplit is the conceptual core — same IR, two renderings:Drift detection
canonical.tssorts props/enum members whileemit.tsreproduces authored order — so reordering keys in a schema never reports drift. Header is matched anywhere in the file (gm), so a user's prepended banner is free; two headers →duplicate-headererror.CLI surface change
Behavior changes worth a reviewer's attention
export interface Inputexport type input— lowercase, fromconst name = 'input'biome-ignore-all,eslint-disable,prettier-ignore-startfields→ skip with warningexport type dataset = Record<string, unknown>;prettierformatting via the libraryArray<T>, parenthesized intersections)