@backstage/plugin-app 0.3.5 → 0.4.0-next.1

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 CHANGED
@@ -1,14 +1,42 @@
1
1
  # @backstage/plugin-app
2
2
 
3
- ## 0.3.5
3
+ ## 0.4.0-next.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 5683c85: Bump to latest zod to ensure it has the latest features
8
7
  - Updated dependencies
9
- - @backstage/frontend-plugin-api@0.13.4
10
- - @backstage/core-components@0.18.6
11
- - @backstage/core-plugin-api@1.12.2
8
+ - @backstage/theme@0.7.2-next.0
9
+ - @backstage/frontend-plugin-api@0.14.0-next.1
10
+ - @backstage/core-components@0.18.7-next.1
11
+ - @backstage/integration-react@1.2.15-next.1
12
+
13
+ ## 0.4.0-next.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 7edb810: **BREAKING**: Extensions created with the following blueprints must now be provided via an override or a module for the `app` plugin. Extensions from other plugins will now trigger a warning in the app and be ignored.
18
+
19
+ - `IconBundleBlueprint`
20
+ - `NavContentBlueprint`
21
+ - `RouterBlueprint`
22
+ - `SignInPageBlueprint`
23
+ - `SwappableComponentBlueprint`
24
+ - `ThemeBlueprint`
25
+ - `TranslationBlueprint`
26
+
27
+ ### Patch Changes
28
+
29
+ - 69d880e: Bump to latest zod to ensure it has the latest features
30
+ - Updated dependencies
31
+ - @backstage/core-components@0.18.6-next.0
32
+ - @backstage/frontend-plugin-api@0.14.0-next.0
33
+ - @backstage/core-plugin-api@1.12.2-next.0
34
+ - @backstage/plugin-app-react@0.1.1-next.0
35
+ - @backstage/integration-react@1.2.15-next.0
36
+ - @backstage/theme@0.7.1
37
+ - @backstage/types@1.2.2
38
+ - @backstage/version-bridge@1.0.11
39
+ - @backstage/plugin-permission-react@0.4.40-next.0
12
40
 
13
41
  ## 0.3.4
14
42
 
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultSwappableComponentsApi.esm.js","sources":["../../../src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.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 SwappableComponentRef,\n SwappableComponentsApi,\n SwappableComponentBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { OpaqueSwappableComponentRef } from '@internal/frontend';\n\nimport { lazy } from 'react';\n\n/**\n * Implementation for the {@link SwappableComponentsApi}\n *\n * @internal\n */\nexport class DefaultSwappableComponentsApi implements SwappableComponentsApi {\n #components: Map<string, ((props: object) => JSX.Element | null) | undefined>;\n\n static fromComponents(\n components: Array<typeof SwappableComponentBlueprint.dataRefs.component.T>,\n ) {\n return new DefaultSwappableComponentsApi(\n new Map(\n components.map(entry => {\n return [\n entry.ref.id,\n entry.loader\n ? lazy(async () => ({\n default: await entry.loader!(),\n }))\n : undefined,\n ];\n }),\n ),\n );\n }\n\n constructor(components: Map<string, any>) {\n this.#components = components;\n }\n\n getComponent(\n ref: SwappableComponentRef<any>,\n ): (props: object) => JSX.Element | null {\n const OverrideComponent = this.#components.get(ref.id);\n const { defaultComponent: DefaultComponent, transformProps } =\n OpaqueSwappableComponentRef.toInternal(ref);\n\n return (props: object) => {\n const innerProps = transformProps?.(props) ?? props;\n\n if (OverrideComponent) {\n return <OverrideComponent {...innerProps} />;\n }\n\n return <DefaultComponent {...innerProps} />;\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA8BO,MAAM,6BAAA,CAAgE;AAAA,EAC3E,WAAA;AAAA,EAEA,OAAO,eACL,UAAA,EACA;AACA,IAAA,OAAO,IAAI,6BAAA;AAAA,MACT,IAAI,GAAA;AAAA,QACF,UAAA,CAAW,IAAI,CAAA,KAAA,KAAS;AACtB,UAAA,OAAO;AAAA,YACL,MAAM,GAAA,CAAI,EAAA;AAAA,YACV,KAAA,CAAM,MAAA,GACF,IAAA,CAAK,aAAa;AAAA,cAChB,OAAA,EAAS,MAAM,KAAA,CAAM,MAAA;AAAQ,cAC7B,CAAA,GACF;AAAA,WACN;AAAA,QACF,CAAC;AAAA;AACH,KACF;AAAA,EACF;AAAA,EAEA,YAAY,UAAA,EAA8B;AACxC,IAAA,IAAA,CAAK,WAAA,GAAc,UAAA;AAAA,EACrB;AAAA,EAEA,aACE,GAAA,EACuC;AACvC,IAAA,MAAM,iBAAA,GAAoB,IAAA,CAAK,WAAA,CAAY,GAAA,CAAI,IAAI,EAAE,CAAA;AACrD,IAAA,MAAM,EAAE,gBAAA,EAAkB,gBAAA,EAAkB,gBAAe,GACzD,2BAAA,CAA4B,WAAW,GAAG,CAAA;AAE5C,IAAA,OAAO,CAAC,KAAA,KAAkB;AACxB,MAAA,MAAM,UAAA,GAAa,cAAA,GAAiB,KAAK,CAAA,IAAK,KAAA;AAE9C,MAAA,IAAI,iBAAA,EAAmB;AACrB,QAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,UAAA,EAAY,CAAA;AAAA,MAC5C;AAEA,MAAA,uBAAO,GAAA,CAAC,gBAAA,EAAA,EAAkB,GAAG,UAAA,EAAY,CAAA;AAAA,IAC3C,CAAA;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"DefaultSwappableComponentsApi.esm.js","sources":["../../../src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.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 SwappableComponentRef,\n SwappableComponentsApi,\n} from '@backstage/frontend-plugin-api';\nimport { SwappableComponentBlueprint } from '@backstage/plugin-app-react';\nimport { OpaqueSwappableComponentRef } from '@internal/frontend';\n\nimport { lazy } from 'react';\n\n/**\n * Implementation for the {@link SwappableComponentsApi}\n *\n * @internal\n */\nexport class DefaultSwappableComponentsApi implements SwappableComponentsApi {\n #components: Map<string, ((props: object) => JSX.Element | null) | undefined>;\n\n static fromComponents(\n components: Array<typeof SwappableComponentBlueprint.dataRefs.component.T>,\n ) {\n return new DefaultSwappableComponentsApi(\n new Map(\n components.map(entry => {\n return [\n entry.ref.id,\n entry.loader\n ? lazy(async () => ({\n default: await entry.loader!(),\n }))\n : undefined,\n ];\n }),\n ),\n );\n }\n\n constructor(components: Map<string, any>) {\n this.#components = components;\n }\n\n getComponent(\n ref: SwappableComponentRef<any>,\n ): (props: object) => JSX.Element | null {\n const OverrideComponent = this.#components.get(ref.id);\n const { defaultComponent: DefaultComponent, transformProps } =\n OpaqueSwappableComponentRef.toInternal(ref);\n\n return (props: object) => {\n const innerProps = transformProps?.(props) ?? props;\n\n if (OverrideComponent) {\n return <OverrideComponent {...innerProps} />;\n }\n\n return <DefaultComponent {...innerProps} />;\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AA8BO,MAAM,6BAAA,CAAgE;AAAA,EAC3E,WAAA;AAAA,EAEA,OAAO,eACL,UAAA,EACA;AACA,IAAA,OAAO,IAAI,6BAAA;AAAA,MACT,IAAI,GAAA;AAAA,QACF,UAAA,CAAW,IAAI,CAAA,KAAA,KAAS;AACtB,UAAA,OAAO;AAAA,YACL,MAAM,GAAA,CAAI,EAAA;AAAA,YACV,KAAA,CAAM,MAAA,GACF,IAAA,CAAK,aAAa;AAAA,cAChB,OAAA,EAAS,MAAM,KAAA,CAAM,MAAA;AAAQ,cAC7B,CAAA,GACF;AAAA,WACN;AAAA,QACF,CAAC;AAAA;AACH,KACF;AAAA,EACF;AAAA,EAEA,YAAY,UAAA,EAA8B;AACxC,IAAA,IAAA,CAAK,WAAA,GAAc,UAAA;AAAA,EACrB;AAAA,EAEA,aACE,GAAA,EACuC;AACvC,IAAA,MAAM,iBAAA,GAAoB,IAAA,CAAK,WAAA,CAAY,GAAA,CAAI,IAAI,EAAE,CAAA;AACrD,IAAA,MAAM,EAAE,gBAAA,EAAkB,gBAAA,EAAkB,gBAAe,GACzD,2BAAA,CAA4B,WAAW,GAAG,CAAA;AAE5C,IAAA,OAAO,CAAC,KAAA,KAAkB;AACxB,MAAA,MAAM,UAAA,GAAa,cAAA,GAAiB,KAAK,CAAA,IAAK,KAAA;AAE9C,MAAA,IAAI,iBAAA,EAAmB;AACrB,QAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,UAAA,EAAY,CAAA;AAAA,MAC5C;AAEA,MAAA,uBAAO,GAAA,CAAC,gBAAA,EAAA,EAAkB,GAAG,UAAA,EAAY,CAAA;AAAA,IAC3C,CAAA;AAAA,EACF;AACF;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { createExtension, coreExtensionData, createExtensionInput, NavContentBlueprint, NavItemBlueprint, useApi, routeResolutionApiRef } from '@backstage/frontend-plugin-api';
2
+ import { createExtension, coreExtensionData, createExtensionInput, NavItemBlueprint, useApi, routeResolutionApiRef } from '@backstage/frontend-plugin-api';
3
+ import { NavContentBlueprint } from '@backstage/plugin-app-react';
3
4
  import { Sidebar, SidebarItem } from '@backstage/core-components';
4
5
  import { useMemo } from 'react';
5
6
 
@@ -45,16 +46,12 @@ const AppNav = createExtension({
45
46
  items: createExtensionInput([NavItemBlueprint.dataRefs.target]),
46
47
  content: createExtensionInput([NavContentBlueprint.dataRefs.component], {
47
48
  singleton: true,
48
- optional: true
49
+ optional: true,
50
+ internal: true
49
51
  })
50
52
  },
51
53
  output: [coreExtensionData.reactElement],
52
54
  *factory({ inputs }) {
53
- if (inputs.content && inputs.content.node.spec.plugin?.id !== "app") {
54
- console.warn(
55
- `DEPRECATION WARNING: NavContent should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${inputs.content.node.spec.id}`
56
- );
57
- }
58
55
  const Content = inputs.content?.get(NavContentBlueprint.dataRefs.component) ?? DefaultNavContent;
59
56
  yield coreExtensionData.reactElement(
60
57
  /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"AppNav.esm.js","sources":["../../src/extensions/AppNav.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 createExtension,\n coreExtensionData,\n createExtensionInput,\n NavItemBlueprint,\n NavContentBlueprint,\n NavContentComponentProps,\n routeResolutionApiRef,\n IconComponent,\n RouteRef,\n useApi,\n NavContentComponent,\n} from '@backstage/frontend-plugin-api';\nimport { Sidebar, SidebarItem } from '@backstage/core-components';\nimport { useMemo } from 'react';\n\nfunction DefaultNavContent(props: NavContentComponentProps) {\n return (\n <Sidebar>\n {props.items.map((item, index) => (\n <SidebarItem\n to={item.to}\n icon={item.icon}\n text={item.text}\n key={index}\n />\n ))}\n </Sidebar>\n );\n}\n\n// This helps defer rendering until the app is being rendered, which is needed\n// because the RouteResolutionApi can't be called until the app has been fully initialized.\nfunction NavContentRenderer(props: {\n Content: NavContentComponent;\n items: Array<{\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n }>;\n}) {\n const routeResolutionApi = useApi(routeResolutionApiRef);\n\n const items = useMemo(() => {\n return props.items.flatMap(item => {\n const link = routeResolutionApi.resolve(item.routeRef);\n if (!link) {\n // eslint-disable-next-line no-console\n console.warn(\n `NavItemBlueprint: unable to resolve route ref ${item.routeRef}`,\n );\n return [];\n }\n return [\n {\n to: link(),\n text: item.title,\n icon: item.icon,\n title: item.title,\n routeRef: item.routeRef,\n },\n ];\n });\n }, [props.items, routeResolutionApi]);\n\n return <props.Content items={items} />;\n}\n\nexport const AppNav = createExtension({\n name: 'nav',\n attachTo: { id: 'app/layout', input: 'nav' },\n inputs: {\n items: createExtensionInput([NavItemBlueprint.dataRefs.target]),\n content: createExtensionInput([NavContentBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n }),\n },\n output: [coreExtensionData.reactElement],\n *factory({ inputs }) {\n if (inputs.content && inputs.content.node.spec.plugin?.id !== 'app') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: NavContent should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${inputs.content.node.spec.id}`,\n );\n }\n\n const Content =\n inputs.content?.get(NavContentBlueprint.dataRefs.component) ??\n DefaultNavContent;\n\n yield coreExtensionData.reactElement(\n <NavContentRenderer\n items={inputs.items.map(item =>\n item.get(NavItemBlueprint.dataRefs.target),\n )}\n Content={Content}\n />,\n );\n },\n});\n"],"names":[],"mappings":";;;;;AAgCA,SAAS,kBAAkB,KAAA,EAAiC;AAC1D,EAAA,2BACG,OAAA,EAAA,EACE,QAAA,EAAA,KAAA,CAAM,MAAM,GAAA,CAAI,CAAC,MAAM,KAAA,qBACtB,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,IAAI,IAAA,CAAK,EAAA;AAAA,MACT,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,MAAM,IAAA,CAAK;AAAA,KAAA;AAAA,IACN;AAAA,GAER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X,QAAA,EAAU;AAAA,KACX;AAAA,GACH;AAAA,EACA,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,CAAC,OAAA,CAAQ,EAAE,MAAA,EAAO,EAAG;AACnB,IAAA,IAAI,MAAA,CAAO,WAAW,MAAA,CAAO,OAAA,CAAQ,KAAK,IAAA,CAAK,MAAA,EAAQ,OAAO,KAAA,EAAO;AAEnE,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN,CAAA,4NAAA,EACqI,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,KAAK,EAAE,CAAA;AAAA,OAClK;AAAA,IACF;AAEA,IAAA,MAAM,UACJ,MAAA,CAAO,OAAA,EAAS,IAAI,mBAAA,CAAoB,QAAA,CAAS,SAAS,CAAA,IAC1D,iBAAA;AAEF,IAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,sBACtB,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,OAAO,KAAA,CAAM,GAAA;AAAA,YAAI,CAAA,IAAA,KACtB,IAAA,CAAK,GAAA,CAAI,gBAAA,CAAiB,SAAS,MAAM;AAAA,WAC3C;AAAA,UACA;AAAA;AAAA;AACF,KACF;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"AppNav.esm.js","sources":["../../src/extensions/AppNav.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 createExtension,\n coreExtensionData,\n createExtensionInput,\n NavItemBlueprint,\n routeResolutionApiRef,\n IconComponent,\n RouteRef,\n useApi,\n} from '@backstage/frontend-plugin-api';\nimport {\n NavContentBlueprint,\n NavContentComponent,\n NavContentComponentProps,\n} from '@backstage/plugin-app-react';\nimport { Sidebar, SidebarItem } from '@backstage/core-components';\nimport { useMemo } from 'react';\n\nfunction DefaultNavContent(props: NavContentComponentProps) {\n return (\n <Sidebar>\n {props.items.map((item, index) => (\n <SidebarItem\n to={item.to}\n icon={item.icon}\n text={item.text}\n key={index}\n />\n ))}\n </Sidebar>\n );\n}\n\n// This helps defer rendering until the app is being rendered, which is needed\n// because the RouteResolutionApi can't be called until the app has been fully initialized.\nfunction NavContentRenderer(props: {\n Content: NavContentComponent;\n items: Array<{\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n }>;\n}) {\n const routeResolutionApi = useApi(routeResolutionApiRef);\n\n const items = useMemo(() => {\n return props.items.flatMap(item => {\n const link = routeResolutionApi.resolve(item.routeRef);\n if (!link) {\n // eslint-disable-next-line no-console\n console.warn(\n `NavItemBlueprint: unable to resolve route ref ${item.routeRef}`,\n );\n return [];\n }\n return [\n {\n to: link(),\n text: item.title,\n icon: item.icon,\n title: item.title,\n routeRef: item.routeRef,\n },\n ];\n });\n }, [props.items, routeResolutionApi]);\n\n return <props.Content items={items} />;\n}\n\nexport const AppNav = createExtension({\n name: 'nav',\n attachTo: { id: 'app/layout', input: 'nav' },\n inputs: {\n items: createExtensionInput([NavItemBlueprint.dataRefs.target]),\n content: createExtensionInput([NavContentBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n internal: true,\n }),\n },\n output: [coreExtensionData.reactElement],\n *factory({ inputs }) {\n const Content =\n inputs.content?.get(NavContentBlueprint.dataRefs.component) ??\n DefaultNavContent;\n\n yield coreExtensionData.reactElement(\n <NavContentRenderer\n items={inputs.items.map(item =>\n item.get(NavItemBlueprint.dataRefs.target),\n )}\n Content={Content}\n />,\n );\n },\n});\n"],"names":[],"mappings":";;;;;;AAkCA,SAAS,kBAAkB,KAAA,EAAiC;AAC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EAAI,YAAA,EAAc,OAAO,KAAA,EAAM;AAAA,EAC3C,MAAA,EAAQ;AAAA,IACN,OAAO,oBAAA,CAAqB,CAAC,gBAAA,CAAiB,QAAA,CAAS,MAAM,CAAC,CAAA;AAAA,IAC9D,SAAS,oBAAA,CAAqB,CAAC,mBAAA,CAAoB,QAAA,CAAS,SAAS,CAAA,EAAG;AAAA,MACtE,SAAA,EAAW,IAAA;AAAA,MACX,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU;AAAA,KACX;AAAA,GACH;AAAA,EACA,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,CAAC,OAAA,CAAQ,EAAE,MAAA,EAAO,EAAG;AACnB,IAAA,MAAM,UACJ,MAAA,CAAO,OAAA,EAAS,IAAI,mBAAA,CAAoB,QAAA,CAAS,SAAS,CAAA,IAC1D,iBAAA;AAEF,IAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,sBACtB,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,OAAO,KAAA,CAAM,GAAA;AAAA,YAAI,CAAA,IAAA,KACtB,IAAA,CAAK,GAAA,CAAI,gBAAA,CAAiB,SAAS,MAAM;AAAA,WAC3C;AAAA,UACA;AAAA;AAAA;AACF,KACF;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
- import { createExtension, coreExtensionData, createExtensionInput, discoveryApiRef, errorApiRef, fetchApiRef, AppRootWrapperBlueprint, RouterBlueprint, SignInPageBlueprint, routeResolutionApiRef } from '@backstage/frontend-plugin-api';
3
+ import { createExtension, coreExtensionData, createExtensionInput, discoveryApiRef, errorApiRef, fetchApiRef, routeResolutionApiRef } from '@backstage/frontend-plugin-api';
4
+ import { AppRootWrapperBlueprint, RouterBlueprint, SignInPageBlueprint } from '@backstage/plugin-app-react';
4
5
  import { identityApiRef, useApi, configApiRef } from '@backstage/core-plugin-api';
5
6
  import { isProtectedApp } from '../packages/core-app-api/src/app/isProtectedApp.esm.js';
6
7
  import { BrowserRouter } from 'react-router-dom';
@@ -13,32 +14,27 @@ const AppRoot = createExtension({
13
14
  inputs: {
14
15
  router: createExtensionInput([RouterBlueprint.dataRefs.component], {
15
16
  singleton: true,
16
- optional: true
17
+ optional: true,
18
+ internal: true
17
19
  }),
18
20
  signInPage: createExtensionInput([SignInPageBlueprint.dataRefs.component], {
19
21
  singleton: true,
20
- optional: true
22
+ optional: true,
23
+ internal: true
21
24
  }),
22
25
  children: createExtensionInput([coreExtensionData.reactElement], {
23
26
  singleton: true
24
27
  }),
25
28
  elements: createExtensionInput([coreExtensionData.reactElement]),
26
- wrappers: createExtensionInput([
27
- AppRootWrapperBlueprint.dataRefs.component
28
- ])
29
+ wrappers: createExtensionInput(
30
+ [AppRootWrapperBlueprint.dataRefs.component],
31
+ {
32
+ internal: true
33
+ }
34
+ )
29
35
  },
30
36
  output: [coreExtensionData.reactElement],
31
37
  factory({ inputs, apis }) {
32
- if (inputs.router && inputs.router.node.spec.plugin?.id !== "app") {
33
- console.warn(
34
- `DEPRECATION WARNING: Router should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${inputs.router.node.spec.id}`
35
- );
36
- }
37
- if (inputs.signInPage && inputs.signInPage.node.spec.plugin?.id !== "app") {
38
- console.warn(
39
- `DEPRECATION WARNING: SignInPage should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${inputs.signInPage.node.spec.id}`
40
- );
41
- }
42
38
  if (isProtectedApp()) {
43
39
  const identityApi = apis.get(identityApiRef);
44
40
  if (!identityApi) {
@@ -64,14 +60,8 @@ const AppRoot = createExtension({
64
60
  );
65
61
  for (const wrapper of inputs.wrappers) {
66
62
  const Component = wrapper.get(AppRootWrapperBlueprint.dataRefs.component);
67
- const pluginId = wrapper.node.spec.plugin.id;
68
63
  if (Component) {
69
64
  content = /* @__PURE__ */ jsx(Component, { children: content });
70
- if (pluginId !== "app") {
71
- console.warn(
72
- `DEPRECATION WARNING: AppRootWrappers should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${wrapper.node.spec.id}`
73
- );
74
- }
75
65
  }
76
66
  }
77
67
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"AppRoot.esm.js","sources":["../../src/extensions/AppRoot.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 ComponentType,\n PropsWithChildren,\n ReactNode,\n useState,\n JSX,\n} from 'react';\nimport {\n AppRootWrapperBlueprint,\n RouterBlueprint,\n SignInPageBlueprint,\n coreExtensionData,\n discoveryApiRef,\n fetchApiRef,\n errorApiRef,\n createExtension,\n createExtensionInput,\n routeResolutionApiRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n DiscoveryApi,\n ErrorApi,\n FetchApi,\n IdentityApi,\n ProfileInfo,\n SignInPageProps,\n configApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { isProtectedApp } from '../../../../packages/core-app-api/src/app/isProtectedApp';\nimport { BrowserRouter } from 'react-router-dom';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { RouteTracker } from '../../../../packages/frontend-app-api/src/routing/RouteTracker';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { getBasePath } from '../../../../packages/frontend-app-api/src/routing/getBasePath';\n\nexport const AppRoot = createExtension({\n name: 'root',\n attachTo: { id: 'app', input: 'root' },\n inputs: {\n router: createExtensionInput([RouterBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n }),\n signInPage: createExtensionInput([SignInPageBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n }),\n children: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n }),\n elements: createExtensionInput([coreExtensionData.reactElement]),\n wrappers: createExtensionInput([\n AppRootWrapperBlueprint.dataRefs.component,\n ]),\n },\n output: [coreExtensionData.reactElement],\n factory({ inputs, apis }) {\n if (inputs.router && inputs.router.node.spec.plugin?.id !== 'app') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Router should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${inputs.router.node.spec.id}`,\n );\n }\n\n if (inputs.signInPage && inputs.signInPage.node.spec.plugin?.id !== 'app') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: SignInPage should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${inputs.signInPage.node.spec.id}`,\n );\n }\n\n if (isProtectedApp()) {\n const identityApi = apis.get(identityApiRef);\n if (!identityApi) {\n throw new Error('App requires an Identity API implementation');\n }\n const appIdentityProxy = toAppIdentityProxy(identityApi);\n const discoveryApi = apis.get(discoveryApiRef);\n const errorApi = apis.get(errorApiRef);\n const fetchApi = apis.get(fetchApiRef);\n if (!discoveryApi || !errorApi || !fetchApi) {\n throw new Error(\n 'App is running in protected mode but missing required APIs',\n );\n }\n appIdentityProxy.enableCookieAuth({\n discoveryApi,\n errorApi,\n fetchApi,\n });\n }\n\n let content: ReactNode = inputs.children.get(\n coreExtensionData.reactElement,\n );\n\n for (const wrapper of inputs.wrappers) {\n const Component = wrapper.get(AppRootWrapperBlueprint.dataRefs.component);\n const pluginId = wrapper.node.spec.plugin.id;\n if (Component) {\n content = <Component>{content}</Component>;\n if (pluginId !== 'app') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: AppRootWrappers should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${wrapper.node.spec.id}`,\n );\n }\n }\n }\n\n return [\n coreExtensionData.reactElement(\n <AppRouter\n SignInPageComponent={inputs.signInPage?.get(\n SignInPageBlueprint.dataRefs.component,\n )}\n RouterComponent={inputs.router?.get(\n RouterBlueprint.dataRefs.component,\n )}\n extraElements={inputs.elements?.map(el =>\n el.get(coreExtensionData.reactElement),\n )}\n >\n {content}\n </AppRouter>,\n ),\n ];\n },\n});\n\n// This wraps the sign-in page and waits for sign-in to be completed before rendering the app\nfunction SignInPageWrapper({\n component: Component,\n appIdentityProxy,\n children,\n}: {\n component: ComponentType<SignInPageProps>;\n appIdentityProxy: AppIdentityProxy;\n children: ReactNode;\n}) {\n const [identityApi, setIdentityApi] = useState<IdentityApi>();\n const configApi = useApi(configApiRef);\n const basePath = getBasePath(configApi);\n\n if (!identityApi) {\n return <Component onSignInSuccess={setIdentityApi} />;\n }\n\n appIdentityProxy.setTarget(identityApi, {\n signOutTargetUrl: basePath || '/',\n });\n return <>{children}</>;\n}\n\ntype AppIdentityProxy = IdentityApi & {\n enableCookieAuth(ctx: {\n errorApi: ErrorApi;\n fetchApi: FetchApi;\n discoveryApi: DiscoveryApi;\n }): void;\n setTarget(\n impl: IdentityApi & /* backwards compat stuff */ {\n getUserId?(): string;\n getIdToken?(): Promise<string | undefined>;\n getProfile?(): ProfileInfo;\n },\n options: { signOutTargetUrl: string },\n ): void;\n};\n\nfunction toAppIdentityProxy(identityApi: IdentityApi): AppIdentityProxy {\n if (!('enableCookieAuth' in identityApi)) {\n throw new Error('Unexpected Identity API implementation');\n }\n return identityApi as AppIdentityProxy;\n}\n\ntype RouteResolverProxy = {\n getRouteObjects(): any[];\n};\n\n/**\n * Props for the {@link AppRouter} component.\n * @public\n */\nexport interface AppRouterProps {\n children?: ReactNode;\n SignInPageComponent?: ComponentType<SignInPageProps>;\n RouterComponent?: (props: { children: ReactNode }) => JSX.Element | null;\n extraElements?: Array<JSX.Element>;\n}\n\nfunction DefaultRouter(props: PropsWithChildren<{}>) {\n const configApi = useApi(configApiRef);\n const basePath = getBasePath(configApi);\n return <BrowserRouter basename={basePath}>{props.children}</BrowserRouter>;\n}\n\n/**\n * App router and sign-in page wrapper.\n *\n * @remarks\n *\n * The AppRouter provides the routing context and renders the sign-in page.\n * Until the user has successfully signed in, this component will render\n * the sign-in page. Once the user has signed-in, it will instead render\n * the app, while providing routing and route tracking for the app.\n */\nexport function AppRouter(props: AppRouterProps) {\n const {\n children,\n SignInPageComponent,\n RouterComponent = DefaultRouter,\n extraElements = [],\n } = props;\n\n const configApi = useApi(configApiRef);\n const appIdentityProxy = toAppIdentityProxy(useApi(identityApiRef));\n const routeResolutionsApi = useApi(routeResolutionApiRef);\n const basePath = getBasePath(configApi);\n\n // TODO: Private access for now, probably replace with path -> node lookup method on the API\n if (!('getRouteObjects' in routeResolutionsApi)) {\n throw new Error('Unexpected route resolution API implementation');\n }\n const routeObjects = (\n routeResolutionsApi as RouteResolverProxy\n ).getRouteObjects();\n\n // If the app hasn't configured a sign-in page, we just continue as guest.\n if (!SignInPageComponent) {\n appIdentityProxy.setTarget(\n {\n getUserId: () => 'guest',\n getIdToken: async () => undefined,\n getProfile: () => ({\n email: 'guest@example.com',\n displayName: 'Guest',\n }),\n getProfileInfo: async () => ({\n email: 'guest@example.com',\n displayName: 'Guest',\n }),\n getBackstageIdentity: async () => ({\n type: 'user',\n userEntityRef: 'user:default/guest',\n ownershipEntityRefs: ['user:default/guest'],\n }),\n getCredentials: async () => ({}),\n signOut: async () => {},\n },\n { signOutTargetUrl: basePath || '/' },\n );\n\n return (\n <RouterComponent>\n {...extraElements}\n <RouteTracker routeObjects={routeObjects} />\n {children}\n </RouterComponent>\n );\n }\n\n return (\n <RouterComponent>\n {...extraElements}\n <RouteTracker routeObjects={routeObjects} />\n <SignInPageWrapper\n component={SignInPageComponent}\n appIdentityProxy={appIdentityProxy}\n >\n {children}\n </SignInPageWrapper>\n </RouterComponent>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAsDO,MAAM,UAAU,eAAA,CAAgB;AAAA,EACrC,IAAA,EAAM,MAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,KAAA,EAAO,OAAO,MAAA,EAAO;AAAA,EACrC,MAAA,EAAQ;AAAA,IACN,QAAQ,oBAAA,CAAqB,CAAC,eAAA,CAAgB,QAAA,CAAS,SAAS,CAAA,EAAG;AAAA,MACjE,SAAA,EAAW,IAAA;AAAA,MACX,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,YAAY,oBAAA,CAAqB,CAAC,mBAAA,CAAoB,QAAA,CAAS,SAAS,CAAA,EAAG;AAAA,MACzE,SAAA,EAAW,IAAA;AAAA,MACX,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,QAAA,EAAU,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAA,EAAG;AAAA,MAC/D,SAAA,EAAW;AAAA,KACZ,CAAA;AAAA,IACD,QAAA,EAAU,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC,CAAA;AAAA,IAC/D,UAAU,oBAAA,CAAqB;AAAA,MAC7B,wBAAwB,QAAA,CAAS;AAAA,KAClC;AAAA,GACH;AAAA,EACA,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,OAAA,CAAQ,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAG;AACxB,IAAA,IAAI,MAAA,CAAO,UAAU,MAAA,CAAO,MAAA,CAAO,KAAK,IAAA,CAAK,MAAA,EAAQ,OAAO,KAAA,EAAO;AAEjE,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN,CAAA,wNAAA,EACqI,MAAA,CAAO,MAAA,CAAO,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WAAW,MAAM,OAAA;AAAA,QACjB,YAAY,YAAY,MAAA;AAAA,QACxB,YAAY,OAAO;AAAA,UACjB,KAAA,EAAO,mBAAA;AAAA,UACP,WAAA,EAAa;AAAA,SACf,CAAA;AAAA,QACA,gBAAgB,aAAa;AAAA,UAC3B,KAAA,EAAO,mBAAA;AAAA,UACP,WAAA,EAAa;AAAA,SACf,CAAA;AAAA,QACA,sBAAsB,aAAa;AAAA,UACjC,IAAA,EAAM,MAAA;AAAA,UACN,aAAA,EAAe,oBAAA;AAAA,UACf,mBAAA,EAAqB,CAAC,oBAAoB;AAAA,SAC5C,CAAA;AAAA,QACA,cAAA,EAAgB,aAAa,EAAC,CAAA;AAAA,QAC9B,SAAS,YAAY;AAAA,QAAC;AAAA,OACxB;AAAA,MACA,EAAE,gBAAA,EAAkB,QAAA,IAAY,GAAA;AAAI,KACtC;AAEA,IAAA,4BACG,eAAA,EAAA,EACE,QAAA,EAAA;AAAA,MAAA,GAAG,aAAA;AAAA,sBACJ,GAAA,CAAC,gBAAa,YAAA,EAA4B,CAAA;AAAA,MACzC;AAAA,KAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,4BACG,eAAA,EAAA,EACE,QAAA,EAAA;AAAA,IAAA,GAAG,aAAA;AAAA,oBACJ,GAAA,CAAC,gBAAa,YAAA,EAA4B,CAAA;AAAA,oBAC1C,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,mBAAA;AAAA,QACX,gBAAA;AAAA,QAEC;AAAA;AAAA;AACH,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AppRoot.esm.js","sources":["../../src/extensions/AppRoot.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 ComponentType,\n PropsWithChildren,\n ReactNode,\n useState,\n JSX,\n} from 'react';\nimport {\n coreExtensionData,\n discoveryApiRef,\n fetchApiRef,\n errorApiRef,\n createExtension,\n createExtensionInput,\n routeResolutionApiRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n AppRootWrapperBlueprint,\n RouterBlueprint,\n SignInPageBlueprint,\n} from '@backstage/plugin-app-react';\nimport {\n DiscoveryApi,\n ErrorApi,\n FetchApi,\n IdentityApi,\n ProfileInfo,\n SignInPageProps,\n configApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { isProtectedApp } from '../../../../packages/core-app-api/src/app/isProtectedApp';\nimport { BrowserRouter } from 'react-router-dom';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { RouteTracker } from '../../../../packages/frontend-app-api/src/routing/RouteTracker';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { getBasePath } from '../../../../packages/frontend-app-api/src/routing/getBasePath';\n\nexport const AppRoot = createExtension({\n name: 'root',\n attachTo: { id: 'app', input: 'root' },\n inputs: {\n router: createExtensionInput([RouterBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n internal: true,\n }),\n signInPage: createExtensionInput([SignInPageBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n internal: true,\n }),\n children: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n }),\n elements: createExtensionInput([coreExtensionData.reactElement]),\n wrappers: createExtensionInput(\n [AppRootWrapperBlueprint.dataRefs.component],\n {\n internal: true,\n },\n ),\n },\n output: [coreExtensionData.reactElement],\n factory({ inputs, apis }) {\n if (isProtectedApp()) {\n const identityApi = apis.get(identityApiRef);\n if (!identityApi) {\n throw new Error('App requires an Identity API implementation');\n }\n const appIdentityProxy = toAppIdentityProxy(identityApi);\n const discoveryApi = apis.get(discoveryApiRef);\n const errorApi = apis.get(errorApiRef);\n const fetchApi = apis.get(fetchApiRef);\n if (!discoveryApi || !errorApi || !fetchApi) {\n throw new Error(\n 'App is running in protected mode but missing required APIs',\n );\n }\n appIdentityProxy.enableCookieAuth({\n discoveryApi,\n errorApi,\n fetchApi,\n });\n }\n\n let content: ReactNode = inputs.children.get(\n coreExtensionData.reactElement,\n );\n\n for (const wrapper of inputs.wrappers) {\n const Component = wrapper.get(AppRootWrapperBlueprint.dataRefs.component);\n if (Component) {\n content = <Component>{content}</Component>;\n }\n }\n\n return [\n coreExtensionData.reactElement(\n <AppRouter\n SignInPageComponent={inputs.signInPage?.get(\n SignInPageBlueprint.dataRefs.component,\n )}\n RouterComponent={inputs.router?.get(\n RouterBlueprint.dataRefs.component,\n )}\n extraElements={inputs.elements?.map(el =>\n el.get(coreExtensionData.reactElement),\n )}\n >\n {content}\n </AppRouter>,\n ),\n ];\n },\n});\n\n// This wraps the sign-in page and waits for sign-in to be completed before rendering the app\nfunction SignInPageWrapper({\n component: Component,\n appIdentityProxy,\n children,\n}: {\n component: ComponentType<SignInPageProps>;\n appIdentityProxy: AppIdentityProxy;\n children: ReactNode;\n}) {\n const [identityApi, setIdentityApi] = useState<IdentityApi>();\n const configApi = useApi(configApiRef);\n const basePath = getBasePath(configApi);\n\n if (!identityApi) {\n return <Component onSignInSuccess={setIdentityApi} />;\n }\n\n appIdentityProxy.setTarget(identityApi, {\n signOutTargetUrl: basePath || '/',\n });\n return <>{children}</>;\n}\n\ntype AppIdentityProxy = IdentityApi & {\n enableCookieAuth(ctx: {\n errorApi: ErrorApi;\n fetchApi: FetchApi;\n discoveryApi: DiscoveryApi;\n }): void;\n setTarget(\n impl: IdentityApi & /* backwards compat stuff */ {\n getUserId?(): string;\n getIdToken?(): Promise<string | undefined>;\n getProfile?(): ProfileInfo;\n },\n options: { signOutTargetUrl: string },\n ): void;\n};\n\nfunction toAppIdentityProxy(identityApi: IdentityApi): AppIdentityProxy {\n if (!('enableCookieAuth' in identityApi)) {\n throw new Error('Unexpected Identity API implementation');\n }\n return identityApi as AppIdentityProxy;\n}\n\ntype RouteResolverProxy = {\n getRouteObjects(): any[];\n};\n\n/**\n * Props for the {@link AppRouter} component.\n * @public\n */\nexport interface AppRouterProps {\n children?: ReactNode;\n SignInPageComponent?: ComponentType<SignInPageProps>;\n RouterComponent?: (props: { children: ReactNode }) => JSX.Element | null;\n extraElements?: Array<JSX.Element>;\n}\n\nfunction DefaultRouter(props: PropsWithChildren<{}>) {\n const configApi = useApi(configApiRef);\n const basePath = getBasePath(configApi);\n return <BrowserRouter basename={basePath}>{props.children}</BrowserRouter>;\n}\n\n/**\n * App router and sign-in page wrapper.\n *\n * @remarks\n *\n * The AppRouter provides the routing context and renders the sign-in page.\n * Until the user has successfully signed in, this component will render\n * the sign-in page. Once the user has signed-in, it will instead render\n * the app, while providing routing and route tracking for the app.\n */\nexport function AppRouter(props: AppRouterProps) {\n const {\n children,\n SignInPageComponent,\n RouterComponent = DefaultRouter,\n extraElements = [],\n } = props;\n\n const configApi = useApi(configApiRef);\n const appIdentityProxy = toAppIdentityProxy(useApi(identityApiRef));\n const routeResolutionsApi = useApi(routeResolutionApiRef);\n const basePath = getBasePath(configApi);\n\n // TODO: Private access for now, probably replace with path -> node lookup method on the API\n if (!('getRouteObjects' in routeResolutionsApi)) {\n throw new Error('Unexpected route resolution API implementation');\n }\n const routeObjects = (\n routeResolutionsApi as RouteResolverProxy\n ).getRouteObjects();\n\n // If the app hasn't configured a sign-in page, we just continue as guest.\n if (!SignInPageComponent) {\n appIdentityProxy.setTarget(\n {\n getUserId: () => 'guest',\n getIdToken: async () => undefined,\n getProfile: () => ({\n email: 'guest@example.com',\n displayName: 'Guest',\n }),\n getProfileInfo: async () => ({\n email: 'guest@example.com',\n displayName: 'Guest',\n }),\n getBackstageIdentity: async () => ({\n type: 'user',\n userEntityRef: 'user:default/guest',\n ownershipEntityRefs: ['user:default/guest'],\n }),\n getCredentials: async () => ({}),\n signOut: async () => {},\n },\n { signOutTargetUrl: basePath || '/' },\n );\n\n return (\n <RouterComponent>\n {...extraElements}\n <RouteTracker routeObjects={routeObjects} />\n {children}\n </RouterComponent>\n );\n }\n\n return (\n <RouterComponent>\n {...extraElements}\n <RouteTracker routeObjects={routeObjects} />\n <SignInPageWrapper\n component={SignInPageComponent}\n appIdentityProxy={appIdentityProxy}\n >\n {children}\n </SignInPageWrapper>\n </RouterComponent>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAwDO,MAAM,UAAU,eAAA,CAAgB;AAAA,EACrC,IAAA,EAAM,MAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,KAAA,EAAO,OAAO,MAAA,EAAO;AAAA,EACrC,MAAA,EAAQ;AAAA,IACN,QAAQ,oBAAA,CAAqB,CAAC,eAAA,CAAgB,QAAA,CAAS,SAAS,CAAA,EAAG;AAAA,MACjE,SAAA,EAAW,IAAA;AAAA,MACX,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,YAAY,oBAAA,CAAqB,CAAC,mBAAA,CAAoB,QAAA,CAAS,SAAS,CAAA,EAAG;AAAA,MACzE,SAAA,EAAW,IAAA;AAAA,MACX,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,IACD,QAAA,EAAU,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAA,EAAG;AAAA,MAC/D,SAAA,EAAW;AAAA,KACZ,CAAA;AAAA,IACD,QAAA,EAAU,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC,CAAA;AAAA,IAC/D,QAAA,EAAU,oBAAA;AAAA,MACR,CAAC,uBAAA,CAAwB,QAAA,CAAS,SAAS,CAAA;AAAA,MAC3C;AAAA,QACE,QAAA,EAAU;AAAA;AACZ;AACF,GAC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,SAAS,YAAY;AAAA,QAAC;AAAA,OACxB;AAAA,MACA,EAAE,gBAAA,EAAkB,QAAA,IAAY,GAAA;AAAI,KACtC;AAEA,IAAA,4BACG,eAAA,EAAA,EACE,QAAA,EAAA;AAAA,MAAA,GAAG,aAAA;AAAA,sBACJ,GAAA,CAAC,gBAAa,YAAA,EAA4B,CAAA;AAAA,MACzC;AAAA,KAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,4BACG,eAAA,EAAA,EACE,QAAA,EAAA;AAAA,IAAA,GAAG,aAAA;AAAA,oBACJ,GAAA,CAAC,gBAAa,YAAA,EAA4B,CAAA;AAAA,oBAC1C,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,mBAAA;AAAA,QACX,gBAAA;AAAA,QAEC;AAAA;AAAA;AACH,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -2,7 +2,8 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { UnifiedThemeProvider, themes } from '@backstage/theme';
3
3
  import DarkIcon from '@material-ui/icons/Brightness2';
4
4
  import LightIcon from '@material-ui/icons/WbSunny';
5
- import { ApiBlueprint, createExtensionInput, appThemeApiRef, ThemeBlueprint } from '@backstage/frontend-plugin-api';
5
+ import { ApiBlueprint, createExtensionInput, appThemeApiRef } from '@backstage/frontend-plugin-api';
6
+ import { ThemeBlueprint } from '@backstage/plugin-app-react';
6
7
  import 'zen-observable';
7
8
  import '@backstage/core-plugin-api';
8
9
  import '../packages/core-app-api/src/apis/implementations/auth/saml/types.esm.js';
@@ -13,7 +14,8 @@ const AppThemeApi = ApiBlueprint.makeWithOverrides({
13
14
  name: "app-theme",
14
15
  inputs: {
15
16
  themes: createExtensionInput([ThemeBlueprint.dataRefs.theme], {
16
- replaces: [{ id: "app", input: "themes" }]
17
+ replaces: [{ id: "app", input: "themes" }],
18
+ internal: true
17
19
  })
18
20
  },
19
21
  factory: (originalFactory, { inputs }) => {
@@ -22,15 +24,6 @@ const AppThemeApi = ApiBlueprint.makeWithOverrides({
22
24
  api: appThemeApiRef,
23
25
  deps: {},
24
26
  factory: () => {
25
- const nonAppExtensions = inputs.themes.filter(
26
- (i) => i.node.spec.plugin?.id !== "app"
27
- );
28
- if (nonAppExtensions.length > 0) {
29
- const list = nonAppExtensions.map((i) => i.node.spec.id).join(", ");
30
- console.warn(
31
- `DEPRECATION WARNING: Theme should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${list}`
32
- );
33
- }
34
27
  return AppThemeSelector.createWithStorage(
35
28
  inputs.themes.map((i) => i.get(ThemeBlueprint.dataRefs.theme))
36
29
  );
@@ -1 +1 @@
1
- {"version":3,"file":"AppThemeApi.esm.js","sources":["../../src/extensions/AppThemeApi.tsx"],"sourcesContent":["/*\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 {\n UnifiedThemeProvider,\n themes as builtinThemes,\n} from '@backstage/theme';\nimport DarkIcon from '@material-ui/icons/Brightness2';\nimport LightIcon from '@material-ui/icons/WbSunny';\nimport {\n createExtensionInput,\n ThemeBlueprint,\n ApiBlueprint,\n appThemeApiRef,\n} from '@backstage/frontend-plugin-api';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppThemeSelector } from '../../../../packages/core-app-api/src/apis/implementations';\n\n/**\n * Contains the themes installed into the app.\n */\nexport const AppThemeApi = ApiBlueprint.makeWithOverrides({\n name: 'app-theme',\n inputs: {\n themes: createExtensionInput([ThemeBlueprint.dataRefs.theme], {\n replaces: [{ id: 'app', input: 'themes' }],\n }),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: appThemeApiRef,\n deps: {},\n factory: () => {\n const nonAppExtensions = inputs.themes.filter(\n i => i.node.spec.plugin?.id !== 'app',\n );\n\n if (nonAppExtensions.length > 0) {\n const list = nonAppExtensions.map(i => i.node.spec.id).join(', ');\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Theme should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${list}`,\n );\n }\n\n return AppThemeSelector.createWithStorage(\n inputs.themes.map(i => i.get(ThemeBlueprint.dataRefs.theme)),\n );\n },\n }),\n );\n },\n});\n\nexport const LightTheme = ThemeBlueprint.make({\n name: 'light',\n params: {\n theme: {\n id: 'light',\n title: 'Light Theme',\n variant: 'light',\n icon: <LightIcon />,\n Provider: ({ children }) => (\n <UnifiedThemeProvider theme={builtinThemes.light} children={children} />\n ),\n },\n },\n});\n\nexport const DarkTheme = ThemeBlueprint.make({\n name: 'dark',\n params: {\n theme: {\n id: 'dark',\n title: 'Dark Theme',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: ({ children }) => (\n <UnifiedThemeProvider theme={builtinThemes.dark} children={children} />\n ),\n },\n },\n});\n"],"names":["builtinThemes"],"mappings":";;;;;;;;;;;AAkCO,MAAM,WAAA,GAAc,aAAa,iBAAA,CAAkB;AAAA,EACxD,IAAA,EAAM,WAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,QAAQ,oBAAA,CAAqB,CAAC,cAAA,CAAe,QAAA,CAAS,KAAK,CAAA,EAAG;AAAA,MAC5D,UAAU,CAAC,EAAE,IAAI,KAAA,EAAO,KAAA,EAAO,UAAU;AAAA,KAC1C;AAAA,GACH;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,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N,KAAA,EAAO;AAAA,MACL,EAAA,EAAI,MAAA;AAAA,MACJ,KAAA,EAAO,YAAA;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,IAAA,sBAAO,QAAA,EAAA,EAAS,CAAA;AAAA,MAChB,QAAA,EAAU,CAAC,EAAE,QAAA,EAAS,yBACnB,oBAAA,EAAA,EAAqB,KAAA,EAAOA,MAAA,CAAc,IAAA,EAAM,QAAA,EAAoB;AAAA;AAEzE;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"AppThemeApi.esm.js","sources":["../../src/extensions/AppThemeApi.tsx"],"sourcesContent":["/*\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 {\n UnifiedThemeProvider,\n themes as builtinThemes,\n} from '@backstage/theme';\nimport DarkIcon from '@material-ui/icons/Brightness2';\nimport LightIcon from '@material-ui/icons/WbSunny';\nimport {\n createExtensionInput,\n ApiBlueprint,\n appThemeApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { ThemeBlueprint } from '@backstage/plugin-app-react';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppThemeSelector } from '../../../../packages/core-app-api/src/apis/implementations';\n\n/**\n * Contains the themes installed into the app.\n */\nexport const AppThemeApi = ApiBlueprint.makeWithOverrides({\n name: 'app-theme',\n inputs: {\n themes: createExtensionInput([ThemeBlueprint.dataRefs.theme], {\n replaces: [{ id: 'app', input: 'themes' }],\n internal: true,\n }),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: appThemeApiRef,\n deps: {},\n factory: () => {\n return AppThemeSelector.createWithStorage(\n inputs.themes.map(i => i.get(ThemeBlueprint.dataRefs.theme)),\n );\n },\n }),\n );\n },\n});\n\nexport const LightTheme = ThemeBlueprint.make({\n name: 'light',\n params: {\n theme: {\n id: 'light',\n title: 'Light Theme',\n variant: 'light',\n icon: <LightIcon />,\n Provider: ({ children }) => (\n <UnifiedThemeProvider theme={builtinThemes.light} children={children} />\n ),\n },\n },\n});\n\nexport const DarkTheme = ThemeBlueprint.make({\n name: 'dark',\n params: {\n theme: {\n id: 'dark',\n title: 'Dark Theme',\n variant: 'dark',\n icon: <DarkIcon />,\n Provider: ({ children }) => (\n <UnifiedThemeProvider theme={builtinThemes.dark} children={children} />\n ),\n },\n },\n});\n"],"names":["builtinThemes"],"mappings":";;;;;;;;;;;;AAkCO,MAAM,WAAA,GAAc,aAAa,iBAAA,CAAkB;AAAA,EACxD,IAAA,EAAM,WAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,QAAQ,oBAAA,CAAqB,CAAC,cAAA,CAAe,QAAA,CAAS,KAAK,CAAA,EAAG;AAAA,MAC5D,UAAU,CAAC,EAAE,IAAI,KAAA,EAAO,KAAA,EAAO,UAAU,CAAA;AAAA,MACzC,QAAA,EAAU;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,cAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,SAAS,MAAM;AACb,UAAA,OAAO,gBAAA,CAAiB,iBAAA;AAAA,YACtB,MAAA,CAAO,OAAO,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,GAAA,CAAI,cAAA,CAAe,QAAA,CAAS,KAAK,CAAC;AAAA,WAC7D;AAAA,QACF;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;AAEM,MAAM,UAAA,GAAa,eAAe,IAAA,CAAK;AAAA,EAC5C,IAAA,EAAM,OAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO;AAAA,MACL,EAAA,EAAI,OAAA;AAAA,MACJ,KAAA,EAAO,aAAA;AAAA,MACP,OAAA,EAAS,OAAA;AAAA,MACT,IAAA,sBAAO,SAAA,EAAA,EAAU,CAAA;AAAA,MACjB,QAAA,EAAU,CAAC,EAAE,QAAA,EAAS,yBACnB,oBAAA,EAAA,EAAqB,KAAA,EAAOA,MAAA,CAAc,KAAA,EAAO,QAAA,EAAoB;AAAA;AAE1E;AAEJ,CAAC;AAEM,MAAM,SAAA,GAAY,eAAe,IAAA,CAAK;AAAA,EAC3C,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO;AAAA,MACL,EAAA,EAAI,MAAA;AAAA,MACJ,KAAA,EAAO,YAAA;AAAA,MACP,OAAA,EAAS,MAAA;AAAA,MACT,IAAA,sBAAO,QAAA,EAAA,EAAS,CAAA;AAAA,MAChB,QAAA,EAAU,CAAC,EAAE,QAAA,EAAS,yBACnB,oBAAA,EAAA,EAAqB,KAAA,EAAOA,MAAA,CAAc,IAAA,EAAM,QAAA,EAAoB;AAAA;AAEzE;AAEJ,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { SignInPageBlueprint } from '@backstage/frontend-plugin-api';
2
+ import { SignInPageBlueprint } from '@backstage/plugin-app-react';
3
3
  import { SignInPage } from '@backstage/core-components';
4
4
 
5
5
  const DefaultSignInPage = SignInPageBlueprint.make({
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultSignInPage.esm.js","sources":["../../src/extensions/DefaultSignInPage.tsx"],"sourcesContent":["/*\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 */\nimport { SignInPageBlueprint } from '@backstage/frontend-plugin-api';\nimport { SignInPage } from '@backstage/core-components';\n\nexport const DefaultSignInPage = SignInPageBlueprint.make({\n params: {\n loader: async () => props =>\n <SignInPage {...props} providers={['guest']} />,\n },\n});\n"],"names":[],"mappings":";;;;AAkBO,MAAM,iBAAA,GAAoB,oBAAoB,IAAA,CAAK;AAAA,EACxD,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,YAAY,CAAA,KAAA,qBAClB,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EAAO,SAAA,EAAW,CAAC,OAAO,CAAA,EAAG;AAAA;AAEnD,CAAC;;;;"}
1
+ {"version":3,"file":"DefaultSignInPage.esm.js","sources":["../../src/extensions/DefaultSignInPage.tsx"],"sourcesContent":["/*\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 */\nimport { SignInPageBlueprint } from '@backstage/plugin-app-react';\nimport { SignInPage } from '@backstage/core-components';\n\nexport const DefaultSignInPage = SignInPageBlueprint.make({\n params: {\n loader: async () => props =>\n <SignInPage {...props} providers={['guest']} />,\n },\n});\n"],"names":[],"mappings":";;;;AAkBO,MAAM,iBAAA,GAAoB,oBAAoB,IAAA,CAAK;AAAA,EACxD,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,YAAY,CAAA,KAAA,qBAClB,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EAAO,SAAA,EAAW,CAAC,OAAO,CAAA,EAAG;AAAA;AAEnD,CAAC;;;;"}
@@ -1,4 +1,5 @@
1
- import { ApiBlueprint, createExtensionInput, iconsApiRef, IconBundleBlueprint } from '@backstage/frontend-plugin-api';
1
+ import { ApiBlueprint, createExtensionInput, iconsApiRef } from '@backstage/frontend-plugin-api';
2
+ import { IconBundleBlueprint } from '@backstage/plugin-app-react';
2
3
  import { DefaultIconsApi } from '../packages/frontend-app-api/src/apis/implementations/IconsApi/DefaultIconsApi.esm.js';
3
4
  import '../packages/app-defaults/src/defaults/apis.esm.js';
4
5
  import 'react/jsx-runtime';
@@ -14,7 +15,8 @@ const IconsApi = ApiBlueprint.makeWithOverrides({
14
15
  name: "icons",
15
16
  inputs: {
16
17
  icons: createExtensionInput([IconBundleBlueprint.dataRefs.icons], {
17
- replaces: [{ id: "app", input: "icons" }]
18
+ replaces: [{ id: "app", input: "icons" }],
19
+ internal: true
18
20
  })
19
21
  },
20
22
  factory: (originalFactory, { inputs }) => {
@@ -23,15 +25,6 @@ const IconsApi = ApiBlueprint.makeWithOverrides({
23
25
  api: iconsApiRef,
24
26
  deps: {},
25
27
  factory: () => {
26
- const nonAppExtensions = inputs.icons.filter(
27
- (i) => i.node.spec.plugin?.id !== "app"
28
- );
29
- if (nonAppExtensions.length > 0) {
30
- const list = nonAppExtensions.map((i) => i.node.spec.id).join(", ");
31
- console.warn(
32
- `DEPRECATION WARNING: IconBundle should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${list}`
33
- );
34
- }
35
28
  return new DefaultIconsApi(
36
29
  inputs.icons.map((i) => i.get(IconBundleBlueprint.dataRefs.icons)).reduce((acc, bundle) => ({ ...acc, ...bundle }), icons)
37
30
  );
@@ -1 +1 @@
1
- {"version":3,"file":"IconsApi.esm.js","sources":["../../src/extensions/IconsApi.ts"],"sourcesContent":["/*\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 {\n createExtensionInput,\n IconBundleBlueprint,\n ApiBlueprint,\n iconsApiRef,\n} from '@backstage/frontend-plugin-api';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { DefaultIconsApi } from '../../../../packages/frontend-app-api/src/apis/implementations/IconsApi';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { icons as defaultIcons } from '../../../../packages/app-defaults/src/defaults';\n\n/**\n * Contains the shareable icons installed into the app.\n */\nexport const IconsApi = ApiBlueprint.makeWithOverrides({\n name: 'icons',\n inputs: {\n icons: createExtensionInput([IconBundleBlueprint.dataRefs.icons], {\n replaces: [{ id: 'app', input: 'icons' }],\n }),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: iconsApiRef,\n deps: {},\n factory: () => {\n const nonAppExtensions = inputs.icons.filter(\n i => i.node.spec.plugin?.id !== 'app',\n );\n\n if (nonAppExtensions.length > 0) {\n const list = nonAppExtensions.map(i => i.node.spec.id).join(', ');\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: IconBundle should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${list}`,\n );\n }\n\n return new DefaultIconsApi(\n inputs.icons\n .map(i => i.get(IconBundleBlueprint.dataRefs.icons))\n .reduce((acc, bundle) => ({ ...acc, ...bundle }), defaultIcons),\n );\n },\n }),\n );\n },\n});\n"],"names":["defaultIcons"],"mappings":";;;;;;;;;;;;AA8BO,MAAM,QAAA,GAAW,aAAa,iBAAA,CAAkB;AAA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":["/*\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 {\n createExtensionInput,\n ApiBlueprint,\n iconsApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { IconBundleBlueprint } from '@backstage/plugin-app-react';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { DefaultIconsApi } from '../../../../packages/frontend-app-api/src/apis/implementations/IconsApi';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { icons as defaultIcons } from '../../../../packages/app-defaults/src/defaults';\n\n/**\n * Contains the shareable icons installed into the app.\n */\nexport const IconsApi = ApiBlueprint.makeWithOverrides({\n name: 'icons',\n inputs: {\n icons: createExtensionInput([IconBundleBlueprint.dataRefs.icons], {\n replaces: [{ id: 'app', input: 'icons' }],\n internal: true,\n }),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: iconsApiRef,\n deps: {},\n factory: () => {\n return new DefaultIconsApi(\n inputs.icons\n .map(i => i.get(IconBundleBlueprint.dataRefs.icons))\n .reduce((acc, bundle) => ({ ...acc, ...bundle }), defaultIcons),\n );\n },\n }),\n );\n },\n});\n"],"names":["defaultIcons"],"mappings":";;;;;;;;;;;;;AA8BO,MAAM,QAAA,GAAW,aAAa,iBAAA,CAAkB;AAAA,EACrD,IAAA,EAAM,OAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,OAAO,oBAAA,CAAqB,CAAC,mBAAA,CAAoB,QAAA,CAAS,KAAK,CAAA,EAAG;AAAA,MAChE,UAAU,CAAC,EAAE,IAAI,KAAA,EAAO,KAAA,EAAO,SAAS,CAAA;AAAA,MACxC,QAAA,EAAU;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,WAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,SAAS,MAAM;AACb,UAAA,OAAO,IAAI,eAAA;AAAA,YACT,MAAA,CAAO,MACJ,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,GAAA,CAAI,mBAAA,CAAoB,SAAS,KAAK,CAAC,EAClD,MAAA,CAAO,CAAC,KAAK,MAAA,MAAY,EAAE,GAAG,GAAA,EAAK,GAAG,MAAA,EAAO,CAAA,EAAIA,KAAY;AAAA,WAClE;AAAA,QACF;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,12 +1,16 @@
1
- import { ApiBlueprint, createExtensionInput, swappableComponentsApiRef, SwappableComponentBlueprint } from '@backstage/frontend-plugin-api';
1
+ import { ApiBlueprint, createExtensionInput, swappableComponentsApiRef } from '@backstage/frontend-plugin-api';
2
+ import { SwappableComponentBlueprint } from '@backstage/plugin-app-react';
2
3
  import { DefaultSwappableComponentsApi } from '../apis/SwappableComponentsApi/DefaultSwappableComponentsApi.esm.js';
3
4
 
4
5
  const SwappableComponentsApi = ApiBlueprint.makeWithOverrides({
5
6
  name: "swappable-components",
6
7
  inputs: {
7
- components: createExtensionInput([
8
- SwappableComponentBlueprint.dataRefs.component
9
- ])
8
+ components: createExtensionInput(
9
+ [SwappableComponentBlueprint.dataRefs.component],
10
+ {
11
+ internal: true
12
+ }
13
+ )
10
14
  },
11
15
  factory: (originalFactory, { inputs }) => {
12
16
  return originalFactory(
@@ -14,19 +18,8 @@ const SwappableComponentsApi = ApiBlueprint.makeWithOverrides({
14
18
  api: swappableComponentsApiRef,
15
19
  deps: {},
16
20
  factory: () => {
17
- const nonAppExtensions = inputs.components.filter(
18
- (i) => i.node.spec.plugin?.id !== "app"
19
- );
20
- if (nonAppExtensions.length > 0) {
21
- console.warn(
22
- `SwappableComponents should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or provide a module for the app-plugin with the extension there instead. Invalid extensions: ${nonAppExtensions.map((i) => i.node.spec.id).join(", ")}`
23
- );
24
- }
25
- const appExtensions = inputs.components.filter(
26
- (i) => i.node.spec.plugin?.id === "app"
27
- );
28
21
  return DefaultSwappableComponentsApi.fromComponents(
29
- appExtensions.map(
22
+ inputs.components.map(
30
23
  (i) => i.get(SwappableComponentBlueprint.dataRefs.component)
31
24
  )
32
25
  );
@@ -1 +1 @@
1
- {"version":3,"file":"SwappableComponentsApi.esm.js","sources":["../../src/extensions/SwappableComponentsApi.ts"],"sourcesContent":["/*\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 {\n SwappableComponentBlueprint,\n createExtensionInput,\n ApiBlueprint,\n swappableComponentsApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { DefaultSwappableComponentsApi } from '../apis/SwappableComponentsApi';\n\n/**\n * Contains the shareable components installed into the app.\n */\nexport const SwappableComponentsApi = ApiBlueprint.makeWithOverrides({\n name: 'swappable-components',\n inputs: {\n components: createExtensionInput([\n SwappableComponentBlueprint.dataRefs.component,\n ]),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: swappableComponentsApiRef,\n deps: {},\n factory: () => {\n const nonAppExtensions = inputs.components.filter(\n i => i.node.spec.plugin?.id !== 'app',\n );\n\n if (nonAppExtensions.length > 0) {\n // eslint-disable-next-line no-console\n console.warn(\n `SwappableComponents should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or provide a module for the app-plugin with the extension there instead. Invalid extensions: ${nonAppExtensions\n .map(i => i.node.spec.id)\n .join(', ')}`,\n );\n }\n\n const appExtensions = inputs.components.filter(\n i => i.node.spec.plugin?.id === 'app',\n );\n\n return DefaultSwappableComponentsApi.fromComponents(\n appExtensions.map(i =>\n i.get(SwappableComponentBlueprint.dataRefs.component),\n ),\n );\n },\n }),\n );\n },\n});\n"],"names":[],"mappings":";;;AA2BO,MAAM,sBAAA,GAAyB,aAAa,iBAAA,CAAkB;AAAA,EACnE,IAAA,EAAM,sBAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,YAAY,oBAAA,CAAqB;AAAA,MAC/B,4BAA4B,QAAA,CAAS;AAAA,KACtC;AAAA,GACH;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,yBAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,SAAS,MAAM;AACb,UAAA,MAAM,gBAAA,GAAmB,OAAO,UAAA,CAAW,MAAA;AAAA,YACzC,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAA,CAAK,QAAQ,EAAA,KAAO;AAAA,WAClC;AAEA,UAAA,IAAI,gBAAA,CAAiB,SAAS,CAAA,EAAG;AAE/B,YAAA,OAAA,CAAQ,IAAA;AAAA,cACN,CAAA,sNAAA,EAAyN,gBAAA,CACtN,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,CACvB,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,aACf;AAAA,UACF;AAEA,UAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,CAAW,MAAA;AAAA,YACtC,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAA,CAAK,QAAQ,EAAA,KAAO;AAAA,WAClC;AAEA,UAAA,OAAO,6BAAA,CAA8B,cAAA;AAAA,YACnC,aAAA,CAAc,GAAA;AAAA,cAAI,CAAA,CAAA,KAChB,CAAA,CAAE,GAAA,CAAI,2BAAA,CAA4B,SAAS,SAAS;AAAA;AACtD,WACF;AAAA,QACF;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"SwappableComponentsApi.esm.js","sources":["../../src/extensions/SwappableComponentsApi.ts"],"sourcesContent":["/*\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 {\n createExtensionInput,\n ApiBlueprint,\n swappableComponentsApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { SwappableComponentBlueprint } from '@backstage/plugin-app-react';\nimport { DefaultSwappableComponentsApi } from '../apis/SwappableComponentsApi';\n\n/**\n * Contains the shareable components installed into the app.\n */\nexport const SwappableComponentsApi = ApiBlueprint.makeWithOverrides({\n name: 'swappable-components',\n inputs: {\n components: createExtensionInput(\n [SwappableComponentBlueprint.dataRefs.component],\n {\n internal: true,\n },\n ),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: swappableComponentsApiRef,\n deps: {},\n factory: () => {\n return DefaultSwappableComponentsApi.fromComponents(\n inputs.components.map(i =>\n i.get(SwappableComponentBlueprint.dataRefs.component),\n ),\n );\n },\n }),\n );\n },\n});\n"],"names":[],"mappings":";;;;AA2BO,MAAM,sBAAA,GAAyB,aAAa,iBAAA,CAAkB;AAAA,EACnE,IAAA,EAAM,sBAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,UAAA,EAAY,oBAAA;AAAA,MACV,CAAC,2BAAA,CAA4B,QAAA,CAAS,SAAS,CAAA;AAAA,MAC/C;AAAA,QACE,QAAA,EAAU;AAAA;AACZ;AACF,GACF;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,yBAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,SAAS,MAAM;AACb,UAAA,OAAO,6BAAA,CAA8B,cAAA;AAAA,YACnC,OAAO,UAAA,CAAW,GAAA;AAAA,cAAI,CAAA,CAAA,KACpB,CAAA,CAAE,GAAA,CAAI,2BAAA,CAA4B,SAAS,SAAS;AAAA;AACtD,WACF;AAAA,QACF;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,4 +1,5 @@
1
- import { ApiBlueprint, createExtensionInput, TranslationBlueprint } from '@backstage/frontend-plugin-api';
1
+ import { ApiBlueprint, createExtensionInput } from '@backstage/frontend-plugin-api';
2
+ import { TranslationBlueprint } from '@backstage/plugin-app-react';
2
3
  import { appLanguageApiRef, translationApiRef } from '@backstage/core-plugin-api/alpha';
3
4
  import { I18nextTranslationApi } from '../packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi.esm.js';
4
5
 
@@ -7,7 +8,7 @@ const TranslationsApi = ApiBlueprint.makeWithOverrides({
7
8
  inputs: {
8
9
  translations: createExtensionInput(
9
10
  [TranslationBlueprint.dataRefs.translation],
10
- { replaces: [{ id: "app", input: "translations" }] }
11
+ { replaces: [{ id: "app", input: "translations" }], internal: true }
11
12
  )
12
13
  },
13
14
  factory: (originalFactory, { inputs }) => {
@@ -16,15 +17,6 @@ const TranslationsApi = ApiBlueprint.makeWithOverrides({
16
17
  api: translationApiRef,
17
18
  deps: { languageApi: appLanguageApiRef },
18
19
  factory: ({ languageApi }) => {
19
- const nonAppExtensions = inputs.translations.filter(
20
- (i) => i.node.spec.plugin?.id !== "app"
21
- );
22
- if (nonAppExtensions.length > 0) {
23
- const list = nonAppExtensions.map((i) => i.node.spec.id).join(", ");
24
- console.warn(
25
- `DEPRECATION WARNING: Translations should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${list}`
26
- );
27
- }
28
20
  return I18nextTranslationApi.create({
29
21
  languageApi,
30
22
  resources: inputs.translations.map(
@@ -1 +1 @@
1
- {"version":3,"file":"TranslationsApi.esm.js","sources":["../../src/extensions/TranslationsApi.tsx"],"sourcesContent":["/*\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 */\nimport {\n ApiBlueprint,\n TranslationBlueprint,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport {\n appLanguageApiRef,\n translationApiRef,\n} from '@backstage/core-plugin-api/alpha';\n\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { I18nextTranslationApi } from '../../../../packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi';\n\n/**\n * Contains translations that are installed in the app.\n */\nexport const TranslationsApi = ApiBlueprint.makeWithOverrides({\n name: 'translations',\n inputs: {\n translations: createExtensionInput(\n [TranslationBlueprint.dataRefs.translation],\n { replaces: [{ id: 'app', input: 'translations' }] },\n ),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: translationApiRef,\n deps: { languageApi: appLanguageApiRef },\n factory: ({ languageApi }) => {\n const nonAppExtensions = inputs.translations.filter(\n i => i.node.spec.plugin?.id !== 'app',\n );\n\n if (nonAppExtensions.length > 0) {\n const list = nonAppExtensions.map(i => i.node.spec.id).join(', ');\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Translations should only be installed as an extension in the app plugin. ` +\n `You can either use appPlugin.override(), or a module for the app plugin. The following extension will be ignored in the future: ${list}`,\n );\n }\n\n return I18nextTranslationApi.create({\n languageApi,\n resources: inputs.translations.map(i =>\n i.get(TranslationBlueprint.dataRefs.translation),\n ),\n });\n },\n }),\n );\n },\n});\n"],"names":[],"mappings":";;;;AA+BO,MAAM,eAAA,GAAkB,aAAa,iBAAA,CAAkB;AAAA,EAC5D,IAAA,EAAM,cAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc,oBAAA;AAAA,MACZ,CAAC,oBAAA,CAAqB,QAAA,CAAS,WAAW,CAAA;AAAA,MAC1C,EAAE,UAAU,CAAC,EAAE,IAAI,KAAA,EAAO,KAAA,EAAO,cAAA,EAAgB,CAAA;AAAE;AACrD,GACF;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,iBAAA;AAAA,QACL,IAAA,EAAM,EAAE,WAAA,EAAa,iBAAA,EAAkB;AAAA,QACvC,OAAA,EAAS,CAAC,EAAE,WAAA,EAAY,KAAM;AAC5B,UAAA,MAAM,gBAAA,GAAmB,OAAO,YAAA,CAAa,MAAA;AAAA,YAC3C,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAA,CAAK,QAAQ,EAAA,KAAO;AAAA,WAClC;AAEA,UAAA,IAAI,gBAAA,CAAiB,SAAS,CAAA,EAAG;AAC/B,YAAA,MAAM,IAAA,GAAO,gBAAA,CAAiB,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,KAAK,IAAA,CAAK,EAAE,CAAA,CAAE,IAAA,CAAK,IAAI,CAAA;AAEhE,YAAA,OAAA,CAAQ,IAAA;AAAA,cACN,iOACqI,IAAI,CAAA;AAAA,aAC3I;AAAA,UACF;AAEA,UAAA,OAAO,sBAAsB,MAAA,CAAO;AAAA,YAClC,WAAA;AAAA,YACA,SAAA,EAAW,OAAO,YAAA,CAAa,GAAA;AAAA,cAAI,CAAA,CAAA,KACjC,CAAA,CAAE,GAAA,CAAI,oBAAA,CAAqB,SAAS,WAAW;AAAA;AACjD,WACD,CAAA;AAAA,QACH;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"TranslationsApi.esm.js","sources":["../../src/extensions/TranslationsApi.tsx"],"sourcesContent":["/*\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 */\nimport {\n ApiBlueprint,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport { TranslationBlueprint } from '@backstage/plugin-app-react';\nimport {\n appLanguageApiRef,\n translationApiRef,\n} from '@backstage/core-plugin-api/alpha';\n\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { I18nextTranslationApi } from '../../../../packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi';\n\n/**\n * Contains translations that are installed in the app.\n */\nexport const TranslationsApi = ApiBlueprint.makeWithOverrides({\n name: 'translations',\n inputs: {\n translations: createExtensionInput(\n [TranslationBlueprint.dataRefs.translation],\n { replaces: [{ id: 'app', input: 'translations' }], internal: true },\n ),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory(defineParams =>\n defineParams({\n api: translationApiRef,\n deps: { languageApi: appLanguageApiRef },\n factory: ({ languageApi }) => {\n return I18nextTranslationApi.create({\n languageApi,\n resources: inputs.translations.map(i =>\n i.get(TranslationBlueprint.dataRefs.translation),\n ),\n });\n },\n }),\n );\n },\n});\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,eAAA,GAAkB,aAAa,iBAAA,CAAkB;AAAA,EAC5D,IAAA,EAAM,cAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc,oBAAA;AAAA,MACZ,CAAC,oBAAA,CAAqB,QAAA,CAAS,WAAW,CAAA;AAAA,MAC1C,EAAE,QAAA,EAAU,CAAC,EAAE,EAAA,EAAI,KAAA,EAAO,KAAA,EAAO,cAAA,EAAgB,CAAA,EAAG,QAAA,EAAU,IAAA;AAAK;AACrE,GACF;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,iBAAA;AAAA,QACL,IAAA,EAAM,EAAE,WAAA,EAAa,iBAAA,EAAkB;AAAA,QACvC,OAAA,EAAS,CAAC,EAAE,WAAA,EAAY,KAAM;AAC5B,UAAA,OAAO,sBAAsB,MAAA,CAAO;AAAA,YAClC,WAAA;AAAA,YACA,SAAA,EAAW,OAAO,YAAA,CAAa,GAAA;AAAA,cAAI,CAAA,CAAA,KACjC,CAAA,CAAE,GAAA,CAAI,oBAAA,CAAqB,SAAS,WAAW;AAAA;AACjD,WACD,CAAA;AAAA,QACH;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { SwappableComponentBlueprint, Progress as Progress$2, NotFoundErrorPage as NotFoundErrorPage$1, ErrorDisplay as ErrorDisplay$1 } from '@backstage/frontend-plugin-api';
2
+ import { Progress as Progress$2, NotFoundErrorPage as NotFoundErrorPage$1, ErrorDisplay as ErrorDisplay$1 } from '@backstage/frontend-plugin-api';
3
+ import { SwappableComponentBlueprint } from '@backstage/plugin-app-react';
3
4
  import { Progress as Progress$1, ErrorPage, ErrorPanel } from '@backstage/core-components';
4
5
  import Button from '@material-ui/core/Button';
5
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"components.esm.js","sources":["../../src/extensions/components.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {\n NotFoundErrorPage as SwappableNotFoundErrorPage,\n Progress as SwappableProgress,\n ErrorDisplay as SwappableErrorDisplay,\n SwappableComponentBlueprint,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n ErrorPage,\n ErrorPanel,\n Progress as ProgressComponent,\n} from '@backstage/core-components';\nimport Button from '@material-ui/core/Button';\n\nexport const Progress = SwappableComponentBlueprint.make({\n name: 'core-progress',\n params: define =>\n define({\n component: SwappableProgress,\n loader: () => ProgressComponent,\n }),\n});\n\nexport const NotFoundErrorPage = SwappableComponentBlueprint.make({\n name: 'core-not-found-error-page',\n params: define =>\n define({\n component: SwappableNotFoundErrorPage,\n loader: () => () =>\n <ErrorPage status=\"404\" statusMessage=\"PAGE NOT FOUND\" />,\n }),\n});\n\nexport const ErrorDisplay = SwappableComponentBlueprint.make({\n name: 'core-error-display',\n params: define =>\n define({\n component: SwappableErrorDisplay,\n loader: () => props => {\n const { plugin, error, resetError } = props;\n const title = `Error in ${plugin?.id}`;\n return (\n <ErrorPanel title={title} error={error} defaultExpanded>\n <Button variant=\"outlined\" onClick={resetError}>\n Retry\n </Button>\n </ErrorPanel>\n );\n },\n }),\n});\n"],"names":["SwappableProgress","ProgressComponent","SwappableNotFoundErrorPage","SwappableErrorDisplay"],"mappings":";;;;;AA6BO,MAAM,QAAA,GAAW,4BAA4B,IAAA,CAAK;AAAA,EACvD,IAAA,EAAM,eAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAA,CAAO;AAAA,IACL,SAAA,EAAWA,UAAA;AAAA,IACX,QAAQ,MAAMC;AAAA,GACf;AACL,CAAC;AAEM,MAAM,iBAAA,GAAoB,4BAA4B,IAAA,CAAK;AAAA,EAChE,IAAA,EAAM,2BAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAA,CAAO;AAAA,IACL,SAAA,EAAWC,mBAAA;AAAA,IACX,MAAA,EAAQ,MAAM,sBACZ,GAAA,CAAC,aAAU,MAAA,EAAO,KAAA,EAAM,eAAc,gBAAA,EAAiB;AAAA,GAC1D;AACL,CAAC;AAEM,MAAM,YAAA,GAAe,4BAA4B,IAAA,CAAK;AAAA,EAC3D,IAAA,EAAM,oBAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAA,CAAO;AAAA,IACL,SAAA,EAAWC,cAAA;AAAA,IACX,MAAA,EAAQ,MAAM,CAAA,KAAA,KAAS;AACrB,MAAA,MAAM,EAAE,MAAA,EAAQ,KAAA,EAAO,UAAA,EAAW,GAAI,KAAA;AACtC,MAAA,MAAM,KAAA,GAAQ,CAAA,SAAA,EAAY,MAAA,EAAQ,EAAE,CAAA,CAAA;AACpC,MAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAc,KAAA,EAAc,eAAA,EAAe,IAAA,EACrD,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,UAAA,EAAW,OAAA,EAAS,UAAA,EAAY,mBAEhD,CAAA,EACF,CAAA;AAAA,IAEJ;AAAA,GACD;AACL,CAAC;;;;"}
1
+ {"version":3,"file":"components.esm.js","sources":["../../src/extensions/components.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {\n NotFoundErrorPage as SwappableNotFoundErrorPage,\n Progress as SwappableProgress,\n ErrorDisplay as SwappableErrorDisplay,\n} from '@backstage/frontend-plugin-api';\nimport { SwappableComponentBlueprint } from '@backstage/plugin-app-react';\nimport {\n ErrorPage,\n ErrorPanel,\n Progress as ProgressComponent,\n} from '@backstage/core-components';\nimport Button from '@material-ui/core/Button';\n\nexport const Progress = SwappableComponentBlueprint.make({\n name: 'core-progress',\n params: define =>\n define({\n component: SwappableProgress,\n loader: () => ProgressComponent,\n }),\n});\n\nexport const NotFoundErrorPage = SwappableComponentBlueprint.make({\n name: 'core-not-found-error-page',\n params: define =>\n define({\n component: SwappableNotFoundErrorPage,\n loader: () => () =>\n <ErrorPage status=\"404\" statusMessage=\"PAGE NOT FOUND\" />,\n }),\n});\n\nexport const ErrorDisplay = SwappableComponentBlueprint.make({\n name: 'core-error-display',\n params: define =>\n define({\n component: SwappableErrorDisplay,\n loader: () => props => {\n const { plugin, error, resetError } = props;\n const title = `Error in ${plugin?.id}`;\n return (\n <ErrorPanel title={title} error={error} defaultExpanded>\n <Button variant=\"outlined\" onClick={resetError}>\n Retry\n </Button>\n </ErrorPanel>\n );\n },\n }),\n});\n"],"names":["SwappableProgress","ProgressComponent","SwappableNotFoundErrorPage","SwappableErrorDisplay"],"mappings":";;;;;;AA4BO,MAAM,QAAA,GAAW,4BAA4B,IAAA,CAAK;AAAA,EACvD,IAAA,EAAM,eAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAA,CAAO;AAAA,IACL,SAAA,EAAWA,UAAA;AAAA,IACX,QAAQ,MAAMC;AAAA,GACf;AACL,CAAC;AAEM,MAAM,iBAAA,GAAoB,4BAA4B,IAAA,CAAK;AAAA,EAChE,IAAA,EAAM,2BAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAA,CAAO;AAAA,IACL,SAAA,EAAWC,mBAAA;AAAA,IACX,MAAA,EAAQ,MAAM,sBACZ,GAAA,CAAC,aAAU,MAAA,EAAO,KAAA,EAAM,eAAc,gBAAA,EAAiB;AAAA,GAC1D;AACL,CAAC;AAEM,MAAM,YAAA,GAAe,4BAA4B,IAAA,CAAK;AAAA,EAC3D,IAAA,EAAM,oBAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAA,CAAO;AAAA,IACL,SAAA,EAAWC,cAAA;AAAA,IACX,MAAA,EAAQ,MAAM,CAAA,KAAA,KAAS;AACrB,MAAA,MAAM,EAAE,MAAA,EAAQ,KAAA,EAAO,UAAA,EAAW,GAAI,KAAA;AACtC,MAAA,MAAM,KAAA,GAAQ,CAAA,SAAA,EAAY,MAAA,EAAQ,EAAE,CAAA,CAAA;AACpC,MAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAc,KAAA,EAAc,eAAA,EAAe,IAAA,EACrD,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,UAAA,EAAW,OAAA,EAAS,UAAA,EAAY,mBAEhD,CAAA,EACF,CAAA;AAAA,IAEJ;AAAA,GACD;AACL,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _backstage_plugin_app_react from '@backstage/plugin-app-react';
1
2
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
3
  import * as react from 'react';
3
4
 
@@ -11,6 +12,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
11
12
  root: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
12
13
  singleton: true;
13
14
  optional: false;
15
+ internal: false;
14
16
  }>;
15
17
  };
16
18
  params: never;
@@ -25,10 +27,12 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
25
27
  nav: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
26
28
  singleton: true;
27
29
  optional: false;
30
+ internal: false;
28
31
  }>;
29
32
  content: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
30
33
  singleton: true;
31
34
  optional: false;
35
+ internal: false;
32
36
  }>;
33
37
  };
34
38
  params: never;
@@ -47,10 +51,12 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
47
51
  }, "core.nav-item.target", {}>, {
48
52
  singleton: false;
49
53
  optional: false;
54
+ internal: false;
50
55
  }>;
51
- content: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.NavContentComponent, "core.nav-content.component", {}>, {
56
+ content: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_plugin_app_react.NavContentComponent, "core.nav-content.component", {}>, {
52
57
  singleton: true;
53
58
  optional: true;
59
+ internal: true;
54
60
  }>;
55
61
  };
56
62
  params: never;
@@ -67,24 +73,29 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
67
73
  }) => JSX.Element | null, "app.router.wrapper", {}>, {
68
74
  singleton: true;
69
75
  optional: true;
76
+ internal: true;
70
77
  }>;
71
- signInPage: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.ComponentType<_backstage_frontend_plugin_api.SignInPageProps>, "core.sign-in-page.component", {}>, {
78
+ signInPage: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.ComponentType<_backstage_plugin_app_react.SignInPageProps>, "core.sign-in-page.component", {}>, {
72
79
  singleton: true;
73
80
  optional: true;
81
+ internal: true;
74
82
  }>;
75
83
  children: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
76
84
  singleton: true;
77
85
  optional: false;
86
+ internal: false;
78
87
  }>;
79
88
  elements: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
80
89
  singleton: false;
81
90
  optional: false;
91
+ internal: false;
82
92
  }>;
83
93
  wrappers: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(props: {
84
94
  children: react.ReactNode;
85
95
  }) => JSX.Element | null, "app.root.wrapper", {}>, {
86
96
  singleton: false;
87
97
  optional: false;
98
+ internal: true;
88
99
  }>;
89
100
  };
90
101
  params: never;
@@ -101,6 +112,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
101
112
  }>, {
102
113
  singleton: false;
103
114
  optional: false;
115
+ internal: false;
104
116
  }>;
105
117
  };
106
118
  params: never;
@@ -124,6 +136,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
124
136
  implementations: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnalyticsImplementationFactory<{}>, "core.analytics.factory", {}>, {
125
137
  singleton: false;
126
138
  optional: false;
139
+ internal: false;
127
140
  }>;
128
141
  };
129
142
  kind: "api";
@@ -153,6 +166,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
153
166
  themes: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AppTheme, "core.theme.theme", {}>, {
154
167
  singleton: false;
155
168
  optional: false;
169
+ internal: true;
156
170
  }>;
157
171
  };
158
172
  kind: "api";
@@ -277,6 +291,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
277
291
  }, "core.icons", {}>, {
278
292
  singleton: false;
279
293
  optional: false;
294
+ internal: true;
280
295
  }>;
281
296
  };
282
297
  kind: "api";
@@ -349,6 +364,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
349
364
  }>, "core.plugin-wrapper.loader", {}>, {
350
365
  singleton: false;
351
366
  optional: false;
367
+ internal: false;
352
368
  }>;
353
369
  };
354
370
  kind: "api";
@@ -393,6 +409,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
393
409
  }, "core.swappableComponent", {}>, {
394
410
  singleton: false;
395
411
  optional: false;
412
+ internal: true;
396
413
  }>;
397
414
  };
398
415
  kind: "api";
@@ -409,6 +426,7 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
409
426
  }, boolean>, "core.translation.translation", {}>, {
410
427
  singleton: false;
411
428
  optional: false;
429
+ internal: true;
412
430
  }>;
413
431
  };
414
432
  kind: "api";
@@ -540,10 +558,10 @@ declare const appPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugi
540
558
  name: undefined;
541
559
  config: {};
542
560
  configInput: {};
543
- output: _backstage_frontend_plugin_api.ExtensionDataRef<react.ComponentType<_backstage_frontend_plugin_api.SignInPageProps>, "core.sign-in-page.component", {}>;
561
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<react.ComponentType<_backstage_plugin_app_react.SignInPageProps>, "core.sign-in-page.component", {}>;
544
562
  inputs: {};
545
563
  params: {
546
- loader: () => Promise<react.ComponentType<_backstage_frontend_plugin_api.SignInPageProps>>;
564
+ loader: () => Promise<react.ComponentType<_backstage_plugin_app_react.SignInPageProps>>;
547
565
  };
548
566
  }>;
549
567
  "theme:app/dark": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-app";
2
- var version = "0.3.5";
2
+ var version = "0.4.0-next.1";
3
3
  var backstage = {
4
4
  role: "frontend-plugin",
5
5
  pluginId: "app",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-app",
3
- "version": "0.3.5",
3
+ "version": "0.4.0-next.1",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "app",
@@ -63,15 +63,15 @@
63
63
  "test": "backstage-cli package test"
64
64
  },
65
65
  "dependencies": {
66
- "@backstage/core-components": "^0.18.6",
67
- "@backstage/core-plugin-api": "^1.12.2",
68
- "@backstage/frontend-plugin-api": "^0.13.4",
69
- "@backstage/integration-react": "^1.2.14",
70
- "@backstage/plugin-app-react": "^0.1.0",
71
- "@backstage/plugin-permission-react": "^0.4.39",
72
- "@backstage/theme": "^0.7.1",
73
- "@backstage/types": "^1.2.2",
74
- "@backstage/version-bridge": "^1.0.11",
66
+ "@backstage/core-components": "0.18.7-next.1",
67
+ "@backstage/core-plugin-api": "1.12.3-next.0",
68
+ "@backstage/frontend-plugin-api": "0.14.0-next.1",
69
+ "@backstage/integration-react": "1.2.15-next.1",
70
+ "@backstage/plugin-app-react": "0.1.1-next.0",
71
+ "@backstage/plugin-permission-react": "0.4.40-next.0",
72
+ "@backstage/theme": "0.7.2-next.0",
73
+ "@backstage/types": "1.2.2",
74
+ "@backstage/version-bridge": "1.0.11",
75
75
  "@material-ui/core": "^4.9.13",
76
76
  "@material-ui/icons": "^4.9.1",
77
77
  "@material-ui/lab": "^4.0.0-alpha.61",
@@ -80,11 +80,11 @@
80
80
  "zod": "^3.25.76"
81
81
  },
82
82
  "devDependencies": {
83
- "@backstage/cli": "^0.35.3",
84
- "@backstage/dev-utils": "^1.1.19",
85
- "@backstage/frontend-defaults": "^0.3.6",
86
- "@backstage/frontend-test-utils": "^0.4.5",
87
- "@backstage/test-utils": "^1.7.14",
83
+ "@backstage/cli": "0.35.4-next.1",
84
+ "@backstage/dev-utils": "1.1.20-next.1",
85
+ "@backstage/frontend-defaults": "0.4.0-next.1",
86
+ "@backstage/frontend-test-utils": "0.4.6-next.1",
87
+ "@backstage/test-utils": "1.7.15-next.1",
88
88
  "@testing-library/jest-dom": "^6.0.0",
89
89
  "@testing-library/react": "^16.0.0",
90
90
  "@testing-library/user-event": "^14.0.0",