Skip to content

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

Description

@Roozenboom

Current Behavior

When you use the configure storybook generator for @storybook/angular it adds the tsconfig.storybook.json to the namedInputs production and targetDefaults in nx.json, but for angular storybook adds a tsconfig.json to the .storybook folder of the project and add a reference to the main tsconfig.json in the project.
So the storybook configuration generator creates two entries to the nx.json that are not needed or used.

Expected Behavior

The expected behavior is that the generator creates (or not) the entries in the nx.json based on used framework, so in case of @storybook/angular it should skip this step.

The logic required for this check is already used in the same generator to create the tsconfig file in the correct place.

GitHub Repo

No response

Steps to Reproduce

  1. Make sure your nx.json does not have a namedInput tsconfig.storybook.json for production
  2. Run pnpm nx g @nx/angular:storybook-configuration to add the storybook config to a new project.
  3. Check the generated output of the nx.json, the entry tsconfig.storybook.json is added to the namedInput production

Nx Report

Node           : 24.13.1
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 10.32.1
daemon         : Available

nx                 : 22.4.5
@nx/js             : 22.4.5
@nx/eslint         : 22.4.5
@nx/workspace      : 22.4.5
@nx/angular        : 22.4.5
@nx/jest           : 22.4.5
@nx/devkit         : 22.4.5
@nx/esbuild        : 22.4.5
@nx/eslint-plugin  : 22.4.5
@nx/playwright     : 22.4.5
@nx/storybook      : 22.4.5
@nx/vite           : 22.4.5
@nx/web            : 22.4.5
typescript         : 5.9.3

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I identified that these entries are added to the nx.json by two methods in packages/storybook/src/generators/configuration/lib/util-functions.ts, addStorybookToNamedInputs and addStorybookToTargetDefaults. I can prepare a pull request to add the condition for the uiFramework

Metadata

Metadata

Assignees

Labels

communityThis is a good first issue for contributingpriority: lowLow Priority (does not affect many people or not severely or has an easy workaround)scope: storybookIssues related to Storybook support in Nxtype: bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions