Skip to content

fix(storybook): update configuration generator nx.json - #34880

Merged
leosvelperez merged 5 commits into
nrwl:masterfrom
Roozenboom:bugfix/storybook-angular-nx-json
Jul 17, 2026
Merged

fix(storybook): update configuration generator nx.json#34880
leosvelperez merged 5 commits into
nrwl:masterfrom
Roozenboom:bugfix/storybook-angular-nx-json

Conversation

@Roozenboom

Copy link
Copy Markdown
Contributor

update namedImports and targetDefaults to not include tsconfig.storybook.json in case the framework is angular

Current Behavior

When generating storybook configuration for a new project, the nx.json is updated with an entry in the namedImports and targetDefaults for `tsconfig.storybook.json. This file does not exists when angular is used as uiFramework

Expected Behavior

In case the uiFramework is angular the file tsconfig.storybook.json should not be added to the namedInputs or targetDefaults in nx.json

Related Issue(s)

Fixes #34879

update namedImports and targetDefaults to not include tsconfig.storybook.json in case the framework is angular

Closes nrwl#34879
@Roozenboom
Roozenboom requested a review from a team as a code owner March 17, 2026 15:09
@Roozenboom
Roozenboom requested a review from jaysoo March 17, 2026 15:09
@netlify

netlify Bot commented Mar 17, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 362f677

@netlify

netlify Bot commented Mar 17, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 362f677

@FrozenPandaz
FrozenPandaz self-requested a review March 17, 2026 20:04
@FrozenPandaz FrozenPandaz self-assigned this Mar 17, 2026
@Roozenboom
Roozenboom requested a review from a team as a code owner April 2, 2026 19:22
@nx-cloud

nx-cloud Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 362f677

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 1h 2m 8s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 7s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 58s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 18s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-17 13:46:15 UTC

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We applied automatic formatting via pnpm nx format to fix the format:check failure on packages/storybook/src/generators/configuration/lib/util-functions.ts. The file was modified as part of the storybook Angular nx.json fix but was not formatted before the PR was pushed. This change brings the file in line with the workspace's Prettier configuration.

Tip

We verified this fix by re-running nx-cloud record -- nx format:check.

diff --git a/packages/storybook/src/generators/configuration/lib/util-functions.ts b/packages/storybook/src/generators/configuration/lib/util-functions.ts
index 05196cd6..adf78d2f 100644
--- a/packages/storybook/src/generators/configuration/lib/util-functions.ts
+++ b/packages/storybook/src/generators/configuration/lib/util-functions.ts
@@ -672,8 +672,8 @@ export function getTsConfigPath(
     path?.length > 0
       ? path
       : getProjectType(tree, root, projectType) === 'application'
-      ? 'tsconfig.app.json'
-      : 'tsconfig.lib.json'
+        ? 'tsconfig.app.json'
+        : 'tsconfig.lib.json'
   );
 }
 

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.

Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.

Apply changes locally with:

npx nx-cloud apply-locally iFuj-C9ko

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

…gular-nx-json

# Conflicts:
#	packages/storybook/src/generators/configuration/lib/util-functions.ts
The getTsConfigPath ternary on this branch kept the pre-prettier-3 indentation, so it no longer matched the formatting on master. Running nx format realigns it.
The configuration generator skips tsconfig.storybook.json in nx.json when the UI framework is Angular, but nothing asserted it, so the suite passed with or without the gate. Cover both the production named input and the build-storybook target default, in the Angular and non-Angular directions.

@leosvelperez leosvelperez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@leosvelperez
leosvelperez merged commit a283c4f into nrwl:master Jul 17, 2026
17 checks passed
FrozenPandaz pushed a commit that referenced this pull request Jul 20, 2026
update namedImports and targetDefaults to not include
`tsconfig.storybook.json` in case the framework is angular

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When generating storybook configuration for a new project, the nx.json
is updated with an entry in the namedImports and targetDefaults for
`tsconfig.storybook.json. This file does not exists when angular is used
as uiFramework

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
In case the uiFramework is angular the file `tsconfig.storybook.json`
should not be added to the namedInputs or targetDefaults in nx.json

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #34879

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
(cherry picked from commit a283c4f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong tsconfig added to nx.json for @storybook/angular

3 participants