From cbfc6fe97f32cacb5fe380a9cc423a5d73948531 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Thu, 9 Jan 2025 15:50:45 -0500 Subject: [PATCH] fix(js): update detection of ts solution setup (#29576) Since we simplified `tsconfig.base.json`'s `compilerOptions` to not include values that match defaults (as per Jake's feedback), the logic to detect TS solution setup should check that `declaration` is explicitly set to `false`, rather than that it is falsy. Clean up PR: https://github.com/nrwl/nx/pull/29550 ## Current Behavior We're not detecting TS solution setup correctly ## Expected Behavior Detection works ## Related Issue(s) Fixes # --- packages/js/src/plugins/typescript/plugin.spec.ts | 2 -- packages/js/src/utils/typescript/ts-solution-setup.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/js/src/plugins/typescript/plugin.spec.ts b/packages/js/src/plugins/typescript/plugin.spec.ts index 58f4495b4f087..6d2b4a49897c0 100644 --- a/packages/js/src/plugins/typescript/plugin.spec.ts +++ b/packages/js/src/plugins/typescript/plugin.spec.ts @@ -2905,7 +2905,6 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => { }, "outputs": [ "{workspaceRoot}/dist/libs/my-lib", - "{workspaceRoot}/dist/libs/*.tsbuildinfo", ], "syncGenerators": [ "@nx/js:typescript-sync", @@ -3066,7 +3065,6 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => { "{workspaceRoot}/dist/libs/my-lib/lib.d.ts.map", "{workspaceRoot}/dist/libs/my-lib/lib.tsbuildinfo", "{workspaceRoot}/dist/libs/my-lib/other", - "{workspaceRoot}/dist/libs/my-lib/*.tsbuildinfo", ], "syncGenerators": [ "@nx/js:typescript-sync", diff --git a/packages/js/src/utils/typescript/ts-solution-setup.ts b/packages/js/src/utils/typescript/ts-solution-setup.ts index a7a3bfa7ef42c..2ddec27b5191e 100644 --- a/packages/js/src/utils/typescript/ts-solution-setup.ts +++ b/packages/js/src/utils/typescript/ts-solution-setup.ts @@ -62,7 +62,7 @@ function isWorkspaceSetupWithTsSolution(tree: Tree): boolean { if ( !baseTsconfigJson.compilerOptions || !baseTsconfigJson.compilerOptions.composite || - !baseTsconfigJson.compilerOptions.declaration + baseTsconfigJson.compilerOptions.declaration === false ) { return false; }