Comments (11)
Hi @vanessayuenn we're also running into this issue with our codebase. I've provided a base repro case for you to check out https://github.com/weikinhuang/storybook-26220-repro
cd packages/storybook
npm install
npm run storybook
See that Example/Button
has the autogenerated docs, which was created by npx storybook init
, while Core/Button3
which lives outside the packages
directory does not have the auto docs even though it's 99% copy pasted from the Button
component.
This repo was made with npx storybook@latest init
.
from storybook.
@weikinhuang Thanks for providing a repro, I didn‘t get around to do that.
from storybook.
Adding some context to #26220 (comment) above:
We are working on a fresh installation of storybook 8 in a packages
directory. Our goal is to have this storybook instance display stories for components from the ui
directory, as well as from components inside that packages
directory.
The issue is that components from the ui
directory are able to be added properly to the storybook, but can never get their jsdoc notation converted by autodocs, and their props aren't fully interpolated into controls. This happens in any case where the component is outside of the packages directory, regardless of whether the stories file is inside packages or somewhere else
Side-by-side you can see that both button 2 (left) and button 3 (right) are nearly identical. The stories generated are very different though, with button 2 having a full complement of documented controls, and the story for button 3 having only controls for props which have args defined:
from storybook.
After some tests I am pretty sure that this line causes the issue:
The project root for vue-component-meta
is basically set to the root of the current package so everything above this folder which includes the rest of the monorepo is not analyzed.
I am not 100% sure whats the best way to fix this. Maybe we should use the paths set in the .storybook/main.ts
to check if contains ../
and adjust the project root accordingly?
from storybook.
@kasperpeulen and @chakAs3 bringing this to your attention. I guess #26220 (comment) already described very well the problem and a potential solution.
from storybook.
a repro would certainly be helpful! cc @larsrickert @chakAs3 @kasperpeulen in case they have some insights already.
from storybook.
Were seeing issues in quite a large repo where were running out of memory when enabling the vue-component-meta docgen. Storybook is in the same package though, it just cant cope I guess
from storybook.
After some tests I am pretty sure that this line causes the issue:
it is rather the reason why it is happening, in monorepo accessing files has limitation, we can only access source from the root project ( running storybook project), @valentinpalkovic you have dealt with monorepo limitation.
from storybook.
I am not 100% sure whats the best way to fix this. Maybe we should use the paths set in the
.storybook/main.ts
to check if contains../
and adjust the project root accordingly?
This the only solution i can see too for now. we can even define a root='../' or in case there is monorepo or any other workspace path where we have our components project, we need to be explicit otherwise in large repo with many packages we will run out of memory
from storybook.
Usually we use the getProjectRoot
function from @storybook/core-common
to determine the project root, like I did here: https://github.com/storybookjs/addon-webpack5-compiler-babel/blob/main/src/preset.ts#L38
At some point we might support an env variable to manually set the project root.
from storybook.
At some point we might support an env variable to manually set the project root.
yes it would be better this way or pass it via the framework options
from storybook.
Related Issues (20)
- [Bug]: SB_CORE-COMMON_0001 (MissingFrameworkFieldError): Could not find a 'framework' field in Storybook config. HOT 1
- [Bug]: next/navigation#useParams returns null when using @storybook/nextjs HOT 1
- [Bug]: Module parse failed: Unexpected token (17:1) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file HOT 1
- [Bug]: A sandbox created with a version specifier will have a caret for all versions
- [Bug]: Storybook/HTML upgrade to v8 - Vite internal server error: this.getData is not a function HOT 4
- [Bug]: Boolean prop set to 'false' for subcomponent is not showing up in show code section.
- [Bug]: "Types of property 'typescript' are incompatible" with @storybook/react-webpack5
- [Bug]: Challenges with Rails and import maps
- [Bug]: code blocks not working in mdx HOT 1
- [Bug]: `react-docgen` not correctly populating Description column if props are `Readonly`
- [Bug]: Unable to connect Tailwind CSS
- [Bug]: Interactions-Addon still uses deprecated Button props HOT 1
- [Bug]: Webcomponents with no render function shows empty source code in Canvas
- [Bug]: Parameter with function as value is not available in Manager API HOT 3
- [Tracking] React-docgen related issues
- [Bug]: Unable to display emails as stories using react-email HOT 1
- [Bug]: @storybook/addon-themes withThemeByDataAttribute decorator not working
- [Bug]: Can't resolve 'next/dist/shared/lib/app-router-context.shared-runtime'
- [Bug]: @storybook/html doesn't support Autodocs HOT 4
- [Documentation]: Missing Vue documentation for Doc Blocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook.