Args/ArgTypes in a Monorepo Environment #28556
Replies: 2 comments 1 reply
-
Is there a reason that you need to use the transpiled files?
I started thinking about this again and realized the alias snippet that I linked is actually doing what you described and pointing to the built files, I am pretty sure. So, my answer was probably wrong, but I still question why a documentation tool would be pointing to files that may have documentation details removed. Maybe it is fine, as long as the generated types files include everything, such as comments. I don't know enough about reactDocgen to answer that though, so you may need someone else to answer that. |
Beta Was this translation helpful? Give feedback.
-
We are having this same issue with our monorepo, and the only solution we've been able to come up with so far is in the story files, we import the components from their original source instead of the compiled package. |
Beta Was this translation helpful? Give feedback.
-
Summary
I am curious if anyone has any experience using Storybook in a Monorepo environment. I currently have a project using Turborepo and it is similar to the official example from turborepo
What I am noticing is that when Storybook is using the bundled and transpiled component code, it can no longer figure out the Arg Types, so we are finding ourselves having to manually set
argTypes
for every single arg. The Story files are properly getting the types and the args/argTypes fields are able to determine our props perfectly, but it does not translate to the actual controls and docs blocks.One example would be
This ends up just showing up in Storybook as a
string
type, so we are not able to see the available options, and the control maps to a basic text input.Does anyone have any experience with this type of thing that could provide some feedback on how to set up an environment like this?
Additional information
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions