This repository was archived by the owner on Jun 25, 2026. It is now read-only.
fix(build): repair esbuild TS include so commons .ts transpiles (unblocks CI build)#478
Draft
maithri471 wants to merge 3 commits into
Draft
fix(build): repair esbuild TS include so commons .ts transpiles (unblocks CI build)#478maithri471 wants to merge 3 commits into
maithri471 wants to merge 3 commits into
Conversation
The shared rollup.common.config esbuild plugin gated TS transpilation on the
glob `${ROOT}/**/*.ts+(|x)`. That extglob no longer matches .ts files under
picomatch 4.x, and CI runs `npm install` (which ignores our yarn.lock), so
picomatch floats to 4.x. esbuild therefore silently stopped transpiling
TypeScript and every component build failed on the first raw .ts import
(commons/src/define-component-patch.ts -> "Unexpected token ... need plugins
to import files that are not JavaScript").
Replace the fragile glob with a cwd/picomatch-independent regex /\.tsx?$/.
Verified with the repo's exact plugin versions ([email protected],
[email protected]): the old glob reproduces the error, the regex transpiles
cleanly. This was masked for a long time because CI's build job died at the
deprecated actions/cache@v2 setup gate before ever running `yarn build`.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
These jobs had no checkout step and pulled the entire workspace from the build job via actions/cache (path: ./*). That cross-job handoff broke after the mandatory cache@v2 -> v4 migration (the v2 backend was shut down): the restore misses, so the jobs run against an empty workspace and fail fast with `npm ERR! enoent ... package.json`. Give each job its own actions/checkout@v4 + npm install (matching the build job) so it no longer depends on the fragile cache handoff. Note: test-cypress uses the same handoff but also needs the built app to serve; left for a separate change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… build) These jobs now check out and install on their own, so they no longer need build's output. `needs: build` only made them idle ~22 min waiting for the build to finish before starting. Dropping it lets them run immediately in parallel, cutting feedback time from ~25 min to ~5-6 min. publish still gates on all four jobs via its own needs list; test-cypress keeps needs: build (it serves the built app). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Now that #477 unblocked the CI
buildjob (it bumped the hard-deprecatedactions/cache@v2→ v4),buildactually reachesyarn build— and fails repo-wide:mainis red and this blocks every PR.Root cause
rollup.common.config.jsgates esbuild's TypeScript transpile with a glob:That
+(|x)extglob no longer matches.tsfiles under picomatch 4.x. The repo ships ayarn.lock, but CI installs withnpm install, which ignoresyarn.lock— so picomatch floats to 4.x and esbuild silently stops transpiling all TypeScript. Every component build then dies on the first raw.tsimport (commons/src/define-component-patch.ts). It stayed hidden because CI'sbuildjob used to die at theactions/cache@v2setup gate beforeyarn buildever ran.Fix
Replace the fragile, cwd-/picomatch-dependent glob with a regex:
Verification
Reproduced and fixed with the repo's exact plugin versions (
[email protected],[email protected]) against the real offending file:include: ['**/*.ts+(|x)']→Unexpected token(bug reproduced)include: /\.tsx?$/→ clean build; output transpiled (name: string→name)Also confirmed at the filter layer:
createFilter(['../../**/*.ts+(|x)'])returnsfalsefor the commons.tsfile; the regex returnstrue. Final end-to-end check is this PR's CI run (Linux + node 14, where node-sass compiles — it won't build on macOS locally).Follow-ups (separate)
yarn.lock+npm install. Useyarn install --frozen-lockfile(or commitpackage-lock.json+npm ci) so transitive deps can't drift like this again.actions/checkout@v2,actions/setup-node@v2,::set-outputin the workflow.🤖 Generated with Claude Code