@backstage/dev-utils 1.0.31-next.0 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/index.d.ts +25 -3
- package/dist/index.esm.js +55 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @backstage/dev-utils
|
|
2
2
|
|
|
3
|
+
## 1.0.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9a41a7b: Allow defining custom sidebar item for page and login for the development app
|
|
8
|
+
- abfbcfc: Updated dependency `@testing-library/react` to `^15.0.0`.
|
|
9
|
+
- cb1e3b0: Updated dependency `@testing-library/dom` to `^10.0.0`.
|
|
10
|
+
- 995f66b: add @backstage/no-top-level-material-ui-4-imports lint rule
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/plugin-catalog-react@1.11.3
|
|
13
|
+
- @backstage/core-components@0.14.4
|
|
14
|
+
- @backstage/core-app-api@1.12.4
|
|
15
|
+
- @backstage/app-defaults@1.5.4
|
|
16
|
+
- @backstage/core-plugin-api@1.9.2
|
|
17
|
+
- @backstage/theme@0.5.3
|
|
18
|
+
- @backstage/integration-react@1.1.26
|
|
19
|
+
- @backstage/catalog-model@1.4.5
|
|
20
|
+
|
|
21
|
+
## 1.0.31-next.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 995f66b: add @backstage/no-top-level-material-ui-4-imports lint rule
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @backstage/core-app-api@1.12.4-next.0
|
|
28
|
+
- @backstage/app-defaults@1.5.4-next.1
|
|
29
|
+
- @backstage/catalog-model@1.4.5
|
|
30
|
+
- @backstage/core-components@0.14.4-next.0
|
|
31
|
+
- @backstage/core-plugin-api@1.9.1
|
|
32
|
+
- @backstage/integration-react@1.1.26-next.0
|
|
33
|
+
- @backstage/theme@0.5.2
|
|
34
|
+
- @backstage/plugin-catalog-react@1.11.3-next.1
|
|
35
|
+
|
|
3
36
|
## 1.0.31-next.0
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Entity } from '@backstage/catalog-model';
|
|
3
|
-
import { GridProps } from '@material-ui/core';
|
|
3
|
+
import { GridProps } from '@material-ui/core/Grid';
|
|
4
|
+
import React, { ReactNode, ComponentType, PropsWithChildren } from 'react';
|
|
4
5
|
import { IconComponent, BackstagePlugin, ApiFactory, AppTheme } from '@backstage/core-plugin-api';
|
|
5
|
-
import {
|
|
6
|
+
import { SignInProviderConfig } from '@backstage/core-components';
|
|
6
7
|
|
|
7
8
|
/** @public */
|
|
8
9
|
declare const EntityGridItem: (props: Omit<GridProps, 'item' | 'container'> & {
|
|
9
10
|
entity: Entity;
|
|
10
11
|
}) => JSX.Element;
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Button for sidebar that signs out user
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
declare const SidebarSignOutButton: (props: {
|
|
19
|
+
icon?: IconComponent;
|
|
20
|
+
text?: string;
|
|
21
|
+
}) => React.JSX.Element;
|
|
22
|
+
|
|
12
23
|
/** @public */
|
|
13
24
|
type DevAppPageOptions = {
|
|
14
25
|
path?: string;
|
|
@@ -29,6 +40,7 @@ declare class DevAppBuilder {
|
|
|
29
40
|
private readonly rootChildren;
|
|
30
41
|
private readonly routes;
|
|
31
42
|
private readonly sidebarItems;
|
|
43
|
+
private readonly signInProviders;
|
|
32
44
|
private defaultPage?;
|
|
33
45
|
private themes?;
|
|
34
46
|
/**
|
|
@@ -47,6 +59,12 @@ declare class DevAppBuilder {
|
|
|
47
59
|
* Useful for adding more global components like the AlertDisplay.
|
|
48
60
|
*/
|
|
49
61
|
addRootChild(node: ReactNode): DevAppBuilder;
|
|
62
|
+
/**
|
|
63
|
+
* Adds a new sidebar item to the dev app.
|
|
64
|
+
*
|
|
65
|
+
* Useful for adding only sidebar items without a corresponding page.
|
|
66
|
+
*/
|
|
67
|
+
addSidebarItem(sidebarItem: JSX.Element): DevAppBuilder;
|
|
50
68
|
/**
|
|
51
69
|
* Adds a page component along with accompanying sidebar item.
|
|
52
70
|
*
|
|
@@ -58,6 +76,10 @@ declare class DevAppBuilder {
|
|
|
58
76
|
* Adds an array of themes to override the default theme.
|
|
59
77
|
*/
|
|
60
78
|
addThemes(themes: AppTheme[]): this;
|
|
79
|
+
/**
|
|
80
|
+
* Adds new sign in provider for the dev app
|
|
81
|
+
*/
|
|
82
|
+
addSignInProvider(provider: SignInProviderConfig): this;
|
|
61
83
|
/**
|
|
62
84
|
* Build a DevApp component using the resources registered so far
|
|
63
85
|
*/
|
|
@@ -74,4 +96,4 @@ declare class DevAppBuilder {
|
|
|
74
96
|
*/
|
|
75
97
|
declare function createDevApp(): DevAppBuilder;
|
|
76
98
|
|
|
77
|
-
export { DevAppBuilder, type DevAppPageOptions, EntityGridItem, createDevApp };
|
|
99
|
+
export { DevAppBuilder, type DevAppPageOptions, EntityGridItem, SidebarSignOutButton, createDevApp };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
|
2
|
-
import
|
|
2
|
+
import Grid from '@material-ui/core/Grid';
|
|
3
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
3
4
|
import React, { useState, useCallback, cloneElement } from 'react';
|
|
5
|
+
import { SidebarItem, SignInPage, AlertDisplay, OAuthRequestDialog, SidebarPage, Sidebar, SidebarSpacer, SidebarSpace, SidebarDivider } from '@backstage/core-components';
|
|
6
|
+
import LockIcon from '@material-ui/icons/Lock';
|
|
7
|
+
import { useApi, identityApiRef, appThemeApiRef, attachComponentData, createRouteRef, createApiFactory, configApiRef } from '@backstage/core-plugin-api';
|
|
4
8
|
import { createApp } from '@backstage/app-defaults';
|
|
5
9
|
import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
|
|
6
|
-
import { SidebarItem, AlertDisplay, OAuthRequestDialog, SidebarPage, Sidebar, SidebarSpacer, SidebarSpace, SidebarDivider } from '@backstage/core-components';
|
|
7
|
-
import { useApi, appThemeApiRef, attachComponentData, createRouteRef, createApiFactory, configApiRef } from '@backstage/core-plugin-api';
|
|
8
10
|
import { scmIntegrationsApiRef, ScmIntegrationsApi } from '@backstage/integration-react';
|
|
11
|
+
import Box from '@material-ui/core/Box';
|
|
9
12
|
import BookmarkIcon from '@material-ui/icons/Bookmark';
|
|
10
13
|
import { createRoutesFromChildren, Route } from 'react-router-dom';
|
|
14
|
+
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
15
|
+
import ListItemText from '@material-ui/core/ListItemText';
|
|
16
|
+
import Menu from '@material-ui/core/Menu';
|
|
17
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
11
18
|
import AutoIcon from '@material-ui/icons/BrightnessAuto';
|
|
12
19
|
import useObservable from 'react-use/esm/useObservable';
|
|
13
20
|
import 'react-dom';
|
|
@@ -30,6 +37,19 @@ const EntityGridItem = (props) => {
|
|
|
30
37
|
return /* @__PURE__ */ React.createElement(EntityProvider, { entity }, /* @__PURE__ */ React.createElement(Grid, { classes: { root: itemClasses.root, ...classes }, ...rest, item: true }));
|
|
31
38
|
};
|
|
32
39
|
|
|
40
|
+
const SidebarSignOutButton = (props) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const identityApi = useApi(identityApiRef);
|
|
43
|
+
return /* @__PURE__ */ React.createElement(
|
|
44
|
+
SidebarItem,
|
|
45
|
+
{
|
|
46
|
+
onClick: () => identityApi.signOut(),
|
|
47
|
+
icon: (_a = props.icon) != null ? _a : LockIcon,
|
|
48
|
+
text: (_b = props.text) != null ? _b : "Sign Out"
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
33
53
|
const ThemeIcon = ({ active, icon }) => icon ? cloneElement(icon, {
|
|
34
54
|
color: active ? "primary" : void 0
|
|
35
55
|
}) : /* @__PURE__ */ React.createElement(AutoIcon, { color: active ? "primary" : void 0 });
|
|
@@ -139,6 +159,7 @@ class DevAppBuilder {
|
|
|
139
159
|
__publicField(this, "rootChildren", new Array());
|
|
140
160
|
__publicField(this, "routes", new Array());
|
|
141
161
|
__publicField(this, "sidebarItems", new Array());
|
|
162
|
+
__publicField(this, "signInProviders", new Array());
|
|
142
163
|
__publicField(this, "defaultPage");
|
|
143
164
|
__publicField(this, "themes");
|
|
144
165
|
}
|
|
@@ -165,6 +186,15 @@ class DevAppBuilder {
|
|
|
165
186
|
this.rootChildren.push(node);
|
|
166
187
|
return this;
|
|
167
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Adds a new sidebar item to the dev app.
|
|
191
|
+
*
|
|
192
|
+
* Useful for adding only sidebar items without a corresponding page.
|
|
193
|
+
*/
|
|
194
|
+
addSidebarItem(sidebarItem) {
|
|
195
|
+
this.sidebarItems.push(sidebarItem);
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
168
198
|
/**
|
|
169
199
|
* Adds a page component along with accompanying sidebar item.
|
|
170
200
|
*
|
|
@@ -210,6 +240,13 @@ class DevAppBuilder {
|
|
|
210
240
|
this.themes = themes;
|
|
211
241
|
return this;
|
|
212
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Adds new sign in provider for the dev app
|
|
245
|
+
*/
|
|
246
|
+
addSignInProvider(provider) {
|
|
247
|
+
this.signInProviders.push(provider);
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
213
250
|
/**
|
|
214
251
|
* Build a DevApp component using the resources registered so far
|
|
215
252
|
*/
|
|
@@ -231,6 +268,19 @@ class DevAppBuilder {
|
|
|
231
268
|
apis,
|
|
232
269
|
plugins: this.plugins,
|
|
233
270
|
themes: this.themes,
|
|
271
|
+
components: {
|
|
272
|
+
SignInPage: (props) => {
|
|
273
|
+
return /* @__PURE__ */ React.createElement(
|
|
274
|
+
SignInPage,
|
|
275
|
+
{
|
|
276
|
+
...props,
|
|
277
|
+
providers: ["guest", ...this.signInProviders],
|
|
278
|
+
title: "Select a sign-in method",
|
|
279
|
+
align: "center"
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
234
284
|
bindRoutes: ({ bind }) => {
|
|
235
285
|
var _a;
|
|
236
286
|
for (const plugin of (_a = this.plugins) != null ? _a : []) {
|
|
@@ -242,7 +292,7 @@ class DevAppBuilder {
|
|
|
242
292
|
}
|
|
243
293
|
}
|
|
244
294
|
});
|
|
245
|
-
const DevApp = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(AlertDisplay, null), /* @__PURE__ */ React.createElement(OAuthRequestDialog, null), this.rootChildren, /* @__PURE__ */ React.createElement(AppRouter, null, /* @__PURE__ */ React.createElement(SidebarPage, null, /* @__PURE__ */ React.createElement(Sidebar, null, /* @__PURE__ */ React.createElement(SidebarSpacer, null), this.sidebarItems, /* @__PURE__ */ React.createElement(SidebarSpace, null), /* @__PURE__ */ React.createElement(SidebarDivider, null), /* @__PURE__ */ React.createElement(SidebarThemeSwitcher, null)), /* @__PURE__ */ React.createElement(FlatRoutes, null, this.routes, /* @__PURE__ */ React.createElement(Route, { path: "/_external_route", element: /* @__PURE__ */ React.createElement(FakePage, null) })))));
|
|
295
|
+
const DevApp = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(AlertDisplay, null), /* @__PURE__ */ React.createElement(OAuthRequestDialog, null), this.rootChildren, /* @__PURE__ */ React.createElement(AppRouter, null, /* @__PURE__ */ React.createElement(SidebarPage, null, /* @__PURE__ */ React.createElement(Sidebar, null, /* @__PURE__ */ React.createElement(SidebarSpacer, null), this.sidebarItems, /* @__PURE__ */ React.createElement(SidebarSpace, null), /* @__PURE__ */ React.createElement(SidebarDivider, null), /* @__PURE__ */ React.createElement(SidebarThemeSwitcher, null), /* @__PURE__ */ React.createElement(SidebarSignOutButton, null)), /* @__PURE__ */ React.createElement(FlatRoutes, null, this.routes, /* @__PURE__ */ React.createElement(Route, { path: "/_external_route", element: /* @__PURE__ */ React.createElement(FakePage, null) })))));
|
|
246
296
|
return app.createRoot(DevApp);
|
|
247
297
|
}
|
|
248
298
|
/**
|
|
@@ -268,5 +318,5 @@ function createDevApp() {
|
|
|
268
318
|
return new DevAppBuilder();
|
|
269
319
|
}
|
|
270
320
|
|
|
271
|
-
export { EntityGridItem, createDevApp };
|
|
321
|
+
export { EntityGridItem, SidebarSignOutButton, createDevApp };
|
|
272
322
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/components/EntityGridItem/EntityGridItem.tsx","../src/devApp/SidebarThemeSwitcher.tsx","../src/devApp/render.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityProvider } from '@backstage/plugin-catalog-react';\nimport { Grid, GridProps, Theme, makeStyles } from '@material-ui/core';\nimport React from 'react';\n\nconst useStyles = makeStyles<Theme, { entity: Entity }>(theme => ({\n root: ({ entity }) => ({\n position: 'relative',\n\n '&::before': {\n content: `\"${entity.metadata.name}\"`,\n top: -theme.typography.fontSize + 4,\n display: 'block',\n position: 'absolute',\n color: theme.palette.textSubtle,\n },\n }),\n}));\n\n/** @public */\nexport const EntityGridItem = (\n props: Omit<GridProps, 'item' | 'container'> & { entity: Entity },\n): JSX.Element => {\n const { entity, classes, ...rest } = props;\n const itemClasses = useStyles({ entity });\n\n return (\n <EntityProvider entity={entity}>\n <Grid classes={{ root: itemClasses.root, ...classes }} {...rest} item />\n </EntityProvider>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SidebarItem } from '@backstage/core-components';\nimport { appThemeApiRef, useApi } from '@backstage/core-plugin-api';\nimport { ListItemIcon, ListItemText, Menu, MenuItem } from '@material-ui/core';\nimport AutoIcon from '@material-ui/icons/BrightnessAuto';\nimport React, { cloneElement, useCallback, useState } from 'react';\nimport useObservable from 'react-use/esm/useObservable';\n\ntype ThemeIconProps = {\n active?: boolean;\n icon: JSX.Element | undefined;\n};\n\nconst ThemeIcon = ({ active, icon }: ThemeIconProps) =>\n icon ? (\n cloneElement(icon, {\n color: active ? 'primary' : undefined,\n })\n ) : (\n <AutoIcon color={active ? 'primary' : undefined} />\n );\n\nexport const SidebarThemeSwitcher = () => {\n const appThemeApi = useApi(appThemeApiRef);\n const themeId = useObservable(\n appThemeApi.activeThemeId$(),\n appThemeApi.getActiveThemeId(),\n );\n const themeIds = appThemeApi.getInstalledThemes();\n const activeTheme = themeIds.find(t => t.id === themeId);\n\n const [anchorEl, setAnchorEl] = useState<Element | undefined>();\n const open = Boolean(anchorEl);\n\n const handleOpen = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleSelectTheme = (newThemeId: string | undefined) => {\n if (themeIds.some(t => t.id === newThemeId)) {\n appThemeApi.setActiveThemeId(newThemeId);\n } else {\n appThemeApi.setActiveThemeId(undefined);\n }\n\n setAnchorEl(undefined);\n };\n\n const handleClose = () => {\n setAnchorEl(undefined);\n };\n\n const ActiveIcon = useCallback(\n () => <ThemeIcon icon={activeTheme?.icon} />,\n [activeTheme],\n );\n\n return (\n <>\n <SidebarItem\n icon={ActiveIcon}\n text=\"Switch Theme\"\n id=\"theme-button\"\n aria-haspopup=\"listbox\"\n aria-controls=\"theme-menu\"\n aria-label=\"switch theme\"\n aria-expanded={open ? 'true' : undefined}\n onClick={handleOpen}\n />\n\n <Menu\n id=\"theme-menu\"\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n MenuListProps={{\n 'aria-labelledby': 'theme-button',\n role: 'listbox',\n }}\n >\n <MenuItem disabled>Choose a theme</MenuItem>\n <MenuItem\n selected={themeId === undefined}\n onClick={() => handleSelectTheme(undefined)}\n >\n <ListItemIcon>\n <ThemeIcon icon={undefined} active={themeId === undefined} />\n </ListItemIcon>\n <ListItemText>Auto</ListItemText>\n </MenuItem>\n\n {themeIds.map(theme => {\n const active = theme.id === themeId;\n return (\n <MenuItem\n key={theme.id}\n selected={active}\n aria-selected={active}\n onClick={() => handleSelectTheme(theme.id)}\n >\n <ListItemIcon>\n <ThemeIcon icon={theme.icon} active={active} />\n </ListItemIcon>\n <ListItemText>{theme.title}</ListItemText>\n </MenuItem>\n );\n })}\n </Menu>\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApp } from '@backstage/app-defaults';\nimport { AppRouter, FlatRoutes } from '@backstage/core-app-api';\nimport {\n AlertDisplay,\n OAuthRequestDialog,\n Sidebar,\n SidebarDivider,\n SidebarItem,\n SidebarPage,\n SidebarSpace,\n SidebarSpacer,\n} from '@backstage/core-components';\nimport {\n AnyApiFactory,\n ApiFactory,\n AppTheme,\n attachComponentData,\n BackstagePlugin,\n configApiRef,\n createApiFactory,\n createRouteRef,\n IconComponent,\n RouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n ScmIntegrationsApi,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport { Box } from '@material-ui/core';\nimport BookmarkIcon from '@material-ui/icons/Bookmark';\nimport React, { ComponentType, ReactNode, PropsWithChildren } from 'react';\nimport { createRoutesFromChildren, Route } from 'react-router-dom';\nimport { SidebarThemeSwitcher } from './SidebarThemeSwitcher';\nimport 'react-dom';\n\nlet ReactDOMPromise: Promise<\n typeof import('react-dom') | typeof import('react-dom/client')\n>;\nif (process.env.HAS_REACT_DOM_CLIENT) {\n ReactDOMPromise = import('react-dom/client');\n} else {\n ReactDOMPromise = import('react-dom');\n}\n\nexport function isReactRouterBeta(): boolean {\n const [obj] = createRoutesFromChildren(<Route index element={<div />} />);\n return !obj.index;\n}\n\nconst MaybeGatheringRoute: (props: {\n path: string;\n element: JSX.Element;\n children?: ReactNode;\n}) => JSX.Element = ({ element }) => element;\n\nif (isReactRouterBeta()) {\n attachComponentData(MaybeGatheringRoute, 'core.gatherMountPoints', true);\n}\n\n/** @public */\nexport type DevAppPageOptions = {\n path?: string;\n element: JSX.Element;\n children?: JSX.Element;\n title?: string;\n icon?: IconComponent;\n};\n\n/**\n * DevApp builder that is similar to the App builder API, but creates an App\n * with the purpose of developing one or more plugins inside it.\n *\n * @public\n */\nexport class DevAppBuilder {\n private readonly plugins = new Array<BackstagePlugin>();\n private readonly apis = new Array<AnyApiFactory>();\n private readonly rootChildren = new Array<ReactNode>();\n private readonly routes = new Array<JSX.Element>();\n private readonly sidebarItems = new Array<JSX.Element>();\n\n private defaultPage?: string;\n private themes?: Array<AppTheme>;\n\n /**\n * Register one or more plugins to render in the dev app\n */\n registerPlugin(...plugins: BackstagePlugin[]): DevAppBuilder {\n this.plugins.push(...plugins);\n return this;\n }\n\n /**\n * Register an API factory to add to the app\n */\n registerApi<\n Api,\n Impl extends Api,\n Deps extends { [name in string]: unknown },\n >(factory: ApiFactory<Api, Impl, Deps>): DevAppBuilder {\n this.apis.push(factory);\n return this;\n }\n\n /**\n * Adds a React node to place just inside the App Provider.\n *\n * Useful for adding more global components like the AlertDisplay.\n */\n addRootChild(node: ReactNode): DevAppBuilder {\n this.rootChildren.push(node);\n return this;\n }\n\n /**\n * Adds a page component along with accompanying sidebar item.\n *\n * If no path is provided one will be generated.\n * If no title is provided, no sidebar item will be created.\n */\n addPage(opts: DevAppPageOptions): DevAppBuilder {\n const path = opts.path ?? `/page-${this.routes.length + 1}`;\n\n if (!this.defaultPage || path === '/') {\n this.defaultPage = path;\n }\n\n if (opts.title) {\n this.sidebarItems.push(\n <SidebarItem\n key={path}\n to={path}\n text={opts.title}\n icon={opts.icon ?? BookmarkIcon}\n />,\n );\n }\n this.routes.push(\n <MaybeGatheringRoute\n key={path}\n path={path}\n element={opts.element}\n children={opts.children}\n />,\n );\n return this;\n }\n\n /**\n * Adds an array of themes to override the default theme.\n */\n addThemes(themes: AppTheme[]) {\n this.themes = themes;\n return this;\n }\n\n /**\n * Build a DevApp component using the resources registered so far\n */\n build(): ComponentType<PropsWithChildren<{}>> {\n const fakeRouteRef = createRouteRef({ id: 'fake' });\n const FakePage = () => <Box p={3}>Page belonging to another plugin.</Box>;\n attachComponentData(FakePage, 'core.mountPoint', fakeRouteRef);\n\n const apis = [...this.apis];\n if (!apis.some(api => api.api.id === scmIntegrationsApiRef.id)) {\n apis.push(\n createApiFactory({\n api: scmIntegrationsApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),\n }),\n );\n }\n\n const app = createApp({\n apis,\n plugins: this.plugins,\n themes: this.themes,\n bindRoutes: ({ bind }) => {\n for (const plugin of this.plugins ?? []) {\n const targets: Record<string, RouteRef<any>> = {};\n for (const routeKey of Object.keys(plugin.externalRoutes)) {\n targets[routeKey] = fakeRouteRef;\n }\n bind(plugin.externalRoutes, targets);\n }\n },\n });\n\n const DevApp = (\n <>\n <AlertDisplay />\n <OAuthRequestDialog />\n {this.rootChildren}\n <AppRouter>\n <SidebarPage>\n <Sidebar>\n <SidebarSpacer />\n {this.sidebarItems}\n <SidebarSpace />\n <SidebarDivider />\n <SidebarThemeSwitcher />\n </Sidebar>\n <FlatRoutes>\n {this.routes}\n <Route path=\"/_external_route\" element={<FakePage />} />\n </FlatRoutes>\n </SidebarPage>\n </AppRouter>\n </>\n );\n\n return app.createRoot(DevApp);\n }\n\n /**\n * Build and render directory to #root element, with react hot loading.\n */\n render(): void {\n const DevApp = this.build();\n\n if (\n window.location.pathname === '/' &&\n this.defaultPage &&\n this.defaultPage !== '/'\n ) {\n window.location.pathname = this.defaultPage;\n }\n\n ReactDOMPromise.then(ReactDOM => {\n if ('createRoot' in ReactDOM) {\n ReactDOM.createRoot(document.getElementById('root')!).render(\n <DevApp />,\n );\n } else {\n ReactDOM.render(<DevApp />, document.getElementById('root'));\n }\n });\n }\n}\n\n// TODO(rugvip): Figure out patterns for how to allow in-house apps to build upon\n// this to provide their own plugin dev wrappers.\n\n/**\n * Creates a dev app for rendering one or more plugins and exposing the touch points of the plugin.\n *\n * @public\n */\nexport function createDevApp() {\n return new DevAppBuilder();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,SAAA,GAAY,WAAsC,CAAU,KAAA,MAAA;AAAA,EAChE,IAAM,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,IACrB,QAAU,EAAA,UAAA;AAAA,IAEV,WAAa,EAAA;AAAA,MACX,OAAS,EAAA,CAAA,CAAA,EAAI,MAAO,CAAA,QAAA,CAAS,IAAI,CAAA,CAAA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+
{"version":3,"file":"index.esm.js","sources":["../src/components/EntityGridItem/EntityGridItem.tsx","../src/components/SidebarSignOutButton/SidebarSignOutButton.tsx","../src/devApp/SidebarThemeSwitcher.tsx","../src/devApp/render.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityProvider } from '@backstage/plugin-catalog-react';\nimport Grid, { GridProps } from '@material-ui/core/Grid';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\n\nconst useStyles = makeStyles<Theme, { entity: Entity }>(theme => ({\n root: ({ entity }) => ({\n position: 'relative',\n\n '&::before': {\n content: `\"${entity.metadata.name}\"`,\n top: -theme.typography.fontSize + 4,\n display: 'block',\n position: 'absolute',\n color: theme.palette.textSubtle,\n },\n }),\n}));\n\n/** @public */\nexport const EntityGridItem = (\n props: Omit<GridProps, 'item' | 'container'> & { entity: Entity },\n): JSX.Element => {\n const { entity, classes, ...rest } = props;\n const itemClasses = useStyles({ entity });\n\n return (\n <EntityProvider entity={entity}>\n <Grid classes={{ root: itemClasses.root, ...classes }} {...rest} item />\n </EntityProvider>\n );\n};\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { SidebarItem } from '@backstage/core-components';\nimport LockIcon from '@material-ui/icons/Lock';\nimport {\n IconComponent,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\n/**\n * Button for sidebar that signs out user\n *\n * @public\n */\nexport const SidebarSignOutButton = (props: {\n icon?: IconComponent;\n text?: string;\n}) => {\n const identityApi = useApi(identityApiRef);\n\n return (\n <SidebarItem\n onClick={() => identityApi.signOut()}\n icon={props.icon ?? LockIcon}\n text={props.text ?? 'Sign Out'}\n />\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SidebarItem } from '@backstage/core-components';\nimport { appThemeApiRef, useApi } from '@backstage/core-plugin-api';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport AutoIcon from '@material-ui/icons/BrightnessAuto';\nimport React, { cloneElement, useCallback, useState } from 'react';\nimport useObservable from 'react-use/esm/useObservable';\n\ntype ThemeIconProps = {\n active?: boolean;\n icon: JSX.Element | undefined;\n};\n\nconst ThemeIcon = ({ active, icon }: ThemeIconProps) =>\n icon ? (\n cloneElement(icon, {\n color: active ? 'primary' : undefined,\n })\n ) : (\n <AutoIcon color={active ? 'primary' : undefined} />\n );\n\nexport const SidebarThemeSwitcher = () => {\n const appThemeApi = useApi(appThemeApiRef);\n const themeId = useObservable(\n appThemeApi.activeThemeId$(),\n appThemeApi.getActiveThemeId(),\n );\n const themeIds = appThemeApi.getInstalledThemes();\n const activeTheme = themeIds.find(t => t.id === themeId);\n\n const [anchorEl, setAnchorEl] = useState<Element | undefined>();\n const open = Boolean(anchorEl);\n\n const handleOpen = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleSelectTheme = (newThemeId: string | undefined) => {\n if (themeIds.some(t => t.id === newThemeId)) {\n appThemeApi.setActiveThemeId(newThemeId);\n } else {\n appThemeApi.setActiveThemeId(undefined);\n }\n\n setAnchorEl(undefined);\n };\n\n const handleClose = () => {\n setAnchorEl(undefined);\n };\n\n const ActiveIcon = useCallback(\n () => <ThemeIcon icon={activeTheme?.icon} />,\n [activeTheme],\n );\n\n return (\n <>\n <SidebarItem\n icon={ActiveIcon}\n text=\"Switch Theme\"\n id=\"theme-button\"\n aria-haspopup=\"listbox\"\n aria-controls=\"theme-menu\"\n aria-label=\"switch theme\"\n aria-expanded={open ? 'true' : undefined}\n onClick={handleOpen}\n />\n\n <Menu\n id=\"theme-menu\"\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n MenuListProps={{\n 'aria-labelledby': 'theme-button',\n role: 'listbox',\n }}\n >\n <MenuItem disabled>Choose a theme</MenuItem>\n <MenuItem\n selected={themeId === undefined}\n onClick={() => handleSelectTheme(undefined)}\n >\n <ListItemIcon>\n <ThemeIcon icon={undefined} active={themeId === undefined} />\n </ListItemIcon>\n <ListItemText>Auto</ListItemText>\n </MenuItem>\n\n {themeIds.map(theme => {\n const active = theme.id === themeId;\n return (\n <MenuItem\n key={theme.id}\n selected={active}\n aria-selected={active}\n onClick={() => handleSelectTheme(theme.id)}\n >\n <ListItemIcon>\n <ThemeIcon icon={theme.icon} active={active} />\n </ListItemIcon>\n <ListItemText>{theme.title}</ListItemText>\n </MenuItem>\n );\n })}\n </Menu>\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApp } from '@backstage/app-defaults';\nimport { AppRouter, FlatRoutes } from '@backstage/core-app-api';\nimport {\n AlertDisplay,\n OAuthRequestDialog,\n Sidebar,\n SidebarDivider,\n SidebarItem,\n SidebarPage,\n SidebarSpace,\n SidebarSpacer,\n SignInPage,\n SignInProviderConfig,\n} from '@backstage/core-components';\nimport {\n AnyApiFactory,\n ApiFactory,\n AppTheme,\n attachComponentData,\n BackstagePlugin,\n configApiRef,\n createApiFactory,\n createRouteRef,\n IconComponent,\n RouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n ScmIntegrationsApi,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport Box from '@material-ui/core/Box';\nimport BookmarkIcon from '@material-ui/icons/Bookmark';\nimport React, { ComponentType, PropsWithChildren, ReactNode } from 'react';\nimport { createRoutesFromChildren, Route } from 'react-router-dom';\nimport { SidebarThemeSwitcher } from './SidebarThemeSwitcher';\nimport 'react-dom';\nimport { SidebarSignOutButton } from '../components';\n\nlet ReactDOMPromise: Promise<\n typeof import('react-dom') | typeof import('react-dom/client')\n>;\nif (process.env.HAS_REACT_DOM_CLIENT) {\n ReactDOMPromise = import('react-dom/client');\n} else {\n ReactDOMPromise = import('react-dom');\n}\n\nexport function isReactRouterBeta(): boolean {\n const [obj] = createRoutesFromChildren(<Route index element={<div />} />);\n return !obj.index;\n}\n\nconst MaybeGatheringRoute: (props: {\n path: string;\n element: JSX.Element;\n children?: ReactNode;\n}) => JSX.Element = ({ element }) => element;\n\nif (isReactRouterBeta()) {\n attachComponentData(MaybeGatheringRoute, 'core.gatherMountPoints', true);\n}\n\n/** @public */\nexport type DevAppPageOptions = {\n path?: string;\n element: JSX.Element;\n children?: JSX.Element;\n title?: string;\n icon?: IconComponent;\n};\n\n/**\n * DevApp builder that is similar to the App builder API, but creates an App\n * with the purpose of developing one or more plugins inside it.\n *\n * @public\n */\nexport class DevAppBuilder {\n private readonly plugins = new Array<BackstagePlugin>();\n private readonly apis = new Array<AnyApiFactory>();\n private readonly rootChildren = new Array<ReactNode>();\n private readonly routes = new Array<JSX.Element>();\n private readonly sidebarItems = new Array<JSX.Element>();\n private readonly signInProviders = new Array<SignInProviderConfig>();\n\n private defaultPage?: string;\n private themes?: Array<AppTheme>;\n\n /**\n * Register one or more plugins to render in the dev app\n */\n registerPlugin(...plugins: BackstagePlugin[]): DevAppBuilder {\n this.plugins.push(...plugins);\n return this;\n }\n\n /**\n * Register an API factory to add to the app\n */\n registerApi<\n Api,\n Impl extends Api,\n Deps extends { [name in string]: unknown },\n >(factory: ApiFactory<Api, Impl, Deps>): DevAppBuilder {\n this.apis.push(factory);\n return this;\n }\n\n /**\n * Adds a React node to place just inside the App Provider.\n *\n * Useful for adding more global components like the AlertDisplay.\n */\n addRootChild(node: ReactNode): DevAppBuilder {\n this.rootChildren.push(node);\n return this;\n }\n\n /**\n * Adds a new sidebar item to the dev app.\n *\n * Useful for adding only sidebar items without a corresponding page.\n */\n addSidebarItem(sidebarItem: JSX.Element): DevAppBuilder {\n this.sidebarItems.push(sidebarItem);\n return this;\n }\n\n /**\n * Adds a page component along with accompanying sidebar item.\n *\n * If no path is provided one will be generated.\n * If no title is provided, no sidebar item will be created.\n */\n addPage(opts: DevAppPageOptions): DevAppBuilder {\n const path = opts.path ?? `/page-${this.routes.length + 1}`;\n\n if (!this.defaultPage || path === '/') {\n this.defaultPage = path;\n }\n\n if (opts.title) {\n this.sidebarItems.push(\n <SidebarItem\n key={path}\n to={path}\n text={opts.title}\n icon={opts.icon ?? BookmarkIcon}\n />,\n );\n }\n\n this.routes.push(\n <MaybeGatheringRoute\n key={path}\n path={path}\n element={opts.element}\n children={opts.children}\n />,\n );\n return this;\n }\n\n /**\n * Adds an array of themes to override the default theme.\n */\n addThemes(themes: AppTheme[]) {\n this.themes = themes;\n return this;\n }\n\n /**\n * Adds new sign in provider for the dev app\n */\n addSignInProvider(provider: SignInProviderConfig) {\n this.signInProviders.push(provider);\n return this;\n }\n\n /**\n * Build a DevApp component using the resources registered so far\n */\n build(): ComponentType<PropsWithChildren<{}>> {\n const fakeRouteRef = createRouteRef({ id: 'fake' });\n const FakePage = () => <Box p={3}>Page belonging to another plugin.</Box>;\n attachComponentData(FakePage, 'core.mountPoint', fakeRouteRef);\n\n const apis = [...this.apis];\n if (!apis.some(api => api.api.id === scmIntegrationsApiRef.id)) {\n apis.push(\n createApiFactory({\n api: scmIntegrationsApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),\n }),\n );\n }\n\n const app = createApp({\n apis,\n plugins: this.plugins,\n themes: this.themes,\n components: {\n SignInPage: props => {\n return (\n <SignInPage\n {...props}\n providers={['guest', ...this.signInProviders]}\n title=\"Select a sign-in method\"\n align=\"center\"\n />\n );\n },\n },\n bindRoutes: ({ bind }) => {\n for (const plugin of this.plugins ?? []) {\n const targets: Record<string, RouteRef<any>> = {};\n for (const routeKey of Object.keys(plugin.externalRoutes)) {\n targets[routeKey] = fakeRouteRef;\n }\n bind(plugin.externalRoutes, targets);\n }\n },\n });\n\n const DevApp = (\n <>\n <AlertDisplay />\n <OAuthRequestDialog />\n {this.rootChildren}\n <AppRouter>\n <SidebarPage>\n <Sidebar>\n <SidebarSpacer />\n {this.sidebarItems}\n <SidebarSpace />\n <SidebarDivider />\n <SidebarThemeSwitcher />\n <SidebarSignOutButton />\n </Sidebar>\n <FlatRoutes>\n {this.routes}\n <Route path=\"/_external_route\" element={<FakePage />} />\n </FlatRoutes>\n </SidebarPage>\n </AppRouter>\n </>\n );\n\n return app.createRoot(DevApp);\n }\n\n /**\n * Build and render directory to #root element, with react hot loading.\n */\n render(): void {\n const DevApp = this.build();\n\n if (\n window.location.pathname === '/' &&\n this.defaultPage &&\n this.defaultPage !== '/'\n ) {\n window.location.pathname = this.defaultPage;\n }\n\n ReactDOMPromise.then(ReactDOM => {\n if ('createRoot' in ReactDOM) {\n ReactDOM.createRoot(document.getElementById('root')!).render(\n <DevApp />,\n );\n } else {\n ReactDOM.render(<DevApp />, document.getElementById('root'));\n }\n });\n }\n}\n\n// TODO(rugvip): Figure out patterns for how to allow in-house apps to build upon\n// this to provide their own plugin dev wrappers.\n\n/**\n * Creates a dev app for rendering one or more plugins and exposing the touch points of the plugin.\n *\n * @public\n */\nexport function createDevApp() {\n return new DevAppBuilder();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,SAAA,GAAY,WAAsC,CAAU,KAAA,MAAA;AAAA,EAChE,IAAM,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,IACrB,QAAU,EAAA,UAAA;AAAA,IAEV,WAAa,EAAA;AAAA,MACX,OAAS,EAAA,CAAA,CAAA,EAAI,MAAO,CAAA,QAAA,CAAS,IAAI,CAAA,CAAA,CAAA;AAAA,MACjC,GAAK,EAAA,CAAC,KAAM,CAAA,UAAA,CAAW,QAAW,GAAA,CAAA;AAAA,MAClC,OAAS,EAAA,OAAA;AAAA,MACT,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,MAAM,OAAQ,CAAA,UAAA;AAAA,KACvB;AAAA,GACF,CAAA;AACF,CAAE,CAAA,CAAA,CAAA;AAGW,MAAA,cAAA,GAAiB,CAC5B,KACgB,KAAA;AAChB,EAAA,MAAM,EAAE,MAAA,EAAQ,OAAS,EAAA,GAAG,MAAS,GAAA,KAAA,CAAA;AACrC,EAAA,MAAM,WAAc,GAAA,SAAA,CAAU,EAAE,MAAA,EAAQ,CAAA,CAAA;AAExC,EAAA,2CACG,cAAe,EAAA,EAAA,MAAA,EAAA,kBACb,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAE,IAA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M,EAAA,CAAA;AAE1B,IACE,IAAA,MAAA,CAAO,SAAS,QAAa,KAAA,GAAA,IAC7B,KAAK,WACL,IAAA,IAAA,CAAK,gBAAgB,GACrB,EAAA;AACA,MAAO,MAAA,CAAA,QAAA,CAAS,WAAW,IAAK,CAAA,WAAA,CAAA;AAAA,KAClC;AAEA,IAAA,eAAA,CAAgB,KAAK,CAAY,QAAA,KAAA;AAC/B,MAAA,IAAI,gBAAgB,QAAU,EAAA;AAC5B,QAAA,QAAA,CAAS,UAAW,CAAA,QAAA,CAAS,cAAe,CAAA,MAAM,CAAE,CAAE,CAAA,MAAA;AAAA,8CACnD,MAAO,EAAA,IAAA,CAAA;AAAA,SACV,CAAA;AAAA,OACK,MAAA;AACL,QAAA,QAAA,CAAS,uBAAQ,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAO,GAAI,QAAS,CAAA,cAAA,CAAe,MAAM,CAAC,CAAA,CAAA;AAAA,OAC7D;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAA;AAUO,SAAS,YAAe,GAAA;AAC7B,EAAA,OAAO,IAAI,aAAc,EAAA,CAAA;AAC3B;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/dev-utils",
|
|
3
|
-
"version": "1.0.31
|
|
3
|
+
"version": "1.0.31",
|
|
4
4
|
"description": "Utilities for developing Backstage plugins.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library"
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"test": "backstage-cli package test"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@backstage/app-defaults": "^1.5.4
|
|
39
|
+
"@backstage/app-defaults": "^1.5.4",
|
|
40
40
|
"@backstage/catalog-model": "^1.4.5",
|
|
41
|
-
"@backstage/core-app-api": "^1.12.
|
|
42
|
-
"@backstage/core-components": "^0.14.4
|
|
43
|
-
"@backstage/core-plugin-api": "^1.9.
|
|
44
|
-
"@backstage/integration-react": "^1.1.26
|
|
45
|
-
"@backstage/plugin-catalog-react": "^1.11.3
|
|
46
|
-
"@backstage/theme": "^0.5.
|
|
41
|
+
"@backstage/core-app-api": "^1.12.4",
|
|
42
|
+
"@backstage/core-components": "^0.14.4",
|
|
43
|
+
"@backstage/core-plugin-api": "^1.9.2",
|
|
44
|
+
"@backstage/integration-react": "^1.1.26",
|
|
45
|
+
"@backstage/plugin-catalog-react": "^1.11.3",
|
|
46
|
+
"@backstage/theme": "^0.5.3",
|
|
47
47
|
"@material-ui/core": "^4.12.2",
|
|
48
48
|
"@material-ui/icons": "^4.9.1",
|
|
49
49
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
50
50
|
"react-use": "^17.2.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@backstage/cli": "^0.26.3
|
|
54
|
-
"@backstage/test-utils": "^1.5.
|
|
55
|
-
"@testing-library/dom": "^
|
|
53
|
+
"@backstage/cli": "^0.26.3",
|
|
54
|
+
"@backstage/test-utils": "^1.5.4",
|
|
55
|
+
"@testing-library/dom": "^10.0.0",
|
|
56
56
|
"@testing-library/jest-dom": "^6.0.0",
|
|
57
|
-
"@testing-library/react": "^
|
|
57
|
+
"@testing-library/react": "^15.0.0",
|
|
58
58
|
"@testing-library/user-event": "^14.0.0",
|
|
59
59
|
"zen-observable": "^0.10.0"
|
|
60
60
|
},
|