@backstage/cli 0.32.2-next.0 → 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.
- package/CHANGELOG.md +23 -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 +101 -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 +7 -8
- 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/config/commands/print.cjs.js +0 -53
- package/dist/modules/config/commands/validate.cjs.js +0 -19
- package/dist/modules/info/commands/info.cjs.js +0 -55
|
@@ -1,43 +1,82 @@
|
|
|
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
|
-
function
|
|
6
|
-
command.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"eslint-formatter-friendly"
|
|
10
|
-
).option(
|
|
11
|
-
"--output-file <path>",
|
|
12
|
-
"Write the lint report to a file instead of stdout"
|
|
13
|
-
).option("--fix", "Attempt to automatically fix violations").option(
|
|
14
|
-
"--max-warnings <number>",
|
|
15
|
-
"Fail if more than this number of warnings. -1 allows warnings. (default: -1)"
|
|
16
|
-
).description("Lint a package").action(lazy.lazy(() => import('./commands/package/lint.cjs.js'), "default"));
|
|
17
|
-
}
|
|
18
|
-
function registerRepoCommands(command) {
|
|
19
|
-
command.command("lint").description("Lint all packages in the project").option(
|
|
9
|
+
function registerPackageLintCommand(command) {
|
|
10
|
+
command.arguments("[directories...]");
|
|
11
|
+
command.option("--fix", "Attempt to automatically fix violations");
|
|
12
|
+
command.option(
|
|
20
13
|
"--format <format>",
|
|
21
14
|
"Lint report output format",
|
|
22
15
|
"eslint-formatter-friendly"
|
|
23
|
-
)
|
|
16
|
+
);
|
|
17
|
+
command.option(
|
|
24
18
|
"--output-file <path>",
|
|
25
19
|
"Write the lint report to a file instead of stdout"
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
"Only lint packages that changed since the specified ref"
|
|
29
|
-
).option(
|
|
30
|
-
"--successCache",
|
|
31
|
-
"Enable success caching, which skips running tests for unchanged packages that were successful in the previous run"
|
|
32
|
-
).option(
|
|
33
|
-
"--successCacheDir <path>",
|
|
34
|
-
"Set the success cache location, (default: node_modules/.cache/backstage-cli)"
|
|
35
|
-
).option(
|
|
20
|
+
);
|
|
21
|
+
command.option(
|
|
36
22
|
"--max-warnings <number>",
|
|
37
23
|
"Fail if more than this number of warnings. -1 allows warnings. (default: -1)"
|
|
38
|
-
)
|
|
24
|
+
);
|
|
25
|
+
command.description("Lint a package");
|
|
26
|
+
command.action(lazy.lazy(() => import('./commands/package/lint.cjs.js'), "default"));
|
|
39
27
|
}
|
|
28
|
+
var index = factory.createCliPlugin({
|
|
29
|
+
pluginId: "lint",
|
|
30
|
+
init: async (reg) => {
|
|
31
|
+
reg.addCommand({
|
|
32
|
+
path: ["package", "lint"],
|
|
33
|
+
description: "Lint a package",
|
|
34
|
+
execute: async ({ args }) => {
|
|
35
|
+
const command = new commander.Command();
|
|
36
|
+
registerPackageLintCommand(command);
|
|
37
|
+
await command.parseAsync(args, { from: "user" });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
reg.addCommand({
|
|
41
|
+
path: ["repo", "lint"],
|
|
42
|
+
description: "Lint a repository",
|
|
43
|
+
execute: async ({ args }) => {
|
|
44
|
+
const command = new commander.Command();
|
|
45
|
+
registerPackageLintCommand(command.command("package").command("lint"));
|
|
46
|
+
command.option("--fix", "Attempt to automatically fix violations");
|
|
47
|
+
command.option(
|
|
48
|
+
"--format <format>",
|
|
49
|
+
"Lint report output format",
|
|
50
|
+
"eslint-formatter-friendly"
|
|
51
|
+
);
|
|
52
|
+
command.option(
|
|
53
|
+
"--output-file <path>",
|
|
54
|
+
"Write the lint report to a file instead of stdout"
|
|
55
|
+
);
|
|
56
|
+
command.option(
|
|
57
|
+
"--successCache",
|
|
58
|
+
"Enable success caching, which skips running tests for unchanged packages that were successful in the previous run"
|
|
59
|
+
);
|
|
60
|
+
command.option(
|
|
61
|
+
"--successCacheDir <path>",
|
|
62
|
+
"Set the success cache location, (default: node_modules/.cache/backstage-cli)"
|
|
63
|
+
);
|
|
64
|
+
command.option(
|
|
65
|
+
"--since <ref>",
|
|
66
|
+
"Only lint packages that changed since the specified ref"
|
|
67
|
+
);
|
|
68
|
+
command.option(
|
|
69
|
+
"--max-warnings <number>",
|
|
70
|
+
"Fail if more than this number of warnings. -1 allows warnings. (default: -1)"
|
|
71
|
+
);
|
|
72
|
+
command.description("Lint a repository");
|
|
73
|
+
command.action(lazy.lazy(() => import('./commands/repo/lint.cjs.js'), "command"));
|
|
74
|
+
await command.parseAsync(args, { from: "user" });
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
40
79
|
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
80
|
+
exports.default = index;
|
|
81
|
+
exports.registerPackageLintCommand = registerPackageLintCommand;
|
|
43
82
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,24 +1,86 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var commander = require('commander');
|
|
6
|
+
var factory = require('../../wiring/factory.cjs.js');
|
|
3
7
|
var lazy = require('../../lib/lazy.cjs.js');
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
var index = factory.createCliPlugin({
|
|
10
|
+
pluginId: "maintenance",
|
|
11
|
+
init: async (reg) => {
|
|
12
|
+
reg.addCommand({
|
|
13
|
+
path: ["package", "clean"],
|
|
14
|
+
description: "Delete cache directories",
|
|
15
|
+
execute: async ({ args }) => {
|
|
16
|
+
const command = new commander.Command();
|
|
17
|
+
const defaultCommand = command.action(
|
|
18
|
+
lazy.lazy(() => import('./commands/package/clean.cjs.js'), "default")
|
|
19
|
+
);
|
|
20
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
reg.addCommand({
|
|
24
|
+
path: ["package", "prepack"],
|
|
25
|
+
description: "Prepares a package for packaging before publishing",
|
|
26
|
+
execute: async ({ args }) => {
|
|
27
|
+
const command = new commander.Command();
|
|
28
|
+
const defaultCommand = command.action(
|
|
29
|
+
lazy.lazy(() => import('./commands/package/pack.cjs.js'), "pre")
|
|
30
|
+
);
|
|
31
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
reg.addCommand({
|
|
35
|
+
path: ["package", "postpack"],
|
|
36
|
+
description: "Restores the changes made by the prepack command",
|
|
37
|
+
execute: async ({ args }) => {
|
|
38
|
+
const command = new commander.Command();
|
|
39
|
+
const defaultCommand = command.action(
|
|
40
|
+
lazy.lazy(() => import('./commands/package/pack.cjs.js'), "post")
|
|
41
|
+
);
|
|
42
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
reg.addCommand({
|
|
46
|
+
path: ["repo", "fix"],
|
|
47
|
+
description: "Automatically fix packages in the project",
|
|
48
|
+
execute: async ({ args }) => {
|
|
49
|
+
const command = new commander.Command();
|
|
50
|
+
const defaultCommand = command.option(
|
|
51
|
+
"--publish",
|
|
52
|
+
"Enable additional fixes that only apply when publishing packages"
|
|
53
|
+
).option(
|
|
54
|
+
"--check",
|
|
55
|
+
"Fail if any packages would have been changed by the command"
|
|
56
|
+
).action(lazy.lazy(() => import('./commands/repo/fix.cjs.js'), "command"));
|
|
57
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
reg.addCommand({
|
|
61
|
+
path: ["repo", "clean"],
|
|
62
|
+
description: "Delete cache and output directories",
|
|
63
|
+
execute: async ({ args }) => {
|
|
64
|
+
const command = new commander.Command();
|
|
65
|
+
const defaultCommand = command.action(
|
|
66
|
+
lazy.lazy(() => import('./commands/repo/clean.cjs.js'), "command")
|
|
67
|
+
);
|
|
68
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
reg.addCommand({
|
|
72
|
+
path: ["repo", "list-deprecations"],
|
|
73
|
+
description: "List deprecations",
|
|
74
|
+
execute: async ({ args }) => {
|
|
75
|
+
const command = new commander.Command();
|
|
76
|
+
const defaultCommand = command.option("--json", "Output as JSON").action(
|
|
77
|
+
lazy.lazy(() => import('./commands/repo/list-deprecations.cjs.js'), "command")
|
|
78
|
+
);
|
|
79
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
|
21
84
|
|
|
22
|
-
exports.
|
|
23
|
-
exports.registerRepoCommands = registerRepoCommands;
|
|
85
|
+
exports.default = index;
|
|
24
86
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,36 +1,102 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
var index = factory.createCliPlugin({
|
|
10
|
+
pluginId: "migrate",
|
|
11
|
+
init: async (reg) => {
|
|
12
|
+
reg.addCommand({
|
|
13
|
+
path: ["versions:migrate"],
|
|
14
|
+
description: "Migrate any plugins that have been moved to the @backstage-community namespace automatically",
|
|
15
|
+
execute: async ({ args }) => {
|
|
16
|
+
const command = new commander.Command();
|
|
17
|
+
const defaultCommand = command.option(
|
|
18
|
+
"--pattern <glob>",
|
|
19
|
+
"Override glob for matching packages to upgrade"
|
|
20
|
+
).option(
|
|
21
|
+
"--skip-code-changes",
|
|
22
|
+
"Skip code changes and only update package.json files"
|
|
23
|
+
).action(lazy.lazy(() => import('./commands/versions/migrate.cjs.js'), "default"));
|
|
24
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
reg.addCommand({
|
|
28
|
+
path: ["versions:bump"],
|
|
29
|
+
description: "Bump Backstage packages to the latest versions",
|
|
30
|
+
execute: async ({ args }) => {
|
|
31
|
+
const command = new commander.Command();
|
|
32
|
+
const defaultCommand = command.option(
|
|
33
|
+
"--pattern <glob>",
|
|
34
|
+
"Override glob for matching packages to upgrade"
|
|
35
|
+
).option(
|
|
36
|
+
"--release <version|next|main>",
|
|
37
|
+
"Bump to a specific Backstage release line or version",
|
|
38
|
+
"main"
|
|
39
|
+
).option("--skip-install", "Skips yarn install step").option("--skip-migrate", "Skips migration of any moved packages").action(lazy.lazy(() => import('./commands/versions/bump.cjs.js'), "default"));
|
|
40
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
reg.addCommand({
|
|
44
|
+
path: ["migrate", "package-roles"],
|
|
45
|
+
description: `Add package role field to packages that don't have it`,
|
|
46
|
+
execute: async ({ args }) => {
|
|
47
|
+
const command = new commander.Command();
|
|
48
|
+
const defaultCommand = command.action(
|
|
49
|
+
lazy.lazy(() => import('./commands/packageRole.cjs.js'), "default")
|
|
50
|
+
);
|
|
51
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
reg.addCommand({
|
|
55
|
+
path: ["migrate", "package-scripts"],
|
|
56
|
+
description: "Set package scripts according to each package role",
|
|
57
|
+
execute: async ({ args }) => {
|
|
58
|
+
const command = new commander.Command();
|
|
59
|
+
const defaultCommand = command.action(
|
|
60
|
+
lazy.lazy(() => import('./commands/packageScripts.cjs.js'), "command")
|
|
61
|
+
);
|
|
62
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
reg.addCommand({
|
|
66
|
+
path: ["migrate", "package-exports"],
|
|
67
|
+
description: "Synchronize package subpath export definitions",
|
|
68
|
+
execute: async ({ args }) => {
|
|
69
|
+
const command = new commander.Command();
|
|
70
|
+
const defaultCommand = command.action(
|
|
71
|
+
lazy.lazy(() => import('./commands/packageExports.cjs.js'), "command")
|
|
72
|
+
);
|
|
73
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
reg.addCommand({
|
|
77
|
+
path: ["migrate", "package-lint-configs"],
|
|
78
|
+
description: "Migrates all packages to use @backstage/cli/config/eslint-factory",
|
|
79
|
+
execute: async ({ args }) => {
|
|
80
|
+
const command = new commander.Command();
|
|
81
|
+
const defaultCommand = command.action(
|
|
82
|
+
lazy.lazy(() => import('./commands/packageLintConfigs.cjs.js'), "command")
|
|
83
|
+
);
|
|
84
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
reg.addCommand({
|
|
88
|
+
path: ["migrate", "react-router-deps"],
|
|
89
|
+
description: "Migrates the react-router dependencies for all packages to be peer dependencies",
|
|
90
|
+
execute: async ({ args }) => {
|
|
91
|
+
const command = new commander.Command();
|
|
92
|
+
const defaultCommand = command.action(
|
|
93
|
+
lazy.lazy(() => import('./commands/reactRouterDeps.cjs.js'), "command")
|
|
94
|
+
);
|
|
95
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
34
100
|
|
|
35
|
-
exports.
|
|
101
|
+
exports.default = index;
|
|
36
102
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,35 +1,64 @@
|
|
|
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
|
var removed = require('../../lib/removed.cjs.js');
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
var index = factory.createCliPlugin({
|
|
11
|
+
pluginId: "new",
|
|
12
|
+
init: async (reg) => {
|
|
13
|
+
reg.addCommand({
|
|
14
|
+
path: ["new"],
|
|
15
|
+
description: "Open up an interactive guide to creating new things in your app",
|
|
16
|
+
execute: async ({ args }) => {
|
|
17
|
+
const command = new commander.Command();
|
|
18
|
+
const defaultCommand = command.storeOptionsAsProperties(false).description(
|
|
19
|
+
"Open up an interactive guide to creating new things in your app"
|
|
20
|
+
).option(
|
|
21
|
+
"--select <name>",
|
|
22
|
+
"Select the thing you want to be creating upfront"
|
|
23
|
+
).option(
|
|
24
|
+
"--option <name>=<value>",
|
|
25
|
+
"Pre-fill options for the creation process",
|
|
26
|
+
(opt, arr) => [...arr, opt],
|
|
27
|
+
[]
|
|
28
|
+
).option(
|
|
29
|
+
"--skip-install",
|
|
30
|
+
`Skips running 'yarn install' and 'yarn lint --fix'`
|
|
31
|
+
).option("--scope <scope>", "The scope to use for new packages").option(
|
|
32
|
+
"--npm-registry <URL>",
|
|
33
|
+
"The package registry to use for new packages"
|
|
34
|
+
).option(
|
|
35
|
+
"--baseVersion <version>",
|
|
36
|
+
"The version to use for any new packages (default: 0.1.0)"
|
|
37
|
+
).option(
|
|
38
|
+
"--license <license>",
|
|
39
|
+
"The license to use for any new packages (default: Apache-2.0)"
|
|
40
|
+
).option("--no-private", "Do not mark new packages as private").action(lazy.lazy(() => import('./commands/new.cjs.js'), "default"));
|
|
41
|
+
await defaultCommand.parseAsync(args, { from: "user" });
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
reg.addCommand({
|
|
45
|
+
path: ["create"],
|
|
46
|
+
description: "Create a new Backstage app",
|
|
47
|
+
deprecated: true,
|
|
48
|
+
execute: async () => {
|
|
49
|
+
removed.removed("use 'backstage-cli new' instead")();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
reg.addCommand({
|
|
53
|
+
path: ["create-plugin"],
|
|
54
|
+
description: "Create a new Backstage plugin",
|
|
55
|
+
deprecated: true,
|
|
56
|
+
execute: async () => {
|
|
57
|
+
removed.removed("use 'backstage-cli new' instead")();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
33
62
|
|
|
34
|
-
exports.
|
|
63
|
+
exports.default = index;
|
|
35
64
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,26 +1,52 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
var index = factory.createCliPlugin({
|
|
10
|
+
pluginId: "test",
|
|
11
|
+
init: async (reg) => {
|
|
12
|
+
reg.addCommand({
|
|
13
|
+
path: ["repo", "test"],
|
|
14
|
+
description: "Run tests, forwarding args to Jest, defaulting to watch mode",
|
|
15
|
+
execute: async ({ args }) => {
|
|
16
|
+
const command = new commander.Command();
|
|
17
|
+
command.allowUnknownOption(true);
|
|
18
|
+
command.option(
|
|
19
|
+
"--since <ref>",
|
|
20
|
+
"Only test packages that changed since the specified ref"
|
|
21
|
+
);
|
|
22
|
+
command.option("--successCache", "Enable success caching");
|
|
23
|
+
command.option(
|
|
24
|
+
"--successCacheDir <path>",
|
|
25
|
+
"Set the success cache location, (default: node_modules/.cache/backstage-cli)"
|
|
26
|
+
);
|
|
27
|
+
command.option(
|
|
28
|
+
"--jest-help",
|
|
29
|
+
"Show help for Jest CLI options, which are passed through"
|
|
30
|
+
);
|
|
31
|
+
command.action(lazy.lazy(() => import('./commands/repo/test.cjs.js'), "command"));
|
|
32
|
+
await command.parseAsync(args, { from: "user" });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
reg.addCommand({
|
|
36
|
+
path: ["package", "test"],
|
|
37
|
+
description: "Run tests, forwarding args to Jest, defaulting to watch mode",
|
|
38
|
+
execute: async ({ args }) => {
|
|
39
|
+
const command = new commander.Command();
|
|
40
|
+
command.allowUnknownOption(true);
|
|
41
|
+
command.helpOption(", --backstage-cli-help");
|
|
42
|
+
command.action(
|
|
43
|
+
lazy.lazy(() => import('./commands/package/test.cjs.js'), "default")
|
|
44
|
+
);
|
|
45
|
+
await command.parseAsync(args, { from: "user" });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
23
50
|
|
|
24
|
-
exports.
|
|
25
|
-
exports.registerRepoCommands = registerRepoCommands;
|
|
51
|
+
exports.default = index;
|
|
26
52
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const MESSAGE_MARKER = "eHgtF5hmbrXyiEvo";
|
|
4
|
+
function describeParentCallSite(ErrorConstructor = Error) {
|
|
5
|
+
const { stack } = new ErrorConstructor(MESSAGE_MARKER);
|
|
6
|
+
if (!stack) {
|
|
7
|
+
return "<unknown>";
|
|
8
|
+
}
|
|
9
|
+
const startIndex = stack.includes(MESSAGE_MARKER) ? stack.indexOf("\n") + 1 : 0;
|
|
10
|
+
const secondEntryStart = stack.indexOf("\n", stack.indexOf("\n", startIndex) + 1) + 1;
|
|
11
|
+
const secondEntryEnd = stack.indexOf("\n", secondEntryStart);
|
|
12
|
+
const line = stack.substring(secondEntryStart, secondEntryEnd).trim();
|
|
13
|
+
if (!line) {
|
|
14
|
+
return "unknown";
|
|
15
|
+
}
|
|
16
|
+
if (line.includes("(")) {
|
|
17
|
+
return line.substring(line.indexOf("(") + 1, line.indexOf(")"));
|
|
18
|
+
}
|
|
19
|
+
if (line.includes("@")) {
|
|
20
|
+
return line.substring(line.indexOf("@") + 1);
|
|
21
|
+
}
|
|
22
|
+
return line;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.describeParentCallSite = describeParentCallSite;
|
|
26
|
+
//# sourceMappingURL=describeParentCallSite.cjs.js.map
|