@backstage/plugin-scaffolder-backend-module-yeoman 0.2.13 → 0.2.15-next.0

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-yeoman
2
2
 
3
+ ## 0.2.15-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d72866f0cc: Internal refactor to use the new `@backstage/plugin-scaffolder-node` package for some functionality
8
+ - Updated dependencies
9
+ - @backstage/plugin-scaffolder-node@0.1.0-next.0
10
+
3
11
  ## 0.2.13
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var pluginScaffolderBackend = require('@backstage/plugin-scaffolder-backend');
5
+ var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
6
6
 
7
7
  async function yeomanRun(workspace, namespace, args, opts) {
8
8
  const yeoman = require("yeoman-environment");
@@ -14,7 +14,7 @@ async function yeomanRun(workspace, namespace, args, opts) {
14
14
  }
15
15
 
16
16
  function createRunYeomanAction() {
17
- return pluginScaffolderBackend.createTemplateAction({
17
+ return pluginScaffolderNode.createTemplateAction({
18
18
  id: "run:yeoman",
19
19
  description: "Runs Yeoman on an installed Yeoman generator",
20
20
  schema: {
@@ -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":";;;;;;AAuBA,eAAsB,SACpB,CAAA,SAAA,EACA,SACA,EAAA,IAAA,EACA,IACA,EAAA;AACA,EAAM,MAAA,MAAA,GAAS,QAAQ,oBAAoB,CAAA,CAAA;AAC3C,EAAM,MAAA,SAAA,GAAY,MAAO,CAAA,eAAA,CAAgB,SAAS,CAAA,CAAA;AAClD,EAAA,MAAM,MAAM,MAAO,CAAA,SAAA,CAAU,QAAW,EAAE,GAAA,EAAK,WAAW,CAAA,CAAA;AAC1D,EAAI,GAAA,CAAA,QAAA,CAAS,WAAW,SAAS,CAAA,CAAA;AACjC,EAAA,MAAM,aAAa,CAAC,SAAA,EAAW,GAAI,IAAA,IAAA,IAAA,GAAA,IAAA,GAAQ,EAAG,CAAA,CAAA;AAC9C,EAAM,MAAA,GAAA,CAAI,GAAI,CAAA,UAAA,EAAY,IAAI,CAAA,CAAA;AAChC;;ACNO,SAAS,qBAAwB,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,QAAA,EAAU,CAAC,WAAW,CAAA;AAAA,QACtB,UAAY,EAAA;AAAA,UACV,SAAW,EAAA;AAAA,YACT,KAAO,EAAA,qBAAA;AAAA,YACP,WAAa,EAAA,2CAAA;AAAA,YACb,IAAM,EAAA,QAAA;AAAA,WACR;AAAA,UACA,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,aACR;AAAA,WACF;AAAA,UACA,OAAS,EAAA;AAAA,YACP,KAAO,EAAA,mBAAA;AAAA,YACP,WAAa,EAAA,6CAAA;AAAA,YACb,IAAM,EAAA,QAAA;AAAA,WACR;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA,MAAM,QAAQ,GAAK,EAAA;AACjB,MAAA,GAAA,CAAI,MAAO,CAAA,IAAA;AAAA,QACT,CAAA,mCAAA,EAAsC,IAAI,KAAM,CAAA,SAAA,CAAA,CAAA;AAAA,OAClD,CAAA;AACA,MAAM,MAAA,SAAA;AAAA,QACJ,GAAI,CAAA,aAAA;AAAA,QACJ,IAAI,KAAM,CAAA,SAAA;AAAA,QACV,IAAI,KAAM,CAAA,IAAA;AAAA,QACV,IAAI,KAAM,CAAA,OAAA;AAAA,OACZ,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
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-node';\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":";;;;;;AAuBA,eAAsB,SACpB,CAAA,SAAA,EACA,SACA,EAAA,IAAA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,GAAK,EAAA;AACjB,MAAA,GAAA,CAAI,MAAO,CAAA,IAAA;AAAA,QACT,CAAA,mCAAA,EAAsC,IAAI,KAAM,CAAA,SAAA,CAAA,CAAA;AAAA,OAClD,CAAA;AACA,MAAM,MAAA,SAAA;AAAA,QACJ,GAAI,CAAA,aAAA;AAAA,QACJ,IAAI,KAAM,CAAA,SAAA;AAAA,QACV,IAAI,KAAM,CAAA,IAAA;AAAA,QACV,IAAI,KAAM,CAAA,OAAA;AAAA,OACZ,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as _backstage_plugin_scaffolder_backend from '@backstage/plugin-scaffolder-backend';
1
+ import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
2
2
  import { JsonObject } from '@backstage/types';
3
3
 
4
4
  /**
@@ -10,7 +10,7 @@ import { JsonObject } from '@backstage/types';
10
10
  *
11
11
  * @public
12
12
  */
13
- declare function createRunYeomanAction(): _backstage_plugin_scaffolder_backend.TemplateAction<{
13
+ declare function createRunYeomanAction(): _backstage_plugin_scaffolder_node.TemplateAction<{
14
14
  namespace: string;
15
15
  args?: string[] | undefined;
16
16
  options?: JsonObject | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-yeoman",
3
- "version": "0.2.13",
3
+ "version": "0.2.15-next.0",
4
4
  "main": "dist/index.cjs.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -23,13 +23,13 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@backstage/config": "^1.0.6",
26
- "@backstage/plugin-scaffolder-backend": "^1.10.0",
26
+ "@backstage/plugin-scaffolder-node": "^0.1.0-next.0",
27
27
  "@backstage/types": "^1.0.2",
28
28
  "winston": "^3.2.1",
29
29
  "yeoman-environment": "^3.9.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@backstage/backend-common": "^0.18.0",
32
+ "@backstage/backend-common": "^0.18.2-next.0",
33
33
  "@backstage/cli": "^0.22.1"
34
34
  },
35
35
  "files": [