@backstage/plugin-scaffolder-backend-module-yeoman 0.2.30 → 0.2.31-next.1

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,24 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-yeoman
2
2
 
3
+ ## 0.2.31-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-plugin-api@0.6.10-next.1
9
+ - @backstage/plugin-scaffolder-node@0.3.0-next.1
10
+ - @backstage/types@1.1.1
11
+
12
+ ## 0.2.31-next.0
13
+
14
+ ### Patch Changes
15
+
16
+ - e9a5228: Exporting a default module for the new Backend System
17
+ - Updated dependencies
18
+ - @backstage/plugin-scaffolder-node@0.3.0-next.0
19
+ - @backstage/backend-plugin-api@0.6.10-next.0
20
+ - @backstage/types@1.1.1
21
+
3
22
  ## 0.2.30
4
23
 
5
24
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
6
+ var backendPluginApi = require('@backstage/backend-plugin-api');
7
+ var alpha = require('@backstage/plugin-scaffolder-node/alpha');
6
8
 
7
9
  async function yeomanRun(workspace, namespace, args, opts) {
8
10
  const yeoman = require("yeoman-environment");
@@ -58,5 +60,21 @@ function createRunYeomanAction() {
58
60
  });
59
61
  }
60
62
 
63
+ const yeomanModule = backendPluginApi.createBackendModule({
64
+ pluginId: "scaffolder",
65
+ moduleId: "yeoman",
66
+ register({ registerInit }) {
67
+ registerInit({
68
+ deps: {
69
+ scaffolder: alpha.scaffolderActionsExtensionPoint
70
+ },
71
+ async init({ scaffolder }) {
72
+ scaffolder.addActions(createRunYeomanAction());
73
+ }
74
+ });
75
+ }
76
+ });
77
+
61
78
  exports.createRunYeomanAction = createRunYeomanAction;
79
+ exports["default"] = yeomanModule;
62
80
  //# sourceMappingURL=index.cjs.js.map
@@ -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-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 supportsDryRun: true,\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,yCAIJ,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,cAAgB,EAAA,IAAA;AAAA,IAChB,MAAM,QAAQ,GAAK,EAAA;AACjB,MAAA,GAAA,CAAI,MAAO,CAAA,IAAA;AAAA,QACT,CAAA,mCAAA,EAAsC,GAAI,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AAAA,OAC3D,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","../src/module.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 supportsDryRun: true,\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","/*\n * Copyright 2024 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 */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport { createRunYeomanAction } from './actions';\n\n/**\n * @public\n * The Yeoman Module for the Scaffolder Backend\n */\nexport const yeomanModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'yeoman',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n },\n async init({ scaffolder }) {\n scaffolder.addActions(createRunYeomanAction());\n },\n });\n },\n});\n"],"names":["createTemplateAction","createBackendModule","scaffolderActionsExtensionPoint"],"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,C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AAsC,GAAI,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AAAA,OAC3D,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;;ACrDO,MAAM,eAAeC,oCAAoB,CAAA;AAAA,EAC9C,QAAU,EAAA,YAAA;AAAA,EACV,QAAU,EAAA,QAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAgB,EAAA;AACzB,IAAa,YAAA,CAAA;AAAA,MACX,IAAM,EAAA;AAAA,QACJ,UAAY,EAAAC,qCAAA;AAAA,OACd;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,EAAc,EAAA;AACzB,QAAW,UAAA,CAAA,UAAA,CAAW,uBAAuB,CAAA,CAAA;AAAA,OAC/C;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
2
2
  import { JsonObject } from '@backstage/types';
3
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
3
4
 
4
5
  /**
5
6
  * Creates a `run:yeoman` Scaffolder action.
@@ -16,4 +17,10 @@ declare function createRunYeomanAction(): _backstage_plugin_scaffolder_node.Temp
16
17
  options?: JsonObject | undefined;
17
18
  }, JsonObject>;
18
19
 
19
- export { createRunYeomanAction };
20
+ /**
21
+ * @public
22
+ * The Yeoman Module for the Scaffolder Backend
23
+ */
24
+ declare const yeomanModule: () => _backstage_backend_plugin_api.BackendFeature;
25
+
26
+ export { createRunYeomanAction, yeomanModule as default };
package/package.json CHANGED
@@ -1,17 +1,23 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-yeoman",
3
- "version": "0.2.30",
4
- "main": "dist/index.cjs.js",
5
- "types": "dist/index.d.ts",
3
+ "version": "0.2.31-next.1",
4
+ "main": "./dist/index.cjs.js",
5
+ "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
8
- "access": "public",
9
- "main": "dist/index.cjs.js",
10
- "types": "dist/index.d.ts"
8
+ "access": "public"
11
9
  },
12
10
  "backstage": {
13
11
  "role": "backend-plugin-module"
14
12
  },
13
+ "exports": {
14
+ ".": {
15
+ "require": "./dist/index.cjs.js",
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.cjs.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
15
21
  "homepage": "https://backstage.io",
16
22
  "repository": {
17
23
  "type": "git",
@@ -28,14 +34,15 @@
28
34
  "clean": "backstage-cli package clean"
29
35
  },
30
36
  "dependencies": {
31
- "@backstage/plugin-scaffolder-node": "^0.2.10",
37
+ "@backstage/backend-plugin-api": "^0.6.10-next.1",
38
+ "@backstage/plugin-scaffolder-node": "^0.3.0-next.1",
32
39
  "@backstage/types": "^1.1.1",
33
40
  "winston": "^3.2.1",
34
41
  "yeoman-environment": "^3.9.1"
35
42
  },
36
43
  "devDependencies": {
37
- "@backstage/backend-common": "^0.20.1",
38
- "@backstage/cli": "^0.25.1"
44
+ "@backstage/backend-common": "^0.21.0-next.1",
45
+ "@backstage/cli": "^0.25.2-next.1"
39
46
  },
40
47
  "files": [
41
48
  "dist"