Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sync-schema script to sync generator schema.json to d.ts #6

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

beeman
Copy link
Collaborator

@beeman beeman commented Nov 8, 2023

This PR adds the script tools/scripts/sync-schemas.ts that generates the *-schema.d.ts files based on the content in the -schema.json files for our generators using the json-schema-to-typescript package.

It also adds a check to the pre-commit hook to prevent committing an outdated schema. You can run yarn sync-schemas to sync them.

image

To make this work I moved around the NormalizedApplicationFooSchema interfaces and other custom types and put them in the same file as the normalize function.

@beeman beeman marked this pull request as ready for review November 8, 2023 22:38
@beeman beeman requested a review from nickfrosty November 8, 2023 22:51
name: string
skipFormat?: boolean
template?: ApplicationAnchorTemplate
name: string;
Copy link
Member

Choose a reason for hiding this comment

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

The name arg for most of the generators is not adding the description into the generated schema.d.ts files.
It looks like the name property for each of the 3 current presets do not have a description set. Is there a reason for that? (they do have a prompt text, just not description)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just added the description to the schema.json files and now they get added

@beeman beeman force-pushed the beeman/schema-generations branch from cbd8c84 to 78e1e09 Compare November 9, 2023 15:08
@beeman beeman merged commit 495aca4 into next Nov 9, 2023
@beeman beeman deleted the beeman/schema-generations branch November 9, 2023 15:10
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