From 00afc28b70669265a1d7d6ba88404b18978452be Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 2 Sep 2026 13:33:24 +0200 Subject: [PATCH 1/3] fix(repo): Align nx cache outputs with actual build outputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Claude-Session: https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB --- packages/astro/package.json | 13 +++++++++++++ packages/aws-serverless/package.json | 3 ++- packages/deno/package.json | 2 +- packages/google-cloud-serverless/package.json | 15 ++++++++++++++- packages/nestjs/package.json | 3 ++- packages/remix/package.json | 15 ++++++++++++++- packages/tanstackstart-react/package.json | 15 ++++++++++++++- packages/vue/package.json | 13 ++++++++++++- 8 files changed, 72 insertions(+), 7 deletions(-) diff --git a/packages/astro/package.json b/packages/astro/package.json index f7c3f35da64b..22690c7d6d05 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -88,5 +88,18 @@ }, "astro": { "external": true + }, + "nx": { + "targets": { + "build:transpile": { + "outputs": [ + "{projectRoot}/build/esm", + "{projectRoot}/build/cjs", + "{projectRoot}/build/npm/esm", + "{projectRoot}/build/npm/cjs", + "{projectRoot}/build/import-hook.mjs" + ] + } + } } } diff --git a/packages/aws-serverless/package.json b/packages/aws-serverless/package.json index c957bab5f64c..fa061388be7e 100644 --- a/packages/aws-serverless/package.json +++ b/packages/aws-serverless/package.json @@ -108,7 +108,8 @@ "{projectRoot}/build/npm/cjs", "{projectRoot}/build/npm/run-lambda-handler.mjs", "{projectRoot}/build/npm/run-lambda-handler.mjs.map", - "{projectRoot}/build/lambda-extension" + "{projectRoot}/build/lambda-extension", + "{projectRoot}/build/import-hook.mjs" ], "cache": true }, diff --git a/packages/deno/package.json b/packages/deno/package.json index 25541f23eee6..67a0462f9823 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -69,7 +69,7 @@ }, "build:types": { "outputs": [ - "{projectRoot}/build-types" + "{projectRoot}/build/esm/**/*.d.ts" ] } } diff --git a/packages/google-cloud-serverless/package.json b/packages/google-cloud-serverless/package.json index b36eb35e039d..65dff6ffc4db 100644 --- a/packages/google-cloud-serverless/package.json +++ b/packages/google-cloud-serverless/package.json @@ -79,5 +79,18 @@ "volta": { "extends": "../../package.json" }, - "sideEffects": false + "sideEffects": false, + "nx": { + "targets": { + "build:transpile": { + "outputs": [ + "{projectRoot}/build/esm", + "{projectRoot}/build/cjs", + "{projectRoot}/build/npm/esm", + "{projectRoot}/build/npm/cjs", + "{projectRoot}/build/import-hook.mjs" + ] + } + } + } } diff --git a/packages/nestjs/package.json b/packages/nestjs/package.json index ee280110eb85..d53568832a55 100644 --- a/packages/nestjs/package.json +++ b/packages/nestjs/package.json @@ -95,7 +95,8 @@ ], "outputs": [ "{projectRoot}/build/types", - "{projectRoot}/*.d.ts" + "{projectRoot}/*.d.ts", + "{projectRoot}/*.d.ts.map" ], "cache": true } diff --git a/packages/remix/package.json b/packages/remix/package.json index e1b4fc5d3f4f..301894a7deaa 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -100,5 +100,18 @@ "volta": { "extends": "../../package.json" }, - "sideEffects": false + "sideEffects": false, + "nx": { + "targets": { + "build:transpile": { + "outputs": [ + "{projectRoot}/build/esm", + "{projectRoot}/build/cjs", + "{projectRoot}/build/npm/esm", + "{projectRoot}/build/npm/cjs", + "{projectRoot}/build/import-hook.mjs" + ] + } + } + } } diff --git a/packages/tanstackstart-react/package.json b/packages/tanstackstart-react/package.json index 14ac56214323..b556b1187638 100644 --- a/packages/tanstackstart-react/package.json +++ b/packages/tanstackstart-react/package.json @@ -87,5 +87,18 @@ "volta": { "extends": "../../package.json" }, - "sideEffects": false + "sideEffects": false, + "nx": { + "targets": { + "build:transpile": { + "outputs": [ + "{projectRoot}/build/esm", + "{projectRoot}/build/cjs", + "{projectRoot}/build/npm/esm", + "{projectRoot}/build/npm/cjs", + "{projectRoot}/build/import-hook.mjs" + ] + } + } + } } diff --git a/packages/vue/package.json b/packages/vue/package.json index 6972b425aeda..3658e06546b0 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -89,5 +89,16 @@ "volta": { "extends": "../../package.json" }, - "sideEffects": false + "sideEffects": false, + "nx": { + "targets": { + "build:types": { + "outputs": [ + "{projectRoot}/build/types", + "{projectRoot}/*.d.ts", + "{projectRoot}/*.d.ts.map" + ] + } + } + } } From 59817ba8e2ae4816ea65b7b5a5edbaf3494b8b97 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 2 Sep 2026 13:52:21 +0200 Subject: [PATCH 2/3] fix(repo): Make deno build:transpile and build:types cache outputs disjoint 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) Claude-Session: https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB --- packages/deno/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/deno/package.json b/packages/deno/package.json index 67a0462f9823..0ba8303daf79 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -64,7 +64,8 @@ "targets": { "build:transpile": { "outputs": [ - "{projectRoot}/build" + "{projectRoot}/build", + "!{projectRoot}/build/esm/**/*.d.ts" ] }, "build:types": { From f5b52aacdaa79056d944328b962f8faa3c9e6a95 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 2 Sep 2026 14:02:10 +0200 Subject: [PATCH 3/3] fix(repo): Skip negated Nx outputs in ci-print-build-artifact-paths 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) Claude-Session: https://claude.ai/code/session_01SFugqE3KWYfwqEfqEbjLsB --- scripts/ci-print-build-artifact-paths.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/ci-print-build-artifact-paths.mjs b/scripts/ci-print-build-artifact-paths.mjs index 690b995d78b2..f4d03b6d8b0b 100644 --- a/scripts/ci-print-build-artifact-paths.mjs +++ b/scripts/ci-print-build-artifact-paths.mjs @@ -61,6 +61,12 @@ for (const node of Object.values(graph.nodes)) { } for (const output of outputs) { + // Negated outputs only narrow a target's Nx cache ownership to keep parallel targets' + // outputs disjoint; they are not files to exclude from the uploaded artifact — those files + // are emitted and owned by another target and must still be uploaded via its output. + if (output.startsWith('!')) { + continue; + } const rel = output.replace(/\{projectRoot\}/g, root).replace(/\\/g, '/'); const prefix = `${kind}/${pkg}/`; if (!rel.startsWith(prefix)) {