@backstage/cli 0.8.2 → 0.10.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 (62) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/config/jest.js +1 -0
  3. package/config/jestSucraseTransform.js +5 -1
  4. package/dist/cjs/{Lockfile-80f0eec4.cjs.js → Lockfile-35661afa.cjs.js} +18 -18
  5. package/dist/cjs/{build-bae5a019.cjs.js → build-4c85e374.cjs.js} +9 -9
  6. package/dist/cjs/{build-1cbb9e7d.cjs.js → build-574ad84f.cjs.js} +23 -20
  7. package/dist/cjs/{build-70dd213a.cjs.js → build-c587cc8c.cjs.js} +8 -7
  8. package/dist/cjs/{build-b25b29ed.cjs.js → build-dc2484e7.cjs.js} +8 -7
  9. package/dist/cjs/{buildWorkspace-424d4929.cjs.js → buildWorkspace-29b42a0b.cjs.js} +6 -6
  10. package/dist/cjs/{bump-bce7f9c2.cjs.js → bump-24057de2.cjs.js} +55 -33
  11. package/dist/cjs/{bundle-cc6870fb.cjs.js → bundle-854deefb.cjs.js} +15 -15
  12. package/dist/cjs/{clean-7a981ea7.cjs.js → clean-ecf90e6b.cjs.js} +6 -6
  13. package/dist/cjs/{config-24fce3c1.cjs.js → config-91083c1e.cjs.js} +7 -7
  14. package/dist/cjs/create-89dd36f0.cjs.js +483 -0
  15. package/dist/cjs/{createPlugin-2c2b30fc.cjs.js → createPlugin-a8527ca3.cjs.js} +35 -36
  16. package/dist/cjs/{dev-efe399b8.cjs.js → dev-3713f802.cjs.js} +8 -8
  17. package/dist/cjs/{diff-e3661054.cjs.js → diff-79e33159.cjs.js} +39 -32
  18. package/dist/cjs/{docs-ceb404a3.cjs.js → docs-a8506fde.cjs.js} +6 -6
  19. package/dist/cjs/{index-26bec8ac.cjs.js → index-33d9cbba.cjs.js} +23 -20
  20. package/dist/cjs/{index-fbff7b78.cjs.js → index-9cf6e421.cjs.js} +14 -14
  21. package/dist/cjs/{index-6fee1c9a.cjs.js → index-b2152549.cjs.js} +81 -79
  22. package/dist/cjs/{info-5e7c2679.cjs.js → info-d8ce894c.cjs.js} +6 -6
  23. package/dist/cjs/{install-5920b5df.cjs.js → install-9e5b8576.cjs.js} +23 -23
  24. package/dist/cjs/{lint-306bb8fe.cjs.js → lint-955bc62d.cjs.js} +4 -4
  25. package/dist/cjs/{lint-6175d471.cjs.js → lint-a78b8bb6.cjs.js} +7 -7
  26. package/dist/cjs/{pack-32228ad6.cjs.js → pack-f474f79b.cjs.js} +6 -6
  27. package/dist/cjs/{packager-1ad7272f.cjs.js → packager-6c80f203.cjs.js} +37 -35
  28. package/dist/cjs/{packages-a5b6a3df.cjs.js → packages-bcde9079.cjs.js} +5 -5
  29. package/dist/cjs/{paths-09202a46.cjs.js → paths-f9c22b94.cjs.js} +51 -36
  30. package/dist/cjs/{print-806676fe.cjs.js → print-5e70799c.cjs.js} +5 -5
  31. package/dist/cjs/{removePlugin-f82ac16a.cjs.js → removePlugin-891ec166.cjs.js} +32 -29
  32. package/dist/cjs/{run-59c4395e.cjs.js → run-8388d249.cjs.js} +5 -5
  33. package/dist/cjs/{schema-398d8593.cjs.js → schema-80516b43.cjs.js} +5 -5
  34. package/dist/cjs/{serve-708fbf98.cjs.js → serve-1b0ace54.cjs.js} +15 -15
  35. package/dist/cjs/{serve-f4bb3cb0.cjs.js → serve-6c335165.cjs.js} +9 -9
  36. package/dist/cjs/{server-107d9cc0.cjs.js → server-b2f87b69.cjs.js} +6 -6
  37. package/dist/cjs/{svgrTemplate-2d0d15cf.cjs.js → svgrTemplate-f19e974c.cjs.js} +3 -3
  38. package/dist/cjs/{tasks-9bd3e946.cjs.js → tasks-f12b95ba.cjs.js} +96 -30
  39. package/dist/cjs/{testCommand-e32fbd45.cjs.js → testCommand-1c515cf7.cjs.js} +4 -4
  40. package/dist/cjs/{validate-9523a11e.cjs.js → validate-9907afbb.cjs.js} +4 -4
  41. package/dist/index.cjs.js +1 -1
  42. package/package.json +22 -23
  43. package/templates/default-backend-plugin/package.json.hbs +39 -37
  44. package/templates/default-backend-plugin/src/run.ts.hbs +1 -1
  45. package/templates/default-common-plugin-package/.eslintrc.js +3 -0
  46. package/templates/default-common-plugin-package/README.md.hbs +5 -0
  47. package/templates/default-common-plugin-package/package.json.hbs +34 -0
  48. package/templates/default-common-plugin-package/src/index.ts.hbs +19 -0
  49. package/templates/default-common-plugin-package/src/setupTests.ts +1 -0
  50. package/templates/default-common-plugin-package/tsconfig.json +9 -0
  51. package/templates/default-plugin/package.json.hbs +7 -4
  52. package/templates/default-plugin/src/routes.ts.hbs +1 -1
  53. package/templates/scaffolder-module/.eslintrc.js +3 -0
  54. package/templates/scaffolder-module/README.md.hbs +5 -0
  55. package/templates/scaffolder-module/package.json.hbs +37 -0
  56. package/templates/scaffolder-module/src/actions/example/example.test.ts +50 -0
  57. package/templates/scaffolder-module/src/actions/example/example.ts +57 -0
  58. package/templates/scaffolder-module/src/actions/example/index.ts +1 -0
  59. package/templates/scaffolder-module/src/actions/index.ts +1 -0
  60. package/templates/scaffolder-module/src/index.ts.hbs +8 -0
  61. package/templates/scaffolder-module/tsconfig.json +9 -0
  62. package/dist/cjs/buildImage-6b35526c.cjs.js +0 -77
@@ -3,7 +3,7 @@
3
3
  var fs = require('fs-extra');
4
4
  var chalk = require('chalk');
5
5
  var yaml = require('yaml');
6
- var index$1 = require('./index-6fee1c9a.cjs.js');
6
+ var index$1 = require('./index-b2152549.cjs.js');
7
7
  var crypto = require('crypto');
8
8
  var openBrowser = require('react-dev-utils/openBrowser');
9
9
  var request = require('@octokit/request');
@@ -42,7 +42,7 @@ const FORM_PAGE = `
42
42
  </form>
43
43
  <script>
44
44
  document.getElementById("form").submit()
45
- </script>
45
+ <\/script>
46
46
  </body>
47
47
  </html>
48
48
  `;
@@ -69,21 +69,21 @@ class GithubCreateAppServer {
69
69
  res.setHeader("content-type", "text/html");
70
70
  res.send(body);
71
71
  };
72
- const webhookId = crypto__default['default'].randomBytes(15).toString("base64").replace(/[\+\/]/g, "");
72
+ const webhookId = crypto__default["default"].randomBytes(15).toString("base64").replace(/[\+\/]/g, "");
73
73
  this.webhookUrl = `https://smee.io/${webhookId}`;
74
74
  }
75
- static async run({org}) {
75
+ static async run({ org }) {
76
76
  const encodedOrg = encodeURIComponent(org);
77
77
  const actionUrl = `https://github.com/organizations/${encodedOrg}/settings/apps/new`;
78
78
  const server = new GithubCreateAppServer(actionUrl);
79
79
  return server.start();
80
80
  }
81
81
  async start() {
82
- const app = express__default['default']();
82
+ const app = express__default["default"]();
83
83
  app.get("/", this.formHandler);
84
84
  const callPromise = new Promise((resolve, reject) => {
85
85
  app.get("/callback", (req, res) => {
86
- request.request(`POST /app-manifests/${encodeURIComponent(req.query.code)}/conversions`).then(({data}) => {
86
+ request.request(`POST /app-manifests/${encodeURIComponent(req.query.code)}/conversions`).then(({ data }) => {
87
87
  resolve({
88
88
  name: data.name,
89
89
  slug: data.slug,
@@ -99,7 +99,7 @@ class GithubCreateAppServer {
99
99
  });
100
100
  });
101
101
  this.baseUrl = await this.listen(app);
102
- openBrowser__default['default'](this.baseUrl);
102
+ openBrowser__default["default"](this.baseUrl);
103
103
  return callPromise;
104
104
  }
105
105
  async listen(app) {
@@ -110,7 +110,7 @@ class GithubCreateAppServer {
110
110
  reject(new Error(`Unexpected listener info '${info}'`));
111
111
  return;
112
112
  }
113
- const {port} = info;
113
+ const { port } = info;
114
114
  resolve(`http://localhost:${port}`);
115
115
  });
116
116
  });
@@ -118,14 +118,14 @@ class GithubCreateAppServer {
118
118
  }
119
119
 
120
120
  var index = async (org) => {
121
- const {slug, name, ...config} = await GithubCreateAppServer.run({org});
121
+ const { slug, name, ...config } = await GithubCreateAppServer.run({ org });
122
122
  const fileName = `github-app-${slug}-credentials.yaml`;
123
123
  const content = `# Name: ${name}
124
124
  ${yaml.stringify(config)}`;
125
- await fs__default['default'].writeFile(index$1.paths.resolveTargetRoot(fileName), content);
126
- console.log(`GitHub App configuration written to ${chalk__default['default'].cyan(fileName)}`);
127
- console.log(chalk__default['default'].yellow("This file contains sensitive credentials, it should not be committed to version control and handled with care!"));
125
+ await fs__default["default"].writeFile(index$1.paths.resolveTargetRoot(fileName), content);
126
+ console.log(`GitHub App configuration written to ${chalk__default["default"].cyan(fileName)}`);
127
+ console.log(chalk__default["default"].yellow("This file contains sensitive credentials, it should not be committed to version control and handled with care!"));
128
128
  };
129
129
 
130
- exports.default = index;
131
- //# sourceMappingURL=index-fbff7b78.cjs.js.map
130
+ exports["default"] = index;
131
+ //# sourceMappingURL=index-9cf6e421.cjs.js.map
@@ -29,13 +29,13 @@ class ExitCodeError extends CustomError {
29
29
  function exitWithError(error) {
30
30
  if (error instanceof ExitCodeError) {
31
31
  process.stderr.write(`
32
- ${chalk__default['default'].red(error.message)}
32
+ ${chalk__default["default"].red(error.message)}
33
33
 
34
34
  `);
35
35
  process.exit(error.code);
36
36
  } else {
37
37
  process.stderr.write(`
38
- ${chalk__default['default'].red(`${error}`)}
38
+ ${chalk__default["default"].red(`${error}`)}
39
39
 
40
40
  `);
41
41
  process.exit(1);
@@ -46,23 +46,23 @@ class NotFoundError extends CustomError {
46
46
 
47
47
  const paths = cliCommon.findPaths(__dirname);
48
48
 
49
- var version$8 = "0.9.9";
49
+ var version$9 = "0.9.13";
50
50
 
51
- var version$7 = "0.8.2";
51
+ var version$8 = "0.10.1";
52
52
  var dependencies = {
53
- "@backstage/cli-common": "^0.1.5",
53
+ "@backstage/cli-common": "^0.1.6",
54
54
  "@backstage/config": "^0.1.11",
55
- "@backstage/config-loader": "^0.7.2",
56
- "@backstage/errors": "^0.1.4",
55
+ "@backstage/config-loader": "^0.8.1",
56
+ "@backstage/errors": "^0.1.5",
57
57
  "@backstage/types": "^0.1.1",
58
58
  "@hot-loader/react-dom": "^16.13.0",
59
59
  "@lerna/package-graph": "^4.0.0",
60
60
  "@lerna/project": "^4.0.0",
61
61
  "@octokit/request": "^5.4.12",
62
- "@rollup/plugin-commonjs": "^17.1.0",
63
- "@rollup/plugin-json": "^4.0.2",
62
+ "@rollup/plugin-commonjs": "^21.0.1",
63
+ "@rollup/plugin-json": "^4.1.0",
64
64
  "@rollup/plugin-node-resolve": "^13.0.0",
65
- "@rollup/plugin-yaml": "^3.0.0",
65
+ "@rollup/plugin-yaml": "^3.1.0",
66
66
  "@spotify/eslint-config-base": "^12.0.0",
67
67
  "@spotify/eslint-config-react": "^12.0.0",
68
68
  "@spotify/eslint-config-typescript": "^12.0.0",
@@ -84,7 +84,7 @@ var dependencies = {
84
84
  "css-loader": "^5.2.6",
85
85
  dashify: "^2.0.0",
86
86
  diff: "^5.0.0",
87
- esbuild: "^0.8.56",
87
+ esbuild: "^0.14.1",
88
88
  eslint: "^7.30.0",
89
89
  "eslint-config-prettier": "^8.3.0",
90
90
  "eslint-formatter-friendly": "^7.0.0",
@@ -103,7 +103,7 @@ var dependencies = {
103
103
  inquirer: "^7.0.4",
104
104
  jest: "^26.0.1",
105
105
  "jest-css-modules": "^2.1.0",
106
- "json-schema": "^0.3.0",
106
+ "json-schema": "^0.4.0",
107
107
  "jest-transform-yaml": "^0.1.1",
108
108
  lodash: "^4.17.21",
109
109
  "mini-css-extract-plugin": "^2.4.2",
@@ -111,20 +111,19 @@ var dependencies = {
111
111
  ora: "^5.3.0",
112
112
  postcss: "^8.1.0",
113
113
  process: "^0.11.10",
114
- react: "^16.0.0",
115
- "react-dev-utils": "^11.0.4",
114
+ "react-dev-utils": "^12.0.0-next.47",
116
115
  "react-hot-loader": "^4.12.21",
117
116
  "recursive-readdir": "^2.2.2",
118
117
  "replace-in-file": "^6.0.0",
119
- rollup: "2.44.x",
120
- "rollup-plugin-dts": "^3.0.1",
121
- "rollup-plugin-esbuild": "2.6.x",
118
+ rollup: "^2.60.2",
119
+ "rollup-plugin-dts": "^4.0.1",
120
+ "rollup-plugin-esbuild": "^4.7.2",
122
121
  "rollup-plugin-peer-deps-external": "^2.2.2",
123
122
  "rollup-plugin-postcss": "^4.0.0",
124
123
  "rollup-pluginutils": "^2.8.2",
125
124
  "run-script-webpack-plugin": "^0.0.11",
126
125
  semver: "^7.3.2",
127
- "style-loader": "^1.2.1",
126
+ "style-loader": "^3.3.1",
128
127
  sucrase: "^3.20.2",
129
128
  tar: "^6.1.2",
130
129
  "terser-webpack-plugin": "^5.1.3",
@@ -139,14 +138,14 @@ var dependencies = {
139
138
  yn: "^4.0.0"
140
139
  };
141
140
  var devDependencies = {
142
- "@backstage/backend-common": "^0.9.9",
141
+ "@backstage/backend-common": "^0.9.13",
143
142
  "@backstage/config": "^0.1.11",
144
- "@backstage/core-components": "^0.7.3",
145
- "@backstage/core-plugin-api": "^0.1.13",
146
- "@backstage/core-app-api": "^0.1.20",
147
- "@backstage/dev-utils": "^0.2.12",
148
- "@backstage/test-utils": "^0.1.21",
149
- "@backstage/theme": "^0.2.13",
143
+ "@backstage/core-components": "^0.8.0",
144
+ "@backstage/core-plugin-api": "^0.3.0",
145
+ "@backstage/core-app-api": "^0.2.0",
146
+ "@backstage/dev-utils": "^0.2.14",
147
+ "@backstage/test-utils": "^0.1.24",
148
+ "@backstage/theme": "^0.2.14",
150
149
  "@types/diff": "^5.0.0",
151
150
  "@types/express": "^4.17.6",
152
151
  "@types/fs-extra": "^9.0.1",
@@ -168,35 +167,38 @@ var devDependencies = {
168
167
  "ts-node": "^10.0.0"
169
168
  };
170
169
 
171
- var version$6 = "0.1.20";
170
+ var version$7 = "0.2.0";
172
171
 
173
- var version$5 = "0.7.3";
172
+ var version$6 = "0.8.0";
174
173
 
175
- var version$4 = "0.1.13";
174
+ var version$5 = "0.3.0";
176
175
 
177
- var version$3 = "0.2.12";
176
+ var version$4 = "0.2.14";
178
177
 
179
- var version$2 = "0.1.21";
178
+ var version$3 = "0.1.24";
180
179
 
181
- var version$1 = "0.2.13";
180
+ var version$2 = "0.2.14";
181
+
182
+ var version$1 = "0.15.16";
182
183
 
183
184
  const packageVersions = {
184
- "@backstage/backend-common": version$8,
185
- "@backstage/cli": version$7,
185
+ "@backstage/backend-common": version$9,
186
+ "@backstage/cli": version$8,
186
187
  "@backstage/config": package_json.version,
187
- "@backstage/core-app-api": version$6,
188
- "@backstage/core-components": version$5,
189
- "@backstage/core-plugin-api": version$4,
190
- "@backstage/dev-utils": version$3,
191
- "@backstage/test-utils": version$2,
192
- "@backstage/theme": version$1
188
+ "@backstage/core-app-api": version$7,
189
+ "@backstage/core-components": version$6,
190
+ "@backstage/core-plugin-api": version$5,
191
+ "@backstage/dev-utils": version$4,
192
+ "@backstage/test-utils": version$3,
193
+ "@backstage/theme": version$2,
194
+ "@backstage/plugin-scaffolder-backend": version$1
193
195
  };
194
196
  function findVersion() {
195
- const pkgContent = fs__default['default'].readFileSync(paths.resolveOwn("package.json"), "utf8");
197
+ const pkgContent = fs__default["default"].readFileSync(paths.resolveOwn("package.json"), "utf8");
196
198
  return JSON.parse(pkgContent).version;
197
199
  }
198
200
  const version = findVersion();
199
- fs__default['default'].pathExistsSync(paths.resolveOwn("src"));
201
+ fs__default["default"].pathExistsSync(paths.resolveOwn("src"));
200
202
  function createPackageVersionProvider(lockfile) {
201
203
  return (name, versionHint) => {
202
204
  var _a;
@@ -209,7 +211,7 @@ function createPackageVersionProvider(lockfile) {
209
211
  if (name.startsWith("@types/") && (lockfileEntries == null ? void 0 : lockfileEntries.some((entry) => entry.range === "*"))) {
210
212
  return "*";
211
213
  }
212
- const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter((entry) => semver__default['default'].satisfies(targetVersion, entry.range));
214
+ const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter((entry) => semver__default["default"].satisfies(targetVersion, entry.range));
213
215
  const highestRange = validRanges == null ? void 0 : validRanges.slice(-1)[0];
214
216
  if (highestRange == null ? void 0 : highestRange.range) {
215
217
  return highestRange == null ? void 0 : highestRange.range;
@@ -217,10 +219,10 @@ function createPackageVersionProvider(lockfile) {
217
219
  if (packageVersion) {
218
220
  return `^${packageVersion}`;
219
221
  }
220
- if ((_a = semver__default['default'].parse(versionHint)) == null ? void 0 : _a.prerelease.length) {
222
+ if ((_a = semver__default["default"].parse(versionHint)) == null ? void 0 : _a.prerelease.length) {
221
223
  return versionHint;
222
224
  }
223
- return `^${versionHint}`;
225
+ return (versionHint == null ? void 0 : versionHint.match(/^[\d\.]+$/)) ? `^${versionHint}` : versionHint;
224
226
  };
225
227
  }
226
228
 
@@ -231,33 +233,33 @@ function registerCommands(program) {
231
233
  (opt, opts) => [...opts, opt],
232
234
  Array()
233
235
  ];
234
- program.command("app:build").description("Build an app for a production release").option("--stats", "Write bundle stats to output directory").option("--lax", "Do not require environment variables to be set").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./build-1cbb9e7d.cjs.js'); }).then((m) => m.default)));
235
- program.command("app:serve").description("Serve an app for local development").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-708fbf98.cjs.js'); }).then((m) => m.default)));
236
- program.command("backend:build").description("Build a backend plugin").action(lazy(() => Promise.resolve().then(function () { return require('./build-b25b29ed.cjs.js'); }).then((m) => m.default)));
237
- program.command("backend:bundle").description("Bundle the backend into a deployment archive").option("--build-dependencies", "Build all local package dependencies before bundling the backend").action(lazy(() => Promise.resolve().then(function () { return require('./bundle-cc6870fb.cjs.js'); }).then((m) => m.default)));
238
- program.command("backend:build-image").allowUnknownOption(true).helpOption(", --backstage-cli-help").option("--build", "Build packages before packing them into the image").description("Bundles the package into a docker image. This command is deprecated and will be removed.").action(lazy(() => Promise.resolve().then(function () { return require('./buildImage-6b35526c.cjs.js'); }).then((m) => m.default)));
239
- program.command("backend:dev").description("Start local development server with HMR for the backend").option("--check", "Enable type checking and linting").option("--inspect", "Enable debugger").option("--inspect-brk", "Enable debugger with await to attach debugger").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./dev-efe399b8.cjs.js'); }).then((m) => m.default)));
240
- program.command("create-plugin").option("--backend", "Create plugin with the backend dependencies as default").description("Creates a new plugin in the current repository").option("--scope <scope>", "npm scope").option("--npm-registry <URL>", "npm registry URL").option("--no-private", "Public npm package").action(lazy(() => Promise.resolve().then(function () { return require('./createPlugin-2c2b30fc.cjs.js'); }).then((m) => m.default)));
241
- program.command("remove-plugin").description("Removes plugin in the current repository").action(lazy(() => Promise.resolve().then(function () { return require('./removePlugin-f82ac16a.cjs.js'); }).then((m) => m.default)));
242
- program.command("plugin:build").description("Build a plugin").action(lazy(() => Promise.resolve().then(function () { return require('./build-70dd213a.cjs.js'); }).then((m) => m.default)));
243
- program.command("plugin:serve").description("Serves the dev/ folder of a plugin").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-f4bb3cb0.cjs.js'); }).then((m) => m.default)));
244
- program.command("plugin:diff").option("--check", "Fail if changes are required").option("--yes", "Apply all changes").description("Diff an existing plugin with the creation template").action(lazy(() => Promise.resolve().then(function () { return require('./diff-e3661054.cjs.js'); }).then((m) => m.default)));
245
- program.command("build").description("Build a package for publishing").option("--outputs <formats>", "List of formats to output [types,cjs,esm]").action(lazy(() => Promise.resolve().then(function () { return require('./build-bae5a019.cjs.js'); }).then((m) => m.default)));
246
- program.command("lint").option("--format <format>", "Lint report output format", "eslint-formatter-friendly").option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-306bb8fe.cjs.js'); }).then((m) => m.default)));
247
- program.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('./testCommand-e32fbd45.cjs.js'); }).then((m) => m.default)));
248
- program.command("config:docs").option("--package <name>", "Only include the schema that applies to the given package").description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-ceb404a3.cjs.js'); }).then((m) => m.default)));
249
- program.command("config:print").option("--package <name>", "Only load config schema that applies to the given package").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("--format <format>", "Format to print the configuration in, either json or yaml [yaml]").option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-806676fe.cjs.js'); }).then((m) => m.default)));
250
- program.command("config:check").option("--package <name>", "Only load config schema that applies to the given package").option("--lax", "Do not require environment variables to be set").option("--frontend", "Only validate the frontend configuration").option(...configOption).description("Validate that the given configuration loads and matches schema").action(lazy(() => Promise.resolve().then(function () { return require('./validate-9523a11e.cjs.js'); }).then((m) => m.default)));
251
- program.command("config:schema").option("--package <name>", "Only output config schema that applies to the given package").option("--format <format>", "Format to print the schema in, either json or yaml [yaml]").description("Print configuration schema").action(lazy(() => Promise.resolve().then(function () { return require('./schema-398d8593.cjs.js'); }).then((m) => m.default)));
252
- program.command("versions:bump").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-bce7f9c2.cjs.js'); }).then((m) => m.default)));
253
- 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-6175d471.cjs.js'); }).then((m) => m.default)));
254
- program.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-32228ad6.cjs.js'); }).then((m) => m.pre)));
255
- program.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-32228ad6.cjs.js'); }).then((m) => m.post)));
256
- program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-7a981ea7.cjs.js'); }).then((m) => m.default)));
257
- program.command("build-workspace <workspace-dir> ...<packages>").description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-424d4929.cjs.js'); }).then((m) => m.default)));
258
- program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-fbff7b78.cjs.js'); }).then((m) => m.default)));
259
- program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-5e7c2679.cjs.js'); }).then((m) => m.default)));
260
- program.command("install [plugin-id]", {hidden: true}).option("--from <packageJsonFilePath>", "Install from a local package.json containing the installation recipe").description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-5920b5df.cjs.js'); }).then((m) => m.default)));
236
+ program.command("app:build").description("Build an app for a production release").option("--stats", "Write bundle stats to output directory").option("--lax", "[DEPRECATED] - Do not require environment variables to be set").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./build-574ad84f.cjs.js'); }).then((m) => m.default)));
237
+ program.command("app:serve").description("Serve an app for local development").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-1b0ace54.cjs.js'); }).then((m) => m.default)));
238
+ program.command("backend:build").description("Build a backend plugin").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-c587cc8c.cjs.js'); }).then((m) => m.default)));
239
+ program.command("backend:bundle").description("Bundle the backend into a deployment archive").option("--build-dependencies", "Build all local package dependencies before bundling the backend").action(lazy(() => Promise.resolve().then(function () { return require('./bundle-854deefb.cjs.js'); }).then((m) => m.default)));
240
+ program.command("backend:dev").description("Start local development server with HMR for the backend").option("--check", "Enable type checking and linting").option("--inspect", "Enable debugger").option("--inspect-brk", "Enable debugger with await to attach debugger").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./dev-3713f802.cjs.js'); }).then((m) => m.default)));
241
+ program.command("create").storeOptionsAsProperties(false).description("Open up an interactive guide to creating new things in your app").option("--select <name>", "Select the thing you want to be creating upfront").option("--option <name>=<value>", "Pre-fill options for the creation process", (opt, arr) => [...arr, opt], []).option("--scope <scope>", "The scope to use for new packages").option("--npm-registry <URL>", "The package registry to use for new packages").option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./create-89dd36f0.cjs.js'); }).then((m) => m.default)));
242
+ program.command("create-plugin").option("--backend", "Create plugin with the backend dependencies as default").description("Creates a new plugin in the current repository").option("--scope <scope>", "npm scope").option("--npm-registry <URL>", "npm registry URL").option("--no-private", "Public npm package").action(lazy(() => Promise.resolve().then(function () { return require('./createPlugin-a8527ca3.cjs.js'); }).then((m) => m.default)));
243
+ program.command("remove-plugin").description("[DEPRECATED] - Removes plugin in the current repository").action(lazy(() => Promise.resolve().then(function () { return require('./removePlugin-891ec166.cjs.js'); }).then((m) => m.default)));
244
+ program.command("plugin:build").description("Build a plugin").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-dc2484e7.cjs.js'); }).then((m) => m.default)));
245
+ program.command("plugin:serve").description("Serves the dev/ folder of a plugin").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-6c335165.cjs.js'); }).then((m) => m.default)));
246
+ program.command("plugin:diff").option("--check", "Fail if changes are required").option("--yes", "Apply all changes").description("Diff an existing plugin with the creation template").action(lazy(() => Promise.resolve().then(function () { return require('./diff-79e33159.cjs.js'); }).then((m) => m.default)));
247
+ program.command("build").description("Build a package for publishing").option("--outputs <formats>", "List of formats to output [types,cjs,esm]").action(lazy(() => Promise.resolve().then(function () { return require('./build-4c85e374.cjs.js'); }).then((m) => m.default)));
248
+ program.command("lint").option("--format <format>", "Lint report output format", "eslint-formatter-friendly").option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-955bc62d.cjs.js'); }).then((m) => m.default)));
249
+ program.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('./testCommand-1c515cf7.cjs.js'); }).then((m) => m.default)));
250
+ program.command("config:docs").option("--package <name>", "Only include the schema that applies to the given package").description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-a8506fde.cjs.js'); }).then((m) => m.default)));
251
+ program.command("config:print").option("--package <name>", "Only load config schema that applies to the given package").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("--format <format>", "Format to print the configuration in, either json or yaml [yaml]").option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-5e70799c.cjs.js'); }).then((m) => m.default)));
252
+ program.command("config:check").option("--package <name>", "Only load config schema that applies to the given package").option("--lax", "Do not require environment variables to be set").option("--frontend", "Only validate the frontend configuration").option(...configOption).description("Validate that the given configuration loads and matches schema").action(lazy(() => Promise.resolve().then(function () { return require('./validate-9907afbb.cjs.js'); }).then((m) => m.default)));
253
+ program.command("config:schema").option("--package <name>", "Only output config schema that applies to the given package").option("--format <format>", "Format to print the schema in, either json or yaml [yaml]").description("Print configuration schema").action(lazy(() => Promise.resolve().then(function () { return require('./schema-80516b43.cjs.js'); }).then((m) => m.default)));
254
+ program.command("versions:bump").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-24057de2.cjs.js'); }).then((m) => m.default)));
255
+ 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-a78b8bb6.cjs.js'); }).then((m) => m.default)));
256
+ program.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-f474f79b.cjs.js'); }).then((m) => m.pre)));
257
+ program.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-f474f79b.cjs.js'); }).then((m) => m.post)));
258
+ program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-ecf90e6b.cjs.js'); }).then((m) => m.default)));
259
+ program.command("build-workspace <workspace-dir> ...<packages>").description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-29b42a0b.cjs.js'); }).then((m) => m.default)));
260
+ program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-9cf6e421.cjs.js'); }).then((m) => m.default)));
261
+ program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-d8ce894c.cjs.js'); }).then((m) => m.default)));
262
+ program.command("install [plugin-id]", { hidden: true }).option("--from <packageJsonFilePath>", "Install from a local package.json containing the installation recipe").description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-9e5b8576.cjs.js'); }).then((m) => m.default)));
261
263
  }
262
264
  function lazy(getActionFunc) {
263
265
  return async (...args) => {
@@ -273,16 +275,16 @@ function lazy(getActionFunc) {
273
275
  }
274
276
 
275
277
  const main = (argv) => {
276
- program__default['default'].name("backstage-cli").version(version);
277
- registerCommands(program__default['default']);
278
- program__default['default'].on("command:*", () => {
278
+ program__default["default"].name("backstage-cli").version(version);
279
+ registerCommands(program__default["default"]);
280
+ program__default["default"].on("command:*", () => {
279
281
  console.log();
280
- console.log(chalk__default['default'].red(`Invalid command: ${program__default['default'].args.join(" ")}`));
282
+ console.log(chalk__default["default"].red(`Invalid command: ${program__default["default"].args.join(" ")}`));
281
283
  console.log();
282
- program__default['default'].outputHelp();
284
+ program__default["default"].outputHelp();
283
285
  process.exit(1);
284
286
  });
285
- program__default['default'].parse(argv);
287
+ program__default["default"].parse(argv);
286
288
  };
287
289
  process.on("unhandledRejection", (rejection) => {
288
290
  if (rejection instanceof Error) {
@@ -300,5 +302,5 @@ exports.dependencies = dependencies;
300
302
  exports.devDependencies = devDependencies;
301
303
  exports.paths = paths;
302
304
  exports.version = version;
303
- exports.version$1 = version$7;
304
- //# sourceMappingURL=index-6fee1c9a.cjs.js.map
305
+ exports.version$1 = version$8;
306
+ //# sourceMappingURL=index-b2152549.cjs.js.map
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-6fee1c9a.cjs.js');
3
+ var index = require('./index-b2152549.cjs.js');
4
4
  var os = require('os');
5
- var run = require('./run-59c4395e.cjs.js');
6
- var Lockfile = require('./Lockfile-80f0eec4.cjs.js');
5
+ var run = require('./run-8388d249.cjs.js');
6
+ var Lockfile = require('./Lockfile-35661afa.cjs.js');
7
7
  require('chalk');
8
8
  require('commander');
9
9
  require('fs-extra');
@@ -23,7 +23,7 @@ var info = async () => {
23
23
  await new Promise(async () => {
24
24
  const yarnVersion = await run.runPlain("yarn --version");
25
25
  const isLocal = require("fs").existsSync(index.paths.resolveOwn("./src"));
26
- console.log(`OS: ${os__default['default'].type} ${os__default['default'].release} - ${os__default['default'].platform}/${os__default['default'].arch}`);
26
+ console.log(`OS: ${os__default["default"].type} ${os__default["default"].release} - ${os__default["default"].platform}/${os__default["default"].arch}`);
27
27
  console.log(`node: ${process.version}`);
28
28
  console.log(`yarn: ${yarnVersion}`);
29
29
  console.log(`cli: ${index.version$1} (${isLocal ? "local" : "installed"})`);
@@ -40,5 +40,5 @@ var info = async () => {
40
40
  });
41
41
  };
42
42
 
43
- exports.default = info;
44
- //# sourceMappingURL=info-5e7c2679.cjs.js.map
43
+ exports["default"] = info;
44
+ //# sourceMappingURL=info-d8ce894c.cjs.js.map
@@ -3,12 +3,12 @@
3
3
  var fs = require('fs-extra');
4
4
  require('semver');
5
5
  require('@yarnpkg/lockfile');
6
- var packages = require('./packages-a5b6a3df.cjs.js');
7
- var index = require('./index-6fee1c9a.cjs.js');
6
+ var packages = require('./packages-bcde9079.cjs.js');
7
+ var index = require('./index-b2152549.cjs.js');
8
8
  var chalk = require('chalk');
9
9
  var sortBy = require('lodash/sortBy');
10
10
  var groupBy = require('lodash/groupBy');
11
- var run = require('./run-59c4395e.cjs.js');
11
+ var run = require('./run-8388d249.cjs.js');
12
12
  require('commander');
13
13
  require('@backstage/cli-common');
14
14
  require('@backstage/config/package.json');
@@ -33,9 +33,9 @@ class AppRouteStep {
33
33
  }
34
34
  async run() {
35
35
  var _a;
36
- const {path, element, packageName} = this.data;
36
+ const { path, element, packageName } = this.data;
37
37
  const appTsxPath = index.paths.resolveTargetRoot("packages/app/src/App.tsx");
38
- const contents = await fs__default['default'].readFile(appTsxPath, "utf-8");
38
+ const contents = await fs__default["default"].readFile(appTsxPath, "utf-8");
39
39
  let failed = false;
40
40
  const contentsWithRoute = contents.replace(/(\s*)<\/FlatRoutes>/, `$1 <Route path="${path}" element={${element}} />$1</FlatRoutes>`);
41
41
  if (contentsWithRoute === contents) {
@@ -56,21 +56,21 @@ import `);
56
56
  console.log(`1. import { ${componentName} } from '${packageName}';`);
57
57
  console.log(`2. <Route path="${path}" element={${element}} />`);
58
58
  } else {
59
- await fs__default['default'].writeFile(appTsxPath, contentsWithImport);
59
+ await fs__default["default"].writeFile(appTsxPath, contentsWithImport);
60
60
  }
61
61
  }
62
62
  }
63
63
  const appRoute = createStepDefinition({
64
64
  type: "app-route",
65
65
  deserialize(obj, pkg) {
66
- const {path, element} = obj;
66
+ const { path, element } = obj;
67
67
  if (!path || typeof path !== "string") {
68
68
  throw new Error("Invalid install step, 'path' must be a string");
69
69
  }
70
70
  if (!element || typeof element !== "string") {
71
71
  throw new Error("Invalid install step, 'element' must be a string");
72
72
  }
73
- return new AppRouteStep({path, element, packageName: pkg.name});
73
+ return new AppRouteStep({ path, element, packageName: pkg.name });
74
74
  },
75
75
  create(data) {
76
76
  return new AppRouteStep(data);
@@ -82,23 +82,23 @@ class DependenciesStep {
82
82
  this.data = data;
83
83
  }
84
84
  async run() {
85
- const {dependencies: dependencies2} = this.data;
86
- const byTarget = groupBy__default['default'](dependencies2, "target");
85
+ const { dependencies: dependencies2 } = this.data;
86
+ const byTarget = groupBy__default["default"](dependencies2, "target");
87
87
  for (const [target, deps] of Object.entries(byTarget)) {
88
88
  const pkgPath = index.paths.resolveTargetRoot(target, "package.json");
89
- const pkgJson = await fs__default['default'].readJson(pkgPath);
90
- const depTypes = new Set();
89
+ const pkgJson = await fs__default["default"].readJson(pkgPath);
90
+ const depTypes = /* @__PURE__ */ new Set();
91
91
  for (const dep of deps) {
92
92
  depTypes.add(dep.type);
93
93
  pkgJson[dep.type][dep.name] = dep.query;
94
94
  }
95
95
  for (const depType of depTypes) {
96
- pkgJson[depType] = Object.fromEntries(sortBy__default['default'](Object.entries(pkgJson[depType]), ([key]) => key));
96
+ pkgJson[depType] = Object.fromEntries(sortBy__default["default"](Object.entries(pkgJson[depType]), ([key]) => key));
97
97
  }
98
- await fs__default['default'].writeJson(pkgPath, pkgJson, {spaces: 2});
98
+ await fs__default["default"].writeJson(pkgPath, pkgJson, { spaces: 2 });
99
99
  }
100
100
  console.log();
101
- console.log(`Running ${chalk__default['default'].blue("yarn install")} to install new versions`);
101
+ console.log(`Running ${chalk__default["default"].blue("yarn install")} to install new versions`);
102
102
  console.log();
103
103
  await run.run("yarn", ["install"]);
104
104
  }
@@ -124,11 +124,11 @@ class MessageStep {
124
124
  const message = createStepDefinition({
125
125
  type: "message",
126
126
  deserialize(obj) {
127
- const {message: msg} = obj;
127
+ const { message: msg } = obj;
128
128
  if (!msg || typeof msg !== "string" && !Array.isArray(msg)) {
129
129
  throw new Error("Invalid install step, 'message' must be a string or array");
130
130
  }
131
- return new MessageStep({message: [msg].flat().join("")});
131
+ return new MessageStep({ message: [msg].flat().join("") });
132
132
  },
133
133
  create(data) {
134
134
  return new MessageStep(data);
@@ -173,10 +173,10 @@ class PluginInstaller {
173
173
  });
174
174
  steps.push({
175
175
  type: "dependencies",
176
- step: dependencies.create({dependencies: dependencies$1})
176
+ step: dependencies.create({ dependencies: dependencies$1 })
177
177
  });
178
178
  for (const step of (_b = (_a = pkg.experimentalInstallationRecipe) == null ? void 0 : _a.steps) != null ? _b : []) {
179
- const {type} = step;
179
+ const { type } = step;
180
180
  const definition = stepDefinitions.find((d) => d.type === type);
181
181
  if (definition) {
182
182
  steps.push({
@@ -190,7 +190,7 @@ class PluginInstaller {
190
190
  return steps;
191
191
  }
192
192
  async run() {
193
- for (const {type, step} of this.steps) {
193
+ for (const { type, step } of this.steps) {
194
194
  console.log(`Running step ${type}`);
195
195
  await step.run();
196
196
  }
@@ -201,7 +201,7 @@ var install = async (pluginId, cmd) => {
201
201
  if (pluginId) {
202
202
  pkg = await fetchPluginPackage(pluginId);
203
203
  } else if (cmd == null ? void 0 : cmd.from) {
204
- pkg = await fs__default['default'].readJson(cmd.from);
204
+ pkg = await fs__default["default"].readJson(cmd.from);
205
205
  } else {
206
206
  throw new Error("Missing both <plugin-id> or a package.json file path in the --from flag.");
207
207
  }
@@ -210,5 +210,5 @@ var install = async (pluginId, cmd) => {
210
210
  await installer.run();
211
211
  };
212
212
 
213
- exports.default = install;
214
- //# sourceMappingURL=install-5920b5df.cjs.js.map
213
+ exports["default"] = install;
214
+ //# sourceMappingURL=install-9e5b8576.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var run = require('./run-59c4395e.cjs.js');
4
- var index = require('./index-6fee1c9a.cjs.js');
3
+ var run = require('./run-8388d249.cjs.js');
4
+ var index = require('./index-b2152549.cjs.js');
5
5
  require('child_process');
6
6
  require('util');
7
7
  require('@backstage/errors');
@@ -25,5 +25,5 @@ var lint = async (cmd, cmdArgs) => {
25
25
  await run.run("eslint", args);
26
26
  };
27
27
 
28
- exports.default = lint;
29
- //# sourceMappingURL=lint-306bb8fe.cjs.js.map
28
+ exports["default"] = lint;
29
+ //# sourceMappingURL=lint-955bc62d.cjs.js.map
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var Lockfile = require('./Lockfile-80f0eec4.cjs.js');
4
- require('./run-59c4395e.cjs.js');
3
+ var Lockfile = require('./Lockfile-35661afa.cjs.js');
4
+ require('./run-8388d249.cjs.js');
5
5
  require('chalk');
6
- var index = require('./index-6fee1c9a.cjs.js');
6
+ var index = require('./index-b2152549.cjs.js');
7
7
  var partition = require('lodash/partition');
8
8
  require('fs-extra');
9
9
  require('semver');
@@ -42,14 +42,14 @@ var lint = async (cmd) => {
42
42
  lockfile.replaceVersions(result.newVersions);
43
43
  await lockfile.save();
44
44
  } else {
45
- const [newVersionsForbidden, newVersionsAllowed] = partition__default['default'](result.newVersions, ({name}) => forbiddenDuplicatesFilter(name));
45
+ const [newVersionsForbidden, newVersionsAllowed] = partition__default["default"](result.newVersions, ({ name }) => forbiddenDuplicatesFilter(name));
46
46
  if (newVersionsForbidden.length && !fix) {
47
47
  success = false;
48
48
  }
49
49
  logArray(newVersionsForbidden, "The following packages must be deduplicated, this can be done automatically with --fix", (e) => ` ${e.name} @ ${e.range} bumped from ${e.oldVersion} to ${e.newVersion}`);
50
50
  logArray(newVersionsAllowed, "The following packages can be deduplicated, this can be done automatically with --fix", (e) => ` ${e.name} @ ${e.range} bumped from ${e.oldVersion} to ${e.newVersion}`);
51
51
  }
52
- const [newRangesForbidden, newRangesAllowed] = partition__default['default'](result.newRanges, ({name}) => forbiddenDuplicatesFilter(name));
52
+ const [newRangesForbidden, newRangesAllowed] = partition__default["default"](result.newRanges, ({ name }) => forbiddenDuplicatesFilter(name));
53
53
  if (newRangesForbidden.length) {
54
54
  success = false;
55
55
  }
@@ -71,7 +71,7 @@ function logArray(arr, header, each) {
71
71
  console.log();
72
72
  }
73
73
 
74
- exports.default = lint;
74
+ exports["default"] = lint;
75
75
  exports.forbiddenDuplicatesFilter = forbiddenDuplicatesFilter;
76
76
  exports.includedFilter = includedFilter;
77
- //# sourceMappingURL=lint-6175d471.cjs.js.map
77
+ //# sourceMappingURL=lint-a78b8bb6.cjs.js.map