@backstage/backend-plugin-api 0.2.1-next.0 → 0.3.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 CHANGED
@@ -1,5 +1,104 @@
1
1
  # @backstage/backend-plugin-api
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8e06f3cf00: Moved `loggerToWinstonLogger` to `@backstage/backend-common`.
8
+ - ecbec4ec4c: Updated all factory function creators to accept options as a top-level callback rather than extra parameter to the main factory function.
9
+
10
+ ### Patch Changes
11
+
12
+ - 6cfd4d7073: Added `RootLifecycleService` and `rootLifecycleServiceRef`, as well as added a `logger` option to the existing `LifecycleServiceShutdownHook`.
13
+ - ecc6bfe4c9: Added `ServiceFactoryOrFunction` type, for use when either a `ServiceFactory` or `() => ServiceFactory` can be used.
14
+ - 5b7bcd3c5e: Added `createSharedEnvironment` for creating a shared environment containing commonly used services in a split backend setup of the backend.
15
+ - 02b119ff93: Added a new `rootHttpRouterServiceRef` and `RootHttpRouterService` interface.
16
+ - 5e2cebe9a3: Migrate `UrlReader` into this package to gradually remove the dependency on backend-common.
17
+ - 843a0a158c: Added new core identity service.
18
+ - 5437fe488f: Migrated types related to `TokenManagerService`, `CacheService` and `DatabaseService` into backend-plugin-api.
19
+ - 6f02d23b01: Moved `PluginEndpointDiscovery` type from backend-common to backend-plugin-api.
20
+ - 483e907eaf: The `createServiceFactory` function has been updated to no longer use a duplicate callback pattern for plugin scoped services. The outer callback is now replaced by an optional `createRootContext` method. This change was made in order to support TypeScript 4.9, but it also simplifies the API surface a bit, especially for plugin scoped service factories that don't need to create a root context. In addition, the factory and root context functions can now be synchronous.
21
+
22
+ A factory that previously would have looked like this:
23
+
24
+ ```ts
25
+ createServiceFactory({
26
+ service: coreServices.cache,
27
+ deps: {
28
+ config: coreServices.config,
29
+ plugin: coreServices.pluginMetadata,
30
+ },
31
+ async factory({ config }) {
32
+ const cacheManager = CacheManager.fromConfig(config);
33
+ return async ({ plugin }) => {
34
+ return cacheManager.forPlugin(plugin.getId());
35
+ };
36
+ },
37
+ });
38
+ ```
39
+
40
+ Now instead looks like this:
41
+
42
+ ```ts
43
+ createServiceFactory({
44
+ service: coreServices.cache,
45
+ deps: {
46
+ config: coreServices.config,
47
+ plugin: coreServices.pluginMetadata,
48
+ },
49
+ async createRootContext({ config }) {
50
+ return CacheManager.fromConfig(config);
51
+ },
52
+ async factory({ plugin }, manager) {
53
+ return manager.forPlugin(plugin.getId());
54
+ },
55
+ });
56
+ ```
57
+
58
+ Although in many cases the `createRootContext` isn't needed, for example:
59
+
60
+ ```ts
61
+ createServiceFactory({
62
+ service: coreServices.logger,
63
+ deps: {
64
+ rootLogger: coreServices.rootLogger,
65
+ plugin: coreServices.pluginMetadata,
66
+ },
67
+ factory({ rootLogger, plugin }) {
68
+ return rootLogger.child({ plugin: plugin.getId() });
69
+ },
70
+ });
71
+ ```
72
+
73
+ - 16054afdec: Documented `coreServices` an all of its members.
74
+ - 0e63aab311: Updated the `RootLoggerService` to also have an `addRedactions` method.
75
+ - 62b04bb865: Updates all `create*` methods to simplify their type definitions and ensure they all have configuration interfaces.
76
+ - Updated dependencies
77
+ - @backstage/backend-tasks@0.4.1
78
+ - @backstage/config@1.0.6
79
+ - @backstage/types@1.0.2
80
+ - @backstage/plugin-auth-node@0.2.9
81
+ - @backstage/plugin-permission-common@0.7.3
82
+
83
+ ## 0.3.0-next.1
84
+
85
+ ### Minor Changes
86
+
87
+ - 8e06f3cf00: Moved `loggerToWinstonLogger` to `@backstage/backend-common`.
88
+
89
+ ### Patch Changes
90
+
91
+ - ecc6bfe4c9: Added `ServiceFactoryOrFunction` type, for use when either a `ServiceFactory` or `() => ServiceFactory` can be used.
92
+ - 02b119ff93: Added a new `rootHttpRouterServiceRef` and `RootHttpRouterService` interface.
93
+ - 5437fe488f: Migrated types related to `TokenManagerService`, `CacheService` and `DatabaseService` into backend-plugin-api.
94
+ - 16054afdec: Documented `coreServices` an all of its members.
95
+ - 62b04bb865: Updates all `create*` methods to simplify their type definitions and ensure they all have configuration interfaces.
96
+ - Updated dependencies
97
+ - @backstage/backend-tasks@0.4.1-next.1
98
+ - @backstage/config@1.0.6-next.0
99
+ - @backstage/types@1.0.2
100
+ - @backstage/plugin-permission-common@0.7.3-next.0
101
+
3
102
  ## 0.2.1-next.0
4
103
 
5
104
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api",
3
- "version": "0.2.1-next.0",
3
+ "version": "0.3.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }