refactor: use default exports for gitlab and github event modules
Signed-off-by: djamaile <rdjamaile@gmail.com>
This commit is contained in:
@@ -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.
|
||||
@@ -14,5 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { eventsModuleGithubEventRouter } from './service/eventsModuleGithubEventRouter';
|
||||
export { eventsModuleGithubWebhook } from './service/eventsModuleGithubWebhook';
|
||||
import { createBackendFeatureLoader } from '@backstage/backend-plugin-api';
|
||||
|
||||
export default createBackendFeatureLoader({
|
||||
loader() {
|
||||
return [
|
||||
import('./service/eventsModuleGithubEventRouter'),
|
||||
import('./service/eventsModuleGithubWebhook'),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
+1
-1
@@ -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 () => {
|
||||
|
||||
@@ -25,7 +25,7 @@ import { GithubEventRouter } from '../router/GithubEventRouter';
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export const eventsModuleGithubEventRouter = createBackendModule({
|
||||
export default createBackendModule({
|
||||
pluginId: 'events',
|
||||
moduleId: 'github-event-router',
|
||||
register(env) {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -28,7 +28,7 @@ import { createGithubSignatureValidator } from '../http/createGithubSignatureVal
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export const eventsModuleGithubWebhook = createBackendModule({
|
||||
export default createBackendModule({
|
||||
pluginId: 'events',
|
||||
moduleId: 'github-webhook',
|
||||
register(env) {
|
||||
|
||||
@@ -14,5 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { eventsModuleGitlabEventRouter } from './service/eventsModuleGitlabEventRouter';
|
||||
export { eventsModuleGitlabWebhook } from './service/eventsModuleGitlabWebhook';
|
||||
import { createBackendFeatureLoader } from '@backstage/backend-plugin-api';
|
||||
|
||||
export default createBackendFeatureLoader({
|
||||
loader() {
|
||||
return [
|
||||
import('./service/eventsModuleGitlabEventRouter'),
|
||||
import('./service/eventsModuleGitlabWebhook'),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
+1
-1
@@ -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 () => {
|
||||
|
||||
@@ -25,7 +25,7 @@ import { GitlabEventRouter } from '../router/GitlabEventRouter';
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export const eventsModuleGitlabEventRouter = createBackendModule({
|
||||
export default createBackendModule({
|
||||
pluginId: 'events',
|
||||
moduleId: 'gitlab-event-router',
|
||||
register(env) {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -30,7 +30,7 @@ import { createGitlabTokenValidator } from '../http/createGitlabTokenValidator';
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export const eventsModuleGitlabWebhook = createBackendModule({
|
||||
export default createBackendModule({
|
||||
pluginId: 'events',
|
||||
moduleId: 'gitlab-webhook',
|
||||
register(env) {
|
||||
|
||||
Reference in New Issue
Block a user