devtools-backend: deprecate createRouter

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2024-08-19 15:45:24 +02:00
parent 41b02f5c3c
commit 2886ef7eb4
3 changed files with 19 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-devtools-backend': patch
---
Deprecated `createRouter` and its router options in favour of the new backend system.
+4 -3
View File
@@ -13,8 +13,9 @@ import { ExternalDependency } from '@backstage/plugin-devtools-common';
import { HttpAuthService } from '@backstage/backend-plugin-api';
import { LoggerService } from '@backstage/backend-plugin-api';
import { PermissionsService } from '@backstage/backend-plugin-api';
import { RootConfigService } from '@backstage/backend-plugin-api';
// @public (undocumented)
// @public @deprecated (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public (undocumented)
@@ -32,10 +33,10 @@ export class DevToolsBackendApi {
const devtoolsPlugin: BackendFeatureCompat;
export default devtoolsPlugin;
// @public (undocumented)
// @public @deprecated (undocumented)
export interface RouterOptions {
// (undocumented)
config: Config;
config: RootConfigService;
// (undocumented)
devToolsBackendApi?: DevToolsBackendApi;
// (undocumented)
+10 -4
View File
@@ -21,7 +21,6 @@ import {
devToolsPermissions,
} from '@backstage/plugin-devtools-common';
import { Config } from '@backstage/config';
import { DevToolsBackendApi } from '../api';
import { NotAllowedError } from '@backstage/errors';
import Router from 'express-promise-router';
@@ -36,19 +35,26 @@ import {
HttpAuthService,
LoggerService,
PermissionsService,
RootConfigService,
} from '@backstage/backend-plugin-api';
/** @public */
/**
* @public
* @deprecated Please migrate to the new backend system as this will be removed in the future.
*/
export interface RouterOptions {
devToolsBackendApi?: DevToolsBackendApi;
logger: LoggerService;
config: Config;
config: RootConfigService;
permissions: PermissionsService;
discovery: DiscoveryService;
httpAuth?: HttpAuthService;
}
/** @public */
/**
* @deprecated Please migrate to the new backend system as this will be removed in the future.
* @public
* */
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {