@backstage/cli 0.28.0-next.0 → 0.28.0-next.2

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 (131) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/config/jest.js +123 -69
  3. package/config/jestCacheResultProcessor.cjs +23 -0
  4. package/config/jestSwcTransform.js +4 -1
  5. package/dist/commands/build/buildBackend.cjs.js +65 -0
  6. package/dist/commands/build/buildFrontend.cjs.js +56 -0
  7. package/dist/commands/build/command.cjs.js +72 -0
  8. package/dist/commands/build/index.cjs.js +8 -0
  9. package/dist/commands/buildWorkspace.cjs.js +24 -0
  10. package/dist/commands/clean/clean.cjs.js +19 -0
  11. package/dist/{cjs/docs-CDE82fWG.cjs.js → commands/config/docs.cjs.js} +4 -12
  12. package/dist/{cjs/print-BX8-7Nzg.cjs.js → commands/config/print.cjs.js} +4 -12
  13. package/dist/{cjs/schema-Cabm6I6c.cjs.js → commands/config/schema.cjs.js} +4 -12
  14. package/dist/commands/config/validate.cjs.js +19 -0
  15. package/dist/{cjs/index-DVDDx3pk.cjs.js → commands/create-github-app/GithubCreateAppServer.cjs.js} +2 -110
  16. package/dist/commands/create-github-app/index.cjs.js +117 -0
  17. package/dist/commands/index.cjs.js +231 -0
  18. package/dist/{cjs/info-CB7ln5K_.cjs.js → commands/info.cjs.js} +13 -17
  19. package/dist/{cjs/lint-6_0f9f26.cjs.js → commands/lint.cjs.js} +10 -10
  20. package/dist/commands/migrate/packageExports.cjs.js +17 -0
  21. package/dist/{cjs/packageLintConfigs-BBvQehRd.cjs.js → commands/migrate/packageLintConfigs.cjs.js} +2 -10
  22. package/dist/{cjs/packageRole-CkpKfhJA.cjs.js → commands/migrate/packageRole.cjs.js} +5 -8
  23. package/dist/{cjs/packageScripts-DX6dilK6.cjs.js → commands/migrate/packageScripts.cjs.js} +1 -1
  24. package/dist/{cjs/reactRouterDeps-CR-hjviw.cjs.js → commands/migrate/reactRouterDeps.cjs.js} +1 -1
  25. package/dist/commands/new/new.cjs.js +101 -0
  26. package/dist/commands/pack.cjs.js +29 -0
  27. package/dist/commands/repo/build.cjs.js +113 -0
  28. package/dist/{cjs/clean-bdpRw-oZ.cjs.js → commands/repo/clean.cjs.js} +5 -10
  29. package/dist/{cjs/fix-BTjof5XT.cjs.js → commands/repo/fix.cjs.js} +8 -13
  30. package/dist/commands/repo/lint.cjs.js +193 -0
  31. package/dist/{cjs/list-deprecations-DFgQENam.cjs.js → commands/repo/list-deprecations.cjs.js} +7 -12
  32. package/dist/commands/repo/optionsParser.cjs.js +37 -0
  33. package/dist/commands/repo/test.cjs.js +274 -0
  34. package/dist/commands/start/command.cjs.js +48 -0
  35. package/dist/commands/start/index.cjs.js +8 -0
  36. package/dist/commands/start/startBackend.cjs.js +112 -0
  37. package/dist/commands/start/startFrontend.cjs.js +47 -0
  38. package/dist/{cjs/test-YJMOGqXG.cjs.js → commands/test.cjs.js} +6 -12
  39. package/dist/{cjs/bump-d9dS56p9.cjs.js → commands/versions/bump.cjs.js} +21 -190
  40. package/dist/commands/versions/migrate.cjs.js +112 -0
  41. package/dist/index.cjs.js +29 -7
  42. package/dist/lib/builder/config.cjs.js +199 -0
  43. package/dist/lib/builder/packager.cjs.js +131 -0
  44. package/dist/lib/builder/plugins.cjs.js +71 -0
  45. package/dist/lib/builder/types.cjs.js +11 -0
  46. package/dist/lib/bundler/LinkedPackageResolvePlugin.cjs.js +47 -0
  47. package/dist/lib/bundler/backend.cjs.js +36 -0
  48. package/dist/{cjs/buildBackend-DXvz7jvh.cjs.js → lib/bundler/bundle.cjs.js} +26 -113
  49. package/dist/lib/bundler/config.cjs.js +469 -0
  50. package/dist/lib/bundler/hasReactDomClient.cjs.js +13 -0
  51. package/dist/lib/bundler/moduleFederation.cjs.js +28 -0
  52. package/dist/lib/bundler/optimization.cjs.js +63 -0
  53. package/dist/lib/bundler/packageDetection.cjs.js +117 -0
  54. package/dist/lib/bundler/paths.cjs.js +60 -0
  55. package/dist/lib/bundler/server.cjs.js +246 -0
  56. package/dist/lib/bundler/transforms.cjs.js +171 -0
  57. package/dist/lib/codeowners/codeowners.cjs.js +92 -0
  58. package/dist/{cjs/config-nCB2LQK-.cjs.js → lib/config.cjs.js} +6 -6
  59. package/dist/{cjs/entryPoints-CoHH4lBA.cjs.js → lib/entryPoints.cjs.js} +4 -1
  60. package/dist/lib/errors.cjs.js +45 -0
  61. package/dist/lib/experimental/IpcServer.cjs.js +60 -0
  62. package/dist/lib/experimental/ServerDataStore.cjs.js +36 -0
  63. package/dist/lib/experimental/startBackendExperimental.cjs.js +128 -0
  64. package/dist/lib/new/FactoryRegistry.cjs.js +96 -0
  65. package/dist/lib/new/factories/backendModule.cjs.js +82 -0
  66. package/dist/lib/new/factories/backendPlugin.cjs.js +78 -0
  67. package/dist/lib/new/factories/common/prompts.cjs.js +57 -0
  68. package/dist/lib/new/factories/common/tasks.cjs.js +66 -0
  69. package/dist/lib/new/factories/common/util.cjs.js +16 -0
  70. package/dist/lib/new/factories/frontendPlugin.cjs.js +107 -0
  71. package/dist/lib/new/factories/index.cjs.js +24 -0
  72. package/dist/lib/new/factories/nodeLibraryPackage.cjs.js +57 -0
  73. package/dist/lib/new/factories/pluginCommon.cjs.js +58 -0
  74. package/dist/lib/new/factories/pluginNode.cjs.js +58 -0
  75. package/dist/lib/new/factories/pluginWeb.cjs.js +58 -0
  76. package/dist/lib/new/factories/scaffolderModule.cjs.js +90 -0
  77. package/dist/lib/new/factories/webLibraryPackage.cjs.js +57 -0
  78. package/dist/lib/new/types.cjs.js +8 -0
  79. package/dist/lib/packager/createDistWorkspace.cjs.js +219 -0
  80. package/dist/{cjs/productionPack-Dfl28j3c.cjs.js → lib/packager/productionPack.cjs.js} +8 -96
  81. package/dist/{cjs/parallel-BszNaKyc.cjs.js → lib/parallel.cjs.js} +2 -1
  82. package/dist/lib/paths.cjs.js +8 -0
  83. package/dist/{cjs/publishing-DQtsKTbc.cjs.js → lib/publishing.cjs.js} +1 -1
  84. package/dist/{cjs/role-e0emQj8q.cjs.js → lib/role.cjs.js} +3 -3
  85. package/dist/{cjs/run-HW3lfDbM.cjs.js → lib/run.cjs.js} +6 -5
  86. package/dist/{cjs/svgrTemplate-BTjBQ3by.cjs.js → lib/svgrTemplate.cjs.js} +1 -1
  87. package/dist/lib/tasks.cjs.js +188 -0
  88. package/dist/lib/typeDistProject.cjs.js +94 -0
  89. package/dist/lib/urls.cjs.js +13 -0
  90. package/dist/lib/version.cjs.js +86 -0
  91. package/dist/{cjs/yarn-6FNAgNBK.cjs.js → lib/versioning/Lockfile.cjs.js} +1 -31
  92. package/dist/lib/versioning/packages.cjs.js +75 -0
  93. package/dist/lib/yarn.cjs.js +34 -0
  94. package/dist/packages/backend-defaults/package.json.cjs.js +6 -0
  95. package/dist/packages/backend-plugin-api/package.json.cjs.js +6 -0
  96. package/dist/packages/backend-test-utils/package.json.cjs.js +6 -0
  97. package/dist/packages/cli/package.json.cjs.js +159 -0
  98. package/dist/packages/config/package.json.cjs.js +6 -0
  99. package/dist/packages/core-app-api/package.json.cjs.js +6 -0
  100. package/dist/packages/core-components/package.json.cjs.js +6 -0
  101. package/dist/packages/core-plugin-api/package.json.cjs.js +6 -0
  102. package/dist/packages/dev-utils/package.json.cjs.js +6 -0
  103. package/dist/packages/test-utils/package.json.cjs.js +6 -0
  104. package/dist/packages/theme/package.json.cjs.js +6 -0
  105. package/dist/plugins/auth-backend/package.json.cjs.js +6 -0
  106. package/dist/plugins/auth-backend-module-guest-provider/package.json.cjs.js +6 -0
  107. package/dist/plugins/scaffolder-node/package.json.cjs.js +6 -0
  108. package/package.json +23 -23
  109. package/dist/cjs/build-gNEKjjhr.cjs.js +0 -194
  110. package/dist/cjs/buildWorkspace-DLfI3EjD.cjs.js +0 -53
  111. package/dist/cjs/clean-Dpgqc3P2.cjs.js +0 -22
  112. package/dist/cjs/createDistWorkspace-DKzy-L-f.cjs.js +0 -576
  113. package/dist/cjs/index-7LxfekFu.cjs.js +0 -625
  114. package/dist/cjs/index-DsP5wbju.cjs.js +0 -131
  115. package/dist/cjs/index-v57xnvgT.cjs.js +0 -520
  116. package/dist/cjs/lint-DYO_SeK3.cjs.js +0 -91
  117. package/dist/cjs/moduleFederation-Dq0n1quT.cjs.js +0 -910
  118. package/dist/cjs/new-C0D_k25O.cjs.js +0 -1043
  119. package/dist/cjs/pack-D8AK7Uem.cjs.js +0 -34
  120. package/dist/cjs/packageExports-bg4mFuFZ.cjs.js +0 -27
  121. package/dist/cjs/test-5bQM0VRL.cjs.js +0 -126
  122. package/dist/cjs/validate-DKBlShmI.cjs.js +0 -28
  123. /package/templates/default-backend-module/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  124. /package/templates/default-backend-plugin/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  125. /package/templates/default-common-plugin-package/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  126. /package/templates/default-node-plugin-package/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  127. /package/templates/default-plugin/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  128. /package/templates/default-react-plugin-package/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  129. /package/templates/node-library-package/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  130. /package/templates/scaffolder-module/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
  131. /package/templates/web-library-package/{.eslintrc.js → .eslintrc.js.hbs} +0 -0
@@ -1,131 +0,0 @@
1
- 'use strict';
2
-
3
- var createDistWorkspace = require('./createDistWorkspace-DKzy-L-f.cjs.js');
4
- var role = require('./role-e0emQj8q.cjs.js');
5
- var cliNode = require('@backstage/cli-node');
6
- var index = require('./index-v57xnvgT.cjs.js');
7
- var buildBackend = require('./buildBackend-DXvz7jvh.cjs.js');
8
- var chalk = require('chalk');
9
- require('fs-extra');
10
- require('path');
11
- require('p-limit');
12
- require('os');
13
- require('tar');
14
- require('lodash/partition');
15
- require('./run-HW3lfDbM.cjs.js');
16
- require('child_process');
17
- require('util');
18
- require('@backstage/errors');
19
- require('rollup');
20
- require('@rollup/plugin-commonjs');
21
- require('@rollup/plugin-node-resolve');
22
- require('rollup-plugin-postcss');
23
- require('rollup-plugin-esbuild');
24
- require('@svgr/rollup');
25
- require('rollup-plugin-dts');
26
- require('@rollup/plugin-json');
27
- require('@rollup/plugin-yaml');
28
- require('rollup-pluginutils');
29
- require('./svgrTemplate-BTjBQ3by.cjs.js');
30
- require('./entryPoints-CoHH4lBA.cjs.js');
31
- require('./parallel-BszNaKyc.cjs.js');
32
- require('worker_threads');
33
- require('./productionPack-Dfl28j3c.cjs.js');
34
- require('npm-packlist');
35
- require('ts-morph');
36
- require('commander');
37
- require('semver');
38
- require('@backstage/cli-common');
39
- require('webpack');
40
- require('eslint-webpack-plugin');
41
- require('fork-ts-checker-webpack-plugin');
42
- require('html-webpack-plugin');
43
- require('@module-federation/enhanced/webpack');
44
- require('react-dev-utils/ModuleScopePlugin');
45
- require('run-script-webpack-plugin');
46
- require('@pmmmwh/react-refresh-webpack-plugin');
47
- require('@manypkg/get-packages');
48
- require('webpack-node-externals');
49
- require('./moduleFederation-Dq0n1quT.cjs.js');
50
- require('lodash/pickBy');
51
- require('mini-css-extract-plugin');
52
- require('yn');
53
- require('@backstage/config');
54
- require('chokidar');
55
- require('p-queue');
56
- require('react-dev-utils/FileSizeReporter');
57
- require('react-dev-utils/formatWebpackMessages');
58
- require('react-dev-utils/openBrowser');
59
- require('webpack-dev-server');
60
- require('./config-nCB2LQK-.cjs.js');
61
- require('@backstage/config-loader');
62
-
63
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
64
-
65
- var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
66
-
67
- function isValidUrl(url) {
68
- try {
69
- new URL(url);
70
- return true;
71
- } catch {
72
- return false;
73
- }
74
- }
75
-
76
- async function command(opts) {
77
- const role$1 = await role.findRoleFromCommand(opts);
78
- if (role$1 === "frontend" || role$1 === "backend") {
79
- const configPaths = opts.config.map((arg) => {
80
- if (isValidUrl(arg)) {
81
- return arg;
82
- }
83
- return index.paths.resolveTarget(arg);
84
- });
85
- if (role$1 === "frontend") {
86
- return buildBackend.buildFrontend({
87
- targetDir: index.paths.targetDir,
88
- configPaths,
89
- writeStats: Boolean(opts.stats)
90
- });
91
- }
92
- return buildBackend.buildBackend({
93
- targetDir: index.paths.targetDir,
94
- configPaths,
95
- skipBuildDependencies: Boolean(opts.skipBuildDependencies),
96
- minify: Boolean(opts.minify)
97
- });
98
- }
99
- if (role$1 === "frontend-dynamic-container") {
100
- console.log(
101
- chalk__default.default.yellow(
102
- `\u26A0\uFE0F WARNING: The 'frontend-dynamic-container' package role is experimental and will receive immediate breaking changes in the future.`
103
- )
104
- );
105
- return buildBackend.buildFrontend({
106
- targetDir: index.paths.targetDir,
107
- configPaths: [],
108
- writeStats: Boolean(opts.stats),
109
- isModuleFederationRemote: true
110
- });
111
- }
112
- const roleInfo = cliNode.PackageRoles.getRoleInfo(role$1);
113
- const outputs = /* @__PURE__ */ new Set();
114
- if (roleInfo.output.includes("cjs")) {
115
- outputs.add(createDistWorkspace.Output.cjs);
116
- }
117
- if (roleInfo.output.includes("esm")) {
118
- outputs.add(createDistWorkspace.Output.esm);
119
- }
120
- if (roleInfo.output.includes("types")) {
121
- outputs.add(createDistWorkspace.Output.types);
122
- }
123
- return createDistWorkspace.buildPackage({
124
- outputs,
125
- minify: Boolean(opts.minify),
126
- workspacePackages: await cliNode.PackageGraph.listTargetPackages()
127
- });
128
- }
129
-
130
- exports.command = command;
131
- //# sourceMappingURL=index-DsP5wbju.cjs.js.map
@@ -1,520 +0,0 @@
1
- 'use strict';
2
-
3
- var commander = require('commander');
4
- var chalk = require('chalk');
5
- var fs = require('fs-extra');
6
- var semver = require('semver');
7
- var cliCommon = require('@backstage/cli-common');
8
- var errors = require('@backstage/errors');
9
-
10
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
-
12
- var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
13
- var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
14
- var semver__default = /*#__PURE__*/_interopDefaultCompat(semver);
15
-
16
- class CustomError extends Error {
17
- get name() {
18
- return this.constructor.name;
19
- }
20
- }
21
- class ExitCodeError extends CustomError {
22
- code;
23
- constructor(code, command) {
24
- super(
25
- command ? `Command '${command}' exited with code ${code}` : `Child exited with code ${code}`
26
- );
27
- this.code = code;
28
- }
29
- }
30
- function exitWithError(error) {
31
- if (error instanceof ExitCodeError) {
32
- process.stderr.write(`
33
- ${chalk__default.default.red(error.message)}
34
-
35
- `);
36
- process.exit(error.code);
37
- } else {
38
- process.stderr.write(`
39
- ${chalk__default.default.red(`${error}`)}
40
-
41
- `);
42
- process.exit(1);
43
- }
44
- }
45
- class NotFoundError extends CustomError {
46
- }
47
-
48
- const paths = cliCommon.findPaths(__dirname);
49
-
50
- var version$e = "1.0.1-next.0";
51
-
52
- var version$d = "1.0.1-next.0";
53
-
54
- var version$c = "0.28.0-next.0";
55
- var dependencies = {
56
- "@backstage/catalog-model": "workspace:^",
57
- "@backstage/cli-common": "workspace:^",
58
- "@backstage/cli-node": "workspace:^",
59
- "@backstage/config": "workspace:^",
60
- "@backstage/config-loader": "workspace:^",
61
- "@backstage/errors": "workspace:^",
62
- "@backstage/eslint-plugin": "workspace:^",
63
- "@backstage/integration": "workspace:^",
64
- "@backstage/release-manifests": "workspace:^",
65
- "@backstage/types": "workspace:^",
66
- "@manypkg/get-packages": "^1.1.3",
67
- "@module-federation/enhanced": "^0.6.0",
68
- "@octokit/graphql": "^5.0.0",
69
- "@octokit/graphql-schema": "^13.7.0",
70
- "@octokit/oauth-app": "^4.2.0",
71
- "@octokit/request": "^6.0.0",
72
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
73
- "@rollup/plugin-commonjs": "^26.0.0",
74
- "@rollup/plugin-json": "^6.0.0",
75
- "@rollup/plugin-node-resolve": "^15.0.0",
76
- "@rollup/plugin-yaml": "^4.0.0",
77
- "@spotify/eslint-config-base": "^15.0.0",
78
- "@spotify/eslint-config-react": "^15.0.0",
79
- "@spotify/eslint-config-typescript": "^15.0.0",
80
- "@sucrase/webpack-loader": "^2.0.0",
81
- "@svgr/core": "6.5.x",
82
- "@svgr/plugin-jsx": "6.5.x",
83
- "@svgr/plugin-svgo": "6.5.x",
84
- "@svgr/rollup": "6.5.x",
85
- "@svgr/webpack": "6.5.x",
86
- "@swc/core": "^1.3.46",
87
- "@swc/helpers": "^0.5.0",
88
- "@swc/jest": "^0.2.22",
89
- "@types/jest": "^29.5.11",
90
- "@types/webpack-env": "^1.15.2",
91
- "@typescript-eslint/eslint-plugin": "^6.12.0",
92
- "@typescript-eslint/parser": "^6.7.2",
93
- "@yarnpkg/lockfile": "^1.1.0",
94
- "@yarnpkg/parsers": "^3.0.0",
95
- bfj: "^8.0.0",
96
- buffer: "^6.0.3",
97
- chalk: "^4.0.0",
98
- chokidar: "^3.3.1",
99
- commander: "^12.0.0",
100
- "cross-fetch": "^4.0.0",
101
- "cross-spawn": "^7.0.3",
102
- "css-loader": "^6.5.1",
103
- "ctrlc-windows": "^2.1.0",
104
- diff: "^5.0.0",
105
- esbuild: "^0.23.0",
106
- "esbuild-loader": "^4.0.0",
107
- eslint: "^8.6.0",
108
- "eslint-config-prettier": "^9.0.0",
109
- "eslint-formatter-friendly": "^7.0.0",
110
- "eslint-plugin-deprecation": "^2.0.0",
111
- "eslint-plugin-import": "^2.25.4",
112
- "eslint-plugin-jest": "^28.0.0",
113
- "eslint-plugin-jsx-a11y": "^6.5.1",
114
- "eslint-plugin-react": "^7.28.0",
115
- "eslint-plugin-react-hooks": "^4.3.0",
116
- "eslint-plugin-unused-imports": "^3.0.0",
117
- "eslint-webpack-plugin": "^4.0.0",
118
- express: "^4.17.1",
119
- "fork-ts-checker-webpack-plugin": "^9.0.0",
120
- "fs-extra": "^11.2.0",
121
- "git-url-parse": "^14.0.0",
122
- glob: "^7.1.7",
123
- "global-agent": "^3.0.0",
124
- handlebars: "^4.7.3",
125
- "html-webpack-plugin": "^5.3.1",
126
- inquirer: "^8.2.0",
127
- jest: "^29.7.0",
128
- "jest-css-modules": "^2.1.0",
129
- "jest-environment-jsdom": "^29.0.2",
130
- "jest-runtime": "^29.0.2",
131
- "json-schema": "^0.4.0",
132
- lodash: "^4.17.21",
133
- "mini-css-extract-plugin": "^2.4.2",
134
- minimatch: "^9.0.0",
135
- "node-fetch": "^2.7.0",
136
- "node-libs-browser": "^2.2.1",
137
- "npm-packlist": "^5.0.0",
138
- ora: "^5.3.0",
139
- "p-limit": "^3.1.0",
140
- "p-queue": "^6.6.2",
141
- pirates: "^4.0.6",
142
- postcss: "^8.1.0",
143
- process: "^0.11.10",
144
- "raw-loader": "^4.0.2",
145
- "react-dev-utils": "^12.0.0-next.60",
146
- "react-refresh": "^0.14.0",
147
- "recursive-readdir": "^2.2.2",
148
- "replace-in-file": "^7.1.0",
149
- rollup: "^4.0.0",
150
- "rollup-plugin-dts": "^6.1.0",
151
- "rollup-plugin-esbuild": "^6.1.1",
152
- "rollup-plugin-postcss": "^4.0.0",
153
- "rollup-pluginutils": "^2.8.2",
154
- "run-script-webpack-plugin": "^0.2.0",
155
- semver: "^7.5.3",
156
- "style-loader": "^3.3.1",
157
- sucrase: "^3.20.2",
158
- "swc-loader": "^0.2.3",
159
- tar: "^6.1.12",
160
- "terser-webpack-plugin": "^5.1.3",
161
- "ts-morph": "^23.0.0",
162
- util: "^0.12.3",
163
- webpack: "^5.70.0",
164
- "webpack-dev-server": "^5.0.0",
165
- "webpack-node-externals": "^3.0.0",
166
- yaml: "^2.0.0",
167
- "yml-loader": "^2.1.0",
168
- yn: "^4.0.0",
169
- zod: "^3.22.4"
170
- };
171
- var devDependencies = {
172
- "@backstage/backend-common": "^0.25.0",
173
- "@backstage/backend-plugin-api": "workspace:^",
174
- "@backstage/backend-test-utils": "workspace:^",
175
- "@backstage/config": "workspace:^",
176
- "@backstage/core-app-api": "workspace:^",
177
- "@backstage/core-components": "workspace:^",
178
- "@backstage/core-plugin-api": "workspace:^",
179
- "@backstage/dev-utils": "workspace:^",
180
- "@backstage/test-utils": "workspace:^",
181
- "@backstage/theme": "workspace:^",
182
- "@types/cross-spawn": "^6.0.2",
183
- "@types/diff": "^5.0.0",
184
- "@types/ejs": "^3.1.3",
185
- "@types/express": "^4.17.6",
186
- "@types/fs-extra": "^11.0.0",
187
- "@types/http-proxy": "^1.17.4",
188
- "@types/inquirer": "^8.1.3",
189
- "@types/node": "^18.17.8",
190
- "@types/npm-packlist": "^3.0.0",
191
- "@types/recursive-readdir": "^2.2.0",
192
- "@types/rollup-plugin-peer-deps-external": "^2.2.0",
193
- "@types/rollup-plugin-postcss": "^3.1.4",
194
- "@types/svgo": "^2.6.2",
195
- "@types/tar": "^6.1.1",
196
- "@types/terser-webpack-plugin": "^5.0.4",
197
- "@types/yarnpkg__lockfile": "^1.1.4",
198
- "@vitejs/plugin-react": "^4.3.1",
199
- del: "^7.0.0",
200
- msw: "^1.0.0",
201
- nodemon: "^3.0.1",
202
- vite: "^5.0.0",
203
- "vite-plugin-html": "^3.2.2",
204
- "vite-plugin-node-polyfills": "^0.22.0"
205
- };
206
-
207
- var version$b = "1.2.0";
208
-
209
- var version$a = "1.15.1-next.0";
210
-
211
- var version$9 = "0.15.1-next.0";
212
-
213
- var version$8 = "1.10.0-next.0";
214
-
215
- var version$7 = "1.1.1-next.0";
216
-
217
- var version$6 = "1.6.1-next.0";
218
-
219
- var version$5 = "0.5.0-next.0";
220
-
221
- var version$4 = "0.23.1-next.0";
222
-
223
- var version$3 = "0.2.1-next.0";
224
-
225
- var version$2 = "0.5.7";
226
-
227
- var version$1 = "0.5.1-next.0";
228
-
229
- const packageVersions = {
230
- "@backstage/backend-defaults": version$1,
231
- "@backstage/backend-plugin-api": version$e,
232
- "@backstage/backend-test-utils": version$d,
233
- "@backstage/cli": version$c,
234
- "@backstage/config": version$b,
235
- "@backstage/core-app-api": version$a,
236
- "@backstage/core-components": version$9,
237
- "@backstage/core-plugin-api": version$8,
238
- "@backstage/dev-utils": version$7,
239
- "@backstage/test-utils": version$6,
240
- "@backstage/theme": version$2,
241
- "@backstage/plugin-scaffolder-node": version$5,
242
- "@backstage/plugin-auth-backend": version$4,
243
- "@backstage/plugin-auth-backend-module-guest-provider": version$3
244
- };
245
- function findVersion() {
246
- const pkgContent = fs__default.default.readFileSync(paths.resolveOwn("package.json"), "utf8");
247
- return JSON.parse(pkgContent).version;
248
- }
249
- const version = findVersion();
250
- fs__default.default.pathExistsSync(paths.resolveOwn("src"));
251
- function createPackageVersionProvider(lockfile) {
252
- return (name, versionHint) => {
253
- const packageVersion = packageVersions[name];
254
- const targetVersion = versionHint || packageVersion;
255
- if (!targetVersion) {
256
- throw new Error(`No version available for package ${name}`);
257
- }
258
- const lockfileEntries = lockfile?.get(name);
259
- if (name.startsWith("@types/") && lockfileEntries?.some((entry) => entry.range === "*")) {
260
- return "*";
261
- }
262
- for (const specifier of ["^", "~", "*"]) {
263
- const range = `workspace:${specifier}`;
264
- if (lockfileEntries?.some((entry) => entry.range === range)) {
265
- return range;
266
- }
267
- }
268
- const validRanges = lockfileEntries?.filter(
269
- (entry) => semver__default.default.satisfies(targetVersion, entry.range)
270
- );
271
- const highestRange = validRanges?.slice(-1)[0];
272
- if (highestRange?.range) {
273
- return highestRange?.range;
274
- }
275
- if (packageVersion) {
276
- return `^${packageVersion}`;
277
- }
278
- if (semver__default.default.parse(versionHint)?.prerelease.length) {
279
- return versionHint;
280
- }
281
- return versionHint?.match(/^[\d\.]+$/) ? `^${versionHint}` : versionHint;
282
- };
283
- }
284
-
285
- const configOption = [
286
- "--config <path>",
287
- "Config files to load instead of app-config.yaml",
288
- (opt, opts) => opts ? [...opts, opt] : [opt],
289
- Array()
290
- ];
291
- function registerRepoCommand(program) {
292
- const command = program.command("repo [command]").description("Command that run across an entire Backstage project");
293
- command.command("build").description(
294
- "Build packages in the project, excluding bundled app and backend packages."
295
- ).option(
296
- "--all",
297
- "Build all packages, including bundled app and backend packages."
298
- ).option(
299
- "--since <ref>",
300
- "Only build packages and their dev dependents that changed since the specified ref"
301
- ).option(
302
- "--minify",
303
- "Minify the generated code. Does not apply to app package (app is minified by default)."
304
- ).action(lazy(() => Promise.resolve().then(function () { return require('./build-gNEKjjhr.cjs.js'); }).then((m) => m.command)));
305
- command.command("lint").description("Lint all packages in the project").option(
306
- "--format <format>",
307
- "Lint report output format",
308
- "eslint-formatter-friendly"
309
- ).option(
310
- "--since <ref>",
311
- "Only lint packages that changed since the specified ref"
312
- ).option("--fix", "Attempt to automatically fix violations").action(lazy(() => Promise.resolve().then(function () { return require('./lint-DYO_SeK3.cjs.js'); }).then((m) => m.command)));
313
- command.command("fix").description("Automatically fix packages in the project").option(
314
- "--publish",
315
- "Enable additional fixes that only apply when publishing packages"
316
- ).option(
317
- "--check",
318
- "Fail if any packages would have been changed by the command"
319
- ).action(lazy(() => Promise.resolve().then(function () { return require('./fix-BTjof5XT.cjs.js'); }).then((m) => m.command)));
320
- command.command("clean").description("Delete cache and output directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-bdpRw-oZ.cjs.js'); }).then((m) => m.command)));
321
- command.command("list-deprecations").description("List deprecations").option("--json", "Output as JSON").action(
322
- lazy(() => Promise.resolve().then(function () { return require('./list-deprecations-DFgQENam.cjs.js'); }).then((m) => m.command))
323
- );
324
- command.command("test").allowUnknownOption(true).option(
325
- "--since <ref>",
326
- "Only test packages that changed since the specified ref"
327
- ).option(
328
- "--jest-help",
329
- "Show help for Jest CLI options, which are passed through"
330
- ).description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./test-5bQM0VRL.cjs.js'); }).then((m) => m.command)));
331
- }
332
- function registerScriptCommand(program) {
333
- const command = program.command("package [command]").description("Lifecycle scripts for individual packages");
334
- command.command("start").description("Start a package for local development").option(...configOption).option("--role <name>", "Run the command with an explicit package role").option("--check", "Enable type checking and linting if available").option("--inspect [host]", "Enable debugger in Node.js environments").option(
335
- "--inspect-brk [host]",
336
- "Enable debugger in Node.js environments, breaking before code starts"
337
- ).option("--require <path>", "Add a --require argument to the node process").action(lazy(() => Promise.resolve().then(function () { return require('./index-7LxfekFu.cjs.js'); }).then((m) => m.command)));
338
- command.command("build").description("Build a package for production deployment or publishing").option("--role <name>", "Run the command with an explicit package role").option(
339
- "--minify",
340
- "Minify the generated code. Does not apply to app package (app is minified by default)."
341
- ).option(
342
- "--skip-build-dependencies",
343
- "Skip the automatic building of local dependencies. Applies to backend packages only."
344
- ).option(
345
- "--stats",
346
- "If bundle stats are available, write them to the output directory. Applies to app packages only."
347
- ).option(
348
- "--config <path>",
349
- "Config files to load instead of app-config.yaml. Applies to app packages only.",
350
- (opt, opts) => opts ? [...opts, opt] : [opt],
351
- Array()
352
- ).action(lazy(() => Promise.resolve().then(function () { return require('./index-DsP5wbju.cjs.js'); }).then((m) => m.command)));
353
- command.command("lint [directories...]").option(
354
- "--format <format>",
355
- "Lint report output format",
356
- "eslint-formatter-friendly"
357
- ).option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-6_0f9f26.cjs.js'); }).then((m) => m.default)));
358
- command.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./test-YJMOGqXG.cjs.js'); }).then((m) => m.default)));
359
- command.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-Dpgqc3P2.cjs.js'); }).then((m) => m.default)));
360
- command.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-D8AK7Uem.cjs.js'); }).then((m) => m.pre)));
361
- command.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-D8AK7Uem.cjs.js'); }).then((m) => m.post)));
362
- }
363
- function registerMigrateCommand(program) {
364
- const command = program.command("migrate [command]").description("Migration utilities");
365
- command.command("package-roles").description(`Add package role field to packages that don't have it`).action(lazy(() => Promise.resolve().then(function () { return require('./packageRole-CkpKfhJA.cjs.js'); }).then((m) => m.default)));
366
- command.command("package-scripts").description("Set package scripts according to each package role").action(
367
- lazy(() => Promise.resolve().then(function () { return require('./packageScripts-DX6dilK6.cjs.js'); }).then((m) => m.command))
368
- );
369
- command.command("package-exports").description("Synchronize package subpath export definitions").action(
370
- lazy(() => Promise.resolve().then(function () { return require('./packageExports-bg4mFuFZ.cjs.js'); }).then((m) => m.command))
371
- );
372
- command.command("package-lint-configs").description(
373
- "Migrates all packages to use @backstage/cli/config/eslint-factory"
374
- ).action(
375
- lazy(() => Promise.resolve().then(function () { return require('./packageLintConfigs-BBvQehRd.cjs.js'); }).then((m) => m.command))
376
- );
377
- command.command("react-router-deps").description(
378
- "Migrates the react-router dependencies for all packages to be peer dependencies"
379
- ).action(
380
- lazy(() => Promise.resolve().then(function () { return require('./reactRouterDeps-CR-hjviw.cjs.js'); }).then((m) => m.command))
381
- );
382
- }
383
- function registerCommands(program) {
384
- program.command("new").storeOptionsAsProperties(false).description(
385
- "Open up an interactive guide to creating new things in your app"
386
- ).option(
387
- "--select <name>",
388
- "Select the thing you want to be creating upfront"
389
- ).option(
390
- "--option <name>=<value>",
391
- "Pre-fill options for the creation process",
392
- (opt, arr) => [...arr, opt],
393
- []
394
- ).option("--scope <scope>", "The scope to use for new packages").option(
395
- "--npm-registry <URL>",
396
- "The package registry to use for new packages"
397
- ).option(
398
- "--baseVersion <version>",
399
- "The version to use for any new packages (default: 0.1.0)"
400
- ).option(
401
- "--license <license>",
402
- "The license to use for any new packages (default: Apache-2.0)"
403
- ).option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./new-C0D_k25O.cjs.js'); }).then((m) => m.default)));
404
- program.command("config:docs").option(
405
- "--package <name>",
406
- "Only include the schema that applies to the given package"
407
- ).description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-CDE82fWG.cjs.js'); }).then((m) => m.default)));
408
- program.command("config:print").option(
409
- "--package <name>",
410
- "Only load config schema that applies to the given package"
411
- ).option("--lax", "Do not require environment variables to be set").option("--frontend", "Print only the frontend configuration").option("--with-secrets", "Include secrets in the printed configuration").option(
412
- "--format <format>",
413
- "Format to print the configuration in, either json or yaml [yaml]"
414
- ).option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-BX8-7Nzg.cjs.js'); }).then((m) => m.default)));
415
- program.command("config:check").option(
416
- "--package <name>",
417
- "Only load config schema that applies to the given package"
418
- ).option("--lax", "Do not require environment variables to be set").option("--frontend", "Only validate the frontend configuration").option("--deprecated", "Output deprecated configuration settings").option(
419
- "--strict",
420
- "Enable strict config validation, forbidding errors and unknown keys"
421
- ).option(...configOption).description(
422
- "Validate that the given configuration loads and matches schema"
423
- ).action(lazy(() => Promise.resolve().then(function () { return require('./validate-DKBlShmI.cjs.js'); }).then((m) => m.default)));
424
- program.command("config:schema").option(
425
- "--package <name>",
426
- "Only output config schema that applies to the given package"
427
- ).option(
428
- "--format <format>",
429
- "Format to print the schema in, either json or yaml [yaml]"
430
- ).option("--merge", "Print the config schemas merged", true).option("--no-merge", "Print the config schemas not merged").description("Print configuration schema").action(lazy(() => Promise.resolve().then(function () { return require('./schema-Cabm6I6c.cjs.js'); }).then((m) => m.default)));
431
- registerRepoCommand(program);
432
- registerScriptCommand(program);
433
- registerMigrateCommand(program);
434
- program.command("versions:bump").option(
435
- "--pattern <glob>",
436
- "Override glob for matching packages to upgrade"
437
- ).option(
438
- "--release <version|next|main>",
439
- "Bump to a specific Backstage release line or version",
440
- "main"
441
- ).option("--skip-install", "Skips yarn install step").option("--skip-migrate", "Skips migration of any moved packages").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-d9dS56p9.cjs.js'); }).then(function (n) { return n.bump; }).then((m) => m.default)));
442
- program.command("versions:migrate").option(
443
- "--pattern <glob>",
444
- "Override glob for matching packages to upgrade"
445
- ).option(
446
- "--skip-code-changes",
447
- "Skip code changes and only update package.json files"
448
- ).description(
449
- "Migrate any plugins that have been moved to the @backstage-community namespace automatically"
450
- ).action(lazy(() => Promise.resolve().then(function () { return require('./bump-d9dS56p9.cjs.js'); }).then(function (n) { return n.migrate; }).then((m) => m.default)));
451
- program.command("build-workspace <workspace-dir> [packages...]").option(
452
- "--alwaysYarnPack",
453
- "Force workspace output to be a result of running `yarn pack` on each package (warning: very slow)"
454
- ).description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-DLfI3EjD.cjs.js'); }).then((m) => m.default)));
455
- program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-DVDDx3pk.cjs.js'); }).then((m) => m.default)));
456
- program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-CB7ln5K_.cjs.js'); }).then((m) => m.default)));
457
- program.command("create").allowUnknownOption(true).action(removed("use 'backstage-cli new' instead"));
458
- program.command("create-plugin").allowUnknownOption(true).action(removed("use 'backstage-cli new' instead"));
459
- program.command("plugin:diff").allowUnknownOption(true).action(removed("use 'backstage-cli fix' instead"));
460
- program.command("test").allowUnknownOption(true).action(
461
- removed(
462
- "use 'backstage-cli repo test' or 'backstage-cli package test' instead"
463
- )
464
- );
465
- program.command("clean").allowUnknownOption(true).action(removed("use 'backstage-cli package clean' instead"));
466
- program.command("versions:check").allowUnknownOption(true).action(removed("use 'yarn dedupe' or 'yarn-deduplicate' instead"));
467
- program.command("install").allowUnknownOption(true).action(removed());
468
- program.command("onboard").allowUnknownOption(true).action(removed());
469
- }
470
- function removed(message) {
471
- return () => {
472
- console.error(
473
- message ? `This command has been removed, ${message}` : "This command has been removed"
474
- );
475
- process.exit(1);
476
- };
477
- }
478
- function lazy(getActionFunc) {
479
- return async (...args) => {
480
- try {
481
- const actionFunc = await getActionFunc();
482
- await actionFunc(...args);
483
- process.exit(0);
484
- } catch (error) {
485
- errors.assertError(error);
486
- exitWithError(error);
487
- }
488
- };
489
- }
490
-
491
- const main = (argv) => {
492
- commander.program.name("backstage-cli").version(version);
493
- registerCommands(commander.program);
494
- commander.program.on("command:*", () => {
495
- console.log();
496
- console.log(chalk__default.default.red(`Invalid command: ${commander.program.args.join(" ")}`));
497
- console.log();
498
- commander.program.outputHelp();
499
- process.exit(1);
500
- });
501
- commander.program.parse(argv);
502
- };
503
- process.on("unhandledRejection", (rejection) => {
504
- if (rejection instanceof Error) {
505
- exitWithError(rejection);
506
- } else {
507
- exitWithError(new Error(`Unknown rejection: '${rejection}'`));
508
- }
509
- });
510
- main(process.argv);
511
-
512
- exports.ExitCodeError = ExitCodeError;
513
- exports.NotFoundError = NotFoundError;
514
- exports.createPackageVersionProvider = createPackageVersionProvider;
515
- exports.dependencies = dependencies;
516
- exports.devDependencies = devDependencies;
517
- exports.paths = paths;
518
- exports.version = version;
519
- exports.version$1 = version$c;
520
- //# sourceMappingURL=index-v57xnvgT.cjs.js.map