@backstage/cli 0.32.2-next.0 → 0.33.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/bin/backstage-cli-alpha +0 -0
- package/dist/index.cjs.js +14 -29
- package/dist/lib/removed.cjs.js +1 -1
- package/dist/lib/run.cjs.js +7 -7
- package/dist/modules/build/index.cjs.js +124 -52
- package/dist/modules/config/commands/docs.cjs.js +18 -1
- package/dist/modules/config/index.cjs.js +97 -30
- package/dist/modules/create-github-app/index.cjs.js +21 -9
- package/dist/modules/info/index.cjs.js +23 -5
- package/dist/modules/lint/index.cjs.js +68 -29
- package/dist/modules/maintenance/index.cjs.js +80 -18
- package/dist/modules/migrate/index.cjs.js +96 -30
- package/dist/modules/new/index.cjs.js +57 -28
- package/dist/modules/test/index.cjs.js +46 -20
- package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
- package/dist/packages/backend-test-utils/package.json.cjs.js +1 -1
- package/dist/packages/cli/package.json.cjs.js +1 -1
- package/dist/packages/core-components/package.json.cjs.js +1 -1
- package/dist/packages/dev-utils/package.json.cjs.js +1 -1
- package/dist/packages/frontend-plugin-api/src/routing/describeParentCallSite.cjs.js +26 -0
- package/dist/packages/opaque-internal/src/OpaqueType.cjs.js +105 -0
- package/dist/plugins/scaffolder-node/package.json.cjs.js +1 -1
- package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +1 -1
- package/dist/wiring/CliInitializer.cjs.js +124 -0
- package/dist/wiring/CommandGraph.cjs.js +71 -0
- package/dist/wiring/CommandRegistry.cjs.js +14 -0
- package/dist/wiring/factory.cjs.js +15 -0
- package/dist/wiring/types.cjs.js +11 -0
- package/package.json +8 -9
- package/templates/backend-plugin/package.json.hbs +2 -1
- package/templates/backend-plugin-module/package.json.hbs +2 -1
- package/templates/frontend-plugin/package.json.hbs +2 -1
- package/templates/plugin-common-library/package.json.hbs +2 -1
- package/templates/plugin-node-library/package.json.hbs +2 -1
- package/templates/plugin-web-library/package.json.hbs +2 -1
- package/templates/scaffolder-backend-module/package.json.hbs +2 -1
- package/templates/scaffolder-backend-module/src/actions/example.ts +6 -12
- package/dist/commands/index.cjs.js +0 -52
- package/dist/modules/info/commands/info.cjs.js +0 -55
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @backstage/cli
|
|
2
2
|
|
|
3
|
+
## 0.33.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8a0164c: Fix an issue where some commands were not usable because of missing dist files
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/eslint-plugin@0.1.11-next.0
|
|
10
|
+
- @backstage/catalog-model@1.7.4
|
|
11
|
+
- @backstage/cli-common@0.1.15
|
|
12
|
+
- @backstage/cli-node@0.2.13
|
|
13
|
+
- @backstage/config@1.3.2
|
|
14
|
+
- @backstage/config-loader@1.10.1
|
|
15
|
+
- @backstage/errors@1.2.7
|
|
16
|
+
- @backstage/integration@1.17.0
|
|
17
|
+
- @backstage/release-manifests@0.0.13
|
|
18
|
+
- @backstage/types@1.2.1
|
|
19
|
+
|
|
20
|
+
## 0.33.0-next.1
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- eef0e83: Internal update to promote the modular CLI entrypoint to stable.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- d07fe35: Added user feedback when opening config docs in browser. The command now clearly indicates what it's doing and provides fallback instructions if the browser fails to open.
|
|
29
|
+
- d6d63c7: Updating the scaffolder action boilerplate to use new `zod` schema
|
|
30
|
+
- e36e855: Added `backstage.pluginId` field in `package.json` to all default plugin package templates for the `new` command.
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
- @backstage/catalog-model@1.7.4
|
|
33
|
+
- @backstage/cli-common@0.1.15
|
|
34
|
+
- @backstage/cli-node@0.2.13
|
|
35
|
+
- @backstage/config@1.3.2
|
|
36
|
+
- @backstage/config-loader@1.10.1
|
|
37
|
+
- @backstage/errors@1.2.7
|
|
38
|
+
- @backstage/eslint-plugin@0.1.10
|
|
39
|
+
- @backstage/integration@1.17.0
|
|
40
|
+
- @backstage/release-manifests@0.0.13
|
|
41
|
+
- @backstage/types@1.2.1
|
|
42
|
+
|
|
3
43
|
## 0.32.2-next.0
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/bin/backstage-cli-alpha
CHANGED
|
File without changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chalk = require('chalk');
|
|
5
|
-
var errors = require('./lib/errors.cjs.js');
|
|
6
|
-
var version = require('./lib/version.cjs.js');
|
|
7
|
-
var index = require('./commands/index.cjs.js');
|
|
3
|
+
var CliInitializer = require('./wiring/CliInitializer.cjs.js');
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
commander.program.parse(argv);
|
|
24
|
-
};
|
|
25
|
-
process.on("unhandledRejection", (rejection) => {
|
|
26
|
-
if (rejection instanceof Error) {
|
|
27
|
-
errors.exitWithError(rejection);
|
|
28
|
-
} else {
|
|
29
|
-
errors.exitWithError(new Error(`Unknown rejection: '${rejection}'`));
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
main(process.argv);
|
|
5
|
+
(async () => {
|
|
6
|
+
const initializer = new CliInitializer.CliInitializer();
|
|
7
|
+
initializer.add(import('./modules/build/index.cjs.js'));
|
|
8
|
+
initializer.add(import('./modules/config/index.cjs.js'));
|
|
9
|
+
initializer.add(import('./modules/create-github-app/index.cjs.js'));
|
|
10
|
+
initializer.add(import('./modules/info/index.cjs.js'));
|
|
11
|
+
initializer.add(import('./modules/lint/index.cjs.js'));
|
|
12
|
+
initializer.add(import('./modules/maintenance/index.cjs.js'));
|
|
13
|
+
initializer.add(import('./modules/migrate/index.cjs.js'));
|
|
14
|
+
initializer.add(import('./modules/new/index.cjs.js'));
|
|
15
|
+
initializer.add(import('./modules/test/index.cjs.js'));
|
|
16
|
+
await initializer.run();
|
|
17
|
+
})();
|
|
33
18
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/lib/removed.cjs.js
CHANGED
package/dist/lib/run.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var child_process = require('child_process');
|
|
4
|
-
var errors
|
|
4
|
+
var errors = require('./errors.cjs.js');
|
|
5
5
|
var util = require('util');
|
|
6
|
-
var errors = require('@backstage/errors');
|
|
6
|
+
var errors$1 = require('@backstage/errors');
|
|
7
7
|
|
|
8
8
|
const execFile = util.promisify(child_process.execFile);
|
|
9
9
|
async function run(name, args = [], options = {}) {
|
|
@@ -37,14 +37,14 @@ async function runPlain(cmd, ...args) {
|
|
|
37
37
|
const { stdout } = await execFile(cmd, args, { shell: true });
|
|
38
38
|
return stdout.trim();
|
|
39
39
|
} catch (error) {
|
|
40
|
-
errors.assertError(error);
|
|
40
|
+
errors$1.assertError(error);
|
|
41
41
|
if ("stderr" in error) {
|
|
42
42
|
process.stderr.write(error.stderr);
|
|
43
43
|
}
|
|
44
44
|
if (typeof error.code === "number") {
|
|
45
|
-
throw new errors
|
|
45
|
+
throw new errors.ExitCodeError(error.code, [cmd, ...args].join(" "));
|
|
46
46
|
}
|
|
47
|
-
throw new errors.ForwardedError("Unknown execution error", error);
|
|
47
|
+
throw new errors$1.ForwardedError("Unknown execution error", error);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
async function runCheck(cmd, ...args) {
|
|
@@ -58,7 +58,7 @@ async function runCheck(cmd, ...args) {
|
|
|
58
58
|
async function waitForExit(child, name) {
|
|
59
59
|
if (typeof child.exitCode === "number") {
|
|
60
60
|
if (child.exitCode) {
|
|
61
|
-
throw new errors
|
|
61
|
+
throw new errors.ExitCodeError(child.exitCode, name);
|
|
62
62
|
}
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
@@ -66,7 +66,7 @@ async function waitForExit(child, name) {
|
|
|
66
66
|
child.once("error", (error) => reject(error));
|
|
67
67
|
child.once("exit", (code) => {
|
|
68
68
|
if (code) {
|
|
69
|
-
reject(new errors
|
|
69
|
+
reject(new errors.ExitCodeError(code, name));
|
|
70
70
|
} else {
|
|
71
71
|
resolve();
|
|
72
72
|
}
|
|
@@ -1,41 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var commander = require('commander');
|
|
6
|
+
var factory = require('../../wiring/factory.cjs.js');
|
|
4
7
|
var lazy = require('../../lib/lazy.cjs.js');
|
|
5
8
|
var index = require('../config/index.cjs.js');
|
|
6
9
|
|
|
7
|
-
function registerRepoCommands(command) {
|
|
8
|
-
command.command("build").description(
|
|
9
|
-
"Build packages in the project, excluding bundled app and backend packages."
|
|
10
|
-
).option(
|
|
11
|
-
"--all",
|
|
12
|
-
"Build all packages, including bundled app and backend packages."
|
|
13
|
-
).option(
|
|
14
|
-
"--since <ref>",
|
|
15
|
-
"Only build packages and their dev dependents that changed since the specified ref"
|
|
16
|
-
).option(
|
|
17
|
-
"--minify",
|
|
18
|
-
"Minify the generated code. Does not apply to app package (app is minified by default)."
|
|
19
|
-
).action(lazy.lazy(() => import('./commands/repo/build.cjs.js'), "command"));
|
|
20
|
-
command.command("start").description("Starts packages in the repo for local development").argument(
|
|
21
|
-
"[packageNameOrPath...]",
|
|
22
|
-
"Run the specified package instead of the defaults."
|
|
23
|
-
).option(
|
|
24
|
-
"--plugin <pluginId>",
|
|
25
|
-
"Start the dev entry-point for any matching plugin package in the repo",
|
|
26
|
-
(opt, opts) => opts ? [...opts, opt] : [opt],
|
|
27
|
-
Array()
|
|
28
|
-
).option(...index.configOption).option(
|
|
29
|
-
"--inspect [host]",
|
|
30
|
-
"Enable debugger in Node.js environments. Applies to backend package only"
|
|
31
|
-
).option(
|
|
32
|
-
"--inspect-brk [host]",
|
|
33
|
-
"Enable debugger in Node.js environments, breaking before code starts. Applies to backend package only"
|
|
34
|
-
).option(
|
|
35
|
-
"--require <path...>",
|
|
36
|
-
"Add a --require argument to the node process. Applies to backend package only"
|
|
37
|
-
).option("--link <path>", "Link an external workspace for module resolution").action(lazy.lazy(() => import('./commands/repo/start.cjs.js'), "command"));
|
|
38
|
-
}
|
|
39
10
|
function registerPackageCommands(command) {
|
|
40
11
|
command.command("build").description("Build a package for production deployment or publishing").option("--role <name>", "Run the command with an explicit package role").option(
|
|
41
12
|
"--minify",
|
|
@@ -52,27 +23,128 @@ function registerPackageCommands(command) {
|
|
|
52
23
|
(opt, opts) => opts ? [...opts, opt] : [opt],
|
|
53
24
|
Array()
|
|
54
25
|
).action(lazy.lazy(() => import('./commands/package/build/index.cjs.js'), "command"));
|
|
55
|
-
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(
|
|
56
|
-
"--inspect-brk [host]",
|
|
57
|
-
"Enable debugger in Node.js environments, breaking before code starts"
|
|
58
|
-
).option(
|
|
59
|
-
"--require <path...>",
|
|
60
|
-
"Add a --require argument to the node process"
|
|
61
|
-
).option("--link <path>", "Link an external workspace for module resolution").action(lazy.lazy(() => import('./commands/package/start/index.cjs.js'), "command"));
|
|
62
|
-
}
|
|
63
|
-
function registerCommands(program) {
|
|
64
|
-
program.command("build-workspace <workspace-dir> [packages...]").addOption(
|
|
65
|
-
new commander.Option(
|
|
66
|
-
"--alwaysYarnPack",
|
|
67
|
-
"Alias for --alwaysPack for backwards compatibility."
|
|
68
|
-
).implies({ alwaysPack: true }).hideHelp(true)
|
|
69
|
-
).option(
|
|
70
|
-
"--alwaysPack",
|
|
71
|
-
"Force workspace output to be a result of running `yarn pack` on each package (warning: very slow)"
|
|
72
|
-
).description("Builds a temporary dist workspace from the provided packages").action(lazy.lazy(() => import('./commands/buildWorkspace.cjs.js'), "default"));
|
|
73
26
|
}
|
|
27
|
+
const buildPlugin = factory.createCliPlugin({
|
|
28
|
+
pluginId: "build",
|
|
29
|
+
init: async (reg) => {
|
|
30
|
+
reg.addCommand({
|
|
31
|
+
path: ["package", "build"],
|
|
32
|
+
description: "Build a package for production deployment or publishing",
|
|
33
|
+
execute: async ({ args }) => {
|
|
34
|
+
const command = new commander.Command();
|
|
35
|
+
const defaultCommand = command.option(
|
|
36
|
+
"--role <name>",
|
|
37
|
+
"Run the command with an explicit package role"
|
|
38
|
+
).option(
|
|
39
|
+
"--minify",
|
|
40
|
+
"Minify the generated code. Does not apply to app package (app is minified by default)."
|
|
41
|
+
).option(
|
|
42
|
+
"--skip-build-dependencies",
|
|
43
|
+
"Skip the automatic building of local dependencies. Applies to backend packages only."
|
|
44
|
+
).option(
|
|
45
|
+
"--stats",
|
|
46
|
+
"If bundle stats are available, write them to the output directory. Applies to app packages only."
|
|
47
|
+
).option(
|
|
48
|
+
"--config <path>",
|
|
49
|
+
"Config files to load instead of app-config.yaml. Applies to app packages only.",
|
|
50
|
+
(opt, opts) => opts ? [...opts, opt] : [opt],
|
|
51
|
+
Array()
|
|
52
|
+
).action(lazy.lazy(() => import('./commands/package/build/index.cjs.js'), "command"));
|
|
53
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
reg.addCommand({
|
|
57
|
+
path: ["repo", "build"],
|
|
58
|
+
description: "Build packages in the project, excluding bundled app and backend packages.",
|
|
59
|
+
execute: async ({ args }) => {
|
|
60
|
+
const command = new commander.Command();
|
|
61
|
+
registerPackageCommands(command.command("package"));
|
|
62
|
+
const defaultCommand = command.option(
|
|
63
|
+
"--all",
|
|
64
|
+
"Build all packages, including bundled app and backend packages."
|
|
65
|
+
).option(
|
|
66
|
+
"--since <ref>",
|
|
67
|
+
"Only build packages and their dev dependents that changed since the specified ref"
|
|
68
|
+
).option(
|
|
69
|
+
"--minify",
|
|
70
|
+
"Minify the generated code. Does not apply to app package (app is minified by default)."
|
|
71
|
+
).action(lazy.lazy(() => import('./commands/repo/build.cjs.js'), "command"));
|
|
72
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
reg.addCommand({
|
|
76
|
+
path: ["package", "start"],
|
|
77
|
+
description: "Start a package for local development",
|
|
78
|
+
execute: async ({ args }) => {
|
|
79
|
+
const command = new commander.Command();
|
|
80
|
+
const defaultCommand = command.option(...index.configOption).option(
|
|
81
|
+
"--role <name>",
|
|
82
|
+
"Run the command with an explicit package role"
|
|
83
|
+
).option("--check", "Enable type checking and linting if available").option("--inspect [host]", "Enable debugger in Node.js environments").option(
|
|
84
|
+
"--inspect-brk [host]",
|
|
85
|
+
"Enable debugger in Node.js environments, breaking before code starts"
|
|
86
|
+
).option(
|
|
87
|
+
"--require <path...>",
|
|
88
|
+
"Add a --require argument to the node process"
|
|
89
|
+
).option(
|
|
90
|
+
"--link <path>",
|
|
91
|
+
"Link an external workspace for module resolution"
|
|
92
|
+
).action(lazy.lazy(() => import('./commands/package/start/index.cjs.js'), "command"));
|
|
93
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
reg.addCommand({
|
|
97
|
+
path: ["repo", "start"],
|
|
98
|
+
description: "Starts packages in the repo for local development",
|
|
99
|
+
execute: async ({ args }) => {
|
|
100
|
+
const command = new commander.Command();
|
|
101
|
+
const defaultCommand = command.argument(
|
|
102
|
+
"[packageNameOrPath...]",
|
|
103
|
+
"Run the specified package instead of the defaults."
|
|
104
|
+
).option(
|
|
105
|
+
"--plugin <pluginId>",
|
|
106
|
+
"Start the dev entry-point for any matching plugin package in the repo",
|
|
107
|
+
(opt, opts) => opts ? [...opts, opt] : [opt],
|
|
108
|
+
Array()
|
|
109
|
+
).option(...index.configOption).option(
|
|
110
|
+
"--inspect [host]",
|
|
111
|
+
"Enable debugger in Node.js environments. Applies to backend package only"
|
|
112
|
+
).option(
|
|
113
|
+
"--inspect-brk [host]",
|
|
114
|
+
"Enable debugger in Node.js environments, breaking before code starts. Applies to backend package only"
|
|
115
|
+
).option(
|
|
116
|
+
"--require <path...>",
|
|
117
|
+
"Add a --require argument to the node process. Applies to backend package only"
|
|
118
|
+
).option(
|
|
119
|
+
"--link <path>",
|
|
120
|
+
"Link an external workspace for module resolution"
|
|
121
|
+
).action(
|
|
122
|
+
lazy.lazy(() => import('./commands/repo/start.cjs.js'), "command")
|
|
123
|
+
);
|
|
124
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
reg.addCommand({
|
|
128
|
+
path: ["build-workspace"],
|
|
129
|
+
description: "Builds a temporary dist workspace from the provided packages",
|
|
130
|
+
execute: async ({ args }) => {
|
|
131
|
+
const command = new commander.Command();
|
|
132
|
+
const defaultCommand = command.arguments("<workspace-dir> [packages...]").addOption(
|
|
133
|
+
new commander.Option(
|
|
134
|
+
"--alwaysYarnPack",
|
|
135
|
+
"Alias for --alwaysPack for backwards compatibility."
|
|
136
|
+
).implies({ alwaysPack: true }).hideHelp(true)
|
|
137
|
+
).option(
|
|
138
|
+
"--alwaysPack",
|
|
139
|
+
"Force workspace output to be a result of running `yarn pack` on each package (warning: very slow)"
|
|
140
|
+
).action(lazy.lazy(() => import('./commands/buildWorkspace.cjs.js'), "default"));
|
|
141
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
74
146
|
|
|
75
|
-
exports.
|
|
147
|
+
exports.buildPlugin = buildPlugin;
|
|
148
|
+
exports.default = buildPlugin;
|
|
76
149
|
exports.registerPackageCommands = registerPackageCommands;
|
|
77
|
-
exports.registerRepoCommands = registerRepoCommands;
|
|
78
150
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var configLoader = require('@backstage/config-loader');
|
|
6
6
|
var openBrowser = require('react-dev-utils/openBrowser');
|
|
7
|
+
var chalk = require('chalk');
|
|
7
8
|
var config = require('../lib/config.cjs.js');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
11
|
|
|
11
12
|
var openBrowser__default = /*#__PURE__*/_interopDefaultCompat(openBrowser);
|
|
13
|
+
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
12
14
|
|
|
13
15
|
const DOCS_URL = "https://config.backstage.io";
|
|
14
16
|
var docs = async (opts) => {
|
|
@@ -22,7 +24,22 @@ var docs = async (opts) => {
|
|
|
22
24
|
(_) => _.value
|
|
23
25
|
)
|
|
24
26
|
);
|
|
25
|
-
|
|
27
|
+
const url = `${DOCS_URL}#schema=${JSON.stringify(schema)}`;
|
|
28
|
+
console.log();
|
|
29
|
+
console.log(
|
|
30
|
+
chalk__default.default.cyan(
|
|
31
|
+
"Opening configuration reference documentation in your browser..."
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
console.log(` ${chalk__default.default.cyan(url)}`);
|
|
35
|
+
console.log();
|
|
36
|
+
const opened = openBrowser__default.default(url);
|
|
37
|
+
if (!opened) {
|
|
38
|
+
console.log(
|
|
39
|
+
chalk__default.default.yellow("\u26A0\uFE0F WARNING: Unable to open browser automatically.")
|
|
40
|
+
);
|
|
41
|
+
console.log(chalk__default.default.yellow("Please open the URL manually in your browser."));
|
|
42
|
+
}
|
|
26
43
|
};
|
|
27
44
|
|
|
28
45
|
exports.default = docs;
|
|
@@ -1,43 +1,110 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var factory = require('../../wiring/factory.cjs.js');
|
|
6
|
+
var yargs = require('yargs');
|
|
7
|
+
var commander = require('commander');
|
|
3
8
|
var lazy = require('../../lib/lazy.cjs.js');
|
|
4
9
|
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var yargs__default = /*#__PURE__*/_interopDefaultCompat(yargs);
|
|
13
|
+
|
|
5
14
|
const configOption = [
|
|
6
15
|
"--config <path>",
|
|
7
16
|
"Config files to load instead of app-config.yaml",
|
|
8
17
|
(opt, opts) => opts ? [...opts, opt] : [opt],
|
|
9
18
|
Array()
|
|
10
19
|
];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
20
|
+
var index = factory.createCliPlugin({
|
|
21
|
+
pluginId: "config",
|
|
22
|
+
init: async (reg) => {
|
|
23
|
+
reg.addCommand({
|
|
24
|
+
path: ["config:docs"],
|
|
25
|
+
description: "Browse the configuration reference documentation",
|
|
26
|
+
execute: async ({ args }) => {
|
|
27
|
+
const command = new commander.Command();
|
|
28
|
+
const defaultCommand = command.option(
|
|
29
|
+
"--package <name>",
|
|
30
|
+
"Only include the schema that applies to the given package"
|
|
31
|
+
).description("Browse the configuration reference documentation").action(lazy.lazy(() => import('./commands/docs.cjs.js'), "default"));
|
|
32
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
reg.addCommand({
|
|
36
|
+
path: ["config", "docs"],
|
|
37
|
+
description: "Browse the configuration reference documentation",
|
|
38
|
+
execute: async ({ args, info }) => {
|
|
39
|
+
await new commander.Command(info.usage).option(
|
|
40
|
+
"--package <name>",
|
|
41
|
+
"Only include the schema that applies to the given package"
|
|
42
|
+
).description(info.description).action(lazy.lazy(() => import('./commands/docs.cjs.js'), "default")).parseAsync(args, { from: "user" });
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
reg.addCommand({
|
|
46
|
+
path: ["config:print"],
|
|
47
|
+
description: "Print the app configuration for the current package",
|
|
48
|
+
execute: async ({ args, info }) => {
|
|
49
|
+
const argv = await yargs__default.default.options({
|
|
50
|
+
package: { type: "string" },
|
|
51
|
+
lax: { type: "boolean" },
|
|
52
|
+
frontend: { type: "boolean" },
|
|
53
|
+
"with-secrets": { type: "boolean" },
|
|
54
|
+
format: { type: "string" },
|
|
55
|
+
config: { type: "string", array: true, default: [] }
|
|
56
|
+
}).usage("$0", info.description).help().parse(args);
|
|
57
|
+
await lazy.lazy(() => import('./commands/print.cjs.js'), "default")(argv);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
reg.addCommand({
|
|
61
|
+
path: ["config:check"],
|
|
62
|
+
description: "Validate that the given configuration loads and matches schema",
|
|
63
|
+
execute: async ({ args }) => {
|
|
64
|
+
const argv = await yargs__default.default.options({
|
|
65
|
+
package: { type: "string" },
|
|
66
|
+
lax: { type: "boolean" },
|
|
67
|
+
frontend: { type: "boolean" },
|
|
68
|
+
deprecated: { type: "boolean" },
|
|
69
|
+
strict: { type: "boolean" },
|
|
70
|
+
config: {
|
|
71
|
+
type: "string",
|
|
72
|
+
array: true,
|
|
73
|
+
default: []
|
|
74
|
+
}
|
|
75
|
+
}).help().parse(args);
|
|
76
|
+
await lazy.lazy(() => import('./commands/validate.cjs.js'), "default")(argv);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
reg.addCommand({
|
|
80
|
+
path: ["config:schema"],
|
|
81
|
+
description: "Print the JSON schema for the given configuration",
|
|
82
|
+
execute: async ({ args }) => {
|
|
83
|
+
const argv = await yargs__default.default.options({
|
|
84
|
+
package: { type: "string" },
|
|
85
|
+
format: { type: "string" },
|
|
86
|
+
merge: { type: "boolean" },
|
|
87
|
+
"no-merge": { type: "boolean" }
|
|
88
|
+
}).help().parse(args);
|
|
89
|
+
await lazy.lazy(() => import('./commands/schema.cjs.js'), "default")(argv);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
reg.addCommand({
|
|
93
|
+
path: ["config", "schema"],
|
|
94
|
+
description: "Print the JSON schema for the given configuration",
|
|
95
|
+
execute: async ({ args }) => {
|
|
96
|
+
const argv = await yargs__default.default.options({
|
|
97
|
+
package: { type: "string" },
|
|
98
|
+
format: { type: "string" },
|
|
99
|
+
merge: { type: "boolean" },
|
|
100
|
+
"no-merge": { type: "boolean" }
|
|
101
|
+
}).help().parse(args);
|
|
102
|
+
await lazy.lazy(() => import('./commands/schema.cjs.js'), "default")(argv);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
40
107
|
|
|
41
108
|
exports.configOption = configOption;
|
|
42
|
-
exports.
|
|
109
|
+
exports.default = index;
|
|
43
110
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var factory = require('../../wiring/factory.cjs.js');
|
|
6
|
+
var commander = require('commander');
|
|
3
7
|
var lazy = require('../../lib/lazy.cjs.js');
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var index = factory.createCliPlugin({
|
|
10
|
+
pluginId: "new",
|
|
11
|
+
init: async (reg) => {
|
|
12
|
+
reg.addCommand({
|
|
13
|
+
path: ["create-github-app"],
|
|
14
|
+
description: "Create new GitHub App in your organization.",
|
|
15
|
+
execute: async ({ args }) => {
|
|
16
|
+
const command = new commander.Command();
|
|
17
|
+
const defaultCommand = command.argument("<github-org>").action(
|
|
18
|
+
lazy.lazy(() => import('./commands/create-github-app/index.cjs.js'), "default")
|
|
19
|
+
);
|
|
20
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
13
25
|
|
|
14
|
-
exports.
|
|
26
|
+
exports.default = index;
|
|
15
27
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
var yargs = require('yargs');
|
|
6
|
+
var factory = require('../../wiring/factory.cjs.js');
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var yargs__default = /*#__PURE__*/_interopDefaultCompat(yargs);
|
|
11
|
+
|
|
12
|
+
var index = factory.createCliPlugin({
|
|
13
|
+
pluginId: "info",
|
|
14
|
+
init: async (reg) => {
|
|
15
|
+
reg.addCommand({
|
|
16
|
+
path: ["info"],
|
|
17
|
+
description: "Show helpful information for debugging and reporting bugs",
|
|
18
|
+
execute: async ({ args }) => {
|
|
19
|
+
yargs__default.default().parse(args);
|
|
20
|
+
const { default: command } = require("./commands/info");
|
|
21
|
+
await command();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.default = index;
|
|
10
28
|
//# sourceMappingURL=index.cjs.js.map
|