From 00cf54df4c11721edbd8c96ced380ccf2870e97f Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 18 Sep 2023 11:25:00 -0500 Subject: [PATCH 1/9] migrate graphql-backend plugin to the new backend system Signed-off-by: zcason --- packages/backend-next/package.json | 1 + packages/backend-next/src/index.ts | 1 + plugins/graphql-backend/api-report.md | 5 ++++ plugins/graphql-backend/src/index.ts | 1 + plugins/graphql-backend/src/plugin.ts | 42 +++++++++++++++++++++++++++ yarn.lock | 2 ++ 6 files changed, 52 insertions(+) create mode 100644 plugins/graphql-backend/src/plugin.ts diff --git a/packages/backend-next/package.json b/packages/backend-next/package.json index edda247a5a..6952fdcc7a 100644 --- a/packages/backend-next/package.json +++ b/packages/backend-next/package.json @@ -38,6 +38,7 @@ "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^", "@backstage/plugin-devtools-backend": "workspace:^", "@backstage/plugin-entity-feedback-backend": "workspace:^", + "@backstage/plugin-graphql-backend": "workspace:^", "@backstage/plugin-kubernetes-backend": "workspace:^", "@backstage/plugin-lighthouse-backend": "workspace:^", "@backstage/plugin-linguist-backend": "workspace:^", diff --git a/packages/backend-next/src/index.ts b/packages/backend-next/src/index.ts index 4e99732a11..b6ffa11a21 100644 --- a/packages/backend-next/src/index.ts +++ b/packages/backend-next/src/index.ts @@ -29,6 +29,7 @@ backend.add( backend.add(import('@backstage/plugin-catalog-backend/alpha')); backend.add(import('@backstage/plugin-devtools-backend')); backend.add(import('@backstage/plugin-entity-feedback-backend')); +backend.add(import('@backstage/plugin-graphql-backend')); backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); backend.add(import('@backstage/plugin-lighthouse-backend')); backend.add(import('@backstage/plugin-linguist-backend')); diff --git a/plugins/graphql-backend/api-report.md b/plugins/graphql-backend/api-report.md index a787c4f209..31cdf4c617 100644 --- a/plugins/graphql-backend/api-report.md +++ b/plugins/graphql-backend/api-report.md @@ -3,6 +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 { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -10,6 +11,10 @@ import { Logger } from 'winston'; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; +// @public +const graphqlPlugin: () => BackendFeature; +export default graphqlPlugin; + // @public (undocumented) export interface RouterOptions { // (undocumented) diff --git a/plugins/graphql-backend/src/index.ts b/plugins/graphql-backend/src/index.ts index a9f7f92ad9..5c21db501f 100644 --- a/plugins/graphql-backend/src/index.ts +++ b/plugins/graphql-backend/src/index.ts @@ -21,3 +21,4 @@ */ export * from './service/router'; +export { graphqlPlugin as default } from './plugin'; diff --git a/plugins/graphql-backend/src/plugin.ts b/plugins/graphql-backend/src/plugin.ts new file mode 100644 index 0000000000..6401f87803 --- /dev/null +++ b/plugins/graphql-backend/src/plugin.ts @@ -0,0 +1,42 @@ +/* + * 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 { + coreServices, + createBackendPlugin, +} from '@backstage/backend-plugin-api'; +import { createRouter } from './service/router'; +import { loggerToWinstonLogger } from '@backstage/backend-common'; + +export const graphqlPlugin = createBackendPlugin({ + pluginId: 'graphql', + register(env) { + env.registerInit({ + deps: { + config: coreServices.rootConfig, + http: coreServices.httpRouter, + logger: coreServices.logger, + }, + async init({ config, http, logger }) { + http.use( + await createRouter({ + config, + logger: loggerToWinstonLogger(logger), + }), + ); + }, + }); + }, +}); diff --git a/yarn.lock b/yarn.lock index 84ad190c8a..53f1c4052a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7280,6 +7280,7 @@ __metadata: dependencies: "@apollo/server": ^4.0.0 "@backstage/backend-common": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" "@backstage/plugin-catalog-graphql": "workspace:^" @@ -25960,6 +25961,7 @@ __metadata: "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^" "@backstage/plugin-devtools-backend": "workspace:^" "@backstage/plugin-entity-feedback-backend": "workspace:^" + "@backstage/plugin-graphql-backend": "workspace:^" "@backstage/plugin-kubernetes-backend": "workspace:^" "@backstage/plugin-lighthouse-backend": "workspace:^" "@backstage/plugin-linguist-backend": "workspace:^" From ee7d8a737b6314ee765d342c09638794f686de35 Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 18 Sep 2023 11:26:23 -0500 Subject: [PATCH 2/9] migrate graphql-backend plugin to the new backend system Signed-off-by: zcason --- plugins/graphql-backend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/graphql-backend/package.json b/plugins/graphql-backend/package.json index 7582c150cb..2ed420983e 100644 --- a/plugins/graphql-backend/package.json +++ b/plugins/graphql-backend/package.json @@ -35,6 +35,7 @@ "dependencies": { "@apollo/server": "^4.0.0", "@backstage/backend-common": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", "@backstage/config": "workspace:^", "@backstage/plugin-catalog-graphql": "workspace:^", "@graphql-tools/schema": "^9.0.0", From 4a2d633aae18fcdb73c0aca1aff226aead535d93 Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 18 Sep 2023 15:26:57 -0500 Subject: [PATCH 3/9] migrate playlist-backend plugin to the new backend system Signed-off-by: zcason --- packages/backend-next/package.json | 1 + packages/backend-next/src/index.ts | 1 + plugins/playlist-backend/api-report.md | 4 +++ plugins/playlist-backend/package.json | 1 + plugins/playlist-backend/src/index.ts | 1 + plugins/playlist-backend/src/plugin.ts | 48 ++++++++++++++++++++++++++ yarn.lock | 2 ++ 7 files changed, 58 insertions(+) create mode 100644 plugins/playlist-backend/src/plugin.ts diff --git a/packages/backend-next/package.json b/packages/backend-next/package.json index 6952fdcc7a..e7b52f7ad0 100644 --- a/packages/backend-next/package.json +++ b/packages/backend-next/package.json @@ -46,6 +46,7 @@ "@backstage/plugin-permission-backend-module-allow-all-policy": "workspace:^", "@backstage/plugin-permission-common": "workspace:^", "@backstage/plugin-permission-node": "workspace:^", + "@backstage/plugin-playlist-backend": "workspace:^", "@backstage/plugin-proxy-backend": "workspace:^", "@backstage/plugin-scaffolder-backend": "workspace:^", "@backstage/plugin-search-backend": "workspace:^", diff --git a/packages/backend-next/src/index.ts b/packages/backend-next/src/index.ts index b6ffa11a21..68e33f4be3 100644 --- a/packages/backend-next/src/index.ts +++ b/packages/backend-next/src/index.ts @@ -33,6 +33,7 @@ backend.add(import('@backstage/plugin-graphql-backend')); backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); backend.add(import('@backstage/plugin-lighthouse-backend')); backend.add(import('@backstage/plugin-linguist-backend')); +backend.add(import('@backstage/plugin-playlist-backend')); backend.add( import('@backstage/plugin-permission-backend-module-allow-all-policy'), ); diff --git a/plugins/playlist-backend/api-report.md b/plugins/playlist-backend/api-report.md index 6b51f316c4..cc7d478481 100644 --- a/plugins/playlist-backend/api-report.md +++ b/plugins/playlist-backend/api-report.md @@ -3,6 +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 { BackstageIdentityResponse } from '@backstage/plugin-auth-node'; import { ConditionalPolicyDecision } from '@backstage/plugin-permission-common'; import { Conditions } from '@backstage/plugin-permission-node'; @@ -34,6 +35,9 @@ export const createPlaylistConditionalDecision: ( // @public (undocumented) export function createRouter(options: RouterOptions): Promise; +// @public +export const playlistPlugin: () => BackendFeature; + // @public export class DefaultPlaylistPermissionPolicy implements PermissionPolicy { // (undocumented) diff --git a/plugins/playlist-backend/package.json b/plugins/playlist-backend/package.json index 53a3bff88a..7189a14b86 100644 --- a/plugins/playlist-backend/package.json +++ b/plugins/playlist-backend/package.json @@ -29,6 +29,7 @@ }, "dependencies": { "@backstage/backend-common": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", "@backstage/catalog-client": "workspace:^", "@backstage/catalog-model": "workspace:^", "@backstage/config": "workspace:^", diff --git a/plugins/playlist-backend/src/index.ts b/plugins/playlist-backend/src/index.ts index eeccd8913f..9081552e00 100644 --- a/plugins/playlist-backend/src/index.ts +++ b/plugins/playlist-backend/src/index.ts @@ -26,3 +26,4 @@ export { isPlaylistPermission, playlistConditions, } from './permissions'; +export { playlistPlugin as default } from './plugin'; diff --git a/plugins/playlist-backend/src/plugin.ts b/plugins/playlist-backend/src/plugin.ts new file mode 100644 index 0000000000..12fe94b01a --- /dev/null +++ b/plugins/playlist-backend/src/plugin.ts @@ -0,0 +1,48 @@ +/* + * 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 { + coreServices, + createBackendPlugin, +} from '@backstage/backend-plugin-api'; +import { createRouter } from './service'; +import { loggerToWinstonLogger } from '@backstage/backend-common'; + +export const playlistPlugin = createBackendPlugin({ + pluginId: 'playlist', + register(env) { + env.registerInit({ + deps: { + http: coreServices.httpRouter, + logger: coreServices.logger, + database: coreServices.database, + identity: coreServices.identity, + discovery: coreServices.discovery, + permissions: coreServices.permissions, + }, + async init({ http, logger, database, identity, discovery, permissions }) { + http.use( + await createRouter({ + logger: loggerToWinstonLogger(logger), + database, + identity, + discovery, + permissions, + }), + ); + }, + }); + }, +}); diff --git a/yarn.lock b/yarn.lock index 53f1c4052a..d600d02811 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8362,6 +8362,7 @@ __metadata: resolution: "@backstage/plugin-playlist-backend@workspace:plugins/playlist-backend" dependencies: "@backstage/backend-common": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" "@backstage/catalog-client": "workspace:^" "@backstage/catalog-model": "workspace:^" @@ -25969,6 +25970,7 @@ __metadata: "@backstage/plugin-permission-backend-module-allow-all-policy": "workspace:^" "@backstage/plugin-permission-common": "workspace:^" "@backstage/plugin-permission-node": "workspace:^" + "@backstage/plugin-playlist-backend": "workspace:^" "@backstage/plugin-proxy-backend": "workspace:^" "@backstage/plugin-scaffolder-backend": "workspace:^" "@backstage/plugin-search-backend": "workspace:^" From 1bb94045a63f1eae2a06665e635763fc79e36ed8 Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 18 Sep 2023 15:33:03 -0500 Subject: [PATCH 4/9] added support to graphql and playlist for new backend Signed-off-by: zcason --- .changeset/eighty-wasps-remain.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/eighty-wasps-remain.md diff --git a/.changeset/eighty-wasps-remain.md b/.changeset/eighty-wasps-remain.md new file mode 100644 index 0000000000..e6ecfde660 --- /dev/null +++ b/.changeset/eighty-wasps-remain.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-playlist-backend': patch +'@backstage/plugin-graphql-backend': patch +--- + +Added support to graphql and playlist for new backend From 0b5845f6c1e7ae078a1e4de81fb6bb721a5e84c7 Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 18 Sep 2023 15:53:56 -0500 Subject: [PATCH 5/9] updated read me for newly supported plugins Signed-off-by: zcason --- plugins/graphql-backend/README.md | 15 +++++++++++++++ plugins/playlist-backend/README.md | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/plugins/graphql-backend/README.md b/plugins/graphql-backend/README.md index 970222fb1f..11453ec8bc 100644 --- a/plugins/graphql-backend/README.md +++ b/plugins/graphql-backend/README.md @@ -26,3 +26,18 @@ yarn workspace example-backend start ``` This will launch the full example backend. + +### New Backend System + +The Grahpql backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up: +In your `packages/backend/src/index.ts` make the following changes: + +```diff ++ import { graphqlPlugin } from '@backstage/plugin-graphql-backend'; + +const backend = createBackend(); ++ backend.add(graphqlPlugin()); +// ... other feature additions + +backend.start(); +``` diff --git a/plugins/playlist-backend/README.md b/plugins/playlist-backend/README.md index c0055ebdf7..e336ec5b08 100644 --- a/plugins/playlist-backend/README.md +++ b/plugins/playlist-backend/README.md @@ -85,3 +85,21 @@ export default async function createPlugin(env: PluginEnvironment): Promise Date: Wed, 20 Sep 2023 15:16:00 -0500 Subject: [PATCH 6/9] new changeset for each plugin Signed-off-by: zcason --- .changeset/dull-dolls-explode.md | 5 +++++ .changeset/eighty-wasps-remain.md | 6 ------ .changeset/short-planets-suffer.md | 5 +++++ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .changeset/dull-dolls-explode.md delete mode 100644 .changeset/eighty-wasps-remain.md create mode 100644 .changeset/short-planets-suffer.md diff --git a/.changeset/dull-dolls-explode.md b/.changeset/dull-dolls-explode.md new file mode 100644 index 0000000000..10088e0818 --- /dev/null +++ b/.changeset/dull-dolls-explode.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-playlist-backend': patch +--- + +Added support to the playlist plugin for the new backend diff --git a/.changeset/eighty-wasps-remain.md b/.changeset/eighty-wasps-remain.md deleted file mode 100644 index e6ecfde660..0000000000 --- a/.changeset/eighty-wasps-remain.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-playlist-backend': patch -'@backstage/plugin-graphql-backend': patch ---- - -Added support to graphql and playlist for new backend diff --git a/.changeset/short-planets-suffer.md b/.changeset/short-planets-suffer.md new file mode 100644 index 0000000000..9626a05e54 --- /dev/null +++ b/.changeset/short-planets-suffer.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-graphql-backend': patch +--- + +Added support to the graphql plugin for the new backend From 38fddab7d54e570ac15b3bcaedf07e38341e6868 Mon Sep 17 00:00:00 2001 From: zcason Date: Wed, 20 Sep 2023 15:17:32 -0500 Subject: [PATCH 7/9] readme update Signed-off-by: zcason --- plugins/graphql-backend/README.md | 7 ++++--- plugins/playlist-backend/README.md | 11 +++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/graphql-backend/README.md b/plugins/graphql-backend/README.md index 11453ec8bc..d1bd53b38d 100644 --- a/plugins/graphql-backend/README.md +++ b/plugins/graphql-backend/README.md @@ -29,14 +29,15 @@ This will launch the full example backend. ### New Backend System -The Grahpql backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up: +The grahpql backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up: In your `packages/backend/src/index.ts` make the following changes: ```diff -+ import { graphqlPlugin } from '@backstage/plugin-graphql-backend'; +import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); -+ backend.add(graphqlPlugin()); + +backend.add(import('@backstage/plugin-graphql-backend')); // ... other feature additions backend.start(); diff --git a/plugins/playlist-backend/README.md b/plugins/playlist-backend/README.md index e336ec5b08..b5c9b8797b 100644 --- a/plugins/playlist-backend/README.md +++ b/plugins/playlist-backend/README.md @@ -93,13 +93,12 @@ The Playlist backend plugin has support for the [new backend system](https://bac In your `packages/backend/src/index.ts` make the following changes: ```diff - import { createBackend } from '@backstage/backend-defaults'; -+ import { playlistPlugin } from '@backstage/plugin-playlist-backend'; - const backend = createBackend(); +import { createBackend } from '@backstage/backend-defaults'; - // ... other feature additions +const backend = createBackend(); -+ backend.add(playlistPlugin()); +backend.add(import('@backstage/plugin-playlist-backend')); +// ... other feature additions - backend.start(); +backend.start(); ``` From 08f12abf006242b0c1cad484304f34efc5a3762d Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 25 Sep 2023 11:45:51 -0500 Subject: [PATCH 8/9] remove all graphql plugin migration work Signed-off-by: zcason --- .changeset/short-planets-suffer.md | 5 ---- packages/backend-next/package.json | 1 - packages/backend-next/src/index.ts | 1 - plugins/graphql-backend/README.md | 16 ---------- plugins/graphql-backend/api-report.md | 5 ---- plugins/graphql-backend/package.json | 1 - plugins/graphql-backend/src/index.ts | 1 - plugins/graphql-backend/src/plugin.ts | 42 --------------------------- yarn.lock | 2 -- 9 files changed, 74 deletions(-) delete mode 100644 .changeset/short-planets-suffer.md delete mode 100644 plugins/graphql-backend/src/plugin.ts diff --git a/.changeset/short-planets-suffer.md b/.changeset/short-planets-suffer.md deleted file mode 100644 index 9626a05e54..0000000000 --- a/.changeset/short-planets-suffer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-graphql-backend': patch ---- - -Added support to the graphql plugin for the new backend diff --git a/packages/backend-next/package.json b/packages/backend-next/package.json index e7b52f7ad0..a6431aab06 100644 --- a/packages/backend-next/package.json +++ b/packages/backend-next/package.json @@ -38,7 +38,6 @@ "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^", "@backstage/plugin-devtools-backend": "workspace:^", "@backstage/plugin-entity-feedback-backend": "workspace:^", - "@backstage/plugin-graphql-backend": "workspace:^", "@backstage/plugin-kubernetes-backend": "workspace:^", "@backstage/plugin-lighthouse-backend": "workspace:^", "@backstage/plugin-linguist-backend": "workspace:^", diff --git a/packages/backend-next/src/index.ts b/packages/backend-next/src/index.ts index 68e33f4be3..04ddd838c8 100644 --- a/packages/backend-next/src/index.ts +++ b/packages/backend-next/src/index.ts @@ -29,7 +29,6 @@ backend.add( backend.add(import('@backstage/plugin-catalog-backend/alpha')); backend.add(import('@backstage/plugin-devtools-backend')); backend.add(import('@backstage/plugin-entity-feedback-backend')); -backend.add(import('@backstage/plugin-graphql-backend')); backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); backend.add(import('@backstage/plugin-lighthouse-backend')); backend.add(import('@backstage/plugin-linguist-backend')); diff --git a/plugins/graphql-backend/README.md b/plugins/graphql-backend/README.md index d1bd53b38d..970222fb1f 100644 --- a/plugins/graphql-backend/README.md +++ b/plugins/graphql-backend/README.md @@ -26,19 +26,3 @@ yarn workspace example-backend start ``` This will launch the full example backend. - -### New Backend System - -The grahpql backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up: -In your `packages/backend/src/index.ts` make the following changes: - -```diff -import { createBackend } from '@backstage/backend-defaults'; - -const backend = createBackend(); - -backend.add(import('@backstage/plugin-graphql-backend')); -// ... other feature additions - -backend.start(); -``` diff --git a/plugins/graphql-backend/api-report.md b/plugins/graphql-backend/api-report.md index 31cdf4c617..a787c4f209 100644 --- a/plugins/graphql-backend/api-report.md +++ b/plugins/graphql-backend/api-report.md @@ -3,7 +3,6 @@ > 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 { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -11,10 +10,6 @@ import { Logger } from 'winston'; // @public (undocumented) export function createRouter(options: RouterOptions): Promise; -// @public -const graphqlPlugin: () => BackendFeature; -export default graphqlPlugin; - // @public (undocumented) export interface RouterOptions { // (undocumented) diff --git a/plugins/graphql-backend/package.json b/plugins/graphql-backend/package.json index 2ed420983e..7582c150cb 100644 --- a/plugins/graphql-backend/package.json +++ b/plugins/graphql-backend/package.json @@ -35,7 +35,6 @@ "dependencies": { "@apollo/server": "^4.0.0", "@backstage/backend-common": "workspace:^", - "@backstage/backend-plugin-api": "workspace:^", "@backstage/config": "workspace:^", "@backstage/plugin-catalog-graphql": "workspace:^", "@graphql-tools/schema": "^9.0.0", diff --git a/plugins/graphql-backend/src/index.ts b/plugins/graphql-backend/src/index.ts index 5c21db501f..a9f7f92ad9 100644 --- a/plugins/graphql-backend/src/index.ts +++ b/plugins/graphql-backend/src/index.ts @@ -21,4 +21,3 @@ */ export * from './service/router'; -export { graphqlPlugin as default } from './plugin'; diff --git a/plugins/graphql-backend/src/plugin.ts b/plugins/graphql-backend/src/plugin.ts deleted file mode 100644 index 6401f87803..0000000000 --- a/plugins/graphql-backend/src/plugin.ts +++ /dev/null @@ -1,42 +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. - */ -import { - coreServices, - createBackendPlugin, -} from '@backstage/backend-plugin-api'; -import { createRouter } from './service/router'; -import { loggerToWinstonLogger } from '@backstage/backend-common'; - -export const graphqlPlugin = createBackendPlugin({ - pluginId: 'graphql', - register(env) { - env.registerInit({ - deps: { - config: coreServices.rootConfig, - http: coreServices.httpRouter, - logger: coreServices.logger, - }, - async init({ config, http, logger }) { - http.use( - await createRouter({ - config, - logger: loggerToWinstonLogger(logger), - }), - ); - }, - }); - }, -}); diff --git a/yarn.lock b/yarn.lock index 04215cd079..3f7ffd754b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7280,7 +7280,6 @@ __metadata: dependencies: "@apollo/server": ^4.0.0 "@backstage/backend-common": "workspace:^" - "@backstage/backend-plugin-api": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" "@backstage/plugin-catalog-graphql": "workspace:^" @@ -25962,7 +25961,6 @@ __metadata: "@backstage/plugin-catalog-backend-module-unprocessed": "workspace:^" "@backstage/plugin-devtools-backend": "workspace:^" "@backstage/plugin-entity-feedback-backend": "workspace:^" - "@backstage/plugin-graphql-backend": "workspace:^" "@backstage/plugin-kubernetes-backend": "workspace:^" "@backstage/plugin-lighthouse-backend": "workspace:^" "@backstage/plugin-linguist-backend": "workspace:^" From 0db06a69a1826d17534c3d67f09ed24765db502a Mon Sep 17 00:00:00 2001 From: zcason Date: Mon, 25 Sep 2023 12:17:28 -0500 Subject: [PATCH 9/9] updated api report Signed-off-by: zcason --- plugins/playlist-backend/api-report.md | 7 ++++--- plugins/playlist-backend/src/plugin.ts | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/playlist-backend/api-report.md b/plugins/playlist-backend/api-report.md index 905b7bc5b1..40b05c25d4 100644 --- a/plugins/playlist-backend/api-report.md +++ b/plugins/playlist-backend/api-report.md @@ -32,9 +32,6 @@ export const createPlaylistConditionalDecision: ( // @public (undocumented) export function createRouter(options: RouterOptions): Promise; -// @public -export const playlistPlugin: () => BackendFeature; - // @public export class DefaultPlaylistPermissionPolicy implements PermissionPolicy { // (undocumented) @@ -84,6 +81,10 @@ export const playlistConditions: Conditions<{ >; }>; +// @public +const playlistPlugin: () => BackendFeature; +export default playlistPlugin; + // @public (undocumented) export interface RouterOptions { // (undocumented) diff --git a/plugins/playlist-backend/src/plugin.ts b/plugins/playlist-backend/src/plugin.ts index 12fe94b01a..b4d926c05e 100644 --- a/plugins/playlist-backend/src/plugin.ts +++ b/plugins/playlist-backend/src/plugin.ts @@ -20,6 +20,11 @@ import { import { createRouter } from './service'; import { loggerToWinstonLogger } from '@backstage/backend-common'; +/** + * Playlist backend plugin + * + * @public + */ export const playlistPlugin = createBackendPlugin({ pluginId: 'playlist', register(env) {