fix(repo): Align nx cache outputs with actual build outputs - #23929
Merged
Conversation
Audit of every cached nx target's `outputs` against what each build command actually emits, fixing mismatches that would drop files on a cache restore. build:transpile — declare the `build/import-hook.mjs` emitted by `makeOrchestrionLoader` for the remaining server SDKs (astro, aws-serverless, google-cloud-serverless, remix, tanstackstart-react). build:types — capture root subpath-export declarations that no cached target was covering: - vue: add override for root `*.d.ts`/`*.d.ts.map` (tanstackrouter) - nestjs: add missing `*.d.ts.map` - deno: point at `build/esm/**/*.d.ts` (real location) instead of the never-produced `build-types` Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 00afc28. Configure here.
| "{projectRoot}/build/import-hook.mjs" | ||
| ] | ||
| } | ||
| } |
There was a problem hiding this comment.
Fix PR missing regression test
Low Severity
This fix PR has no test that would fail if an nx outputs list again missed a file the build emits. The review guidelines for fix PRs require a regression test, which is what let these cache lists drift in the first place.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 00afc28. Configure here.
Contributor
size-limit report 📦
|
…sjoint deno's build:transpile cached the whole build/ tree, which contains the .d.ts files build:types emits into build/esm (tsc emitDeclarationOnly + outDir build/esm). With both targets claiming those declarations and no dependsOn edge between them, they run in parallel and a build:transpile cache restore can overwrite or drop the declarations build:types just produced or restored. Exclude the declaration files from build:transpile's outputs so the two targets' claims are disjoint; build:types remains their sole owner. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB
A negated Nx output (e.g. "!{projectRoot}/build/esm/**/*.d.ts") only
narrows a target's cache ownership to keep parallel targets' outputs
disjoint; it is not a file to exclude from the uploaded artifact. The
script mapped every output to an upload path and threw on the leading
"!" because it fails the project-prefix check. Skip negated outputs so
those files are still uploaded via the target that owns them.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB
mydea
marked this pull request as ready for review
September 2, 2026 12:16
mydea
requested review from
JPeer264,
isaacs,
nicohrubec and
s1gr1d
and removed request for
a team
September 2, 2026 12:16
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.


Audits every cached nx target's
outputsagainst what each package's build command actually emits, and fixes the mismatches. When a target produces a file that isn't listed in itsoutputs, nx never stores it in the cache — so a later cache hit restores an incompletebuild/, silently missing files until a full rebuild.build:transpile— themakeOrchestrionLoader('./build')helper emitsbuild/import-hook.mjs, but only some of its callers declared it. Added it for the remaining server SDKs: astro, aws-serverless, google-cloud-serverless, remix, tanstackstart-react. (node and nextjs already declared it.)build:types— several packages run a secondtscfor subpath exports that writes declarations outsidebuild/types, uncaptured by any cached target:tsconfig.router-types.jsonemitstanstackrouter.d.ts+.d.ts.mapat the package root. Added an override mirroringsolid(build/types,*.d.ts,*.d.ts.map).declarationMap: true, so it also emits*.d.ts.mapat root, which the override was missing.build-types, a directory that is never produced; itstscactually writes declarations intobuild/esm. Repointed tobuild/esm/**/*.d.ts(recursive, since deno'ssrcis nested).Root cause: these
outputslists were maintained by hand as build steps were added (extratscpasses, the orchestrion import-hook), so per-package emitters drifted out of sync with the declarations.Verified against the rollup/tsconfig configs rather than on-disk
build/dirs, since some of those are stale (e.g. leftoverpackages/node-core/,packages/tanstackstart/with nopackage.json). The other cached targets —build:bundle(build/bundles),build:tarball(*.tgz),build:layer(build/aws),lint(no outputs),test:unit(coverage) — were checked and already correct.🤖 Generated with Claude Code
https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB