@backstage/plugin-catalog-react 1.12.3-next.0 → 1.12.3-next.2
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 +39 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +8 -4
- package/dist/alpha.esm.js +2 -2
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/EntityDisplayName/EntityDisplayName.esm.js +3 -1
- package/dist/components/EntityDisplayName/EntityDisplayName.esm.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 1.12.3-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 012e3eb: Entity page extensions created for the new frontend system via the `/alpha` exports will now be enabled by default.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.7.0-next.2
|
|
10
|
+
- @backstage/plugin-permission-common@0.8.1-next.1
|
|
11
|
+
- @backstage/plugin-catalog-common@1.0.26-next.1
|
|
12
|
+
- @backstage/plugin-permission-react@0.4.25-next.1
|
|
13
|
+
- @backstage/catalog-client@1.6.5
|
|
14
|
+
- @backstage/catalog-model@1.5.0
|
|
15
|
+
- @backstage/core-components@0.14.10-next.0
|
|
16
|
+
- @backstage/core-plugin-api@1.9.3
|
|
17
|
+
- @backstage/errors@1.2.4
|
|
18
|
+
- @backstage/integration-react@1.1.30-next.0
|
|
19
|
+
- @backstage/types@1.1.1
|
|
20
|
+
- @backstage/version-bridge@1.0.8
|
|
21
|
+
|
|
22
|
+
## 1.12.3-next.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 7ca331c: Correct `EntityDisplayName`'s icon alignment with the text.
|
|
27
|
+
- 6349099: Added config input type to the extensions
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
- @backstage/plugin-permission-common@0.8.1-next.0
|
|
30
|
+
- @backstage/frontend-plugin-api@0.6.8-next.1
|
|
31
|
+
- @backstage/plugin-catalog-common@1.0.26-next.0
|
|
32
|
+
- @backstage/plugin-permission-react@0.4.25-next.0
|
|
33
|
+
- @backstage/catalog-client@1.6.5
|
|
34
|
+
- @backstage/catalog-model@1.5.0
|
|
35
|
+
- @backstage/core-components@0.14.10-next.0
|
|
36
|
+
- @backstage/core-plugin-api@1.9.3
|
|
37
|
+
- @backstage/errors@1.2.4
|
|
38
|
+
- @backstage/integration-react@1.1.30-next.0
|
|
39
|
+
- @backstage/types@1.1.1
|
|
40
|
+
- @backstage/version-bridge@1.0.8
|
|
41
|
+
|
|
3
42
|
## 1.12.3-next.0
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -98,9 +98,9 @@ declare const catalogReactTranslationRef: _backstage_core_plugin_api_alpha.Trans
|
|
|
98
98
|
|
|
99
99
|
/** @alpha */
|
|
100
100
|
declare const catalogExtensionData: {
|
|
101
|
-
entityContentTitle: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<"catalog.entity-content-title",
|
|
102
|
-
entityFilterFunction: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
103
|
-
entityFilterExpression: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<"catalog.entity-filter-expression",
|
|
101
|
+
entityContentTitle: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}>;
|
|
102
|
+
entityFilterFunction: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {}>;
|
|
103
|
+
entityFilterExpression: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {}>;
|
|
104
104
|
};
|
|
105
105
|
/** @alpha */
|
|
106
106
|
declare function createEntityCardExtension<TConfig extends {
|
|
@@ -120,7 +120,7 @@ declare function createEntityCardExtension<TConfig extends {
|
|
|
120
120
|
config: TConfig;
|
|
121
121
|
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
|
122
122
|
}) => Promise<JSX.Element>;
|
|
123
|
-
}): _backstage_frontend_plugin_api.ExtensionDefinition<TConfig>;
|
|
123
|
+
}): _backstage_frontend_plugin_api.ExtensionDefinition<TConfig & {}, TConfig & {}>;
|
|
124
124
|
/** @alpha */
|
|
125
125
|
declare function createEntityContentExtension<TInputs extends AnyExtensionInputMap>(options: {
|
|
126
126
|
namespace?: string;
|
|
@@ -142,6 +142,10 @@ declare function createEntityContentExtension<TInputs extends AnyExtensionInputM
|
|
|
142
142
|
title: string;
|
|
143
143
|
path: string;
|
|
144
144
|
filter?: string | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
filter?: string | undefined;
|
|
147
|
+
title?: string | undefined;
|
|
148
|
+
path?: string | undefined;
|
|
145
149
|
}>;
|
|
146
150
|
|
|
147
151
|
export { catalogExtensionData, catalogReactTranslationRef, createEntityCardExtension, createEntityContentExtension, isOwnerOf, useEntityPermission };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -28,7 +28,7 @@ function createEntityCardExtension(options) {
|
|
|
28
28
|
id: "entity-content:catalog/overview",
|
|
29
29
|
input: "cards"
|
|
30
30
|
},
|
|
31
|
-
disabled: options.disabled
|
|
31
|
+
disabled: options.disabled,
|
|
32
32
|
output: {
|
|
33
33
|
element: coreExtensionData.reactElement,
|
|
34
34
|
filterFunction: catalogExtensionData.entityFilterFunction.optional(),
|
|
@@ -56,7 +56,7 @@ function createEntityContentExtension(options) {
|
|
|
56
56
|
id: "page:catalog/entity",
|
|
57
57
|
input: "contents"
|
|
58
58
|
},
|
|
59
|
-
disabled: options.disabled
|
|
59
|
+
disabled: options.disabled,
|
|
60
60
|
output: {
|
|
61
61
|
element: coreExtensionData.reactElement,
|
|
62
62
|
path: coreExtensionData.routePath,
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {\n AnyExtensionInputMap,\n ExtensionBoundary,\n PortableSchema,\n ResolvedExtensionInputs,\n RouteRef,\n coreExtensionData,\n createExtension,\n createExtensionDataRef,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport React, { lazy } from 'react';\nimport { Entity } from '@backstage/catalog-model';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { Expand } from '../../../packages/frontend-plugin-api/src/types';\n\nexport { useEntityPermission } from './hooks/useEntityPermission';\nexport { isOwnerOf } from './utils';\nexport * from './translation';\n\n/** @alpha */\nexport const catalogExtensionData = {\n entityContentTitle: createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n }),\n entityFilterFunction: createExtensionDataRef<\n (entity: Entity) => boolean\n >().with({ id: 'catalog.entity-filter-function' }),\n entityFilterExpression: createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n }),\n};\n\n// TODO: Figure out how to merge with provided config schema\n/** @alpha */\nexport function createEntityCardExtension<\n TConfig extends { filter?: string },\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n configSchema?: PortableSchema<TConfig>;\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n}) {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({\n filter: z.string().optional(),\n }),\n ) as PortableSchema<TConfig>);\n return createExtension({\n kind: 'entity-card',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'entity-content:catalog/overview',\n input: 'cards',\n },\n disabled: options.disabled
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {\n AnyExtensionInputMap,\n ExtensionBoundary,\n PortableSchema,\n ResolvedExtensionInputs,\n RouteRef,\n coreExtensionData,\n createExtension,\n createExtensionDataRef,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport React, { lazy } from 'react';\nimport { Entity } from '@backstage/catalog-model';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { Expand } from '../../../packages/frontend-plugin-api/src/types';\n\nexport { useEntityPermission } from './hooks/useEntityPermission';\nexport { isOwnerOf } from './utils';\nexport * from './translation';\n\n/** @alpha */\nexport const catalogExtensionData = {\n entityContentTitle: createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n }),\n entityFilterFunction: createExtensionDataRef<\n (entity: Entity) => boolean\n >().with({ id: 'catalog.entity-filter-function' }),\n entityFilterExpression: createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n }),\n};\n\n// TODO: Figure out how to merge with provided config schema\n/** @alpha */\nexport function createEntityCardExtension<\n TConfig extends { filter?: string },\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n configSchema?: PortableSchema<TConfig>;\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n}) {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({\n filter: z.string().optional(),\n }),\n ) as PortableSchema<TConfig>);\n return createExtension({\n kind: 'entity-card',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'entity-content:catalog/overview',\n input: 'cards',\n },\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n filterFunction: catalogExtensionData.entityFilterFunction.optional(),\n filterExpression: catalogExtensionData.entityFilterExpression.optional(),\n },\n inputs: options.inputs,\n configSchema,\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ inputs, config })\n .then(element => ({ default: () => element })),\n );\n\n return {\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n ...mergeFilters({ config, options }),\n };\n },\n });\n}\n\n/** @alpha */\nexport function createEntityContentExtension<\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n routeRef?: RouteRef;\n defaultPath: string;\n defaultTitle: string;\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n loader: (options: {\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n}) {\n return createExtension({\n kind: 'entity-content',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'page:catalog/entity',\n input: 'contents',\n },\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n path: coreExtensionData.routePath,\n routeRef: coreExtensionData.routeRef.optional(),\n title: catalogExtensionData.entityContentTitle,\n filterFunction: catalogExtensionData.entityFilterFunction.optional(),\n filterExpression: catalogExtensionData.entityFilterExpression.optional(),\n },\n inputs: options.inputs,\n configSchema: createSchemaFromZod(z =>\n z.object({\n path: z.string().default(options.defaultPath),\n title: z.string().default(options.defaultTitle),\n filter: z.string().optional(),\n }),\n ),\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ inputs })\n .then(element => ({ default: () => element })),\n );\n\n return {\n path: config.path,\n title: config.title,\n routeRef: options.routeRef,\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n ...mergeFilters({ config, options }),\n };\n },\n });\n}\n\n/**\n * Decides what filter outputs to produce, given some options and config\n */\nfunction mergeFilters(inputs: {\n options: {\n filter?:\n | typeof catalogExtensionData.entityFilterFunction.T\n | typeof catalogExtensionData.entityFilterExpression.T;\n };\n config: {\n filter?: string;\n };\n}): {\n filterFunction?: typeof catalogExtensionData.entityFilterFunction.T;\n filterExpression?: typeof catalogExtensionData.entityFilterExpression.T;\n} {\n const { options, config } = inputs;\n if (config.filter) {\n return { filterExpression: config.filter };\n } else if (typeof options.filter === 'string') {\n return { filterExpression: options.filter };\n } else if (typeof options.filter === 'function') {\n return { filterFunction: options.filter };\n }\n return {};\n}\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,oBAAuB,GAAA;AAAA,EAClC,kBAAA,EAAoB,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,IACxD,EAAI,EAAA,8BAAA;AAAA,GACL,CAAA;AAAA,EACD,sBAAsB,sBAEpB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC,CAAA;AAAA,EACjD,sBAAA,EAAwB,sBAA+B,EAAA,CAAE,IAAK,CA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"EntityDisplayName.esm.js","sources":["../../../src/components/EntityDisplayName/EntityDisplayName.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { CompoundEntityRef, Entity } from '@backstage/catalog-model';\nimport Box from '@material-ui/core/Box';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { useEntityPresentation } from '../../apis';\n\n/**\n * The available style class keys for {@link EntityDisplayName}, under the name\n * \"CatalogReactEntityDisplayName\".\n *\n * @public\n */\nexport type CatalogReactEntityDisplayNameClassKey = 'root' | 'icon';\n\nconst useStyles = makeStyles(\n (theme: Theme) => ({\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n },\n icon: {\n marginRight: theme.spacing(0.5),\n color: theme.palette.text.secondary,\n
|
|
1
|
+
{"version":3,"file":"EntityDisplayName.esm.js","sources":["../../../src/components/EntityDisplayName/EntityDisplayName.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { CompoundEntityRef, Entity } from '@backstage/catalog-model';\nimport Box from '@material-ui/core/Box';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { useEntityPresentation } from '../../apis';\n\n/**\n * The available style class keys for {@link EntityDisplayName}, under the name\n * \"CatalogReactEntityDisplayName\".\n *\n * @public\n */\nexport type CatalogReactEntityDisplayNameClassKey = 'root' | 'icon';\n\nconst useStyles = makeStyles(\n (theme: Theme) => ({\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n },\n icon: {\n marginRight: theme.spacing(0.5),\n color: theme.palette.text.secondary,\n '& svg': {\n verticalAlign: 'middle',\n },\n },\n }),\n { name: 'CatalogReactEntityDisplayName' },\n);\n\n/**\n * Props for {@link EntityDisplayName}.\n *\n * @public\n */\nexport type EntityDisplayNameProps = {\n entityRef: Entity | CompoundEntityRef | string;\n hideIcon?: boolean;\n disableTooltip?: boolean;\n defaultKind?: string;\n defaultNamespace?: string;\n};\n\n/**\n * Shows a nice representation of a reference to an entity.\n *\n * @public\n */\nexport const EntityDisplayName = (\n props: EntityDisplayNameProps,\n): JSX.Element => {\n const { entityRef, hideIcon, disableTooltip, defaultKind, defaultNamespace } =\n props;\n\n const classes = useStyles();\n const { primaryTitle, secondaryTitle, Icon } = useEntityPresentation(\n entityRef,\n { defaultKind, defaultNamespace },\n );\n\n // The innermost \"body\" content\n let content = <>{primaryTitle}</>;\n\n // Optionally an icon, and wrapper around them both\n content = (\n <Box component=\"span\" className={classes.root}>\n {Icon && !hideIcon ? (\n <Box component=\"span\" className={classes.icon}>\n <Icon fontSize=\"inherit\" />\n </Box>\n ) : null}\n {content}\n </Box>\n );\n\n // Optionally, a tooltip as the outermost layer\n if (secondaryTitle && !disableTooltip) {\n content = (\n <Tooltip enterDelay={1500} title={secondaryTitle}>\n {content}\n </Tooltip>\n );\n }\n\n return content;\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA+BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAC,KAAkB,MAAA;AAAA,IACjB,IAAM,EAAA;AAAA,MACJ,OAAS,EA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A,EAAO,kBAC/B,OACH,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAO,OAAA,OAAA,CAAA;AACT;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "1.12.3-next.
|
|
3
|
+
"version": "1.12.3-next.2",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"@backstage/core-components": "^0.14.10-next.0",
|
|
62
62
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
63
63
|
"@backstage/errors": "^1.2.4",
|
|
64
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
64
|
+
"@backstage/frontend-plugin-api": "^0.7.0-next.2",
|
|
65
65
|
"@backstage/integration-react": "^1.1.30-next.0",
|
|
66
|
-
"@backstage/plugin-catalog-common": "^1.0.
|
|
67
|
-
"@backstage/plugin-permission-common": "^0.8.
|
|
68
|
-
"@backstage/plugin-permission-react": "^0.4.
|
|
66
|
+
"@backstage/plugin-catalog-common": "^1.0.26-next.1",
|
|
67
|
+
"@backstage/plugin-permission-common": "^0.8.1-next.1",
|
|
68
|
+
"@backstage/plugin-permission-react": "^0.4.25-next.1",
|
|
69
69
|
"@backstage/types": "^1.1.1",
|
|
70
70
|
"@backstage/version-bridge": "^1.0.8",
|
|
71
71
|
"@material-ui/core": "^4.12.2",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"zen-observable": "^0.10.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@backstage/cli": "^0.27.0-next.
|
|
86
|
-
"@backstage/core-app-api": "^1.14.
|
|
87
|
-
"@backstage/plugin-catalog-common": "^1.0.
|
|
88
|
-
"@backstage/plugin-scaffolder-common": "^1.5.
|
|
89
|
-
"@backstage/test-utils": "^1.5.
|
|
85
|
+
"@backstage/cli": "^0.27.0-next.3",
|
|
86
|
+
"@backstage/core-app-api": "^1.14.2-next.0",
|
|
87
|
+
"@backstage/plugin-catalog-common": "^1.0.26-next.1",
|
|
88
|
+
"@backstage/plugin-scaffolder-common": "^1.5.5-next.1",
|
|
89
|
+
"@backstage/test-utils": "^1.5.10-next.2",
|
|
90
90
|
"@testing-library/dom": "^10.0.0",
|
|
91
91
|
"@testing-library/jest-dom": "^6.0.0",
|
|
92
92
|
"@testing-library/react": "^15.0.0",
|