Skip to content

Commit a8026af

Browse files
feat(translations): migrate app package from Material UI v4 to MUI v5 (#3607)
* feat(translations): migrate app package from Material UI v4 to MUI v5 Replace @material-ui/core and @material-ui/icons with @mui/material and @mui/icons-material in the translations workspace app shell. Delete local LogoFull/LogoIcon components in favor of the shared theme plugin exports. Add ESLint guard to prevent MUI v4 re-introduction. Signed-off-by: Mitul Kumar <mitulkumar2000@gmail.com> Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> * addressing comments Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> * updating yarn lock Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> --------- Signed-off-by: Mitul Kumar <mitulkumar2000@gmail.com> Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent aa23f4a commit a8026af

10 files changed

Lines changed: 170 additions & 204 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright Red Hat, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
const materialUiMigrationEslintConfig = {
18+
restrictedImports: [
19+
{
20+
name: '@material-ui/core',
21+
message: 'Use @mui/material instead of Material UI v4.',
22+
},
23+
{
24+
name: '@material-ui/icons',
25+
message: 'Use @mui/icons-material instead of Material UI v4.',
26+
},
27+
{
28+
name: '@material-ui/lab',
29+
message: 'Use @mui/material instead of Material UI v4.',
30+
},
31+
{
32+
name: '@material-ui/styles',
33+
message:
34+
'Use @mui/styles, @mui/material (sx/styled), or Backstage UI instead of Material UI v4.',
35+
},
36+
],
37+
restrictedImportPatterns: ['@material-ui/*'],
38+
};
39+
40+
/**
41+
* ESLint config for frontend packages in this workspace (MUI v4 migration guards).
42+
*/
43+
module.exports = function createEslintConfig(packageDir) {
44+
return require('@backstage/cli/config/eslint-factory')(
45+
packageDir,
46+
materialUiMigrationEslintConfig,
47+
);
48+
};
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
1+
/*
2+
* Copyright Red Hat, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config
18+
module.exports = require('../../eslint.frontend-shared.cjs')(__dirname);

workspaces/translations/packages/app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
"@backstage/plugin-user-settings": "^0.9.1",
4747
"@backstage/theme": "^0.7.2",
4848
"@backstage/ui": "^0.13.2",
49-
"@material-ui/core": "^4.12.2",
50-
"@material-ui/icons": "^4.9.1",
51-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
49+
"@mui/icons-material": "^5.18.0",
50+
"@mui/material": "^5.18.0",
51+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0",
5252
"@red-hat-developer-hub/backstage-plugin-translations": "workspace:^",
5353
"@red-hat-developer-hub/backstage-plugin-translations-test": "workspace:^",
5454
"react": "^18.0.2",

workspaces/translations/packages/app/src/components/Root/LogoFull.tsx

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)