@backstage/cli 0.36.0-next.1 → 0.36.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.
Files changed (263) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/config/eslint-factory.js +1 -0
  3. package/config/getJestEnvironment.js +7 -29
  4. package/config/jest-environment-jsdom/index.js +9 -43
  5. package/config/jest.js +7 -401
  6. package/config/jestCacheResultProcessor.cjs +10 -6
  7. package/config/jestCachingModuleLoader.js +11 -19
  8. package/config/jestFileTransform.js +11 -28
  9. package/config/jestRejectNetworkRequests.js +10 -53
  10. package/config/jestSucraseTransform.js +10 -70
  11. package/config/jestSwcTransform.js +10 -27
  12. package/config/jestYamlTransform.js +11 -24
  13. package/config/nodeTransform.cjs +10 -70
  14. package/config/nodeTransformHooks.mjs +4 -278
  15. package/config/webpack-public-path.js +10 -14
  16. package/dist/cli-internal/src/InternalCliModule.cjs.js +11 -0
  17. package/dist/cli-internal/src/InternalCommandNode.cjs.js +25 -0
  18. package/dist/cli-internal/src/knownPluginPackages.cjs.js +40 -0
  19. package/dist/index.cjs.js +21 -10
  20. package/dist/wiring/CliInitializer.cjs.js +61 -20
  21. package/dist/wiring/CommandGraph.cjs.js +81 -23
  22. package/dist/wiring/discoverCliModules.cjs.js +44 -0
  23. package/package.json +27 -154
  24. package/dist/modules/build/commands/buildWorkspace.cjs.js +0 -24
  25. package/dist/modules/build/commands/package/build/command.cjs.js +0 -89
  26. package/dist/modules/build/commands/package/build/index.cjs.js +0 -8
  27. package/dist/modules/build/commands/package/clean.cjs.js +0 -21
  28. package/dist/modules/build/commands/package/postpack.cjs.js +0 -15
  29. package/dist/modules/build/commands/package/prepack.cjs.js +0 -29
  30. package/dist/modules/build/commands/package/start/command.cjs.js +0 -23
  31. package/dist/modules/build/commands/package/start/index.cjs.js +0 -8
  32. package/dist/modules/build/commands/package/start/resolveLinkedWorkspace.cjs.js +0 -34
  33. package/dist/modules/build/commands/package/start/startBackend.cjs.js +0 -46
  34. package/dist/modules/build/commands/package/start/startFrontend.cjs.js +0 -50
  35. package/dist/modules/build/commands/package/start/startPackage.cjs.js +0 -53
  36. package/dist/modules/build/commands/repo/build.cjs.js +0 -114
  37. package/dist/modules/build/commands/repo/clean.cjs.js +0 -41
  38. package/dist/modules/build/commands/repo/start.cjs.js +0 -150
  39. package/dist/modules/build/index.cjs.js +0 -192
  40. package/dist/modules/build/lib/buildBackend.cjs.js +0 -81
  41. package/dist/modules/build/lib/buildFrontend.cjs.js +0 -50
  42. package/dist/modules/build/lib/builder/config.cjs.js +0 -257
  43. package/dist/modules/build/lib/builder/packager.cjs.js +0 -131
  44. package/dist/modules/build/lib/builder/plugins.cjs.js +0 -125
  45. package/dist/modules/build/lib/builder/types.cjs.js +0 -10
  46. package/dist/modules/build/lib/bundler/ConfigInjectingHtmlWebpackPlugin.cjs.js +0 -43
  47. package/dist/modules/build/lib/bundler/bundle.cjs.js +0 -189
  48. package/dist/modules/build/lib/bundler/config.cjs.js +0 -308
  49. package/dist/modules/build/lib/bundler/hasReactDomClient.cjs.js +0 -17
  50. package/dist/modules/build/lib/bundler/linkWorkspaces.cjs.js +0 -34
  51. package/dist/modules/build/lib/bundler/moduleFederation.cjs.js +0 -135
  52. package/dist/modules/build/lib/bundler/optimization.cjs.js +0 -68
  53. package/dist/modules/build/lib/bundler/packageDetection.cjs.js +0 -124
  54. package/dist/modules/build/lib/bundler/paths.cjs.js +0 -62
  55. package/dist/modules/build/lib/bundler/server.cjs.js +0 -231
  56. package/dist/modules/build/lib/bundler/transforms.cjs.js +0 -145
  57. package/dist/modules/build/lib/config.cjs.js +0 -94
  58. package/dist/modules/build/lib/entryPoints.cjs.js +0 -49
  59. package/dist/modules/build/lib/ipc/IpcServer.cjs.js +0 -60
  60. package/dist/modules/build/lib/ipc/ServerDataStore.cjs.js +0 -36
  61. package/dist/modules/build/lib/optionsParser.cjs.js +0 -37
  62. package/dist/modules/build/lib/packager/createDistWorkspace.cjs.js +0 -235
  63. package/dist/modules/build/lib/packager/productionPack.cjs.js +0 -160
  64. package/dist/modules/build/lib/publishing.cjs.js +0 -40
  65. package/dist/modules/build/lib/role.cjs.js +0 -24
  66. package/dist/modules/build/lib/runner/runBackend.cjs.js +0 -136
  67. package/dist/modules/build/lib/typeDistProject.cjs.js +0 -89
  68. package/dist/modules/build/lib/urls.cjs.js +0 -13
  69. package/dist/modules/config/commands/docs.cjs.js +0 -62
  70. package/dist/modules/config/commands/print.cjs.js +0 -80
  71. package/dist/modules/config/commands/schema.cjs.js +0 -55
  72. package/dist/modules/config/commands/validate.cjs.js +0 -49
  73. package/dist/modules/config/index.cjs.js +0 -51
  74. package/dist/modules/config/lib/config.cjs.js +0 -94
  75. package/dist/modules/create-github-app/commands/create-github-app/GithubCreateAppServer.cjs.js +0 -127
  76. package/dist/modules/create-github-app/commands/create-github-app/index.cjs.js +0 -115
  77. package/dist/modules/create-github-app/index.cjs.js +0 -27
  78. package/dist/modules/info/commands/info.cjs.js +0 -181
  79. package/dist/modules/info/index.cjs.js +0 -19
  80. package/dist/modules/lint/commands/package/lint.cjs.js +0 -46
  81. package/dist/modules/lint/commands/repo/lint.cjs.js +0 -212
  82. package/dist/modules/lint/index.cjs.js +0 -82
  83. package/dist/modules/lint/lib/optionsParser.cjs.js +0 -37
  84. package/dist/modules/maintenance/commands/repo/fix.cjs.js +0 -400
  85. package/dist/modules/maintenance/commands/repo/list-deprecations.cjs.js +0 -74
  86. package/dist/modules/maintenance/index.cjs.js +0 -42
  87. package/dist/modules/migrate/commands/packageExports.cjs.js +0 -15
  88. package/dist/modules/migrate/commands/packageLintConfigs.cjs.js +0 -77
  89. package/dist/modules/migrate/commands/packageRole.cjs.js +0 -57
  90. package/dist/modules/migrate/commands/packageScripts.cjs.js +0 -87
  91. package/dist/modules/migrate/commands/reactRouterDeps.cjs.js +0 -51
  92. package/dist/modules/migrate/commands/versions/bump.cjs.js +0 -373
  93. package/dist/modules/migrate/commands/versions/migrate.cjs.js +0 -112
  94. package/dist/modules/migrate/index.cjs.js +0 -82
  95. package/dist/modules/migrate/lib/utils.cjs.js +0 -44
  96. package/dist/modules/migrate/lib/versioning/packages.cjs.js +0 -71
  97. package/dist/modules/migrate/lib/versioning/yarn.cjs.js +0 -28
  98. package/dist/modules/new/commands/new.cjs.js +0 -60
  99. package/dist/modules/new/index.cjs.js +0 -68
  100. package/dist/modules/new/lib/codeowners/codeowners.cjs.js +0 -92
  101. package/dist/modules/new/lib/createNewPackage.cjs.js +0 -32
  102. package/dist/modules/new/lib/defaultTemplates.cjs.js +0 -17
  103. package/dist/modules/new/lib/execution/PortableTemplater.cjs.js +0 -89
  104. package/dist/modules/new/lib/execution/executePortableTemplate.cjs.js +0 -66
  105. package/dist/modules/new/lib/execution/installNewPackage.cjs.js +0 -127
  106. package/dist/modules/new/lib/execution/writeTemplateContents.cjs.js +0 -116
  107. package/dist/modules/new/lib/preparation/collectPortableTemplateInput.cjs.js +0 -157
  108. package/dist/modules/new/lib/preparation/loadPortableTemplate.cjs.js +0 -81
  109. package/dist/modules/new/lib/preparation/loadPortableTemplateConfig.cjs.js +0 -132
  110. package/dist/modules/new/lib/preparation/resolvePackageParams.cjs.js +0 -40
  111. package/dist/modules/new/lib/preparation/selectTemplateInteractively.cjs.js +0 -38
  112. package/dist/modules/new/lib/tasks.cjs.js +0 -51
  113. package/dist/modules/new/lib/types.cjs.js +0 -19
  114. package/dist/modules/new/lib/version.cjs.js +0 -91
  115. package/dist/modules/test/commands/package/test.cjs.js +0 -65
  116. package/dist/modules/test/commands/repo/test.cjs.js +0 -288
  117. package/dist/modules/test/index.cjs.js +0 -54
  118. package/dist/modules/translations/commands/export.cjs.js +0 -127
  119. package/dist/modules/translations/commands/import.cjs.js +0 -164
  120. package/dist/modules/translations/index.cjs.js +0 -24
  121. package/dist/modules/translations/lib/discoverPackages.cjs.js +0 -121
  122. package/dist/modules/translations/lib/extractTranslations.cjs.js +0 -71
  123. package/dist/modules/translations/lib/messageFilePath.cjs.js +0 -43
  124. package/dist/packages/backend-defaults/package.json.cjs.js +0 -6
  125. package/dist/packages/backend-plugin-api/package.json.cjs.js +0 -6
  126. package/dist/packages/backend-test-utils/package.json.cjs.js +0 -6
  127. package/dist/packages/catalog-client/package.json.cjs.js +0 -6
  128. package/dist/packages/cli/package.json.cjs.js +0 -156
  129. package/dist/packages/config/package.json.cjs.js +0 -6
  130. package/dist/packages/core-app-api/package.json.cjs.js +0 -6
  131. package/dist/packages/core-components/package.json.cjs.js +0 -6
  132. package/dist/packages/core-plugin-api/package.json.cjs.js +0 -6
  133. package/dist/packages/dev-utils/package.json.cjs.js +0 -6
  134. package/dist/packages/errors/package.json.cjs.js +0 -6
  135. package/dist/packages/frontend-defaults/package.json.cjs.js +0 -6
  136. package/dist/packages/frontend-plugin-api/package.json.cjs.js +0 -6
  137. package/dist/packages/frontend-plugin-api/src/routing/describeParentCallSite.cjs.js +0 -26
  138. package/dist/packages/frontend-test-utils/package.json.cjs.js +0 -6
  139. package/dist/packages/test-utils/package.json.cjs.js +0 -6
  140. package/dist/packages/theme/package.json.cjs.js +0 -6
  141. package/dist/packages/types/package.json.cjs.js +0 -6
  142. package/dist/plugins/auth-backend/package.json.cjs.js +0 -6
  143. package/dist/plugins/auth-backend-module-guest-provider/package.json.cjs.js +0 -6
  144. package/dist/plugins/catalog-node/package.json.cjs.js +0 -6
  145. package/dist/plugins/scaffolder-node/package.json.cjs.js +0 -6
  146. package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +0 -6
  147. package/dist/wiring/CommandRegistry.cjs.js +0 -14
  148. package/dist/wiring/factory.cjs.js +0 -15
  149. package/dist/wiring/lazy.cjs.js +0 -22
  150. package/dist/wiring/types.cjs.js +0 -11
  151. package/templates/backend-plugin/.eslintrc.js.hbs +0 -1
  152. package/templates/backend-plugin/README.md.hbs +0 -28
  153. package/templates/backend-plugin/dev/index.ts.hbs +0 -60
  154. package/templates/backend-plugin/package.json.hbs +0 -44
  155. package/templates/backend-plugin/portable-template.yaml +0 -5
  156. package/templates/backend-plugin/src/index.ts.hbs +0 -1
  157. package/templates/backend-plugin/src/plugin.test.ts.hbs +0 -129
  158. package/templates/backend-plugin/src/plugin.ts.hbs +0 -32
  159. package/templates/backend-plugin/src/router.test.ts +0 -67
  160. package/templates/backend-plugin/src/router.ts +0 -51
  161. package/templates/backend-plugin/src/services/TodoListService.ts +0 -155
  162. package/templates/backend-plugin/src/setupTests.ts +0 -1
  163. package/templates/backend-plugin-module/.eslintrc.js.hbs +0 -1
  164. package/templates/backend-plugin-module/README.md.hbs +0 -5
  165. package/templates/backend-plugin-module/package.json.hbs +0 -34
  166. package/templates/backend-plugin-module/portable-template.yaml +0 -5
  167. package/templates/backend-plugin-module/src/index.ts.hbs +0 -8
  168. package/templates/backend-plugin-module/src/module.ts.hbs +0 -17
  169. package/templates/catalog-provider-module/.eslintrc.js.hbs +0 -1
  170. package/templates/catalog-provider-module/README.md.hbs +0 -5
  171. package/templates/catalog-provider-module/config.d.ts.hbs +0 -34
  172. package/templates/catalog-provider-module/package.json.hbs +0 -36
  173. package/templates/catalog-provider-module/portable-template.yaml +0 -9
  174. package/templates/catalog-provider-module/src/index.ts.hbs +0 -8
  175. package/templates/catalog-provider-module/src/module.ts.hbs +0 -29
  176. package/templates/catalog-provider-module/src/provider/readProviderConfigs.ts.hbs +0 -78
  177. package/templates/catalog-provider-module/src/provider/{{providerClass}}.test.ts.hbs +0 -18
  178. package/templates/catalog-provider-module/src/provider/{{providerClass}}.ts.hbs +0 -109
  179. package/templates/frontend-plugin/.eslintrc.js.hbs +0 -1
  180. package/templates/frontend-plugin/README.md.hbs +0 -13
  181. package/templates/frontend-plugin/dev/index.tsx.hbs +0 -11
  182. package/templates/frontend-plugin/package.json.hbs +0 -54
  183. package/templates/frontend-plugin/portable-template.yaml +0 -6
  184. package/templates/frontend-plugin/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs +0 -28
  185. package/templates/frontend-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs +0 -37
  186. package/templates/frontend-plugin/src/components/ExampleComponent/index.ts +0 -1
  187. package/templates/frontend-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx.hbs +0 -19
  188. package/templates/frontend-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +0 -308
  189. package/templates/frontend-plugin/src/components/ExampleFetchComponent/index.ts +0 -1
  190. package/templates/frontend-plugin/src/index.ts.hbs +0 -1
  191. package/templates/frontend-plugin/src/plugin.test.ts.hbs +0 -7
  192. package/templates/frontend-plugin/src/plugin.ts.hbs +0 -22
  193. package/templates/frontend-plugin/src/routes.ts.hbs +0 -5
  194. package/templates/frontend-plugin/src/setupTests.ts +0 -1
  195. package/templates/new-frontend-plugin/.eslintrc.js.hbs +0 -1
  196. package/templates/new-frontend-plugin/README.md.hbs +0 -20
  197. package/templates/new-frontend-plugin/dev/index.tsx +0 -10
  198. package/templates/new-frontend-plugin/package.json.hbs +0 -49
  199. package/templates/new-frontend-plugin/portable-template.yaml +0 -5
  200. package/templates/new-frontend-plugin/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs +0 -28
  201. package/templates/new-frontend-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs +0 -37
  202. package/templates/new-frontend-plugin/src/components/ExampleComponent/index.ts +0 -1
  203. package/templates/new-frontend-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx.hbs +0 -19
  204. package/templates/new-frontend-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +0 -308
  205. package/templates/new-frontend-plugin/src/components/ExampleFetchComponent/index.ts +0 -1
  206. package/templates/new-frontend-plugin/src/index.ts.hbs +0 -1
  207. package/templates/new-frontend-plugin/src/plugin.test.ts.hbs +0 -7
  208. package/templates/new-frontend-plugin/src/plugin.tsx.hbs +0 -25
  209. package/templates/new-frontend-plugin/src/routes.ts +0 -3
  210. package/templates/new-frontend-plugin/src/setupTests.ts +0 -1
  211. package/templates/new-frontend-plugin-module/.eslintrc.js.hbs +0 -1
  212. package/templates/new-frontend-plugin-module/README.md.hbs +0 -5
  213. package/templates/new-frontend-plugin-module/package.json.hbs +0 -35
  214. package/templates/new-frontend-plugin-module/portable-template.yaml +0 -5
  215. package/templates/new-frontend-plugin-module/src/index.ts.hbs +0 -1
  216. package/templates/new-frontend-plugin-module/src/module.tsx.hbs +0 -8
  217. package/templates/new-frontend-plugin-module/src/setupTests.ts +0 -1
  218. package/templates/node-library/.eslintrc.js.hbs +0 -1
  219. package/templates/node-library/README.md.hbs +0 -12
  220. package/templates/node-library/package.json.hbs +0 -29
  221. package/templates/node-library/portable-template.yaml +0 -3
  222. package/templates/node-library/src/index.ts.hbs +0 -1
  223. package/templates/node-library/src/setupTests.ts +0 -1
  224. package/templates/plugin-common-library/.eslintrc.js.hbs +0 -1
  225. package/templates/plugin-common-library/README.md.hbs +0 -5
  226. package/templates/plugin-common-library/package.json.hbs +0 -31
  227. package/templates/plugin-common-library/portable-template.yaml +0 -3
  228. package/templates/plugin-common-library/src/index.ts.hbs +0 -19
  229. package/templates/plugin-common-library/src/setupTests.ts +0 -1
  230. package/templates/plugin-node-library/.eslintrc.js.hbs +0 -1
  231. package/templates/plugin-node-library/README.md.hbs +0 -5
  232. package/templates/plugin-node-library/package.json.hbs +0 -30
  233. package/templates/plugin-node-library/portable-template.yaml +0 -3
  234. package/templates/plugin-node-library/src/index.ts.hbs +0 -18
  235. package/templates/plugin-node-library/src/setupTests.ts +0 -1
  236. package/templates/plugin-web-library/.eslintrc.js.hbs +0 -1
  237. package/templates/plugin-web-library/README.md.hbs +0 -5
  238. package/templates/plugin-web-library/package.json.hbs +0 -42
  239. package/templates/plugin-web-library/portable-template.yaml +0 -3
  240. package/templates/plugin-web-library/src/components/ExampleComponent/ExampleComponent.test.tsx +0 -17
  241. package/templates/plugin-web-library/src/components/ExampleComponent/ExampleComponent.tsx +0 -28
  242. package/templates/plugin-web-library/src/components/ExampleComponent/index.ts +0 -2
  243. package/templates/plugin-web-library/src/components/index.ts +0 -5
  244. package/templates/plugin-web-library/src/hooks/index.ts +0 -5
  245. package/templates/plugin-web-library/src/hooks/useExample/index.ts +0 -1
  246. package/templates/plugin-web-library/src/hooks/useExample/useExample.ts +0 -15
  247. package/templates/plugin-web-library/src/index.ts.hbs +0 -12
  248. package/templates/plugin-web-library/src/setupTests.ts +0 -1
  249. package/templates/scaffolder-backend-module/.eslintrc.js.hbs +0 -1
  250. package/templates/scaffolder-backend-module/README.md.hbs +0 -5
  251. package/templates/scaffolder-backend-module/package.json.hbs +0 -36
  252. package/templates/scaffolder-backend-module/portable-template.yaml +0 -6
  253. package/templates/scaffolder-backend-module/src/actions/example.test.ts +0 -24
  254. package/templates/scaffolder-backend-module/src/actions/example.ts +0 -39
  255. package/templates/scaffolder-backend-module/src/index.ts.hbs +0 -8
  256. package/templates/scaffolder-backend-module/src/module.ts +0 -21
  257. package/templates/web-library/.eslintrc.js.hbs +0 -1
  258. package/templates/web-library/README.md.hbs +0 -12
  259. package/templates/web-library/package.json.hbs +0 -30
  260. package/templates/web-library/portable-template.yaml +0 -3
  261. package/templates/web-library/src/index.ts.hbs +0 -1
  262. package/templates/web-library/src/setupTests.ts +0 -1
  263. /package/dist/{packages/opaque-internal → opaque-internal}/src/OpaqueType.cjs.js +0 -0
@@ -1,3 +0,0 @@
1
- name: plugin-common-library
2
- role: plugin-common-library
3
- description: A new isomorphic common plugin package
@@ -1,19 +0,0 @@
1
- /***/
2
- /**
3
- * Common functionalities for the {{pluginId}} plugin.
4
- *
5
- * @packageDocumentation
6
- */
7
-
8
- /**
9
- * In this package you might for example declare types that are common
10
- * between the frontend and backend plugin packages.
11
- */
12
- export type CommonType = {
13
- field: string;
14
- };
15
-
16
- /**
17
- * Or you might declare some common constants.
18
- */
19
- export const COMMON_CONSTANT = 1;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -1,5 +0,0 @@
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,30 +0,0 @@
1
- {
2
- "name": "{{packageName}}",
3
- "description": "Node.js library for the {{pluginId}} plugin",
4
- "main": "src/index.ts",
5
- "types": "src/index.ts",
6
- "publishConfig": {
7
- "access": "public",
8
- "main": "dist/index.cjs.js",
9
- "types": "dist/index.d.ts"
10
- },
11
- "backstage": {
12
- "role": "node-library",
13
- "pluginId": "{{pluginId}}"
14
- },
15
- "scripts": {
16
- "build": "backstage-cli package build",
17
- "lint": "backstage-cli package lint",
18
- "test": "backstage-cli package test",
19
- "clean": "backstage-cli package clean",
20
- "prepack": "backstage-cli package prepack",
21
- "postpack": "backstage-cli package postpack"
22
- },
23
- "devDependencies": {
24
- "@backstage/backend-test-utils": "{{versionQuery '@backstage/backend-test-utils'}}",
25
- "@backstage/cli": "{{versionQuery '@backstage/cli'}}"
26
- },
27
- "files": [
28
- "dist"
29
- ]
30
- }
@@ -1,3 +0,0 @@
1
- name: plugin-node-library
2
- role: plugin-node-library
3
- description: A new Node.js library plugin package
@@ -1,18 +0,0 @@
1
- /***/
2
- /**
3
- * Node.js library for the {{pluginId}} plugin.
4
- *
5
- * @packageDocumentation
6
- */
7
-
8
- // In this package you might for example export functions that
9
- // help other plugins or modules interact with your plugin.
10
-
11
- /**
12
- * Does something useful.
13
- *
14
- * @public
15
- */
16
- export function someFunction() {
17
- // ...
18
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -1,5 +0,0 @@
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,42 +0,0 @@
1
- {
2
- "name": "{{packageName}}",
3
- "description": "Web library for the {{pluginId}} plugin",
4
- "main": "src/index.ts",
5
- "types": "src/index.ts",
6
- "publishConfig": {
7
- "access": "public",
8
- "main": "dist/index.esm.js",
9
- "types": "dist/index.d.ts"
10
- },
11
- "backstage": {
12
- "role": "web-library",
13
- "pluginId": "{{pluginId}}"
14
- },
15
- "sideEffects": false,
16
- "scripts": {
17
- "start": "backstage-cli package start",
18
- "build": "backstage-cli package build",
19
- "lint": "backstage-cli package lint",
20
- "test": "backstage-cli package test",
21
- "clean": "backstage-cli package clean",
22
- "prepack": "backstage-cli package prepack",
23
- "postpack": "backstage-cli package postpack"
24
- },
25
- "dependencies": {
26
- "@backstage/core-plugin-api": "{{versionQuery '@backstage/core-plugin-api'}}",
27
- "@material-ui/core": "{{versionQuery '@material-ui/core' '4.12.2'}}"
28
- },
29
- "peerDependencies": {
30
- "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}"
31
- },
32
- "devDependencies": {
33
- "@backstage/cli": "{{versionQuery '@backstage/cli'}}",
34
- "@backstage/test-utils": "{{versionQuery '@backstage/test-utils'}}",
35
- "@testing-library/jest-dom": "{{versionQuery '@testing-library/jest-dom' '6.0.0'}}",
36
- "@testing-library/react": "{{versionQuery '@testing-library/react' '14.0.0'}}",
37
- "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}"
38
- },
39
- "files": [
40
- "dist"
41
- ]
42
- }
@@ -1,3 +0,0 @@
1
- name: plugin-web-library
2
- role: plugin-web-library
3
- description: A new web library plugin package
@@ -1,17 +0,0 @@
1
- import { screen } from '@testing-library/react';
2
- import { renderInTestApp } from '@backstage/test-utils';
3
- import { ExampleComponent } from './ExampleComponent';
4
-
5
- describe('ExampleComponent', () => {
6
- it('should render', async () => {
7
- await renderInTestApp(<ExampleComponent />);
8
-
9
- expect(screen.getByText('Hello World')).toBeInTheDocument();
10
- });
11
-
12
- it('should display a custom message', async () => {
13
- await renderInTestApp(<ExampleComponent message="Hello Example" />);
14
-
15
- expect(screen.getByText('Hello Example')).toBeInTheDocument();
16
- });
17
- });
@@ -1,28 +0,0 @@
1
- import { Typography } from '@material-ui/core';
2
-
3
- /**
4
- * Props for {@link ExampleComponent}.
5
- *
6
- * @public
7
- */
8
- export interface ExampleComponentProps {
9
- message?: string;
10
- }
11
-
12
- /**
13
- * Displays an example.
14
- *
15
- * @remarks
16
- *
17
- * Longer descriptions should be put after the `@remarks` tag. That way the initial summary
18
- * will show up in the API docs overview section, while the longer description will only be
19
- * displayed on the page for the specific API.
20
- *
21
- * @public
22
- */
23
- export function ExampleComponent(props: ExampleComponentProps) {
24
- // By destructuring props here rather than in the signature the API docs will look nicer
25
- const { message = 'Hello World' } = props;
26
-
27
- return <Typography variant="h1">{message}</Typography>;
28
- }
@@ -1,2 +0,0 @@
1
- export { ExampleComponent } from './ExampleComponent';
2
- export type { ExampleComponentProps } from './ExampleComponent';
@@ -1,5 +0,0 @@
1
- /***/
2
- // The index file in ./components/ is typically responsible for selecting
3
- // which components are public API and should be exported from the package.
4
-
5
- export * from './ExampleComponent';
@@ -1,5 +0,0 @@
1
- /***/
2
- // The index file in ./hooks/ is typically responsible for selecting
3
- // which hooks are public API and should be exported from the package.
4
-
5
- export * from './useExample';
@@ -1 +0,0 @@
1
- export { useExample } from './useExample';
@@ -1,15 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useApi, alertApiRef } from '@backstage/core-plugin-api';
3
-
4
- /**
5
- * Shows an example alert.
6
- *
7
- * @public
8
- */
9
- export function useExample() {
10
- const alertApi = useApi(alertApiRef);
11
-
12
- useEffect(() => {
13
- alertApi.post({ message: 'Hello World!' });
14
- }, [alertApi]);
15
- }
@@ -1,12 +0,0 @@
1
- /***/
2
- /**
3
- * Web library for the {{pluginId}} plugin.
4
- *
5
- * @packageDocumentation
6
- */
7
-
8
- // In this package you might for example export components or hooks
9
- // that are useful to other plugins or modules.
10
-
11
- export * from './components';
12
- export * from './hooks';
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1 +0,0 @@
1
- module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -1,5 +0,0 @@
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,36 +0,0 @@
1
- {
2
- "name": "{{packageName}}",
3
- "description": "The {{moduleId}} module for @backstage/plugin-scaffolder-backend",
4
- "main": "src/index.ts",
5
- "types": "src/index.ts",
6
- "publishConfig": {
7
- "access": "public",
8
- "main": "dist/index.cjs.js",
9
- "types": "dist/index.d.ts"
10
- },
11
- "backstage": {
12
- "role": "backend-plugin-module",
13
- "pluginId": "scaffolder"
14
- },
15
- "scripts": {
16
- "start": "backstage-cli package start",
17
- "build": "backstage-cli package build",
18
- "lint": "backstage-cli package lint",
19
- "test": "backstage-cli package test",
20
- "clean": "backstage-cli package clean",
21
- "prepack": "backstage-cli package prepack",
22
- "postpack": "backstage-cli package postpack"
23
- },
24
- "dependencies": {
25
- "@backstage/backend-plugin-api": "{{versionQuery '@backstage/backend-plugin-api'}}",
26
- "@backstage/plugin-scaffolder-node": "{{versionQuery '@backstage/plugin-scaffolder-node'}}"
27
- },
28
- "devDependencies": {
29
- "@backstage/backend-test-utils": "{{versionQuery '@backstage/backend-test-utils'}}",
30
- "@backstage/cli": "{{versionQuery '@backstage/cli'}}",
31
- "@backstage/plugin-scaffolder-node-test-utils": "{{versionQuery '@backstage/plugin-scaffolder-node-test-utils'}}"
32
- },
33
- "files": [
34
- "dist"
35
- ]
36
- }
@@ -1,6 +0,0 @@
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,24 +0,0 @@
1
- import { createExampleAction } from './example';
2
- import {createMockActionContext} from '@backstage/plugin-scaffolder-node-test-utils'
3
-
4
- describe('createExampleAction', () => {
5
- it('should call action', async () => {
6
- const action = createExampleAction();
7
-
8
- await expect(action.handler(createMockActionContext({
9
- input: {
10
- myParameter: 'test',
11
- },
12
- }))).resolves.toBeUndefined()
13
- });
14
-
15
- it('should fail when passing foo', async () => {
16
- const action = createExampleAction();
17
-
18
- await expect(action.handler(createMockActionContext({
19
- input: {
20
- myParameter: 'foo',
21
- },
22
- }))).rejects.toThrow("myParameter cannot be 'foo'")
23
- });
24
- });
@@ -1,39 +0,0 @@
1
- import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
2
-
3
- /**
4
- * Creates an `acme:example` Scaffolder action.
5
- *
6
- * @remarks
7
- *
8
- * See {@link https://example.com} for more information.
9
- *
10
- * @public
11
- */
12
- export function createExampleAction() {
13
- // For more information on how to define custom actions, see
14
- // https://backstage.io/docs/features/software-templates/writing-custom-actions
15
- return createTemplateAction({
16
- id: 'acme:example',
17
- description: 'Runs an example action',
18
- schema: {
19
- input: {
20
- myParameter: z =>
21
- z.string({
22
- description:
23
- "This is an example parameter, don't set it to foo",
24
- }),
25
- },
26
- },
27
- async handler(ctx) {
28
- ctx.logger.info(
29
- `Running example template with parameters: ${ctx.input.myParameter}`,
30
- );
31
-
32
- if (ctx.input.myParameter === 'foo') {
33
- throw new Error(`myParameter cannot be 'foo'`);
34
- }
35
-
36
- await new Promise(resolve => setTimeout(resolve, 1000));
37
- },
38
- });
39
- }
@@ -1,8 +0,0 @@
1
- /***/
2
- /**
3
- * The {{moduleId}} module for @backstage/plugin-scaffolder-backend.
4
- *
5
- * @packageDocumentation
6
- */
7
-
8
- export { scaffolderModule as default } from './module';
@@ -1,21 +0,0 @@
1
- import { createBackendModule } from "@backstage/backend-plugin-api";
2
- import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';
3
- import { createExampleAction } from "./actions/example";
4
-
5
- /**
6
- * A backend module that registers the action into the scaffolder
7
- */
8
- export const scaffolderModule = createBackendModule({
9
- moduleId: 'example-action',
10
- pluginId: 'scaffolder',
11
- register({ registerInit }) {
12
- registerInit({
13
- deps: {
14
- scaffolderActions: scaffolderActionsExtensionPoint
15
- },
16
- async init({ scaffolderActions}) {
17
- scaffolderActions.addActions(createExampleAction());
18
- }
19
- });
20
- },
21
- })
@@ -1 +0,0 @@
1
- module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -1,12 +0,0 @@
1
- # {{packageName}}
2
-
3
- _This package was created through the Backstage CLI_.
4
-
5
- ## Installation
6
-
7
- Install the package via Yarn:
8
-
9
- ```sh
10
- cd <package-dir> # if within a monorepo
11
- yarn add {{packageName}}
12
- ```
@@ -1,30 +0,0 @@
1
- {
2
- "name": "{{packageName}}",
3
- "main": "src/index.ts",
4
- "types": "src/index.ts",
5
- "publishConfig": {
6
- "access": "public",
7
- "main": "dist/index.esm.js",
8
- "types": "dist/index.d.ts"
9
- },
10
- "backstage": {
11
- "role": "web-library"
12
- },
13
- "sideEffects": false,
14
- "scripts": {
15
- "start": "backstage-cli package start",
16
- "build": "backstage-cli package build",
17
- "lint": "backstage-cli package lint",
18
- "test": "backstage-cli package test",
19
- "clean": "backstage-cli package clean",
20
- "prepack": "backstage-cli package prepack",
21
- "postpack": "backstage-cli package postpack"
22
- },
23
- "devDependencies": {
24
- "@backstage/cli": "{{versionQuery '@backstage/cli'}}",
25
- "@testing-library/jest-dom": "{{versionQuery '@testing-library/jest-dom' '6.0.0'}}"
26
- },
27
- "files": [
28
- "dist"
29
- ]
30
- }
@@ -1,3 +0,0 @@
1
- name: web-library
2
- role: web-library
3
- description: A library package, exporting shared functionality for web environments
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';