@backstage/frontend-app-api 0.2.0 → 0.3.0-next.0
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 +24 -0
- package/config.d.ts +12 -5
- package/dist/index.d.ts +40 -3
- package/dist/index.esm.js +1851 -1708
- package/dist/index.esm.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @backstage/frontend-app-api
|
|
2
2
|
|
|
3
|
+
## 0.3.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- e28d379e32: Refactor internal extension instance system into an app graph.
|
|
12
|
+
- 6c2b872153: Add official support for React 18.
|
|
13
|
+
- dc613f9bcf: Updated `app.extensions` configuration schema.
|
|
14
|
+
- 685a4c8901: Installed features are now deduplicated both by reference and ID when available. Features passed to `createApp` now override both discovered and loaded features.
|
|
15
|
+
- bb98953cb9: Register default implementation for the `Translation API` on the new `createApp`.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/core-components@0.13.7-next.0
|
|
18
|
+
- @backstage/frontend-plugin-api@0.3.0-next.0
|
|
19
|
+
- @backstage/plugin-graphiql@0.3.0-next.0
|
|
20
|
+
- @backstage/core-plugin-api@1.8.0-next.0
|
|
21
|
+
- @backstage/version-bridge@1.0.7-next.0
|
|
22
|
+
- @backstage/core-app-api@1.11.1-next.0
|
|
23
|
+
- @backstage/theme@0.4.4-next.0
|
|
24
|
+
- @backstage/config@1.1.1
|
|
25
|
+
- @backstage/types@1.1.1
|
|
26
|
+
|
|
3
27
|
## 0.2.0
|
|
4
28
|
|
|
5
29
|
### 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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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 };
|