@backstage/cli 0.26.6 → 0.26.7-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/cjs/{Lockfile-C7rtIlD6.cjs.js → Lockfile-BGMdDb8M.cjs.js} +54 -21
  3. package/dist/cjs/{build-BSDLApkE.cjs.js → build-K-pcqX-7.cjs.js} +14 -17
  4. package/dist/cjs/{buildBackend-FV4cZ7YT.cjs.js → buildBackend-DESg_XAV.cjs.js} +8 -10
  5. package/dist/cjs/{buildWorkspace-DV7BpoZT.cjs.js → buildWorkspace-Cl0Fml15.cjs.js} +5 -5
  6. package/dist/cjs/{bump-CjL9wSlI.cjs.js → bump-C9CYCDTD.cjs.js} +16 -21
  7. package/dist/cjs/{clean-Cw1FeJO5.cjs.js → clean-CsvXtbbM.cjs.js} +3 -4
  8. package/dist/cjs/{clean-SL6sMYtJ.cjs.js → clean-xJbA1_MQ.cjs.js} +2 -2
  9. package/dist/cjs/{codeowners-B9Ys_6Yd.cjs.js → codeowners-DmwJdjBf.cjs.js} +2 -2
  10. package/dist/cjs/{config-XS8tRRzZ.cjs.js → config-B_JP0Gbk.cjs.js} +3 -4
  11. package/dist/cjs/{createDistWorkspace-B1pyeDwS.cjs.js → createDistWorkspace-Ccrfo-Bv.cjs.js} +15 -21
  12. package/dist/cjs/{createPlugin-Bf67GaKA.cjs.js → createPlugin-DsRqp_45.cjs.js} +7 -8
  13. package/dist/cjs/{diff-jArODNjZ.cjs.js → diff-CzHvSwdu.cjs.js} +2 -2
  14. package/dist/cjs/{docs-VFbH2gLP.cjs.js → docs-CwoppLTr.cjs.js} +3 -3
  15. package/dist/cjs/{fix-F8xWYiWH.cjs.js → fix-DRJmPWVw.cjs.js} +3 -4
  16. package/dist/cjs/{index-BWsdQbfr.cjs.js → index-4tpfFcd0.cjs.js} +160 -343
  17. package/dist/cjs/{index-DtxQfUmH.cjs.js → index-BBSSy9dx.cjs.js} +9 -9
  18. package/dist/cjs/{index-CS6xQRSZ.cjs.js → index-CABYoOop.cjs.js} +60 -67
  19. package/dist/cjs/{index-ko14Ea3F.cjs.js → index-CFXiU9k7.cjs.js} +38 -44
  20. package/dist/cjs/{index-Wt0qQuCU.cjs.js → index-sgL46Hcr.cjs.js} +29 -62
  21. package/dist/cjs/{info-31wuUeHo.cjs.js → info-1ZqjB4Yh.cjs.js} +5 -6
  22. package/dist/cjs/{install-Bf0Cm4CP.cjs.js → install-CdKSl_Ad.cjs.js} +8 -11
  23. package/dist/cjs/{lint-CeLPKohb.cjs.js → lint-CB_NthPd.cjs.js} +4 -4
  24. package/dist/cjs/{lint-NokSgx6Q.cjs.js → lint-CcLekf2l.cjs.js} +2 -2
  25. package/dist/cjs/{lint-BHZJ9s87.cjs.js → lint-Cfr3Nf8W.cjs.js} +2 -2
  26. package/dist/cjs/{list-deprecations-PCaNouxb.cjs.js → list-deprecations-BohRYhXY.cjs.js} +2 -2
  27. package/dist/cjs/{new-wsaO3CgE.cjs.js → new-arMiMufY.cjs.js} +11 -19
  28. package/dist/cjs/{pack-D65aI1Y5.cjs.js → pack-BbXl8HgZ.cjs.js} +3 -3
  29. package/dist/cjs/{packageDetection-DT09yDE6.cjs.js → packageDetection-DwaARCF2.cjs.js} +15 -21
  30. package/dist/cjs/{packageExports-BQpjmF7V.cjs.js → packageExports-BTQCKtXi.cjs.js} +3 -3
  31. package/dist/cjs/{packageLintConfigs-CtbeLXlD.cjs.js → packageLintConfigs-CLLDzY4E.cjs.js} +4 -5
  32. package/dist/cjs/{packageRole-B-GQB2ZF.cjs.js → packageRole-Bv24SFxi.cjs.js} +2 -2
  33. package/dist/cjs/{packageScripts-CPnlPBBs.cjs.js → packageScripts-DX6dilK6.cjs.js} +10 -11
  34. package/dist/cjs/{packages-BS13eILq.cjs.js → packages-DIejWWRM.cjs.js} +6 -10
  35. package/dist/cjs/{print-B6UB54DH.cjs.js → print-DMJLOORu.cjs.js} +3 -3
  36. package/dist/cjs/{productionPack-DotlEIE2.cjs.js → productionPack-BfVQNApa.cjs.js} +4 -6
  37. package/dist/cjs/{reactRouterDeps-BBKc6o07.cjs.js → reactRouterDeps-CR-hjviw.cjs.js} +2 -3
  38. package/dist/cjs/{role-DTQZhzFJ.cjs.js → role-C3QxOl0c.cjs.js} +3 -4
  39. package/dist/cjs/{run-B3QtsbD6.cjs.js → run-EMLKAvpF.cjs.js} +3 -4
  40. package/dist/cjs/{schema-M5iIZ_Eq.cjs.js → schema-Dg6cnwTS.cjs.js} +3 -3
  41. package/dist/cjs/{tasks-mGXy8WjR.cjs.js → tasks-Dy-6nV0-.cjs.js} +3 -3
  42. package/dist/cjs/{test-BuGhBxNC.cjs.js → test-B-mnTZ_w.cjs.js} +3 -3
  43. package/dist/cjs/{test-Dt0SmBb4.cjs.js → test-DOImiAsd.cjs.js} +3 -3
  44. package/dist/cjs/{validate-2WOv51mB.cjs.js → validate-B53ZW9oJ.cjs.js} +3 -3
  45. package/dist/index.cjs.js +1 -1
  46. package/package.json +10 -10
  47. package/templates/default-backend-plugin/README.md.hbs +1 -1
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var createDistWorkspace = require('./createDistWorkspace-B1pyeDwS.cjs.js');
4
- var role = require('./role-DTQZhzFJ.cjs.js');
3
+ var createDistWorkspace = require('./createDistWorkspace-Ccrfo-Bv.cjs.js');
4
+ var role = require('./role-C3QxOl0c.cjs.js');
5
5
  var cliNode = require('@backstage/cli-node');
6
- var index = require('./index-CS6xQRSZ.cjs.js');
7
- var buildBackend = require('./buildBackend-FV4cZ7YT.cjs.js');
8
- var config = require('./config-XS8tRRzZ.cjs.js');
6
+ var index = require('./index-CABYoOop.cjs.js');
7
+ var buildBackend = require('./buildBackend-DESg_XAV.cjs.js');
8
+ var config = require('./config-B_JP0Gbk.cjs.js');
9
9
  require('chalk');
10
10
  require('fs-extra');
11
11
  require('path');
@@ -13,7 +13,7 @@ require('p-limit');
13
13
  require('os');
14
14
  require('tar');
15
15
  require('lodash/partition');
16
- require('./run-B3QtsbD6.cjs.js');
16
+ require('./run-EMLKAvpF.cjs.js');
17
17
  require('child_process');
18
18
  require('util');
19
19
  require('@backstage/errors');
@@ -31,7 +31,7 @@ require('./svgrTemplate-BTjBQ3by.cjs.js');
31
31
  require('./entryPoints-CoHH4lBA.cjs.js');
32
32
  require('./parallel-BszNaKyc.cjs.js');
33
33
  require('worker_threads');
34
- require('./productionPack-DotlEIE2.cjs.js');
34
+ require('./productionPack-BfVQNApa.cjs.js');
35
35
  require('npm-packlist');
36
36
  require('commander');
37
37
  require('semver');
@@ -44,7 +44,7 @@ require('react-dev-utils/ModuleScopePlugin');
44
44
  require('run-script-webpack-plugin');
45
45
  require('@manypkg/get-packages');
46
46
  require('webpack-node-externals');
47
- require('./packageDetection-DT09yDE6.cjs.js');
47
+ require('./packageDetection-DwaARCF2.cjs.js');
48
48
  require('lodash/pickBy');
49
49
  require('mini-css-extract-plugin');
50
50
  require('@pmmmwh/react-refresh-webpack-plugin');
@@ -104,4 +104,4 @@ async function command(opts) {
104
104
  }
105
105
 
106
106
  exports.command = command;
107
- //# sourceMappingURL=index-DtxQfUmH.cjs.js.map
107
+ //# sourceMappingURL=index-BBSSy9dx.cjs.js.map
@@ -13,23 +13,17 @@ var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
13
13
  var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
14
14
  var semver__default = /*#__PURE__*/_interopDefaultCompat(semver);
15
15
 
16
- var __defProp = Object.defineProperty;
17
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
- var __publicField = (obj, key, value) => {
19
- __defNormalProp(obj, key + "" , value);
20
- return value;
21
- };
22
16
  class CustomError extends Error {
23
17
  get name() {
24
18
  return this.constructor.name;
25
19
  }
26
20
  }
27
21
  class ExitCodeError extends CustomError {
22
+ code;
28
23
  constructor(code, command) {
29
24
  super(
30
25
  command ? `Command '${command}' exited with code ${code}` : `Child exited with code ${code}`
31
26
  );
32
- __publicField(this, "code");
33
27
  this.code = code;
34
28
  }
35
29
  }
@@ -53,13 +47,13 @@ class NotFoundError extends CustomError {
53
47
 
54
48
  const paths = cliCommon.findPaths(__dirname);
55
49
 
56
- var version$f = "0.22.0";
50
+ var version$f = "0.23.0-next.1";
57
51
 
58
- var version$e = "0.6.18";
52
+ var version$e = "0.6.19-next.1";
59
53
 
60
- var version$d = "0.3.8";
54
+ var version$d = "0.4.0-next.1";
61
55
 
62
- var version$c = "0.26.6";
56
+ var version$c = "0.26.7-next.1";
63
57
  var dependencies = {
64
58
  "@backstage/catalog-model": "workspace:^",
65
59
  "@backstage/cli-common": "workspace:^",
@@ -98,7 +92,7 @@ var dependencies = {
98
92
  "@typescript-eslint/eslint-plugin": "^6.12.0",
99
93
  "@typescript-eslint/parser": "^6.7.2",
100
94
  "@yarnpkg/lockfile": "^1.1.0",
101
- "@yarnpkg/parsers": "^3.0.0-rc.4",
95
+ "@yarnpkg/parsers": "^3.0.0",
102
96
  bfj: "^8.0.0",
103
97
  buffer: "^6.0.3",
104
98
  chalk: "^4.0.0",
@@ -213,23 +207,23 @@ var version$b = "1.2.0";
213
207
 
214
208
  var version$a = "1.12.5";
215
209
 
216
- var version$9 = "0.14.7";
210
+ var version$9 = "0.14.8-next.0";
217
211
 
218
212
  var version$8 = "1.9.2";
219
213
 
220
- var version$7 = "1.0.32";
214
+ var version$7 = "1.0.33-next.0";
221
215
 
222
- var version$6 = "1.5.5";
216
+ var version$6 = "1.5.6-next.0";
223
217
 
224
- var version$5 = "0.4.4";
218
+ var version$5 = "0.4.5-next.1";
225
219
 
226
- var version$4 = "0.22.5";
220
+ var version$4 = "0.22.6-next.1";
227
221
 
228
- var version$3 = "0.1.4";
222
+ var version$3 = "0.1.5-next.1";
229
223
 
230
- var version$2 = "0.5.5";
224
+ var version$2 = "0.5.6-next.0";
231
225
 
232
- var version$1 = "0.2.18";
226
+ var version$1 = "0.3.0-next.1";
233
227
 
234
228
  const packageVersions = {
235
229
  "@backstage/backend-common": version$f,
@@ -256,36 +250,35 @@ const version = findVersion();
256
250
  fs__default.default.pathExistsSync(paths.resolveOwn("src"));
257
251
  function createPackageVersionProvider(lockfile) {
258
252
  return (name, versionHint) => {
259
- var _a;
260
253
  const packageVersion = packageVersions[name];
261
254
  const targetVersion = versionHint || packageVersion;
262
255
  if (!targetVersion) {
263
256
  throw new Error(`No version available for package ${name}`);
264
257
  }
265
- const lockfileEntries = lockfile == null ? void 0 : lockfile.get(name);
266
- if (name.startsWith("@types/") && (lockfileEntries == null ? void 0 : lockfileEntries.some((entry) => entry.range === "*"))) {
258
+ const lockfileEntries = lockfile?.get(name);
259
+ if (name.startsWith("@types/") && lockfileEntries?.some((entry) => entry.range === "*")) {
267
260
  return "*";
268
261
  }
269
262
  for (const specifier of ["^", "~", "*"]) {
270
263
  const range = `workspace:${specifier}`;
271
- if (lockfileEntries == null ? void 0 : lockfileEntries.some((entry) => entry.range === range)) {
264
+ if (lockfileEntries?.some((entry) => entry.range === range)) {
272
265
  return range;
273
266
  }
274
267
  }
275
- const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter(
268
+ const validRanges = lockfileEntries?.filter(
276
269
  (entry) => semver__default.default.satisfies(targetVersion, entry.range)
277
270
  );
278
- const highestRange = validRanges == null ? void 0 : validRanges.slice(-1)[0];
279
- if (highestRange == null ? void 0 : highestRange.range) {
280
- return highestRange == null ? void 0 : highestRange.range;
271
+ const highestRange = validRanges?.slice(-1)[0];
272
+ if (highestRange?.range) {
273
+ return highestRange?.range;
281
274
  }
282
275
  if (packageVersion) {
283
276
  return `^${packageVersion}`;
284
277
  }
285
- if ((_a = semver__default.default.parse(versionHint)) == null ? void 0 : _a.prerelease.length) {
278
+ if (semver__default.default.parse(versionHint)?.prerelease.length) {
286
279
  return versionHint;
287
280
  }
288
- return (versionHint == null ? void 0 : versionHint.match(/^[\d\.]+$/)) ? `^${versionHint}` : versionHint;
281
+ return versionHint?.match(/^[\d\.]+$/) ? `^${versionHint}` : versionHint;
289
282
  };
290
283
  }
291
284
 
@@ -296,7 +289,7 @@ const configOption = [
296
289
  Array()
297
290
  ];
298
291
  function registerOnboardCommand(program) {
299
- program.command("onboard", { hidden: true }).description("Get help setting up your Backstage App.").action(lazy(() => Promise.resolve().then(function () { return require('./index-BWsdQbfr.cjs.js'); }).then((m) => m.command)));
292
+ program.command("onboard", { hidden: true }).description("Get help setting up your Backstage App.").action(lazy(() => Promise.resolve().then(function () { return require('./index-4tpfFcd0.cjs.js'); }).then((m) => m.command)));
300
293
  }
301
294
  function registerRepoCommand(program) {
302
295
  const command = program.command("repo [command]").description("Command that run across an entire Backstage project");
@@ -308,7 +301,7 @@ function registerRepoCommand(program) {
308
301
  ).option(
309
302
  "--since <ref>",
310
303
  "Only build packages and their dev dependents that changed since the specified ref"
311
- ).action(lazy(() => Promise.resolve().then(function () { return require('./build-BSDLApkE.cjs.js'); }).then((m) => m.command)));
304
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./build-K-pcqX-7.cjs.js'); }).then((m) => m.command)));
312
305
  command.command("lint").description("Lint all packages in the project").option(
313
306
  "--format <format>",
314
307
  "Lint report output format",
@@ -316,14 +309,14 @@ function registerRepoCommand(program) {
316
309
  ).option(
317
310
  "--since <ref>",
318
311
  "Only lint packages that changed since the specified ref"
319
- ).option("--fix", "Attempt to automatically fix violations").action(lazy(() => Promise.resolve().then(function () { return require('./lint-BHZJ9s87.cjs.js'); }).then((m) => m.command)));
312
+ ).option("--fix", "Attempt to automatically fix violations").action(lazy(() => Promise.resolve().then(function () { return require('./lint-Cfr3Nf8W.cjs.js'); }).then((m) => m.command)));
320
313
  command.command("fix").description("Automatically fix packages in the project").option(
321
314
  "--check",
322
315
  "Fail if any packages would have been changed by the command"
323
- ).action(lazy(() => Promise.resolve().then(function () { return require('./fix-F8xWYiWH.cjs.js'); }).then((m) => m.command)));
324
- command.command("clean").description("Delete cache and output directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-Cw1FeJO5.cjs.js'); }).then((m) => m.command)));
316
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./fix-DRJmPWVw.cjs.js'); }).then((m) => m.command)));
317
+ command.command("clean").description("Delete cache and output directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-CsvXtbbM.cjs.js'); }).then((m) => m.command)));
325
318
  command.command("list-deprecations").description("List deprecations").option("--json", "Output as JSON").action(
326
- lazy(() => Promise.resolve().then(function () { return require('./list-deprecations-PCaNouxb.cjs.js'); }).then((m) => m.command))
319
+ lazy(() => Promise.resolve().then(function () { return require('./list-deprecations-BohRYhXY.cjs.js'); }).then((m) => m.command))
327
320
  );
328
321
  command.command("test").allowUnknownOption(true).option(
329
322
  "--since <ref>",
@@ -331,14 +324,14 @@ function registerRepoCommand(program) {
331
324
  ).option(
332
325
  "--jest-help",
333
326
  "Show help for Jest CLI options, which are passed through"
334
- ).description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./test-BuGhBxNC.cjs.js'); }).then((m) => m.command)));
327
+ ).description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./test-B-mnTZ_w.cjs.js'); }).then((m) => m.command)));
335
328
  }
336
329
  function registerScriptCommand(program) {
337
330
  const command = program.command("package [command]").description("Lifecycle scripts for individual packages");
338
331
  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(
339
332
  "--inspect-brk [host]",
340
333
  "Enable debugger in Node.js environments, breaking before code starts"
341
- ).option("--require <path>", "Add a --require argument to the node process").action(lazy(() => Promise.resolve().then(function () { return require('./index-Wt0qQuCU.cjs.js'); }).then((m) => m.command)));
334
+ ).option("--require <path>", "Add a --require argument to the node process").action(lazy(() => Promise.resolve().then(function () { return require('./index-sgL46Hcr.cjs.js'); }).then((m) => m.command)));
342
335
  command.command("build").description("Build a package for production deployment or publishing").option("--role <name>", "Run the command with an explicit package role").option(
343
336
  "--minify",
344
337
  "Minify the generated code. Does not apply to app package (app is minified by default)."
@@ -353,35 +346,35 @@ function registerScriptCommand(program) {
353
346
  "Config files to load instead of app-config.yaml. Applies to app packages only.",
354
347
  (opt, opts) => opts ? [...opts, opt] : [opt],
355
348
  Array()
356
- ).action(lazy(() => Promise.resolve().then(function () { return require('./index-DtxQfUmH.cjs.js'); }).then((m) => m.command)));
349
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./index-BBSSy9dx.cjs.js'); }).then((m) => m.command)));
357
350
  command.command("lint [directories...]").option(
358
351
  "--format <format>",
359
352
  "Lint report output format",
360
353
  "eslint-formatter-friendly"
361
- ).option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-NokSgx6Q.cjs.js'); }).then((m) => m.default)));
362
- 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-Dt0SmBb4.cjs.js'); }).then((m) => m.default)));
363
- command.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-SL6sMYtJ.cjs.js'); }).then((m) => m.default)));
364
- command.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-D65aI1Y5.cjs.js'); }).then((m) => m.pre)));
365
- command.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-D65aI1Y5.cjs.js'); }).then((m) => m.post)));
354
+ ).option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-CcLekf2l.cjs.js'); }).then((m) => m.default)));
355
+ 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-DOImiAsd.cjs.js'); }).then((m) => m.default)));
356
+ command.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-xJbA1_MQ.cjs.js'); }).then((m) => m.default)));
357
+ command.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-BbXl8HgZ.cjs.js'); }).then((m) => m.pre)));
358
+ command.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-BbXl8HgZ.cjs.js'); }).then((m) => m.post)));
366
359
  }
367
360
  function registerMigrateCommand(program) {
368
361
  const command = program.command("migrate [command]").description("Migration utilities");
369
- 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-B-GQB2ZF.cjs.js'); }).then((m) => m.default)));
362
+ 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-Bv24SFxi.cjs.js'); }).then((m) => m.default)));
370
363
  command.command("package-scripts").description("Set package scripts according to each package role").action(
371
- lazy(() => Promise.resolve().then(function () { return require('./packageScripts-CPnlPBBs.cjs.js'); }).then((m) => m.command))
364
+ lazy(() => Promise.resolve().then(function () { return require('./packageScripts-DX6dilK6.cjs.js'); }).then((m) => m.command))
372
365
  );
373
366
  command.command("package-exports").description("Synchronize package subpath export definitions").action(
374
- lazy(() => Promise.resolve().then(function () { return require('./packageExports-BQpjmF7V.cjs.js'); }).then((m) => m.command))
367
+ lazy(() => Promise.resolve().then(function () { return require('./packageExports-BTQCKtXi.cjs.js'); }).then((m) => m.command))
375
368
  );
376
369
  command.command("package-lint-configs").description(
377
370
  "Migrates all packages to use @backstage/cli/config/eslint-factory"
378
371
  ).action(
379
- lazy(() => Promise.resolve().then(function () { return require('./packageLintConfigs-CtbeLXlD.cjs.js'); }).then((m) => m.command))
372
+ lazy(() => Promise.resolve().then(function () { return require('./packageLintConfigs-CLLDzY4E.cjs.js'); }).then((m) => m.command))
380
373
  );
381
374
  command.command("react-router-deps").description(
382
375
  "Migrates the react-router dependencies for all packages to be peer dependencies"
383
376
  ).action(
384
- lazy(() => Promise.resolve().then(function () { return require('./reactRouterDeps-BBKc6o07.cjs.js'); }).then((m) => m.command))
377
+ lazy(() => Promise.resolve().then(function () { return require('./reactRouterDeps-CR-hjviw.cjs.js'); }).then((m) => m.command))
385
378
  );
386
379
  }
387
380
  function registerCommands(program) {
@@ -401,7 +394,7 @@ function registerCommands(program) {
401
394
  ).option(
402
395
  "--baseVersion <version>",
403
396
  "The version to use for any new packages (default: 0.1.0)"
404
- ).option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./new-wsaO3CgE.cjs.js'); }).then((m) => m.default)));
397
+ ).option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./new-arMiMufY.cjs.js'); }).then((m) => m.default)));
405
398
  program.command("create", { hidden: true }).storeOptionsAsProperties(false).description(
406
399
  "Open up an interactive guide to creating new things in your app [DEPRECATED]"
407
400
  ).option(
@@ -415,30 +408,30 @@ function registerCommands(program) {
415
408
  ).option("--scope <scope>", "The scope to use for new packages").option(
416
409
  "--npm-registry <URL>",
417
410
  "The package registry to use for new packages"
418
- ).option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./new-wsaO3CgE.cjs.js'); }).then((m) => m.default)));
411
+ ).option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./new-arMiMufY.cjs.js'); }).then((m) => m.default)));
419
412
  program.command("create-plugin", { hidden: true }).option(
420
413
  "--backend",
421
414
  "Create plugin with the backend dependencies as default"
422
415
  ).description("Creates a new plugin in the current repository [DEPRECATED]").option("--scope <scope>", "npm scope").option("--npm-registry <URL>", "npm registry URL").option("--no-private", "Public npm package").action(
423
- lazy(() => Promise.resolve().then(function () { return require('./createPlugin-Bf67GaKA.cjs.js'); }).then((m) => m.default))
416
+ lazy(() => Promise.resolve().then(function () { return require('./createPlugin-DsRqp_45.cjs.js'); }).then((m) => m.default))
424
417
  );
425
418
  program.command("plugin:diff", { hidden: true }).option("--check", "Fail if changes are required").option("--yes", "Apply all changes").description(
426
419
  "Diff an existing plugin with the creation template [DEPRECATED]"
427
- ).action(lazy(() => Promise.resolve().then(function () { return require('./diff-jArODNjZ.cjs.js'); }).then((m) => m.default)));
420
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./diff-CzHvSwdu.cjs.js'); }).then((m) => m.default)));
428
421
  program.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description(
429
422
  "Run tests, forwarding args to Jest, defaulting to watch mode [DEPRECATED]"
430
- ).action(lazy(() => Promise.resolve().then(function () { return require('./test-Dt0SmBb4.cjs.js'); }).then((m) => m.default)));
423
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./test-DOImiAsd.cjs.js'); }).then((m) => m.default)));
431
424
  program.command("config:docs").option(
432
425
  "--package <name>",
433
426
  "Only include the schema that applies to the given package"
434
- ).description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-VFbH2gLP.cjs.js'); }).then((m) => m.default)));
427
+ ).description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-CwoppLTr.cjs.js'); }).then((m) => m.default)));
435
428
  program.command("config:print").option(
436
429
  "--package <name>",
437
430
  "Only load config schema that applies to the given package"
438
431
  ).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(
439
432
  "--format <format>",
440
433
  "Format to print the configuration in, either json or yaml [yaml]"
441
- ).option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-B6UB54DH.cjs.js'); }).then((m) => m.default)));
434
+ ).option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-DMJLOORu.cjs.js'); }).then((m) => m.default)));
442
435
  program.command("config:check").option(
443
436
  "--package <name>",
444
437
  "Only load config schema that applies to the given package"
@@ -447,14 +440,14 @@ function registerCommands(program) {
447
440
  "Enable strict config validation, forbidding errors and unknown keys"
448
441
  ).option(...configOption).description(
449
442
  "Validate that the given configuration loads and matches schema"
450
- ).action(lazy(() => Promise.resolve().then(function () { return require('./validate-2WOv51mB.cjs.js'); }).then((m) => m.default)));
443
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./validate-B53ZW9oJ.cjs.js'); }).then((m) => m.default)));
451
444
  program.command("config:schema").option(
452
445
  "--package <name>",
453
446
  "Only output config schema that applies to the given package"
454
447
  ).option(
455
448
  "--format <format>",
456
449
  "Format to print the schema in, either json or yaml [yaml]"
457
- ).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-M5iIZ_Eq.cjs.js'); }).then((m) => m.default)));
450
+ ).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-Dg6cnwTS.cjs.js'); }).then((m) => m.default)));
458
451
  registerRepoCommand(program);
459
452
  registerScriptCommand(program);
460
453
  registerMigrateCommand(program);
@@ -466,8 +459,8 @@ function registerCommands(program) {
466
459
  "--release <version|next|main>",
467
460
  "Bump to a specific Backstage release line or version",
468
461
  "main"
469
- ).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-CjL9wSlI.cjs.js'); }).then(function (n) { return n.bump; }).then((m) => m.default)));
470
- program.command("versions:check").option("--fix", "Fix any auto-fixable versioning problems").description("Check Backstage package versioning").action(lazy(() => Promise.resolve().then(function () { return require('./lint-CeLPKohb.cjs.js'); }).then((m) => m.default)));
462
+ ).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-C9CYCDTD.cjs.js'); }).then(function (n) { return n.bump; }).then((m) => m.default)));
463
+ program.command("versions:check").option("--fix", "Fix any auto-fixable versioning problems").description("Check Backstage package versioning").action(lazy(() => Promise.resolve().then(function () { return require('./lint-CB_NthPd.cjs.js'); }).then((m) => m.default)));
471
464
  program.command("versions:migrate").option(
472
465
  "--pattern <glob>",
473
466
  "Override glob for matching packages to upgrade"
@@ -476,18 +469,18 @@ function registerCommands(program) {
476
469
  "Skip code changes and only update package.json files"
477
470
  ).description(
478
471
  "Migrate any plugins that have been moved to the @backstage-community namespace automatically"
479
- ).action(lazy(() => Promise.resolve().then(function () { return require('./bump-CjL9wSlI.cjs.js'); }).then(function (n) { return n.migrate; }).then((m) => m.default)));
480
- program.command("clean").description("Delete cache directories [DEPRECATED]").action(lazy(() => Promise.resolve().then(function () { return require('./clean-SL6sMYtJ.cjs.js'); }).then((m) => m.default)));
472
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./bump-C9CYCDTD.cjs.js'); }).then(function (n) { return n.migrate; }).then((m) => m.default)));
473
+ program.command("clean").description("Delete cache directories [DEPRECATED]").action(lazy(() => Promise.resolve().then(function () { return require('./clean-xJbA1_MQ.cjs.js'); }).then((m) => m.default)));
481
474
  program.command("build-workspace <workspace-dir> [packages...]").option(
482
475
  "--alwaysYarnPack",
483
476
  "Force workspace output to be a result of running `yarn pack` on each package (warning: very slow)"
484
- ).description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-DV7BpoZT.cjs.js'); }).then((m) => m.default)));
485
- program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-ko14Ea3F.cjs.js'); }).then((m) => m.default)));
486
- program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-31wuUeHo.cjs.js'); }).then((m) => m.default)));
477
+ ).description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-Cl0Fml15.cjs.js'); }).then((m) => m.default)));
478
+ program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-CFXiU9k7.cjs.js'); }).then((m) => m.default)));
479
+ program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-1ZqjB4Yh.cjs.js'); }).then((m) => m.default)));
487
480
  program.command("install [plugin-id]", { hidden: true }).option(
488
481
  "--from <packageJsonFilePath>",
489
482
  "Install from a local package.json containing the installation recipe"
490
- ).description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-Bf0Cm4CP.cjs.js'); }).then((m) => m.default)));
483
+ ).description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-CdKSl_Ad.cjs.js'); }).then((m) => m.default)));
491
484
  }
492
485
  function lazy(getActionFunc) {
493
486
  return async (...args) => {
@@ -531,4 +524,4 @@ exports.devDependencies = devDependencies;
531
524
  exports.paths = paths;
532
525
  exports.version = version;
533
526
  exports.version$1 = version$c;
534
- //# sourceMappingURL=index-CS6xQRSZ.cjs.js.map
527
+ //# sourceMappingURL=index-CABYoOop.cjs.js.map
@@ -4,7 +4,7 @@ var fs = require('fs-extra');
4
4
  var chalk = require('chalk');
5
5
  var yaml = require('yaml');
6
6
  var inquirer = require('inquirer');
7
- var index$1 = require('./index-CS6xQRSZ.cjs.js');
7
+ var index$1 = require('./index-CABYoOop.cjs.js');
8
8
  var crypto = require('crypto');
9
9
  var openBrowser = require('react-dev-utils/openBrowser');
10
10
  var request = require('@octokit/request');
@@ -25,12 +25,6 @@ var openBrowser__default = /*#__PURE__*/_interopDefaultCompat(openBrowser);
25
25
  var express__default = /*#__PURE__*/_interopDefaultCompat(express);
26
26
  var fetch__default = /*#__PURE__*/_interopDefaultCompat(fetch);
27
27
 
28
- var __defProp = Object.defineProperty;
29
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
30
- var __publicField = (obj, key, value) => {
31
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
- return value;
33
- };
34
28
  const FORM_PAGE = `
35
29
  <html>
36
30
  <body>
@@ -48,44 +42,11 @@ class GithubCreateAppServer {
48
42
  constructor(actionUrl, permissions) {
49
43
  this.actionUrl = actionUrl;
50
44
  this.permissions = permissions;
51
- __publicField(this, "baseUrl");
52
- __publicField(this, "webhookUrl");
53
- __publicField(this, "formHandler", (_req, res) => {
54
- const baseUrl = this.baseUrl;
55
- if (!baseUrl) {
56
- throw new Error("baseUrl is not set");
57
- }
58
- const manifest = {
59
- default_events: ["create", "delete", "push", "repository"],
60
- default_permissions: {
61
- metadata: "read",
62
- ...this.permissions.includes("members") && { members: "read" },
63
- ...this.permissions.includes("read") && { contents: "read" },
64
- ...this.permissions.includes("write") && {
65
- contents: "write",
66
- actions: "write"
67
- }
68
- },
69
- name: "Backstage-<changeme>",
70
- url: "https://backstage.io",
71
- description: "GitHub App for Backstage",
72
- public: false,
73
- redirect_url: `${baseUrl}/callback`,
74
- hook_attributes: {
75
- url: this.webhookUrl,
76
- active: false
77
- }
78
- };
79
- const manifestJson = JSON.stringify(manifest).replace(/\"/g, "&quot;");
80
- let body = FORM_PAGE;
81
- body = body.replace("MANIFEST_JSON", manifestJson);
82
- body = body.replace("ACTION_URL", this.actionUrl);
83
- res.setHeader("content-type", "text/html");
84
- res.send(body);
85
- });
86
45
  const webhookId = crypto__default.default.randomBytes(15).toString("base64").replace(/[\+\/]/g, "");
87
46
  this.webhookUrl = `https://smee.io/${webhookId}`;
88
47
  }
48
+ baseUrl;
49
+ webhookUrl;
89
50
  static async run(options) {
90
51
  const encodedOrg = encodeURIComponent(options.org);
91
52
  const actionUrl = `https://github.com/organizations/${encodedOrg}/settings/apps/new`;
@@ -120,6 +81,39 @@ class GithubCreateAppServer {
120
81
  openBrowser__default.default(this.baseUrl);
121
82
  return callPromise;
122
83
  }
84
+ formHandler = (_req, res) => {
85
+ const baseUrl = this.baseUrl;
86
+ if (!baseUrl) {
87
+ throw new Error("baseUrl is not set");
88
+ }
89
+ const manifest = {
90
+ default_events: ["create", "delete", "push", "repository"],
91
+ default_permissions: {
92
+ metadata: "read",
93
+ ...this.permissions.includes("members") && { members: "read" },
94
+ ...this.permissions.includes("read") && { contents: "read" },
95
+ ...this.permissions.includes("write") && {
96
+ contents: "write",
97
+ actions: "write"
98
+ }
99
+ },
100
+ name: "Backstage-<changeme>",
101
+ url: "https://backstage.io",
102
+ description: "GitHub App for Backstage",
103
+ public: false,
104
+ redirect_url: `${baseUrl}/callback`,
105
+ hook_attributes: {
106
+ url: this.webhookUrl,
107
+ active: false
108
+ }
109
+ };
110
+ const manifestJson = JSON.stringify(manifest).replace(/\"/g, "&quot;");
111
+ let body = FORM_PAGE;
112
+ body = body.replace("MANIFEST_JSON", manifestJson);
113
+ body = body.replace("ACTION_URL", this.actionUrl);
114
+ res.setHeader("content-type", "text/html");
115
+ res.send(body);
116
+ };
123
117
  async listen(app) {
124
118
  return new Promise((resolve, reject) => {
125
119
  const listener = app.listen(0, () => {
@@ -202,7 +196,7 @@ async function verifyGithubOrg(org) {
202
196
  )
203
197
  );
204
198
  }
205
- if ((response == null ? void 0 : response.status) === 404) {
199
+ if (response?.status === 404) {
206
200
  const questions = [
207
201
  {
208
202
  type: "confirm",
@@ -230,4 +224,4 @@ async function verifyGithubOrg(org) {
230
224
  }
231
225
 
232
226
  exports.default = index;
233
- //# sourceMappingURL=index-ko14Ea3F.cjs.js.map
227
+ //# sourceMappingURL=index-CFXiU9k7.cjs.js.map