-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[docs] POC: wire @mui/internal-docs-infra types pipeline into API pages #22091
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
Draft
JCQuintas
wants to merge
5
commits into
mui:master
Choose a base branch
from
JCQuintas:docs-apitest-infra
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e62c845
[POC] Wire @mui/internal-docs-infra types pipeline for Gauge page
JCQuintas efe32b0
Flatten root tsconfig — drop @mui/monorepo extends
JCQuintas b5b8401
Diagnose docs-infra OOM on DataGrid + file upstream memoization fix
JCQuintas 23f19c1
changes
JCQuintas 319ba2b
chnages
JCQuintas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ import * as semver from 'semver'; | |||||
| import { createRequire } from 'module'; | ||||||
| import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; | ||||||
| import { withDeploymentConfig } from '@mui/internal-docs-infra/withDocsInfra'; | ||||||
| import type { LoaderOptions as PrecomputedTypesLoaderOptions } from '@mui/internal-docs-infra/pipeline/loadPrecomputedTypes'; | ||||||
| import { findPages } from './src/modules/utils/find'; | ||||||
| import { LANGUAGES, LANGUAGES_SSR, LANGUAGES_IGNORE_PAGES, LANGUAGES_IN_PROGRESS } from './config'; | ||||||
| import { SOURCE_CODE_REPO, SOURCE_GITHUB_BRANCH } from './constants'; | ||||||
|
|
@@ -78,6 +79,7 @@ export default withDeploymentConfig({ | |||||
| // TODO, those shouldn't be needed in the first place | ||||||
| '@mui/monorepo', // Migrate everything to @mui/internal-core-docs until the @mui/monorepo dependency becomes obsolete | ||||||
| '@mui/internal-core-docs', // needed to fix slashes in the generated links (https://github.com/mui/mui-x/pull/13713#issuecomment-2205591461, ) | ||||||
| '@mui/internal-docs-infra', // TEMP: local link points at ../mui-public/packages/docs-infra source tree | ||||||
| ], | ||||||
| // Avoid conflicts with the other Next.js apps hosted under https://mui.com/ | ||||||
| assetPrefix: process.env.DEPLOY_ENV === 'development' ? undefined : '/x', | ||||||
|
|
@@ -132,6 +134,11 @@ export default withDeploymentConfig({ | |||||
| ), | ||||||
| docs: path.resolve(MONOREPO_PATH, './docs'), | ||||||
| docsx: path.resolve(currentDirectory, '../docs'), | ||||||
| // TEMP: force React dedupe so linked @mui/internal-docs-infra doesn't | ||||||
| // load its own React copy (breaks hooks with "Cannot read properties | ||||||
| // of null (reading 'useMemo')"). | ||||||
| react: path.resolve(currentDirectory, 'node_modules/react'), | ||||||
| 'react-dom': path.resolve(currentDirectory, 'node_modules/react-dom'), | ||||||
| }, | ||||||
| }, | ||||||
| module: { | ||||||
|
|
@@ -166,6 +173,20 @@ export default withDeploymentConfig({ | |||||
| include: [/(@mui[\\/]monorepo)$/, /(@mui[\\/]monorepo)[\\/](?!.*node_modules)/], | ||||||
| use: options.defaultLoaders.babel, | ||||||
| }, | ||||||
| // New types pipeline (POC) — intercept `types.*.ts` next to API pages and | ||||||
| // precompute props metadata at build time via the docs-infra loader. | ||||||
| { | ||||||
| test: /[/\\]docs[/\\]pages[/\\]x[/\\]api[/\\].+[/\\]types\..*\.ts$/, | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So that the types.ts and types.md files sort properly, I would recommend this format
Suggested change
|
||||||
| use: [ | ||||||
| options.defaultLoaders.babel, | ||||||
| { | ||||||
| loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedTypes', | ||||||
| options: { | ||||||
| socketDir: '.next/docs-infra', | ||||||
| } satisfies PrecomputedTypesLoaderOptions, | ||||||
| }, | ||||||
| ], | ||||||
| }, | ||||||
| { | ||||||
| test: /\.(ts|tsx)$/, | ||||||
| loader: 'string-replace-loader', | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './animated-area.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesAnimatedArea } from './types.animated-area'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['skipAnimation']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/animated-area', | ||
| false, | ||
| /\.\/animated-area.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="AnimatedArea" allowedProps={allowedProps}> | ||
| <TypesAnimatedArea /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './animated-line.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesAnimatedLine } from './types.animated-line'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['skipAnimation']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/animated-line', | ||
| false, | ||
| /\.\/animated-line.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="AnimatedLine" allowedProps={allowedProps}> | ||
| <TypesAnimatedLine /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './area-element.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesAreaElement } from './types.area-element'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['skipAnimation', 'slotProps', 'slots']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/area-element', | ||
| false, | ||
| /\.\/area-element.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="AreaElement" allowedProps={allowedProps}> | ||
| <TypesAreaElement /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './area-plot.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesAreaPlot } from './types.area-plot'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['onItemClick', 'skipAnimation', 'slotProps', 'slots']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/area-plot', | ||
| false, | ||
| /\.\/area-plot.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="AreaPlot" allowedProps={allowedProps}> | ||
| <TypesAreaPlot /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; | ||
| import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; | ||
| import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './axis-config.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesAxisConfig } from './types.axis-config'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return ( | ||
| <InterfaceApiPage {...layoutConfig} descriptions={descriptions} pageContent={jsonPageContent} /> | ||
| ); | ||
| } | ||
| const allowedProps = []; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/', | ||
| false, | ||
| /\.\/axis-config.*.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="AxisConfig" allowedProps={allowedProps}> | ||
| <TypesAxisConfig /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './bar-chart-premium.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesBarChartPremium } from './types.bar-chart-premium'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['axesGap', 'axisHighlight', 'borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'initialZoom', 'layout', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/bar-chart-premium', | ||
| false, | ||
| /\.\/bar-chart-premium.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="BarChartPremium" allowedProps={allowedProps}> | ||
| <TypesBarChartPremium /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './bar-chart-pro.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesBarChartPro } from './types.bar-chart-pro'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['axesGap', 'axisHighlight', 'borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'initialZoom', 'layout', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/bar-chart-pro', | ||
| false, | ||
| /\.\/bar-chart-pro.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="BarChartPro" allowedProps={allowedProps}> | ||
| <TypesBarChartPro /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './bar-chart.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesBarChart } from './types.bar-chart'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['axesGap', 'axisHighlight', 'borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'layout', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/bar-chart', | ||
| false, | ||
| /\.\/bar-chart.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="BarChart" allowedProps={allowedProps}> | ||
| <TypesBarChart /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './bar-element.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesBarElement } from './types.bar-element'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['slotProps', 'slots']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/bar-element', | ||
| false, | ||
| /\.\/bar-element.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="BarElement" allowedProps={allowedProps}> | ||
| <TypesBarElement /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './bar-label.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesBarLabel } from './types.bar-label'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['height', 'hidden', 'placement', 'width', 'x', 'xOrigin', 'y', 'yOrigin']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/bar-label', | ||
| false, | ||
| /\.\/bar-label.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="BarLabel" allowedProps={allowedProps}> | ||
| <TypesBarLabel /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
| import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
| import jsonPageContent from './bar-plot.json'; | ||
| import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; | ||
| import { TypesBarPlot } from './types.bar-plot'; | ||
|
|
||
| export default function Page(props) { | ||
| const { descriptions } = props; | ||
| return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />; | ||
| } | ||
| const allowedProps = ['borderRadius', 'className', 'onItemClick', 'renderer', 'skipAnimation', 'slotProps', 'slots']; | ||
|
|
||
| export async function getStaticProps() { | ||
| const req = require.context( | ||
| 'docsx/translations/api-docs/charts/bar-plot', | ||
| false, | ||
| /\.\/bar-plot.*\.json$/, | ||
| export default function Page() { | ||
| return ( | ||
| <TypesPageShell name="BarPlot" allowedProps={allowedProps}> | ||
| <TypesBarPlot /> | ||
| </TypesPageShell> | ||
| ); | ||
| const descriptions = mapApiPageTranslations(req); | ||
|
|
||
| return { props: { descriptions } }; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Usually I add
file:../../mui-public/packages/docs-infra/build/in the package.json instead of linking, the downside is you have to runpnpm iafter every build of docs-infra to sync the built files