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

[core] Update buildApi script to support new structure #30245

Merged
merged 41 commits into from
Dec 21, 2021

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Dec 17, 2021

Update buildApi.ts script to support component API generation for both current & new structure (NO functionalities are added or deleted, just refactor the code and move most of the logic to ComponentApiBuilder.ts because we will need other type of ApiBuilder soon eg, react-hook).

As mentioned in #30091, there are 3 phases.
The script usage remains the same (yarn docs:api), this PR is using the config that produce the same result as in master branch.

I have added the comment about the settings here

Once the 1st phase is done, I will run the scripts to clone pages and then switch the config to this one


@mui-pr-bot
Copy link

mui-pr-bot commented Dec 17, 2021

No bundle size changes

Generated by 🚫 dangerJS against 00b276e

"docs:api": "rimraf ./docs/pages/api-docs && yarn docs:api:build",
"docs:api:build": "cross-env BABEL_ENV=development __NEXT_EXPORT_TRAILING_SLASH=true babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/buildApi.ts ./docs/pages/api-docs ./packages/mui-base/src ./packages/mui-material/src ./packages/mui-lab/src --apiPagesManifestPath ./docs/src/pagesApi.js",
"docs:api": "rimraf ./docs/pages/**/api-docs && yarn docs:api:build",
"docs:api:build": "cross-env BABEL_ENV=development __NEXT_EXPORT_TRAILING_SLASH=true babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/buildApi.ts",
Copy link
Member Author

Choose a reason for hiding this comment

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

The specified directories are moved inside the script. (I think it is easier to add comment inside the script file)

@@ -12,8 +12,8 @@
"release:publish": "lerna publish from-package --dist-tag latest --contents build",
"release:publish:dry-run": "lerna publish from-package --dist-tag latest --contents build --registry=\"http://localhost:4873/\"",
"release:tag": "node scripts/releaseTag",
"docs:api": "rimraf ./docs/pages/api-docs && yarn docs:api:build",
"docs:api:build": "cross-env BABEL_ENV=development __NEXT_EXPORT_TRAILING_SLASH=true babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/buildApi.ts ./docs/pages/api-docs ./packages/mui-base/src ./packages/mui-material/src ./packages/mui-lab/src --apiPagesManifestPath ./docs/src/pagesApi.js",
"docs:api": "rimraf ./docs/pages/**/api-docs && yarn docs:api:build",
Copy link
Member Author

Choose a reason for hiding this comment

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

add /**/ to support nested directories in the future.

eg. ./docs/pages/material/api-docs, ./docs/pages/base/api-docs, ...etc

Comment on lines +345 to +347
`${reactComponentName}: Unable to handle node of type "ts.TypeFlags.${
ts.TypeFlags[type.flags]
}", using any`,
Copy link
Member Author

Choose a reason for hiding this comment

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

Improve debuggability to see which file cause this warning.

@siriwatknp siriwatknp marked this pull request as draft December 17, 2021 07:47
@siriwatknp siriwatknp mentioned this pull request Dec 17, 2021
32 tasks
@siriwatknp siriwatknp marked this pull request as ready for review December 17, 2021 10:00
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.

I couldn't spot anything suspicious, and the CI is green so believe it's safe to move forward with it.

@siriwatknp siriwatknp merged commit c1a2a0c into mui:master Dec 21, 2021
@zannager zannager added the core Infrastructure work going on behind the scenes label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants