@backstage/plugin-scaffolder-backend-module-yeoman 0.1.0 → 0.1.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 ADDED
@@ -0,0 +1,34 @@
1
+ # @backstage/plugin-scaffolder-backend-module-yeoman
2
+
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/config@0.1.13
9
+ - @backstage/plugin-scaffolder-backend@0.15.21
10
+
11
+ ## 0.1.3-next.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - @backstage/config@0.1.13-next.0
17
+ - @backstage/plugin-scaffolder-backend@0.15.21-next.0
18
+
19
+ ## 0.1.2
20
+
21
+ ### Patch Changes
22
+
23
+ - 290fbb3ec2: Add missing API docs to scaffolder action plugins
24
+ - Updated dependencies
25
+ - @backstage/plugin-scaffolder-backend@0.15.12
26
+
27
+ ## 0.1.1
28
+
29
+ ### Patch Changes
30
+
31
+ - 10615525f3: Switch to use the json and observable types from `@backstage/types`
32
+ - Updated dependencies
33
+ - @backstage/config@0.1.11
34
+ - @backstage/plugin-scaffolder-backend@0.15.11
package/dist/index.cjs.js CHANGED
@@ -7,7 +7,7 @@ var pluginScaffolderBackend = require('@backstage/plugin-scaffolder-backend');
7
7
  async function yeomanRun(workspace, namespace, args, opts) {
8
8
  const yeoman = require("yeoman-environment");
9
9
  const generator = yeoman.lookupGenerator(namespace);
10
- const env = yeoman.createEnv(void 0, {cwd: workspace});
10
+ const env = yeoman.createEnv(void 0, { cwd: workspace });
11
11
  env.register(generator, namespace);
12
12
  const yeomanArgs = [namespace, ...args != null ? args : []];
13
13
  await env.run(yeomanArgs, opts);
@@ -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/config';\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/config';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { yeomanRun } from './yeomanRun';\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":";;;;;;yBAwBE,WACA,WACA,MACA,MACA;AACA,QAAM,SAAS,QAAQ;AACvB,QAAM,YAAY,OAAO,gBAAgB;AACzC,QAAM,MAAM,OAAO,UAAU,QAAW,CAAE,KAAK;AAC/C,MAAI,SAAS,WAAW;AACxB,QAAM,aAAa,CAAC,WAAW,GAAI,sBAAQ;AAC3C,QAAM,IAAI,IAAI,YAAY;AAAA;;iCCdY;AACtC,SAAOA,6CAIJ;AAAA,IACD,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,QAAQ;AAAA,MACN,OAAO;AAAA,QACL,MAAM;AAAA,QACN,UAAU,CAAC;AAAA,QACX,YAAY;AAAA,UACV,WAAW;AAAA,YACT,OAAO;AAAA,YACP,aAAa;AAAA,YACb,MAAM;AAAA;AAAA,UAER,MAAM;AAAA,YACJ,OAAO;AAAA,YACP,aAAa;AAAA,YACb,MAAM;AAAA,YACN,OAAO;AAAA,cACL,MAAM;AAAA;AAAA;AAAA,UAGV,SAAS;AAAA,YACP,OAAO;AAAA,YACP,aAAa;AAAA,YACb,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,UAKR,QAAQ,KAAK;AACjB,UAAI,OAAO,KACT,sCAAsC,IAAI,MAAM;AAElD,YAAM,UACJ,IAAI,eACJ,IAAI,MAAM,WACV,IAAI,MAAM,MACV,IAAI,MAAM;AAAA;AAAA;AAAA;;;;"}
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":";;;;;;yBAwBE,WACA,WACA,MACA,MACA;AACA,QAAM,SAAS,QAAQ;AACvB,QAAM,YAAY,OAAO,gBAAgB;AACzC,QAAM,MAAM,OAAO,UAAU,QAAW,EAAE,KAAK;AAC/C,MAAI,SAAS,WAAW;AACxB,QAAM,aAAa,CAAC,WAAW,GAAI,sBAAQ;AAC3C,QAAM,IAAI,IAAI,YAAY;AAAA;;iCCLY;AACtC,SAAOA,6CAIJ;AAAA,IACD,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,QAAQ;AAAA,MACN,OAAO;AAAA,QACL,MAAM;AAAA,QACN,UAAU,CAAC;AAAA,QACX,YAAY;AAAA,UACV,WAAW;AAAA,YACT,OAAO;AAAA,YACP,aAAa;AAAA,YACb,MAAM;AAAA;AAAA,UAER,MAAM;AAAA,YACJ,OAAO;AAAA,YACP,aAAa;AAAA,YACb,MAAM;AAAA,YACN,OAAO;AAAA,cACL,MAAM;AAAA;AAAA;AAAA,UAGV,SAAS;AAAA,YACP,OAAO;AAAA,YACP,aAAa;AAAA,YACb,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,UAKR,QAAQ,KAAK;AACjB,UAAI,OAAO,KACT,sCAAsC,IAAI,MAAM;AAElD,YAAM,UACJ,IAAI,eACJ,IAAI,MAAM,WACV,IAAI,MAAM,MACV,IAAI,MAAM;AAAA;AAAA;AAAA;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import * as _backstage_plugin_scaffolder_backend from '@backstage/plugin-scaffolder-backend';
2
2
 
3
+ /**
4
+ * Creates a `run:yeoman` Scaffolder action.
5
+ *
6
+ * @remarks
7
+ *
8
+ * See {@link https://yeoman.io/} and {@link https://backstage.io/docs/features/software-templates/writing-custom-actions}.
9
+ *
10
+ * @public
11
+ */
3
12
  declare function createRunYeomanAction(): _backstage_plugin_scaffolder_backend.TemplateAction<any>;
4
13
 
5
14
  export { createRunYeomanAction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-yeoman",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "main": "dist/index.cjs.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -20,17 +20,18 @@
20
20
  "clean": "backstage-cli clean"
21
21
  },
22
22
  "dependencies": {
23
- "@backstage/config": "^0.1.8",
24
- "@backstage/plugin-scaffolder-backend": "^0.15.2",
23
+ "@backstage/config": "^0.1.13",
24
+ "@backstage/plugin-scaffolder-backend": "^0.15.21",
25
+ "@backstage/types": "^0.1.1",
25
26
  "winston": "^3.2.1",
26
27
  "yeoman-environment": "^3.6.0"
27
28
  },
28
29
  "devDependencies": {
29
- "@backstage/backend-common": "^0.9.2",
30
+ "@backstage/backend-common": "^0.10.4",
30
31
  "@types/jest": "^26.0.7"
31
32
  },
32
33
  "files": [
33
34
  "dist"
34
35
  ],
35
- "gitHead": "1d7a75538080a6532431a7110f500745cbb24fa4"
36
+ "gitHead": "600d6e3c854bbfb12a0078ca6f726d1c0d1fea0b"
36
37
  }