-
-
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
[core] Update buildApi
script to support new structure
#30245
Conversation
…docs/restructure
This reverts commit fe374cb.
…docs/update-scripts
"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", |
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.
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", |
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.
add /**/
to support nested directories in the future.
eg. ./docs/pages/material/api-docs
, ./docs/pages/base/api-docs
, ...etc
`${reactComponentName}: Unable to handle node of type "ts.TypeFlags.${ | ||
ts.TypeFlags[type.flags] | ||
}", using any`, |
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.
Improve debuggability to see which file cause this warning.
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 couldn't spot anything suspicious, and the CI is green so believe it's safe to move forward with it.
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 toComponentApiBuilder.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.Once the 1st phase is done, I will run the scripts to clone pages and then switch the config to this one