@backstage/cli 0.32.1 → 0.33.0-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 (61) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/bin/backstage-cli-alpha +0 -0
  3. package/config/jest.js +5 -4
  4. package/dist/index.cjs.js +14 -29
  5. package/dist/lib/removed.cjs.js +1 -1
  6. package/dist/lib/run.cjs.js +7 -7
  7. package/dist/modules/{start → build}/commands/package/start/startFrontend.cjs.js +6 -6
  8. package/dist/modules/build/index.cjs.js +125 -27
  9. package/dist/modules/build/lib/bundler/config.cjs.js +2 -39
  10. package/dist/modules/config/commands/docs.cjs.js +18 -1
  11. package/dist/modules/config/index.cjs.js +101 -30
  12. package/dist/modules/create-github-app/index.cjs.js +21 -9
  13. package/dist/modules/info/index.cjs.js +23 -5
  14. package/dist/modules/lint/commands/repo/lint.cjs.js +13 -1
  15. package/dist/modules/lint/index.cjs.js +68 -29
  16. package/dist/modules/maintenance/index.cjs.js +80 -18
  17. package/dist/modules/migrate/index.cjs.js +96 -30
  18. package/dist/modules/new/index.cjs.js +57 -28
  19. package/dist/modules/test/index.cjs.js +46 -20
  20. package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
  21. package/dist/packages/backend-plugin-api/package.json.cjs.js +1 -1
  22. package/dist/packages/backend-test-utils/package.json.cjs.js +1 -1
  23. package/dist/packages/catalog-client/package.json.cjs.js +1 -1
  24. package/dist/packages/cli/package.json.cjs.js +1 -1
  25. package/dist/packages/core-components/package.json.cjs.js +1 -1
  26. package/dist/packages/dev-utils/package.json.cjs.js +1 -1
  27. package/dist/packages/frontend-plugin-api/src/routing/describeParentCallSite.cjs.js +26 -0
  28. package/dist/packages/opaque-internal/src/OpaqueType.cjs.js +105 -0
  29. package/dist/plugins/auth-backend/package.json.cjs.js +1 -1
  30. package/dist/plugins/auth-backend-module-guest-provider/package.json.cjs.js +1 -1
  31. package/dist/plugins/catalog-node/package.json.cjs.js +1 -1
  32. package/dist/plugins/scaffolder-node/package.json.cjs.js +1 -1
  33. package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +1 -1
  34. package/dist/wiring/CliInitializer.cjs.js +124 -0
  35. package/dist/wiring/CommandGraph.cjs.js +71 -0
  36. package/dist/wiring/CommandRegistry.cjs.js +14 -0
  37. package/dist/wiring/factory.cjs.js +15 -0
  38. package/dist/wiring/types.cjs.js +11 -0
  39. package/package.json +28 -29
  40. package/templates/backend-plugin/package.json.hbs +2 -1
  41. package/templates/backend-plugin-module/package.json.hbs +2 -1
  42. package/templates/frontend-plugin/package.json.hbs +2 -1
  43. package/templates/plugin-common-library/package.json.hbs +2 -1
  44. package/templates/plugin-node-library/package.json.hbs +2 -1
  45. package/templates/plugin-web-library/package.json.hbs +2 -1
  46. package/templates/scaffolder-backend-module/package.json.hbs +2 -1
  47. package/templates/scaffolder-backend-module/src/actions/example.ts +6 -12
  48. package/dist/commands/index.cjs.js +0 -55
  49. package/dist/modules/config/commands/print.cjs.js +0 -53
  50. package/dist/modules/config/commands/validate.cjs.js +0 -19
  51. package/dist/modules/info/commands/info.cjs.js +0 -55
  52. package/dist/modules/start/index.cjs.js +0 -38
  53. /package/dist/modules/{start → build}/commands/package/start/command.cjs.js +0 -0
  54. /package/dist/modules/{start → build}/commands/package/start/index.cjs.js +0 -0
  55. /package/dist/modules/{start → build}/commands/package/start/resolveLinkedWorkspace.cjs.js +0 -0
  56. /package/dist/modules/{start → build}/commands/package/start/startBackend.cjs.js +0 -0
  57. /package/dist/modules/{start → build}/commands/package/start/startPackage.cjs.js +0 -0
  58. /package/dist/modules/{start → build}/commands/repo/start.cjs.js +0 -0
  59. /package/dist/modules/{start → build}/lib/ipc/IpcServer.cjs.js +0 -0
  60. /package/dist/modules/{start → build}/lib/ipc/ServerDataStore.cjs.js +0 -0
  61. /package/dist/modules/{start → build}/lib/runner/runBackend.cjs.js +0 -0
@@ -1,55 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('../modules/config/index.cjs.js');
4
- var index$2 = require('../modules/build/index.cjs.js');
5
- var index$6 = require('../modules/start/index.cjs.js');
6
- var index$3 = require('../modules/info/index.cjs.js');
7
- var index$1 = require('../modules/migrate/index.cjs.js');
8
- var index$7 = require('../modules/test/index.cjs.js');
9
- var index$8 = require('../modules/lint/index.cjs.js');
10
- var index$9 = require('../modules/maintenance/index.cjs.js');
11
- var removed = require('../lib/removed.cjs.js');
12
- var index$4 = require('../modules/new/index.cjs.js');
13
- var index$5 = require('../modules/create-github-app/index.cjs.js');
14
-
15
- function registerRepoCommand(program) {
16
- const command = program.command("repo [command]").description("Command that run across an entire Backstage project");
17
- index$6.registerRepoCommands(command);
18
- index$2.registerRepoCommands(command);
19
- index$7.registerRepoCommands(command);
20
- index$8.registerRepoCommands(command);
21
- index$9.registerRepoCommands(command);
22
- }
23
- function registerScriptCommand(program) {
24
- const command = program.command("package [command]").description("Lifecycle scripts for individual packages");
25
- index$6.registerPackageCommands(command);
26
- index$2.registerPackageCommands(command);
27
- index$7.registerPackageCommands(command);
28
- index$9.registerPackageCommands(command);
29
- index$8.registerPackageCommands(command);
30
- }
31
- function registerCommands(program) {
32
- index.registerCommands(program);
33
- registerRepoCommand(program);
34
- registerScriptCommand(program);
35
- index$1.registerCommands(program);
36
- index$2.registerCommands(program);
37
- index$3.registerCommands(program);
38
- index$4.registerCommands(program);
39
- index$5.registerCommands(program);
40
- program.command("plugin:diff").allowUnknownOption(true).action(removed.removed("use 'backstage-cli fix' instead"));
41
- program.command("test").allowUnknownOption(true).action(
42
- removed.removed(
43
- "use 'backstage-cli repo test' or 'backstage-cli package test' instead"
44
- )
45
- );
46
- program.command("clean").allowUnknownOption(true).action(removed.removed("use 'backstage-cli package clean' instead"));
47
- program.command("versions:check").allowUnknownOption(true).action(removed.removed("use 'yarn dedupe' or 'yarn-deduplicate' instead"));
48
- program.command("install").allowUnknownOption(true).action(removed.removed());
49
- program.command("onboard").allowUnknownOption(true).action(removed.removed());
50
- }
51
-
52
- exports.registerCommands = registerCommands;
53
- exports.registerRepoCommand = registerRepoCommand;
54
- exports.registerScriptCommand = registerScriptCommand;
55
- //# sourceMappingURL=index.cjs.js.map
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var yaml = require('yaml');
6
- var config$1 = require('@backstage/config');
7
- var config = require('../lib/config.cjs.js');
8
-
9
- var print = async (opts) => {
10
- const { schema, appConfigs } = await config.loadCliConfig({
11
- args: opts.config,
12
- fromPackage: opts.package,
13
- mockEnv: opts.lax,
14
- fullVisibility: !opts.frontend
15
- });
16
- const visibility = getVisibilityOption(opts);
17
- const data = serializeConfigData(appConfigs, schema, visibility);
18
- if (opts.format === "json") {
19
- process.stdout.write(`${JSON.stringify(data, null, 2)}
20
- `);
21
- } else {
22
- process.stdout.write(`${yaml.stringify(data)}
23
- `);
24
- }
25
- };
26
- function getVisibilityOption(opts) {
27
- if (opts.frontend && opts.withSecrets) {
28
- throw new Error("Not allowed to combine frontend and secret config");
29
- }
30
- if (opts.frontend) {
31
- return "frontend";
32
- } else if (opts.withSecrets) {
33
- return "secret";
34
- }
35
- return "backend";
36
- }
37
- function serializeConfigData(appConfigs, schema, visibility) {
38
- if (visibility === "frontend") {
39
- const frontendConfigs = schema.process(appConfigs, {
40
- visibility: ["frontend"]
41
- });
42
- return config$1.ConfigReader.fromConfigs(frontendConfigs).get();
43
- } else if (visibility === "secret") {
44
- return config$1.ConfigReader.fromConfigs(appConfigs).get();
45
- }
46
- const sanitizedConfigs = schema.process(appConfigs, {
47
- valueTransform: (value, context) => context.visibility === "secret" ? "<secret>" : value
48
- });
49
- return config$1.ConfigReader.fromConfigs(sanitizedConfigs).get();
50
- }
51
-
52
- exports.default = print;
53
- //# sourceMappingURL=print.cjs.js.map
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var config = require('../lib/config.cjs.js');
6
-
7
- var validate = async (opts) => {
8
- await config.loadCliConfig({
9
- args: opts.config,
10
- fromPackage: opts.package,
11
- mockEnv: opts.lax,
12
- fullVisibility: !opts.frontend,
13
- withDeprecatedKeys: opts.deprecated,
14
- strict: opts.strict
15
- });
16
- };
17
-
18
- exports.default = validate;
19
- //# sourceMappingURL=validate.cjs.js.map
@@ -1,55 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _package = require('../../../packages/cli/package.json.cjs.js');
6
- var os = require('os');
7
- var run = require('../../../lib/run.cjs.js');
8
- var paths = require('../../../lib/paths.cjs.js');
9
- var Lockfile = require('../../../lib/versioning/Lockfile.cjs.js');
10
- require('minimatch');
11
- require('@manypkg/get-packages');
12
- require('chalk');
13
- require('../../../lib/versioning/yarn.cjs.js');
14
- var fs = require('fs-extra');
15
-
16
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
17
-
18
- var os__default = /*#__PURE__*/_interopDefaultCompat(os);
19
- var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
20
-
21
- var info = async () => {
22
- await new Promise(async () => {
23
- const yarnVersion = await run.runPlain("yarn --version");
24
- const isLocal = fs__default.default.existsSync(paths.paths.resolveOwn("./src"));
25
- const backstageFile = paths.paths.resolveTargetRoot("backstage.json");
26
- let backstageVersion = "N/A";
27
- if (fs__default.default.existsSync(backstageFile)) {
28
- try {
29
- const backstageJson = await fs__default.default.readJSON(backstageFile);
30
- backstageVersion = backstageJson.version ?? "N/A";
31
- } catch (error) {
32
- console.warn('The "backstage.json" file is not in the expected format');
33
- console.log();
34
- }
35
- }
36
- console.log(`OS: ${os__default.default.type} ${os__default.default.release} - ${os__default.default.platform}/${os__default.default.arch}`);
37
- console.log(`node: ${process.version}`);
38
- console.log(`yarn: ${yarnVersion}`);
39
- console.log(`cli: ${_package.version} (${isLocal ? "local" : "installed"})`);
40
- console.log(`backstage: ${backstageVersion}`);
41
- console.log();
42
- console.log("Dependencies:");
43
- const lockfilePath = paths.paths.resolveTargetRoot("yarn.lock");
44
- const lockfile = await Lockfile.Lockfile.load(lockfilePath);
45
- const deps = [...lockfile.keys()].filter((n) => n.startsWith("@backstage/"));
46
- const maxLength = Math.max(...deps.map((d) => d.length));
47
- for (const dep of deps) {
48
- const versions = new Set(lockfile.get(dep).map((i) => i.version));
49
- console.log(` ${dep.padEnd(maxLength)} ${[...versions].join(", ")}`);
50
- }
51
- });
52
- };
53
-
54
- exports.default = info;
55
- //# sourceMappingURL=info.cjs.js.map
@@ -1,38 +0,0 @@
1
- 'use strict';
2
-
3
- var lazy = require('../../lib/lazy.cjs.js');
4
- var index = require('../config/index.cjs.js');
5
-
6
- function registerRepoCommands(command) {
7
- command.command("start").description("Starts packages in the repo for local development").argument(
8
- "[packageNameOrPath...]",
9
- "Run the specified package instead of the defaults."
10
- ).option(
11
- "--plugin <pluginId>",
12
- "Start the dev entry-point for any matching plugin package in the repo",
13
- (opt, opts) => opts ? [...opts, opt] : [opt],
14
- Array()
15
- ).option(...index.configOption).option(
16
- "--inspect [host]",
17
- "Enable debugger in Node.js environments. Applies to backend package only"
18
- ).option(
19
- "--inspect-brk [host]",
20
- "Enable debugger in Node.js environments, breaking before code starts. Applies to backend package only"
21
- ).option(
22
- "--require <path...>",
23
- "Add a --require argument to the node process. Applies to backend package only"
24
- ).option("--link <path>", "Link an external workspace for module resolution").action(lazy.lazy(() => import('./commands/repo/start.cjs.js'), "command"));
25
- }
26
- function registerPackageCommands(command) {
27
- command.command("start").description("Start a package for local development").option(...index.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(
28
- "--inspect-brk [host]",
29
- "Enable debugger in Node.js environments, breaking before code starts"
30
- ).option(
31
- "--require <path...>",
32
- "Add a --require argument to the node process"
33
- ).option("--link <path>", "Link an external workspace for module resolution").action(lazy.lazy(() => import('./commands/package/start/index.cjs.js'), "command"));
34
- }
35
-
36
- exports.registerPackageCommands = registerPackageCommands;
37
- exports.registerRepoCommands = registerRepoCommands;
38
- //# sourceMappingURL=index.cjs.js.map