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

docs: fix imported types not showing up in docs #667

Merged
merged 2 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/__docs__/buildScripts/utils/getReactDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module.exports = function getReactDoc(source, fileName, error) {
reactDocgen.resolver.findAllExportedComponentDefinitions,
null,
{
filename: fileName
filename: fileName,
importer: reactDocgen.importers.makeFsImporter()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new upcoming feature of react-docgen allows us to operate on imported types as well.

}
)
if (Array.isArray(doc)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/__docs__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"html-webpack-plugin": "^4",
"jsdoc-api": "^6.0.0",
"mkdirp": "^1",
"react-docgen": "^5",
"react-docgen": "^6.0.0-alpha.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new importer feature is not fully released in production yet, but according to the maintainers of the repo v6 won't contain any breaking changes, so it seems like a safe thing for us to use the pre-release version of the lib.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The yarn.lock is missing, please add it :) I couldn't find any problems with it, the View props display correctly now, and it could recognise the "query" and "props" prop of Responsive as "object" (typeof this and that) too. Well, it cannot go deeper than one level, but that's why we need that type-linking ticket too :)

"svg-inline-loader": "^0.8.0",
"webpack-bundle-analyzer": "^4"
}
Expand Down