diff --git a/plugins/scaffolder-backend-module-azure/src/alpha.ts b/plugins/scaffolder-backend-module-azure/src/alpha.ts index 34b3ff29c6..b565b2ccf4 100644 --- a/plugins/scaffolder-backend-module-azure/src/alpha.ts +++ b/plugins/scaffolder-backend-module-azure/src/alpha.ts @@ -13,6 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { azureModule } from './module'; - -export default azureModule; +export { azureModule as default } from './module'; diff --git a/plugins/scaffolder-backend-module-bitbucket/api-report-alpha.md b/plugins/scaffolder-backend-module-bitbucket/api-report-alpha.md new file mode 100644 index 0000000000..d660622d96 --- /dev/null +++ b/plugins/scaffolder-backend-module-bitbucket/api-report-alpha.md @@ -0,0 +1,13 @@ +## API Report File for "@backstage/plugin-scaffolder-backend-module-bitbucket" + +> 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 +const bitbucketModule: () => BackendFeature; +export default bitbucketModule; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/scaffolder-backend-module-bitbucket/package.json b/plugins/scaffolder-backend-module-bitbucket/package.json index 03ebab43fc..ab4dbc77e8 100644 --- a/plugins/scaffolder-backend-module-bitbucket/package.json +++ b/plugins/scaffolder-backend-module-bitbucket/package.json @@ -13,6 +13,21 @@ "backstage": { "role": "backend-plugin-module" }, + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.ts", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "alpha": [ + "src/alpha.ts" + ], + "package.json": [ + "package.json" + ] + } + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", @@ -24,6 +39,7 @@ }, "dependencies": { "@backstage/backend-common": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", "@backstage/config": "workspace:^", "@backstage/errors": "workspace:^", "@backstage/integration": "workspace:^", diff --git a/plugins/scaffolder-backend-module-bitbucket/src/alpha.ts b/plugins/scaffolder-backend-module-bitbucket/src/alpha.ts new file mode 100644 index 0000000000..278efe2b48 --- /dev/null +++ b/plugins/scaffolder-backend-module-bitbucket/src/alpha.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2024 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 { bitbucketModule as default } from './module'; diff --git a/plugins/scaffolder-backend-module-bitbucket/src/module.ts b/plugins/scaffolder-backend-module-bitbucket/src/module.ts new file mode 100644 index 0000000000..3bac71690f --- /dev/null +++ b/plugins/scaffolder-backend-module-bitbucket/src/module.ts @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha'; +import { + createBitbucketPipelinesRunAction, + createPublishBitbucketCloudAction, + createPublishBitbucketServerAction, + createPublishBitbucketServerPullRequestAction, +} from './actions'; +import { ScmIntegrations } from '@backstage/integration'; + +/** + * @alpha + * The Bitbucket Module for the Scaffolder Backend + */ +export const bitbucketModule = createBackendModule({ + moduleId: 'bitbucket', + pluginId: 'scaffolder', + register({ registerInit }) { + registerInit({ + deps: { + scaffolder: scaffolderActionsExtensionPoint, + config: coreServices.rootConfig, + }, + async init({ scaffolder, config }) { + const integrations = ScmIntegrations.fromConfig(config); + + scaffolder.addActions( + createPublishBitbucketCloudAction({ integrations, config }), + createPublishBitbucketServerAction({ integrations, config }), + createPublishBitbucketServerPullRequestAction({ + integrations, + config, + }), + createBitbucketPipelinesRunAction({ integrations }), + ); + }, + }); + }, +});