@backstage/frontend-app-api 0.2.0 → 0.3.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,5 +1,47 @@
1
1
  # @backstage/frontend-app-api
2
2
 
3
+ ## 0.3.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fe6d09953d: Fix for app node output IDs not being serialized correctly.
8
+ - 77f009b35d: Internal updates to match changes in the experimental `@backstage/frontend-plugin-api`.
9
+ - 4d6fa921db: Internal refactor to rename the app graph to app tree
10
+ - Updated dependencies
11
+ - @backstage/frontend-plugin-api@0.3.0-next.1
12
+ - @backstage/plugin-graphiql@0.3.0-next.1
13
+ - @backstage/core-components@0.13.8-next.1
14
+ - @backstage/config@1.1.1
15
+ - @backstage/core-app-api@1.11.1-next.0
16
+ - @backstage/core-plugin-api@1.8.0-next.0
17
+ - @backstage/theme@0.4.4-next.0
18
+ - @backstage/types@1.1.1
19
+ - @backstage/version-bridge@1.0.7-next.0
20
+
21
+ ## 0.3.0-next.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 68fc9dc60e: Added the ability to configure bound routes through `app.routes.bindings`. The routing system used by `createApp` has been replaced by one that only supports route refs of the new format from `@backstage/frontend-plugin-api`. The requirement for route refs to have the same ID as their associated extension has been removed.
26
+
27
+ ### Patch Changes
28
+
29
+ - e28d379e32: Refactor internal extension instance system into an app graph.
30
+ - 6c2b872153: Add official support for React 18.
31
+ - dc613f9bcf: Updated `app.extensions` configuration schema.
32
+ - 685a4c8901: Installed features are now deduplicated both by reference and ID when available. Features passed to `createApp` now override both discovered and loaded features.
33
+ - bb98953cb9: Register default implementation for the `Translation API` on the new `createApp`.
34
+ - Updated dependencies
35
+ - @backstage/core-components@0.13.7-next.0
36
+ - @backstage/frontend-plugin-api@0.3.0-next.0
37
+ - @backstage/plugin-graphiql@0.3.0-next.0
38
+ - @backstage/core-plugin-api@1.8.0-next.0
39
+ - @backstage/version-bridge@1.0.7-next.0
40
+ - @backstage/core-app-api@1.11.1-next.0
41
+ - @backstage/theme@0.4.4-next.0
42
+ - @backstage/config@1.1.1
43
+ - @backstage/types@1.1.1
44
+
3
45
  ## 0.2.0
4
46
 
5
47
  ### Minor Changes
package/config.d.ts CHANGED
@@ -24,20 +24,27 @@ export interface Config {
24
24
  packages?: 'all' | { include?: string[]; exclude?: string[] };
25
25
  };
26
26
 
27
+ routes?: {
28
+ /**
29
+ * @deepVisibility frontend
30
+ */
31
+ bindings?: { [externalRouteRefId: string]: string };
32
+ };
33
+
27
34
  /**
28
35
  * @deepVisibility frontend
29
36
  */
30
- extensions?:
37
+ extensions?: Array<
31
38
  | string
32
39
  | {
33
40
  [extensionId: string]:
34
41
  | boolean
35
- | string
36
42
  | {
37
- at?: string;
38
- extension?: string;
43
+ attachTo?: { id: string; input: string };
44
+ disabled?: boolean;
39
45
  config?: unknown;
40
46
  };
41
- };
47
+ }
48
+ >;
42
49
  };
43
50
  }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,45 @@
1
1
  import { JSX } from 'react';
2
2
  import { Config } from '@backstage/config';
3
- import { ExtensionDataRef, BackstagePlugin, ExtensionOverrides } from '@backstage/frontend-plugin-api';
3
+ import { ExternalRouteRef, RouteRef, SubRouteRef, ExtensionDataRef, BackstagePlugin, ExtensionOverrides } from '@backstage/frontend-plugin-api';
4
4
  import { ConfigApi } from '@backstage/core-plugin-api';
5
- import { AppRouteBinder } from '@backstage/core-app-api';
5
+
6
+ /**
7
+ * Extracts a union of the keys in a map whose value extends the given type
8
+ *
9
+ * @ignore
10
+ */
11
+ type KeysWithType<Obj extends {
12
+ [key in string]: any;
13
+ }, Type> = {
14
+ [key in keyof Obj]: Obj[key] extends Type ? key : never;
15
+ }[keyof Obj];
16
+ /**
17
+ * Takes a map Map required values and makes all keys matching Keys optional
18
+ *
19
+ * @ignore
20
+ */
21
+ type PartialKeys<Map extends {
22
+ [name in string]: any;
23
+ }, Keys extends keyof Map> = Partial<Pick<Map, Keys>> & Required<Omit<Map, Keys>>;
24
+ /**
25
+ * Creates a map of target routes with matching parameters based on a map of external routes.
26
+ *
27
+ * @ignore
28
+ */
29
+ type TargetRouteMap<ExternalRoutes extends {
30
+ [name: string]: ExternalRouteRef;
31
+ }> = {
32
+ [name in keyof ExternalRoutes]: ExternalRoutes[name] extends ExternalRouteRef<infer Params, any> ? RouteRef<Params> | SubRouteRef<Params> : never;
33
+ };
34
+ /**
35
+ * A function that can bind from external routes of a given plugin, to concrete
36
+ * routes of other plugins. See {@link createApp}.
37
+ *
38
+ * @public
39
+ */
40
+ type AppRouteBinder = <TExternalRoutes extends {
41
+ [name: string]: ExternalRouteRef;
42
+ }>(externalRoutes: TExternalRoutes, targetRoutes: PartialKeys<TargetRouteMap<TExternalRoutes>, KeysWithType<TExternalRoutes, ExternalRouteRef<any, true>>>) => void;
6
43
 
7
44
  /** @public */
8
45
  interface ExtensionTreeNode {
@@ -34,4 +71,4 @@ declare function createApp(options: {
34
71
  createRoot(): JSX.Element;
35
72
  };
36
73
 
37
- export { ExtensionTree, ExtensionTreeNode, createApp, createExtensionTree };
74
+ export { AppRouteBinder, ExtensionTree, ExtensionTreeNode, createApp, createExtensionTree };