Nx: [Feature request] Storybook Support

Created on 22 Feb 2019  路  6Comments  路  Source: nrwl/nx

Hello,

That would be nice if there were Storybook support, for Component Driven Development approach (with asset bundling support).

https://storybook.js.org/basics/guide-angular/

Thank you.

more info needed feature

Most helpful comment

I think it's important to realize that storybook isn't purely a documentation solution. It gives you the ability to develop your components in isolation and to easily emulate all the various states of your component without needed to wire it up and click through the application to view/test them.

All 6 comments

This kind of feature is something I'm interested in adding in the future to Nx. I think adding documentation is extremely important for organizations when they have so many sharable components and libraries. I've also looked at:

I'd like to brainstorm in this issue what the community would think is best here. I think for this to be successful, it needs the following:
[ ] Docs can be generated on a project level
[ ] Docs may contain Angular information such as module graph
[ ] Docs can also be generated by pure typescript libraries

@bohushvitali I didn't get why you referred jest.

@FrozenPandaz Compodoc looks great!

I think it's important to realize that storybook isn't purely a documentation solution. It gives you the ability to develop your components in isolation and to easily emulate all the various states of your component without needed to wire it up and click through the application to view/test them.

I'd love this feature out of the box, but a lot of things to consider here. First of all, I don't think Storybook supports a use-case of a monorepo at this time. It's only capable of being integrated with one type of a project - Angular, React, etc. As far as I know there is no way to provide a single configuration file to support multiple types of projects at the same time.

However, is there even a need to serve components from all kind of projects in the same storybook? Would a person working on Angular project really be interested in React components? I think it'd be OK to provide separate configs for different types of projects and have a separate npm script to start these.

Related issues:

Initial story book supported has been merged: https://github.com/nrwl/nx/commit/c60857a6df1301d79749b65748339f448de1e57e

The PR adds schematic for angular, but all the foundations are generic. We are adding support for React and Web right now. It should land in the next week or so.

I'm going to close this issue. If you have any concerns with the merged implementation, please open another issue.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zachnewburgh picture zachnewburgh  路  3Comments

MichaelWarneke picture MichaelWarneke  路  3Comments

about-code picture about-code  路  3Comments

ZempTime picture ZempTime  路  3Comments

sukei picture sukei  路  3Comments