-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[docs-infra] Transpile .ts demo files #15345
Conversation
Deploy preview: https://deploy-preview-15345--material-ui-x.netlify.app/ |
f0034f6
to
589a978
Compare
@@ -79,7 +81,7 @@ const TranspileResult = { | |||
}; | |||
|
|||
async function transpileFile(tsxPath, program, ignoreCache = false) { | |||
const jsPath = tsxPath.replace('.tsx', '.js'); | |||
const jsPath = tsxPath.replace(/\.tsx?$/, '.js'); |
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.
To include .ts
files
@@ -42,7 +42,7 @@ const babelConfig = { | |||
|
|||
const workspaceRoot = path.join(__dirname, '../../'); | |||
|
|||
async function getFiles(root) { | |||
async function getFiles(root, excludeRoot = false) { |
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 don't think we want to transpile files at the root of docs/data
, e.g. https://github.com/mui/mui-x/blob/master/docs/data/chartsApiPages.ts, so I have added an extra option to this function to exclude the root files.
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.
Thanks for handling that 👍
Did you checked if it works when updating the @mui-internals/markdown
?
@alexfauquette is there something in particular that needs testing with that package? If it's related to mui/material-ui#44150, we're on |
I missed this update. Then it's all good, I tried the docs preview and nested files work perfectly on charts demo 🚀👌 |
Cherry-pick PRs will be created targeting branches: v7.x |
Fix #15059
formattedTSDemos.js
script to transpile.ts
files.js
equivalents of.ts
files in existing demosRelated to mui/material-ui#44150