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

[code-infra] Make Babel config path configurable in API docs builder #41999

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

michaldudak
Copy link
Member

The Babel configuration path in the API docs builder was hardcoded, causing problems when the package was used in other repositories.
Added the relevant configuration field (defaulting to the previous value).

@michaldudak michaldudak added the scope: code-infra Specific to the core-infra product label Apr 22, 2024
@michaldudak michaldudak requested a review from a team April 22, 2024 13:37
@mui-bot
Copy link

mui-bot commented Apr 22, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against ca1c9ed

@Janpot
Copy link
Member

Janpot commented Apr 22, 2024

I think it should be possible to leverage @babel/core API loadPartialConfig to detect the config file location that applies to a file automatically. It's not super well documented, but it seems like the following returns a config location

// config property should contain the path to the project babel.config.js file that applies to `pathToCodeFile`
const { config } = babelCore.loadPartialConfig({ fileName: pathToCodeFile })

@michaldudak
Copy link
Member Author

Thanks! I didn't realize Babel would look for the config automatically.
Looks like it works well in both Core and Base UI repos.

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

Nice, thanks for checking. Approving under the assumption the babelConfigPath setting will be removed.

@michaldudak michaldudak merged commit ab7b2f1 into mui:next Apr 23, 2024
19 checks passed
@michaldudak michaldudak deleted the configurable-babel-path branch April 23, 2024 19:57
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants