@backstage/cli 0.10.0 → 0.10.4

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 (43) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/config/jest.js +5 -3
  3. package/dist/cjs/{Lockfile-80f0eec4.cjs.js → Lockfile-35661afa.cjs.js} +18 -18
  4. package/dist/cjs/{build-555a7349.cjs.js → build-16f16d70.cjs.js} +9 -9
  5. package/dist/cjs/{build-8652aa69.cjs.js → build-ba4675b9.cjs.js} +8 -7
  6. package/dist/cjs/{build-be463597.cjs.js → build-e7dbdd80.cjs.js} +23 -23
  7. package/dist/cjs/{build-b5fb2b35.cjs.js → build-f3921423.cjs.js} +8 -7
  8. package/dist/cjs/{buildWorkspace-79c93924.cjs.js → buildWorkspace-a573304e.cjs.js} +6 -6
  9. package/dist/cjs/{bump-53a961f8.cjs.js → bump-0acacde9.cjs.js} +36 -36
  10. package/dist/cjs/{bundle-64a797f5.cjs.js → bundle-8bcde9c4.cjs.js} +15 -15
  11. package/dist/cjs/{clean-a28705b5.cjs.js → clean-f5d3a3ff.cjs.js} +6 -6
  12. package/dist/cjs/{config-3816244a.cjs.js → config-02308249.cjs.js} +17 -9
  13. package/dist/cjs/{create-d5e65154.cjs.js → create-2c1328b1.cjs.js} +41 -41
  14. package/dist/cjs/{createPlugin-77a95bbd.cjs.js → createPlugin-33636b2b.cjs.js} +31 -31
  15. package/dist/cjs/{dev-3b68b882.cjs.js → dev-c74959e4.cjs.js} +8 -8
  16. package/dist/cjs/{diff-7238cc6c.cjs.js → diff-d393a7d6.cjs.js} +39 -32
  17. package/dist/cjs/{docs-f46d6945.cjs.js → docs-43abe831.cjs.js} +6 -6
  18. package/dist/cjs/{index-8a512334.cjs.js → index-60792ea9.cjs.js} +65 -68
  19. package/dist/cjs/{index-05328067.cjs.js → index-d1f94b33.cjs.js} +15 -15
  20. package/dist/cjs/{index-c8a3517a.cjs.js → index-f5dcae68.cjs.js} +14 -14
  21. package/dist/cjs/{info-a069f3b4.cjs.js → info-f260605b.cjs.js} +6 -6
  22. package/dist/cjs/{install-43a8076b.cjs.js → install-db22d18d.cjs.js} +60 -33
  23. package/dist/cjs/{lint-60658813.cjs.js → lint-0c8dd45e.cjs.js} +5 -5
  24. package/dist/cjs/{lint-0053aded.cjs.js → lint-f4a40773.cjs.js} +7 -7
  25. package/dist/cjs/{pack-a4246579.cjs.js → pack-f5669e4f.cjs.js} +6 -6
  26. package/dist/cjs/{packager-b1a183ad.cjs.js → packager-ce069fd1.cjs.js} +37 -35
  27. package/dist/cjs/{packages-562fcd14.cjs.js → packages-587c99dd.cjs.js} +5 -5
  28. package/dist/cjs/{paths-f77bdf66.cjs.js → paths-8d6dfec1.cjs.js} +62 -46
  29. package/dist/cjs/{print-db876002.cjs.js → print-5db03c66.cjs.js} +5 -5
  30. package/dist/cjs/{removePlugin-1379b63a.cjs.js → removePlugin-5984ee26.cjs.js} +30 -30
  31. package/dist/cjs/{run-bacdaaf1.cjs.js → run-8b1e277a.cjs.js} +5 -5
  32. package/dist/cjs/{schema-3fe57ce7.cjs.js → schema-37d6a972.cjs.js} +5 -5
  33. package/dist/cjs/{serve-e89d4ea4.cjs.js → serve-aaec7087.cjs.js} +15 -15
  34. package/dist/cjs/{serve-a9cf4184.cjs.js → serve-bfb3e982.cjs.js} +10 -10
  35. package/dist/cjs/{server-4f0e40d3.cjs.js → server-d9492b36.cjs.js} +6 -6
  36. package/dist/cjs/{svgrTemplate-2d0d15cf.cjs.js → svgrTemplate-f19e974c.cjs.js} +3 -3
  37. package/dist/cjs/{tasks-29b7d09e.cjs.js → tasks-94b21b51.cjs.js} +29 -29
  38. package/dist/cjs/{testCommand-5602a58f.cjs.js → testCommand-0c162b80.cjs.js} +4 -4
  39. package/dist/cjs/{validate-9b1a5456.cjs.js → validate-89d918a7.cjs.js} +4 -4
  40. package/dist/index.cjs.js +1 -1
  41. package/package.json +18 -21
  42. package/templates/default-plugin/package.json.hbs +3 -2
  43. package/templates/serve_index.html +1 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var fs = require('fs-extra');
4
- var index = require('./index-8a512334.cjs.js');
4
+ var index = require('./index-60792ea9.cjs.js');
5
5
  var webpack = require('webpack');
6
- var paths = require('./paths-f77bdf66.cjs.js');
6
+ var paths = require('./paths-8d6dfec1.cjs.js');
7
7
  require('commander');
8
8
  require('chalk');
9
9
  require('semver');
@@ -19,8 +19,8 @@ require('webpack-node-externals');
19
19
  require('terser-webpack-plugin');
20
20
  require('./parallel-a4714c72.cjs.js');
21
21
  require('mini-css-extract-plugin');
22
- require('./svgrTemplate-2d0d15cf.cjs.js');
23
- require('./run-bacdaaf1.cjs.js');
22
+ require('./svgrTemplate-f19e974c.cjs.js');
23
+ require('./run-8b1e277a.cjs.js');
24
24
  require('child_process');
25
25
  require('util');
26
26
  require('lodash/pickBy');
@@ -36,7 +36,7 @@ async function serveBackend(options) {
36
36
  ...options,
37
37
  isDev: true
38
38
  });
39
- const compiler = webpack__default['default'](config, (err) => {
39
+ const compiler = webpack__default["default"](config, (err) => {
40
40
  if (err) {
41
41
  console.error(err);
42
42
  } else
@@ -56,7 +56,7 @@ async function serveBackend(options) {
56
56
  }
57
57
 
58
58
  var dev = async (cmd) => {
59
- await fs__default['default'].remove(index.paths.resolveTarget("dist"));
59
+ await fs__default["default"].remove(index.paths.resolveTarget("dist"));
60
60
  const waitForExit = await serveBackend({
61
61
  entry: "src/index",
62
62
  checksEnabled: cmd.check,
@@ -66,5 +66,5 @@ var dev = async (cmd) => {
66
66
  await waitForExit();
67
67
  };
68
68
 
69
- exports.default = dev;
70
- //# sourceMappingURL=dev-3b68b882.cjs.js.map
69
+ exports["default"] = dev;
70
+ //# sourceMappingURL=dev-c74959e4.cjs.js.map
@@ -7,7 +7,7 @@ var path = require('path');
7
7
  var inquirer = require('inquirer');
8
8
  var handlebars = require('handlebars');
9
9
  var recursive = require('recursive-readdir');
10
- var index = require('./index-8a512334.cjs.js');
10
+ var index = require('./index-60792ea9.cjs.js');
11
11
  require('commander');
12
12
  require('semver');
13
13
  require('@backstage/cli-common');
@@ -38,7 +38,7 @@ class PackageJsonHandler {
38
38
  this.targetPkg = targetPkg;
39
39
  this.variant = variant;
40
40
  }
41
- static async handler({path, write, missing, targetContents, templateContents}, prompt, variant) {
41
+ static async handler({ path, write, missing, targetContents, templateContents }, prompt, variant) {
42
42
  console.log("Checking package.json");
43
43
  if (missing) {
44
44
  throw new Error(`${path} doesn't exist`);
@@ -61,18 +61,20 @@ class PackageJsonHandler {
61
61
  await this.syncScripts();
62
62
  await this.syncPublishConfig();
63
63
  await this.syncDependencies("dependencies");
64
+ await this.syncDependencies("peerDependencies", true);
64
65
  await this.syncDependencies("devDependencies");
66
+ await this.syncReactDeps();
65
67
  }
66
68
  async syncField(fieldName, obj = this.pkg, targetObj = this.targetPkg, prefix, sort, optional) {
67
- const fullFieldName = chalk__default['default'].cyan(prefix ? `${prefix}[${fieldName}]` : fieldName);
69
+ const fullFieldName = chalk__default["default"].cyan(prefix ? `${prefix}[${fieldName}]` : fieldName);
68
70
  const newValue = obj[fieldName];
69
- const coloredNewValue = chalk__default['default'].cyan(JSON.stringify(newValue));
71
+ const coloredNewValue = chalk__default["default"].cyan(JSON.stringify(newValue));
70
72
  if (fieldName in targetObj) {
71
73
  const oldValue = targetObj[fieldName];
72
74
  if (JSON.stringify(oldValue) === JSON.stringify(newValue)) {
73
75
  return;
74
76
  }
75
- const coloredOldValue = chalk__default['default'].cyan(JSON.stringify(oldValue));
77
+ const coloredOldValue = chalk__default["default"].cyan(JSON.stringify(oldValue));
76
78
  const msg = `package.json has mismatched field, ${fullFieldName}, change from ${coloredOldValue} to ${coloredNewValue}?`;
77
79
  if (await this.prompt(msg)) {
78
80
  targetObj[fieldName] = newValue;
@@ -92,7 +94,7 @@ class PackageJsonHandler {
92
94
  }
93
95
  }
94
96
  async syncFiles() {
95
- const {configSchema} = this.targetPkg;
97
+ const { configSchema } = this.targetPkg;
96
98
  const hasSchemaFile = typeof configSchema === "string";
97
99
  if (!this.targetPkg.files) {
98
100
  const expected = hasSchemaFile ? ["dist", configSchema] : ["dist"];
@@ -145,10 +147,10 @@ class PackageJsonHandler {
145
147
  }
146
148
  }
147
149
  }
148
- async syncDependencies(fieldName) {
150
+ async syncDependencies(fieldName, required = false) {
149
151
  const pkgDeps = this.pkg[fieldName];
150
152
  const targetDeps = this.targetPkg[fieldName] = this.targetPkg[fieldName] || {};
151
- if (!pkgDeps) {
153
+ if (!pkgDeps && !required) {
152
154
  return;
153
155
  }
154
156
  await this.syncField("@backstage/core", {}, targetDeps, fieldName, true);
@@ -157,17 +159,22 @@ class PackageJsonHandler {
157
159
  if (this.variant === "app" && key.startsWith("plugin-")) {
158
160
  continue;
159
161
  }
160
- await this.syncField(key, pkgDeps, targetDeps, fieldName, true, true);
162
+ await this.syncField(key, pkgDeps, targetDeps, fieldName, true, !required);
161
163
  }
162
164
  }
165
+ async syncReactDeps() {
166
+ const targetDeps = this.targetPkg.dependencies = this.targetPkg.dependencies || {};
167
+ await this.syncField("react", {}, targetDeps, "dependencies");
168
+ await this.syncField("react-dom", {}, targetDeps, "dependencies");
169
+ }
163
170
  async write() {
164
171
  await this.writeFunc(`${JSON.stringify(this.targetPkg, null, 2)}
165
172
  `);
166
173
  }
167
174
  }
168
- async function exactMatchHandler({path, write, missing, targetContents, templateContents}, prompt) {
175
+ async function exactMatchHandler({ path, write, missing, targetContents, templateContents }, prompt) {
169
176
  console.log(`Checking ${path}`);
170
- const coloredPath = chalk__default['default'].cyan(path);
177
+ const coloredPath = chalk__default["default"].cyan(path);
171
178
  if (missing) {
172
179
  if (await prompt(`Missing ${coloredPath}, do you want to add it?`)) {
173
180
  await write(templateContents);
@@ -180,9 +187,9 @@ async function exactMatchHandler({path, write, missing, targetContents, template
180
187
  const diffs = diff$1.diffLines(targetContents, templateContents);
181
188
  for (const diff of diffs) {
182
189
  if (diff.added) {
183
- process.stdout.write(chalk__default['default'].green(`+${diff.value}`));
190
+ process.stdout.write(chalk__default["default"].green(`+${diff.value}`));
184
191
  } else if (diff.removed) {
185
- process.stdout.write(chalk__default['default'].red(`-${diff.value}`));
192
+ process.stdout.write(chalk__default["default"].red(`-${diff.value}`));
186
193
  } else {
187
194
  process.stdout.write(` ${diff.value}`);
188
195
  }
@@ -191,9 +198,9 @@ async function exactMatchHandler({path, write, missing, targetContents, template
191
198
  await write(templateContents);
192
199
  }
193
200
  }
194
- async function existsHandler({path, write, missing, templateContents}, prompt) {
201
+ async function existsHandler({ path, write, missing, templateContents }, prompt) {
195
202
  console.log(`Making sure ${path} exists`);
196
- const coloredPath = chalk__default['default'].cyan(path);
203
+ const coloredPath = chalk__default["default"].cyan(path);
197
204
  if (missing) {
198
205
  if (await prompt(`Missing ${coloredPath}, do you want to add it?`)) {
199
206
  await write(templateContents);
@@ -201,7 +208,7 @@ async function existsHandler({path, write, missing, templateContents}, prompt) {
201
208
  return;
202
209
  }
203
210
  }
204
- async function skipHandler({path}) {
211
+ async function skipHandler({ path }) {
205
212
  console.log(`Skipping ${path}`);
206
213
  }
207
214
  const handlers = {
@@ -224,10 +231,10 @@ async function handleAllFiles(fileHandlers, files, promptFunc) {
224
231
  }
225
232
 
226
233
  const inquirerPromptFunc = async (msg) => {
227
- const {result} = await inquirer__default['default'].prompt({
234
+ const { result } = await inquirer__default["default"].prompt({
228
235
  type: "confirm",
229
236
  name: "result",
230
- message: chalk__default['default'].blue(msg)
237
+ message: chalk__default["default"].blue(msg)
231
238
  });
232
239
  return result;
233
240
  };
@@ -235,7 +242,7 @@ const makeCheckPromptFunc = () => {
235
242
  let failed = false;
236
243
  const promptFunc = async (msg) => {
237
244
  failed = true;
238
- console.log(chalk__default['default'].red(`[Check Failed] ${msg}`));
245
+ console.log(chalk__default["default"].red(`[Check Failed] ${msg}`));
239
246
  return false;
240
247
  };
241
248
  const finalize = () => {
@@ -251,12 +258,12 @@ const yesPromptFunc = async (msg) => {
251
258
  };
252
259
 
253
260
  async function readTemplateFile(templateFile, templateVars) {
254
- const contents = await fs__default['default'].readFile(templateFile, "utf8");
261
+ const contents = await fs__default["default"].readFile(templateFile, "utf8");
255
262
  if (!templateFile.endsWith(".hbs")) {
256
263
  return contents;
257
264
  }
258
265
  const packageVersionProvider = index.createPackageVersionProvider(void 0);
259
- return handlebars__default['default'].compile(contents)(templateVars, {
266
+ return handlebars__default["default"].compile(contents)(templateVars, {
260
267
  helpers: {
261
268
  versionQuery(name, hint) {
262
269
  return packageVersionProvider(name, typeof hint === "string" ? hint : void 0);
@@ -265,28 +272,28 @@ async function readTemplateFile(templateFile, templateVars) {
265
272
  });
266
273
  }
267
274
  async function readTemplate(templateDir, templateVars) {
268
- const templateFilePaths = await recursive__default['default'](templateDir).catch((error) => {
275
+ const templateFilePaths = await recursive__default["default"](templateDir).catch((error) => {
269
276
  throw new Error(`Failed to read template directory: ${error.message}`);
270
277
  });
271
278
  const templatedFiles = new Array();
272
279
  for (const templateFile of templateFilePaths) {
273
280
  const path$1 = path.relative(templateDir, templateFile).replace(/\.hbs$/, "");
274
281
  const contents = await readTemplateFile(templateFile, templateVars);
275
- templatedFiles.push({path: path$1, contents});
282
+ templatedFiles.push({ path: path$1, contents });
276
283
  }
277
284
  return templatedFiles;
278
285
  }
279
286
  async function diffTemplatedFiles(targetDir, templatedFiles) {
280
287
  const fileDiffs = new Array();
281
- for (const {path: path$1, contents: templateContents} of templatedFiles) {
288
+ for (const { path: path$1, contents: templateContents } of templatedFiles) {
282
289
  const targetPath = path.resolve(targetDir, path$1);
283
- const targetExists = await fs__default['default'].pathExists(targetPath);
290
+ const targetExists = await fs__default["default"].pathExists(targetPath);
284
291
  const write = async (contents) => {
285
- await fs__default['default'].ensureDir(path.dirname(targetPath));
286
- await fs__default['default'].writeFile(targetPath, contents, "utf8");
292
+ await fs__default["default"].ensureDir(path.dirname(targetPath));
293
+ await fs__default["default"].writeFile(targetPath, contents, "utf8");
287
294
  };
288
295
  if (targetExists) {
289
- const targetContents = await fs__default['default'].readFile(targetPath, "utf8");
296
+ const targetContents = await fs__default["default"].readFile(targetPath, "utf8");
290
297
  fileDiffs.push({
291
298
  path: path$1,
292
299
  write,
@@ -364,14 +371,14 @@ async function readPluginData() {
364
371
  } catch (error) {
365
372
  throw new Error(`Failed to read target package, ${error}`);
366
373
  }
367
- const pluginTsContents = await fs__default['default'].readFile(index.paths.resolveTarget("src/plugin.ts"), "utf8");
374
+ const pluginTsContents = await fs__default["default"].readFile(index.paths.resolveTarget("src/plugin.ts"), "utf8");
368
375
  const pluginIdMatch = pluginTsContents.match(/id: ['"`](.+?)['"`]/);
369
376
  if (!pluginIdMatch) {
370
377
  throw new Error(`Failed to parse plugin.ts, no plugin ID found`);
371
378
  }
372
379
  const id = pluginIdMatch[1];
373
- return {id, name, privatePackage, pluginVersion, npmRegistry};
380
+ return { id, name, privatePackage, pluginVersion, npmRegistry };
374
381
  }
375
382
 
376
- exports.default = diff;
377
- //# sourceMappingURL=diff-7238cc6c.cjs.js.map
383
+ exports["default"] = diff;
384
+ //# sourceMappingURL=diff-d393a7d6.cjs.js.map
@@ -2,9 +2,9 @@
2
2
 
3
3
  var configLoader = require('@backstage/config-loader');
4
4
  var openBrowser = require('react-dev-utils/openBrowser');
5
- var config = require('./config-3816244a.cjs.js');
5
+ var config = require('./config-02308249.cjs.js');
6
6
  require('@backstage/config');
7
- require('./index-8a512334.cjs.js');
7
+ require('./index-60792ea9.cjs.js');
8
8
  require('commander');
9
9
  require('chalk');
10
10
  require('fs-extra');
@@ -19,14 +19,14 @@ var openBrowser__default = /*#__PURE__*/_interopDefaultLegacy(openBrowser);
19
19
 
20
20
  const DOCS_URL = "https://config.backstage.io";
21
21
  var docs = async (cmd) => {
22
- const {schema: appSchemas} = await config.loadCliConfig({
22
+ const { schema: appSchemas } = await config.loadCliConfig({
23
23
  args: [],
24
24
  fromPackage: cmd.package,
25
25
  mockEnv: true
26
26
  });
27
27
  const schema = configLoader.mergeConfigSchemas(appSchemas.serialize().schemas.map((_) => _.value));
28
- openBrowser__default['default'](`${DOCS_URL}#schema=${JSON.stringify(schema)}`);
28
+ openBrowser__default["default"](`${DOCS_URL}#schema=${JSON.stringify(schema)}`);
29
29
  };
30
30
 
31
- exports.default = docs;
32
- //# sourceMappingURL=docs-f46d6945.cjs.js.map
31
+ exports["default"] = docs;
32
+ //# sourceMappingURL=docs-43abe831.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,13 +46,13 @@ class NotFoundError extends CustomError {
46
46
 
47
47
  const paths = cliCommon.findPaths(__dirname);
48
48
 
49
- var version$9 = "0.9.12";
49
+ var version$9 = "0.10.1";
50
50
 
51
- var version$8 = "0.10.0";
51
+ var version$8 = "0.10.4";
52
52
  var dependencies = {
53
53
  "@backstage/cli-common": "^0.1.6",
54
54
  "@backstage/config": "^0.1.11",
55
- "@backstage/config-loader": "^0.8.1",
55
+ "@backstage/config-loader": "^0.9.1",
56
56
  "@backstage/errors": "^0.1.5",
57
57
  "@backstage/types": "^0.1.1",
58
58
  "@hot-loader/react-dom": "^16.13.0",
@@ -60,9 +60,9 @@ var dependencies = {
60
60
  "@lerna/project": "^4.0.0",
61
61
  "@octokit/request": "^5.4.12",
62
62
  "@rollup/plugin-commonjs": "^21.0.1",
63
- "@rollup/plugin-json": "^4.0.2",
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",
@@ -73,7 +73,7 @@ var dependencies = {
73
73
  "@svgr/rollup": "5.5.x",
74
74
  "@svgr/webpack": "5.5.x",
75
75
  "@types/webpack-env": "^1.15.2",
76
- "@typescript-eslint/eslint-plugin": "^v4.30.0",
76
+ "@typescript-eslint/eslint-plugin": "^v4.33.0",
77
77
  "@typescript-eslint/parser": "^v4.28.3",
78
78
  "@yarnpkg/lockfile": "^1.1.0",
79
79
  bfj: "^7.0.2",
@@ -82,9 +82,8 @@ var dependencies = {
82
82
  chokidar: "^3.3.1",
83
83
  commander: "^6.1.0",
84
84
  "css-loader": "^5.2.6",
85
- dashify: "^2.0.0",
86
85
  diff: "^5.0.0",
87
- esbuild: "^0.8.56",
86
+ esbuild: "^0.14.1",
88
87
  eslint: "^7.30.0",
89
88
  "eslint-config-prettier": "^8.3.0",
90
89
  "eslint-formatter-friendly": "^7.0.0",
@@ -111,14 +110,13 @@ var dependencies = {
111
110
  ora: "^5.3.0",
112
111
  postcss: "^8.1.0",
113
112
  process: "^0.11.10",
114
- react: "^16.0.0",
115
113
  "react-dev-utils": "^12.0.0-next.47",
116
114
  "react-hot-loader": "^4.12.21",
117
115
  "recursive-readdir": "^2.2.2",
118
116
  "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",
117
+ rollup: "^2.60.2",
118
+ "rollup-plugin-dts": "^4.0.1",
119
+ "rollup-plugin-esbuild": "^4.7.2",
122
120
  "rollup-plugin-peer-deps-external": "^2.2.2",
123
121
  "rollup-plugin-postcss": "^4.0.0",
124
122
  "rollup-pluginutils": "^2.8.2",
@@ -128,7 +126,6 @@ var dependencies = {
128
126
  sucrase: "^3.20.2",
129
127
  tar: "^6.1.2",
130
128
  "terser-webpack-plugin": "^5.1.3",
131
- "ts-loader": "^8.0.17",
132
129
  typescript: "^4.0.3",
133
130
  util: "^0.12.3",
134
131
  webpack: "^5.48.0",
@@ -139,25 +136,25 @@ var dependencies = {
139
136
  yn: "^4.0.0"
140
137
  };
141
138
  var devDependencies = {
142
- "@backstage/backend-common": "^0.9.12",
139
+ "@backstage/backend-common": "^0.10.1",
143
140
  "@backstage/config": "^0.1.11",
144
- "@backstage/core-components": "^0.7.6",
145
- "@backstage/core-plugin-api": "^0.2.2",
146
- "@backstage/core-app-api": "^0.1.24",
147
- "@backstage/dev-utils": "^0.2.13",
148
- "@backstage/test-utils": "^0.1.23",
141
+ "@backstage/core-components": "^0.8.2",
142
+ "@backstage/core-plugin-api": "^0.4.0",
143
+ "@backstage/core-app-api": "^0.3.0",
144
+ "@backstage/dev-utils": "^0.2.15",
145
+ "@backstage/test-utils": "^0.2.1",
149
146
  "@backstage/theme": "^0.2.14",
150
147
  "@types/diff": "^5.0.0",
151
148
  "@types/express": "^4.17.6",
152
149
  "@types/fs-extra": "^9.0.1",
153
150
  "@types/http-proxy": "^1.17.4",
154
- "@types/inquirer": "^7.3.1",
151
+ "@types/inquirer": "^8.1.3",
155
152
  "@types/mock-fs": "^4.13.0",
156
153
  "@types/node": "^14.14.32",
157
154
  "@types/recursive-readdir": "^2.2.0",
158
155
  "@types/rollup-plugin-peer-deps-external": "^2.2.0",
159
156
  "@types/rollup-plugin-postcss": "^2.0.0",
160
- "@types/tar": "^4.0.3",
157
+ "@types/tar": "^6.1.1",
161
158
  "@types/terser-webpack-plugin": "^5.0.4",
162
159
  "@types/webpack": "^5.28.0",
163
160
  "@types/webpack-dev-server": "^3.11.5",
@@ -168,19 +165,19 @@ var devDependencies = {
168
165
  "ts-node": "^10.0.0"
169
166
  };
170
167
 
171
- var version$7 = "0.1.24";
168
+ var version$7 = "0.3.0";
172
169
 
173
- var version$6 = "0.7.6";
170
+ var version$6 = "0.8.2";
174
171
 
175
- var version$5 = "0.2.2";
172
+ var version$5 = "0.4.0";
176
173
 
177
- var version$4 = "0.2.13";
174
+ var version$4 = "0.2.15";
178
175
 
179
- var version$3 = "0.1.23";
176
+ var version$3 = "0.2.1";
180
177
 
181
178
  var version$2 = "0.2.14";
182
179
 
183
- var version$1 = "0.15.15";
180
+ var version$1 = "0.15.19";
184
181
 
185
182
  const packageVersions = {
186
183
  "@backstage/backend-common": version$9,
@@ -195,11 +192,11 @@ const packageVersions = {
195
192
  "@backstage/plugin-scaffolder-backend": version$1
196
193
  };
197
194
  function findVersion() {
198
- const pkgContent = fs__default['default'].readFileSync(paths.resolveOwn("package.json"), "utf8");
195
+ const pkgContent = fs__default["default"].readFileSync(paths.resolveOwn("package.json"), "utf8");
199
196
  return JSON.parse(pkgContent).version;
200
197
  }
201
198
  const version = findVersion();
202
- fs__default['default'].pathExistsSync(paths.resolveOwn("src"));
199
+ fs__default["default"].pathExistsSync(paths.resolveOwn("src"));
203
200
  function createPackageVersionProvider(lockfile) {
204
201
  return (name, versionHint) => {
205
202
  var _a;
@@ -212,7 +209,7 @@ function createPackageVersionProvider(lockfile) {
212
209
  if (name.startsWith("@types/") && (lockfileEntries == null ? void 0 : lockfileEntries.some((entry) => entry.range === "*"))) {
213
210
  return "*";
214
211
  }
215
- const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter((entry) => semver__default['default'].satisfies(targetVersion, entry.range));
212
+ const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter((entry) => semver__default["default"].satisfies(targetVersion, entry.range));
216
213
  const highestRange = validRanges == null ? void 0 : validRanges.slice(-1)[0];
217
214
  if (highestRange == null ? void 0 : highestRange.range) {
218
215
  return highestRange == null ? void 0 : highestRange.range;
@@ -220,10 +217,10 @@ function createPackageVersionProvider(lockfile) {
220
217
  if (packageVersion) {
221
218
  return `^${packageVersion}`;
222
219
  }
223
- if ((_a = semver__default['default'].parse(versionHint)) == null ? void 0 : _a.prerelease.length) {
220
+ if ((_a = semver__default["default"].parse(versionHint)) == null ? void 0 : _a.prerelease.length) {
224
221
  return versionHint;
225
222
  }
226
- return `^${versionHint}`;
223
+ return (versionHint == null ? void 0 : versionHint.match(/^[\d\.]+$/)) ? `^${versionHint}` : versionHint;
227
224
  };
228
225
  }
229
226
 
@@ -234,33 +231,33 @@ function registerCommands(program) {
234
231
  (opt, opts) => [...opts, opt],
235
232
  Array()
236
233
  ];
237
- 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-be463597.cjs.js'); }).then((m) => m.default)));
238
- 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-e89d4ea4.cjs.js'); }).then((m) => m.default)));
239
- program.command("backend:build").description("Build a backend plugin").action(lazy(() => Promise.resolve().then(function () { return require('./build-8652aa69.cjs.js'); }).then((m) => m.default)));
240
- 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-64a797f5.cjs.js'); }).then((m) => m.default)));
241
- 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-3b68b882.cjs.js'); }).then((m) => m.default)));
242
- 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-d5e65154.cjs.js'); }).then((m) => m.default)));
243
- 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-77a95bbd.cjs.js'); }).then((m) => m.default)));
244
- program.command("remove-plugin").description("[DEPRECATED] - Removes plugin in the current repository").action(lazy(() => Promise.resolve().then(function () { return require('./removePlugin-1379b63a.cjs.js'); }).then((m) => m.default)));
245
- program.command("plugin:build").description("Build a plugin").action(lazy(() => Promise.resolve().then(function () { return require('./build-b5fb2b35.cjs.js'); }).then((m) => m.default)));
246
- 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-a9cf4184.cjs.js'); }).then((m) => m.default)));
247
- 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-7238cc6c.cjs.js'); }).then((m) => m.default)));
248
- 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-555a7349.cjs.js'); }).then((m) => m.default)));
249
- 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-60658813.cjs.js'); }).then((m) => m.default)));
250
- 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-5602a58f.cjs.js'); }).then((m) => m.default)));
251
- 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-f46d6945.cjs.js'); }).then((m) => m.default)));
252
- 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-db876002.cjs.js'); }).then((m) => m.default)));
253
- 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-9b1a5456.cjs.js'); }).then((m) => m.default)));
254
- 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-3fe57ce7.cjs.js'); }).then((m) => m.default)));
255
- program.command("versions:bump").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-53a961f8.cjs.js'); }).then((m) => m.default)));
256
- 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-0053aded.cjs.js'); }).then((m) => m.default)));
257
- program.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-a4246579.cjs.js'); }).then((m) => m.pre)));
258
- program.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-a4246579.cjs.js'); }).then((m) => m.post)));
259
- program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-a28705b5.cjs.js'); }).then((m) => m.default)));
260
- 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-79c93924.cjs.js'); }).then((m) => m.default)));
261
- program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-c8a3517a.cjs.js'); }).then((m) => m.default)));
262
- program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-a069f3b4.cjs.js'); }).then((m) => m.default)));
263
- 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-43a8076b.cjs.js'); }).then((m) => m.default)));
234
+ 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-e7dbdd80.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-aaec7087.cjs.js'); }).then((m) => m.default)));
236
+ program.command("backend:build").description("Build a backend plugin").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-f3921423.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-8bcde9c4.cjs.js'); }).then((m) => m.default)));
238
+ 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-c74959e4.cjs.js'); }).then((m) => m.default)));
239
+ 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-2c1328b1.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-33636b2b.cjs.js'); }).then((m) => m.default)));
241
+ program.command("remove-plugin").description("[DEPRECATED] - Removes plugin in the current repository").action(lazy(() => Promise.resolve().then(function () { return require('./removePlugin-5984ee26.cjs.js'); }).then((m) => m.default)));
242
+ program.command("plugin:build").description("Build a plugin").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-ba4675b9.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-bfb3e982.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-d393a7d6.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]").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-16f16d70.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-0c8dd45e.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-0c162b80.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-43abe831.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-5db03c66.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-89d918a7.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-37d6a972.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-0acacde9.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-f4a40773.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-f5669e4f.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-f5669e4f.cjs.js'); }).then((m) => m.post)));
256
+ program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-f5d3a3ff.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-a573304e.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-f5dcae68.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-f260605b.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-db22d18d.cjs.js'); }).then((m) => m.default)));
264
261
  }
265
262
  function lazy(getActionFunc) {
266
263
  return async (...args) => {
@@ -276,16 +273,16 @@ function lazy(getActionFunc) {
276
273
  }
277
274
 
278
275
  const main = (argv) => {
279
- program__default['default'].name("backstage-cli").version(version);
280
- registerCommands(program__default['default']);
281
- program__default['default'].on("command:*", () => {
276
+ program__default["default"].name("backstage-cli").version(version);
277
+ registerCommands(program__default["default"]);
278
+ program__default["default"].on("command:*", () => {
282
279
  console.log();
283
- console.log(chalk__default['default'].red(`Invalid command: ${program__default['default'].args.join(" ")}`));
280
+ console.log(chalk__default["default"].red(`Invalid command: ${program__default["default"].args.join(" ")}`));
284
281
  console.log();
285
- program__default['default'].outputHelp();
282
+ program__default["default"].outputHelp();
286
283
  process.exit(1);
287
284
  });
288
- program__default['default'].parse(argv);
285
+ program__default["default"].parse(argv);
289
286
  };
290
287
  process.on("unhandledRejection", (rejection) => {
291
288
  if (rejection instanceof Error) {
@@ -304,4 +301,4 @@ exports.devDependencies = devDependencies;
304
301
  exports.paths = paths;
305
302
  exports.version = version;
306
303
  exports.version$1 = version$8;
307
- //# sourceMappingURL=index-8a512334.cjs.js.map
304
+ //# sourceMappingURL=index-60792ea9.cjs.js.map