@backstage/frontend-app-api 0.7.4-next.0 → 0.7.4
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 +5 -10
- package/dist/extensions/App.esm.js +1 -4
- package/dist/extensions/App.esm.js.map +1 -1
- package/dist/frontend-plugin-api/src/wiring/createExtension.esm.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/wiring/createApp.esm.js +2 -3
- package/dist/wiring/createApp.esm.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
# @backstage/frontend-app-api
|
|
2
2
|
|
|
3
|
-
## 0.7.4
|
|
3
|
+
## 0.7.4
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- 7777b5f: Support icon overriding with the new `IconBundleBlueprint` API.
|
|
8
7
|
- Updated dependencies
|
|
9
|
-
- @backstage/
|
|
10
|
-
- @backstage/core-components@0.14.
|
|
11
|
-
- @backstage/core-app-api@1.14.1-next.0
|
|
12
|
-
- @backstage/config@1.2.0
|
|
8
|
+
- @backstage/core-app-api@1.14.1
|
|
9
|
+
- @backstage/core-components@0.14.9
|
|
13
10
|
- @backstage/core-plugin-api@1.9.3
|
|
14
|
-
- @backstage/
|
|
15
|
-
- @backstage/
|
|
16
|
-
- @backstage/types@1.1.1
|
|
17
|
-
- @backstage/version-bridge@1.0.8
|
|
11
|
+
- @backstage/frontend-plugin-api@0.6.7
|
|
12
|
+
- @backstage/config@1.2.0
|
|
18
13
|
|
|
19
14
|
## 0.7.3
|
|
20
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { createExtension, createExtensionInput, createApiExtension, createThemeExtension, createComponentExtension, createTranslationExtension,
|
|
2
|
+
import { createExtension, createExtensionInput, createApiExtension, createThemeExtension, createComponentExtension, createTranslationExtension, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
3
3
|
|
|
4
4
|
const App = createExtension({
|
|
5
5
|
namespace: "app",
|
|
@@ -18,9 +18,6 @@ const App = createExtension({
|
|
|
18
18
|
translations: createExtensionInput({
|
|
19
19
|
translation: createTranslationExtension.translationDataRef
|
|
20
20
|
}),
|
|
21
|
-
icons: createExtensionInput({
|
|
22
|
-
icon: IconBundleBlueprint.dataRefs.icons
|
|
23
|
-
}),
|
|
24
21
|
root: createExtensionInput(
|
|
25
22
|
{
|
|
26
23
|
element: coreExtensionData.reactElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.esm.js","sources":["../../src/extensions/App.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 React from 'react';\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createApiExtension,\n createComponentExtension,\n createExtension,\n createExtensionInput,\n createThemeExtension,\n createTranslationExtension,\n
|
|
1
|
+
{"version":3,"file":"App.esm.js","sources":["../../src/extensions/App.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 React from 'react';\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createApiExtension,\n createComponentExtension,\n createExtension,\n createExtensionInput,\n createThemeExtension,\n createTranslationExtension,\n} from '@backstage/frontend-plugin-api';\n\nexport const App = createExtension({\n namespace: 'app',\n attachTo: { id: 'root', input: 'default' }, // ignored\n inputs: {\n apis: createExtensionInput({\n api: createApiExtension.factoryDataRef,\n }),\n themes: createExtensionInput({\n theme: createThemeExtension.themeDataRef,\n }),\n components: createExtensionInput({\n component: createComponentExtension.componentDataRef,\n }),\n translations: createExtensionInput({\n translation: createTranslationExtension.translationDataRef,\n }),\n root: createExtensionInput(\n {\n element: coreExtensionData.reactElement,\n },\n { singleton: true },\n ),\n },\n output: {\n root: coreExtensionData.reactElement,\n },\n factory({ node, inputs }) {\n return {\n root: (\n <ExtensionBoundary node={node}>\n {inputs.root.output.element}\n </ExtensionBoundary>\n ),\n };\n },\n});\n"],"names":[],"mappings":";;;AA4BO,MAAM,MAAM,eAAgB,CAAA;AAAA,EACjC,SAAW,EAAA,KAAA;AAAA,EACX,QAAU,EAAA,EAAE,EAAI,EAAA,MAAA,EAAQ,OAAO,SAAU,EAAA;AAAA;AAAA,EACzC,MAAQ,EAAA;AAAA,IACN,MAAM,oBAAqB,CAAA;AAAA,MACzB,KAAK,kBAAmB,CAAA,cAAA;AAAA,KACzB,CAAA;AAAA,IACD,QAAQ,oBAAqB,CAAA;AAAA,MAC3B,OAAO,oBAAqB,CAAA,YAAA;AAAA,KAC7B,CAAA;AAAA,IACD,YAAY,oBAAqB,CAAA;AAAA,MAC/B,WAAW,wBAAyB,CAAA,gBAAA;AAAA,KACrC,CAAA;AAAA,IACD,cAAc,oBAAqB,CAAA;AAAA,MACjC,aAAa,0BAA2B,CAAA,kBAAA;AAAA,KACzC,CAAA;AAAA,IACD,IAAM,EAAA,oBAAA;AAAA,MACJ;AAAA,QACE,SAAS,iBAAkB,CAAA,YAAA;AAAA,OAC7B;AAAA,MACA,EAAE,WAAW,IAAK,EAAA;AAAA,KACpB;AAAA,GACF;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAM,iBAAkB,CAAA,YAAA;AAAA,GAC1B;AAAA,EACA,OAAQ,CAAA,EAAE,IAAM,EAAA,MAAA,EAAU,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,sBACG,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,QAChB,MAAO,CAAA,IAAA,CAAK,OAAO,OACtB,CAAA;AAAA,KAEJ,CAAA;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createExtension.esm.js","sources":["../../../../../frontend-plugin-api/src/wiring/createExtension.ts"],"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 { AppNode } from '../apis';\nimport { PortableSchema } from '../schema';\nimport { Expand } from '../types';\nimport { ExtensionDataRef } from './createExtensionDataRef';\nimport { ExtensionInput } from './createExtensionInput';\n\n/** @public */\nexport type AnyExtensionDataMap = {\n [name in string]: ExtensionDataRef<unknown,
|
|
1
|
+
{"version":3,"file":"createExtension.esm.js","sources":["../../../../../frontend-plugin-api/src/wiring/createExtension.ts"],"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 { AppNode } from '../apis';\nimport { PortableSchema } from '../schema';\nimport { Expand } from '../types';\nimport { ExtensionDataRef } from './createExtensionDataRef';\nimport { ExtensionInput } from './createExtensionInput';\n\n/** @public */\nexport type AnyExtensionDataMap = {\n [name in string]: ExtensionDataRef<unknown, { optional?: true }>;\n};\n\n/** @public */\nexport type AnyExtensionInputMap = {\n [inputName in string]: ExtensionInput<\n AnyExtensionDataMap,\n { optional: boolean; singleton: boolean }\n >;\n};\n\n/**\n * Converts an extension data map into the matching concrete data values type.\n * @public\n */\nexport type ExtensionDataValues<TExtensionData extends AnyExtensionDataMap> = {\n [DataName in keyof TExtensionData as TExtensionData[DataName]['config'] extends {\n optional: true;\n }\n ? never\n : DataName]: TExtensionData[DataName]['T'];\n} & {\n [DataName in keyof TExtensionData as TExtensionData[DataName]['config'] extends {\n optional: true;\n }\n ? DataName\n : never]?: TExtensionData[DataName]['T'];\n};\n\n/**\n * Convert a single extension input into a matching resolved input.\n * @public\n */\nexport type ResolvedExtensionInput<TExtensionData extends AnyExtensionDataMap> =\n {\n node: AppNode;\n output: ExtensionDataValues<TExtensionData>;\n };\n\n/**\n * Converts an extension input map into a matching collection of resolved inputs.\n * @public\n */\nexport type ResolvedExtensionInputs<\n TInputs extends { [name in string]: ExtensionInput<any, any> },\n> = {\n [InputName in keyof TInputs]: false extends TInputs[InputName]['config']['singleton']\n ? Array<Expand<ResolvedExtensionInput<TInputs[InputName]['extensionData']>>>\n : false extends TInputs[InputName]['config']['optional']\n ? Expand<ResolvedExtensionInput<TInputs[InputName]['extensionData']>>\n : Expand<\n ResolvedExtensionInput<TInputs[InputName]['extensionData']> | undefined\n >;\n};\n\n/** @public */\nexport interface CreateExtensionOptions<\n TOutput extends AnyExtensionDataMap,\n TInputs extends AnyExtensionInputMap,\n TConfig,\n> {\n kind?: string;\n namespace?: string;\n name?: string;\n attachTo: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n output: TOutput;\n configSchema?: PortableSchema<TConfig>;\n factory(options: {\n node: AppNode;\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }): Expand<ExtensionDataValues<TOutput>>;\n}\n\n/** @public */\nexport interface ExtensionDefinition<TConfig> {\n $$type: '@backstage/ExtensionDefinition';\n readonly kind?: string;\n readonly namespace?: string;\n readonly name?: string;\n readonly attachTo: { id: string; input: string };\n readonly disabled: boolean;\n readonly configSchema?: PortableSchema<TConfig>;\n}\n\n/** @internal */\nexport interface InternalExtensionDefinition<TConfig>\n extends ExtensionDefinition<TConfig> {\n readonly version: 'v1';\n readonly inputs: AnyExtensionInputMap;\n readonly output: AnyExtensionDataMap;\n factory(options: {\n node: AppNode;\n config: TConfig;\n inputs: ResolvedExtensionInputs<any>;\n }): ExtensionDataValues<any>;\n}\n\n/** @internal */\nexport function toInternalExtensionDefinition<TConfig>(\n overrides: ExtensionDefinition<TConfig>,\n): InternalExtensionDefinition<TConfig> {\n const internal = overrides as InternalExtensionDefinition<TConfig>;\n if (internal.$$type !== '@backstage/ExtensionDefinition') {\n throw new Error(\n `Invalid extension definition instance, bad type '${internal.$$type}'`,\n );\n }\n if (internal.version !== 'v1') {\n throw new Error(\n `Invalid extension definition instance, bad version '${internal.version}'`,\n );\n }\n return internal;\n}\n\n/** @public */\nexport function createExtension<\n TOutput extends AnyExtensionDataMap,\n TInputs extends AnyExtensionInputMap,\n TConfig = never,\n>(\n options: CreateExtensionOptions<TOutput, TInputs, TConfig>,\n): ExtensionDefinition<TConfig> {\n return {\n $$type: '@backstage/ExtensionDefinition',\n version: 'v1',\n kind: options.kind,\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo,\n disabled: options.disabled ?? false,\n inputs: options.inputs ?? {},\n output: options.output,\n configSchema: options.configSchema,\n factory({ inputs, ...rest }) {\n // TODO: Simplify this, but TS wouldn't infer the input type for some reason\n return options.factory({\n inputs: inputs as Expand<ResolvedExtensionInputs<TInputs>>,\n ...rest,\n });\n },\n toString() {\n const parts: string[] = [];\n if (options.kind) {\n parts.push(`kind=${options.kind}`);\n }\n if (options.namespace) {\n parts.push(`namespace=${options.namespace}`);\n }\n if (options.name) {\n parts.push(`name=${options.name}`);\n }\n parts.push(`attachTo=${options.attachTo.id}@${options.attachTo.input}`);\n return `ExtensionDefinition{${parts.join(',')}}`;\n },\n } as InternalExtensionDefinition<TConfig>;\n}\n"],"names":[],"mappings":"AA6HO,SAAS,8BACd,SACsC,EAAA;AACtC,EAAA,MAAM,QAAW,GAAA,SAAA,CAAA;AACjB,EAAI,IAAA,QAAA,CAAS,WAAW,gCAAkC,EAAA;AACxD,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,iDAAA,EAAoD,SAAS,MAAM,CAAA,CAAA,CAAA;AAAA,KACrE,CAAA;AAAA,GACF;AACA,EAAI,IAAA,QAAA,CAAS,YAAY,IAAM,EAAA;AAC7B,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,oDAAA,EAAuD,SAAS,OAAO,CAAA,CAAA,CAAA;AAAA,KACzE,CAAA;AAAA,GACF;AACA,EAAO,OAAA,QAAA,CAAA;AACT;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,6 @@ interface CreateAppFeatureLoader {
|
|
|
61
61
|
}
|
|
62
62
|
/** @public */
|
|
63
63
|
declare function createApp(options?: {
|
|
64
|
-
/** @deprecated - Please use {@link @backstage/frontend-plugin-api#IconBundleBlueprint} to make new icon bundles which can be installed in the app seperately */
|
|
65
64
|
icons?: {
|
|
66
65
|
[key in string]: IconComponent;
|
|
67
66
|
};
|
|
@@ -89,7 +88,6 @@ declare function createApp(options?: {
|
|
|
89
88
|
* @public
|
|
90
89
|
*/
|
|
91
90
|
declare function createSpecializedApp(options?: {
|
|
92
|
-
/** @deprecated - Please use {@link @backstage/frontend-plugin-api#IconBundleBlueprint} to make new icon bundles which can be installed in the app seperately */
|
|
93
91
|
icons?: {
|
|
94
92
|
[key in string]: IconComponent;
|
|
95
93
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ConfigReader } from '@backstage/config';
|
|
3
|
-
import { createApiExtension, coreExtensionData, createThemeExtension, createTranslationExtension,
|
|
3
|
+
import { createApiExtension, coreExtensionData, createThemeExtension, createTranslationExtension, appTreeApiRef, routeResolutionApiRef, componentsApiRef, iconsApiRef } from '@backstage/frontend-plugin-api';
|
|
4
4
|
import { App } from '../extensions/App.esm.js';
|
|
5
5
|
import { AppRoutes } from '../extensions/AppRoutes.esm.js';
|
|
6
6
|
import { AppLayout } from '../extensions/AppLayout.esm.js';
|
|
@@ -202,7 +202,6 @@ function createApiHolder(tree, configApi, appIdentityProxy, routeResolutionApi,
|
|
|
202
202
|
).filter(
|
|
203
203
|
(x) => !!x
|
|
204
204
|
) ?? [];
|
|
205
|
-
const extensionIcons = tree.root.edges.attachments.get("icons")?.map((e) => e.instance?.getData(IconBundleBlueprint.dataRefs.icons)).reduce((acc, bundle) => ({ ...acc, ...bundle }), {});
|
|
206
205
|
for (const factory of pluginApis) {
|
|
207
206
|
factoryRegistry.register("default", factory);
|
|
208
207
|
}
|
|
@@ -236,7 +235,7 @@ function createApiHolder(tree, configApi, appIdentityProxy, routeResolutionApi,
|
|
|
236
235
|
factoryRegistry.register("static", {
|
|
237
236
|
api: iconsApiRef,
|
|
238
237
|
deps: {},
|
|
239
|
-
factory: () => new DefaultIconsApi({ ...icons, ...
|
|
238
|
+
factory: () => new DefaultIconsApi({ ...icons, ...icons$1 })
|
|
240
239
|
});
|
|
241
240
|
factoryRegistry.register("static", {
|
|
242
241
|
api: appThemeApiRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApp.esm.js","sources":["../../src/wiring/createApp.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 React, { JSX, ReactNode } from 'react';\nimport { ConfigReader } from '@backstage/config';\nimport {\n AppTree,\n appTreeApiRef,\n componentsApiRef,\n coreExtensionData,\n createApiExtension,\n createThemeExtension,\n createTranslationExtension,\n FrontendFeature,\n IconBundleBlueprint,\n iconsApiRef,\n RouteResolutionApi,\n routeResolutionApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { App } from '../extensions/App';\nimport { AppRoutes } from '../extensions/AppRoutes';\nimport { AppLayout } from '../extensions/AppLayout';\nimport { AppNav } from '../extensions/AppNav';\nimport {\n AnyApiFactory,\n ApiHolder,\n appThemeApiRef,\n ConfigApi,\n configApiRef,\n IconComponent,\n featureFlagsApiRef,\n identityApiRef,\n AppTheme,\n errorApiRef,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport { getAvailableFeatures } from './discovery';\nimport {\n ApiFactoryRegistry,\n ApiProvider,\n ApiResolver,\n AppThemeSelector,\n} from '@backstage/core-app-api';\n\n// TODO: Get rid of all of these\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { isProtectedApp } from '../../../core-app-api/src/app/isProtectedApp';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppThemeProvider } from '../../../core-app-api/src/app/AppThemeProvider';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppIdentityProxy } from '../../../core-app-api/src/apis/implementations/IdentityApi/AppIdentityProxy';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { LocalStorageFeatureFlags } from '../../../core-app-api/src/apis/implementations/FeatureFlagsApi/LocalStorageFeatureFlags';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { defaultConfigLoaderSync } from '../../../core-app-api/src/app/defaultConfigLoader';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { overrideBaseUrlConfigs } from '../../../core-app-api/src/app/overrideBaseUrlConfigs';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppLanguageSelector } from '../../../core-app-api/src/apis/implementations/AppLanguageApi/AppLanguageSelector';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { I18nextTranslationApi } from '../../../core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { resolveExtensionDefinition } from '../../../frontend-plugin-api/src/wiring/resolveExtensionDefinition';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { apis as defaultApis } from '../../../app-defaults/src/defaults';\nimport { DarkTheme, LightTheme } from '../extensions/themes';\nimport {\n oauthRequestDialogAppRootElement,\n alertDisplayAppRootElement,\n} from '../extensions/elements';\nimport { extractRouteInfoFromAppNode } from '../routing/extractRouteInfoFromAppNode';\nimport {\n appLanguageApiRef,\n translationApiRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { CreateAppRouteBinder } from '../routing';\nimport { RouteResolver } from '../routing/RouteResolver';\nimport { resolveRouteBindings } from '../routing/resolveRouteBindings';\nimport { collectRouteIds } from '../routing/collectRouteIds';\nimport { createAppTree } from '../tree';\nimport {\n DefaultProgressComponent,\n DefaultErrorBoundaryComponent,\n DefaultNotFoundErrorPageComponent,\n} from '../extensions/components';\nimport { InternalAppContext } from './InternalAppContext';\nimport { AppRoot } from '../extensions/AppRoot';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { toInternalBackstagePlugin } from '../../../frontend-plugin-api/src/wiring/createPlugin';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { toInternalExtensionOverrides } from '../../../frontend-plugin-api/src/wiring/createExtensionOverrides';\nimport { DefaultComponentsApi } from '../apis/implementations/ComponentsApi';\nimport { DefaultIconsApi } from '../apis/implementations/IconsApi';\nimport { stringifyError } from '@backstage/errors';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { icons as defaultIcons } from '../../../app-defaults/src/defaults';\nimport { getBasePath } from '../routing/getBasePath';\n\nconst DefaultApis = defaultApis.map(factory => createApiExtension({ factory }));\n\nexport const builtinExtensions = [\n App,\n AppRoot,\n AppRoutes,\n AppNav,\n AppLayout,\n DefaultProgressComponent,\n DefaultErrorBoundaryComponent,\n DefaultNotFoundErrorPageComponent,\n LightTheme,\n DarkTheme,\n oauthRequestDialogAppRootElement,\n alertDisplayAppRootElement,\n ...DefaultApis,\n].map(def => resolveExtensionDefinition(def));\n\nfunction deduplicateFeatures(\n allFeatures: FrontendFeature[],\n): FrontendFeature[] {\n // Start by removing duplicates by reference\n const features = Array.from(new Set(allFeatures));\n\n // Plugins are deduplicated by ID, last one wins\n const seenIds = new Set<string>();\n return features\n .reverse()\n .filter(feature => {\n if (feature.$$type !== '@backstage/BackstagePlugin') {\n return true;\n }\n if (seenIds.has(feature.id)) {\n return false;\n }\n seenIds.add(feature.id);\n return true;\n })\n .reverse();\n}\n\n/**\n * A source of dynamically loaded frontend features.\n *\n * @public\n */\nexport interface CreateAppFeatureLoader {\n /**\n * Returns name of this loader. suitable for showing to users.\n */\n getLoaderName(): string;\n\n /**\n * Loads a number of features dynamically.\n */\n load(options: { config: ConfigApi }): Promise<{\n features: FrontendFeature[];\n }>;\n}\n\n/** @public */\nexport function createApp(options?: {\n /** @deprecated - Please use {@link @backstage/frontend-plugin-api#IconBundleBlueprint} to make new icon bundles which can be installed in the app seperately */\n icons?: { [key in string]: IconComponent };\n features?: (FrontendFeature | CreateAppFeatureLoader)[];\n configLoader?: () => Promise<{ config: ConfigApi }>;\n bindRoutes?(context: { bind: CreateAppRouteBinder }): void;\n /**\n * The component to render while loading the app (waiting for config, features, etc)\n *\n * Is the text \"Loading...\" by default.\n * If set to \"null\" then no loading fallback component is rendered. *\n */\n loadingComponent?: ReactNode;\n}): {\n createRoot(): JSX.Element;\n} {\n let suspenseFallback = options?.loadingComponent;\n if (suspenseFallback === undefined) {\n suspenseFallback = 'Loading...';\n }\n\n async function appLoader() {\n const config =\n (await options?.configLoader?.().then(c => c.config)) ??\n ConfigReader.fromConfigs(\n overrideBaseUrlConfigs(defaultConfigLoaderSync()),\n );\n\n const discoveredFeatures = getAvailableFeatures(config);\n\n const providedFeatures: FrontendFeature[] = [];\n for (const entry of options?.features ?? []) {\n if ('load' in entry) {\n try {\n const result = await entry.load({ config });\n providedFeatures.push(...result.features);\n } catch (e) {\n throw new Error(\n `Failed to read frontend features from loader '${entry.getLoaderName()}', ${stringifyError(\n e,\n )}`,\n );\n }\n } else {\n providedFeatures.push(entry);\n }\n }\n\n const app = createSpecializedApp({\n icons: options?.icons,\n config,\n features: [...discoveredFeatures, ...providedFeatures],\n bindRoutes: options?.bindRoutes,\n }).createRoot();\n\n return { default: () => app };\n }\n\n return {\n createRoot() {\n const LazyApp = React.lazy(appLoader);\n return (\n <React.Suspense fallback={suspenseFallback}>\n <LazyApp />\n </React.Suspense>\n );\n },\n };\n}\n\n/**\n * Synchronous version of {@link createApp}, expecting all features and\n * config to have been loaded already.\n *\n * @public\n */\nexport function createSpecializedApp(options?: {\n /** @deprecated - Please use {@link @backstage/frontend-plugin-api#IconBundleBlueprint} to make new icon bundles which can be installed in the app seperately */\n icons?: { [key in string]: IconComponent };\n features?: FrontendFeature[];\n config?: ConfigApi;\n bindRoutes?(context: { bind: CreateAppRouteBinder }): void;\n}): { createRoot(): JSX.Element } {\n const {\n features: duplicatedFeatures = [],\n config = new ConfigReader({}, 'empty-config'),\n } = options ?? {};\n\n const features = deduplicateFeatures(duplicatedFeatures);\n\n const tree = createAppTree({\n features,\n builtinExtensions,\n config,\n });\n\n const routeInfo = extractRouteInfoFromAppNode(tree.root);\n const routeBindings = resolveRouteBindings(\n options?.bindRoutes,\n config,\n collectRouteIds(features),\n );\n\n const appIdentityProxy = new AppIdentityProxy();\n const apiHolder = createApiHolder(\n tree,\n config,\n appIdentityProxy,\n new RouteResolver(\n routeInfo.routePaths,\n routeInfo.routeParents,\n routeInfo.routeObjects,\n routeBindings,\n getBasePath(config),\n ),\n options?.icons,\n );\n\n if (isProtectedApp()) {\n const discoveryApi = apiHolder.get(discoveryApiRef);\n const errorApi = apiHolder.get(errorApiRef);\n const fetchApi = apiHolder.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 const featureFlagApi = apiHolder.get(featureFlagsApiRef);\n if (featureFlagApi) {\n for (const feature of features) {\n if (feature.$$type === '@backstage/BackstagePlugin') {\n toInternalBackstagePlugin(feature).featureFlags.forEach(flag =>\n featureFlagApi.registerFlag({\n name: flag.name,\n pluginId: feature.id,\n }),\n );\n }\n if (feature.$$type === '@backstage/ExtensionOverrides') {\n toInternalExtensionOverrides(feature).featureFlags.forEach(flag =>\n featureFlagApi.registerFlag({ name: flag.name, pluginId: '' }),\n );\n }\n }\n }\n\n const rootEl = tree.root.instance!.getData(coreExtensionData.reactElement);\n\n const AppComponent = () => (\n <ApiProvider apis={apiHolder}>\n <AppThemeProvider>\n <InternalAppContext.Provider\n value={{ appIdentityProxy, routeObjects: routeInfo.routeObjects }}\n >\n {rootEl}\n </InternalAppContext.Provider>\n </AppThemeProvider>\n </ApiProvider>\n );\n\n return {\n createRoot() {\n return <AppComponent />;\n },\n };\n}\n\nfunction createApiHolder(\n tree: AppTree,\n configApi: ConfigApi,\n appIdentityProxy: AppIdentityProxy,\n routeResolutionApi: RouteResolutionApi,\n icons?: { [key in string]: IconComponent },\n): ApiHolder {\n const factoryRegistry = new ApiFactoryRegistry();\n\n const pluginApis =\n tree.root.edges.attachments\n .get('apis')\n ?.map(e => e.instance?.getData(createApiExtension.factoryDataRef))\n .filter((x): x is AnyApiFactory => !!x) ?? [];\n\n const themeExtensions =\n tree.root.edges.attachments\n .get('themes')\n ?.map(e => e.instance?.getData(createThemeExtension.themeDataRef))\n .filter((x): x is AppTheme => !!x) ?? [];\n\n const translationResources =\n tree.root.edges.attachments\n .get('translations')\n ?.map(e =>\n e.instance?.getData(createTranslationExtension.translationDataRef),\n )\n .filter(\n (x): x is typeof createTranslationExtension.translationDataRef.T => !!x,\n ) ?? [];\n\n const extensionIcons = tree.root.edges.attachments\n .get('icons')\n ?.map(e => e.instance?.getData(IconBundleBlueprint.dataRefs.icons))\n .reduce((acc, bundle) => ({ ...acc, ...bundle }), {});\n\n for (const factory of pluginApis) {\n factoryRegistry.register('default', factory);\n }\n\n // TODO: properly discovery feature flags, maybe rework the whole thing\n factoryRegistry.register('default', {\n api: featureFlagsApiRef,\n deps: {},\n factory: () => new LocalStorageFeatureFlags(),\n });\n\n factoryRegistry.register('static', {\n api: identityApiRef,\n deps: {},\n factory: () => appIdentityProxy,\n });\n\n factoryRegistry.register('static', {\n api: appTreeApiRef,\n deps: {},\n factory: () => ({\n getTree: () => ({ tree }),\n }),\n });\n\n factoryRegistry.register('static', {\n api: routeResolutionApiRef,\n deps: {},\n factory: () => routeResolutionApi,\n });\n\n factoryRegistry.register('static', {\n api: componentsApiRef,\n deps: {},\n factory: () => DefaultComponentsApi.fromTree(tree),\n });\n\n factoryRegistry.register('static', {\n api: iconsApiRef,\n deps: {},\n factory: () =>\n new DefaultIconsApi({ ...defaultIcons, ...extensionIcons, ...icons }),\n });\n\n factoryRegistry.register('static', {\n api: appThemeApiRef,\n deps: {},\n // TODO: add extension for registering themes\n factory: () => AppThemeSelector.createWithStorage(themeExtensions),\n });\n\n factoryRegistry.register('static', {\n api: appLanguageApiRef,\n deps: {},\n factory: () => AppLanguageSelector.createWithStorage(),\n });\n\n factoryRegistry.register('static', {\n api: configApiRef,\n deps: {},\n factory: () => configApi,\n });\n\n factoryRegistry.register('static', {\n api: appLanguageApiRef,\n deps: {},\n factory: () => AppLanguageSelector.createWithStorage(),\n });\n\n factoryRegistry.register('static', {\n api: translationApiRef,\n deps: { languageApi: appLanguageApiRef },\n factory: ({ languageApi }) =>\n I18nextTranslationApi.create({\n languageApi,\n resources: translationResources,\n }),\n });\n\n ApiResolver.validateFactories(factoryRegistry, factoryRegistry.getAllApis());\n\n return new ApiResolver(factoryRegistry);\n}\n"],"names":["defaultApis","icons","defaultIcons"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgHA,MAAM,WAAA,GAAcA,KAAY,GAAI,CAAA,CAAA,OAAA,KAAW,mBAAmB,EAAE,OAAA,EAAS,CAAC,CAAA,CAAA;AAEvE,MAAM,iBAAoB,GAAA;AAAA,EAC/B,GAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,6BAAA;AAAA,EACA,iCAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,gCAAA;AAAA,EACA,0BAAA;AAAA,EACA,GAAG,WAAA;AACL,CAAA,CAAE,GAAI,CAAA,CAAA,GAAA,KAAO,0BAA2B,CAAA,GAAG,CAAC,EAAA;AAE5C,SAAS,oBACP,WACmB,EAAA;AAEnB,EAAA,MAAM,WAAW,KAAM,CAAA,IAAA,CAAK,IAAI,GAAA,CAAI,WAAW,CAAC,CAAA,CAAA;AAGhD,EAAM,MAAA,OAAA,uBAAc,GAAY,EAAA,CAAA;AAChC,EAAA,OAAO,QACJ,CAAA,OAAA,EACA,CAAA,MAAA,CAAO,CAAW,OAAA,KAAA;AACjB,IAAI,IAAA,OAAA,CAAQ,WAAW,4BAA8B,EAAA;AACnD,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AACA,IAAA,IAAI,OAAQ,CAAA,GAAA,CAAI,OAAQ,CAAA,EAAE,CAAG,EAAA;AAC3B,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AACA,IAAQ,OAAA,CAAA,GAAA,CAAI,QAAQ,EAAE,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AAgB,SAAS,QAAU,EAAA;AAAA,IACjC,GAAK,EAAA,YAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,SAAS,MAAM,SAAA;AAAA,GAChB,CAAA,CAAA;AAED,EAAA,eAAA,CAAgB,SAAS,QAAU,EAAA;AAAA,IACjC,GAAK,EAAA,iBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,OAAA,EAAS,MAAM,mBAAA,CAAoB,iBAAkB,EAAA;AAAA,GACtD,CAAA,CAAA;AAED,EAAA,eAAA,CAAgB,SAAS,QAAU,EAAA;AAAA,IACjC,GAAK,EAAA,iBAAA;AAAA,IACL,IAAA,EAAM,EAAE,WAAA,EAAa,iBAAkB,EAAA;AAAA,IACvC,SAAS,CAAC,EAAE,WAAY,EAAA,KACtB,sBAAsB,MAAO,CAAA;AAAA,MAC3B,WAAA;AAAA,MACA,SAAW,EAAA,oBAAA;AAAA,KACZ,CAAA;AAAA,GACJ,CAAA,CAAA;AAED,EAAA,WAAA,CAAY,iBAAkB,CAAA,eAAA,EAAiB,eAAgB,CAAA,UAAA,EAAY,CAAA,CAAA;AAE3E,EAAO,OAAA,IAAI,YAAY,eAAe,CAAA,CAAA;AACxC;;;;"}
|
|
1
|
+
{"version":3,"file":"createApp.esm.js","sources":["../../src/wiring/createApp.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 React, { JSX, ReactNode } from 'react';\nimport { ConfigReader } from '@backstage/config';\nimport {\n AppTree,\n appTreeApiRef,\n componentsApiRef,\n coreExtensionData,\n createApiExtension,\n createThemeExtension,\n createTranslationExtension,\n FrontendFeature,\n iconsApiRef,\n RouteResolutionApi,\n routeResolutionApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { App } from '../extensions/App';\nimport { AppRoutes } from '../extensions/AppRoutes';\nimport { AppLayout } from '../extensions/AppLayout';\nimport { AppNav } from '../extensions/AppNav';\nimport {\n AnyApiFactory,\n ApiHolder,\n appThemeApiRef,\n ConfigApi,\n configApiRef,\n IconComponent,\n featureFlagsApiRef,\n identityApiRef,\n AppTheme,\n errorApiRef,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport { getAvailableFeatures } from './discovery';\nimport {\n ApiFactoryRegistry,\n ApiProvider,\n ApiResolver,\n AppThemeSelector,\n} from '@backstage/core-app-api';\n\n// TODO: Get rid of all of these\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { isProtectedApp } from '../../../core-app-api/src/app/isProtectedApp';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppThemeProvider } from '../../../core-app-api/src/app/AppThemeProvider';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppIdentityProxy } from '../../../core-app-api/src/apis/implementations/IdentityApi/AppIdentityProxy';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { LocalStorageFeatureFlags } from '../../../core-app-api/src/apis/implementations/FeatureFlagsApi/LocalStorageFeatureFlags';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { defaultConfigLoaderSync } from '../../../core-app-api/src/app/defaultConfigLoader';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { overrideBaseUrlConfigs } from '../../../core-app-api/src/app/overrideBaseUrlConfigs';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { AppLanguageSelector } from '../../../core-app-api/src/apis/implementations/AppLanguageApi/AppLanguageSelector';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { I18nextTranslationApi } from '../../../core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { resolveExtensionDefinition } from '../../../frontend-plugin-api/src/wiring/resolveExtensionDefinition';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { apis as defaultApis } from '../../../app-defaults/src/defaults';\nimport { DarkTheme, LightTheme } from '../extensions/themes';\nimport {\n oauthRequestDialogAppRootElement,\n alertDisplayAppRootElement,\n} from '../extensions/elements';\nimport { extractRouteInfoFromAppNode } from '../routing/extractRouteInfoFromAppNode';\nimport {\n appLanguageApiRef,\n translationApiRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { CreateAppRouteBinder } from '../routing';\nimport { RouteResolver } from '../routing/RouteResolver';\nimport { resolveRouteBindings } from '../routing/resolveRouteBindings';\nimport { collectRouteIds } from '../routing/collectRouteIds';\nimport { createAppTree } from '../tree';\nimport {\n DefaultProgressComponent,\n DefaultErrorBoundaryComponent,\n DefaultNotFoundErrorPageComponent,\n} from '../extensions/components';\nimport { InternalAppContext } from './InternalAppContext';\nimport { AppRoot } from '../extensions/AppRoot';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { toInternalBackstagePlugin } from '../../../frontend-plugin-api/src/wiring/createPlugin';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { toInternalExtensionOverrides } from '../../../frontend-plugin-api/src/wiring/createExtensionOverrides';\nimport { DefaultComponentsApi } from '../apis/implementations/ComponentsApi';\nimport { DefaultIconsApi } from '../apis/implementations/IconsApi';\nimport { stringifyError } from '@backstage/errors';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { icons as defaultIcons } from '../../../app-defaults/src/defaults';\nimport { getBasePath } from '../routing/getBasePath';\n\nconst DefaultApis = defaultApis.map(factory => createApiExtension({ factory }));\n\nexport const builtinExtensions = [\n App,\n AppRoot,\n AppRoutes,\n AppNav,\n AppLayout,\n DefaultProgressComponent,\n DefaultErrorBoundaryComponent,\n DefaultNotFoundErrorPageComponent,\n LightTheme,\n DarkTheme,\n oauthRequestDialogAppRootElement,\n alertDisplayAppRootElement,\n ...DefaultApis,\n].map(def => resolveExtensionDefinition(def));\n\nfunction deduplicateFeatures(\n allFeatures: FrontendFeature[],\n): FrontendFeature[] {\n // Start by removing duplicates by reference\n const features = Array.from(new Set(allFeatures));\n\n // Plugins are deduplicated by ID, last one wins\n const seenIds = new Set<string>();\n return features\n .reverse()\n .filter(feature => {\n if (feature.$$type !== '@backstage/BackstagePlugin') {\n return true;\n }\n if (seenIds.has(feature.id)) {\n return false;\n }\n seenIds.add(feature.id);\n return true;\n })\n .reverse();\n}\n\n/**\n * A source of dynamically loaded frontend features.\n *\n * @public\n */\nexport interface CreateAppFeatureLoader {\n /**\n * Returns name of this loader. suitable for showing to users.\n */\n getLoaderName(): string;\n\n /**\n * Loads a number of features dynamically.\n */\n load(options: { config: ConfigApi }): Promise<{\n features: FrontendFeature[];\n }>;\n}\n\n/** @public */\nexport function createApp(options?: {\n icons?: { [key in string]: IconComponent };\n features?: (FrontendFeature | CreateAppFeatureLoader)[];\n configLoader?: () => Promise<{ config: ConfigApi }>;\n bindRoutes?(context: { bind: CreateAppRouteBinder }): void;\n /**\n * The component to render while loading the app (waiting for config, features, etc)\n *\n * Is the text \"Loading...\" by default.\n * If set to \"null\" then no loading fallback component is rendered. *\n */\n loadingComponent?: ReactNode;\n}): {\n createRoot(): JSX.Element;\n} {\n let suspenseFallback = options?.loadingComponent;\n if (suspenseFallback === undefined) {\n suspenseFallback = 'Loading...';\n }\n\n async function appLoader() {\n const config =\n (await options?.configLoader?.().then(c => c.config)) ??\n ConfigReader.fromConfigs(\n overrideBaseUrlConfigs(defaultConfigLoaderSync()),\n );\n\n const discoveredFeatures = getAvailableFeatures(config);\n\n const providedFeatures: FrontendFeature[] = [];\n for (const entry of options?.features ?? []) {\n if ('load' in entry) {\n try {\n const result = await entry.load({ config });\n providedFeatures.push(...result.features);\n } catch (e) {\n throw new Error(\n `Failed to read frontend features from loader '${entry.getLoaderName()}', ${stringifyError(\n e,\n )}`,\n );\n }\n } else {\n providedFeatures.push(entry);\n }\n }\n\n const app = createSpecializedApp({\n icons: options?.icons,\n config,\n features: [...discoveredFeatures, ...providedFeatures],\n bindRoutes: options?.bindRoutes,\n }).createRoot();\n\n return { default: () => app };\n }\n\n return {\n createRoot() {\n const LazyApp = React.lazy(appLoader);\n return (\n <React.Suspense fallback={suspenseFallback}>\n <LazyApp />\n </React.Suspense>\n );\n },\n };\n}\n\n/**\n * Synchronous version of {@link createApp}, expecting all features and\n * config to have been loaded already.\n *\n * @public\n */\nexport function createSpecializedApp(options?: {\n icons?: { [key in string]: IconComponent };\n features?: FrontendFeature[];\n config?: ConfigApi;\n bindRoutes?(context: { bind: CreateAppRouteBinder }): void;\n}): { createRoot(): JSX.Element } {\n const {\n features: duplicatedFeatures = [],\n config = new ConfigReader({}, 'empty-config'),\n } = options ?? {};\n\n const features = deduplicateFeatures(duplicatedFeatures);\n\n const tree = createAppTree({\n features,\n builtinExtensions,\n config,\n });\n\n const routeInfo = extractRouteInfoFromAppNode(tree.root);\n const routeBindings = resolveRouteBindings(\n options?.bindRoutes,\n config,\n collectRouteIds(features),\n );\n\n const appIdentityProxy = new AppIdentityProxy();\n const apiHolder = createApiHolder(\n tree,\n config,\n appIdentityProxy,\n new RouteResolver(\n routeInfo.routePaths,\n routeInfo.routeParents,\n routeInfo.routeObjects,\n routeBindings,\n getBasePath(config),\n ),\n options?.icons,\n );\n\n if (isProtectedApp()) {\n const discoveryApi = apiHolder.get(discoveryApiRef);\n const errorApi = apiHolder.get(errorApiRef);\n const fetchApi = apiHolder.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 const featureFlagApi = apiHolder.get(featureFlagsApiRef);\n if (featureFlagApi) {\n for (const feature of features) {\n if (feature.$$type === '@backstage/BackstagePlugin') {\n toInternalBackstagePlugin(feature).featureFlags.forEach(flag =>\n featureFlagApi.registerFlag({\n name: flag.name,\n pluginId: feature.id,\n }),\n );\n }\n if (feature.$$type === '@backstage/ExtensionOverrides') {\n toInternalExtensionOverrides(feature).featureFlags.forEach(flag =>\n featureFlagApi.registerFlag({ name: flag.name, pluginId: '' }),\n );\n }\n }\n }\n\n const rootEl = tree.root.instance!.getData(coreExtensionData.reactElement);\n\n const AppComponent = () => (\n <ApiProvider apis={apiHolder}>\n <AppThemeProvider>\n <InternalAppContext.Provider\n value={{ appIdentityProxy, routeObjects: routeInfo.routeObjects }}\n >\n {rootEl}\n </InternalAppContext.Provider>\n </AppThemeProvider>\n </ApiProvider>\n );\n\n return {\n createRoot() {\n return <AppComponent />;\n },\n };\n}\n\nfunction createApiHolder(\n tree: AppTree,\n configApi: ConfigApi,\n appIdentityProxy: AppIdentityProxy,\n routeResolutionApi: RouteResolutionApi,\n icons?: { [key in string]: IconComponent },\n): ApiHolder {\n const factoryRegistry = new ApiFactoryRegistry();\n\n const pluginApis =\n tree.root.edges.attachments\n .get('apis')\n ?.map(e => e.instance?.getData(createApiExtension.factoryDataRef))\n .filter((x): x is AnyApiFactory => !!x) ?? [];\n\n const themeExtensions =\n tree.root.edges.attachments\n .get('themes')\n ?.map(e => e.instance?.getData(createThemeExtension.themeDataRef))\n .filter((x): x is AppTheme => !!x) ?? [];\n\n const translationResources =\n tree.root.edges.attachments\n .get('translations')\n ?.map(e =>\n e.instance?.getData(createTranslationExtension.translationDataRef),\n )\n .filter(\n (x): x is typeof createTranslationExtension.translationDataRef.T => !!x,\n ) ?? [];\n\n for (const factory of pluginApis) {\n factoryRegistry.register('default', factory);\n }\n\n // TODO: properly discovery feature flags, maybe rework the whole thing\n factoryRegistry.register('default', {\n api: featureFlagsApiRef,\n deps: {},\n factory: () => new LocalStorageFeatureFlags(),\n });\n\n factoryRegistry.register('static', {\n api: identityApiRef,\n deps: {},\n factory: () => appIdentityProxy,\n });\n\n factoryRegistry.register('static', {\n api: appTreeApiRef,\n deps: {},\n factory: () => ({\n getTree: () => ({ tree }),\n }),\n });\n\n factoryRegistry.register('static', {\n api: routeResolutionApiRef,\n deps: {},\n factory: () => routeResolutionApi,\n });\n\n factoryRegistry.register('static', {\n api: componentsApiRef,\n deps: {},\n factory: () => DefaultComponentsApi.fromTree(tree),\n });\n\n factoryRegistry.register('static', {\n api: iconsApiRef,\n deps: {},\n factory: () => new DefaultIconsApi({ ...defaultIcons, ...icons }),\n });\n\n factoryRegistry.register('static', {\n api: appThemeApiRef,\n deps: {},\n // TODO: add extension for registering themes\n factory: () => AppThemeSelector.createWithStorage(themeExtensions),\n });\n\n factoryRegistry.register('static', {\n api: appLanguageApiRef,\n deps: {},\n factory: () => AppLanguageSelector.createWithStorage(),\n });\n\n factoryRegistry.register('static', {\n api: configApiRef,\n deps: {},\n factory: () => configApi,\n });\n\n factoryRegistry.register('static', {\n api: appLanguageApiRef,\n deps: {},\n factory: () => AppLanguageSelector.createWithStorage(),\n });\n\n factoryRegistry.register('static', {\n api: translationApiRef,\n deps: { languageApi: appLanguageApiRef },\n factory: ({ languageApi }) =>\n I18nextTranslationApi.create({\n languageApi,\n resources: translationResources,\n }),\n });\n\n ApiResolver.validateFactories(factoryRegistry, factoryRegistry.getAllApis());\n\n return new ApiResolver(factoryRegistry);\n}\n"],"names":["defaultApis","icons","defaultIcons"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,MAAM,WAAA,GAAcA,KAAY,GAAI,CAAA,CAAA,OAAA,KAAW,mBAAmB,EAAE,OAAA,EAAS,CAAC,CAAA,CAAA;AAEvE,MAAM,iBAAoB,GAAA;AAAA,EAC/B,GAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,6BAAA;AAAA,EACA,iCAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA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|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@backstage/config": "^1.2.0",
|
|
36
|
-
"@backstage/core-app-api": "^1.14.1
|
|
37
|
-
"@backstage/core-components": "^0.14.
|
|
36
|
+
"@backstage/core-app-api": "^1.14.1",
|
|
37
|
+
"@backstage/core-components": "^0.14.9",
|
|
38
38
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
39
39
|
"@backstage/errors": "^1.2.4",
|
|
40
|
-
"@backstage/frontend-plugin-api": "^0.6.
|
|
40
|
+
"@backstage/frontend-plugin-api": "^0.6.7",
|
|
41
41
|
"@backstage/theme": "^0.5.6",
|
|
42
42
|
"@backstage/types": "^1.1.1",
|
|
43
43
|
"@backstage/version-bridge": "^1.0.8",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"lodash": "^4.17.21"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@backstage/cli": "^0.
|
|
51
|
-
"@backstage/test-utils": "^1.5.9
|
|
50
|
+
"@backstage/cli": "^0.26.11",
|
|
51
|
+
"@backstage/test-utils": "^1.5.9",
|
|
52
52
|
"@testing-library/jest-dom": "^6.0.0",
|
|
53
53
|
"@testing-library/react": "^15.0.0"
|
|
54
54
|
},
|