Deprecated `createRouter` and its router options in favour of the new backend system. (#2048)

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin 2024-12-06 11:15:53 -08:00 committed by GitHub
parent a2e396485e
commit 9265e67583
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 29 additions and 9 deletions

View File

@ -5,8 +5,6 @@
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
// Warning: (ae-missing-release-tag) "feedbackPlugin" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
const feedbackPlugin: BackendFeature;
export default feedbackPlugin;

View File

@ -11,17 +11,26 @@ import { LoggerService } from '@backstage/backend-plugin-api';
import { NotificationService } from '@backstage/plugin-notifications-node';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
// Warning: (ae-forgotten-export) The symbol "RouterOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "createRouter" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public @deprecated (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
// Warning: (ae-missing-release-tag) "feedbackPlugin" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
const feedbackPlugin: BackendFeature;
export default feedbackPlugin;
// @public @deprecated (undocumented)
export interface RouterOptions {
// (undocumented)
auth: AuthService;
// (undocumented)
config: Config;
// (undocumented)
discovery: PluginEndpointDiscovery;
// (undocumented)
logger: LoggerService;
// (undocumented)
notifications?: NotificationService;
}
// (No @packageDocumentation comment for this package)
```

View File

@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { createRouter } from './service/router';
export { createRouter, type RouterOptions } from './service/router';
export { feedbackPlugin as default } from './plugin';

View File

@ -20,6 +20,9 @@ import {
import { notificationService } from '@backstage/plugin-notifications-node';
import { createRouter } from './service/router';
/**
* @public
*/
export const feedbackPlugin = createBackendPlugin({
pluginId: 'feedback',
register(env) {

View File

@ -33,6 +33,11 @@ import { NodeMailer } from './emails';
import { NotificationService } from '@backstage/plugin-notifications-node';
/**
* @deprecated Please migrate to the new backend system as this will be removed in the future.
*
* @public
*/
export interface RouterOptions {
logger: LoggerService;
config: Config;
@ -41,6 +46,11 @@ export interface RouterOptions {
notifications?: NotificationService;
}
/**
* @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> {