question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chromatic monorepo support

See original GitHub issue

Description

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:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mandarinicommented, Oct 21, 2022

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?

0reactions
mandarinicommented, Nov 18, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Monorepos • Chromatic docs
As a monorepo can be associated with many Chromatic projects, there are a few tips that can help with using Chromatic with a...
Read more >
Chromatic (we're hiring!) on LinkedIn: Monorepo support
Monorepo support is here! Run in multiple subprojects in parallel ✓ Report status checks to the monorepo repository What's a monorepo?
Read more >
Chromatic (@chromaui) / Twitter
Building FilmChain's Design System with Storybook and Chromatic ... Revert complete and Chromatic back to normal service. ... Monorepo support is here!
Read more >
How to add Storybook and Chromatic to your Angular monorepo
Close. How to add Storybook and Chromatic to your Angular monorepo. catalincodes. 3. 0 comments ... Close. AWS Lambda Now Has Support for...
Read more >
How To Build a React Component Library Using NX ... - Medium
Add monorepo support to storybook (running yarn storybook-start at the root ... Now that chromatic is setup we are going to create a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found