Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo documentation #22271

Open
kylegach opened this issue Apr 26, 2023 · 1 comment
Open

Monorepo documentation #22271

kylegach opened this issue Apr 26, 2023 · 1 comment

Comments

@kylegach
Copy link
Contributor

Currently, we've focused on documenting Storybook's features while gradually focusing on application testing and introducing some guidance on how to do it. However, more and more teams are adopting a monorepo stack for their projects, and we forget about that section of the community. We'll need to start putting more effort into creating dedicated documentation on how to set up Storybook with monorepos. We've seen that NX already provides it in their documentation, and we could continue to build on it and factor not only NX, but also other tooling (e.g., Yarn Workspaces, Pnpm Workspaces, Turborepo, etc.).

This was brought to my attention by Ian VanSchooten in this issue comment.

@cyrfer
Copy link

cyrfer commented May 3, 2023

I'm using a monorepo with NPM workspaces. I'm trying to follow https://storybook.js.org/docs/react/get-started/install/
For step 1, I assume the following instruction:

Run this inside your existing project’s root directory

...actually means "Run this inside your package's root directory". So, I run cd packages/react-component-library and ran npx storybook@latest init there.

I'm attaching the package.json and build configuration for my react component library package.
example-package.zip

I don't know how to respond to the following CLI prompt. Please advise.

CLI prompt

🔎 found a 'missing-babelrc' migration:
╭ Automigration detected ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ ││ We detected that your project does not have a babel configuration (.babelrc, babel.config.js, etc.). ││ ││ In version 6.x, Storybook provided its own babel settings out of the box. Now, Storybook re-uses your project's babel configuration, with small, incremental updates ││ from Storybook addons. ││ ││ If your project does not have a babel configuration file, we can generate one that's equivalent to the 6.x defaults for you. Keep in mind that this can affect your ││ project if it uses babel, and you may need to make additional changes based on your projects needs. ││ ││ Note: This automatic setup doesn't work in a monorepo, see the babel documentation for how to setup babel manually: ││ https://babeljs.io/docs ││ ││ We can create a .babelrc.json file with some basic configuration and add any necessary package devDependencies. ││ ││ Please see the migration guide for more information: ││ https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#babel-mode-v7-exclusively ││ ││ │╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
? Do you want to run the 'missing-babelrc' migration on your project? › (Y/n)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants