Nx: [storybook] no .stories generated?

Created on 30 Nov 2019  路  5Comments  路  Source: nrwl/nx

Expected Behavior

Please describe the behavior you are expecting

Current Behavior

Running:

 npm run nx g @nrwl/angular:storybook-configuration shared-components

or

ng g stories shared-components

should generate .stories files for my (ui)-components.

What is the current behavior?

When running the first command: no stories are generated and when running the second command afterwards I receive:

Nothing to be done.

Context

  • I'm running the latest NX (8.8.3) nothin fancy here.
  • Library contains simple ui-components, but styling or styleUrls is included (don't know if that may play a part)
storybook bug

Most helpful comment

ahhh that explains. We don't work with root modules, but instead libraries export multiple modules.

I suppose a search for any .module.ts file in the lib should be the way to have this fixed.

All 5 comments

What *.module.ts files are in the root level of that library? The stories schematic is currently dumbly taking the first *.module.ts file it finds and looking for a declarations array on it.

I'd like to add an optional parameter to specify the module file manually.

ahhh that explains. We don't work with root modules, but instead libraries export multiple modules.

I suppose a search for any .module.ts file in the lib should be the way to have this fixed.

Closing as I believe this issue is fixed with #2583. Please reopen this issue if this is not the case.

Yeah I haven't found time to try the StoryBook implementation for our NX Repo once more. I guess it will be fixed, will report back if I stumble upon this issue again.

Screen Shot 2020-04-03 at 17 24 00

I can confirm this is not working (no .stories files created), we have a root level .module.ts that looks like:

    declarations: [
        SidebarComponent,
        SidebarSecondaryComponent,
        NotificationsComponent,
        SearchInputComponent,
        ModalComponent,
        HeaderComponent
    ],

just migrated workspace to latest 9.2.1 successfully

Was this page helpful?
0 / 5 - 0 ratings