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-infra] Transpile .ts demo files #15345

Merged
merged 7 commits into from
Nov 14, 2024

Conversation

KenanYusuf
Copy link
Member

@KenanYusuf KenanYusuf commented Nov 8, 2024

Fix #15059

  • Update formattedTSDemos.js script to transpile .ts files
  • Run transpilation script to get .js equivalents of .ts files in existing demos

Related to mui/material-ui#44150

@KenanYusuf KenanYusuf added the scope: docs-infra Specific to the docs-infra product label Nov 8, 2024
@mui-bot
Copy link

mui-bot commented Nov 8, 2024

Deploy preview: https://deploy-preview-15345--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against d5e2522

@KenanYusuf KenanYusuf force-pushed the transpile-ts-demo-files branch from f0034f6 to 589a978 Compare November 8, 2024 14:59
@@ -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');
Copy link
Member Author

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) {
Copy link
Member Author

@KenanYusuf KenanYusuf Nov 13, 2024

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.

@KenanYusuf KenanYusuf marked this pull request as ready for review November 13, 2024 11:22
@KenanYusuf KenanYusuf requested a review from a team November 13, 2024 11:25
Copy link
Member

@alexfauquette alexfauquette left a 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?

@KenanYusuf KenanYusuf added needs cherry-pick The PR should be cherry-picked to master after merge v7.x labels Nov 13, 2024
@KenanYusuf
Copy link
Member Author

@alexfauquette is there something in particular that needs testing with that package? If it's related to mui/material-ui#44150, we're on 1.0.19 which includes those changes

@alexfauquette
Copy link
Member

we're on 1.0.19 which includes those changes

I missed this update. Then it's all good, I tried the docs preview and nested files work perfectly on charts demo 🚀👌

@KenanYusuf KenanYusuf merged commit e07d874 into mui:master Nov 14, 2024
18 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v7.x

@KenanYusuf KenanYusuf deleted the transpile-ts-demo-files branch November 14, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs cherry-pick The PR should be cherry-picked to master after merge scope: docs-infra Specific to the docs-infra product v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Chart example with responsive container and tooltip demo is broken
3 participants