core-app-api,core-plugin-api: remove MUI dependencies

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-01-04 10:46:11 +01:00
parent bdf1419d20
commit 784d8078ab
9 changed files with 42 additions and 36 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-plugin-api': minor
---
Removed the deprecated `OldIconComponent` type.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/core-app-api': patch
'@backstage/core-plugin-api': patch
---
Removed direct and transitive MUI dependencies.
-5
View File
@@ -29,15 +29,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/app-defaults": "^0.1.3",
"@backstage/core-components": "^0.8.3",
"@backstage/config": "^0.1.11",
"@backstage/core-plugin-api": "^0.4.1",
"@backstage/theme": "^0.2.14",
"@backstage/types": "^0.1.1",
"@backstage/version-bridge": "^0.1.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@types/prop-types": "^15.7.3",
"prop-types": "^15.7.2",
"react-router-dom": "6.0.0-beta.0",
+19 -2
View File
@@ -49,7 +49,6 @@ import {
SubRouteRef,
ExternalRouteRef,
} from '@backstage/core-plugin-api';
import { UserIdentity } from '@backstage/core-components';
import { ApiFactoryRegistry, ApiResolver } from '../apis/system';
import {
childDiscoverer,
@@ -360,7 +359,25 @@ export class AppManager implements BackstageApp {
// If the app hasn't configured a sign-in page, we just continue as guest.
if (!SignInPageComponent) {
this.appIdentityProxy.setTarget(UserIdentity.createGuest());
this.appIdentityProxy.setTarget({
getUserId: () => 'guest',
getIdToken: async () => undefined,
getProfile: () => ({
email: 'guest@example.com',
displayName: 'Guest',
}),
getProfileInfo: async () => ({
email: 'guest@example.com',
displayName: 'Guest',
}),
getBackstageIdentity: async () => ({
type: 'user',
userEntityRef: 'user:default/guest',
ownershipEntityRefs: ['user:default/guest'],
}),
getCredentials: async () => ({}),
signOut: async () => {},
});
return (
<RouterComponent>
-4
View File
@@ -16,7 +16,6 @@ import { ProfileInfo as ProfileInfo_2 } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { ReactElement } from 'react';
import { ReactNode } from 'react';
import { SvgIconProps } from '@material-ui/core';
// @public
export type AlertApi = {
@@ -616,9 +615,6 @@ export const oktaAuthApiRef: ApiRef<
SessionApi
>;
// @public @deprecated
export type OldIconComponent = ComponentType<SvgIconProps>;
// @alpha
export const oneloginAuthApiRef: ApiRef<
OAuthApi &
-2
View File
@@ -30,10 +30,8 @@
},
"dependencies": {
"@backstage/config": "^0.1.11",
"@backstage/theme": "^0.2.14",
"@backstage/types": "^0.1.1",
"@backstage/version-bridge": "^0.1.1",
"@material-ui/core": "^4.12.2",
"history": "^5.0.0",
"prop-types": "^15.7.2",
"react-router-dom": "6.0.0-beta.0",
+1 -1
View File
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export type { IconComponent, OldIconComponent } from './types';
export type { IconComponent } from './types';
@@ -15,7 +15,6 @@
*/
import { ComponentType } from 'react';
import { SvgIconProps } from '@material-ui/core';
/**
* IconComponent is the common icon type used throughout Backstage when
@@ -36,13 +35,3 @@ import { SvgIconProps } from '@material-ui/core';
export type IconComponent = ComponentType<{
fontSize?: 'default' | 'small' | 'large';
}>;
/**
* This exists for backwards compatibility with the old core package.
* It's used in some parts of this package in order to smooth out the
* migration, but it is not exported.
*
* @public
* @deprecated This type will be removed, use {@link IconComponent} instead.
*/
export type OldIconComponent = ComponentType<SvgIconProps>;
+11 -11
View File
@@ -310,7 +310,16 @@ export const EntityRefLink: React_2.ForwardRefExoticComponent<
| 'children'
| 'key'
| 'id'
| 'classes'
| 'variant'
| 'state'
| 'href'
| 'download'
| 'hrefLang'
| 'ping'
| 'rel'
| 'target'
| 'type'
| 'referrerPolicy'
| 'defaultChecked'
| 'defaultValue'
| 'suppressContentEditableWarning'
@@ -556,22 +565,13 @@ export const EntityRefLink: React_2.ForwardRefExoticComponent<
| 'onTransitionEnd'
| 'onTransitionEndCapture'
| 'component'
| 'variant'
| 'classes'
| 'innerRef'
| 'download'
| 'href'
| 'hrefLang'
| 'ping'
| 'rel'
| 'target'
| 'type'
| 'referrerPolicy'
| 'noWrap'
| 'gutterBottom'
| 'paragraph'
| 'align'
| 'variantMapping'
| 'state'
| 'TypographyClasses'
| 'entityRef'
| 'defaultKind'