feat: cookiecutter to module

Signed-off-by: blam <ben@blam.sh>

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-01-18 16:31:56 +01:00
parent 8f483eabce
commit 6833b035e7
8 changed files with 186 additions and 0 deletions
@@ -0,0 +1,13 @@
## API Report File for "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown"
> 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 confluenceToMarkdownModule: () => BackendFeature;
export default confluenceToMarkdownModule;
// (No @packageDocumentation comment for this package)
```
@@ -19,6 +19,21 @@
"url": "https://github.com/backstage/backstage",
"directory": "plugins/scaffolder-backend-module-confluence-to-markdown"
},
"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",
@@ -31,6 +46,7 @@
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/integration": "workspace:^",
@@ -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 { confluenceToMarkdownModule as default } from './module';
@@ -0,0 +1,50 @@
/*
* 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 {
createBackendModule,
coreServices,
} from '@backstage/backend-plugin-api';
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
import { createConfluenceToMarkdownAction } from './actions';
import { ScmIntegrations } from '@backstage/integration';
/**
* @alpha
* The Confluence to Markdown Module for the Scaffolder Backend
*/
export const confluenceToMarkdownModule = createBackendModule({
pluginId: 'scaffolder',
moduleId: 'confluence-to-markdown',
register({ registerInit }) {
registerInit({
deps: {
scaffolder: scaffolderActionsExtensionPoint,
config: coreServices.rootConfig,
reader: coreServices.urlReader,
},
async init({ scaffolder, config, reader }) {
const integrations = ScmIntegrations.fromConfig(config);
scaffolder.addActions(
createConfluenceToMarkdownAction({
config,
integrations,
reader,
}),
);
},
});
},
});
@@ -0,0 +1,13 @@
## API Report File for "@backstage/plugin-scaffolder-backend-module-cookiecutter"
> 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 cookiecutterModule: () => BackendFeature;
export default cookiecutterModule;
// (No @packageDocumentation comment for this package)
```
@@ -19,6 +19,21 @@
"url": "https://github.com/backstage/backstage",
"directory": "plugins/scaffolder-backend-module-cookiecutter"
},
"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",
@@ -30,6 +45,7 @@
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/integration": "workspace:^",
@@ -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 { cookiecutterModule as default } from './module';
@@ -0,0 +1,46 @@
/*
* 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 { createFetchCookiecutterAction } from './actions';
import { ScmIntegrations } from '@backstage/integration';
/**
* @alpha
* The Cookiecutter Module for the Scaffolder Backend
*/
export const cookiecutterModule = createBackendModule({
pluginId: 'scaffolder',
moduleId: 'cookiecutter',
register({ registerInit }) {
registerInit({
deps: {
scaffolder: scaffolderActionsExtensionPoint,
config: coreServices.rootConfig,
reader: coreServices.urlReader,
},
async init({ scaffolder, config, reader }) {
const integrations = ScmIntegrations.fromConfig(config);
scaffolder.addActions(
createFetchCookiecutterAction({ reader, integrations }),
);
},
});
},
});