diff --git a/.changeset/wise-tables-add.md b/.changeset/wise-tables-add.md new file mode 100644 index 0000000000..987c74cf53 --- /dev/null +++ b/.changeset/wise-tables-add.md @@ -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. diff --git a/packages/backend-plugin-api/src/services/system/types.ts b/packages/backend-plugin-api/src/services/system/types.ts index bea53dc1ed..b8fb12fe44 100644 --- a/packages/backend-plugin-api/src/services/system/types.ts +++ b/packages/backend-plugin-api/src/services/system/types.ts @@ -241,7 +241,7 @@ export function createServiceFactory< | (() => PluginServiceFactoryConfig), ): (options: TOpts) => ServiceFactory { const configCallback = typeof config === 'function' ? config : () => config; - return ( + const factory = ( options: TOpts, ): InternalServiceFactory => { 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; }