-
-
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
Add Docgen info to PropTable #1505
Conversation
@jribeiro Thanks for contributing this! Is there any chance you can add this to the To get the example running on your machine:
Many thanks again and please let me know if you have any questions! |
Codecov Report
@@ Coverage Diff @@
## master #1505 +/- ##
==========================================
- Coverage 14.61% 14.47% -0.14%
==========================================
Files 202 202
Lines 4653 4670 +17
Branches 505 520 +15
==========================================
- Hits 680 676 -4
- Misses 3533 3542 +9
- Partials 440 452 +12
Continue to review full report at Codecov.
|
Hi @shilman, thanks for that. I've added an example to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing back the commit that got lost during the merge.
See if you can get rid of these dependencies and give it a test. Let me know if you need any help!
addons/info/README.md
Outdated
// @flow | ||
import React from 'react'; | ||
|
||
type PropsType = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean flowtype is supported by our babel-plugin-react-docgen
?
examples/cra-kitchen-sink/.babelrc
Outdated
"polyfill": false, | ||
"regenerator": true | ||
}], | ||
"react-docgen" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea to add this .babelrc
since these settings should have been the default included by Storybook.
If there's anything that should be inserted, we should include it here:
https://github.com/storybooks/storybook/blob/master/app/react/src/server/babel_config.js#L73
Looks like the babel plugin is already getting inserted.
"@storybook/addon-links": "^3.0.0", | ||
"@storybook/addon-notes": "^3.0.0", | ||
"@storybook/addon-options": "^3.0.0", | ||
"@storybook/addon-storyshots": "^3.0.0", | ||
"@storybook/addons": "^3.0.0", | ||
"@storybook/react": "^3.0.0", | ||
"babel-plugin-react-docgen": "^1.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is included by the package.json
in the react app already and it should be used by the babel there already.
https://github.com/storybooks/storybook/blob/master/app/react/package.json#L34
If it's not, let's fix it.
Hi @danielduan, is this not needed anymore? |
@jribeiro Sorry about that, I tried to fix the merge conflicts and when I pushed to your branch, this got closed automatically. New PR is above ^ |
Issue:
Storybook Info Addon currently does not support React docgen for documenting components. This was actually implemented on the old repo but got lost on the migration:
storybook-eol/react-storybook-addon-info@092e10a
What I did
Added support for react docgen on the PropTable component and documentation
How to test
Follow the instructions on the readme on a repo supporting flowtype. normal
npm link
approaches should be helpful