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][joy] Build API documentations #36008

Merged
merged 61 commits into from
Feb 21, 2023
Merged

[docs][joy] Build API documentations #36008

merged 61 commits into from
Feb 21, 2023

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented Jan 31, 2023

Closes #35813

Summary of this PR:

  1. Export Autocomplete, AutocompleteListbox, AutocompleteOption, ScopedCssBaseline
  2. Typography: Add default value to levelMapping
  3. Correct the default values of props in interfaces in multiple components
  4. Create docs/translations/api-docs-joy where all JSON files for api docs of Joy components are located
  5. Generate API docs for Joy (located in docs/pages/joy-ui/api)

Screenshot 2023-02-07 at 11 40 52

Preview: https://deploy-preview-36008--material-ui.netlify.app/joy-ui/api/alert/ -> Alert API

@hbjORbj hbjORbj changed the title [docs][joy] Build API documentation [docs][joy] Build API documentations Jan 31, 2023
@hbjORbj hbjORbj self-assigned this Jan 31, 2023
@hbjORbj hbjORbj added docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy labels Jan 31, 2023
@hbjORbj hbjORbj changed the title [docs][joy] Build API documentations Draft: [docs][joy] Build API documentations Jan 31, 2023
@hbjORbj hbjORbj added this to the Joy UI stable release milestone Jan 31, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 2, 2023
@hbjORbj hbjORbj changed the title Draft: [docs][joy] Build API documentations [docs][joy] Build API documentations Feb 2, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 2, 2023
docs/data/joy/pages.ts Show resolved Hide resolved
docs/pages/joy-ui/api/alert.js Show resolved Hide resolved
docs/translations/translations.json Show resolved Hide resolved
packages/api-docs-builder/buildApi.ts Outdated Show resolved Hide resolved
// Grid has problem with react-docgen
// Stack has problem with react-docgen
Copy link
Member

Choose a reason for hiding this comment

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

Is this still the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the inclusion of Grid and Stack are causing 3 throws of "No component definition found".

Copy link
Member

Choose a reason for hiding this comment

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

Alright, we can investigate this in a follow-up PR.

packages/mui-joy/src/Container/Container.tsx Outdated Show resolved Hide resolved
*/
variant?: OverridableStringUnion<VariantProp, MenuPropsVariantOverrides>;
};
props: P & {
Copy link
Member

Choose a reason for hiding this comment

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

Is this required for the script to work correctly? Should we document it or try to fix the script if this is the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this fixed the following error:
color: Error: JSDoc @default annotation not found. Add @default 'neutral' to the JSDoc of this prop.

Even if MenuProps had @default 'neutral', it wasn't being copied to PropTypes in Menu.tsx.

Should we document it or try to fix the script if this is the case?

Agree

@hbjORbj
Copy link
Member Author

hbjORbj commented Feb 7, 2023

@siriwatknp @mnajdova I will review the PR myself 1 more time and let you know. Don't review more yet please!

@hbjORbj
Copy link
Member Author

hbjORbj commented Feb 9, 2023

@siriwatknp @mnajdova I think this is ready for review now!

Summary of this PR:

  1. Export Autocomplete, AutocompleteListbox, AutocompleteOption, ScopedCssBaseline
  2. Typography: Add default value to levelMapping
  3. Correct the default values of props in interfaces in multiple components
  4. Create docs/translations/api-docs-joy where all JSON files for api docs of Joy components are located
  5. Generate API docs for Joy (located in docs/pages/joy-ui/api)

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Two small nits from code perspective. I will test out the api pages a bit next.

docs/scripts/i18n.js Show resolved Hide resolved
packages/api-docs-builder/buildApiUtils.ts Outdated Show resolved Hide resolved
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

The CSS section is missing from the Joy's API pages, for e.g. this is how it looks for the Material UI's components: https://mui.com/material-ui/api/accordion/#css

@hbjORbj
Copy link
Member Author

hbjORbj commented Feb 13, 2023

The CSS section is missing from the Joy's API pages, for e.g. this is how it looks for the Material UI's components: https://mui.com/material-ui/api/accordion/#css

Wouldn't it be more helpful for Joy package users if we release this PR and we work on CSS section in a separate PR?

@mnajdova
Copy link
Member

Wouldn't it be more helpful for Joy package users if we release this PR and we work on CSS section in a separate PR?

That works too, I mentioned it so that it's not overlooked. Apart from that I can't find anything else that's missing. Great work Benny! I will let the last review to Jun, to validate that we have everything in place.

@hbjORbj
Copy link
Member Author

hbjORbj commented Feb 13, 2023

TODOs to be done in separate PRs

  1. [docs][joy] Build API documentations #36008 (comment)
  2. CSS Section in API documentation -> UPDATE: We are doing "Slots" Section for Joy instead of "CSS" Section

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 21, 2023
@hbjORbj hbjORbj enabled auto-merge (squash) February 21, 2023 14:55
@hbjORbj hbjORbj merged commit 17f9fc6 into mui:master Feb 21, 2023
siriwatknp pushed a commit to mnajdova/material-ui that referenced this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Joy] API pages
4 participants