-
Notifications
You must be signed in to change notification settings - Fork 20
chore: add generation guidance and verification workflow #431
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Verify Generated Artifacts | ||
|
|
||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| verify-generated-content: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: latest | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: Run generation scripts | ||
| run: | | ||
| bun scripts/generate-component-types.ts | ||
| bun scripts/generate-manual-edits-docs.ts | ||
| bun scripts/generate-readme-docs.ts | ||
| bun scripts/generate-props-overview.ts | ||
|
|
||
| - name: Ensure working tree is clean | ||
| run: | | ||
| if ! git diff --quiet; then | ||
| echo "Generated files are out of date. Please run the generation scripts and commit the results." >&2 | ||
| git status --short | ||
| exit 1 | ||
| fi | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Repository Guidance | ||
|
|
||
| This repository contains the generated props documentation and supporting scripts for the `@tscircuit/props` package. Many files—especially under `docs/` and `generated/`—are produced by scripts inside the `scripts/` directory. Keeping these generated artifacts in sync is critical for ensuring the package consumers receive up-to-date information. | ||
|
|
||
| ## Required Workflow Before Committing | ||
| - Always run the generation scripts and include their results in your commit before opening a pull request or merging changes. Run the scripts with: | ||
| ```sh | ||
| bun scripts/generate-component-types.ts | ||
| bun scripts/generate-manual-edits-docs.ts | ||
| bun scripts/generate-readme-docs.ts | ||
| bun scripts/generate-props-overview.ts | ||
| ``` | ||
| - After running the scripts, confirm that `git status` reports a clean working tree (or that you have staged all generated changes) before committing. | ||
|
|
||
| Following these steps helps prevent CI failures and ensures generated content stays in sync with the source definitions. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verification job always runs
scripts/generate-props-overview.ts, which rewritesgenerated/PROPS_OVERVIEW.mdwith> Generated at ${new Date().toISOString()}on each invocation. Even when the committed artifacts are up to date, this timestamp changes on CI andgit diff --quietwill fail, blocking every PR. The workflow needs to ignore the timestamp, make the generator deterministic, or skip that file entirely so that a clean working tree is possible.Useful? React with 👍 / 👎.