diff --git a/.changeset/odd-ducks-spend.md b/.changeset/odd-ducks-spend.md new file mode 100644 index 0000000000..426f417186 --- /dev/null +++ b/.changeset/odd-ducks-spend.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-events-backend-module-github': minor +'@backstage/plugin-events-backend-module-gitlab': minor +--- + +**BREAKING ALPHA**: Modules from `events-backend-module-github` and `events-backend-module-gitlab` are now exported as `default` instead of being a named export. In addition, they have been moved from `aplha` to `public`. diff --git a/plugins/events-backend-module-github/package.json b/plugins/events-backend-module-github/package.json index 9191069142..e5df18b33b 100644 --- a/plugins/events-backend-module-github/package.json +++ b/plugins/events-backend-module-github/package.json @@ -18,16 +18,12 @@ "license": "Apache-2.0", "exports": { ".": "./src/index.ts", - "./alpha": "./src/alpha.ts", "./package.json": "./package.json" }, "main": "src/index.ts", "types": "src/index.ts", "typesVersions": { "*": { - "alpha": [ - "src/alpha.ts" - ], "package.json": [ "package.json" ] diff --git a/plugins/events-backend-module-github/report-alpha.api.md b/plugins/events-backend-module-github/report-alpha.api.md deleted file mode 100644 index 63e51f1dae..0000000000 --- a/plugins/events-backend-module-github/report-alpha.api.md +++ /dev/null @@ -1,15 +0,0 @@ -## API Report File for "@backstage/plugin-events-backend-module-github" - -> 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'; - -// @alpha -export const eventsModuleGithubEventRouter: BackendFeature; - -// @alpha -export const eventsModuleGithubWebhook: BackendFeature; - -// (No @packageDocumentation comment for this package) -``` diff --git a/plugins/events-backend-module-github/report.api.md b/plugins/events-backend-module-github/report.api.md index 5341f86039..a1e468793e 100644 --- a/plugins/events-backend-module-github/report.api.md +++ b/plugins/events-backend-module-github/report.api.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 { EventParams } from '@backstage/plugin-events-node'; import { EventsService } from '@backstage/plugin-events-node'; @@ -14,6 +15,10 @@ export function createGithubSignatureValidator( config: Config, ): RequestValidator; +// @public (undocumented) +const _default: BackendFeature; +export default _default; + // @public export class GithubEventRouter extends SubTopicEventRouter { constructor(options: { events: EventsService }); @@ -22,4 +27,6 @@ export class GithubEventRouter extends SubTopicEventRouter { // (undocumented) protected getSubscriberId(): string; } + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-github/src/alpha.ts b/plugins/events-backend-module-github/src/alpha.ts deleted file mode 100644 index 2db8e9d9aa..0000000000 --- a/plugins/events-backend-module-github/src/alpha.ts +++ /dev/null @@ -1,18 +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 { eventsModuleGithubEventRouter } from './service/eventsModuleGithubEventRouter'; -export { eventsModuleGithubWebhook } from './service/eventsModuleGithubWebhook'; diff --git a/plugins/events-backend-module-github/src/index.ts b/plugins/events-backend-module-github/src/index.ts index d02ea1deaf..72b55f892b 100644 --- a/plugins/events-backend-module-github/src/index.ts +++ b/plugins/events-backend-module-github/src/index.ts @@ -20,6 +20,16 @@ * * @packageDocumentation */ +import { createBackendFeatureLoader } from '@backstage/backend-plugin-api'; + +export default createBackendFeatureLoader({ + loader() { + return [ + import('./service/eventsModuleGithubEventRouter'), + import('./service/eventsModuleGithubWebhook'), + ]; + }, +}); export { createGithubSignatureValidator } from './http/createGithubSignatureValidator'; export { GithubEventRouter } from './router/GithubEventRouter'; diff --git a/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.test.ts b/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.test.ts index d69a128c4c..a22caacea2 100644 --- a/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.test.ts +++ b/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.test.ts @@ -18,7 +18,7 @@ import { createServiceFactory } from '@backstage/backend-plugin-api'; import { startTestBackend } from '@backstage/backend-test-utils'; import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; import { eventsServiceRef } from '@backstage/plugin-events-node'; -import { eventsModuleGithubEventRouter } from './eventsModuleGithubEventRouter'; +import eventsModuleGithubEventRouter from './eventsModuleGithubEventRouter'; describe('eventsModuleGithubEventRouter', () => { it('should be correctly wired and set up', async () => { diff --git a/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.ts b/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.ts index 694b4b162d..f2bb07e837 100644 --- a/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.ts +++ b/plugins/events-backend-module-github/src/service/eventsModuleGithubEventRouter.ts @@ -23,9 +23,9 @@ import { GithubEventRouter } from '../router/GithubEventRouter'; * * Registers the `GithubEventRouter`. * - * @alpha + * @public */ -export const eventsModuleGithubEventRouter = createBackendModule({ +export default createBackendModule({ pluginId: 'events', moduleId: 'github-event-router', register(env) { diff --git a/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.test.ts b/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.test.ts index ec5ec66946..3e7f281326 100644 --- a/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.test.ts +++ b/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.test.ts @@ -21,7 +21,7 @@ import { RequestDetails, } from '@backstage/plugin-events-node'; import { sign } from '@octokit/webhooks-methods'; -import { eventsModuleGithubWebhook } from './eventsModuleGithubWebhook'; +import eventsModuleGithubWebhook from './eventsModuleGithubWebhook'; describe('eventsModuleGithubWebhook', () => { const secret = 'valid-secret'; diff --git a/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.ts b/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.ts index 647b21c364..5cd10d8cc6 100644 --- a/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.ts +++ b/plugins/events-backend-module-github/src/service/eventsModuleGithubWebhook.ts @@ -28,7 +28,7 @@ import { createGithubSignatureValidator } from '../http/createGithubSignatureVal * * @alpha */ -export const eventsModuleGithubWebhook = createBackendModule({ +export default createBackendModule({ pluginId: 'events', moduleId: 'github-webhook', register(env) { diff --git a/plugins/events-backend-module-gitlab/package.json b/plugins/events-backend-module-gitlab/package.json index e3ce32da16..13773f8198 100644 --- a/plugins/events-backend-module-gitlab/package.json +++ b/plugins/events-backend-module-gitlab/package.json @@ -18,16 +18,12 @@ "license": "Apache-2.0", "exports": { ".": "./src/index.ts", - "./alpha": "./src/alpha.ts", "./package.json": "./package.json" }, "main": "src/index.ts", "types": "src/index.ts", "typesVersions": { "*": { - "alpha": [ - "src/alpha.ts" - ], "package.json": [ "package.json" ] diff --git a/plugins/events-backend-module-gitlab/report-alpha.api.md b/plugins/events-backend-module-gitlab/report-alpha.api.md deleted file mode 100644 index 1406b3ef64..0000000000 --- a/plugins/events-backend-module-gitlab/report-alpha.api.md +++ /dev/null @@ -1,15 +0,0 @@ -## API Report File for "@backstage/plugin-events-backend-module-gitlab" - -> 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'; - -// @alpha -export const eventsModuleGitlabEventRouter: BackendFeature; - -// @alpha -export const eventsModuleGitlabWebhook: BackendFeature; - -// (No @packageDocumentation comment for this package) -``` diff --git a/plugins/events-backend-module-gitlab/report.api.md b/plugins/events-backend-module-gitlab/report.api.md index f348436375..359e78b565 100644 --- a/plugins/events-backend-module-gitlab/report.api.md +++ b/plugins/events-backend-module-gitlab/report.api.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 { EventParams } from '@backstage/plugin-events-node'; import { EventsService } from '@backstage/plugin-events-node'; @@ -12,6 +13,10 @@ import { SubTopicEventRouter } from '@backstage/plugin-events-node'; // @public export function createGitlabTokenValidator(config: Config): RequestValidator; +// @public (undocumented) +const _default: BackendFeature; +export default _default; + // @public export class GitlabEventRouter extends SubTopicEventRouter { constructor(options: { events: EventsService }); @@ -20,4 +25,6 @@ export class GitlabEventRouter extends SubTopicEventRouter { // (undocumented) protected getSubscriberId(): string; } + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gitlab/src/alpha.ts b/plugins/events-backend-module-gitlab/src/alpha.ts deleted file mode 100644 index 65610af96c..0000000000 --- a/plugins/events-backend-module-gitlab/src/alpha.ts +++ /dev/null @@ -1,18 +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 { eventsModuleGitlabEventRouter } from './service/eventsModuleGitlabEventRouter'; -export { eventsModuleGitlabWebhook } from './service/eventsModuleGitlabWebhook'; diff --git a/plugins/events-backend-module-gitlab/src/index.ts b/plugins/events-backend-module-gitlab/src/index.ts index 3788e02955..67cc34ee40 100644 --- a/plugins/events-backend-module-gitlab/src/index.ts +++ b/plugins/events-backend-module-gitlab/src/index.ts @@ -21,5 +21,16 @@ * @packageDocumentation */ +import { createBackendFeatureLoader } from '@backstage/backend-plugin-api'; + +export default createBackendFeatureLoader({ + loader() { + return [ + import('./service/eventsModuleGitlabEventRouter'), + import('./service/eventsModuleGitlabWebhook'), + ]; + }, +}); + export { createGitlabTokenValidator } from './http/createGitlabTokenValidator'; export { GitlabEventRouter } from './router/GitlabEventRouter'; diff --git a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.test.ts b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.test.ts index 48ed7ef4d3..39f161e916 100644 --- a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.test.ts +++ b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.test.ts @@ -18,7 +18,7 @@ import { createServiceFactory } from '@backstage/backend-plugin-api'; import { startTestBackend } from '@backstage/backend-test-utils'; import { TestEventsService } from '@backstage/plugin-events-backend-test-utils'; import { eventsServiceRef } from '@backstage/plugin-events-node'; -import { eventsModuleGitlabEventRouter } from './eventsModuleGitlabEventRouter'; +import eventsModuleGitlabEventRouter from './eventsModuleGitlabEventRouter'; describe('eventsModuleGitlabEventRouter', () => { it('should be correctly wired and set up', async () => { diff --git a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.ts b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.ts index 66245efb58..4dd4d1531b 100644 --- a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.ts +++ b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabEventRouter.ts @@ -23,9 +23,9 @@ import { GitlabEventRouter } from '../router/GitlabEventRouter'; * * Registers the `GitlabEventRouter`. * - * @alpha + * @public */ -export const eventsModuleGitlabEventRouter = createBackendModule({ +export default createBackendModule({ pluginId: 'events', moduleId: 'gitlab-event-router', register(env) { diff --git a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.test.ts b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.test.ts index d3452dd813..7671b6740c 100644 --- a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.test.ts +++ b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.test.ts @@ -20,7 +20,7 @@ import { HttpPostIngressOptions, RequestDetails, } from '@backstage/plugin-events-node'; -import { eventsModuleGitlabWebhook } from './eventsModuleGitlabWebhook'; +import eventsModuleGitlabWebhook from './eventsModuleGitlabWebhook'; describe('gitlabWebhookEventsModule', () => { const requestWithToken = (token?: string) => { diff --git a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.ts b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.ts index 77bca7236b..f0896e1a99 100644 --- a/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.ts +++ b/plugins/events-backend-module-gitlab/src/service/eventsModuleGitlabWebhook.ts @@ -28,9 +28,9 @@ import { createGitlabTokenValidator } from '../http/createGitlabTokenValidator'; * * Registers the `GitlabEventRouter`. * - * @alpha + * @public */ -export const eventsModuleGitlabWebhook = createBackendModule({ +export default createBackendModule({ pluginId: 'events', moduleId: 'gitlab-webhook', register(env) {