From 026941061f558fa02f6662940b536c914f89a5f7 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Tue, 7 Feb 2023 11:55:07 +0100 Subject: [PATCH 01/12] upgrade monorepo --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index bf1a86bd9d50..00277bcd4445 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2526,8 +2526,8 @@ react-transition-group "^4.4.5" "@mui/monorepo@https://github.com/mui/material-ui.git#master": - version "5.10.16" - resolved "https://github.com/mui/material-ui.git#2abad795e4890829deb0fb40204a100b547a3873" + version "5.11.8" + resolved "https://github.com/mui/material-ui.git#d4d8512ce3453711f3c661374579b0d2ed13f3e7" "@mui/private-theming@^5.10.3": version "5.10.3" From 1dca47a01ff1fc43d85ba0c089eba9a96498a084 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Tue, 7 Feb 2023 12:03:45 +0100 Subject: [PATCH 02/12] [core] Sync back with the mono repo (#7351) --- docs/data/pages.ts | 32 +++++--------------- docs/pages/_app.js | 10 ++++-- docs/public/static/sponsors/doit-dark.svg | 6 ++++ docs/public/static/sponsors/doit-square.svg | 5 +-- docs/public/static/sponsors/megafamous.png | Bin 0 -> 5467 bytes docs/src/modules/components/ApiPage.js | 2 +- 6 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 docs/public/static/sponsors/doit-dark.svg create mode 100644 docs/public/static/sponsors/megafamous.png diff --git a/docs/data/pages.ts b/docs/data/pages.ts index 001064aed63f..b0a70094c761 100644 --- a/docs/data/pages.ts +++ b/docs/data/pages.ts @@ -2,8 +2,8 @@ import type { MuiPage } from '@mui/monorepo/docs/src/MuiPage'; const pages: MuiPage[] = [ { - pathname: '/x/introduction', - scopePathnames: ['/x/introduction'], + pathname: '/x/introduction-group', + title: 'Introduction', icon: 'DescriptionIcon', children: [ { pathname: `/x/introduction`, title: 'Overview' }, @@ -14,9 +14,8 @@ const pages: MuiPage[] = [ ], }, { - pathname: '/x/react-data-grid', - scopePathnames: ['/x/api/data-grid'], - title: 'Data grid', + pathname: '/x/react-data-grid-group', + title: 'Data Grid', icon: 'TableViewIcon', children: [ { pathname: '/x/react-data-grid', title: 'Overview' }, @@ -26,7 +25,6 @@ const pages: MuiPage[] = [ { pathname: '/x/react-data-grid/layout' }, { pathname: '/x/react-data-grid/columns', - scopePathnames: ['/x/react-data-grid/column-'], children: [ { pathname: '/x/react-data-grid/column-definition' }, { pathname: '/x/react-data-grid/column-dimensions' }, @@ -40,7 +38,6 @@ const pages: MuiPage[] = [ }, { pathname: '/x/react-data-grid/rows', - scopePathnames: ['/x/react-data-grid/row-', '/x/react-data-grid/master-detail'], children: [ { pathname: '/x/react-data-grid/row-definition' }, { pathname: '/x/react-data-grid/row-updates' }, @@ -64,14 +61,8 @@ const pages: MuiPage[] = [ { pathname: '/x/react-data-grid/virtualization' }, { pathname: '/x/react-data-grid/accessibility' }, { - pathname: '/x/react-data-grid/row-grouping', + pathname: '/x/react-data-grid-group-pivot', title: 'Group & Pivot', - scopePathnames: [ - '/x/react-data-grid/row-grouping', - '/x/react-data-grid/tree-data', - '/x/react-data-grid/aggregation', - '/x/react-data-grid/pivoting', - ], children: [ { pathname: '/x/react-data-grid/row-grouping', plan: 'premium' }, { pathname: '/x/react-data-grid/tree-data', plan: 'pro' }, @@ -81,12 +72,7 @@ const pages: MuiPage[] = [ }, { title: 'Advanced', - pathname: '/x/react-data-grid/api-object', - scopePathnames: [ - '/x/react-data-grid/api-object', - '/x/react-data-grid/events', - '/x/react-data-grid/state', - ], + pathname: '/x/react-data-grid/advanced', children: [ { pathname: '/x/react-data-grid/api-object', title: 'API object' }, { pathname: '/x/react-data-grid/events' }, @@ -96,14 +82,13 @@ const pages: MuiPage[] = [ { title: 'Recipes', pathname: '/x/react-data-grid/recipes', - scopePathnames: ['/x/react-data-grid/recipes-'], children: [ { pathname: '/x/react-data-grid/recipes-editing', title: 'Editing' }, { pathname: '/x/react-data-grid/recipes-row-grouping', title: 'Row grouping' }, ], }, { - pathname: '/x/api/data-grid', + pathname: '/x/api/data-grid-group', title: 'API Reference', children: [ { pathname: '/x/api/data-grid', title: 'Index' }, @@ -144,8 +129,7 @@ const pages: MuiPage[] = [ }, { pathname: '/x/react-date-pickers', - scopePathnames: ['/x/api/date-pickers'], - title: 'Date and Time pickers', + title: 'Date and Time Pickers', icon: 'DatePickerIcon', children: [ { pathname: '/x/react-date-pickers/getting-started' }, diff --git a/docs/pages/_app.js b/docs/pages/_app.js index 8dd79bee67c2..4d14a6ca043a 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -201,8 +201,6 @@ function AppWrapper(props) { } }, []); - const activePage = findActivePage(pages, router.pathname); - let fonts = []; if (router.pathname.match(/onepirate/)) { fonts = [ @@ -210,6 +208,12 @@ function AppWrapper(props) { ]; } + const pageContextValue = React.useMemo(() => { + const { activePage, activePageParents } = findActivePage(pages, router.pathname); + + return { activePage, activePageParents, pages }; + }, [router.pathname]); + return ( @@ -220,7 +224,7 @@ function AppWrapper(props) { - + {children} diff --git a/docs/public/static/sponsors/doit-dark.svg b/docs/public/static/sponsors/doit-dark.svg new file mode 100644 index 000000000000..e5e6e352206a --- /dev/null +++ b/docs/public/static/sponsors/doit-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/public/static/sponsors/doit-square.svg b/docs/public/static/sponsors/doit-square.svg index a2f011ffeff2..00c038d19936 100644 --- a/docs/public/static/sponsors/doit-square.svg +++ b/docs/public/static/sponsors/doit-square.svg @@ -1,3 +1,4 @@ - - + + + diff --git a/docs/public/static/sponsors/megafamous.png b/docs/public/static/sponsors/megafamous.png new file mode 100644 index 0000000000000000000000000000000000000000..e923fb3dec745c7803d345fc3af46af039908c88 GIT binary patch literal 5467 zcmZ`-Ra6uV)81Vg7FeXDyBh&PVwaMT6eN^zX^_sPSz=jYX=$WeKtMoR=?*~}0ZD0; z&fo96*Z(|c>S`|LoOxy@N=HkDn2?qb000oHs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Q5cMW|HkK3;NC*pSgpq0VkTLq^2HIQ<5VJ9E;AKWr$OF=Sc|`Mw>=I$1?rP}^Pw*YTfDZNhT}iP&nC zpl=w@=j#&EY;V}A@J#I9+q+t3_LCSDlHurF-mkOre0a|bKEFz~hTB%Bk|Z%^jy?LW zqW)HkG533}=A&BazKK`s#}Txp%!6$o2P)mLh-v1(z<<2zWQcT@tELz&Ur&oBn0m?< zIYu2V1TO(7oi2*&Uf1J%PpkaB_T_cYLA?62v+o~)Q`?T3`B1U+2^9BJc61sDmni7Q z89L29OM)}NEg`athOGAzFVN1=N#OaTm)2d&U|k!b4dLGaK67TKUu z^4Uf$_R!wEtTe%!9OZ9TZRb%uazwWmCAmYDWlpS675!S88E;w7d{<2)QTGs%P(~bP z?&iC3jf)!_&FSD7`-fJ+4^?{&=X>jYRWaQ+!4G7SyQDjhrF|Ky@nVQIV$?)f-)9au z+!x87u3`%*Q9bNk7-cJmI&?npY(->bk@aY4<_!TWd_C*NxA|D_?@A4Z-0uIDQdRn~ z_=|f}7peeN*^PM!j*5o}E*lIBk&f%Ip_3Xi22eCZf8Q}rtw{OlO#AzwzY?v^X>P%wP`8jA+SGj%+F zg6Z+kebqBa8|2{rP!P^4e2HbOh_kV%FD`$H9usP>xeZUUtT0Quo5LCiIg zQ5PXHS|*B@0a>y0$A%WfGEs!e)l_80uGqPo{JhAub(AXEoh=tU6dHNcdt#& zD8=K3D6RW~Y{)EL+0w?4D}lmXjvFRrWb#)qh;+BLk~&R-7VsAitne+<89 znPNn3%ER&!6tjBoJf=&(Mn`}ls^W%4@>SX1uF<}@ATK7RJntkd%2@fla~hMO$(k!@ z2+TT^p1QT=VaEKq5igcpLhEc{M$7 literal 0 HcmV?d00001 diff --git a/docs/src/modules/components/ApiPage.js b/docs/src/modules/components/ApiPage.js index 6ced9f22f1a8..1711219a5157 100644 --- a/docs/src/modules/components/ApiPage.js +++ b/docs/src/modules/components/ApiPage.js @@ -198,7 +198,7 @@ function Heading(props) { return ( {getTranslatedHeader(t, hash)} - + From 14cb8a6806c3dcaac99540a947248a8adb2280bc Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Tue, 7 Feb 2023 12:03:39 +0100 Subject: [PATCH 03/12] update imports paths --- babel.config.js | 1 + docs/babel.config.js | 2 +- docs/config.js | 1 + docs/data/pages.ts | 2 +- docs/next.config.js | 4 +-- .../api/buildComponentsDocumentation.ts | 29 ++++++++++++------- .../api/buildGridEventsDocumentation.ts | 2 +- .../api/buildInterfacesDocumentation.ts | 2 +- docs/scripts/generateProptypes.ts | 2 +- docs/scripts/tsconfig.json | 2 +- docs/src/modules/constants.js | 1 - webpackBaseConfig.js | 5 +--- 12 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 docs/config.js delete mode 100644 docs/src/modules/constants.js diff --git a/babel.config.js b/babel.config.js index 681816176532..5779ff856acb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -14,6 +14,7 @@ const defaultAlias = { '@mui/x-license-pro': resolveAliasPath('./packages/x-license-pro/src'), '@mui/x-date-pickers': resolveAliasPath('./packages/x-date-pickers/src'), '@mui/x-date-pickers-pro': resolveAliasPath('./packages/x-date-pickers-pro/src'), + '@mui/markdown': '@mui/monorepo/packages/markdown', 'typescript-to-proptypes': '@mui/monorepo/packages/typescript-to-proptypes/src', docs: resolveAliasPath('./node_modules/@mui/monorepo/docs'), test: resolveAliasPath('./test'), diff --git a/docs/babel.config.js b/docs/babel.config.js index 18c2649844cb..ca9ee1d06ff3 100644 --- a/docs/babel.config.js +++ b/docs/babel.config.js @@ -9,7 +9,7 @@ const alias = { '@mui/x-date-pickers-pro': '../packages/x-date-pickers-pro/src', '@mui/x-license-pro': '../packages/x-license-pro/src', '@mui/docs': '../node_modules/@mui/monorepo/packages/mui-docs/src', - '@mui/markdown': '../node_modules/@mui/monorepo/docs/packages/markdown', + '@mui/markdown': '../node_modules/@mui/monorepo/packages/markdown', '@mui/monorepo': '../node_modules/@mui/monorepo', '@mui/joy': '../node_modules/@mui/monorepo/packages/mui-joy/src', docs: '../node_modules/@mui/monorepo/docs', // TODO remove diff --git a/docs/config.js b/docs/config.js new file mode 100644 index 000000000000..49a7ebd2de7f --- /dev/null +++ b/docs/config.js @@ -0,0 +1 @@ +module.exports = require('@mui/monorepo/docs/config'); diff --git a/docs/data/pages.ts b/docs/data/pages.ts index b0a70094c761..acd1694164aa 100644 --- a/docs/data/pages.ts +++ b/docs/data/pages.ts @@ -154,7 +154,7 @@ const pages: MuiPage[] = [ plan: 'pro', }, { - pathname: '/x/api/date-pickers', + pathname: '/x/api/date-pickers-group', title: 'API Reference', children: [ { pathname: '/x/api/date-pickers', title: 'Index' }, diff --git a/docs/next.config.js b/docs/next.config.js index 4568265c865f..a5eb5dd8943d 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -6,7 +6,7 @@ const pkg = require('../package.json'); const dataGridPkg = require('../packages/grid/x-data-grid/package.json'); const datePickersPkg = require('../packages/x-date-pickers/package.json'); const { findPages } = require('./src/modules/utils/find'); -const { LANGUAGES, LANGUAGES_SSR } = require('./src/modules/constants'); +const { LANGUAGES, LANGUAGES_SSR } = require('./config'); const workspaceRoot = path.join(__dirname, '../'); @@ -62,7 +62,7 @@ module.exports = withDocsInfra({ oneOf: [ { resourceQuery: /@mui\/markdown/, - use: require.resolve('@mui/monorepo/docs/packages/markdown/loader'), + use: require.resolve('@mui/monorepo/packages/markdown/loader'), }, ], }, diff --git a/docs/scripts/api/buildComponentsDocumentation.ts b/docs/scripts/api/buildComponentsDocumentation.ts index 858d2e75636b..7c662d307da2 100644 --- a/docs/scripts/api/buildComponentsDocumentation.ts +++ b/docs/scripts/api/buildComponentsDocumentation.ts @@ -1,28 +1,35 @@ import * as ttp from '@mui/monorepo/packages/typescript-to-proptypes/src/index'; import * as fse from 'fs-extra'; import path from 'path'; -import parseStyles, { Styles } from '@mui/monorepo/docs/src/modules/utils/parseStyles'; +import parseStyles, { Styles } from '@mui/monorepo/packages/api-docs-builder/utils/parseStyles'; import fromPairs from 'lodash/fromPairs'; import createDescribeableProp, { DescribeablePropDescriptor, -} from '@mui/monorepo/docs/src/modules/utils/createDescribeableProp'; -import generatePropDescription from '@mui/monorepo/docs/src/modules/utils/generatePropDescription'; +} from '@mui/monorepo/packages/api-docs-builder/utils/createDescribeableProp'; +import generatePropDescription from '@mui/monorepo/packages/api-docs-builder/utils/generatePropDescription'; import { parse as parseDoctrine } from 'doctrine'; import generatePropTypeDescription, { getChained, -} from '@mui/monorepo/docs/src/modules/utils/generatePropTypeDescription'; -import parseTest from '@mui/monorepo/docs/src/modules/utils/parseTest'; +} from '@mui/monorepo/packages/api-docs-builder/utils/generatePropTypeDescription'; +import parseTest from '@mui/monorepo/packages/api-docs-builder/utils/parseTest'; import kebabCase from 'lodash/kebabCase'; -import { LANGUAGES } from 'docs/src/modules/constants'; -import { findPagesMarkdownNew } from 'docs/src/modules/utils/find'; +import { LANGUAGES } from 'docs/config'; +import findPagesMarkdownNew from '@mui/monorepo/packages/api-docs-builder/utils/findPagesMarkdown'; import { defaultHandlers, parse as docgenParse, ReactDocgenApi } from 'react-docgen'; import { renderInline as renderMarkdownInline, getHeaders, -} from '@mui/monorepo/docs/packages/markdown'; -import { getLineFeed } from '@mui/monorepo/docs/scripts/helpers'; -import generateUtilityClass from '@mui/base/generateUtilityClass'; -import { DocumentedInterfaces, getJsdocDefaultValue, linkify, writePrettifiedFile } from './utils'; + getTitle, +} from '@mui/monorepo/packages/markdown'; +import { getLineFeed } from '@mui/monorepo/packages/docs-utilities'; +import { unstable_generateUtilityClass as generateUtilityClass } from '@mui/utils'; +import { + DocumentedInterfaces, + getJsdocDefaultValue, + linkify, + getSymbolJSDocTags, + writePrettifiedFile, +} from './utils'; import { Project, Projects } from '../getTypeScriptProjects'; interface ReactApi extends ReactDocgenApi { diff --git a/docs/scripts/api/buildGridEventsDocumentation.ts b/docs/scripts/api/buildGridEventsDocumentation.ts index 8b2b2d3ccfb4..d9fe8a13a134 100644 --- a/docs/scripts/api/buildGridEventsDocumentation.ts +++ b/docs/scripts/api/buildGridEventsDocumentation.ts @@ -1,6 +1,6 @@ import * as ts from 'typescript'; import path from 'path'; -import { renderInline as renderMarkdownInline } from '@mui/monorepo/docs/packages/markdown'; +import { renderInline as renderMarkdownInline } from '@mui/monorepo/packages/markdown'; import { DocumentedInterfaces, getSymbolDescription, diff --git a/docs/scripts/api/buildInterfacesDocumentation.ts b/docs/scripts/api/buildInterfacesDocumentation.ts index 5da977a8f427..b08431dc0049 100644 --- a/docs/scripts/api/buildInterfacesDocumentation.ts +++ b/docs/scripts/api/buildInterfacesDocumentation.ts @@ -2,7 +2,7 @@ import * as ts from 'typescript'; import * as prettier from 'prettier'; import kebabCase from 'lodash/kebabCase'; import path from 'path'; -import { renderInline as renderMarkdownInline } from '@mui/monorepo/docs/packages/markdown'; +import { renderInline as renderMarkdownInline } from '@mui/monorepo/packages/markdown'; import { escapeCell, getSymbolDescription, diff --git a/docs/scripts/generateProptypes.ts b/docs/scripts/generateProptypes.ts index 9a6ad47e3734..8aac9843a8fa 100644 --- a/docs/scripts/generateProptypes.ts +++ b/docs/scripts/generateProptypes.ts @@ -3,7 +3,7 @@ import * as path from 'path'; import * as fse from 'fs-extra'; import * as prettier from 'prettier'; import * as ttp from '@mui/monorepo/packages/typescript-to-proptypes/src'; -import { fixBabelGeneratorIssues, fixLineEndings } from 'docs/scripts/helpers'; +import { fixBabelGeneratorIssues, fixLineEndings } from '@mui/monorepo/packages/docs-utilities'; import { getTypeScriptProjects } from './getTypeScriptProjects'; const prettierConfig = prettier.resolveConfig.sync(process.cwd(), { diff --git a/docs/scripts/tsconfig.json b/docs/scripts/tsconfig.json index f6ec683df344..6c77015928a3 100644 --- a/docs/scripts/tsconfig.json +++ b/docs/scripts/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.json", "include": [ - "../../node_modules/@mui/monorepo/docs/types/react-docgen.d.ts", + "../../node_modules/@mui/monorepo/packages/api-docs-builder/react-docgen.d.ts", "api/buildApi.ts", "i18n.js" ], diff --git a/docs/src/modules/constants.js b/docs/src/modules/constants.js deleted file mode 100644 index a0dfc4ee82cd..000000000000 --- a/docs/src/modules/constants.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../node_modules/@mui/monorepo/docs/src/modules/constants'); diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index ed97191fac06..131a86817003 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -20,10 +20,7 @@ module.exports = { '@mui/x-date-pickers': path.resolve(__dirname, './packages/x-date-pickers/src'), '@mui/x-date-pickers-pro': path.resolve(__dirname, './packages/x-date-pickers-pro/src'), '@mui/x-license-pro': path.resolve(__dirname, './packages/x-license-pro/src'), - '@mui/markdown': path.resolve( - __dirname, - './node_modules/@mui/monorepo/docs/packages/markdown', - ), + '@mui/markdown': path.resolve(__dirname, './node_modules/@mui/monorepo/packages/markdown'), docs: path.resolve(__dirname, './node_modules/@mui/monorepo/docs'), docsx: path.resolve(__dirname, './docs'), }, From ea2f549944bc96a6181db733e33d021b34370140 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Tue, 7 Feb 2023 12:08:43 +0100 Subject: [PATCH 04/12] update parseStyles signature --- docs/scripts/api/buildComponentsDocumentation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scripts/api/buildComponentsDocumentation.ts b/docs/scripts/api/buildComponentsDocumentation.ts index 7c662d307da2..6fe4c126ccea 100644 --- a/docs/scripts/api/buildComponentsDocumentation.ts +++ b/docs/scripts/api/buildComponentsDocumentation.ts @@ -242,7 +242,7 @@ const buildComponentDocumentation = async (options: { } reactApi.demos = demos; - reactApi.styles = await parseStyles(reactApi, project.program as any); + reactApi.styles = parseStyles({ project, componentName: reactApi.name }); reactApi.styles.name = reactApi.name.startsWith('Grid') ? 'MuiDataGrid' // TODO: Read from @slot annotation : `Mui${reactApi.name.replace(/(Pro|Premium)$/, '')}`; From 2622e8c403e27e792447b22f10b3d364317e91da Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Tue, 7 Feb 2023 13:50:05 +0100 Subject: [PATCH 05/12] remove unnecessary pagesMarkdown --- .../api/buildComponentsDocumentation.ts | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/docs/scripts/api/buildComponentsDocumentation.ts b/docs/scripts/api/buildComponentsDocumentation.ts index 6fe4c126ccea..48a7a2a1e4c3 100644 --- a/docs/scripts/api/buildComponentsDocumentation.ts +++ b/docs/scripts/api/buildComponentsDocumentation.ts @@ -14,22 +14,11 @@ import generatePropTypeDescription, { import parseTest from '@mui/monorepo/packages/api-docs-builder/utils/parseTest'; import kebabCase from 'lodash/kebabCase'; import { LANGUAGES } from 'docs/config'; -import findPagesMarkdownNew from '@mui/monorepo/packages/api-docs-builder/utils/findPagesMarkdown'; import { defaultHandlers, parse as docgenParse, ReactDocgenApi } from 'react-docgen'; -import { - renderInline as renderMarkdownInline, - getHeaders, - getTitle, -} from '@mui/monorepo/packages/markdown'; +import { renderInline as renderMarkdownInline } from '@mui/monorepo/packages/markdown'; import { getLineFeed } from '@mui/monorepo/packages/docs-utilities'; import { unstable_generateUtilityClass as generateUtilityClass } from '@mui/utils'; -import { - DocumentedInterfaces, - getJsdocDefaultValue, - linkify, - getSymbolJSDocTags, - writePrettifiedFile, -} from './utils'; +import { DocumentedInterfaces, getJsdocDefaultValue, linkify, writePrettifiedFile } from './utils'; import { Project, Projects } from '../getTypeScriptProjects'; interface ReactApi extends ReactDocgenApi { @@ -190,11 +179,6 @@ const buildComponentDocumentation = async (options: { projects: Projects; documentationRoot: string; documentedInterfaces: DocumentedInterfaces; - pagesMarkdown: ReadonlyArray<{ - components: readonly string[]; - filename: string; - pathname: string; - }>; }) => { const { filename, project, documentationRoot, documentedInterfaces, projects } = options; @@ -517,16 +501,6 @@ export default async function buildComponentsDocumentation( ) { const { documentationRoot, documentedInterfaces, projects } = options; - const pagesMarkdown = findPagesMarkdownNew() - .map((markdown) => { - const markdownSource = fse.readFileSync(markdown.filename, 'utf8'); - return { - ...markdown, - components: getHeaders(markdownSource).components, - }; - }) - .filter((markdown) => markdown.components.length > 0); - const promises = Array.from(projects.values()).flatMap((project) => { if (!project.getComponentsWithApiDoc) { return []; @@ -540,7 +514,6 @@ export default async function buildComponentsDocumentation( project, projects, documentationRoot, - pagesMarkdown, documentedInterfaces, }); } catch (error: any) { From c6e62a8cdf7027d5626e03128b3b20ce42ee6c45 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Tue, 7 Feb 2023 16:54:43 +0100 Subject: [PATCH 06/12] fix docs:build not working --- docs/next.config.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/next.config.js b/docs/next.config.js index a5eb5dd8943d..010da362d799 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -6,7 +6,12 @@ const pkg = require('../package.json'); const dataGridPkg = require('../packages/grid/x-data-grid/package.json'); const datePickersPkg = require('../packages/x-date-pickers/package.json'); const { findPages } = require('./src/modules/utils/find'); -const { LANGUAGES, LANGUAGES_SSR } = require('./config'); +const { + LANGUAGES, + LANGUAGES_SSR, + LANGUAGES_IN_PROGRESS, + LANGUAGES_IGNORE_PAGES, +} = require('./config'); const workspaceRoot = path.join(__dirname, '../'); @@ -62,7 +67,15 @@ module.exports = withDocsInfra({ oneOf: [ { resourceQuery: /@mui\/markdown/, - use: require.resolve('@mui/monorepo/packages/markdown/loader'), + use: [ + { + loader: require.resolve('@mui/monorepo/packages/markdown/loader'), + options: { + ignoreLanguagePages: LANGUAGES_IGNORE_PAGES, + languagesInProgress: LANGUAGES_IN_PROGRESS, + }, + }, + ], }, ], }, From 966bb6b4dac5dab46adc54bd4d125e5bfe970d55 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 8 Feb 2023 17:00:53 +0000 Subject: [PATCH 07/12] Remove `joy` example already removed in `next` --- .../date-field/CustomUIDateField.js | 56 ++++++----------- .../date-field/CustomUIDateField.tsx | 62 ++++++------------- .../date-field/CustomUIDateField.tsx.preview | 16 +++++ 3 files changed, 52 insertions(+), 82 deletions(-) create mode 100644 docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.js b/docs/data/date-pickers/date-field/CustomUIDateField.js index bfb9abc5fdd4..55e810ec1178 100644 --- a/docs/data/date-pickers/date-field/CustomUIDateField.js +++ b/docs/data/date-pickers/date-field/CustomUIDateField.js @@ -1,33 +1,20 @@ import * as React from 'react'; import dayjs from 'dayjs'; -import { CssVarsProvider } from '@mui/joy/styles'; import Stack from '@mui/material/Stack'; import FormControlLabel from '@mui/material/FormControlLabel'; -import FormLabel from '@mui/joy/FormLabel'; -import JoyTextField from '@mui/joy/TextField'; +import FormLabel from '@mui/material/FormLabel'; import InputUnstyled from '@mui/base/InputUnstyled'; import { LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { unstable_useDateField as useDateField } from '@mui/x-date-pickers/DateField'; -const JoyDateField = (props) => { - const { inputRef, inputProps } = useDateField(props); - - return ( - - ); -}; - const UnstyledDateField = (props) => { const { inputRef, inputProps } = useDateField(props); return ( ); }; @@ -47,28 +34,21 @@ export default function CustomUIDateField() { const handleChange = (newValue) => setValue(newValue); return ( - - - - - Using unstyled input} - control={} - labelPlacement="top" - sx={{ alignItems: 'stretch' }} - /> - Using browser input} - control={} - labelPlacement="top" - sx={{ alignItems: 'stretch' }} - /> - - - + + + Using unstyled input} + control={} + labelPlacement="top" + sx={{ alignItems: 'stretch' }} + /> + Using browser input} + control={} + labelPlacement="top" + sx={{ alignItems: 'stretch' }} + /> + + ); } diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.tsx b/docs/data/date-pickers/date-field/CustomUIDateField.tsx index b42581d788de..2e71cdd9a672 100644 --- a/docs/data/date-pickers/date-field/CustomUIDateField.tsx +++ b/docs/data/date-pickers/date-field/CustomUIDateField.tsx @@ -1,12 +1,8 @@ import * as React from 'react'; import dayjs, { Dayjs } from 'dayjs'; -import { CssVarsProvider } from '@mui/joy/styles'; import Stack from '@mui/material/Stack'; import FormControlLabel from '@mui/material/FormControlLabel'; -import FormLabel from '@mui/joy/FormLabel'; -import JoyTextField, { - TextFieldProps as JoyTextFieldProps, -} from '@mui/joy/TextField'; +import FormLabel from '@mui/material/FormLabel'; import InputUnstyled, { InputUnstyledProps } from '@mui/base/InputUnstyled'; import { LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; @@ -15,21 +11,6 @@ import { UseDateFieldComponentProps, } from '@mui/x-date-pickers/DateField'; -type JoyDateFieldProps = UseDateFieldComponentProps; - -const JoyDateField = (props: JoyDateFieldProps) => { - const { inputRef, inputProps } = useDateField( - props, - ); - - return ( - - ); -}; - type UnstyledDateFieldProps = UseDateFieldComponentProps< Dayjs, Dayjs, @@ -46,7 +27,7 @@ const UnstyledDateField = (props: UnstyledDateFieldProps) => { return ( ); }; @@ -72,28 +53,21 @@ export default function CustomUIDateField() { const handleChange = (newValue: Dayjs | null) => setValue(newValue); return ( - - - - - Using unstyled input} - control={} - labelPlacement="top" - sx={{ alignItems: 'stretch' }} - /> - Using browser input} - control={} - labelPlacement="top" - sx={{ alignItems: 'stretch' }} - /> - - - + + + Using unstyled input} + control={} + labelPlacement="top" + sx={{ alignItems: 'stretch' }} + /> + Using browser input} + control={} + labelPlacement="top" + sx={{ alignItems: 'stretch' }} + /> + + ); } diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview b/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview new file mode 100644 index 000000000000..4ee0ccb6bf3f --- /dev/null +++ b/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview @@ -0,0 +1,16 @@ + + + Using unstyled input} + control={} + labelPlacement="top" + sx={{ alignItems: 'stretch' }} + /> + Using browser input} + control={} + labelPlacement="top" + sx={{ alignItems: 'stretch' }} + /> + + \ No newline at end of file From ac85f0715b243dbc15aaf65a153ecf311e4c8b94 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Wed, 8 Feb 2023 18:20:44 +0100 Subject: [PATCH 08/12] fix typo --- docs/data/data-grid/demo/PopularFeaturesDemo.js | 2 +- docs/data/data-grid/demo/PopularFeaturesDemo.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/data/data-grid/demo/PopularFeaturesDemo.js b/docs/data/data-grid/demo/PopularFeaturesDemo.js index 52f9b8f990ea..bd0abf9da515 100644 --- a/docs/data/data-grid/demo/PopularFeaturesDemo.js +++ b/docs/data/data-grid/demo/PopularFeaturesDemo.js @@ -129,7 +129,7 @@ export const featuresSet = [ }, { id: 12, - name: 'Aggretation and Summary rows', + name: 'Aggregation and Summary rows', description: 'Set summary footer rows or inline summaries with row grouping', plan: 'Premium', detailPage: '/aggregation/', diff --git a/docs/data/data-grid/demo/PopularFeaturesDemo.tsx b/docs/data/data-grid/demo/PopularFeaturesDemo.tsx index 1406a02bfb5e..e2cd9a4545e2 100644 --- a/docs/data/data-grid/demo/PopularFeaturesDemo.tsx +++ b/docs/data/data-grid/demo/PopularFeaturesDemo.tsx @@ -144,7 +144,7 @@ export const featuresSet: Row[] = [ }, { id: 12, - name: 'Aggretation and Summary rows', + name: 'Aggregation and Summary rows', description: 'Set summary footer rows or inline summaries with row grouping', plan: 'Premium', detailPage: '/aggregation/', From c9a3fd17cff20d575bb6ba05c51ae9b3c5235235 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Wed, 8 Feb 2023 18:25:48 +0100 Subject: [PATCH 09/12] upgrade monorepo --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 00277bcd4445..6e25e640351d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2527,7 +2527,7 @@ "@mui/monorepo@https://github.com/mui/material-ui.git#master": version "5.11.8" - resolved "https://github.com/mui/material-ui.git#d4d8512ce3453711f3c661374579b0d2ed13f3e7" + resolved "https://github.com/mui/material-ui.git#c0c3d556a4d039f615188ecc5be6123f6de9156b" "@mui/private-theming@^5.10.3": version "5.10.3" From f2301a07336b1a5ce6b44e09e2608dee79b2aa7b Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Wed, 8 Feb 2023 20:07:41 +0100 Subject: [PATCH 10/12] fix ts error --- docs/data/date-pickers/date-field/CustomUIDateField.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.tsx b/docs/data/date-pickers/date-field/CustomUIDateField.tsx index 2e71cdd9a672..5c349e6787ee 100644 --- a/docs/data/date-pickers/date-field/CustomUIDateField.tsx +++ b/docs/data/date-pickers/date-field/CustomUIDateField.tsx @@ -27,7 +27,7 @@ const UnstyledDateField = (props: UnstyledDateFieldProps) => { return ( ); }; From 80f830a96bf7efaea46c9491a8a19883b51b90ce Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Wed, 8 Feb 2023 20:07:49 +0100 Subject: [PATCH 11/12] align the inputs --- docs/data/date-pickers/date-field/CustomUIDateField.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.tsx b/docs/data/date-pickers/date-field/CustomUIDateField.tsx index 5c349e6787ee..bdcc3535b38f 100644 --- a/docs/data/date-pickers/date-field/CustomUIDateField.tsx +++ b/docs/data/date-pickers/date-field/CustomUIDateField.tsx @@ -59,13 +59,13 @@ export default function CustomUIDateField() { label={Using unstyled input} control={} labelPlacement="top" - sx={{ alignItems: 'stretch' }} + sx={{ margin: 0 }} /> Using browser input} control={} labelPlacement="top" - sx={{ alignItems: 'stretch' }} + sx={{ margin: 0 }} /> From 4b776e784327a5c1e801eb1575a0f472d1e0604f Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Wed, 8 Feb 2023 20:43:24 +0100 Subject: [PATCH 12/12] docs:typescript:formatted --- docs/data/date-pickers/date-field/CustomUIDateField.js | 6 +++--- .../date-pickers/date-field/CustomUIDateField.tsx.preview | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.js b/docs/data/date-pickers/date-field/CustomUIDateField.js index 55e810ec1178..0993c2310f97 100644 --- a/docs/data/date-pickers/date-field/CustomUIDateField.js +++ b/docs/data/date-pickers/date-field/CustomUIDateField.js @@ -14,7 +14,7 @@ const UnstyledDateField = (props) => { return ( ); }; @@ -40,13 +40,13 @@ export default function CustomUIDateField() { label={Using unstyled input} control={} labelPlacement="top" - sx={{ alignItems: 'stretch' }} + sx={{ margin: 0 }} /> Using browser input} control={} labelPlacement="top" - sx={{ alignItems: 'stretch' }} + sx={{ margin: 0 }} /> diff --git a/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview b/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview index 4ee0ccb6bf3f..a9bdaf3c79d9 100644 --- a/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview +++ b/docs/data/date-pickers/date-field/CustomUIDateField.tsx.preview @@ -4,13 +4,13 @@ label={Using unstyled input} control={} labelPlacement="top" - sx={{ alignItems: 'stretch' }} + sx={{ margin: 0 }} /> Using browser input} control={} labelPlacement="top" - sx={{ alignItems: 'stretch' }} + sx={{ margin: 0 }} /> \ No newline at end of file