viza 1.8.22 → 1.8.24
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/dist/src/cli/options.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export function getGlobalOptions() {
|
|
2
2
|
return [
|
|
3
3
|
{ flags: "--status", description: "Show status only (no execution)" },
|
|
4
|
-
{ flags: "--remove-log", description: "Remove execution logs after completion"
|
|
5
|
-
{ flags: "--self-hosted", description: "Use self-hosted runner (viza-builder)"
|
|
4
|
+
{ flags: "--remove-log", description: "Remove execution logs after completion" },
|
|
5
|
+
{ flags: "--self-hosted", description: "Use self-hosted runner (viza-builder)" }
|
|
6
6
|
];
|
|
7
7
|
}
|
|
8
8
|
export function registerGlobalOptions(program) {
|
package/dist/src/cli/program.js
CHANGED
|
@@ -9,6 +9,7 @@ import { renderHint } from "../core/renderHint.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export async function createProgram() {
|
|
11
11
|
const program = new Command();
|
|
12
|
+
program.enablePositionalOptions();
|
|
12
13
|
program
|
|
13
14
|
.name("viza")
|
|
14
15
|
.description("Viza Command Line Interface")
|
|
@@ -89,7 +90,22 @@ export async function createProgram() {
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
if (node.run) {
|
|
92
|
-
sub.action(
|
|
93
|
+
sub.action(async (...args) => {
|
|
94
|
+
const cmd = args[args.length - 1];
|
|
95
|
+
function collectOptions(c) {
|
|
96
|
+
const merged = {};
|
|
97
|
+
let cur = c;
|
|
98
|
+
while (cur) {
|
|
99
|
+
if (typeof cur.opts === "function") {
|
|
100
|
+
Object.assign(merged, cur.opts());
|
|
101
|
+
}
|
|
102
|
+
cur = cur.parent;
|
|
103
|
+
}
|
|
104
|
+
return merged;
|
|
105
|
+
}
|
|
106
|
+
const opts = collectOptions(cmd);
|
|
107
|
+
await node.run(opts);
|
|
108
|
+
});
|
|
93
109
|
}
|
|
94
110
|
if (node.children?.length) {
|
|
95
111
|
walk(node.children, sub);
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function getResolvedOptions(command) {
|
|
2
|
-
// Commander v10+ provides optsWithGlobals which already merges parent options
|
|
3
|
-
const anyCmd = command;
|
|
4
|
-
if (typeof anyCmd.optsWithGlobals === "function") {
|
|
5
|
-
return anyCmd.optsWithGlobals();
|
|
6
|
-
}
|
|
7
|
-
// Fallback for older commander versions
|
|
8
|
-
const resolved = {};
|
|
9
|
-
let current = command;
|
|
10
|
-
while (current) {
|
|
11
|
-
Object.assign(resolved, current.opts());
|
|
12
|
-
current = current.parent;
|
|
13
|
-
}
|
|
14
|
-
return resolved;
|
|
15
|
-
}
|
package/dist/src/types/cli.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|