diff --git a/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBasic.tsx.preview b/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBasic.tsx.preview new file mode 100644 index 00000000000..5081efd6fd5 --- /dev/null +++ b/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBasic.tsx.preview @@ -0,0 +1,14 @@ + + + + Dashboard content goes here. + + + \ No newline at end of file diff --git a/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBranding.tsx.preview b/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBranding.tsx.preview new file mode 100644 index 00000000000..dcb48e9a1d9 --- /dev/null +++ b/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBranding.tsx.preview @@ -0,0 +1,14 @@ + + + + Dashboard content goes here. + + + \ No newline at end of file diff --git a/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutNavigation.tsx.preview b/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutNavigation.tsx.preview new file mode 100644 index 00000000000..5081efd6fd5 --- /dev/null +++ b/docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutNavigation.tsx.preview @@ -0,0 +1,14 @@ + + + + Dashboard content goes here. + + + \ No newline at end of file diff --git a/docs/data/toolpad/core/pages.js b/docs/data/toolpad/core/pages.js new file mode 100644 index 00000000000..baa4dac2cb6 --- /dev/null +++ b/docs/data/toolpad/core/pages.js @@ -0,0 +1,150 @@ +const pages = [ + { + pathname: '/toolpad/core/intro-group', + title: 'Introduction', + children: [ + { + pathname: '/toolpad/core/introduction', + title: 'Overview', + }, + { + pathname: '/toolpad/core/introduction/installation', + title: 'Installation', + }, + { + pathname: '/toolpad/core/introduction/tutorial', + title: 'Tutorial', + }, + { + pathname: '/toolpad/core/introduction/examples', + title: 'Examples', + }, + { + pathname: '/toolpad/core/introduction/build-deploy', + title: 'Build and Deploy', + }, + { + pathname: '/toolpad/core/introduction/roadmap', + title: 'Roadmap', + }, + { + pathname: '/toolpad/core/introduction/support', + title: 'Support', + }, + { + pathname: '/toolpad/core/features-group', + subheader: 'Features', + children: [ + { + pathname: '/toolpad/core/features/authentication', + title: 'Authentication', + }, + { + pathname: '/toolpad/core/features/data-providers', + title: 'Data Providers', + }, + { + pathname: '/toolpad/core/features/audit-logs', + title: 'Audit Logs', + plan: 'pro', + }, + ], + }, + ], + }, + { + pathname: '/toolpad/core/components-group', + title: 'Components', + children: [ + { pathname: '/toolpad/core/components', title: 'All components' }, + { + pathname: '/toolpad/core/components/layout-group', + subheader: 'Layout', + children: [ + { + pathname: '/toolpad/core/components/dashboard-layout', + title: 'Dashboard Layout', + }, + ], + }, + { + pathname: '/toolpad/core/components/data-group', + subheader: 'Data', + children: [ + { + pathname: '/toolpad/core/components/data-grid', + title: 'Data Grid', + }, + { + pathname: '/toolpad/core/components/line-chart', + title: 'Line Chart', + }, + ], + }, + { + pathname: '/toolpad/core/components/filter-group', + subheader: 'Filters', + children: [ + { + pathname: '/toolpad/core/components/select-filter', + title: 'Select', + }, + ], + }, + ], + }, + { + pathname: '/toolpad/core/api-group', + title: 'API', + children: [ + { + pathname: '/toolpad/core/api', + title: 'Index', + }, + { + pathname: '/toolpad/core/api/components-group', + subheader: 'Components', + children: [ + { + pathname: '/toolpad/core/api/dashboard-layout', + title: 'DashboardLayout', + }, + { + pathname: '/toolpad/core/api/data-grid', + title: 'Data Grid', + }, + { + pathname: '/toolpad/core/api/line-chart', + title: 'Line Chart', + }, + ], + }, + { + pathname: '/toolpad/core/api/filters-group', + subheader: 'Filters', + children: [ + { + pathname: '/toolpad/core/api/select-filter', + title: 'Select', + }, + ], + }, + { + pathname: '/toolpad/core/api/hooks-group', + subheader: 'Hooks', + children: [ + { + pathname: '/toolpad/core/api/use-filter-state', + title: 'useFilterState', + }, + ], + }, + ], + }, + { + pathname: '/toolpad/core/customization', + title: 'Customization', + }, +]; + +export default pages; diff --git a/docs/data/toolpad/studio/pages.js b/docs/data/toolpad/studio/pages.js new file mode 100644 index 00000000000..825a2289dd5 --- /dev/null +++ b/docs/data/toolpad/studio/pages.js @@ -0,0 +1,254 @@ +import componentsManifest from './reference/components/manifest.json'; + +const pages = [ + { + pathname: '/toolpad/studio/getting-started-group', + title: 'Getting Started', + children: [ + { pathname: '/toolpad/studio/getting-started', title: 'Overview' }, + { pathname: '/toolpad/studio/getting-started/installation' }, + { + pathname: '/toolpad/studio/getting-started/why-toolpad', + title: 'Why Toolpad Studio?', + }, + { + pathname: '/toolpad/studio/getting-started/first-app', + title: 'Build your first app', + }, + { + pathname: '/toolpad/studio/examples-group', + title: 'Examples', + children: [ + { pathname: '/toolpad/studio/examples', title: 'Overview' }, + { pathname: '/toolpad/studio/examples/npm-stats', title: 'npm stats' }, + { + pathname: '/toolpad/studio/examples/basic-crud-app', + title: 'Basic CRUD application', + }, + { + pathname: '/toolpad/studio/examples/qr-generator', + title: 'QR Code generator', + }, + ], + }, + { pathname: '/toolpad/studio/getting-started/roadmap' }, + { + pathname: '/toolpad/studio/getting-started/support', + title: 'Support', + }, + ], + }, + { + pathname: '/toolpad/studio/concepts', + children: [ + { + pathname: '/toolpad/studio/concepts/building-ui', + title: 'Building UI', + }, + { + pathname: '/toolpad/studio/concepts/connecting-to-data', + title: 'Connecting to data', + children: [ + { + pathname: '/toolpad/studio/concepts/queries', + title: 'Overview', + }, + { + pathname: '/toolpad/studio/concepts/http-requests', + title: 'HTTP requests', + }, + { + pathname: '/toolpad/studio/concepts/custom-functions', + title: 'Custom functions', + }, + { + pathname: '/toolpad/studio/concepts/data-providers', + title: 'Data providers', + }, + ], + }, + { + pathname: '/toolpad/studio/concepts/data-binding', + title: 'Data binding', + }, + { + pathname: '/toolpad/studio/concepts/event-handling', + }, + { + pathname: '/toolpad/studio/concepts/file-structure', + title: 'File structure', + }, + { + pathname: '/toolpad/studio/concepts/deployment', + }, + { + pathname: '/toolpad/studio/concepts/custom-components', + }, + { + pathname: '/toolpad/studio/concepts/theming', + }, + { + pathname: '/toolpad/studio/concepts/page-properties', + }, + { + pathname: '/toolpad/studio/concepts/authorization', + title: 'Authorization', + children: [ + { + pathname: '/toolpad/studio/concepts/authentication', + title: 'Authentication', + }, + { + pathname: '/toolpad/studio/concepts/rbac', + title: 'Role-based access control', + }, + ], + }, + { pathname: '/toolpad/studio/concepts/custom-server' }, + ], + }, + { + pathname: '/toolpad/studio/components', + children: [ + { pathname: '/toolpad/studio/components/button' }, + { + pathname: '/toolpad/studio/components/data-grid', + title: 'Data Grid', + }, + { pathname: '/toolpad/studio/components/list' }, + { pathname: '/toolpad/studio/components/date-picker', title: 'Date Picker' }, + { pathname: '/toolpad/studio/components/text-field', title: 'Text Field' }, + ], + }, + { + pathname: '/toolpad/studio/how-to-guides', + title: 'How-to guides', + children: [ + { + pathname: '/toolpad/studio/how-to-guides/connect-to-datasource', + subheader: 'Connect to datasource', + children: [ + { + pathname: '/toolpad/studio/how-to-guides/connect-to-databases', + title: 'MySQL', + }, + { + pathname: '/toolpad/studio/how-to-guides/connect-to-googlesheets', + title: 'Google Sheets', + }, + ], + }, + { + pathname: '/toolpad/studio/how-to-guides/deployment', + subheader: 'Deployment', + children: [ + { + pathname: '/toolpad/studio/how-to-guides/render-deploy', + title: 'Deploy to Render', + }, + { + pathname: '/toolpad/studio/how-to-guides/railway-deploy', + title: 'Deploy to Railway', + }, + { + pathname: '/toolpad/studio/how-to-guides/gcp-deploy', + title: 'Deploy to Google Cloud', + }, + ], + }, + { + pathname: '/toolpad/studio/how-to-guides/custom-components', + subheader: 'Create custom components', + children: [ + { + pathname: '/toolpad/studio/how-to-guides/map-display', + title: 'Map component', + }, + { + pathname: '/toolpad/studio/how-to-guides/cube-component', + title: '3D cube component', + }, + ], + }, + { + pathname: '/toolpad/studio/how-to-guides/misc', + subheader: 'Miscellaneous', + children: [ + { + pathname: '/toolpad/studio/how-to-guides/customize-datagrid', + title: 'Customize data grids', + }, + { + pathname: '/toolpad/studio/how-to-guides/delete-datagrid-row', + title: 'Delete a data grid row', + }, + { + pathname: '/toolpad/studio/how-to-guides/embed-pages', + title: 'Embedding Toolpad Studio pages', + }, + { + pathname: '/toolpad/studio/how-to-guides/basic-auth', + title: 'Enable basic auth', + }, + { + pathname: '/toolpad/studio/how-to-guides/editor-path', + title: 'Troubleshoot missing editor', + }, + ], + }, + ], + }, + { + pathname: '/toolpad/studio/reference-group', + title: 'Reference', + children: [ + { + pathname: '/toolpad/studio/reference/file-schema', + title: 'File schema', + }, + { + pathname: '/toolpad/studio/reference/components-group', + title: 'Components', + children: componentsManifest.pages, + }, + { + pathname: '/toolpad/studio/reference/api-group', + title: 'API', + children: [ + { + pathname: '/toolpad/studio/reference/api', + title: 'Index', + }, + { + pathname: '/toolpad/studio/reference/api/functions-group', + subheader: 'Functions', + children: [ + { + title: 'createComponent', + pathname: '/toolpad/studio/reference/api/create-component', + }, + { + title: 'createDataProvider', + pathname: '/toolpad/studio/reference/api/create-data-provider', + }, + { + title: 'createFunction', + pathname: '/toolpad/studio/reference/api/create-function', + }, + { + title: 'createHandler', + pathname: '/toolpad/studio/reference/api/create-handler', + }, + { + title: 'getContext', + pathname: '/toolpad/studio/reference/api/get-context', + }, + ], + }, + ], + }, + ], + }, +]; + +export default pages; diff --git a/docs/scripts/formattedTSDemos.js b/docs/scripts/formattedTSDemos.js new file mode 100644 index 00000000000..77502f52b9a --- /dev/null +++ b/docs/scripts/formattedTSDemos.js @@ -0,0 +1,239 @@ +/* eslint-disable no-console */ +/** + * Transpiles TypeScript demos to formatted JavaScript. + * Can be used to verify that JS and TS demos are equivalent. No introduced change + * would indicate equivalence. + */ + +/** + * List of demos or folders to ignore when transpiling. + * Only ignore files that aren't used in the UI. + */ +const ignoreList = []; + +const path = require('path'); +const fse = require('fs-extra'); +const babel = require('@babel/core'); +const prettier = require('prettier'); +const { + getPropTypesFromFile, + injectPropTypesInFile, +} = require('@mui/internal-scripts/typescript-to-proptypes'); +const { + createTypeScriptProjectBuilder, +} = require('@mui-internal/api-docs-builder/utils/createTypeScriptProject'); +const yargs = require('yargs'); +const { fixBabelGeneratorIssues, fixLineEndings } = require('@mui/internal-docs-utils'); +const { default: CORE_TYPESCRIPT_PROJECTS } = require('../../scripts/coreTypeScriptProjects'); + +const babelConfig = { + presets: ['@babel/preset-typescript'], + plugins: [], + generatorOpts: { retainLines: true }, + babelrc: false, + configFile: false, + shouldPrintComment: (comment) => !comment.startsWith(' @babel-ignore-comment-in-output'), +}; + +const workspaceRoot = path.join(__dirname, '../../'); + +async function getFiles(root) { + const files = []; + + try { + await Promise.all( + (await fse.readdir(root)).map(async (name) => { + const filePath = path.join(root, name); + const stat = await fse.stat(filePath); + + if ( + stat.isDirectory() && + !ignoreList.some((ignorePath) => + filePath.startsWith(path.normalize(`${workspaceRoot}/${ignorePath}`)), + ) + ) { + files.push(...(await getFiles(filePath))); + } else if ( + stat.isFile() && + /\.tsx?$/.test(filePath) && + !filePath.endsWith('.d.ts') && + !ignoreList.some((ignorePath) => filePath.endsWith(path.normalize(ignorePath))) + ) { + files.push(filePath); + } + }), + ); + } catch (error) { + if (error.message?.includes('no such file or directory')) { + return []; + } + throw error; + } + + return files; +} + +const TranspileResult = { + Success: 0, + Failed: 1, +}; + +async function transpileFile(tsxPath, project) { + const jsPath = tsxPath.replace(/\.tsx?$/, '.js'); + try { + const source = await fse.readFile(tsxPath, 'utf8'); + + const transformOptions = { ...babelConfig, filename: tsxPath }; + const enableJSXPreview = !tsxPath.includes(path.join('pages')); + if (enableJSXPreview) { + transformOptions.plugins = transformOptions.plugins.concat([ + [ + require.resolve('docs/src/modules/utils/babel-plugin-jsx-preview'), + { maxLines: 16, outputFilename: `${tsxPath}.preview` }, + ], + ]); + } + const { code } = await babel.transformAsync(source, transformOptions); + + if (/import \w* from 'prop-types'/.test(code)) { + throw new Error('TypeScript demo contains prop-types, please remove them'); + } + + console.log(tsxPath); + + const propTypesAST = getPropTypesFromFile({ + project, + filePath: tsxPath, + shouldResolveObject: ({ name }) => { + if (name === 'classes' || name === 'ownerState' || name === 'popper') { + return false; + } + + return undefined; + }, + }); + const codeWithPropTypes = injectPropTypesInFile({ components: propTypesAST, target: code }); + const prettierConfig = await prettier.resolveConfig(jsPath, { + config: path.join(workspaceRoot, 'prettier.config.js'), + }); + const prettierFormat = async (jsSource) => + prettier.format(jsSource, { ...prettierConfig, filepath: jsPath }); + + const codeWithoutTsIgnoreComments = codeWithPropTypes.replace(/^\s*\/\/ @ts-ignore.*$/gm, ''); + const prettified = await prettierFormat(codeWithoutTsIgnoreComments); + const formatted = fixBabelGeneratorIssues(prettified); + const correctedLineEndings = fixLineEndings(source, formatted); + + // removed blank lines change potential formatting + await fse.writeFile(jsPath, await prettierFormat(correctedLineEndings)); + return TranspileResult.Success; + } catch (err) { + console.error('Something went wrong transpiling %s\n%s\n', tsxPath, err); + return TranspileResult.Failed; + } +} + +async function main(argv) { + const { watch: watchMode, disableCache, pattern } = argv; + + // TODO: Remove at some point. + // Though not too soon so that it isn't disruptive. + // It's a no-op anyway. + if (disableCache !== undefined) { + console.warn( + '--disable-cache does not have any effect since it is the default. In the future passing this flag will throw.', + ); + } + + const filePattern = new RegExp(pattern); + if (pattern.length > 0) { + console.log(`Only considering demos matching ${filePattern}`); + } + + const tsxFiles = [ + ...(await getFiles(path.join(workspaceRoot, 'docs/data'))), // new structure + ].filter((fileName) => filePattern.test(fileName)); + + const buildProject = createTypeScriptProjectBuilder(CORE_TYPESCRIPT_PROJECTS); + const project = buildProject('docs', { files: tsxFiles }); + + let successful = 0; + let failed = 0; + ( + await Promise.all( + tsxFiles.map((file) => { + return transpileFile(file, project); + }), + ) + ).forEach((result) => { + switch (result) { + case TranspileResult.Success: { + successful += 1; + break; + } + case TranspileResult.Failed: { + failed += 1; + break; + } + default: { + throw new Error(`No handler for ${result}`); + } + } + }); + + console.log( + [ + '------ Summary ------', + '%i demo(s) were successfully transpiled', + '%i demo(s) were unsuccessful', + ].join('\n'), + successful, + failed, + ); + + if (!watchMode) { + if (failed > 0) { + process.exit(1); + } + return; + } + + tsxFiles.forEach((filePath) => { + fse.watchFile(filePath, { interval: 500 }, async () => { + if ((await transpileFile(filePath, project, true)) === 0) { + console.log('Success - %s', filePath); + } + }); + }); + + console.log('\nWatching for file changes...'); +} + +yargs + .command({ + command: '$0', + description: 'transpile TypeScript demos', + builder: (command) => { + return command + .option('watch', { + default: false, + description: 'transpiles demos as soon as they changed', + type: 'boolean', + }) + .option('disable-cache', { + description: 'No longer supported. The cache is disabled by default.', + type: 'boolean', + }) + .option('pattern', { + default: '', + description: + 'Transpiles only the TypeScript demos whose filename matches the given pattern.', + type: 'string', + }); + }, + handler: main, + }) + .help() + .strict(true) + .version(false) + .parse(); diff --git a/package.json b/package.json index a5bdc75a36a..a79f35b4b8d 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "docs:dev": "pnpm --filter docs dev", "docs:build": "pnpm --filter docs build", "docs:build:api": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/docs/buildApi.ts", + "docs:typescript:formatted": "tsx ./docs/scripts/formattedTSDemos", "eslint": "eslint . --report-unused-disable-directives --ext .js,.ts,.tsx", "jsonlint": "node ./scripts/jsonlint.mjs", "release:build": "lerna run --ignore docs --stream build", @@ -47,12 +48,15 @@ "@babel/preset-env": "7.24.4", "@babel/preset-react": "7.24.1", "@babel/preset-typescript": "7.24.1", + "@mui/internal-docs-utils": "1.0.6", + "@mui/internal-scripts": "1.0.6", "@mui/monorepo": "github:mui/material-ui#6477d93ce61ab0e6b500b90e484129217eb6f5ec", "@mui/x-charts": "7.4.0", "@next/eslint-plugin-next": "14.2.3", "@playwright/test": "1.43.1", "@testing-library/react": "14.3.1", "@types/archiver": "6.0.2", + "@types/fs-extra": "11.0.4", "@types/gtag.js": "0.0.19", "@types/invariant": "2.2.37", "@types/node": "20.12.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0983917fda1..121ca1cf726 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,6 +84,12 @@ importers: '@babel/preset-typescript': specifier: 7.24.1 version: 7.24.1(@babel/core@7.24.4) + '@mui/internal-docs-utils': + specifier: 1.0.6 + version: 1.0.6 + '@mui/internal-scripts': + specifier: 1.0.6 + version: 1.0.6 '@mui/monorepo': specifier: github:mui/material-ui#6477d93ce61ab0e6b500b90e484129217eb6f5ec version: github.com/mui/material-ui/6477d93ce61ab0e6b500b90e484129217eb6f5ec(@opentelemetry/api@1.8.0) @@ -102,6 +108,9 @@ importers: '@types/archiver': specifier: 6.0.2 version: 6.0.2 + '@types/fs-extra': + specifier: 11.0.4 + version: 11.0.4 '@types/gtag.js': specifier: 0.0.19 version: 0.0.19 @@ -3784,6 +3793,13 @@ packages: react: 18.2.0 dev: false + /@mui/internal-docs-utils@1.0.6: + resolution: {integrity: sha512-/XZsdEPulG2bkTTZAkQ7/jECzwdRLUs3HB9TgFmQixBCMblYpNHMTRVGJe9UrDHEAlJmBXFf0stiqboOJBM8sw==} + dependencies: + rimraf: 5.0.7 + typescript: 5.4.5 + dev: true + /@mui/internal-markdown@1.0.1: resolution: {integrity: sha512-goTCzEbx0yxDbCU9ngHo02f5TBHwngF6RDM2ALqtgUsvNp14/lVU3OFytvpxcwjeSrrbVPEw4MSidYO8FnlUKQ==} dependencies: @@ -3802,6 +3818,23 @@ packages: prismjs: 1.29.0 dev: false + /@mui/internal-scripts@1.0.6: + resolution: {integrity: sha512-Walp2Uw1Ho/LTX2mFWZjpcXesUAMsDfndCCoDbOfYaUMVlwFw9N8GzgYgdTNfxy0/kMYR5ExkAoW3ON9VPpvsw==} + dependencies: + '@babel/core': 7.24.5 + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.5) + '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.5) + '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.5) + '@babel/types': 7.24.5 + '@mui/internal-docs-utils': 1.0.6 + doctrine: 3.0.0 + lodash: 4.17.21 + typescript: 5.4.5 + uuid: 9.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /@mui/joy@5.0.0-beta.36(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.3.1)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-fFW8jqA/6JcnjjSUgiFJ17bbvMxwFU+daT5Ohpi1qYrDub0XYj1+8UYDUgGCLsv8XNe50AkbnqidtAlMpq7Glg==} engines: {node: '>=12.0.0'} @@ -5946,6 +5979,13 @@ packages: '@types/node': 20.12.11 dev: true + /@types/fs-extra@11.0.4: + resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} + dependencies: + '@types/jsonfile': 6.1.4 + '@types/node': 20.12.11 + dev: true + /@types/glob@8.1.0: resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} dependencies: @@ -6012,6 +6052,12 @@ packages: /@types/json5@0.0.29: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + /@types/jsonfile@6.1.4: + resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} + dependencies: + '@types/node': 20.12.11 + dev: true + /@types/jsonwebtoken@8.5.9: resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==} dependencies: diff --git a/scripts/coreTypescriptProjects.js b/scripts/coreTypescriptProjects.js new file mode 100644 index 00000000000..e67f4ce91a7 --- /dev/null +++ b/scripts/coreTypescriptProjects.js @@ -0,0 +1,12 @@ +import path from 'path'; + +export default { + 'toolpad-core': { + rootPath: path.join(process.cwd(), 'packages/toolpad-core'), + entryPointPath: 'src/index.ts', + }, + docs: { + rootPath: path.join(process.cwd(), 'docs'), + tsConfigPath: 'tsconfig.json', + }, +}; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 37e36133007..586714961dd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,13 @@ "jsx": "react", "noImplicitAny": true, "types": ["node"], - "paths": {} + "baseUrl": "./", + "paths": { + "@mui-internal/api-docs-builder": ["./node_modules/@mui/monorepo/packages/api-docs-builder"], + "@mui-internal/api-docs-builder/*": [ + "./node_modules/@mui/monorepo/packages/api-docs-builder/*" + ] + } }, "include": ["./test", "packages/toolpad-utils/src/http.ts"] }