Does Nx have a recomme…

less than 1 minute read

Does Nx have a recommendation around how to structure storybook configuration with your workspaces?

Currently, I use nx generate @nrwl/react:storybook-configuration to generate a storybook config, one for each library (with a .storybook at root level).

Is it recommended/best practice to have a storybook config per library or have only one storybook configuration for all the UI libs in the workspace? Or is it up to consumers of Nx to have a guideline that fits their workspace?

Responses:

I notice that when creating storybook configuration, Nx also prompts to create a cypress e2e app to test this storybook, so was wondering what’s the motivation behind that?

in terms of the motivation behind cypress testing storybook: https://blog.nrwl.io/ui-testing-with-storybook-and-nx-4b86975224c

:+1:

libs tend to extend root level configs for many things so i think makes sense for storybook to as well. How much goes into your root level config would be the lever to pull perhaps?

I also gave a conference talk covering similar material: https://www.youtube.com/watch?v=C88th0SbepE

Updated: