Merge pull request #19810 from backstage/mob/factory-factory-factory
backend-plugin-api: properly mark service factory functions as such
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-plugin-api': patch
|
||||
---
|
||||
|
||||
Service factory functions are now marked as feature factories that can be installed in the backend.
|
||||
@@ -241,7 +241,7 @@ export function createServiceFactory<
|
||||
| (() => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>),
|
||||
): (options: TOpts) => ServiceFactory {
|
||||
const configCallback = typeof config === 'function' ? config : () => config;
|
||||
return (
|
||||
const factory = (
|
||||
options: TOpts,
|
||||
): InternalServiceFactory<TService, 'plugin' | 'root'> => {
|
||||
const anyConf = configCallback(options);
|
||||
@@ -275,4 +275,8 @@ export function createServiceFactory<
|
||||
factory: async (deps: TDeps, ctx: TContext) => c.factory(deps, ctx),
|
||||
};
|
||||
};
|
||||
|
||||
factory.$$type = '@backstage/BackendFeatureFactory';
|
||||
|
||||
return factory;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user