Skip to content

Commit

Permalink
[core] Remove grid folder from getComponentInfo RegExp (#12241)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Feb 28, 2024
1 parent bea36e8 commit 1e86d1f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions scripts/buildApiDocs/chartsSettings/getComponentInfo.ts
Expand Up @@ -64,13 +64,13 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

const rootImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/.*/,
(match, dash, pkg) => `@mui/${pkg}`,
/\/packages\/(.+?)?\/src\/.*/,
(match, pkg) => `@mui/${pkg}`,
);

const subdirectoryImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/([^\\/]+)\/.*/,
(match, dash, pkg, directory) => `@mui/${pkg}/${directory}`,
/\/packages\/(.+?)?\/src\/([^\\/]+)\/.*/,
(match, pkg, directory) => `@mui/${pkg}/${directory}`,
);

const reExportPackage = [rootImportPath];
Expand Down
8 changes: 4 additions & 4 deletions scripts/buildApiDocs/gridSettings/getComponentInfo.ts
Expand Up @@ -50,13 +50,13 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

const rootImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/.*/,
(match, dash, pkg) => `@mui/${pkg}`,
/\/packages\/(.+?)?\/src\/.*/,
(match, pkg) => `@mui/${pkg}`,
);

const subdirectoryImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/([^\\/]+)\/.*/,
(match, dash, pkg, directory) => `@mui/${pkg}/${directory}`,
/\/packages\/(.+?)?\/src\/([^\\/]+)\/.*/,
(match, pkg, directory) => `@mui/${pkg}/${directory}`,
);

const reExportPackage = [rootImportPath];
Expand Down
8 changes: 4 additions & 4 deletions scripts/buildApiDocs/pickersSettings/getComponentInfo.ts
Expand Up @@ -66,13 +66,13 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

const rootImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/.*/,
(match, dash, pkg) => `@mui/${pkg}`,
/\/packages\/(.+?)?\/src\/.*/,
(match, pkg) => `@mui/${pkg}`,
);

const subdirectoryImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/([^\\/]+)\/.*/,
(match, dash, pkg, directory) => `@mui/${pkg}/${directory}`,
/\/packages\/(.+?)?\/src\/([^\\/]+)\/.*/,
(match, pkg, directory) => `@mui/${pkg}/${directory}`,
);

const reExportPackage = [rootImportPath];
Expand Down
8 changes: 4 additions & 4 deletions scripts/buildApiDocs/treeViewSettings/getComponentInfo.ts
Expand Up @@ -64,13 +64,13 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

const rootImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/.*/,
(match, dash, pkg) => `@mui/${pkg}`,
/\/packages\/(.+?)?\/src\/.*/,
(match, pkg) => `@mui/${pkg}`,
);

const subdirectoryImportPath = githubPath.replace(
/\/packages\/(grid\/|)(.+?)?\/src\/([^\\/]+)\/.*/,
(match, dash, pkg, directory) => `@mui/${pkg}/${directory}`,
/\/packages\/(.+?)?\/src\/([^\\/]+)\/.*/,
(match, pkg, directory) => `@mui/${pkg}/${directory}`,
);

const reExportPackage = [rootImportPath];
Expand Down

0 comments on commit 1e86d1f

Please sign in to comment.