Skip to content

Commit

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions scripts/buildApiDocs/gridSettings/getComponentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

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

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

Expand Down
4 changes: 2 additions & 2 deletions scripts/buildApiDocs/pickersSettings/getComponentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

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

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

Expand Down
4 changes: 2 additions & 2 deletions scripts/buildApiDocs/treeViewSettings/getComponentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export function getComponentImports(name: string, filename: string) {
const githubPath = toGitHubPath(filename);

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

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

Expand Down

0 comments on commit 576c4dd

Please sign in to comment.