Skip to content

Commit

Permalink
[core] Bump monorepo (#12001)
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii authored Feb 9, 2024
1 parent ae8e6d2 commit 300d079
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 136 deletions.
2 changes: 1 addition & 1 deletion docs/data/charts/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pnpm add @mui/styled-engine-sc styled-components

</codeblock>

Take a look at the [Styled engine guide](/material-ui/guides/styled-components/) for more information about how to configure `styled-components` as the style engine.
Take a look at the [Styled engine guide](/material-ui/integrations/styled-components/) for more information about how to configure `styled-components` as the style engine.

### Usage with Next.js

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pnpm add @mui/styled-engine-sc styled-components
</codeblock>

:::info
Take a look at the [Styled Components guide](/material-ui/guides/styled-components/) for more information about how to configure `styled-components` as the style engine.
Take a look at the [Styled Components guide](/material-ui/integrations/styled-components/) for more information about how to configure `styled-components` as the style engine.
:::

## Quickstart
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Note that these translations of the Data Grid component depend on the [Localizat
## RTL Support

Right-to-left languages such as Arabic, Persian, or Hebrew are supported.
Follow [this guide](/material-ui/guides/right-to-left/) to use them.
Follow [this guide](/material-ui/customization/right-to-left/) to use them.

The example below demonstrates how to use an RTL language (Arabic) with the data grid.

Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/faq/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You should never use these components in your application.

## Why is the KeyboardDatePicker not supported anymore?

It has been replaced with the `DatePicker` component, please refer to the [migration documentation](/material-ui/guides/pickers-migration/#imports) for more information.
It has been replaced with the `DatePicker` component, please refer to the [migration documentation](/material-ui/migration/pickers-migration/#imports) for more information.

All versions of the date and time pickers implement keyboard input for accessibility and also allow editing through the UI. Depending on your use case, you may only need keyboard editing, in which case you can use the date and time field components.

Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pnpm add @mui/styled-engine-sc styled-components

</codeblock>

Take a look at the [Styled engine guide](/material-ui/guides/styled-components/) for more information about how to configure `styled-components` as the style engine.
Take a look at the [Styled engine guide](/material-ui/integrations/styled-components/) for more information about how to configure `styled-components` as the style engine.

## Setup your date library adapter

Expand Down
2 changes: 1 addition & 1 deletion docs/data/tree-view/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pnpm add @mui/styled-engine-sc styled-components

</codeblock>

Take a look at the [Styled engine guide](/material-ui/guides/styled-components/) for more information about how to configure `styled-components` as the style engine.
Take a look at the [Styled engine guide](/material-ui/integrations/styled-components/) for more information about how to configure `styled-components` as the style engine.

## Render your first component

Expand Down
6 changes: 0 additions & 6 deletions docs/pages/x/api/data-grid/data-grid-premium.json
Original file line number Diff line number Diff line change
Expand Up @@ -782,12 +782,6 @@
"description": "Styles applied to the empty cell element.",
"isGlobal": false
},
{
"key": "cellOffsetLeft",
"className": "MuiDataGridPremium-cellOffsetLeft",
"description": "",
"isGlobal": false
},
{
"key": "cellSkeleton",
"className": "MuiDataGridPremium-cellSkeleton",
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/x/api/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,6 @@
"description": "Styles applied to the empty cell element.",
"isGlobal": false
},
{
"key": "cellOffsetLeft",
"className": "MuiDataGridPro-cellOffsetLeft",
"description": "",
"isGlobal": false
},
{
"key": "cellSkeleton",
"className": "MuiDataGridPro-cellSkeleton",
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/x/api/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,6 @@
"description": "Styles applied to the empty cell element.",
"isGlobal": false
},
{
"key": "cellOffsetLeft",
"className": "MuiDataGrid-cellOffsetLeft",
"description": "",
"isGlobal": false
},
{
"key": "cellSkeleton",
"className": "MuiDataGrid-cellSkeleton",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the empty cell element"
},
"cellOffsetLeft": { "description": "" },
"cellSkeleton": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the skeleton cell element"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the empty cell element"
},
"cellOffsetLeft": { "description": "" },
"cellSkeleton": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the skeleton cell element"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the empty cell element"
},
"cellOffsetLeft": { "description": "" },
"cellSkeleton": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the skeleton cell element"
Expand Down
113 changes: 6 additions & 107 deletions scripts/copyFiles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,118 +3,17 @@
/* eslint-disable no-console */
import path from 'path';
import fse from 'fs-extra';
import glob from 'fast-glob';
import {
includeFileInBuild,
createModulePackages,
typescriptCopy,
createPackageFile,
} from '@mui/monorepo/scripts/copyFilesUtils.mjs';

const packagePath = process.cwd();
const buildPath = path.join(packagePath, './build');
const srcPath = path.join(packagePath, './src');

async function includeFileInBuild(file) {
const sourcePath = path.resolve(packagePath, file);
const targetPath = path.resolve(buildPath, path.basename(file));
await fse.copy(sourcePath, targetPath);
console.log(`Copied ${sourcePath} to ${targetPath}`);
}

/**
* Puts a package.json into every immediate child directory of rootDir.
* That package.json contains information about esm for bundlers so that imports
* like import Typography from '@mui/material/Typography' are tree-shakeable.
*
* It also tests that this import can be used in TypeScript by checking
* if an index.d.ts is present at that path.
* @param {object} param0
* @param {string} param0.from
* @param {string} param0.to
*/
async function createModulePackages({ from, to }) {
const directoryPackages = glob.sync('*/index.{js,ts,tsx}', { cwd: from }).map(path.dirname);

await Promise.all(
directoryPackages.map(async (directoryPackage) => {
const packageJsonPath = path.join(to, directoryPackage, 'package.json');
const topLevelPathImportsAreCommonJSModules = await fse.pathExists(
path.resolve(path.dirname(packageJsonPath), '../esm'),
);

const packageJson = {
sideEffects: false,
module: topLevelPathImportsAreCommonJSModules
? path.posix.join('../esm', directoryPackage, 'index.js')
: './index.js',
main: topLevelPathImportsAreCommonJSModules
? './index.js'
: path.posix.join('../node', directoryPackage, 'index.js'),
types: './index.d.ts',
};

const [typingsEntryExist, moduleEntryExists, mainEntryExists] = await Promise.all([
fse.pathExists(path.resolve(path.dirname(packageJsonPath), packageJson.types)),
fse.pathExists(path.resolve(path.dirname(packageJsonPath), packageJson.module)),
fse.pathExists(path.resolve(path.dirname(packageJsonPath), packageJson.main)),
fse.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2)),
]);

const manifestErrorMessages = [];
if (!typingsEntryExist) {
manifestErrorMessages.push(`'types' entry '${packageJson.types}' does not exist`);
}
if (!moduleEntryExists) {
manifestErrorMessages.push(`'module' entry '${packageJson.module}' does not exist`);
}
if (!mainEntryExists) {
manifestErrorMessages.push(`'main' entry '${packageJson.main}' does not exist`);
}
if (manifestErrorMessages.length > 0) {
// TODO: AggregateError
throw new Error(`${packageJsonPath}:\n${manifestErrorMessages.join('\n')}`);
}

return packageJsonPath;
}),
);
}

async function typescriptCopy({ from, to }) {
if (!(await fse.pathExists(to))) {
console.warn(`path ${to} does not exists`);
return [];
}

const files = await glob('**/*.d.ts', { cwd: from });
const cmds = files.map((file) => fse.copy(path.resolve(from, file), path.resolve(to, file)));
return Promise.all(cmds);
}

async function createPackageFile() {
const packageData = await fse.readFile(path.resolve(packagePath, './package.json'), 'utf8');
const { nyc, scripts, devDependencies, workspaces, ...packageDataOther } =
JSON.parse(packageData);

const newPackageData = {
...packageDataOther,
private: false,
...(packageDataOther.main
? {
main: fse.existsSync(path.resolve(buildPath, './node/index.js'))
? './node/index.js'
: './index.js',
module: fse.existsSync(path.resolve(buildPath, './esm/index.js'))
? './esm/index.js'
: './index.js',
}
: {}),
types: './index.d.ts',
};

const targetPath = path.resolve(buildPath, './package.json');

await fse.writeFile(targetPath, JSON.stringify(newPackageData, null, 2), 'utf8');
console.log(`Created package.json in ${targetPath}`);

return newPackageData;
}

async function prepend(file, string) {
const data = await fse.readFile(file, 'utf8');
await fse.writeFile(file, string + data, 'utf8');
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1891,8 +1891,8 @@
react-transition-group "^4.4.5"

"@mui/monorepo@https://github.com/mui/material-ui.git#master":
version "5.15.7"
resolved "https://github.com/mui/material-ui.git#475e186f1e31d194e1d80621effa8a866411ec30"
version "5.15.9"
resolved "https://github.com/mui/material-ui.git#97bd4c7ccc25a106a53be29d4267e317b782cb2e"
dependencies:
"@googleapis/sheets" "^5.0.5"
"@slack/bolt" "^3.17.1"
Expand Down

0 comments on commit 300d079

Please sign in to comment.