From 0c450c0e9e44571cb6f8139d6b8a3331eb1dfc6d Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 1 Aug 2023 11:55:25 +0200 Subject: [PATCH 01/15] add feature discovery service Co-authored-by: Patrik Oldsberg Signed-off-by: Vincenzo Scamporlino --- .../src/wiring/BackendInitializer.ts | 17 +++++++++++ packages/backend-plugin-api/package.json | 19 ++++++++++-- packages/backend-plugin-api/src/alpha.ts | 29 +++++++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 packages/backend-plugin-api/src/alpha.ts diff --git a/packages/backend-app-api/src/wiring/BackendInitializer.ts b/packages/backend-app-api/src/wiring/BackendInitializer.ts index ec4b2a79ac..cf140158a6 100644 --- a/packages/backend-app-api/src/wiring/BackendInitializer.ts +++ b/packages/backend-app-api/src/wiring/BackendInitializer.ts @@ -27,6 +27,7 @@ import { EnumerableServiceHolder, ServiceOrExtensionPoint } from './types'; // eslint-disable-next-line @backstage/no-forbidden-package-imports import { InternalBackendFeature } from '@backstage/backend-plugin-api/src/wiring/types'; import { ForwardedError } from '@backstage/errors'; +import { featureDiscoveryServiceRef } from '@backstage/backend-plugin-api/alpha'; export interface BackendRegisterInit { consumes: Set; @@ -87,6 +88,10 @@ export class BackendInitializer { if (this.#startPromise) { throw new Error('feature can not be added after the backend has started'); } + this.#addFeature(feature); + } + + #addFeature(feature: BackendFeature) { if (feature.$$type !== '@backstage/BackendFeature') { throw new Error( `Failed to add feature, invalid type '${feature.$$type}'`, @@ -129,6 +134,18 @@ export class BackendInitializer { } async #doStart(): Promise { + const featureDiscovery = await this.#serviceHolder.get( + featureDiscoveryServiceRef, + 'root', + ); + + if (featureDiscovery) { + const { features } = await featureDiscovery.getBackendFeatures(); + for (const plugin of features) { + this.#addFeature(plugin); + } + } + // Initialize all root scoped services for (const ref of this.#serviceHolder.getServiceRefs()) { if (ref.scope === 'root') { diff --git a/packages/backend-plugin-api/package.json b/packages/backend-plugin-api/package.json index 5d0bfe08fb..555c60c8e4 100644 --- a/packages/backend-plugin-api/package.json +++ b/packages/backend-plugin-api/package.json @@ -5,13 +5,26 @@ "main": "src/index.ts", "types": "src/index.ts", "publishConfig": { - "access": "public", - "main": "dist/index.cjs.js", - "types": "dist/index.d.ts" + "access": "public" }, "backstage": { "role": "node-library" }, + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.ts", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "alpha": [ + "src/alpha.ts" + ], + "package.json": [ + "package.json" + ] + } + }, "homepage": "https://backstage.io", "repository": { "type": "git", diff --git a/packages/backend-plugin-api/src/alpha.ts b/packages/backend-plugin-api/src/alpha.ts new file mode 100644 index 0000000000..6db9b009cf --- /dev/null +++ b/packages/backend-plugin-api/src/alpha.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { createServiceRef } from './services'; +import { BackendFeature } from './wiring'; + +/** @alpha */ +export interface FeatureDiscoveryService { + getBackendFeatures(): Promise<{ features: Array }>; +} + +/** @alpha */ +export const featureDiscoveryServiceRef = + createServiceRef({ + id: 'core.featureDiscovery', + }); From 0b4dbb40827c6097b741c58cb4fd11e9cf25dedc Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 1 Aug 2023 16:52:56 +0200 Subject: [PATCH 02/15] discover backend feature factory Co-authored-by: Patrik Oldsberg Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/package.json | 20 ++- packages/backend-app-api/src/alpha.ts | 118 ++++++++++++++++++ packages/backend-next/package.json | 1 + .../src/wiring/factories.ts | 10 +- yarn.lock | 2 + 5 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 packages/backend-app-api/src/alpha.ts diff --git a/packages/backend-app-api/package.json b/packages/backend-app-api/package.json index d1aa511794..75890b4370 100644 --- a/packages/backend-app-api/package.json +++ b/packages/backend-app-api/package.json @@ -5,13 +5,26 @@ "main": "src/index.ts", "types": "src/index.ts", "publishConfig": { - "access": "public", - "main": "dist/index.cjs.js", - "types": "dist/index.d.ts" + "access": "public" }, "backstage": { "role": "node-library" }, + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.ts", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "alpha": [ + "src/alpha.ts" + ], + "package.json": [ + "package.json" + ] + } + }, "homepage": "https://backstage.io", "repository": { "type": "git", @@ -36,6 +49,7 @@ "@backstage/backend-plugin-api": "workspace:^", "@backstage/backend-tasks": "workspace:^", "@backstage/cli-common": "workspace:^", + "@backstage/cli-node": "workspace:^", "@backstage/config": "workspace:^", "@backstage/config-loader": "workspace:^", "@backstage/errors": "workspace:^", diff --git a/packages/backend-app-api/src/alpha.ts b/packages/backend-app-api/src/alpha.ts new file mode 100644 index 0000000000..da77c7cfc5 --- /dev/null +++ b/packages/backend-app-api/src/alpha.ts @@ -0,0 +1,118 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + BackendFeature, + RootConfigService, + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import { + featureDiscoveryServiceRef, + FeatureDiscoveryService, +} from '@backstage/backend-plugin-api/alpha'; +import { resolve as resolvePath, dirname } from 'path'; +import fs from 'fs-extra'; +import { BackstagePackageJson } from '@backstage/cli-node'; + +const LOADED_PACKAGE_ROLES = ['backend-plugin', 'backend-module']; + +/** @internal */ +async function findClosestPackageDir( + searchDir: string, +): Promise { + let path = searchDir; + + // Some confidence check to avoid infinite loop + for (let i = 0; i < 1000; i++) { + const packagePath = resolvePath(path, 'package.json'); + const exists = await fs.pathExists(packagePath); + if (exists) { + return path; + } + + const newPath = dirname(path); + if (newPath === path) { + return undefined; + } + path = newPath; + } + + throw new Error( + `Iteration limit reached when searching for root package.json at ${searchDir}`, + ); +} + +/** @alpha */ +export class PackageDiscoveryService implements FeatureDiscoveryService { + constructor(private readonly config: RootConfigService) {} + + async getBackendFeatures(): Promise<{ features: Array }> { + // if (this.config.getOptionalString('backend.packages') !== 'all') { + // return { features: [] }; + // } + + console.log(`DEBUG: executing backend feature discovery`); + const packageDir = await findClosestPackageDir(process.argv[1]); + if (!packageDir) { + throw new Error('NOOOOOOOOOOOOOOOOOOOOOOOOOO'); + } + console.log(`DEBUG: packageDir=`, packageDir); + const { dependencies } = require(resolvePath(packageDir, 'package.json')); + const dependencyNames = Object.keys(dependencies); + console.log(`DEBUG: dependencyNames=`, dependencyNames); + + const features: BackendFeature[] = []; + + for (const name of dependencyNames) { + const depPkg = require(`${name}/package.json`) as BackstagePackageJson; + if (!LOADED_PACKAGE_ROLES.includes(depPkg?.backstage?.role ?? '')) { + continue; + } + const depModule = require(name); // @backstage/plugin-catalog-backend + console.log(`DEBUG: loaded ${name} depModule=`, depModule); + Object.values(depModule).filter(exportValue => { + if ( + exportValue && + typeof exportValue === 'object' && + (exportValue as any).$$type === '@backstage/BackendFeature' + ) { + features.push(exportValue as BackendFeature); + } + if ( + typeof exportValue === 'function' && + (exportValue as any).$$type === '@backstage/BackendFeatureFactory' + ) { + features.push(exportValue() as BackendFeature); + } + }); + } + + console.log(`DEBUG: features=`, features); + return { features }; + } +} + +/** @alpha */ +export const packageFeatureDiscoveryServiceFactory = createServiceFactory({ + service: featureDiscoveryServiceRef, + deps: { + config: coreServices.rootConfig, + }, + factory({ config }) { + return new PackageDiscoveryService(config); + }, +}); diff --git a/packages/backend-next/package.json b/packages/backend-next/package.json index af4f483db0..f36f90998b 100644 --- a/packages/backend-next/package.json +++ b/packages/backend-next/package.json @@ -26,6 +26,7 @@ }, "dependencies": { "@backstage/backend-defaults": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", "@backstage/backend-tasks": "workspace:^", "@backstage/plugin-adr-backend": "workspace:^", "@backstage/plugin-app-backend": "workspace:^", diff --git a/packages/backend-plugin-api/src/wiring/factories.ts b/packages/backend-plugin-api/src/wiring/factories.ts index 928c933af0..41584e9a29 100644 --- a/packages/backend-plugin-api/src/wiring/factories.ts +++ b/packages/backend-plugin-api/src/wiring/factories.ts @@ -78,6 +78,11 @@ export interface BackendPluginConfig { register(reg: BackendPluginRegistrationPoints): void; } +export const catalogPlugin = createBackendPlugin({ + pluginId: 'catalog', + register() {}, +}); + /** * Creates a new backend plugin. * @@ -89,7 +94,7 @@ export function createBackendPlugin( config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), ): (...params: TOptions) => BackendFeature { const configCallback = typeof config === 'function' ? config : () => config; - return (...options: TOptions): InternalBackendFeature => { + const factory = (...options: TOptions): InternalBackendFeature => { const c = configCallback(...options); let registrations: InternalBackendPluginRegistration[]; @@ -144,6 +149,9 @@ export function createBackendPlugin( }, }; }; + + factory.$$type = '@backstage/BackendFeatureFactory'; + return factory; } /** diff --git a/yarn.lock b/yarn.lock index 88a07ef408..07c182f207 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3292,6 +3292,7 @@ __metadata: "@backstage/backend-test-utils": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/cli-common": "workspace:^" + "@backstage/cli-node": "workspace:^" "@backstage/config": "workspace:^" "@backstage/config-loader": "workspace:^" "@backstage/errors": "workspace:^" @@ -25169,6 +25170,7 @@ __metadata: resolution: "example-backend-next@workspace:packages/backend-next" dependencies: "@backstage/backend-defaults": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-tasks": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/plugin-adr-backend": "workspace:^" From 36a40b4903059537a8e0ef174819c44ef2b886a7 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 1 Aug 2023 20:43:28 +0200 Subject: [PATCH 03/15] define BackendFeatureFactory Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/src/alpha.ts | 48 ++++++++++++------- .../src/wiring/factories.ts | 17 ++++--- .../backend-plugin-api/src/wiring/index.ts | 1 + .../backend-plugin-api/src/wiring/types.ts | 8 ++++ 4 files changed, 51 insertions(+), 23 deletions(-) diff --git a/packages/backend-app-api/src/alpha.ts b/packages/backend-app-api/src/alpha.ts index da77c7cfc5..31b61950b9 100644 --- a/packages/backend-app-api/src/alpha.ts +++ b/packages/backend-app-api/src/alpha.ts @@ -16,6 +16,7 @@ import { BackendFeature, + BackendFeatureFactory, RootConfigService, coreServices, createServiceFactory, @@ -71,8 +72,11 @@ export class PackageDiscoveryService implements FeatureDiscoveryService { throw new Error('NOOOOOOOOOOOOOOOOOOOOOOOOOO'); } console.log(`DEBUG: packageDir=`, packageDir); - const { dependencies } = require(resolvePath(packageDir, 'package.json')); - const dependencyNames = Object.keys(dependencies); + const { dependencies } = require(resolvePath( + packageDir, + 'package.json', + )) as BackstagePackageJson; + const dependencyNames = Object.keys(dependencies || {}); console.log(`DEBUG: dependencyNames=`, dependencyNames); const features: BackendFeature[] = []; @@ -82,23 +86,16 @@ export class PackageDiscoveryService implements FeatureDiscoveryService { if (!LOADED_PACKAGE_ROLES.includes(depPkg?.backstage?.role ?? '')) { continue; } - const depModule = require(name); // @backstage/plugin-catalog-backend + const depModule = require(name); console.log(`DEBUG: loaded ${name} depModule=`, depModule); - Object.values(depModule).filter(exportValue => { - if ( - exportValue && - typeof exportValue === 'object' && - (exportValue as any).$$type === '@backstage/BackendFeature' - ) { - features.push(exportValue as BackendFeature); + for (const exportValue of Object.values(depModule)) { + if (isBackendFeature(exportValue)) { + features.push(exportValue); } - if ( - typeof exportValue === 'function' && - (exportValue as any).$$type === '@backstage/BackendFeatureFactory' - ) { - features.push(exportValue() as BackendFeature); + if (isBackendFeatureFactory(exportValue)) { + features.push(exportValue()); } - }); + } } console.log(`DEBUG: features=`, features); @@ -116,3 +113,22 @@ export const packageFeatureDiscoveryServiceFactory = createServiceFactory({ return new PackageDiscoveryService(config); }, }); + +function isBackendFeature(value: unknown): value is BackendFeature { + return ( + !!value && + typeof value === 'object' && + (value as BackendFeature).$$type === '@backstage/BackendFeature' + ); +} + +function isBackendFeatureFactory( + value: unknown, +): value is BackendFeatureFactory { + return ( + !!value && + typeof value === 'object' && + (value as BackendFeatureFactory).$$type === + '@backstage/BackendFeatureFactory' + ); +} diff --git a/packages/backend-plugin-api/src/wiring/factories.ts b/packages/backend-plugin-api/src/wiring/factories.ts index 41584e9a29..ba9238e0e0 100644 --- a/packages/backend-plugin-api/src/wiring/factories.ts +++ b/packages/backend-plugin-api/src/wiring/factories.ts @@ -17,11 +17,10 @@ import { BackendModuleRegistrationPoints, BackendPluginRegistrationPoints, - BackendFeature, ExtensionPoint, - InternalBackendFeature, InternalBackendModuleRegistration, InternalBackendPluginRegistration, + BackendFeatureFactory, } from './types'; /** @@ -92,9 +91,10 @@ export const catalogPlugin = createBackendPlugin({ */ export function createBackendPlugin( config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), -): (...params: TOptions) => BackendFeature { +): BackendFeatureFactory { const configCallback = typeof config === 'function' ? config : () => config; - const factory = (...options: TOptions): InternalBackendFeature => { + + const factory: BackendFeatureFactory = (...options) => { const c = configCallback(...options); let registrations: InternalBackendPluginRegistration[]; @@ -149,8 +149,8 @@ export function createBackendPlugin( }, }; }; - factory.$$type = '@backstage/BackendFeatureFactory'; + return factory; } @@ -184,9 +184,9 @@ export interface BackendModuleConfig { */ export function createBackendModule( config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig), -): (...params: TOptions) => BackendFeature { +): BackendFeatureFactory { const configCallback = typeof config === 'function' ? config : () => config; - return (...options: TOptions): InternalBackendFeature => { + const factory: BackendFeatureFactory = (...options: TOptions) => { const c = configCallback(...options); let registrations: InternalBackendModuleRegistration[]; @@ -231,4 +231,7 @@ export function createBackendModule( }, }; }; + factory.$$type = '@backstage/BackendFeatureFactory'; + + return factory; } diff --git a/packages/backend-plugin-api/src/wiring/index.ts b/packages/backend-plugin-api/src/wiring/index.ts index 9cb767b8ac..0b7104374a 100644 --- a/packages/backend-plugin-api/src/wiring/index.ts +++ b/packages/backend-plugin-api/src/wiring/index.ts @@ -28,5 +28,6 @@ export type { BackendModuleRegistrationPoints, BackendPluginRegistrationPoints, BackendFeature, + BackendFeatureFactory, ExtensionPoint, } from './types'; diff --git a/packages/backend-plugin-api/src/wiring/types.ts b/packages/backend-plugin-api/src/wiring/types.ts index c81ee3ceb7..b9b4f3ff10 100644 --- a/packages/backend-plugin-api/src/wiring/types.ts +++ b/packages/backend-plugin-api/src/wiring/types.ts @@ -67,6 +67,14 @@ export interface BackendModuleRegistrationPoints { }): void; } +/** @public */ +export interface BackendFeatureFactory< + TOptions extends [options?: object] = [], +> { + (...options: TOptions): BackendFeature; + $$type: '@backstage/BackendFeatureFactory'; +} + /** @public */ export interface BackendFeature { // NOTE: This type is opaque in order to simplify future API evolution. From 83ae67710a703a475943b1cce6486c1c75f966dc Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 11:02:53 +0200 Subject: [PATCH 04/15] move feature discovery to alpha Co-authored-by: Patrik Oldsberg Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/src/alpha.ts | 119 +--------------- .../alpha/featureDiscoveryServiceFactory.ts | 129 ++++++++++++++++++ packages/backend-app-api/src/alpha/index.ts | 17 +++ 3 files changed, 147 insertions(+), 118 deletions(-) create mode 100644 packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts create mode 100644 packages/backend-app-api/src/alpha/index.ts diff --git a/packages/backend-app-api/src/alpha.ts b/packages/backend-app-api/src/alpha.ts index 31b61950b9..d9068b8f82 100644 --- a/packages/backend-app-api/src/alpha.ts +++ b/packages/backend-app-api/src/alpha.ts @@ -14,121 +14,4 @@ * limitations under the License. */ -import { - BackendFeature, - BackendFeatureFactory, - RootConfigService, - coreServices, - createServiceFactory, -} from '@backstage/backend-plugin-api'; -import { - featureDiscoveryServiceRef, - FeatureDiscoveryService, -} from '@backstage/backend-plugin-api/alpha'; -import { resolve as resolvePath, dirname } from 'path'; -import fs from 'fs-extra'; -import { BackstagePackageJson } from '@backstage/cli-node'; - -const LOADED_PACKAGE_ROLES = ['backend-plugin', 'backend-module']; - -/** @internal */ -async function findClosestPackageDir( - searchDir: string, -): Promise { - let path = searchDir; - - // Some confidence check to avoid infinite loop - for (let i = 0; i < 1000; i++) { - const packagePath = resolvePath(path, 'package.json'); - const exists = await fs.pathExists(packagePath); - if (exists) { - return path; - } - - const newPath = dirname(path); - if (newPath === path) { - return undefined; - } - path = newPath; - } - - throw new Error( - `Iteration limit reached when searching for root package.json at ${searchDir}`, - ); -} - -/** @alpha */ -export class PackageDiscoveryService implements FeatureDiscoveryService { - constructor(private readonly config: RootConfigService) {} - - async getBackendFeatures(): Promise<{ features: Array }> { - // if (this.config.getOptionalString('backend.packages') !== 'all') { - // return { features: [] }; - // } - - console.log(`DEBUG: executing backend feature discovery`); - const packageDir = await findClosestPackageDir(process.argv[1]); - if (!packageDir) { - throw new Error('NOOOOOOOOOOOOOOOOOOOOOOOOOO'); - } - console.log(`DEBUG: packageDir=`, packageDir); - const { dependencies } = require(resolvePath( - packageDir, - 'package.json', - )) as BackstagePackageJson; - const dependencyNames = Object.keys(dependencies || {}); - console.log(`DEBUG: dependencyNames=`, dependencyNames); - - const features: BackendFeature[] = []; - - for (const name of dependencyNames) { - const depPkg = require(`${name}/package.json`) as BackstagePackageJson; - if (!LOADED_PACKAGE_ROLES.includes(depPkg?.backstage?.role ?? '')) { - continue; - } - const depModule = require(name); - console.log(`DEBUG: loaded ${name} depModule=`, depModule); - for (const exportValue of Object.values(depModule)) { - if (isBackendFeature(exportValue)) { - features.push(exportValue); - } - if (isBackendFeatureFactory(exportValue)) { - features.push(exportValue()); - } - } - } - - console.log(`DEBUG: features=`, features); - return { features }; - } -} - -/** @alpha */ -export const packageFeatureDiscoveryServiceFactory = createServiceFactory({ - service: featureDiscoveryServiceRef, - deps: { - config: coreServices.rootConfig, - }, - factory({ config }) { - return new PackageDiscoveryService(config); - }, -}); - -function isBackendFeature(value: unknown): value is BackendFeature { - return ( - !!value && - typeof value === 'object' && - (value as BackendFeature).$$type === '@backstage/BackendFeature' - ); -} - -function isBackendFeatureFactory( - value: unknown, -): value is BackendFeatureFactory { - return ( - !!value && - typeof value === 'object' && - (value as BackendFeatureFactory).$$type === - '@backstage/BackendFeatureFactory' - ); -} +export * from './alpha'; diff --git a/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts new file mode 100644 index 0000000000..ee1c2aa729 --- /dev/null +++ b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts @@ -0,0 +1,129 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + BackendFeature, + BackendFeatureFactory, + RootConfigService, + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import { + featureDiscoveryServiceRef, + FeatureDiscoveryService, +} from '@backstage/backend-plugin-api/alpha'; +import { resolve as resolvePath, dirname } from 'path'; +import fs from 'fs-extra'; +import { BackstagePackageJson } from '@backstage/cli-node'; + +const LOADED_PACKAGE_ROLES = ['backend-plugin', 'backend-module']; + +/** @internal */ +async function findClosestPackageDir( + searchDir: string, +): Promise { + let path = searchDir; + + // Some confidence check to avoid infinite loop + for (let i = 0; i < 1000; i++) { + const packagePath = resolvePath(path, 'package.json'); + const exists = await fs.pathExists(packagePath); + if (exists) { + return path; + } + + const newPath = dirname(path); + if (newPath === path) { + return undefined; + } + path = newPath; + } + + throw new Error( + `Iteration limit reached when searching for root package.json at ${searchDir}`, + ); +} + +/** @internal */ +class PackageDiscoveryService implements FeatureDiscoveryService { + constructor(private readonly config: RootConfigService) {} + + async getBackendFeatures(): Promise<{ features: Array }> { + if (this.config.getOptionalString('backend.packages') !== 'all') { + return { features: [] }; + } + + const packageDir = await findClosestPackageDir(process.argv[1]); + if (!packageDir) { + throw new Error('Package discovery failed to find package.json'); + } + const { dependencies } = require(resolvePath( + packageDir, + 'package.json', + )) as BackstagePackageJson; + const dependencyNames = Object.keys(dependencies || {}); + + const features: BackendFeature[] = []; + + for (const name of dependencyNames) { + const depPkg = require(`${name}/package.json`) as BackstagePackageJson; + if (!LOADED_PACKAGE_ROLES.includes(depPkg?.backstage?.role ?? '')) { + continue; + } + const depModule = require(name); + for (const exportValue of Object.values(depModule)) { + if (isBackendFeature(exportValue)) { + features.push(exportValue); + } + if (isBackendFeatureFactory(exportValue)) { + features.push(exportValue()); + } + } + } + + return { features }; + } +} + +/** @alpha */ +export const featureDiscoveryServiceFactory = createServiceFactory({ + service: featureDiscoveryServiceRef, + deps: { + config: coreServices.rootConfig, + }, + factory({ config }) { + return new PackageDiscoveryService(config); + }, +}); + +function isBackendFeature(value: unknown): value is BackendFeature { + return ( + !!value && + typeof value === 'object' && + (value as BackendFeature).$$type === '@backstage/BackendFeature' + ); +} + +function isBackendFeatureFactory( + value: unknown, +): value is BackendFeatureFactory { + return ( + !!value && + typeof value === 'object' && + (value as BackendFeatureFactory).$$type === + '@backstage/BackendFeatureFactory' + ); +} diff --git a/packages/backend-app-api/src/alpha/index.ts b/packages/backend-app-api/src/alpha/index.ts new file mode 100644 index 0000000000..6afc9e2eb6 --- /dev/null +++ b/packages/backend-app-api/src/alpha/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { featureDiscoveryServiceFactory } from './featureDiscoveryServiceFactory'; From 95676ce51aa11d9c861d56b2cfab23506c15b59e Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 13:38:07 +0200 Subject: [PATCH 05/15] add featureDiscoveryServiceFactory test Co-authored-by: Patrik Oldsberg Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/package.json | 5 +- packages/backend-app-api/src/alpha.ts | 17 --- .../featureDiscoveryServiceFactory.test.ts | 114 ++++++++++++++++++ .../alpha/featureDiscoveryServiceFactory.ts | 8 +- packages/backend-plugin-api/src/alpha.ts | 5 +- yarn.lock | 1 + 6 files changed, 127 insertions(+), 23 deletions(-) delete mode 100644 packages/backend-app-api/src/alpha.ts create mode 100644 packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.test.ts diff --git a/packages/backend-app-api/package.json b/packages/backend-app-api/package.json index 75890b4370..bc3318fce5 100644 --- a/packages/backend-app-api/package.json +++ b/packages/backend-app-api/package.json @@ -12,13 +12,13 @@ }, "exports": { ".": "./src/index.ts", - "./alpha": "./src/alpha.ts", + "./alpha": "./src/alpha/index.ts", "./package.json": "./package.json" }, "typesVersions": { "*": { "alpha": [ - "src/alpha.ts" + "src/alpha/index.ts" ], "package.json": [ "package.json" @@ -87,6 +87,7 @@ "@types/node-forge": "^1.3.0", "@types/stoppable": "^1.1.0", "http-errors": "^2.0.0", + "mock-fs": "^5.2.0", "supertest": "^6.1.3" }, "files": [ diff --git a/packages/backend-app-api/src/alpha.ts b/packages/backend-app-api/src/alpha.ts deleted file mode 100644 index d9068b8f82..0000000000 --- a/packages/backend-app-api/src/alpha.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2023 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from './alpha'; diff --git a/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.test.ts b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.test.ts new file mode 100644 index 0000000000..5a5917dd3b --- /dev/null +++ b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.test.ts @@ -0,0 +1,114 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import mockFs from 'mock-fs'; +import { resolve as resolvePath, dirname } from 'path'; +import { startTestBackend, mockServices } from '@backstage/backend-test-utils'; +import { featureDiscoveryServiceFactory } from './featureDiscoveryServiceFactory'; +import { + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; + +const rootDir = dirname(process.argv[1]); + +describe('featureDiscoveryServiceFactory', () => { + beforeEach(() => { + mockFs({ + [rootDir]: { + 'package.json': JSON.stringify({ + name: 'example-app', + dependencies: { + 'detected-plugin': '0.0.0', + 'detected-module': '0.0.0', + }, + }), + }, + [resolvePath(rootDir, 'node_modules/detected-plugin')]: { + 'package.json': JSON.stringify({ + name: 'detected-plugin', + main: 'index.js', + backstage: { + role: 'backend-plugin', + }, + }), + 'index.js': ` + const { createBackendPlugin, coreServices } = require('@backstage/backend-plugin-api'); + exports.detectedPlugin = createBackendPlugin({ + pluginId: 'detected', + register(env) { + env.registerInit({ + deps: { identity: coreServices.identity }, + async init({ identity }) { + identity.getIdentity('detected-plugin'); + }, + }); + }, + }); + `, + }, + [resolvePath(rootDir, 'node_modules/detected-module')]: { + 'package.json': JSON.stringify({ + name: 'detected-module', + main: 'index.js', + backstage: { + role: 'backend-module', + }, + }), + 'index.js': ` + const { createBackendModule, coreServices } = require('@backstage/backend-plugin-api'); + exports.detectedModuleDerp = createBackendModule({ + pluginId: 'detected', + moduleId: 'derp', + register(env) { + env.registerInit({ + deps: { identity: coreServices.identity }, + async init({ identity }) { + identity.getIdentity('detected-module'); + }, + }); + }, + }); + `, + }, + }); + }); + + afterEach(() => { + mockFs.restore(); + }); + + it('should detect plugin and module packages', async () => { + const fn = jest.fn().mockResolvedValue({}); + + await startTestBackend({ + services: [ + createServiceFactory({ + service: coreServices.identity, + deps: {}, + factory: () => ({ getIdentity: fn }), + }), + featureDiscoveryServiceFactory(), + mockServices.rootConfig.factory({ + data: { backend: { packages: 'all' } }, + }), + ], + }); + + expect(fn).toHaveBeenCalledWith('detected-plugin'); + expect(fn).toHaveBeenCalledWith('detected-module'); + }); +}); diff --git a/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts index ee1c2aa729..7062448eb1 100644 --- a/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts +++ b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts @@ -79,11 +79,13 @@ class PackageDiscoveryService implements FeatureDiscoveryService { const features: BackendFeature[] = []; for (const name of dependencyNames) { - const depPkg = require(`${name}/package.json`) as BackstagePackageJson; + const depPkg = require(require.resolve(`${name}/package.json`, { + paths: [packageDir], + })) as BackstagePackageJson; if (!LOADED_PACKAGE_ROLES.includes(depPkg?.backstage?.role ?? '')) { continue; } - const depModule = require(name); + const depModule = require(require.resolve(name, { paths: [packageDir] })); for (const exportValue of Object.values(depModule)) { if (isBackendFeature(exportValue)) { features.push(exportValue); @@ -122,7 +124,7 @@ function isBackendFeatureFactory( ): value is BackendFeatureFactory { return ( !!value && - typeof value === 'object' && + typeof value === 'function' && (value as BackendFeatureFactory).$$type === '@backstage/BackendFeatureFactory' ); diff --git a/packages/backend-plugin-api/src/alpha.ts b/packages/backend-plugin-api/src/alpha.ts index 6db9b009cf..1030b55d95 100644 --- a/packages/backend-plugin-api/src/alpha.ts +++ b/packages/backend-plugin-api/src/alpha.ts @@ -22,7 +22,10 @@ export interface FeatureDiscoveryService { getBackendFeatures(): Promise<{ features: Array }>; } -/** @alpha */ +/** + * An optional service that can be used to dynamically load in additional BackendFeatures at runtime. + * @alpha + */ export const featureDiscoveryServiceRef = createServiceRef({ id: 'core.featureDiscovery', diff --git a/yarn.lock b/yarn.lock index 07c182f207..fcdc40a97a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3320,6 +3320,7 @@ __metadata: logform: ^2.3.2 minimatch: ^5.0.0 minimist: ^1.2.5 + mock-fs: ^5.2.0 morgan: ^1.10.0 node-forge: ^1.3.1 selfsigned: ^2.0.0 From cc9256a33bcc8f1115a1251dfd621e9f1148ce35 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 13:45:12 +0200 Subject: [PATCH 06/15] changesets Co-authored-by: Patrik Oldsberg Signed-off-by: Vincenzo Scamporlino --- .changeset/rotten-dolls-sing.md | 5 +++++ .changeset/serious-singers-vanish.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/rotten-dolls-sing.md create mode 100644 .changeset/serious-singers-vanish.md diff --git a/.changeset/rotten-dolls-sing.md b/.changeset/rotten-dolls-sing.md new file mode 100644 index 0000000000..039b287a77 --- /dev/null +++ b/.changeset/rotten-dolls-sing.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-plugin-api': patch +--- + +Added new experimental `featureDiscoveryServiceRef`, available as an `/alpha` export. diff --git a/.changeset/serious-singers-vanish.md b/.changeset/serious-singers-vanish.md new file mode 100644 index 0000000000..e1f4a754a7 --- /dev/null +++ b/.changeset/serious-singers-vanish.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-app-api': patch +--- + +Added new experimental `featureDiscoveryServiceFactory`, available as an `/alpha` export. From 97f21bce4731092905b08ec25fbaea9a38be0fb9 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 14:13:58 +0200 Subject: [PATCH 07/15] api report Signed-off-by: Vincenzo Scamporlino --- .../backend-plugin-api/alpha-api-report.md | 27 +++++++++++++++++++ packages/backend-plugin-api/api-report.md | 14 ++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 packages/backend-plugin-api/alpha-api-report.md diff --git a/packages/backend-plugin-api/alpha-api-report.md b/packages/backend-plugin-api/alpha-api-report.md new file mode 100644 index 0000000000..84fe2de175 --- /dev/null +++ b/packages/backend-plugin-api/alpha-api-report.md @@ -0,0 +1,27 @@ +## API Report File for "@backstage/backend-plugin-api" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +// @alpha (undocumented) +export interface FeatureDiscoveryService { + // (undocumented) + getBackendFeatures(): Promise<{ + features: Array; + }>; +} + +// Warning: (ae-forgotten-export) The symbol "ServiceRef" needs to be exported by the entry point alpha.d.ts +// +// @alpha +export const featureDiscoveryServiceRef: ServiceRef< + FeatureDiscoveryService, + 'plugin' +>; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:5:9 - (ae-forgotten-export) The symbol "BackendFeature" needs to be exported by the entry point alpha.d.ts + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index a1ae6284c6..a9eba1ba86 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -21,6 +21,16 @@ export interface BackendFeature { $$type: '@backstage/BackendFeature'; } +// @public (undocumented) +export interface BackendFeatureFactory< + TOptions extends [options?: object] = [], +> { + // (undocumented) + $$type: '@backstage/BackendFeatureFactory'; + // (undocumented) + (...options: TOptions): BackendFeature; +} + // @public export interface BackendModuleConfig { moduleId: string; @@ -116,12 +126,12 @@ export namespace coreServices { // @public export function createBackendModule( config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig), -): (...params: TOptions) => BackendFeature; +): BackendFeatureFactory; // @public export function createBackendPlugin( config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), -): (...params: TOptions) => BackendFeature; +): BackendFeatureFactory; // @public export function createExtensionPoint( From c9039c79a8e1a41710a9ceba056085eb31c23061 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 14:28:48 +0200 Subject: [PATCH 08/15] update api report Signed-off-by: Vincenzo Scamporlino --- plugins/adr-backend/api-report.md | 4 ++-- plugins/airbrake-backend/api-report.md | 4 ++-- plugins/app-backend/alpha-api-report.md | 4 ++-- plugins/azure-devops-backend/api-report.md | 4 ++-- plugins/badges-backend/api-report.md | 4 ++-- plugins/bazaar-backend/api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 6 ++++-- .../alpha-api-report.md | 6 ++++-- .../catalog-backend-module-gcp/api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 6 ++++-- .../alpha-api-report.md | 18 +++++++++++------- .../alpha-api-report.md | 6 ++++-- .../alpha-api-report.md | 4 ++-- .../api-report.md | 4 ++-- plugins/catalog-backend/alpha-api-report.md | 4 ++-- plugins/devtools-backend/api-report.md | 4 ++-- plugins/entity-feedback-backend/api-report.md | 4 ++-- .../alpha-api-report.md | 6 ++++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 6 +++--- .../alpha-api-report.md | 6 +++--- plugins/events-backend/alpha-api-report.md | 4 ++-- .../example-todo-list-backend/api-report.md | 4 ++-- plugins/kafka-backend/api-report.md | 4 ++-- plugins/kubernetes-backend/alpha-api-report.md | 4 ++-- plugins/lighthouse-backend/api-report.md | 4 ++-- plugins/linguist-backend/api-report.md | 6 ++++-- plugins/periskop-backend/api-report.md | 4 ++-- plugins/permission-backend/alpha-api-report.md | 6 +++--- plugins/proxy-backend/api-report.md | 4 ++-- plugins/scaffolder-backend/alpha-api-report.md | 10 +++++----- .../alpha-api-report.md | 8 ++++---- .../alpha-api-report.md | 8 ++++---- .../alpha-api-report.md | 8 ++++---- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 8 ++++---- plugins/search-backend/alpha-api-report.md | 4 ++-- plugins/techdocs-backend/alpha-api-report.md | 4 ++-- plugins/todo-backend/api-report.md | 4 ++-- plugins/user-settings-backend/api-report.md | 4 ++-- 46 files changed, 127 insertions(+), 111 deletions(-) diff --git a/plugins/adr-backend/api-report.md b/plugins/adr-backend/api-report.md index 2fd22ef9cd..4092a6eb60 100644 --- a/plugins/adr-backend/api-report.md +++ b/plugins/adr-backend/api-report.md @@ -7,7 +7,7 @@ import { AdrDocument } from '@backstage/plugin-adr-common'; import { AdrFilePathFilterFn } from '@backstage/plugin-adr-common'; -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { CacheClient } from '@backstage/backend-common'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; @@ -45,7 +45,7 @@ export type AdrParserContext = { }; // @public -export const adrPlugin: () => BackendFeature; +export const adrPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export type AdrRouterOptions = { diff --git a/plugins/airbrake-backend/api-report.md b/plugins/airbrake-backend/api-report.md index c410245e31..d3dd706c29 100644 --- a/plugins/airbrake-backend/api-report.md +++ b/plugins/airbrake-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -14,7 +14,7 @@ export interface AirbrakeConfig { } // @public -export const airbrakePlugin: () => BackendFeature; +export const airbrakePlugin: BackendFeatureFactory<[]>; // @public export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/app-backend/alpha-api-report.md b/plugins/app-backend/alpha-api-report.md index 5fb0546a79..32d8cc3605 100644 --- a/plugins/app-backend/alpha-api-report.md +++ b/plugins/app-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const appPlugin: () => BackendFeature; +export const appPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/azure-devops-backend/api-report.md b/plugins/azure-devops-backend/api-report.md index a2a43cd6af..6447f03796 100644 --- a/plugins/azure-devops-backend/api-report.md +++ b/plugins/azure-devops-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Build } from 'azure-devops-node-api/interfaces/BuildInterfaces'; import { BuildDefinitionReference } from 'azure-devops-node-api/interfaces/BuildInterfaces'; import { BuildRun } from '@backstage/plugin-azure-devops-common'; @@ -96,7 +96,7 @@ export class AzureDevOpsApi { } // @public -export const azureDevOpsPlugin: () => BackendFeature; +export const azureDevOpsPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/badges-backend/api-report.md b/plugins/badges-backend/api-report.md index 4594228543..30fd1e0752 100644 --- a/plugins/badges-backend/api-report.md +++ b/plugins/badges-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; @@ -83,7 +83,7 @@ export type BadgeSpec = { }; // @public -export const badgesPlugin: () => BackendFeature; +export const badgesPlugin: BackendFeatureFactory<[]>; // @public export interface BadgesStore { diff --git a/plugins/bazaar-backend/api-report.md b/plugins/bazaar-backend/api-report.md index 6281530851..d3fe7987a1 100644 --- a/plugins/bazaar-backend/api-report.md +++ b/plugins/bazaar-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; @@ -11,7 +11,7 @@ import { Logger } from 'winston'; import { PluginDatabaseManager } from '@backstage/backend-common'; // @alpha -export const bazaarPlugin: () => BackendFeature; +export const bazaarPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/catalog-backend-module-aws/alpha-api-report.md b/plugins/catalog-backend-module-aws/alpha-api-report.md index f78f6a802d..6f4fa2c760 100644 --- a/plugins/catalog-backend-module-aws/alpha-api-report.md +++ b/plugins/catalog-backend-module-aws/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleAwsS3EntityProvider: () => BackendFeature; +export const catalogModuleAwsS3EntityProvider: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-azure/alpha-api-report.md b/plugins/catalog-backend-module-azure/alpha-api-report.md index 66551a2856..833eb3dc59 100644 --- a/plugins/catalog-backend-module-azure/alpha-api-report.md +++ b/plugins/catalog-backend-module-azure/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleAzureDevOpsEntityProvider: () => BackendFeature; +export const catalogModuleAzureDevOpsEntityProvider: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md b/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md index a5d0ffc665..0f76de5552 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md @@ -3,10 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -export const catalogModuleBitbucketCloudEntityProvider: () => BackendFeature; +export const catalogModuleBitbucketCloudEntityProvider: BackendFeatureFactory< + [] +>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md b/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md index 2cc53a3c16..2616e92cba 100644 --- a/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md +++ b/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md @@ -3,10 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -export const catalogModuleBitbucketServerEntityProvider: () => BackendFeature; +export const catalogModuleBitbucketServerEntityProvider: BackendFeatureFactory< + [] +>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gcp/api-report.md b/plugins/catalog-backend-module-gcp/api-report.md index 6f963ed51d..489032b830 100644 --- a/plugins/catalog-backend-module-gcp/api-report.md +++ b/plugins/catalog-backend-module-gcp/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import * as container from '@google-cloud/container'; import { EntityProvider } from '@backstage/plugin-catalog-node'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; import { SchedulerService } from '@backstage/backend-plugin-api'; // @public -export const catalogModuleGcpGkeEntityProvider: () => BackendFeature; +export const catalogModuleGcpGkeEntityProvider: BackendFeatureFactory<[]>; // @public export class GkeEntityProvider implements EntityProvider { diff --git a/plugins/catalog-backend-module-gerrit/alpha-api-report.md b/plugins/catalog-backend-module-gerrit/alpha-api-report.md index 5aee61f28a..b7e00008cf 100644 --- a/plugins/catalog-backend-module-gerrit/alpha-api-report.md +++ b/plugins/catalog-backend-module-gerrit/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -export const catalogModuleGerritEntityProvider: () => BackendFeature; +export const catalogModuleGerritEntityProvider: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/alpha-api-report.md b/plugins/catalog-backend-module-github/alpha-api-report.md index 0d4e16b4ea..abc5b4d2a0 100644 --- a/plugins/catalog-backend-module-github/alpha-api-report.md +++ b/plugins/catalog-backend-module-github/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleGithubEntityProvider: () => BackendFeature; +export const catalogModuleGithubEntityProvider: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gitlab/alpha-api-report.md b/plugins/catalog-backend-module-gitlab/alpha-api-report.md index f14b41d6c5..51ebbc4ae2 100644 --- a/plugins/catalog-backend-module-gitlab/alpha-api-report.md +++ b/plugins/catalog-backend-module-gitlab/alpha-api-report.md @@ -3,10 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleGitlabDiscoveryEntityProvider: () => BackendFeature; +export const catalogModuleGitlabDiscoveryEntityProvider: BackendFeatureFactory< + [] +>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md b/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md index b11ec43cf5..f067a0a6d7 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md +++ b/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md @@ -3,17 +3,21 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { IncrementalEntityProvider } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; import { IncrementalEntityProviderOptions } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; // @alpha -export const catalogModuleIncrementalIngestionEntityProvider: (options: { - providers: { - provider: IncrementalEntityProvider; - options: IncrementalEntityProviderOptions; - }[]; -}) => BackendFeature; +export const catalogModuleIncrementalIngestionEntityProvider: BackendFeatureFactory< + [ + options: { + providers: { + provider: IncrementalEntityProvider; + options: IncrementalEntityProviderOptions; + }[]; + }, + ] +>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-msgraph/alpha-api-report.md b/plugins/catalog-backend-module-msgraph/alpha-api-report.md index 0fa093a1bc..d8aa5f5816 100644 --- a/plugins/catalog-backend-module-msgraph/alpha-api-report.md +++ b/plugins/catalog-backend-module-msgraph/alpha-api-report.md @@ -3,13 +3,15 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { GroupTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; import { OrganizationTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; import { UserTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; // @alpha -export const catalogModuleMicrosoftGraphOrgEntityProvider: () => BackendFeature; +export const catalogModuleMicrosoftGraphOrgEntityProvider: BackendFeatureFactory< + [] +>; // @alpha export interface CatalogModuleMicrosoftGraphOrgEntityProviderOptions { diff --git a/plugins/catalog-backend-module-puppetdb/alpha-api-report.md b/plugins/catalog-backend-module-puppetdb/alpha-api-report.md index 0856fdb836..be38b9fc25 100644 --- a/plugins/catalog-backend-module-puppetdb/alpha-api-report.md +++ b/plugins/catalog-backend-module-puppetdb/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModulePuppetDbEntityProvider: () => BackendFeature; +export const catalogModulePuppetDbEntityProvider: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-unprocessed/api-report.md b/plugins/catalog-backend-module-unprocessed/api-report.md index 7fd7119276..6f52fdd967 100644 --- a/plugins/catalog-backend-module-unprocessed/api-report.md +++ b/plugins/catalog-backend-module-unprocessed/api-report.md @@ -3,12 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { HttpRouterService } from '@backstage/backend-plugin-api'; import { Knex } from 'knex'; // @public -export const catalogModuleUnprocessedEntities: () => BackendFeature; +export const catalogModuleUnprocessedEntities: BackendFeatureFactory<[]>; // @public export class UnprocessedEntitiesModule { diff --git a/plugins/catalog-backend/alpha-api-report.md b/plugins/catalog-backend/alpha-api-report.md index df3e809ade..57a10cbeda 100644 --- a/plugins/catalog-backend/alpha-api-report.md +++ b/plugins/catalog-backend/alpha-api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { ConditionalPolicyDecision } from '@backstage/plugin-permission-common'; import { Conditions } from '@backstage/plugin-permission-node'; import { Entity } from '@backstage/catalog-model'; @@ -74,7 +74,7 @@ export type CatalogPermissionRule< > = PermissionRule; // @alpha -export const catalogPlugin: () => BackendFeature; +export const catalogPlugin: BackendFeatureFactory<[]>; // @alpha export const createCatalogConditionalDecision: ( diff --git a/plugins/devtools-backend/api-report.md b/plugins/devtools-backend/api-report.md index dc51fc8387..dd356951f4 100644 --- a/plugins/devtools-backend/api-report.md +++ b/plugins/devtools-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { ConfigInfo } from '@backstage/plugin-devtools-common'; import { DevToolsInfo } from '@backstage/plugin-devtools-common'; @@ -27,7 +27,7 @@ export class DevToolsBackendApi { } // @public -export const devtoolsPlugin: () => BackendFeature; +export const devtoolsPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/entity-feedback-backend/api-report.md b/plugins/entity-feedback-backend/api-report.md index 3e8f90220e..fddce48592 100644 --- a/plugins/entity-feedback-backend/api-report.md +++ b/plugins/entity-feedback-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { Logger } from 'winston'; @@ -14,7 +14,7 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; export function createRouter(options: RouterOptions): Promise; // @public -export const entityFeedbackPlugin: () => BackendFeature; +export const entityFeedbackPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/events-backend-module-aws-sqs/alpha-api-report.md b/plugins/events-backend-module-aws-sqs/alpha-api-report.md index e48515a414..8f81ff00d1 100644 --- a/plugins/events-backend-module-aws-sqs/alpha-api-report.md +++ b/plugins/events-backend-module-aws-sqs/alpha-api-report.md @@ -3,10 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleAwsSqsConsumingEventPublisher: () => BackendFeature; +export const eventsModuleAwsSqsConsumingEventPublisher: BackendFeatureFactory< + [] +>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-azure/alpha-api-report.md b/plugins/events-backend-module-azure/alpha-api-report.md index 1bd568d1df..680c609c10 100644 --- a/plugins/events-backend-module-azure/alpha-api-report.md +++ b/plugins/events-backend-module-azure/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleAzureDevOpsEventRouter: () => BackendFeature; +export const eventsModuleAzureDevOpsEventRouter: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md b/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md index 5e63ae36c8..52b2cac142 100644 --- a/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md +++ b/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleBitbucketCloudEventRouter: () => BackendFeature; +export const eventsModuleBitbucketCloudEventRouter: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gerrit/alpha-api-report.md b/plugins/events-backend-module-gerrit/alpha-api-report.md index d1be54730f..82588d05ac 100644 --- a/plugins/events-backend-module-gerrit/alpha-api-report.md +++ b/plugins/events-backend-module-gerrit/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleGerritEventRouter: () => BackendFeature; +export const eventsModuleGerritEventRouter: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-github/alpha-api-report.md b/plugins/events-backend-module-github/alpha-api-report.md index c233df8634..21bfdbb9d2 100644 --- a/plugins/events-backend-module-github/alpha-api-report.md +++ b/plugins/events-backend-module-github/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleGithubEventRouter: () => BackendFeature; +export const eventsModuleGithubEventRouter: BackendFeatureFactory<[]>; // @alpha -export const eventsModuleGithubWebhook: () => BackendFeature; +export const eventsModuleGithubWebhook: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gitlab/alpha-api-report.md b/plugins/events-backend-module-gitlab/alpha-api-report.md index bf61f66a4b..bca947c195 100644 --- a/plugins/events-backend-module-gitlab/alpha-api-report.md +++ b/plugins/events-backend-module-gitlab/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleGitlabEventRouter: () => BackendFeature; +export const eventsModuleGitlabEventRouter: BackendFeatureFactory<[]>; // @alpha -export const eventsModuleGitlabWebhook: () => BackendFeature; +export const eventsModuleGitlabWebhook: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend/alpha-api-report.md b/plugins/events-backend/alpha-api-report.md index 3e32f769c1..72d4bce4b2 100644 --- a/plugins/events-backend/alpha-api-report.md +++ b/plugins/events-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const eventsPlugin: () => BackendFeature; +export const eventsPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/example-todo-list-backend/api-report.md b/plugins/example-todo-list-backend/api-report.md index 319fbbf226..80b86c4e4d 100644 --- a/plugins/example-todo-list-backend/api-report.md +++ b/plugins/example-todo-list-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { Logger } from 'winston'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const exampleTodoListPlugin: () => BackendFeature; +export const exampleTodoListPlugin: BackendFeatureFactory<[]>; // @public export interface RouterOptions { diff --git a/plugins/kafka-backend/api-report.md b/plugins/kafka-backend/api-report.md index a748a543d9..176c961cd4 100644 --- a/plugins/kafka-backend/api-report.md +++ b/plugins/kafka-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const kafkaPlugin: () => BackendFeature; +export const kafkaPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/kubernetes-backend/alpha-api-report.md b/plugins/kubernetes-backend/alpha-api-report.md index f95c1414f3..77a300d344 100644 --- a/plugins/kubernetes-backend/alpha-api-report.md +++ b/plugins/kubernetes-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const kubernetesPlugin: () => BackendFeature; +export const kubernetesPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/lighthouse-backend/api-report.md b/plugins/lighthouse-backend/api-report.md index 5d9d948cf4..f504ce70c9 100644 --- a/plugins/lighthouse-backend/api-report.md +++ b/plugins/lighthouse-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Logger } from 'winston'; @@ -30,7 +30,7 @@ export function createScheduler( ): Promise; // @public -export const lighthousePlugin: () => BackendFeature; +export const lighthousePlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/linguist-backend/api-report.md b/plugins/linguist-backend/api-report.md index aac978e426..995b54da62 100644 --- a/plugins/linguist-backend/api-report.md +++ b/plugins/linguist-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorCache } from '@backstage/plugin-catalog-node'; import { Config } from '@backstage/config'; @@ -36,7 +36,9 @@ export interface LinguistBackendApi { } // @public -export const linguistPlugin: (options: LinguistPluginOptions) => BackendFeature; +export const linguistPlugin: BackendFeatureFactory< + [options: LinguistPluginOptions] +>; // @public export interface LinguistPluginOptions { diff --git a/plugins/periskop-backend/api-report.md b/plugins/periskop-backend/api-report.md index 7906bc4785..e548a70a75 100644 --- a/plugins/periskop-backend/api-report.md +++ b/plugins/periskop-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const periskopPlugin: () => BackendFeature; +export const periskopPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/permission-backend/alpha-api-report.md b/plugins/permission-backend/alpha-api-report.md index 926691930b..5068992c71 100644 --- a/plugins/permission-backend/alpha-api-report.md +++ b/plugins/permission-backend/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const permissionModuleAllowAllPolicy: () => BackendFeature; +export const permissionModuleAllowAllPolicy: BackendFeatureFactory<[]>; // @alpha -export const permissionPlugin: () => BackendFeature; +export const permissionPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/proxy-backend/api-report.md b/plugins/proxy-backend/api-report.md index 9c5cf5f9ef..7960c9658c 100644 --- a/plugins/proxy-backend/api-report.md +++ b/plugins/proxy-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -13,7 +13,7 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const proxyPlugin: () => BackendFeature; +export const proxyPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/scaffolder-backend/alpha-api-report.md b/plugins/scaffolder-backend/alpha-api-report.md index 363fcafd17..f4174697b2 100644 --- a/plugins/scaffolder-backend/alpha-api-report.md +++ b/plugins/scaffolder-backend/alpha-api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { ConditionalPolicyDecision } from '@backstage/plugin-permission-common'; import { Conditions } from '@backstage/plugin-permission-node'; import { JsonObject } from '@backstage/types'; @@ -20,7 +20,7 @@ import { TemplateGlobal } from '@backstage/plugin-scaffolder-backend'; import { TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common'; // @alpha -export const catalogModuleTemplateKind: () => BackendFeature; +export const catalogModuleTemplateKind: BackendFeatureFactory<[]>; // @alpha (undocumented) export const createScaffolderActionConditionalDecision: ( @@ -90,9 +90,9 @@ export const scaffolderActionConditions: Conditions<{ }>; // @alpha -export const scaffolderPlugin: ( - options?: ScaffolderPluginOptions | undefined, -) => BackendFeature; +export const scaffolderPlugin: BackendFeatureFactory< + [options?: ScaffolderPluginOptions | undefined] +>; // @alpha export type ScaffolderPluginOptions = { diff --git a/plugins/search-backend-module-catalog/alpha-api-report.md b/plugins/search-backend-module-catalog/alpha-api-report.md index 7c6e91b6a1..02a2ea2266 100644 --- a/plugins/search-backend-module-catalog/alpha-api-report.md +++ b/plugins/search-backend-module-catalog/alpha-api-report.md @@ -3,14 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { DefaultCatalogCollatorFactoryOptions } from '@backstage/plugin-search-backend-module-catalog'; import { TaskScheduleDefinition } from '@backstage/backend-tasks'; // @alpha -export const searchModuleCatalogCollator: ( - options?: SearchModuleCatalogCollatorOptions | undefined, -) => BackendFeature; +export const searchModuleCatalogCollator: BackendFeatureFactory< + [options?: SearchModuleCatalogCollatorOptions | undefined] +>; // @alpha export type SearchModuleCatalogCollatorOptions = Omit< diff --git a/plugins/search-backend-module-elasticsearch/alpha-api-report.md b/plugins/search-backend-module-elasticsearch/alpha-api-report.md index 91007c20de..254771b484 100644 --- a/plugins/search-backend-module-elasticsearch/alpha-api-report.md +++ b/plugins/search-backend-module-elasticsearch/alpha-api-report.md @@ -3,14 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { ElasticSearchCustomIndexTemplate } from '@backstage/plugin-search-backend-module-elasticsearch'; import { ElasticSearchQueryTranslator } from '@backstage/plugin-search-backend-module-elasticsearch'; // @alpha -export const searchModuleElasticsearchEngine: ( - options?: SearchModuleElasticsearchEngineOptions | undefined, -) => BackendFeature; +export const searchModuleElasticsearchEngine: BackendFeatureFactory< + [options?: SearchModuleElasticsearchEngineOptions | undefined] +>; // @alpha export type SearchModuleElasticsearchEngineOptions = { diff --git a/plugins/search-backend-module-explore/alpha-api-report.md b/plugins/search-backend-module-explore/alpha-api-report.md index 7b0f2658d6..f8053601b3 100644 --- a/plugins/search-backend-module-explore/alpha-api-report.md +++ b/plugins/search-backend-module-explore/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { TaskScheduleDefinition } from '@backstage/backend-tasks'; // @alpha -export const searchModuleExploreCollator: ( - options?: SearchModuleExploreCollatorOptions | undefined, -) => BackendFeature; +export const searchModuleExploreCollator: BackendFeatureFactory< + [options?: SearchModuleExploreCollatorOptions | undefined] +>; // @alpha export type SearchModuleExploreCollatorOptions = { diff --git a/plugins/search-backend-module-pg/alpha-api-report.md b/plugins/search-backend-module-pg/alpha-api-report.md index eaee78e944..d41010a594 100644 --- a/plugins/search-backend-module-pg/alpha-api-report.md +++ b/plugins/search-backend-module-pg/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const searchModulePostgresEngine: () => BackendFeature; +export const searchModulePostgresEngine: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-techdocs/alpha-api-report.md b/plugins/search-backend-module-techdocs/alpha-api-report.md index 0eac010b4c..4f7515dac5 100644 --- a/plugins/search-backend-module-techdocs/alpha-api-report.md +++ b/plugins/search-backend-module-techdocs/alpha-api-report.md @@ -3,14 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { TechDocsCollatorFactoryOptions } from '@backstage/plugin-search-backend-module-techdocs'; // @alpha -export const searchModuleTechDocsCollator: ( - options?: SearchModuleTechDocsCollatorOptions | undefined, -) => BackendFeature; +export const searchModuleTechDocsCollator: BackendFeatureFactory< + [options?: SearchModuleTechDocsCollatorOptions | undefined] +>; // @alpha export type SearchModuleTechDocsCollatorOptions = Omit< diff --git a/plugins/search-backend/alpha-api-report.md b/plugins/search-backend/alpha-api-report.md index 6ee94a0e29..9d620efe0e 100644 --- a/plugins/search-backend/alpha-api-report.md +++ b/plugins/search-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const searchPlugin: () => BackendFeature; +export const searchPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/techdocs-backend/alpha-api-report.md b/plugins/techdocs-backend/alpha-api-report.md index 16db84c216..6de1a7d209 100644 --- a/plugins/techdocs-backend/alpha-api-report.md +++ b/plugins/techdocs-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; // @alpha -export const techdocsPlugin: () => BackendFeature; +export const techdocsPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/todo-backend/api-report.md b/plugins/todo-backend/api-report.md index 6db1e012e9..a3703eaaab 100644 --- a/plugins/todo-backend/api-report.md +++ b/plugins/todo-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { CompoundEntityRef } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; @@ -91,7 +91,7 @@ export type TodoParserResult = { }; // @public -export const todoPlugin: () => BackendFeature; +export const todoPlugin: BackendFeatureFactory<[]>; // @public (undocumented) export interface TodoReader { diff --git a/plugins/user-settings-backend/api-report.md b/plugins/user-settings-backend/api-report.md index b015915723..32722bbf2d 100644 --- a/plugins/user-settings-backend/api-report.md +++ b/plugins/user-settings-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeature } from '@backstage/backend-plugin-api'; +import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { PluginDatabaseManager } from '@backstage/backend-common'; @@ -20,7 +20,7 @@ export interface RouterOptions { } // @alpha -export const userSettingsPlugin: () => BackendFeature; +export const userSettingsPlugin: BackendFeatureFactory<[]>; // (No @packageDocumentation comment for this package) ``` From 9f88cb0ebd1d037cac6223ad23e6933cd25bf4fe Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 22:37:28 +0200 Subject: [PATCH 09/15] backend-app-api: improve naming Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/src/wiring/BackendInitializer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-app-api/src/wiring/BackendInitializer.ts b/packages/backend-app-api/src/wiring/BackendInitializer.ts index cf140158a6..6bc4e995e2 100644 --- a/packages/backend-app-api/src/wiring/BackendInitializer.ts +++ b/packages/backend-app-api/src/wiring/BackendInitializer.ts @@ -141,8 +141,8 @@ export class BackendInitializer { if (featureDiscovery) { const { features } = await featureDiscovery.getBackendFeatures(); - for (const plugin of features) { - this.#addFeature(plugin); + for (const feature of features) { + this.#addFeature(feature); } } From 6246562ab473bd14a9119e09b298eb6c14e97703 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 22:38:53 +0200 Subject: [PATCH 10/15] backend-plugin-api: fix scope Signed-off-by: Vincenzo Scamporlino --- packages/backend-plugin-api/alpha-api-report.md | 16 +++++++++++++--- packages/backend-plugin-api/src/alpha.ts | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/backend-plugin-api/alpha-api-report.md b/packages/backend-plugin-api/alpha-api-report.md index 84fe2de175..74616a5138 100644 --- a/packages/backend-plugin-api/alpha-api-report.md +++ b/packages/backend-plugin-api/alpha-api-report.md @@ -11,14 +11,24 @@ export interface FeatureDiscoveryService { }>; } -// Warning: (ae-forgotten-export) The symbol "ServiceRef" needs to be exported by the entry point alpha.d.ts -// // @alpha export const featureDiscoveryServiceRef: ServiceRef< FeatureDiscoveryService, - 'plugin' + 'root' >; +// @public +export type ServiceRef< + TService, + TScope extends 'root' | 'plugin' = 'root' | 'plugin', +> = { + id: string; + scope: TScope; + T: TService; + toString(): string; + $$type: '@backstage/ServiceRef'; +}; + // Warnings were encountered during analysis: // // src/alpha.d.ts:5:9 - (ae-forgotten-export) The symbol "BackendFeature" needs to be exported by the entry point alpha.d.ts diff --git a/packages/backend-plugin-api/src/alpha.ts b/packages/backend-plugin-api/src/alpha.ts index 1030b55d95..bd6be5b75e 100644 --- a/packages/backend-plugin-api/src/alpha.ts +++ b/packages/backend-plugin-api/src/alpha.ts @@ -29,4 +29,8 @@ export interface FeatureDiscoveryService { export const featureDiscoveryServiceRef = createServiceRef({ id: 'core.featureDiscovery', + scope: 'root', }); + +export type { ServiceRef } from './services'; +export type { BackendFeature }; From 5726b01e4d9a47b8f11638b24a9d7931c8962435 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Wed, 2 Aug 2023 22:39:52 +0200 Subject: [PATCH 11/15] backend-plugin-api: unused object Signed-off-by: Vincenzo Scamporlino --- packages/backend-plugin-api/src/wiring/factories.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/backend-plugin-api/src/wiring/factories.ts b/packages/backend-plugin-api/src/wiring/factories.ts index ba9238e0e0..cbc3771b86 100644 --- a/packages/backend-plugin-api/src/wiring/factories.ts +++ b/packages/backend-plugin-api/src/wiring/factories.ts @@ -77,11 +77,6 @@ export interface BackendPluginConfig { register(reg: BackendPluginRegistrationPoints): void; } -export const catalogPlugin = createBackendPlugin({ - pluginId: 'catalog', - register() {}, -}); - /** * Creates a new backend plugin. * From 35ccc2365a0756fc7ef100c5d003b3943135590d Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 7 Aug 2023 15:08:48 +0200 Subject: [PATCH 12/15] Fix backend-plugin-api alpha api report Signed-off-by: Philipp Hugenroth --- packages/backend-app-api/alpha-api-report.md | 16 ++++++++++++++++ packages/backend-app-api/package.json | 4 ++-- .../src/{alpha/index.ts => alpha.ts} | 2 +- packages/backend-plugin-api/alpha-api-report.md | 10 ++++++---- 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 packages/backend-app-api/alpha-api-report.md rename packages/backend-app-api/src/{alpha/index.ts => alpha.ts} (87%) diff --git a/packages/backend-app-api/alpha-api-report.md b/packages/backend-app-api/alpha-api-report.md new file mode 100644 index 0000000000..488feedf2c --- /dev/null +++ b/packages/backend-app-api/alpha-api-report.md @@ -0,0 +1,16 @@ +## API Report File for "@backstage/backend-app-api" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { FeatureDiscoveryService } from '@backstage/backend-plugin-api/alpha'; +import { ServiceFactory } from '@backstage/backend-plugin-api'; + +// @alpha (undocumented) +export const featureDiscoveryServiceFactory: () => ServiceFactory< + FeatureDiscoveryService, + 'root' +>; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-app-api/package.json b/packages/backend-app-api/package.json index bc3318fce5..d1f3f8ac43 100644 --- a/packages/backend-app-api/package.json +++ b/packages/backend-app-api/package.json @@ -12,13 +12,13 @@ }, "exports": { ".": "./src/index.ts", - "./alpha": "./src/alpha/index.ts", + "./alpha": "./src/alpha.ts", "./package.json": "./package.json" }, "typesVersions": { "*": { "alpha": [ - "src/alpha/index.ts" + "src/alpha.ts" ], "package.json": [ "package.json" diff --git a/packages/backend-app-api/src/alpha/index.ts b/packages/backend-app-api/src/alpha.ts similarity index 87% rename from packages/backend-app-api/src/alpha/index.ts rename to packages/backend-app-api/src/alpha.ts index 6afc9e2eb6..a334214738 100644 --- a/packages/backend-app-api/src/alpha/index.ts +++ b/packages/backend-app-api/src/alpha.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { featureDiscoveryServiceFactory } from './featureDiscoveryServiceFactory'; +export { featureDiscoveryServiceFactory } from './alpha/featureDiscoveryServiceFactory'; diff --git a/packages/backend-plugin-api/alpha-api-report.md b/packages/backend-plugin-api/alpha-api-report.md index 74616a5138..d76d7e4deb 100644 --- a/packages/backend-plugin-api/alpha-api-report.md +++ b/packages/backend-plugin-api/alpha-api-report.md @@ -3,6 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +// @public (undocumented) +export interface BackendFeature { + // (undocumented) + $$type: '@backstage/BackendFeature'; +} + // @alpha (undocumented) export interface FeatureDiscoveryService { // (undocumented) @@ -29,9 +35,5 @@ export type ServiceRef< $$type: '@backstage/ServiceRef'; }; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:5:9 - (ae-forgotten-export) The symbol "BackendFeature" needs to be exported by the entry point alpha.d.ts - // (No @packageDocumentation comment for this package) ``` From 9261f22f1c04c5aec8620db011dc85ba3a9ce636 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 8 Aug 2023 13:00:08 +0200 Subject: [PATCH 13/15] keep BackendFeatureFactory internal Signed-off-by: Vincenzo Scamporlino --- .../backend-plugin-api/alpha-api-report.md | 10 ++++++++++ packages/backend-plugin-api/api-report.md | 4 ++-- packages/backend-plugin-api/src/alpha.ts | 4 ++-- .../backend-plugin-api/src/wiring/factories.ts | 5 +++-- plugins/adr-backend/api-report.md | 4 ++-- plugins/airbrake-backend/api-report.md | 4 ++-- plugins/app-backend/alpha-api-report.md | 4 ++-- plugins/azure-devops-backend/api-report.md | 4 ++-- plugins/badges-backend/api-report.md | 4 ++-- plugins/bazaar-backend/api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 6 ++---- .../alpha-api-report.md | 6 ++---- .../catalog-backend-module-gcp/api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 6 ++---- .../alpha-api-report.md | 18 +++++++----------- .../alpha-api-report.md | 6 ++---- .../alpha-api-report.md | 4 ++-- .../api-report.md | 4 ++-- plugins/catalog-backend/alpha-api-report.md | 4 ++-- plugins/devtools-backend/api-report.md | 4 ++-- plugins/entity-feedback-backend/api-report.md | 4 ++-- .../alpha-api-report.md | 6 ++---- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 6 +++--- .../alpha-api-report.md | 6 +++--- plugins/events-backend/alpha-api-report.md | 4 ++-- .../example-todo-list-backend/api-report.md | 4 ++-- plugins/kafka-backend/api-report.md | 4 ++-- plugins/kubernetes-backend/alpha-api-report.md | 4 ++-- plugins/lighthouse-backend/api-report.md | 4 ++-- plugins/linguist-backend/api-report.md | 6 ++---- plugins/periskop-backend/api-report.md | 4 ++-- plugins/permission-backend/alpha-api-report.md | 6 +++--- plugins/proxy-backend/api-report.md | 4 ++-- plugins/scaffolder-backend/alpha-api-report.md | 10 +++++----- .../alpha-api-report.md | 8 ++++---- .../alpha-api-report.md | 8 ++++---- .../alpha-api-report.md | 8 ++++---- .../alpha-api-report.md | 4 ++-- .../alpha-api-report.md | 8 ++++---- plugins/search-backend/alpha-api-report.md | 4 ++-- plugins/techdocs-backend/alpha-api-report.md | 4 ++-- plugins/todo-backend/api-report.md | 4 ++-- plugins/user-settings-backend/api-report.md | 4 ++-- 50 files changed, 128 insertions(+), 133 deletions(-) diff --git a/packages/backend-plugin-api/alpha-api-report.md b/packages/backend-plugin-api/alpha-api-report.md index d76d7e4deb..29f78ed9d1 100644 --- a/packages/backend-plugin-api/alpha-api-report.md +++ b/packages/backend-plugin-api/alpha-api-report.md @@ -9,6 +9,16 @@ export interface BackendFeature { $$type: '@backstage/BackendFeature'; } +// @public (undocumented) +export interface BackendFeatureFactory< + TOptions extends [options?: object] = [], +> { + // (undocumented) + $$type: '@backstage/BackendFeatureFactory'; + // (undocumented) + (...options: TOptions): BackendFeature; +} + // @alpha (undocumented) export interface FeatureDiscoveryService { // (undocumented) diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index a9eba1ba86..dc75c09b18 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -126,12 +126,12 @@ export namespace coreServices { // @public export function createBackendModule( config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig), -): BackendFeatureFactory; +): (...params: TOptions) => BackendFeature; // @public export function createBackendPlugin( config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), -): BackendFeatureFactory; +): (...params: TOptions) => BackendFeature; // @public export function createExtensionPoint( diff --git a/packages/backend-plugin-api/src/alpha.ts b/packages/backend-plugin-api/src/alpha.ts index bd6be5b75e..e3598dff5a 100644 --- a/packages/backend-plugin-api/src/alpha.ts +++ b/packages/backend-plugin-api/src/alpha.ts @@ -15,7 +15,7 @@ */ import { createServiceRef } from './services'; -import { BackendFeature } from './wiring'; +import { BackendFeature, BackendFeatureFactory } from './wiring'; /** @alpha */ export interface FeatureDiscoveryService { @@ -33,4 +33,4 @@ export const featureDiscoveryServiceRef = }); export type { ServiceRef } from './services'; -export type { BackendFeature }; +export type { BackendFeature, BackendFeatureFactory }; diff --git a/packages/backend-plugin-api/src/wiring/factories.ts b/packages/backend-plugin-api/src/wiring/factories.ts index cbc3771b86..ecaccdc6de 100644 --- a/packages/backend-plugin-api/src/wiring/factories.ts +++ b/packages/backend-plugin-api/src/wiring/factories.ts @@ -21,6 +21,7 @@ import { InternalBackendModuleRegistration, InternalBackendPluginRegistration, BackendFeatureFactory, + BackendFeature, } from './types'; /** @@ -86,7 +87,7 @@ export interface BackendPluginConfig { */ export function createBackendPlugin( config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig), -): BackendFeatureFactory { +): (...params: TOptions) => BackendFeature { const configCallback = typeof config === 'function' ? config : () => config; const factory: BackendFeatureFactory = (...options) => { @@ -179,7 +180,7 @@ export interface BackendModuleConfig { */ export function createBackendModule( config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig), -): BackendFeatureFactory { +): (...params: TOptions) => BackendFeature { const configCallback = typeof config === 'function' ? config : () => config; const factory: BackendFeatureFactory = (...options: TOptions) => { const c = configCallback(...options); diff --git a/plugins/adr-backend/api-report.md b/plugins/adr-backend/api-report.md index 4092a6eb60..2fd22ef9cd 100644 --- a/plugins/adr-backend/api-report.md +++ b/plugins/adr-backend/api-report.md @@ -7,7 +7,7 @@ import { AdrDocument } from '@backstage/plugin-adr-common'; import { AdrFilePathFilterFn } from '@backstage/plugin-adr-common'; -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CacheClient } from '@backstage/backend-common'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; @@ -45,7 +45,7 @@ export type AdrParserContext = { }; // @public -export const adrPlugin: BackendFeatureFactory<[]>; +export const adrPlugin: () => BackendFeature; // @public (undocumented) export type AdrRouterOptions = { diff --git a/plugins/airbrake-backend/api-report.md b/plugins/airbrake-backend/api-report.md index d3dd706c29..c410245e31 100644 --- a/plugins/airbrake-backend/api-report.md +++ b/plugins/airbrake-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -14,7 +14,7 @@ export interface AirbrakeConfig { } // @public -export const airbrakePlugin: BackendFeatureFactory<[]>; +export const airbrakePlugin: () => BackendFeature; // @public export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/app-backend/alpha-api-report.md b/plugins/app-backend/alpha-api-report.md index 32d8cc3605..5fb0546a79 100644 --- a/plugins/app-backend/alpha-api-report.md +++ b/plugins/app-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const appPlugin: BackendFeatureFactory<[]>; +export const appPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/azure-devops-backend/api-report.md b/plugins/azure-devops-backend/api-report.md index 6447f03796..a2a43cd6af 100644 --- a/plugins/azure-devops-backend/api-report.md +++ b/plugins/azure-devops-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Build } from 'azure-devops-node-api/interfaces/BuildInterfaces'; import { BuildDefinitionReference } from 'azure-devops-node-api/interfaces/BuildInterfaces'; import { BuildRun } from '@backstage/plugin-azure-devops-common'; @@ -96,7 +96,7 @@ export class AzureDevOpsApi { } // @public -export const azureDevOpsPlugin: BackendFeatureFactory<[]>; +export const azureDevOpsPlugin: () => BackendFeature; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/badges-backend/api-report.md b/plugins/badges-backend/api-report.md index 30fd1e0752..4594228543 100644 --- a/plugins/badges-backend/api-report.md +++ b/plugins/badges-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; @@ -83,7 +83,7 @@ export type BadgeSpec = { }; // @public -export const badgesPlugin: BackendFeatureFactory<[]>; +export const badgesPlugin: () => BackendFeature; // @public export interface BadgesStore { diff --git a/plugins/bazaar-backend/api-report.md b/plugins/bazaar-backend/api-report.md index d3fe7987a1..6281530851 100644 --- a/plugins/bazaar-backend/api-report.md +++ b/plugins/bazaar-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; @@ -11,7 +11,7 @@ import { Logger } from 'winston'; import { PluginDatabaseManager } from '@backstage/backend-common'; // @alpha -export const bazaarPlugin: BackendFeatureFactory<[]>; +export const bazaarPlugin: () => BackendFeature; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/catalog-backend-module-aws/alpha-api-report.md b/plugins/catalog-backend-module-aws/alpha-api-report.md index 6f4fa2c760..f78f6a802d 100644 --- a/plugins/catalog-backend-module-aws/alpha-api-report.md +++ b/plugins/catalog-backend-module-aws/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleAwsS3EntityProvider: BackendFeatureFactory<[]>; +export const catalogModuleAwsS3EntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-azure/alpha-api-report.md b/plugins/catalog-backend-module-azure/alpha-api-report.md index 833eb3dc59..66551a2856 100644 --- a/plugins/catalog-backend-module-azure/alpha-api-report.md +++ b/plugins/catalog-backend-module-azure/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleAzureDevOpsEntityProvider: BackendFeatureFactory<[]>; +export const catalogModuleAzureDevOpsEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md b/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md index 0f76de5552..a5d0ffc665 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/alpha-api-report.md @@ -3,12 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -export const catalogModuleBitbucketCloudEntityProvider: BackendFeatureFactory< - [] ->; +export const catalogModuleBitbucketCloudEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md b/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md index 2616e92cba..2cc53a3c16 100644 --- a/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md +++ b/plugins/catalog-backend-module-bitbucket-server/alpha-api-report.md @@ -3,12 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -export const catalogModuleBitbucketServerEntityProvider: BackendFeatureFactory< - [] ->; +export const catalogModuleBitbucketServerEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gcp/api-report.md b/plugins/catalog-backend-module-gcp/api-report.md index 489032b830..6f963ed51d 100644 --- a/plugins/catalog-backend-module-gcp/api-report.md +++ b/plugins/catalog-backend-module-gcp/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import * as container from '@google-cloud/container'; import { EntityProvider } from '@backstage/plugin-catalog-node'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; import { SchedulerService } from '@backstage/backend-plugin-api'; // @public -export const catalogModuleGcpGkeEntityProvider: BackendFeatureFactory<[]>; +export const catalogModuleGcpGkeEntityProvider: () => BackendFeature; // @public export class GkeEntityProvider implements EntityProvider { diff --git a/plugins/catalog-backend-module-gerrit/alpha-api-report.md b/plugins/catalog-backend-module-gerrit/alpha-api-report.md index b7e00008cf..5aee61f28a 100644 --- a/plugins/catalog-backend-module-gerrit/alpha-api-report.md +++ b/plugins/catalog-backend-module-gerrit/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -export const catalogModuleGerritEntityProvider: BackendFeatureFactory<[]>; +export const catalogModuleGerritEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/alpha-api-report.md b/plugins/catalog-backend-module-github/alpha-api-report.md index abc5b4d2a0..0d4e16b4ea 100644 --- a/plugins/catalog-backend-module-github/alpha-api-report.md +++ b/plugins/catalog-backend-module-github/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleGithubEntityProvider: BackendFeatureFactory<[]>; +export const catalogModuleGithubEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gitlab/alpha-api-report.md b/plugins/catalog-backend-module-gitlab/alpha-api-report.md index 51ebbc4ae2..f14b41d6c5 100644 --- a/plugins/catalog-backend-module-gitlab/alpha-api-report.md +++ b/plugins/catalog-backend-module-gitlab/alpha-api-report.md @@ -3,12 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModuleGitlabDiscoveryEntityProvider: BackendFeatureFactory< - [] ->; +export const catalogModuleGitlabDiscoveryEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md b/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md index f067a0a6d7..b11ec43cf5 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md +++ b/plugins/catalog-backend-module-incremental-ingestion/alpha-api-report.md @@ -3,21 +3,17 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { IncrementalEntityProvider } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; import { IncrementalEntityProviderOptions } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; // @alpha -export const catalogModuleIncrementalIngestionEntityProvider: BackendFeatureFactory< - [ - options: { - providers: { - provider: IncrementalEntityProvider; - options: IncrementalEntityProviderOptions; - }[]; - }, - ] ->; +export const catalogModuleIncrementalIngestionEntityProvider: (options: { + providers: { + provider: IncrementalEntityProvider; + options: IncrementalEntityProviderOptions; + }[]; +}) => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-msgraph/alpha-api-report.md b/plugins/catalog-backend-module-msgraph/alpha-api-report.md index d8aa5f5816..0fa093a1bc 100644 --- a/plugins/catalog-backend-module-msgraph/alpha-api-report.md +++ b/plugins/catalog-backend-module-msgraph/alpha-api-report.md @@ -3,15 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { GroupTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; import { OrganizationTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; import { UserTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; // @alpha -export const catalogModuleMicrosoftGraphOrgEntityProvider: BackendFeatureFactory< - [] ->; +export const catalogModuleMicrosoftGraphOrgEntityProvider: () => BackendFeature; // @alpha export interface CatalogModuleMicrosoftGraphOrgEntityProviderOptions { diff --git a/plugins/catalog-backend-module-puppetdb/alpha-api-report.md b/plugins/catalog-backend-module-puppetdb/alpha-api-report.md index be38b9fc25..0856fdb836 100644 --- a/plugins/catalog-backend-module-puppetdb/alpha-api-report.md +++ b/plugins/catalog-backend-module-puppetdb/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const catalogModulePuppetDbEntityProvider: BackendFeatureFactory<[]>; +export const catalogModulePuppetDbEntityProvider: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-unprocessed/api-report.md b/plugins/catalog-backend-module-unprocessed/api-report.md index 6f52fdd967..7fd7119276 100644 --- a/plugins/catalog-backend-module-unprocessed/api-report.md +++ b/plugins/catalog-backend-module-unprocessed/api-report.md @@ -3,12 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { HttpRouterService } from '@backstage/backend-plugin-api'; import { Knex } from 'knex'; // @public -export const catalogModuleUnprocessedEntities: BackendFeatureFactory<[]>; +export const catalogModuleUnprocessedEntities: () => BackendFeature; // @public export class UnprocessedEntitiesModule { diff --git a/plugins/catalog-backend/alpha-api-report.md b/plugins/catalog-backend/alpha-api-report.md index 57a10cbeda..df3e809ade 100644 --- a/plugins/catalog-backend/alpha-api-report.md +++ b/plugins/catalog-backend/alpha-api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { ConditionalPolicyDecision } from '@backstage/plugin-permission-common'; import { Conditions } from '@backstage/plugin-permission-node'; import { Entity } from '@backstage/catalog-model'; @@ -74,7 +74,7 @@ export type CatalogPermissionRule< > = PermissionRule; // @alpha -export const catalogPlugin: BackendFeatureFactory<[]>; +export const catalogPlugin: () => BackendFeature; // @alpha export const createCatalogConditionalDecision: ( diff --git a/plugins/devtools-backend/api-report.md b/plugins/devtools-backend/api-report.md index dd356951f4..dc51fc8387 100644 --- a/plugins/devtools-backend/api-report.md +++ b/plugins/devtools-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { ConfigInfo } from '@backstage/plugin-devtools-common'; import { DevToolsInfo } from '@backstage/plugin-devtools-common'; @@ -27,7 +27,7 @@ export class DevToolsBackendApi { } // @public -export const devtoolsPlugin: BackendFeatureFactory<[]>; +export const devtoolsPlugin: () => BackendFeature; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/entity-feedback-backend/api-report.md b/plugins/entity-feedback-backend/api-report.md index fddce48592..3e8f90220e 100644 --- a/plugins/entity-feedback-backend/api-report.md +++ b/plugins/entity-feedback-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { Logger } from 'winston'; @@ -14,7 +14,7 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; export function createRouter(options: RouterOptions): Promise; // @public -export const entityFeedbackPlugin: BackendFeatureFactory<[]>; +export const entityFeedbackPlugin: () => BackendFeature; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/events-backend-module-aws-sqs/alpha-api-report.md b/plugins/events-backend-module-aws-sqs/alpha-api-report.md index 8f81ff00d1..e48515a414 100644 --- a/plugins/events-backend-module-aws-sqs/alpha-api-report.md +++ b/plugins/events-backend-module-aws-sqs/alpha-api-report.md @@ -3,12 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleAwsSqsConsumingEventPublisher: BackendFeatureFactory< - [] ->; +export const eventsModuleAwsSqsConsumingEventPublisher: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-azure/alpha-api-report.md b/plugins/events-backend-module-azure/alpha-api-report.md index 680c609c10..1bd568d1df 100644 --- a/plugins/events-backend-module-azure/alpha-api-report.md +++ b/plugins/events-backend-module-azure/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleAzureDevOpsEventRouter: BackendFeatureFactory<[]>; +export const eventsModuleAzureDevOpsEventRouter: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md b/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md index 52b2cac142..5e63ae36c8 100644 --- a/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md +++ b/plugins/events-backend-module-bitbucket-cloud/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleBitbucketCloudEventRouter: BackendFeatureFactory<[]>; +export const eventsModuleBitbucketCloudEventRouter: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gerrit/alpha-api-report.md b/plugins/events-backend-module-gerrit/alpha-api-report.md index 82588d05ac..d1be54730f 100644 --- a/plugins/events-backend-module-gerrit/alpha-api-report.md +++ b/plugins/events-backend-module-gerrit/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleGerritEventRouter: BackendFeatureFactory<[]>; +export const eventsModuleGerritEventRouter: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-github/alpha-api-report.md b/plugins/events-backend-module-github/alpha-api-report.md index 21bfdbb9d2..c233df8634 100644 --- a/plugins/events-backend-module-github/alpha-api-report.md +++ b/plugins/events-backend-module-github/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleGithubEventRouter: BackendFeatureFactory<[]>; +export const eventsModuleGithubEventRouter: () => BackendFeature; // @alpha -export const eventsModuleGithubWebhook: BackendFeatureFactory<[]>; +export const eventsModuleGithubWebhook: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gitlab/alpha-api-report.md b/plugins/events-backend-module-gitlab/alpha-api-report.md index bca947c195..bf61f66a4b 100644 --- a/plugins/events-backend-module-gitlab/alpha-api-report.md +++ b/plugins/events-backend-module-gitlab/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsModuleGitlabEventRouter: BackendFeatureFactory<[]>; +export const eventsModuleGitlabEventRouter: () => BackendFeature; // @alpha -export const eventsModuleGitlabWebhook: BackendFeatureFactory<[]>; +export const eventsModuleGitlabWebhook: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend/alpha-api-report.md b/plugins/events-backend/alpha-api-report.md index 72d4bce4b2..3e32f769c1 100644 --- a/plugins/events-backend/alpha-api-report.md +++ b/plugins/events-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const eventsPlugin: BackendFeatureFactory<[]>; +export const eventsPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/example-todo-list-backend/api-report.md b/plugins/example-todo-list-backend/api-report.md index 80b86c4e4d..319fbbf226 100644 --- a/plugins/example-todo-list-backend/api-report.md +++ b/plugins/example-todo-list-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { Logger } from 'winston'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const exampleTodoListPlugin: BackendFeatureFactory<[]>; +export const exampleTodoListPlugin: () => BackendFeature; // @public export interface RouterOptions { diff --git a/plugins/kafka-backend/api-report.md b/plugins/kafka-backend/api-report.md index 176c961cd4..a748a543d9 100644 --- a/plugins/kafka-backend/api-report.md +++ b/plugins/kafka-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const kafkaPlugin: BackendFeatureFactory<[]>; +export const kafkaPlugin: () => BackendFeature; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/kubernetes-backend/alpha-api-report.md b/plugins/kubernetes-backend/alpha-api-report.md index 77a300d344..f95c1414f3 100644 --- a/plugins/kubernetes-backend/alpha-api-report.md +++ b/plugins/kubernetes-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const kubernetesPlugin: BackendFeatureFactory<[]>; +export const kubernetesPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/lighthouse-backend/api-report.md b/plugins/lighthouse-backend/api-report.md index f504ce70c9..5d9d948cf4 100644 --- a/plugins/lighthouse-backend/api-report.md +++ b/plugins/lighthouse-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Logger } from 'winston'; @@ -30,7 +30,7 @@ export function createScheduler( ): Promise; // @public -export const lighthousePlugin: BackendFeatureFactory<[]>; +export const lighthousePlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/linguist-backend/api-report.md b/plugins/linguist-backend/api-report.md index 995b54da62..aac978e426 100644 --- a/plugins/linguist-backend/api-report.md +++ b/plugins/linguist-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorCache } from '@backstage/plugin-catalog-node'; import { Config } from '@backstage/config'; @@ -36,9 +36,7 @@ export interface LinguistBackendApi { } // @public -export const linguistPlugin: BackendFeatureFactory< - [options: LinguistPluginOptions] ->; +export const linguistPlugin: (options: LinguistPluginOptions) => BackendFeature; // @public export interface LinguistPluginOptions { diff --git a/plugins/periskop-backend/api-report.md b/plugins/periskop-backend/api-report.md index e548a70a75..7906bc4785 100644 --- a/plugins/periskop-backend/api-report.md +++ b/plugins/periskop-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -12,7 +12,7 @@ import { Logger } from 'winston'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const periskopPlugin: BackendFeatureFactory<[]>; +export const periskopPlugin: () => BackendFeature; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/permission-backend/alpha-api-report.md b/plugins/permission-backend/alpha-api-report.md index 5068992c71..926691930b 100644 --- a/plugins/permission-backend/alpha-api-report.md +++ b/plugins/permission-backend/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const permissionModuleAllowAllPolicy: BackendFeatureFactory<[]>; +export const permissionModuleAllowAllPolicy: () => BackendFeature; // @alpha -export const permissionPlugin: BackendFeatureFactory<[]>; +export const permissionPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/proxy-backend/api-report.md b/plugins/proxy-backend/api-report.md index 7960c9658c..9c5cf5f9ef 100644 --- a/plugins/proxy-backend/api-report.md +++ b/plugins/proxy-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -13,7 +13,7 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; export function createRouter(options: RouterOptions): Promise; // @alpha -export const proxyPlugin: BackendFeatureFactory<[]>; +export const proxyPlugin: () => BackendFeature; // @public (undocumented) export interface RouterOptions { diff --git a/plugins/scaffolder-backend/alpha-api-report.md b/plugins/scaffolder-backend/alpha-api-report.md index f4174697b2..363fcafd17 100644 --- a/plugins/scaffolder-backend/alpha-api-report.md +++ b/plugins/scaffolder-backend/alpha-api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { ConditionalPolicyDecision } from '@backstage/plugin-permission-common'; import { Conditions } from '@backstage/plugin-permission-node'; import { JsonObject } from '@backstage/types'; @@ -20,7 +20,7 @@ import { TemplateGlobal } from '@backstage/plugin-scaffolder-backend'; import { TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common'; // @alpha -export const catalogModuleTemplateKind: BackendFeatureFactory<[]>; +export const catalogModuleTemplateKind: () => BackendFeature; // @alpha (undocumented) export const createScaffolderActionConditionalDecision: ( @@ -90,9 +90,9 @@ export const scaffolderActionConditions: Conditions<{ }>; // @alpha -export const scaffolderPlugin: BackendFeatureFactory< - [options?: ScaffolderPluginOptions | undefined] ->; +export const scaffolderPlugin: ( + options?: ScaffolderPluginOptions | undefined, +) => BackendFeature; // @alpha export type ScaffolderPluginOptions = { diff --git a/plugins/search-backend-module-catalog/alpha-api-report.md b/plugins/search-backend-module-catalog/alpha-api-report.md index 02a2ea2266..7c6e91b6a1 100644 --- a/plugins/search-backend-module-catalog/alpha-api-report.md +++ b/plugins/search-backend-module-catalog/alpha-api-report.md @@ -3,14 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { DefaultCatalogCollatorFactoryOptions } from '@backstage/plugin-search-backend-module-catalog'; import { TaskScheduleDefinition } from '@backstage/backend-tasks'; // @alpha -export const searchModuleCatalogCollator: BackendFeatureFactory< - [options?: SearchModuleCatalogCollatorOptions | undefined] ->; +export const searchModuleCatalogCollator: ( + options?: SearchModuleCatalogCollatorOptions | undefined, +) => BackendFeature; // @alpha export type SearchModuleCatalogCollatorOptions = Omit< diff --git a/plugins/search-backend-module-elasticsearch/alpha-api-report.md b/plugins/search-backend-module-elasticsearch/alpha-api-report.md index 254771b484..91007c20de 100644 --- a/plugins/search-backend-module-elasticsearch/alpha-api-report.md +++ b/plugins/search-backend-module-elasticsearch/alpha-api-report.md @@ -3,14 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { ElasticSearchCustomIndexTemplate } from '@backstage/plugin-search-backend-module-elasticsearch'; import { ElasticSearchQueryTranslator } from '@backstage/plugin-search-backend-module-elasticsearch'; // @alpha -export const searchModuleElasticsearchEngine: BackendFeatureFactory< - [options?: SearchModuleElasticsearchEngineOptions | undefined] ->; +export const searchModuleElasticsearchEngine: ( + options?: SearchModuleElasticsearchEngineOptions | undefined, +) => BackendFeature; // @alpha export type SearchModuleElasticsearchEngineOptions = { diff --git a/plugins/search-backend-module-explore/alpha-api-report.md b/plugins/search-backend-module-explore/alpha-api-report.md index f8053601b3..7b0f2658d6 100644 --- a/plugins/search-backend-module-explore/alpha-api-report.md +++ b/plugins/search-backend-module-explore/alpha-api-report.md @@ -3,13 +3,13 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { TaskScheduleDefinition } from '@backstage/backend-tasks'; // @alpha -export const searchModuleExploreCollator: BackendFeatureFactory< - [options?: SearchModuleExploreCollatorOptions | undefined] ->; +export const searchModuleExploreCollator: ( + options?: SearchModuleExploreCollatorOptions | undefined, +) => BackendFeature; // @alpha export type SearchModuleExploreCollatorOptions = { diff --git a/plugins/search-backend-module-pg/alpha-api-report.md b/plugins/search-backend-module-pg/alpha-api-report.md index d41010a594..eaee78e944 100644 --- a/plugins/search-backend-module-pg/alpha-api-report.md +++ b/plugins/search-backend-module-pg/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const searchModulePostgresEngine: BackendFeatureFactory<[]>; +export const searchModulePostgresEngine: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-techdocs/alpha-api-report.md b/plugins/search-backend-module-techdocs/alpha-api-report.md index 4f7515dac5..0eac010b4c 100644 --- a/plugins/search-backend-module-techdocs/alpha-api-report.md +++ b/plugins/search-backend-module-techdocs/alpha-api-report.md @@ -3,14 +3,14 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { TaskScheduleDefinition } from '@backstage/backend-tasks'; import { TechDocsCollatorFactoryOptions } from '@backstage/plugin-search-backend-module-techdocs'; // @alpha -export const searchModuleTechDocsCollator: BackendFeatureFactory< - [options?: SearchModuleTechDocsCollatorOptions | undefined] ->; +export const searchModuleTechDocsCollator: ( + options?: SearchModuleTechDocsCollatorOptions | undefined, +) => BackendFeature; // @alpha export type SearchModuleTechDocsCollatorOptions = Omit< diff --git a/plugins/search-backend/alpha-api-report.md b/plugins/search-backend/alpha-api-report.md index 9d620efe0e..6ee94a0e29 100644 --- a/plugins/search-backend/alpha-api-report.md +++ b/plugins/search-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const searchPlugin: BackendFeatureFactory<[]>; +export const searchPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/techdocs-backend/alpha-api-report.md b/plugins/techdocs-backend/alpha-api-report.md index 6de1a7d209..16db84c216 100644 --- a/plugins/techdocs-backend/alpha-api-report.md +++ b/plugins/techdocs-backend/alpha-api-report.md @@ -3,10 +3,10 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha -export const techdocsPlugin: BackendFeatureFactory<[]>; +export const techdocsPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/todo-backend/api-report.md b/plugins/todo-backend/api-report.md index a3703eaaab..6db1e012e9 100644 --- a/plugins/todo-backend/api-report.md +++ b/plugins/todo-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { CompoundEntityRef } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; @@ -91,7 +91,7 @@ export type TodoParserResult = { }; // @public -export const todoPlugin: BackendFeatureFactory<[]>; +export const todoPlugin: () => BackendFeature; // @public (undocumented) export interface TodoReader { diff --git a/plugins/user-settings-backend/api-report.md b/plugins/user-settings-backend/api-report.md index 32722bbf2d..b015915723 100644 --- a/plugins/user-settings-backend/api-report.md +++ b/plugins/user-settings-backend/api-report.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { BackendFeatureFactory } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; import { PluginDatabaseManager } from '@backstage/backend-common'; @@ -20,7 +20,7 @@ export interface RouterOptions { } // @alpha -export const userSettingsPlugin: BackendFeatureFactory<[]>; +export const userSettingsPlugin: () => BackendFeature; // (No @packageDocumentation comment for this package) ``` From a58fc22210ac0df11e47edb269a681c372f08648 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 8 Aug 2023 13:47:36 +0200 Subject: [PATCH 14/15] avoid exporting BackendFeatureFactory Signed-off-by: Vincenzo Scamporlino --- .../src/alpha/featureDiscoveryServiceFactory.ts | 6 ++---- packages/backend-plugin-api/alpha-api-report.md | 10 ---------- packages/backend-plugin-api/api-report.md | 10 ---------- packages/backend-plugin-api/src/alpha.ts | 4 ++-- packages/backend-plugin-api/src/wiring/index.ts | 1 - packages/backend-plugin-api/src/wiring/types.ts | 2 +- 6 files changed, 5 insertions(+), 28 deletions(-) diff --git a/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts index 7062448eb1..f9ee7edc5f 100644 --- a/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts +++ b/packages/backend-app-api/src/alpha/featureDiscoveryServiceFactory.ts @@ -16,7 +16,6 @@ import { BackendFeature, - BackendFeatureFactory, RootConfigService, coreServices, createServiceFactory, @@ -121,11 +120,10 @@ function isBackendFeature(value: unknown): value is BackendFeature { function isBackendFeatureFactory( value: unknown, -): value is BackendFeatureFactory { +): value is () => BackendFeature { return ( !!value && typeof value === 'function' && - (value as BackendFeatureFactory).$$type === - '@backstage/BackendFeatureFactory' + (value as any).$$type === '@backstage/BackendFeatureFactory' ); } diff --git a/packages/backend-plugin-api/alpha-api-report.md b/packages/backend-plugin-api/alpha-api-report.md index 29f78ed9d1..d76d7e4deb 100644 --- a/packages/backend-plugin-api/alpha-api-report.md +++ b/packages/backend-plugin-api/alpha-api-report.md @@ -9,16 +9,6 @@ export interface BackendFeature { $$type: '@backstage/BackendFeature'; } -// @public (undocumented) -export interface BackendFeatureFactory< - TOptions extends [options?: object] = [], -> { - // (undocumented) - $$type: '@backstage/BackendFeatureFactory'; - // (undocumented) - (...options: TOptions): BackendFeature; -} - // @alpha (undocumented) export interface FeatureDiscoveryService { // (undocumented) diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index dc75c09b18..a1ae6284c6 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -21,16 +21,6 @@ export interface BackendFeature { $$type: '@backstage/BackendFeature'; } -// @public (undocumented) -export interface BackendFeatureFactory< - TOptions extends [options?: object] = [], -> { - // (undocumented) - $$type: '@backstage/BackendFeatureFactory'; - // (undocumented) - (...options: TOptions): BackendFeature; -} - // @public export interface BackendModuleConfig { moduleId: string; diff --git a/packages/backend-plugin-api/src/alpha.ts b/packages/backend-plugin-api/src/alpha.ts index e3598dff5a..bd6be5b75e 100644 --- a/packages/backend-plugin-api/src/alpha.ts +++ b/packages/backend-plugin-api/src/alpha.ts @@ -15,7 +15,7 @@ */ import { createServiceRef } from './services'; -import { BackendFeature, BackendFeatureFactory } from './wiring'; +import { BackendFeature } from './wiring'; /** @alpha */ export interface FeatureDiscoveryService { @@ -33,4 +33,4 @@ export const featureDiscoveryServiceRef = }); export type { ServiceRef } from './services'; -export type { BackendFeature, BackendFeatureFactory }; +export type { BackendFeature }; diff --git a/packages/backend-plugin-api/src/wiring/index.ts b/packages/backend-plugin-api/src/wiring/index.ts index 0b7104374a..9cb767b8ac 100644 --- a/packages/backend-plugin-api/src/wiring/index.ts +++ b/packages/backend-plugin-api/src/wiring/index.ts @@ -28,6 +28,5 @@ export type { BackendModuleRegistrationPoints, BackendPluginRegistrationPoints, BackendFeature, - BackendFeatureFactory, ExtensionPoint, } from './types'; diff --git a/packages/backend-plugin-api/src/wiring/types.ts b/packages/backend-plugin-api/src/wiring/types.ts index b9b4f3ff10..028c2b87da 100644 --- a/packages/backend-plugin-api/src/wiring/types.ts +++ b/packages/backend-plugin-api/src/wiring/types.ts @@ -67,7 +67,7 @@ export interface BackendModuleRegistrationPoints { }): void; } -/** @public */ +/** @internal */ export interface BackendFeatureFactory< TOptions extends [options?: object] = [], > { From dfb01beddae77daa15059720d3ca67b8a91d45d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 8 Aug 2023 15:00:45 +0200 Subject: [PATCH 15/15] import non-alpha imports from the main package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../backend-plugin-api/alpha-api-report.md | 19 ++----------------- packages/backend-plugin-api/src/alpha.ts | 9 ++++----- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/packages/backend-plugin-api/alpha-api-report.md b/packages/backend-plugin-api/alpha-api-report.md index d76d7e4deb..81b378a671 100644 --- a/packages/backend-plugin-api/alpha-api-report.md +++ b/packages/backend-plugin-api/alpha-api-report.md @@ -3,11 +3,8 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -// @public (undocumented) -export interface BackendFeature { - // (undocumented) - $$type: '@backstage/BackendFeature'; -} +import { BackendFeature } from '@backstage/backend-plugin-api'; +import { ServiceRef } from '@backstage/backend-plugin-api'; // @alpha (undocumented) export interface FeatureDiscoveryService { @@ -23,17 +20,5 @@ export const featureDiscoveryServiceRef: ServiceRef< 'root' >; -// @public -export type ServiceRef< - TService, - TScope extends 'root' | 'plugin' = 'root' | 'plugin', -> = { - id: string; - scope: TScope; - T: TService; - toString(): string; - $$type: '@backstage/ServiceRef'; -}; - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-plugin-api/src/alpha.ts b/packages/backend-plugin-api/src/alpha.ts index bd6be5b75e..baee739f49 100644 --- a/packages/backend-plugin-api/src/alpha.ts +++ b/packages/backend-plugin-api/src/alpha.ts @@ -14,8 +14,10 @@ * limitations under the License. */ -import { createServiceRef } from './services'; -import { BackendFeature } from './wiring'; +import { + BackendFeature, + createServiceRef, +} from '@backstage/backend-plugin-api'; /** @alpha */ export interface FeatureDiscoveryService { @@ -31,6 +33,3 @@ export const featureDiscoveryServiceRef = id: 'core.featureDiscovery', scope: 'root', }); - -export type { ServiceRef } from './services'; -export type { BackendFeature };