Skip to content

chore: migrate gen-json-schemas to TS#874

Merged
graphite-app[bot] merged 1 commit into
mainfrom
c/04-06-chore_migrate_gen-json-schemas_to_ts
Apr 6, 2026
Merged

chore: migrate gen-json-schemas to TS#874
graphite-app[bot] merged 1 commit into
mainfrom
c/04-06-chore_migrate_gen-json-schemas_to_ts

Conversation

@camc314

@camc314 camc314 commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 6, 2026 15:45
@camc314 camc314 added the 0-merge label Apr 6, 2026
@camc314 camc314 self-assigned this Apr 6, 2026
@camc314 camc314 added 0-merge and removed 0-merge labels Apr 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-schemas to include TypeScript typings and updated internal helper implementations.
  • Updates docs to instruct running the .ts generator.
  • Updates the check-schemas CI workflow to run the .ts generator.

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 plain node 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 failed go-jsonschema -h invocation, 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
  • definitionName is never used in this loop. If/when this script is typechecked with noUnusedLocals, it will become a compile error. Either omit the key from destructuring or rename it to _/_definitionName to make the intent explicit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/check-schemas.yml
Comment thread CONTRIBUTING.md
Comment thread AGENTS.md

camc314 commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@graphite-app graphite-app Bot force-pushed the c/04-06-chore_migrate_gen-json-schemas_to_ts branch from 607be45 to 50cb30f Compare April 6, 2026 16:05
@graphite-app graphite-app Bot merged commit 50cb30f into main Apr 6, 2026
8 checks passed
@graphite-app graphite-app Bot removed the 0-merge label Apr 6, 2026
@graphite-app graphite-app Bot deleted the c/04-06-chore_migrate_gen-json-schemas_to_ts branch April 6, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants