fix: pin typescript and harden lockfile check in docs examples CI#21909
Merged
Conversation
sklppy88
approved these changes
Mar 23, 2026
Two fixes for docs examples CI failures affecting all PRs: 1. Pin typescript to ^5.3.3 (matching yarn-project) instead of unpinned latest. TypeScript 6.0 changed JSON import type inference, making @ts-expect-error directives unused (TS2578 errors). 2. Change yarn.lock emptiness check to use git state (git show HEAD:...) instead of filesystem state (-s). When parallel kills a job mid-yarn add, the cleanup trap never runs, leaving lockfiles dirty on disk. The retry then hits a false positive. Now checks committed state and resets filesystem before validation.
f33dd42 to
1f2a3dc
Compare
1 task
critesjosh
added a commit
that referenced
this pull request
Mar 23, 2026
… backport) (#21914) ## Summary Backport of #21909 to `backport-to-v4-next-staging`. - Pin `typescript@^5.3.3` in docs examples validation (was unpinned, pulling TS 6.0 which breaks `@ts-expect-error` directives) - Use git state instead of filesystem state for yarn.lock emptiness check (prevents false positives on retry after interrupted parallel runs) ## Context See #21909 for full details. The same `docs/examples/ts/bootstrap.sh` exists on this branch with the same two issues. ## Test plan - [ ] CI passes on this PR 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AztecBot
pushed a commit
that referenced
this pull request
Mar 24, 2026
… backport) (#21914) ## Summary Backport of #21909 to `backport-to-v4-next-staging`. - Pin `typescript@^5.3.3` in docs examples validation (was unpinned, pulling TS 6.0 which breaks `@ts-expect-error` directives) - Use git state instead of filesystem state for yarn.lock emptiness check (prevents false positives on retry after interrupted parallel runs) ## Context See #21909 for full details. The same `docs/examples/ts/bootstrap.sh` exists on this branch with the same two issues. ## Test plan - [ ] CI passes on this PR 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Thunkar
pushed a commit
that referenced
this pull request
Mar 24, 2026
… backport) (#21914) ## Summary Backport of #21909 to `backport-to-v4-next-staging`. - Pin `typescript@^5.3.3` in docs examples validation (was unpinned, pulling TS 6.0 which breaks `@ts-expect-error` directives) - Use git state instead of filesystem state for yarn.lock emptiness check (prevents false positives on retry after interrupted parallel runs) ## Context See #21909 for full details. The same `docs/examples/ts/bootstrap.sh` exists on this branch with the same two issues. ## Test plan - [ ] CI passes on this PR 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Summary
typescript@^5.3.3in docs examples validation to matchyarn-project. The unpinnedyarn add -D typescriptstarted pulling TypeScript 6.0, which changed JSON import type inference and made existing@ts-expect-errordirectives unused (TS2578 errors), breakingexample_swaptype-checking.git show HEAD:...) instead of filesystem state (-s) for yarn.lock emptiness check. Whenexample_swapfails, GNU parallel's--halt now,fail=1kills other jobs mid-yarn addbefore cleanup traps run, leaving lockfiles dirty on disk. On retry, the check found dirty filesystem state and reported the misleadingtoken_bridge/yarn.lock is not emptyerror.Context
Multiple unrelated PRs (#21865, #21907, #21812) are failing with:
Root cause chain:
yarn add -D typescript(unpinned) pulls TS 6.0, released today@ts-expect-errordirectives unused → TS2578 errors inexample_swapexample_swapfails →--halt now,fail=1killstoken_bridgemid-yarn add→ cleanup trap never runstoken_bridge/yarn.lockon filesystem → misleading errorTest plan
example_swapandtoken_bridgetype-check cleanly with pinned TS 5.x🤖 Generated with Claude Code