@backstage/cli 0.30.0-next.2 → 0.30.0-next.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.
Files changed (135) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/commands/index.cjs.js +3 -0
  3. package/dist/commands/new/new.cjs.js +39 -80
  4. package/dist/lib/new/createNewPackage.cjs.js +32 -0
  5. package/dist/lib/new/defaultTemplates.cjs.js +16 -0
  6. package/dist/lib/new/execution/PortableTemplater.cjs.js +91 -0
  7. package/dist/lib/new/execution/executePortableTemplate.cjs.js +54 -0
  8. package/dist/lib/new/execution/installNewPackage.cjs.js +127 -0
  9. package/dist/lib/new/execution/writeTemplateContents.cjs.js +111 -0
  10. package/dist/lib/new/preparation/collectPortableTemplateInput.cjs.js +157 -0
  11. package/dist/lib/new/preparation/loadPortableTemplate.cjs.js +82 -0
  12. package/dist/lib/new/preparation/loadPortableTemplateConfig.cjs.js +121 -0
  13. package/dist/lib/new/preparation/resolvePackageParams.cjs.js +40 -0
  14. package/dist/lib/new/preparation/selectTemplateInteractively.cjs.js +38 -0
  15. package/dist/lib/new/types.cjs.js +15 -4
  16. package/dist/lib/tasks.cjs.js +0 -111
  17. package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
  18. package/dist/packages/backend-plugin-api/package.json.cjs.js +1 -1
  19. package/dist/packages/backend-test-utils/package.json.cjs.js +1 -1
  20. package/dist/packages/cli/package.json.cjs.js +3 -2
  21. package/dist/packages/dev-utils/package.json.cjs.js +1 -1
  22. package/dist/plugins/auth-backend/package.json.cjs.js +1 -1
  23. package/dist/plugins/auth-backend-module-guest-provider/package.json.cjs.js +1 -1
  24. package/dist/plugins/catalog-node/package.json.cjs.js +1 -1
  25. package/dist/plugins/scaffolder-node/package.json.cjs.js +1 -1
  26. package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +1 -1
  27. package/package.json +11 -10
  28. package/templates/{default-backend-plugin → backend-plugin}/README.md.hbs +4 -4
  29. package/templates/{default-backend-plugin → backend-plugin}/dev/index.ts.hbs +5 -5
  30. package/templates/{default-backend-plugin → backend-plugin}/package.json.hbs +1 -9
  31. package/templates/backend-plugin/portable-template.yaml +5 -0
  32. package/templates/{default-backend-plugin → backend-plugin}/src/plugin.test.ts.hbs +5 -5
  33. package/templates/{default-backend-plugin → backend-plugin}/src/plugin.ts.hbs +1 -1
  34. package/templates/{default-backend-module → backend-plugin-module}/README.md.hbs +1 -1
  35. package/templates/{default-backend-module → backend-plugin-module}/package.json.hbs +1 -9
  36. package/templates/backend-plugin-module/portable-template.yaml +5 -0
  37. package/templates/{default-plugin → frontend-plugin}/README.md.hbs +3 -3
  38. package/templates/{default-plugin → frontend-plugin}/dev/index.tsx.hbs +1 -1
  39. package/templates/{default-plugin → frontend-plugin}/package.json.hbs +1 -9
  40. package/templates/frontend-plugin/portable-template.yaml +6 -0
  41. package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs +1 -1
  42. package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/ExampleComponent.tsx.hbs +1 -1
  43. package/templates/{default-plugin → frontend-plugin}/src/plugin.test.ts.hbs +1 -1
  44. package/templates/{default-plugin → frontend-plugin}/src/plugin.ts.hbs +1 -1
  45. package/templates/{default-plugin → frontend-plugin}/src/routes.ts.hbs +1 -1
  46. package/templates/{node-library-package → node-library}/README.md.hbs +2 -2
  47. package/templates/{node-library-package → node-library}/package.json.hbs +1 -9
  48. package/templates/node-library/portable-template.yaml +3 -0
  49. package/templates/plugin-common-library/README.md.hbs +5 -0
  50. package/templates/{default-common-plugin-package → plugin-common-library}/package.json.hbs +2 -10
  51. package/templates/plugin-common-library/portable-template.yaml +3 -0
  52. package/templates/{default-common-plugin-package → plugin-common-library}/src/index.ts.hbs +1 -1
  53. package/templates/plugin-node-library/README.md.hbs +5 -0
  54. package/templates/{default-node-plugin-package → plugin-node-library}/package.json.hbs +2 -10
  55. package/templates/plugin-node-library/portable-template.yaml +3 -0
  56. package/templates/{default-node-plugin-package → plugin-node-library}/src/index.ts.hbs +1 -1
  57. package/templates/plugin-web-library/README.md.hbs +5 -0
  58. package/templates/{default-react-plugin-package → plugin-web-library}/package.json.hbs +2 -10
  59. package/templates/plugin-web-library/portable-template.yaml +3 -0
  60. package/templates/{default-react-plugin-package → plugin-web-library}/src/index.ts.hbs +1 -1
  61. package/templates/scaffolder-backend-module/README.md.hbs +5 -0
  62. package/templates/{scaffolder-module → scaffolder-backend-module}/package.json.hbs +2 -10
  63. package/templates/scaffolder-backend-module/portable-template.yaml +6 -0
  64. package/templates/{scaffolder-module → scaffolder-backend-module}/src/index.ts.hbs +1 -1
  65. package/templates/{web-library-package → web-library}/README.md.hbs +2 -2
  66. package/templates/{web-library-package → web-library}/package.json.hbs +1 -9
  67. package/templates/web-library/portable-template.yaml +3 -0
  68. package/dist/lib/new/FactoryRegistry.cjs.js +0 -96
  69. package/dist/lib/new/factories/backendModule.cjs.js +0 -82
  70. package/dist/lib/new/factories/backendPlugin.cjs.js +0 -78
  71. package/dist/lib/new/factories/common/prompts.cjs.js +0 -57
  72. package/dist/lib/new/factories/common/tasks.cjs.js +0 -66
  73. package/dist/lib/new/factories/common/util.cjs.js +0 -16
  74. package/dist/lib/new/factories/frontendPlugin.cjs.js +0 -107
  75. package/dist/lib/new/factories/index.cjs.js +0 -24
  76. package/dist/lib/new/factories/nodeLibraryPackage.cjs.js +0 -57
  77. package/dist/lib/new/factories/pluginCommon.cjs.js +0 -58
  78. package/dist/lib/new/factories/pluginNode.cjs.js +0 -58
  79. package/dist/lib/new/factories/pluginWeb.cjs.js +0 -58
  80. package/dist/lib/new/factories/scaffolderModule.cjs.js +0 -90
  81. package/dist/lib/new/factories/webLibraryPackage.cjs.js +0 -57
  82. package/templates/default-backend-module/tsconfig.json +0 -9
  83. package/templates/default-backend-plugin/tsconfig.json +0 -13
  84. package/templates/default-common-plugin-package/README.md.hbs +0 -5
  85. package/templates/default-common-plugin-package/tsconfig.json +0 -9
  86. package/templates/default-node-plugin-package/README.md.hbs +0 -5
  87. package/templates/default-node-plugin-package/tsconfig.json +0 -9
  88. package/templates/default-plugin/tsconfig.json +0 -12
  89. package/templates/default-react-plugin-package/README.md.hbs +0 -5
  90. package/templates/default-react-plugin-package/tsconfig.json +0 -11
  91. package/templates/node-library-package/tsconfig.json +0 -11
  92. package/templates/scaffolder-module/README.md.hbs +0 -5
  93. package/templates/scaffolder-module/tsconfig.json +0 -9
  94. package/templates/web-library-package/tsconfig.json +0 -11
  95. /package/templates/{default-backend-plugin → backend-plugin}/.eslintrc.js.hbs +0 -0
  96. /package/templates/{default-backend-plugin → backend-plugin}/src/index.ts.hbs +0 -0
  97. /package/templates/{default-backend-plugin → backend-plugin}/src/router.test.ts +0 -0
  98. /package/templates/{default-backend-plugin → backend-plugin}/src/router.ts +0 -0
  99. /package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/createTodoListService.ts +0 -0
  100. /package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/index.ts +0 -0
  101. /package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/types.ts +0 -0
  102. /package/templates/{default-backend-plugin → backend-plugin}/src/setupTests.ts +0 -0
  103. /package/templates/{default-backend-module → backend-plugin-module}/.eslintrc.js.hbs +0 -0
  104. /package/templates/{default-backend-module → backend-plugin-module}/src/index.ts.hbs +0 -0
  105. /package/templates/{default-backend-module → backend-plugin-module}/src/module.ts.hbs +0 -0
  106. /package/templates/{default-common-plugin-package → frontend-plugin}/.eslintrc.js.hbs +0 -0
  107. /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/index.ts +0 -0
  108. /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx.hbs +0 -0
  109. /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +0 -0
  110. /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/index.ts +0 -0
  111. /package/templates/{default-plugin → frontend-plugin}/src/index.ts.hbs +0 -0
  112. /package/templates/{default-plugin → frontend-plugin}/src/setupTests.ts +0 -0
  113. /package/templates/{default-node-plugin-package → node-library}/.eslintrc.js.hbs +0 -0
  114. /package/templates/{node-library-package → node-library}/src/index.ts.hbs +0 -0
  115. /package/templates/{default-common-plugin-package → node-library}/src/setupTests.ts +0 -0
  116. /package/templates/{default-plugin → plugin-common-library}/.eslintrc.js.hbs +0 -0
  117. /package/templates/{default-node-plugin-package → plugin-common-library}/src/setupTests.ts +0 -0
  118. /package/templates/{default-react-plugin-package → plugin-node-library}/.eslintrc.js.hbs +0 -0
  119. /package/templates/{node-library-package → plugin-node-library}/src/setupTests.ts +0 -0
  120. /package/templates/{node-library-package → plugin-web-library}/.eslintrc.js.hbs +0 -0
  121. /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/ExampleComponent/ExampleComponent.test.tsx +0 -0
  122. /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/ExampleComponent/ExampleComponent.tsx +0 -0
  123. /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/ExampleComponent/index.ts +0 -0
  124. /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/index.ts +0 -0
  125. /package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/index.ts +0 -0
  126. /package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/useExample/index.ts +0 -0
  127. /package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/useExample/useExample.ts +0 -0
  128. /package/templates/{default-react-plugin-package → plugin-web-library}/src/setupTests.ts +0 -0
  129. /package/templates/{scaffolder-module → scaffolder-backend-module}/.eslintrc.js.hbs +0 -0
  130. /package/templates/{scaffolder-module → scaffolder-backend-module}/src/actions/example.test.ts +0 -0
  131. /package/templates/{scaffolder-module → scaffolder-backend-module}/src/actions/example.ts +0 -0
  132. /package/templates/{scaffolder-module → scaffolder-backend-module}/src/module.ts +0 -0
  133. /package/templates/{web-library-package → web-library}/.eslintrc.js.hbs +0 -0
  134. /package/templates/{web-library-package → web-library}/src/index.ts.hbs +0 -0
  135. /package/templates/{web-library-package → web-library}/src/setupTests.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.7.0-next.1";
3
+ var version = "0.7.0-next.2";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.1.19-next.2";
3
+ var version = "0.1.19-next.3";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/cli",
3
- "version": "0.30.0-next.2",
3
+ "version": "0.30.0-next.3",
4
4
  "description": "CLI for developing Backstage plugins and apps",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -159,23 +159,24 @@
159
159
  "yargs": "^16.2.0",
160
160
  "yml-loader": "^2.1.0",
161
161
  "yn": "^4.0.0",
162
- "zod": "^3.22.4"
162
+ "zod": "^3.22.4",
163
+ "zod-validation-error": "^3.4.0"
163
164
  },
164
165
  "devDependencies": {
165
- "@backstage/backend-plugin-api": "1.2.0-next.1",
166
- "@backstage/backend-test-utils": "1.3.0-next.2",
166
+ "@backstage/backend-plugin-api": "1.2.0-next.2",
167
+ "@backstage/backend-test-utils": "1.3.0-next.3",
167
168
  "@backstage/catalog-client": "1.9.1",
168
169
  "@backstage/config": "1.3.2",
169
170
  "@backstage/core-app-api": "1.15.5-next.0",
170
171
  "@backstage/core-components": "0.16.4-next.1",
171
172
  "@backstage/core-plugin-api": "1.10.4-next.0",
172
- "@backstage/dev-utils": "1.1.7-next.2",
173
+ "@backstage/dev-utils": "1.1.7-next.3",
173
174
  "@backstage/errors": "1.2.7",
174
- "@backstage/plugin-auth-backend": "0.24.3-next.2",
175
- "@backstage/plugin-auth-backend-module-guest-provider": "0.2.5-next.1",
176
- "@backstage/plugin-catalog-node": "1.16.0-next.2",
177
- "@backstage/plugin-scaffolder-node": "0.7.0-next.1",
178
- "@backstage/plugin-scaffolder-node-test-utils": "0.1.19-next.2",
175
+ "@backstage/plugin-auth-backend": "0.24.3-next.3",
176
+ "@backstage/plugin-auth-backend-module-guest-provider": "0.2.5-next.2",
177
+ "@backstage/plugin-catalog-node": "1.16.0-next.3",
178
+ "@backstage/plugin-scaffolder-node": "0.7.0-next.2",
179
+ "@backstage/plugin-scaffolder-node-test-utils": "0.1.19-next.3",
179
180
  "@backstage/test-utils": "1.7.5-next.0",
180
181
  "@backstage/theme": "0.6.4-next.0",
181
182
  "@rspack/core": "^1.0.10",
@@ -1,14 +1,14 @@
1
- # {{id}}
1
+ # {{pluginId}}
2
2
 
3
3
  This plugin backend was templated using the Backstage CLI. You should replace this text with a description of your plugin backend.
4
4
 
5
5
  ## Installation
6
6
 
7
- This plugin is installed via the `{{name}}` package. To install it to your backend package, run the following command:
7
+ This plugin is installed via the `{{packageName}}` package. To install it to your backend package, run the following command:
8
8
 
9
9
  ```bash
10
10
  # From your root directory
11
- yarn --cwd packages/backend add {{name}}
11
+ yarn --cwd packages/backend add {{packageName}}
12
12
  ```
13
13
 
14
14
  Then add the plugin to your backend in `packages/backend/src/index.ts`:
@@ -16,7 +16,7 @@ Then add the plugin to your backend in `packages/backend/src/index.ts`:
16
16
  ```ts
17
17
  const backend = createBackend();
18
18
  // ...
19
- backend.add(import('{{name}}'));
19
+ backend.add(import('{{packageName}}'));
20
20
  ```
21
21
 
22
22
  ## Development
@@ -11,17 +11,17 @@ import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils';
11
11
  //
12
12
  // Create a new todo item, standalone or for the sample component:
13
13
  //
14
- // curl http://localhost:7007/api/{{id}}/todos -H 'Content-Type: application/json' -d '{"title": "My Todo"}'
15
- // curl http://localhost:7007/api/{{id}}/todos -H 'Content-Type: application/json' -d '{"title": "My Todo", "entityRef": "component:default/sample"}'
14
+ // curl http://localhost:7007/api/{{pluginId}}/todos -H 'Content-Type: application/json' -d '{"title": "My Todo"}'
15
+ // curl http://localhost:7007/api/{{pluginId}}/todos -H 'Content-Type: application/json' -d '{"title": "My Todo", "entityRef": "component:default/sample"}'
16
16
  //
17
17
  // List TODOs:
18
18
  //
19
- // curl http://localhost:7007/api/{{id}}/todos
19
+ // curl http://localhost:7007/api/{{pluginId}}/todos
20
20
  //
21
21
  // Explicitly make an unauthenticated request, or with service auth:
22
22
  //
23
- // curl http://localhost:7007/api/{{id}}/todos -H 'Authorization: Bearer mock-none-token'
24
- // curl http://localhost:7007/api/{{id}}/todos -H 'Authorization: Bearer mock-service-token'
23
+ // curl http://localhost:7007/api/{{pluginId}}/todos -H 'Authorization: Bearer mock-none-token'
24
+ // curl http://localhost:7007/api/{{pluginId}}/todos -H 'Authorization: Bearer mock-service-token'
25
25
 
26
26
  const backend = createBackend();
27
27
 
@@ -1,16 +1,8 @@
1
1
  {
2
- "name": "{{name}}",
3
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
4
3
  "main": "src/index.ts",
5
4
  "types": "src/index.ts",
6
- "license": "{{license}}",
7
- {{#if privatePackage}}
8
- "private": {{privatePackage}},
9
- {{/if}}
10
5
  "publishConfig": {
11
- {{#if npmRegistry}}
12
- "registry": "{{npmRegistry}}",
13
- {{/if}}
14
6
  "access": "public",
15
7
  "main": "dist/index.cjs.js",
16
8
  "types": "dist/index.d.ts"
@@ -0,0 +1,5 @@
1
+ name: backend-plugin
2
+ role: backend-plugin
3
+ description: A new backend plugin
4
+ values:
5
+ pluginVar: '{{ camelCase pluginId }}Plugin'
@@ -17,12 +17,12 @@ describe('plugin', () => {
17
17
  features: [{{pluginVar}}],
18
18
  });
19
19
 
20
- await request(server).get('/api/{{id}}/todos').expect(200, {
20
+ await request(server).get('/api/{{pluginId}}/todos').expect(200, {
21
21
  items: [],
22
22
  });
23
23
 
24
24
  const createRes = await request(server)
25
- .post('/api/{{id}}/todos')
25
+ .post('/api/{{pluginId}}/todos')
26
26
  .send({ title: 'My Todo' });
27
27
 
28
28
  expect(createRes.status).toBe(201);
@@ -36,13 +36,13 @@ describe('plugin', () => {
36
36
  const createdTodoItem = createRes.body;
37
37
 
38
38
  await request(server)
39
- .get('/api/{{id}}/todos')
39
+ .get('/api/{{pluginId}}/todos')
40
40
  .expect(200, {
41
41
  items: [createdTodoItem],
42
42
  });
43
43
 
44
44
  await request(server)
45
- .get(`/api/{{id}}/todos/${createdTodoItem.id}`)
45
+ .get(`/api/{{pluginId}}/todos/${createdTodoItem.id}`)
46
46
  .expect(200, createdTodoItem);
47
47
  });
48
48
 
@@ -71,7 +71,7 @@ describe('plugin', () => {
71
71
  });
72
72
 
73
73
  const createRes = await request(server)
74
- .post('/api/{{id}}/todos')
74
+ .post('/api/{{pluginId}}/todos')
75
75
  .send({ title: 'My Todo', entityRef: 'component:default/my-component' });
76
76
 
77
77
  expect(createRes.status).toBe(201);
@@ -12,7 +12,7 @@ import { createTodoListService } from './services/TodoListService';
12
12
  * @public
13
13
  */
14
14
  export const {{pluginVar}} = createBackendPlugin({
15
- pluginId: '{{id}}',
15
+ pluginId: '{{pluginId}}',
16
16
  register(env) {
17
17
  env.registerInit({
18
18
  deps: {
@@ -1,4 +1,4 @@
1
- # {{name}}
1
+ # {{packageName}}
2
2
 
3
3
  The {{moduleId}} backend module for the {{pluginId}} plugin.
4
4
 
@@ -1,17 +1,9 @@
1
1
  {
2
- "name": "{{name}}",
2
+ "name": "{{packageName}}",
3
3
  "description": "The {{moduleId}} backend module for the {{pluginId}} plugin.",
4
- "version": "{{packageVersion}}",
5
4
  "main": "src/index.ts",
6
5
  "types": "src/index.ts",
7
- "license": "{{license}}",
8
- {{#if privatePackage}}
9
- "private": {{privatePackage}},
10
- {{/if}}
11
6
  "publishConfig": {
12
- {{#if npmRegistry}}
13
- "registry": "{{npmRegistry}}",
14
- {{/if}}
15
7
  "access": "public",
16
8
  "main": "dist/index.cjs.js",
17
9
  "types": "dist/index.d.ts"
@@ -0,0 +1,5 @@
1
+ name: backend-plugin-module
2
+ role: backend-plugin-module
3
+ description: A new backend module that extends an existing backend plugin
4
+ values:
5
+ moduleVar: '{{ camelCase pluginId }}Module{{ upperFirst ( camelCase moduleId ) }}'
@@ -1,12 +1,12 @@
1
- # {{id}}
1
+ # {{pluginId}}
2
2
 
3
- Welcome to the {{id}} plugin!
3
+ Welcome to the {{pluginId}} plugin!
4
4
 
5
5
  _This plugin was created through the Backstage CLI_
6
6
 
7
7
  ## Getting started
8
8
 
9
- Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/{{id}}](http://localhost:3000/{{id}}).
9
+ Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/{{pluginId}}](http://localhost:3000/{{pluginId}}).
10
10
 
11
11
  You can also serve the plugin in isolation by running `yarn start` in the plugin directory.
12
12
  This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads.
@@ -7,6 +7,6 @@ createDevApp()
7
7
  .addPage({
8
8
  element: <{{ extensionName }} />,
9
9
  title: 'Root Page',
10
- path: '/{{ id }}',
10
+ path: '/{{pluginId}}',
11
11
  })
12
12
  .render();
@@ -1,16 +1,8 @@
1
1
  {
2
- "name": "{{name}}",
3
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
4
3
  "main": "src/index.ts",
5
4
  "types": "src/index.ts",
6
- "license": "{{license}}",
7
- {{#if privatePackage}}
8
- "private": {{privatePackage}},
9
- {{/if}}
10
5
  "publishConfig": {
11
- {{#if npmRegistry}}
12
- "registry": "{{npmRegistry}}",
13
- {{/if}}
14
6
  "access": "public",
15
7
  "main": "dist/index.esm.js",
16
8
  "types": "dist/index.d.ts"
@@ -0,0 +1,6 @@
1
+ name: frontend-plugin
2
+ role: frontend-plugin
3
+ description: A new frontend plugin
4
+ values:
5
+ pluginVar: '{{ camelCase pluginId }}Plugin'
6
+ extensionName: '{{ upperFirst ( camelCase pluginId ) }}Page'
@@ -23,7 +23,7 @@ describe('ExampleComponent', () => {
23
23
  it('should render', async () => {
24
24
  await renderInTestApp(<ExampleComponent />);
25
25
  expect(
26
- screen.getByText('Welcome to {{ id }}!'),
26
+ screen.getByText('Welcome to {{pluginId}}!'),
27
27
  ).toBeInTheDocument();
28
28
  });
29
29
  });
@@ -13,7 +13,7 @@ import { ExampleFetchComponent } from '../ExampleFetchComponent';
13
13
 
14
14
  export const ExampleComponent = () => (
15
15
  <Page themeId="tool">
16
- <Header title="Welcome to {{ id }}!" subtitle="Optional subtitle">
16
+ <Header title="Welcome to {{pluginId}}!" subtitle="Optional subtitle">
17
17
  <HeaderLabel label="Owner" value="Team X" />
18
18
  <HeaderLabel label="Lifecycle" value="Alpha" />
19
19
  </Header>
@@ -1,6 +1,6 @@
1
1
  import { {{ pluginVar }} } from './plugin';
2
2
 
3
- describe('{{ id }}', () => {
3
+ describe('{{pluginId}}', () => {
4
4
  it('should export plugin', () => {
5
5
  expect({{ pluginVar }}).toBeDefined();
6
6
  });
@@ -6,7 +6,7 @@ import {
6
6
  import { rootRouteRef } from './routes';
7
7
 
8
8
  export const {{ pluginVar }} = createPlugin({
9
- id: '{{ id }}',
9
+ id: '{{pluginId}}',
10
10
  routes: {
11
11
  root: rootRouteRef,
12
12
  },
@@ -1,5 +1,5 @@
1
1
  import { createRouteRef } from '@backstage/core-plugin-api';
2
2
 
3
3
  export const rootRouteRef = createRouteRef({
4
- id: '{{ id }}',
4
+ id: '{{pluginId}}',
5
5
  });
@@ -1,4 +1,4 @@
1
- # {{name}}
1
+ # {{packageName}}
2
2
 
3
3
  _This package was created through the Backstage CLI_.
4
4
 
@@ -8,5 +8,5 @@ Install the package via Yarn:
8
8
 
9
9
  ```sh
10
10
  cd <package-dir> # if within a monorepo
11
- yarn add {{name}}
11
+ yarn add {{packageName}}
12
12
  ```
@@ -1,16 +1,8 @@
1
1
  {
2
- "name": "{{name}}",
3
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
4
3
  "main": "src/index.ts",
5
4
  "types": "src/index.ts",
6
- "license": "{{license}}",
7
- {{#if privatePackage}}
8
- "private": {{privatePackage}},
9
- {{/if}}
10
5
  "publishConfig": {
11
- {{#if npmRegistry}}
12
- "registry": "{{npmRegistry}}",
13
- {{/if}}
14
6
  "access": "public",
15
7
  "main": "dist/index.cjs.js",
16
8
  "types": "dist/index.d.ts"
@@ -0,0 +1,3 @@
1
+ name: node-library
2
+ role: node-library
3
+ description: A library package, exporting shared functionality for Node.js environments
@@ -0,0 +1,5 @@
1
+ # {{packageName}}
2
+
3
+ Welcome to the common package for the {{pluginId}} plugin!
4
+
5
+ _This plugin was created through the Backstage CLI_
@@ -1,17 +1,9 @@
1
1
  {
2
- "name": "{{name}}",
3
- "description": "Common functionalities for the {{id}} plugin",
4
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
3
+ "description": "Common functionalities for the {{pluginId}} plugin",
5
4
  "main": "src/index.ts",
6
5
  "types": "src/index.ts",
7
- "license": "{{license}}",
8
- {{#if privatePackage}}
9
- "private": {{privatePackage}},
10
- {{/if}}
11
6
  "publishConfig": {
12
- {{#if npmRegistry}}
13
- "registry": "{{npmRegistry}}",
14
- {{/if}}
15
7
  "access": "public",
16
8
  "main": "dist/index.cjs.js",
17
9
  "module": "dist/index.esm.js",
@@ -0,0 +1,3 @@
1
+ name: plugin-common-library
2
+ role: plugin-common-library
3
+ description: A new isomorphic common plugin package
@@ -1,6 +1,6 @@
1
1
  /***/
2
2
  /**
3
- * Common functionalities for the {{id}} plugin.
3
+ * Common functionalities for the {{pluginId}} plugin.
4
4
  *
5
5
  * @packageDocumentation
6
6
  */
@@ -0,0 +1,5 @@
1
+ # {{packageName}}
2
+
3
+ Welcome to the Node.js library package for the {{pluginId}} plugin!
4
+
5
+ _This plugin was created through the Backstage CLI_
@@ -1,17 +1,9 @@
1
1
  {
2
- "name": "{{name}}",
3
- "description": "Node.js library for the {{id}} plugin",
4
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
3
+ "description": "Node.js library for the {{pluginId}} plugin",
5
4
  "main": "src/index.ts",
6
5
  "types": "src/index.ts",
7
- "license": "{{license}}",
8
- {{#if privatePackage}}
9
- "private": {{privatePackage}},
10
- {{/if}}
11
6
  "publishConfig": {
12
- {{#if npmRegistry}}
13
- "registry": "{{npmRegistry}}",
14
- {{/if}}
15
7
  "access": "public",
16
8
  "main": "dist/index.cjs.js",
17
9
  "types": "dist/index.d.ts"
@@ -0,0 +1,3 @@
1
+ name: plugin-node-library
2
+ role: plugin-node-library
3
+ description: A new Node.js library plugin package
@@ -1,6 +1,6 @@
1
1
  /***/
2
2
  /**
3
- * Node.js library for the {{id}} plugin.
3
+ * Node.js library for the {{pluginId}} plugin.
4
4
  *
5
5
  * @packageDocumentation
6
6
  */
@@ -0,0 +1,5 @@
1
+ # {{packageName}}
2
+
3
+ Welcome to the web library package for the {{pluginId}} plugin!
4
+
5
+ _This plugin was created through the Backstage CLI_
@@ -1,17 +1,9 @@
1
1
  {
2
- "name": "{{name}}",
3
- "description": "Web library for the {{id}} plugin",
4
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
3
+ "description": "Web library for the {{pluginId}} plugin",
5
4
  "main": "src/index.ts",
6
5
  "types": "src/index.ts",
7
- "license": "{{license}}",
8
- {{#if privatePackage}}
9
- "private": {{privatePackage}},
10
- {{/if}}
11
6
  "publishConfig": {
12
- {{#if npmRegistry}}
13
- "registry": "{{npmRegistry}}",
14
- {{/if}}
15
7
  "access": "public",
16
8
  "main": "dist/index.esm.js",
17
9
  "types": "dist/index.d.ts"
@@ -0,0 +1,3 @@
1
+ name: plugin-web-library
2
+ role: plugin-web-library
3
+ description: A new web library plugin package
@@ -1,6 +1,6 @@
1
1
  /***/
2
2
  /**
3
- * Web library for the {{id}} plugin.
3
+ * Web library for the {{pluginId}} plugin.
4
4
  *
5
5
  * @packageDocumentation
6
6
  */
@@ -0,0 +1,5 @@
1
+ # {{packageName}}
2
+
3
+ The {{moduleId}} module for [@backstage/plugin-scaffolder-backend](https://www.npmjs.com/package/@backstage/plugin-scaffolder-backend).
4
+
5
+ _This plugin was created through the Backstage CLI_
@@ -1,17 +1,9 @@
1
1
  {
2
- "name": "{{name}}",
3
- "description": "The {{id}} module for @backstage/plugin-scaffolder-backend",
4
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
3
+ "description": "The {{moduleId}} module for @backstage/plugin-scaffolder-backend",
5
4
  "main": "src/index.ts",
6
5
  "types": "src/index.ts",
7
- "license": "{{license}}",
8
- {{#if privatePackage}}
9
- "private": {{privatePackage}},
10
- {{/if}}
11
6
  "publishConfig": {
12
- {{#if npmRegistry}}
13
- "registry": "{{npmRegistry}}",
14
- {{/if}}
15
7
  "access": "public",
16
8
  "main": "dist/index.cjs.js",
17
9
  "types": "dist/index.d.ts"
@@ -0,0 +1,6 @@
1
+ name: scaffolder-backend-module
2
+ role: backend-plugin-module
3
+ description: A module exporting custom actions for @backstage/plugin-scaffolder-backend
4
+ values:
5
+ pluginId: scaffolder
6
+ moduleVar: '{{ camelCase pluginId }}Module{{ upperFirst ( camelCase moduleId ) }}'
@@ -1,6 +1,6 @@
1
1
  /***/
2
2
  /**
3
- * The {{id}} module for @backstage/plugin-scaffolder-backend.
3
+ * The {{moduleId}} module for @backstage/plugin-scaffolder-backend.
4
4
  *
5
5
  * @packageDocumentation
6
6
  */
@@ -1,4 +1,4 @@
1
- # {{name}}
1
+ # {{packageName}}
2
2
 
3
3
  _This package was created through the Backstage CLI_.
4
4
 
@@ -8,5 +8,5 @@ Install the package via Yarn:
8
8
 
9
9
  ```sh
10
10
  cd <package-dir> # if within a monorepo
11
- yarn add {{name}}
11
+ yarn add {{packageName}}
12
12
  ```
@@ -1,16 +1,8 @@
1
1
  {
2
- "name": "{{name}}",
3
- "version": "{{pluginVersion}}",
2
+ "name": "{{packageName}}",
4
3
  "main": "src/index.ts",
5
4
  "types": "src/index.ts",
6
- "license": "{{license}}",
7
- {{#if privatePackage}}
8
- "private": {{privatePackage}},
9
- {{/if}}
10
5
  "publishConfig": {
11
- {{#if npmRegistry}}
12
- "registry": "{{npmRegistry}}",
13
- {{/if}}
14
6
  "access": "public",
15
7
  "main": "dist/index.esm.js",
16
8
  "types": "dist/index.d.ts"
@@ -0,0 +1,3 @@
1
+ name: web-library
2
+ role: web-library
3
+ description: A library package, exporting shared functionality for web environments