-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[docs] Require documentation of demos #25811
Conversation
JSDOC had a syntax error
Not automatically checked but can now be traced manually.
type-checked
This reverts commit b23b33d. Let's do this another time to be safe i.e. make sure bisect, blame etc are useful after squash+merge.
@@ -63,7 +63,7 @@ | |||
"forwardsRefTo": "HTMLSpanElement", | |||
"filename": "/packages/material-ui-unstyled/src/BadgeUnstyled/BadgeUnstyled.js", | |||
"inheritance": null, | |||
"demos": "<ul><li><a href=\"/components/badges/\">Badges</a></li></ul>", | |||
"demos": "<ul><li><a href=\"/components/avatars/\">Avatars</a></li>\n<li><a href=\"/components/badges/\">Badges</a></li></ul>", |
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.
TODO: Is the addition of Avatar here intended?
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.
@mnajdova I guess the idea was to only list the demo of the styled component? My question would be why we special case the unstyled component in the first place i.e. just list BadgeUnstyled
in /components/badges
?
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.
BadgeUnstyled is only referenced on the badge demo page. I fail to see the link with the avatar, outside of this demo: https://next.material-ui.com/components/avatars/#with-badge. It looks like a regression.
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.
But at the same time it is already listed in the JSDOC for the Badge:
https://github.com/mui-org/material-ui/blob/b8bb45119ce0a2f97b70e361a4ac7179f6f8ad1a/packages/material-ui-unstyled/src/BadgeUnstyled/BadgeUnstyled.d.ts#L127-L128
Opening a separate PR to explicitly list these demos instead of trying to be too clever about it.
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.
Resolved by #25900
@@ -1372,7 +1378,7 @@ async function run(argv: { | |||
workspaceRoot, | |||
}); | |||
} catch (error) { | |||
error.message = `${component.filename}: ${error.message}`; | |||
error.message = `${path.relative(process.cwd(), component.filename)}: ${error.message}`; |
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 the full path is relevant. Error message is now smaller.
The displayed path is still interpreted by VSCode as a path and therefore handled as a link.
Failing CI is expected since this change requires #25812
API documentation is one part of the documentation story. But documentation is only complete with demos and API.
yarn docs:api
will now throw if a component has no demo listed:This change touches older code so I used the opportunity to reduce technical debt (e.g. CJS -> ES -> TypeScript).