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-infra] Fixes in API pages generation #37813

Merged
merged 5 commits into from
Jul 10, 2023

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Jul 4, 2023

Fixes introduced:

  • don't generate API pages if there is no components & hooks header on the page
  • renamed react-components to all-components

@mnajdova mnajdova added bug 🐛 Something doesn't work scope: docs-infra Specific to the docs-infra product labels Jul 4, 2023
@mui-bot
Copy link

mui-bot commented Jul 4, 2023

Netlify deploy preview

https://deploy-preview-37813--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 0217834

@mnajdova mnajdova changed the title [docs-infra] Don't generate API pages if there is no components & hoo… [docs-infra] Don't generate API pages if there is no components & hooks header Jul 4, 2023
@mnajdova mnajdova changed the title [docs-infra] Don't generate API pages if there is no components & hooks header [docs-infra] Fixes in API pages generation Jul 4, 2023
@@ -18,7 +18,7 @@ const pages = [
title: 'Components',
icon: standardNavIcons.ToggleOnIcon,
children: [
{ pathname: '/base-ui/react-components', title: 'All components' },
{ pathname: '/base-ui/react-all-components', title: 'All components' },
Copy link
Member Author

Choose a reason for hiding this comment

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

Following the convention for the pages inside /components/

Copy link
Member Author

Choose a reason for hiding this comment

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

I could also rename the page to react-components, but I liked more this url. Happy to iterate on this. cc @danilo-leal

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think I also dig "all-components" slightly more, but that's just a loose preference. 😬

Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that the react-* convention is mostly for SEO purposes, which probably isn't really applicable here. So I would also lean more towards all-components for the sake of simplicity. (Otherwise, the grammatically correct version would be all-react-components.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I will adjust the script to not consider this file as React component file.

@mnajdova mnajdova marked this pull request as ready for review July 4, 2023 12:39
@mnajdova mnajdova requested review from danilo-leal and a team July 4, 2023 12:39
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Thank :)

I let Danilo answer about the path rename

Copy link
Member

@samuelsycamore samuelsycamore left a comment

Choose a reason for hiding this comment

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

LGTM! 🫡

Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

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

Looks good to me as well 🤙

@mnajdova mnajdova merged commit 8b85ae6 into mui:master Jul 10, 2023
21 checks passed
@@ -689,13 +689,23 @@ export const getStaticPaths = () => {
${staticProps}
`;

Copy link
Member

Choose a reason for hiding this comment

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

I'm reverting the changes to this file in #37941. It doesn't work per the last commit of #37931. I think that the markdown should match exactly the URL (/base-ui/all-components/) to make reasoning with the path easier. In our case, moving the markdown to match is enough to fix the issue on its own.

Copy link
Member Author

Choose a reason for hiding this comment

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

This fixed another issue with generating docs api pages for the coming soon pages locally. For e.g. running yarn docs:api locally generates API pages for the checkbox, radio, according etc. It's still makes sense to not generate API pages if there are no components & hooks in the header.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, yarn docs:api now generates files but the CI doesn't check that no new files aren't committed, hence the CI didn't catch the regression I introduced in #37941. So part of my revert was correct, the other part was wrong. Oops

Copy link
Member

Choose a reason for hiding this comment

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

I'm cleaning my mess: #38039.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants