@backstage/backend-plugin-api 0.8.0-next.2 → 0.8.0-next.3

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,18 @@
1
1
  # @backstage/backend-plugin-api
2
2
 
3
+ ## 0.8.0-next.3
4
+
5
+ ### Patch Changes
6
+
7
+ - ddde5fe: Fixed a type issue where plugin and modules depending on multiton services would not receive the correct type.
8
+ - Updated dependencies
9
+ - @backstage/cli-common@0.1.14
10
+ - @backstage/config@1.2.0
11
+ - @backstage/errors@1.2.4
12
+ - @backstage/types@1.1.1
13
+ - @backstage/plugin-auth-node@0.5.0-next.3
14
+ - @backstage/plugin-permission-common@0.8.1-next.1
15
+
3
16
  ## 0.8.0-next.2
4
17
 
5
18
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api__alpha",
3
- "version": "0.8.0-next.2",
3
+ "version": "0.8.0-next.3",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/index.d.ts CHANGED
@@ -1864,6 +1864,12 @@ type ExtensionPoint<T> = {
1864
1864
  toString(): string;
1865
1865
  $$type: '@backstage/ExtensionPoint';
1866
1866
  };
1867
+ /** @ignore */
1868
+ type DepsToInstances<TDeps extends {
1869
+ [key in string]: ServiceRef<unknown> | ExtensionPoint<unknown>;
1870
+ }> = {
1871
+ [key in keyof TDeps]: TDeps[key] extends ServiceRef<unknown, any, 'multiton'> ? Array<TDeps[key]['T']> : TDeps[key]['T'];
1872
+ };
1867
1873
  /**
1868
1874
  * The callbacks passed to the `register` method of a backend plugin.
1869
1875
  *
@@ -1871,13 +1877,11 @@ type ExtensionPoint<T> = {
1871
1877
  */
1872
1878
  interface BackendPluginRegistrationPoints {
1873
1879
  registerExtensionPoint<TExtensionPoint>(ref: ExtensionPoint<TExtensionPoint>, impl: TExtensionPoint): void;
1874
- registerInit<Deps extends {
1875
- [name in string]: unknown;
1880
+ registerInit<TDeps extends {
1881
+ [name in string]: ServiceRef<unknown>;
1876
1882
  }>(options: {
1877
- deps: {
1878
- [name in keyof Deps]: ServiceRef<Deps[name]>;
1879
- };
1880
- init(deps: Deps): Promise<void>;
1883
+ deps: TDeps;
1884
+ init(deps: DepsToInstances<TDeps>): Promise<void>;
1881
1885
  }): void;
1882
1886
  }
1883
1887
  /**
@@ -1887,13 +1891,11 @@ interface BackendPluginRegistrationPoints {
1887
1891
  */
1888
1892
  interface BackendModuleRegistrationPoints {
1889
1893
  registerExtensionPoint<TExtensionPoint>(ref: ExtensionPoint<TExtensionPoint>, impl: TExtensionPoint): void;
1890
- registerInit<Deps extends {
1891
- [name in string]: unknown;
1894
+ registerInit<TDeps extends {
1895
+ [name in string]: ServiceRef<unknown> | ExtensionPoint<unknown>;
1892
1896
  }>(options: {
1893
- deps: {
1894
- [name in keyof Deps]: ServiceRef<Deps[name]> | ExtensionPoint<Deps[name]>;
1895
- };
1896
- init(deps: Deps): Promise<void>;
1897
+ deps: TDeps;
1898
+ init(deps: DepsToInstances<TDeps>): Promise<void>;
1897
1899
  }): void;
1898
1900
  }
1899
1901
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api",
3
- "version": "0.8.0-next.2",
3
+ "version": "0.8.0-next.3",
4
4
  "description": "Core API used by Backstage backend plugins",
5
5
  "backstage": {
6
6
  "role": "node-library"
@@ -56,7 +56,7 @@
56
56
  "@backstage/cli-common": "^0.1.14",
57
57
  "@backstage/config": "^1.2.0",
58
58
  "@backstage/errors": "^1.2.4",
59
- "@backstage/plugin-auth-node": "^0.5.0-next.2",
59
+ "@backstage/plugin-auth-node": "^0.5.0-next.3",
60
60
  "@backstage/plugin-permission-common": "^0.8.1-next.1",
61
61
  "@backstage/types": "^1.1.1",
62
62
  "@types/express": "^4.17.6",
@@ -66,7 +66,7 @@
66
66
  "luxon": "^3.0.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@backstage/backend-test-utils": "^0.4.5-next.2",
70
- "@backstage/cli": "^0.27.0-next.3"
69
+ "@backstage/backend-test-utils": "^0.4.5-next.3",
70
+ "@backstage/cli": "^0.27.0-next.4"
71
71
  }
72
72
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api__testutils",
3
- "version": "0.8.0-next.2",
3
+ "version": "0.8.0-next.3",
4
4
  "main": "../dist/testUtils.cjs.js",
5
5
  "types": "../dist/testUtils.d.ts"
6
6
  }