-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storybook zero-config typescript support #10790
Comments
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.12 containing PR #10813 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
@shilman Secondly, I'm still a bit confused as to how this change works? after exporting the typescript object from Lastly, It would be great if you could allow passing the |
@EdenTurgeman the purpose of this issue is to:
To configure addon-docs you need to add the following to your module.exports = {
addons: ['@storybook/addon-docs']
} You can configure module.exports = {
typescript: {
reactDocgenTypescriptOptions: {
propFilter: (prop) => ['label', 'disabled'].includes(prop.name),
}
}
}; |
@shilman I see now!
|
@EdenTurgeman did you npm install / yarn add it? The setup instructions for sb docs haven’t changed. The major difference Is that now you shouldn’t have to worry about any typescript-related configuration now, and reconfiguring is simpler if needed |
@shilman Actually I did, not a new dep in my repo could it be a problem with yarn? (working in a monorepo so maybe package hoisting) |
@shilman The latest release of To get around it, I wanted to disable module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app"
],
typescript: {
docgen: 'none'
}
} However, storybook is still loading |
I was able to temporarily get around the issue by changing the typescript options to the following: ...
typescript: {
docgen: 'none',
reactDocgenTypescriptOptions: {
include: ['src/**/*.tsx']
}
}
... (As described here). However, the |
That's because the option should be Found via styleguidist/react-docgen-typescript#356. Just posting it here in case anyone else comes by wondering about the same as i did. |
@babel/preset-typescript
ts-fork-checker-webpack-plugin
should be opt-ints-fork-checker-webpack-plugin
optionsreact-docgen-typescript-loader
needs to be added - with optional flag to usebabel-plugin-react-docgen
instead.react-docgen-typescript-loader
(React)ts-loader
(Vue)react-docgen-typescript-loader
to CRA preset.For flags, we will use a typescript object in
main.js
:👉 Original spec
The text was updated successfully, but these errors were encountered: