chore: migrate gen-json-schemas to TS#874
Merged
graphite-app[bot] merged 1 commit intoApr 6, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates the JSON-schema → Go-options generator script from the prior JS/MJS style to TypeScript, and updates contributor/CI entrypoints to invoke the new .ts script.
Changes:
- Refactors
tools/gen-json-schemasto include TypeScript typings and updated internal helper implementations. - Updates docs to instruct running the
.tsgenerator. - Updates the
check-schemasCI workflow to run the.tsgenerator.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tools/gen-json-schemas.ts | Converts generator implementation to TS (types + refactors) and adjusts error handling/variable naming. |
| .github/workflows/check-schemas.yml | Switches schema-generation step to invoke the .ts script. |
| CONTRIBUTING.md | Updates contributor instructions to run the .ts generator. |
| AGENTS.md | Updates agent checklist to run the .ts generator. |
Comments suppressed due to low confidence (3)
tools/gen-json-schemas.ts:16
- This script contains TypeScript-only syntax (type declarations and
as typeof import(...)assertions). If it's executed via plainnode tools/gen-json-schemas.ts(as the workflow/docs now suggest), Node will throw a syntax error unless the environment enables TypeScript type-stripping / a TS loader. Consider either (1) keeping this as JS/MJS, (2) compiling it to JS as part of the workflow, or (3) updating invocations to use a TS runner (and ensuring CI installs it).
tools/gen-json-schemas.ts:36 - The
catch { ... }here discards the underlying error from the failedgo-jsonschema -hinvocation, which makes troubleshooting CI/local failures harder (e.g., PATH issues vs. non-zero exit). Capture the error and print it (or at least log it at stderr) before exiting.
tools/gen-json-schemas.ts:77 definitionNameis never used in this loop. If/when this script is typechecked withnoUnusedLocals, it will become a compile error. Either omit the key from destructuring or rename it to_/_definitionNameto make the intent explicit.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
Merge activity
|
607be45 to
50cb30f
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.
No description provided.