Skip to content

Commit 537049a

Browse files
feat(scorecard): migrate from Material UI v4 to MUI v5
1 parent 763507e commit 537049a

16 files changed

Lines changed: 214 additions & 276 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-scorecard': patch
3+
---
4+
5+
Replace Material UI v4 imports with MUI v5 and scope JSS class names to prevent style collisions.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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/lab',
25+
message: 'Use @mui/material instead of Material UI v4.',
26+
},
27+
{
28+
name: '@material-ui/styles',
29+
message:
30+
'Use @mui/styles, @mui/material (sx/styled), or Backstage UI instead of Material UI v4.',
31+
},
32+
],
33+
restrictedImportPatterns: ['@material-ui/*'],
34+
};
35+
36+
/**
37+
* Shared ESLint config for frontend packages in the scorecard workspace.
38+
*/
39+
module.exports = packageDir =>
40+
require('@backstage/cli/config/eslint-factory')(
41+
packageDir,
42+
materialUiMigrationEslintConfig,
43+
);
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/scorecard/packages/app-legacy/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@
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",
49+
"@mui/icons-material": "5.18.0",
50+
"@mui/material": "5.18.0",
51+
"@mui/styles": "5.18.0",
5152
"@openshift/dynamic-plugin-sdk": "^5.0.1",
5253
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": "^1.10.2",
5354
"@red-hat-developer-hub/backstage-plugin-scorecard": "workspace:^",
54-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
55+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0",
5556
"@roadiehq/backstage-plugin-github-pull-requests": "^3.5.1",
5657
"@roadiehq/backstage-plugin-jira": "^2.13.1",
5758
"@scalprum/react-core": "0.11.1",

workspaces/scorecard/packages/app-legacy/src/components/Root/LogoFull.tsx

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

0 commit comments

Comments
 (0)