-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Menu: auto-generate README #68249
base: trunk
Are you sure you want to change the base?
Menu: auto-generate README #68249
Conversation
93215f7
to
323f875
Compare
|
||
const meta: Meta< typeof Menu > = { | ||
id: 'components-experimental-menu', | ||
id: 'components-menu', |
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 change was necessary because the generated README links to ?path=/docs/components-menu--docs
. I've updated storybook/manager-head.html
to add a redirect from the old experimental URL.
* It can optionally contain one instance of the `Menu.ItemLabel` component | ||
* and one instance of the `Menu.ItemHelpText` component. | ||
*/ | ||
Item: Object.assign( Item, { |
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.
With the previous subcomponent named export scheme (ie. MenuItem
being assigned to the Item
property of the Menu
object), the README generator could not pick up the JSDoc correctly,
I managed to fix it by changing the internal naming convention of all subcomponent by removing the Menu
prefix: for example, MenuItem
got renamed to Item
. A lot of the code changes in this file are related to this refactor and were applied as a single commit. You can review the rest of the changes commit by commit to remove the noise.
states and behaviors: | ||
- The `portal` and `preventBodyScroll` props are set to `true`. They can | ||
still be manually set to `false`. | ||
- When the dialog is open, element tree outside it will be inert. |
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.
@mirka here's another instance of the problem you were mentioning with list being merged when rendered to HTML ( #68209 (comment) )
@@ -1,344 +1,589 @@ | |||
# `Menu` | |||
# Menu |
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.
@mirka there's no way currently to mark the component as private in the README, right?
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.
Right. I'll figure something out as a follow up.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
323f875
to
364338a
Compare
Flaky tests detected in 364338a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12470206963
|
What?
Convert the Menu README to an auto-generated one.
Supplementary information that was in the existing README is moved to other appropriate locations (JSDocs, new "Best Practices" Storybook page).
Why?
To decrease maintenance cost and consolidate the canonical docs for our audience.
Testing Instructions
Menu.Item
for example, and see that the JSDoc includes the subcomponent description.npm run docs:components
to regenerate READMEs.