Chromatic monorepo support
See original GitHub issueDescription
Chromatic recently released an update for monorepo support: https://www.chromatic.com/blog/monorepo-support/
Their CI action depend on a package.json with a build-storybook command executed on chromaui/action@v1.
Building your Storybook
[25](https://github.com/sebpalluel/web3-monorepo/actions/runs/3288784830/jobs/5419537372#step:5:26)
→ Running command: npm run --silent build-storybook -- --output-dir /tmp/chromatic--2013-rdrqIkCuLAH4
There is no clear way to handle a deploy for each storybook instances on a workspace because NX centralize everything in one main package.json
Motivation
Currently it’s possible to add this command to build one instance of all the storybooks:
//package.json
{
//...
scripts: {
'build-storybook': 'nx run-many --target=build-storybook --all',
},
}
It would be nice to be able to publish separate storybook like described here: https://www.chromatic.com/docs/github-actions#run-chromatic-on-monorepos
Suggested Implementation
A generator in @nrwl/storybook to update the workspace with the needed files (like a package.json with the build-storybook command on each apps/libs where there is a storybook config)
Alternate Implementations
A guide in https://nx.dev/storybook#storybook to handle this manually or create an alternate github action workflow for chromaui/action@v1 to make it work for nx projects.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
Hi there, thanks for the feature request! I am going to put a bit more thought into this in a couple of weeks, and get back to you!
Just to check: would you be willing to implement this?
Ok, noting that. This feature is not in our roadmap yet, but if someone wants to implement it, I’ll be more than happy to help.
In the meantime, can you use a solution like this: https://nx.dev/storybook/best-practices#how-to-set-up-storybook-to-get-the-most-out-of-nx In a solution like that, you don’t have to publish all storybooks. You just create one Storybook and import all the stories in there.