@backstage/plugin-scaffolder-backend-module-yeoman 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +21 -20
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-yeoman
|
|
2
2
|
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 89c7e47967: Minor README update
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-scaffolder-backend@1.0.0
|
|
10
|
+
- @backstage/config@1.0.0
|
|
11
|
+
- @backstage/types@1.0.0
|
|
12
|
+
|
|
13
|
+
## 0.2.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 8122e27717: Updating documentation for supporting `apiVersion: scaffolder.backstage.io/v1beta3`
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/plugin-scaffolder-backend@0.18.0
|
|
20
|
+
|
|
21
|
+
## 0.2.2-next.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 8122e27717: Updating documentation for supporting `apiVersion: scaffolder.backstage.io/v1beta3`
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @backstage/plugin-scaffolder-backend@0.18.0-next.0
|
|
28
|
+
|
|
3
29
|
## 0.2.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -23,28 +23,28 @@ const actions = [
|
|
|
23
23
|
createRunYeomanAction(),
|
|
24
24
|
...createBuiltInActions({
|
|
25
25
|
containerRunner,
|
|
26
|
-
integrations,
|
|
27
|
-
config,
|
|
28
26
|
catalogClient,
|
|
29
|
-
|
|
27
|
+
integrations,
|
|
28
|
+
config: env.config,
|
|
29
|
+
reader: env.reader,
|
|
30
30
|
}),
|
|
31
31
|
];
|
|
32
32
|
|
|
33
33
|
return await createRouter({
|
|
34
34
|
containerRunner,
|
|
35
|
-
logger,
|
|
36
|
-
config,
|
|
37
|
-
database,
|
|
38
35
|
catalogClient,
|
|
39
|
-
reader,
|
|
40
36
|
actions,
|
|
37
|
+
logger: env.logger,
|
|
38
|
+
config: env.config,
|
|
39
|
+
database: env.database,
|
|
40
|
+
reader: env.reader,
|
|
41
41
|
});
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
After that you can use the action in your template:
|
|
45
45
|
|
|
46
46
|
```yaml
|
|
47
|
-
apiVersion: backstage.io/
|
|
47
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
48
48
|
kind: Template
|
|
49
49
|
metadata:
|
|
50
50
|
name: yeoman-demo
|
|
@@ -107,29 +107,30 @@ spec:
|
|
|
107
107
|
name: Yeoman
|
|
108
108
|
action: run:yeoman
|
|
109
109
|
input:
|
|
110
|
-
namespace:
|
|
110
|
+
namespace: org:codeowners
|
|
111
111
|
options:
|
|
112
|
-
codeowners: '
|
|
112
|
+
codeowners: '@${{ parameters.owner }}'
|
|
113
113
|
|
|
114
114
|
- id: publish
|
|
115
|
-
if:
|
|
115
|
+
if: ${{ parameters.dryRun !== true }}
|
|
116
116
|
name: Publish
|
|
117
117
|
action: publish:github
|
|
118
118
|
input:
|
|
119
|
-
allowedHosts:
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
allowedHosts:
|
|
120
|
+
- github.com
|
|
121
|
+
description: This is ${{ parameters.name }}
|
|
122
|
+
repoUrl: ${{ parameters.repoUrl }}
|
|
122
123
|
|
|
123
124
|
- id: register
|
|
124
|
-
if:
|
|
125
|
+
if: ${{ parameters.dryRun !== true }}
|
|
125
126
|
name: Register
|
|
126
127
|
action: catalog:register
|
|
127
128
|
input:
|
|
128
|
-
repoContentsUrl:
|
|
129
|
+
repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
|
|
129
130
|
catalogInfoPath: '/catalog-info.yaml'
|
|
130
131
|
|
|
131
132
|
- name: Results
|
|
132
|
-
if:
|
|
133
|
+
if: ${{ parameters.dryRun }}
|
|
133
134
|
action: debug:log
|
|
134
135
|
input:
|
|
135
136
|
listWorkspace: true
|
|
@@ -137,10 +138,10 @@ spec:
|
|
|
137
138
|
output:
|
|
138
139
|
links:
|
|
139
140
|
- title: Repository
|
|
140
|
-
url:
|
|
141
|
+
url: ${{ steps.publish.output.remoteUrl }}
|
|
141
142
|
- title: Open in catalog
|
|
142
|
-
icon:
|
|
143
|
-
entityRef:
|
|
143
|
+
icon: catalog
|
|
144
|
+
entityRef: ${{ steps.register.output.entityRef }}
|
|
144
145
|
```
|
|
145
146
|
|
|
146
147
|
You can also visit the `/create/actions` route in your Backstage application to find out more about the parameters this action accepts when it's installed to configure how you like.
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/actions/run/yeomanRun.ts","../src/actions/run/yeoman.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\n\n/*\n * This module should use '@types/yeoman-environment' eventually as soon as '@types/yeoman-environment' supports\n * the latest version of Yeoman -> 3.x. Then it will be possible to test this module with jest.\n */\n\nexport async function yeomanRun(\n workspace: string,\n namespace: string,\n args?: string[],\n opts?: JsonObject,\n) {\n const yeoman = require('yeoman-environment');\n const generator = yeoman.lookupGenerator(namespace);\n const env = yeoman.createEnv(undefined, { cwd: workspace });\n env.register(generator, namespace);\n const yeomanArgs = [namespace, ...(args ?? [])];\n await env.run(yeomanArgs, opts);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { yeomanRun } from './yeomanRun';\n\n/**\n * Creates a `run:yeoman` Scaffolder action.\n *\n * @remarks\n *\n * See {@link https://yeoman.io/} and {@link https://backstage.io/docs/features/software-templates/writing-custom-actions}.\n *\n * @public\n */\nexport function createRunYeomanAction() {\n return createTemplateAction<{\n namespace: string;\n args?: string[];\n options?: JsonObject;\n }>({\n id: 'run:yeoman',\n description: 'Runs Yeoman on an installed Yeoman generator',\n schema: {\n input: {\n type: 'object',\n required: ['namespace'],\n properties: {\n namespace: {\n title: 'Generator Namespace',\n description: 'Yeoman generator namespace, e.g: node:app',\n type: 'string',\n },\n args: {\n title: 'Generator Arguments',\n description: 'Arguments to pass on to Yeoman for templating',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n options: {\n title: 'Generator Options',\n description: 'Options to pass on to Yeoman for templating',\n type: 'object',\n },\n },\n },\n },\n async handler(ctx) {\n ctx.logger.info(\n `Templating using Yeoman generator: ${ctx.input.namespace}`,\n );\n await yeomanRun(\n ctx.workspacePath,\n ctx.input.namespace,\n ctx.input.args,\n ctx.input.options,\n );\n },\n });\n}\n"],"names":["createTemplateAction"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/actions/run/yeomanRun.ts","../src/actions/run/yeoman.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\n\n/*\n * This module should use '@types/yeoman-environment' eventually as soon as '@types/yeoman-environment' supports\n * the latest version of Yeoman -> 3.x. Then it will be possible to test this module with jest.\n */\n\nexport async function yeomanRun(\n workspace: string,\n namespace: string,\n args?: string[],\n opts?: JsonObject,\n) {\n const yeoman = require('yeoman-environment');\n const generator = yeoman.lookupGenerator(namespace);\n const env = yeoman.createEnv(undefined, { cwd: workspace });\n env.register(generator, namespace);\n const yeomanArgs = [namespace, ...(args ?? [])];\n await env.run(yeomanArgs, opts);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { yeomanRun } from './yeomanRun';\n\n/**\n * Creates a `run:yeoman` Scaffolder action.\n *\n * @remarks\n *\n * See {@link https://yeoman.io/} and {@link https://backstage.io/docs/features/software-templates/writing-custom-actions}.\n *\n * @public\n */\nexport function createRunYeomanAction() {\n return createTemplateAction<{\n namespace: string;\n args?: string[];\n options?: JsonObject;\n }>({\n id: 'run:yeoman',\n description: 'Runs Yeoman on an installed Yeoman generator',\n schema: {\n input: {\n type: 'object',\n required: ['namespace'],\n properties: {\n namespace: {\n title: 'Generator Namespace',\n description: 'Yeoman generator namespace, e.g: node:app',\n type: 'string',\n },\n args: {\n title: 'Generator Arguments',\n description: 'Arguments to pass on to Yeoman for templating',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n options: {\n title: 'Generator Options',\n description: 'Options to pass on to Yeoman for templating',\n type: 'object',\n },\n },\n },\n },\n async handler(ctx) {\n ctx.logger.info(\n `Templating using Yeoman generator: ${ctx.input.namespace}`,\n );\n await yeomanRun(\n ctx.workspacePath,\n ctx.input.namespace,\n ctx.input.args,\n ctx.input.options,\n );\n },\n });\n}\n"],"names":["createTemplateAction"],"mappings":";;;;;;AAwBE,eAAA,SAAA,CAAA,SAAA,EACA,SACA,EAAA,IAAA,EACA,IACA,EAAA;AACA,EAAA,MAAM,SAAS,OAAQ,CAAA,oBAAA,CAAA,CAAA;AACvB,EAAM,MAAA,SAAA,GAAY,OAAO,eAAgB,CAAA,SAAA,CAAA,CAAA;AACzC,EAAA,MAAM,GAAM,GAAA,MAAA,CAAO,SAAU,CAAA,KAAA,CAAA,EAAW,EAAE,GAAK,EAAA,SAAA,EAAA,CAAA,CAAA;AAC/C,EAAA,GAAA,CAAI,SAAS,SAAW,EAAA,SAAA,CAAA,CAAA;AACxB,EAAA,MAAM,UAAa,GAAA,CAAC,SAAW,EAAA,GAAI,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,EAAA,CAAA,CAAA;AAC3C,EAAM,MAAA,GAAA,CAAI,IAAI,UAAY,EAAA,IAAA,CAAA,CAAA;AAAA;;ACLY,SAAA,qBAAA,GAAA;AACtC,EAAA,OAAOA,4CAIJ,CAAA;AAAA,IACD,EAAI,EAAA,YAAA;AAAA,IACJ,WAAa,EAAA,8CAAA;AAAA,IACb,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,UAAU,CAAC,WAAA,CAAA;AAAA,QACX,UAAY,EAAA;AAAA,UACV,SAAW,EAAA;AAAA,YACT,KAAO,EAAA,qBAAA;AAAA,YACP,WAAa,EAAA,2CAAA;AAAA,YACb,IAAM,EAAA,QAAA;AAAA,WAAA;AAAA,UAER,IAAM,EAAA;AAAA,YACJ,KAAO,EAAA,qBAAA;AAAA,YACP,WAAa,EAAA,+CAAA;AAAA,YACb,IAAM,EAAA,OAAA;AAAA,YACN,KAAO,EAAA;AAAA,cACL,IAAM,EAAA,QAAA;AAAA,aAAA;AAAA,WAAA;AAAA,UAGV,OAAS,EAAA;AAAA,YACP,KAAO,EAAA,mBAAA;AAAA,YACP,WAAa,EAAA,6CAAA;AAAA,YACb,IAAM,EAAA,QAAA;AAAA,WAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KAAA;AAAA,IAAA,MAKR,QAAQ,GAAK,EAAA;AACjB,MAAA,GAAA,CAAI,MAAO,CAAA,IAAA,CACT,CAAsC,mCAAA,EAAA,GAAA,CAAI,KAAM,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AAElD,MAAM,MAAA,SAAA,CACJ,GAAI,CAAA,aAAA,EACJ,GAAI,CAAA,KAAA,CAAM,WACV,GAAI,CAAA,KAAA,CAAM,IACV,EAAA,GAAA,CAAI,KAAM,CAAA,OAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,CAAA,CAAA;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-yeoman",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"clean": "backstage-cli package clean"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@backstage/config": "^0.
|
|
27
|
-
"@backstage/plugin-scaffolder-backend": "^0.
|
|
28
|
-
"@backstage/types": "^0.
|
|
26
|
+
"@backstage/config": "^1.0.0",
|
|
27
|
+
"@backstage/plugin-scaffolder-backend": "^1.0.0",
|
|
28
|
+
"@backstage/types": "^1.0.0",
|
|
29
29
|
"winston": "^3.2.1",
|
|
30
30
|
"yeoman-environment": "^3.9.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@backstage/backend-common": "^0.
|
|
33
|
+
"@backstage/backend-common": "^0.13.1",
|
|
34
34
|
"@types/jest": "^26.0.7"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "e9496f746b31600dbfac7fa76987479e66426257"
|
|
40
40
|
}
|