@backstage/dev-utils 0.2.13 → 0.2.17
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 +53 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +12 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +17 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# @backstage/dev-utils
|
|
2
2
|
|
|
3
|
+
## 0.2.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/test-utils@0.2.2
|
|
9
|
+
- @backstage/core-components@0.8.4
|
|
10
|
+
- @backstage/core-plugin-api@0.5.0
|
|
11
|
+
- @backstage/plugin-catalog-react@0.6.11
|
|
12
|
+
- @backstage/core-app-api@0.4.0
|
|
13
|
+
- @backstage/app-defaults@0.1.4
|
|
14
|
+
- @backstage/catalog-model@0.9.9
|
|
15
|
+
- @backstage/integration-react@0.1.18
|
|
16
|
+
|
|
17
|
+
## 0.2.16
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/core-plugin-api@0.4.1
|
|
24
|
+
- @backstage/plugin-catalog-react@0.6.10
|
|
25
|
+
- @backstage/core-app-api@0.3.1
|
|
26
|
+
- @backstage/core-components@0.8.3
|
|
27
|
+
|
|
28
|
+
## 0.2.15
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @backstage/app-defaults@0.1.3
|
|
34
|
+
- @backstage/core-app-api@0.3.0
|
|
35
|
+
- @backstage/core-plugin-api@0.4.0
|
|
36
|
+
- @backstage/plugin-catalog-react@0.6.8
|
|
37
|
+
- @backstage/core-components@0.8.2
|
|
38
|
+
- @backstage/test-utils@0.2.0
|
|
39
|
+
- @backstage/integration-react@0.1.16
|
|
40
|
+
|
|
41
|
+
## 0.2.14
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- cd450844f6: Moved React dependencies to `peerDependencies` and allow both React v16 and v17 to be used.
|
|
46
|
+
- dcd1a0c3f4: Minor improvement to the API reports, by not unpacking arguments directly
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @backstage/core-components@0.8.0
|
|
49
|
+
- @backstage/core-plugin-api@0.3.0
|
|
50
|
+
- @backstage/core-app-api@0.2.0
|
|
51
|
+
- @backstage/app-defaults@0.1.2
|
|
52
|
+
- @backstage/integration-react@0.1.15
|
|
53
|
+
- @backstage/test-utils@0.1.24
|
|
54
|
+
- @backstage/plugin-catalog-react@0.6.5
|
|
55
|
+
|
|
3
56
|
## 0.2.13
|
|
4
57
|
|
|
5
58
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IconComponent, BackstagePlugin, ApiFactory, AppTheme } from '@backstage
|
|
|
5
5
|
import { ReactNode, ComponentType } from 'react';
|
|
6
6
|
|
|
7
7
|
/** @public */
|
|
8
|
-
declare const EntityGridItem: (
|
|
8
|
+
declare const EntityGridItem: (props: Omit<GridProps, 'item' | 'container'> & {
|
|
9
9
|
entity: Entity;
|
|
10
10
|
}) => JSX.Element;
|
|
11
11
|
|
package/dist/index.esm.js
CHANGED
|
@@ -11,10 +11,10 @@ import ReactDOM from 'react-dom';
|
|
|
11
11
|
import { hot } from 'react-hot-loader';
|
|
12
12
|
import { Route } from 'react-router';
|
|
13
13
|
import AutoIcon from '@material-ui/icons/BrightnessAuto';
|
|
14
|
-
import
|
|
14
|
+
import useObservable from 'react-use/lib/useObservable';
|
|
15
15
|
|
|
16
16
|
const useStyles = makeStyles((theme) => ({
|
|
17
|
-
root: ({entity}) => ({
|
|
17
|
+
root: ({ entity }) => ({
|
|
18
18
|
position: "relative",
|
|
19
19
|
"&::before": {
|
|
20
20
|
content: `"${entity.metadata.name}"`,
|
|
@@ -25,22 +25,19 @@ const useStyles = makeStyles((theme) => ({
|
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
}));
|
|
28
|
-
const EntityGridItem = ({
|
|
29
|
-
entity,
|
|
30
|
-
|
|
31
|
-
...rest
|
|
32
|
-
}) => {
|
|
33
|
-
const itemClasses = useStyles({entity});
|
|
28
|
+
const EntityGridItem = (props) => {
|
|
29
|
+
const { entity, classes, ...rest } = props;
|
|
30
|
+
const itemClasses = useStyles({ entity });
|
|
34
31
|
return /* @__PURE__ */ React.createElement(EntityProvider, {
|
|
35
32
|
entity
|
|
36
33
|
}, /* @__PURE__ */ React.createElement(Grid, {
|
|
37
|
-
classes: {root: itemClasses.root, ...classes},
|
|
34
|
+
classes: { root: itemClasses.root, ...classes },
|
|
38
35
|
...rest,
|
|
39
36
|
item: true
|
|
40
37
|
}));
|
|
41
38
|
};
|
|
42
39
|
|
|
43
|
-
const ThemeIcon = ({active, icon}) => icon ? cloneElement(icon, {
|
|
40
|
+
const ThemeIcon = ({ active, icon }) => icon ? cloneElement(icon, {
|
|
44
41
|
color: active ? "primary" : void 0
|
|
45
42
|
}) : /* @__PURE__ */ React.createElement(AutoIcon, {
|
|
46
43
|
color: active ? "primary" : void 0
|
|
@@ -109,7 +106,7 @@ const SidebarThemeSwitcher = () => {
|
|
|
109
106
|
})));
|
|
110
107
|
};
|
|
111
108
|
|
|
112
|
-
const GatheringRoute = ({element}) => element;
|
|
109
|
+
const GatheringRoute = ({ element }) => element;
|
|
113
110
|
attachComponentData(GatheringRoute, "core.gatherMountPoints", true);
|
|
114
111
|
class DevAppBuilder {
|
|
115
112
|
constructor() {
|
|
@@ -158,7 +155,7 @@ class DevAppBuilder {
|
|
|
158
155
|
return this;
|
|
159
156
|
}
|
|
160
157
|
build() {
|
|
161
|
-
const dummyRouteRef = createRouteRef({
|
|
158
|
+
const dummyRouteRef = createRouteRef({ id: "dummy" });
|
|
162
159
|
const DummyPage = () => /* @__PURE__ */ React.createElement(Box, {
|
|
163
160
|
p: 3
|
|
164
161
|
}, "Page belonging to another plugin.");
|
|
@@ -167,15 +164,15 @@ class DevAppBuilder {
|
|
|
167
164
|
if (!apis.some((api) => api.api.id === scmIntegrationsApiRef.id)) {
|
|
168
165
|
apis.push(createApiFactory({
|
|
169
166
|
api: scmIntegrationsApiRef,
|
|
170
|
-
deps: {configApi: configApiRef},
|
|
171
|
-
factory: ({configApi}) => ScmIntegrationsApi.fromConfig(configApi)
|
|
167
|
+
deps: { configApi: configApiRef },
|
|
168
|
+
factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi)
|
|
172
169
|
}));
|
|
173
170
|
}
|
|
174
171
|
const app = createApp({
|
|
175
172
|
apis,
|
|
176
173
|
plugins: this.plugins,
|
|
177
174
|
themes: this.themes,
|
|
178
|
-
bindRoutes: ({bind}) => {
|
|
175
|
+
bindRoutes: ({ bind }) => {
|
|
179
176
|
var _a;
|
|
180
177
|
for (const plugin of (_a = this.plugins) != null ? _a : []) {
|
|
181
178
|
const targets = {};
|
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 { BackstageTheme } from '@backstage/theme';\nimport { Grid, GridProps, makeStyles } from '@material-ui/core';\nimport React from 'react';\n\nconst useStyles = makeStyles<BackstageTheme, { 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 entity,\n classes,\n ...rest\n}: Omit<GridProps, 'item' | 'container'> & { entity: Entity }): JSX.Element => {\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';\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 { 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 } from 'react';\nimport ReactDOM from 'react-dom';\nimport { hot } from 'react-hot-loader';\nimport { Route } from 'react-router';\nimport { SidebarThemeSwitcher } from './SidebarThemeSwitcher';\n\nconst GatheringRoute: (props: {\n path: string;\n element: JSX.Element;\n children?: ReactNode;\n}) => JSX.Element = ({ element }) => element;\n\nattachComponentData(GatheringRoute, 'core.gatherMountPoints', true);\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 <GatheringRoute\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 overide 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<{}> {\n const dummyRouteRef = createRouteRef({ title: 'Page of another plugin' });\n const DummyPage = () => <Box p={3}>Page belonging to another plugin.</Box>;\n attachComponentData(DummyPage, 'core.mountPoint', dummyRouteRef);\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] = dummyRouteRef;\n }\n bind(plugin.externalRoutes, targets);\n }\n },\n });\n\n const AppProvider = app.getProvider();\n const AppRouter = app.getRouter();\n\n const DevApp = () => {\n return (\n <AppProvider>\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={<DummyPage />} />\n </FlatRoutes>\n </SidebarPage>\n </AppRouter>\n </AppProvider>\n );\n };\n\n return DevApp;\n }\n\n /**\n * Build and render directory to #root element, with react hot loading.\n */\n render(): void {\n const hotModule =\n require.cache['./dev/index.tsx'] ??\n require.cache['./dev/index.ts'] ??\n module;\n\n const DevApp = hot(hotModule)(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 ReactDOM.render(<DevApp />, document.getElementById('root'));\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,YAAY,WAA+C;AAAU,EACzE,MAAM,CAAC,CAAE;AAAc,IACrB,UAAU;AAAA,IAEV,aAAa;AAAA,MACX,SAAS,IAAI,OAAO,SAAS;AAAA,MAC7B,KAAK,CAAC,MAAM,WAAW,WAAW;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO,MAAM,QAA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AAAA,QAAmB,6CAAU,WAAD;AAAA;AAAA;AAQpD,WAAO;AAAA;AAAA,EAMT,SAAe;AAjOjB;AAkOI,UAAM,YACJ,oBAAQ,MAAM,uBAAd,YACA,QAAQ,MAAM,sBADd,YAEA;AAEF,UAAM,SAAS,IAAI,WAAW,KAAK;AAEnC,QACE,OAAO,SAAS,aAAa,OAC7B,KAAK,eACL,KAAK,gBAAgB,KACrB;AACA,aAAO,SAAS,WAAW,KAAK;AAAA;AAGlC,aAAS,2CAAQ,QAAD,OAAY,SAAS,eAAe;AAAA;AAAA;wBAYzB;AAC7B,SAAO,IAAI;AAAA;;;;"}
|
|
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 { BackstageTheme } from '@backstage/theme';\nimport { Grid, GridProps, makeStyles } from '@material-ui/core';\nimport React from 'react';\n\nconst useStyles = makeStyles<BackstageTheme, { 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/lib/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 { 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 } from 'react';\nimport ReactDOM from 'react-dom';\nimport { hot } from 'react-hot-loader';\nimport { Route } from 'react-router';\nimport { SidebarThemeSwitcher } from './SidebarThemeSwitcher';\n\nconst GatheringRoute: (props: {\n path: string;\n element: JSX.Element;\n children?: ReactNode;\n}) => JSX.Element = ({ element }) => element;\n\nattachComponentData(GatheringRoute, 'core.gatherMountPoints', true);\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 <GatheringRoute\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 overide 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<{}> {\n const dummyRouteRef = createRouteRef({ id: 'dummy' });\n const DummyPage = () => <Box p={3}>Page belonging to another plugin.</Box>;\n attachComponentData(DummyPage, 'core.mountPoint', dummyRouteRef);\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] = dummyRouteRef;\n }\n bind(plugin.externalRoutes, targets);\n }\n },\n });\n\n const AppProvider = app.getProvider();\n const AppRouter = app.getRouter();\n\n const DevApp = () => {\n return (\n <AppProvider>\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={<DummyPage />} />\n </FlatRoutes>\n </SidebarPage>\n </AppRouter>\n </AppProvider>\n );\n };\n\n return DevApp;\n }\n\n /**\n * Build and render directory to #root element, with react hot loading.\n */\n render(): void {\n const hotModule =\n require.cache['./dev/index.tsx'] ??\n require.cache['./dev/index.ts'] ??\n module;\n\n const DevApp = hot(hotModule)(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 ReactDOM.render(<DevApp />, document.getElementById('root'));\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,YAAY,WAA+C;AAAU,EACzE,MAAM,CAAC,EAAE;AAAc,IACrB,UAAU;AAAA,IAEV,aAAa;AAAA,MACX,SAAS,IAAI,OAAO,SAAS;AAAA,MAC7B,KAAK,CAAC,MAAM,WAAW,WAAW;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO,MAAM,QAAQ;AAAA;AAAA;AAAA;MAMd,iBAAiB,CAC5B,UACgB;AAChB,QAAM,EAAE,QAAQ,YAAY,SAAS;AACrC,QAAM,cAAc,UAAU,EAAE;AAEhC,6CACG,gBAAD;AAAA,IAAgB;AAAA,yCACb,MAAD;AAAA,IAAM,SAAS,EAAE,MAAM,YAAY,SAAS;AAAA,OAAe;AAAA,IAAM,MAAI;AAAA;AAAA;;AClB3E,MAAM,YAAY,CAAC,EAAE,QAAQ,WAC3B,OACE,aAAa,MAAM;AAAA,EACjB,OAAO,SAAS,YAAY;AAAA,yCAG7B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7B,SAAO,IAAI;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/dev-utils",
|
|
3
3
|
"description": "Utilities for developing Backstage plugins.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.17",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -29,36 +29,38 @@
|
|
|
29
29
|
"clean": "backstage-cli clean"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@backstage/app-defaults": "^0.1.
|
|
33
|
-
"@backstage/catalog-model": "^0.9.
|
|
34
|
-
"@backstage/core-app-api": "^0.
|
|
35
|
-
"@backstage/core-components": "^0.
|
|
36
|
-
"@backstage/core-plugin-api": "^0.
|
|
37
|
-
"@backstage/integration-react": "^0.1.
|
|
38
|
-
"@backstage/plugin-catalog-react": "^0.6.
|
|
39
|
-
"@backstage/test-utils": "^0.
|
|
40
|
-
"@backstage/theme": "^0.2.
|
|
32
|
+
"@backstage/app-defaults": "^0.1.4",
|
|
33
|
+
"@backstage/catalog-model": "^0.9.9",
|
|
34
|
+
"@backstage/core-app-api": "^0.4.0",
|
|
35
|
+
"@backstage/core-components": "^0.8.4",
|
|
36
|
+
"@backstage/core-plugin-api": "^0.5.0",
|
|
37
|
+
"@backstage/integration-react": "^0.1.18",
|
|
38
|
+
"@backstage/plugin-catalog-react": "^0.6.11",
|
|
39
|
+
"@backstage/test-utils": "^0.2.2",
|
|
40
|
+
"@backstage/theme": "^0.2.14",
|
|
41
41
|
"@material-ui/core": "^4.12.2",
|
|
42
42
|
"@material-ui/icons": "^4.9.1",
|
|
43
43
|
"@testing-library/jest-dom": "^5.10.1",
|
|
44
44
|
"@testing-library/react": "^11.2.5",
|
|
45
45
|
"@testing-library/user-event": "^13.1.8",
|
|
46
|
-
"@types/react": "*",
|
|
47
|
-
"react": "^16.12.0",
|
|
48
|
-
"react-dom": "^16.12.0",
|
|
49
46
|
"react-hot-loader": "^4.12.21",
|
|
50
47
|
"react-router": "6.0.0-beta.0",
|
|
51
48
|
"react-router-dom": "6.0.0-beta.0",
|
|
52
49
|
"react-use": "^17.2.4",
|
|
53
50
|
"zen-observable": "^0.8.15"
|
|
54
51
|
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@types/react": "^16.13.1 || ^17.0.0",
|
|
54
|
+
"react": "^16.13.1 || ^17.0.0",
|
|
55
|
+
"react-dom": "^16.13.1 || ^17.0.0"
|
|
56
|
+
},
|
|
55
57
|
"devDependencies": {
|
|
56
|
-
"@backstage/cli": "^0.
|
|
58
|
+
"@backstage/cli": "^0.11.0",
|
|
57
59
|
"@types/jest": "^26.0.7",
|
|
58
60
|
"@types/node": "^14.14.32"
|
|
59
61
|
},
|
|
60
62
|
"files": [
|
|
61
63
|
"dist"
|
|
62
64
|
],
|
|
63
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "da66c61bdd63cdb3f0f0cd2e26dc9e6454d93c7b"
|
|
64
66
|
}
|