@vizamodo/viza-cli 1.3.36 → 1.3.45
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/bin/viza.js
CHANGED
|
@@ -37,7 +37,7 @@ program
|
|
|
37
37
|
.version(readCliVersion())
|
|
38
38
|
// Global Options
|
|
39
39
|
.option("--status", "Show status only (no execution)")
|
|
40
|
-
.option("--
|
|
40
|
+
.option("--selfhosted", "Use self-hosted runner (viza-builder)", false);
|
|
41
41
|
program
|
|
42
42
|
.command("bootstrap")
|
|
43
43
|
.description("Bootstrap configuration")
|
|
@@ -8,14 +8,13 @@ import { dispatchIntentAndWait } from "../../core/dispatch.js";
|
|
|
8
8
|
*/
|
|
9
9
|
const TARGET_TEAMS = {
|
|
10
10
|
"dev": [
|
|
11
|
-
"viza-
|
|
11
|
+
"viza-deployer",
|
|
12
12
|
"viza-manager",
|
|
13
13
|
"viza-admin",
|
|
14
14
|
"viza-super"
|
|
15
15
|
],
|
|
16
16
|
"prod": [
|
|
17
17
|
"viza-publisher",
|
|
18
|
-
"viza-billing",
|
|
19
18
|
"viza-admin",
|
|
20
19
|
"viza-super"
|
|
21
20
|
]
|
|
@@ -34,14 +33,23 @@ export async function loginAwsCommand(options) {
|
|
|
34
33
|
// 1) Resolve environment
|
|
35
34
|
const env = resolveEnv(options);
|
|
36
35
|
const intent = resolveHubIntent(env);
|
|
36
|
+
// Resolve allowed teams
|
|
37
|
+
// - Dispatch mode: restrict by targetEnv
|
|
38
|
+
// - Status mode: allow union of all env teams (read-only query)
|
|
39
|
+
const allowedTeams = options.status
|
|
40
|
+
? Array.from(new Set([
|
|
41
|
+
...TARGET_TEAMS.dev,
|
|
42
|
+
...TARGET_TEAMS.prod,
|
|
43
|
+
]))
|
|
44
|
+
: TARGET_TEAMS[env];
|
|
37
45
|
// 5) Dispatch intent (freeze)
|
|
38
46
|
await dispatchIntentAndWait({
|
|
39
47
|
intent,
|
|
40
48
|
commandType: "viza.aws.login",
|
|
41
49
|
infraKey: "aws",
|
|
42
50
|
targetEnv: env,
|
|
43
|
-
allowedTeams
|
|
44
|
-
|
|
51
|
+
allowedTeams,
|
|
52
|
+
selfhosted: options.selfhosted === true,
|
|
45
53
|
keepLog: options.keepLog === true,
|
|
46
54
|
flowGates: {
|
|
47
55
|
secrets: false,
|
|
@@ -49,7 +57,7 @@ export async function loginAwsCommand(options) {
|
|
|
49
57
|
},
|
|
50
58
|
payload: {}
|
|
51
59
|
}, {
|
|
52
|
-
|
|
60
|
+
status: options.status === true,
|
|
53
61
|
log: "show",
|
|
54
62
|
});
|
|
55
63
|
}
|
|
@@ -4,6 +4,7 @@ import { startSpinner, stopSpinner } from "../ui/spinner.js";
|
|
|
4
4
|
import { renderLog } from "../ui/logRenderer.js";
|
|
5
5
|
import { showDispatchBanner } from "../ui/banner.js";
|
|
6
6
|
import { getCliVersion, checkForCliUpdateSoft } from "./version.js";
|
|
7
|
+
import { resolveExecutionMode } from "./resolveExecutionMode.js";
|
|
7
8
|
/**
|
|
8
9
|
* KISS log rendering.
|
|
9
10
|
* - success + hide => no log
|
|
@@ -24,7 +25,7 @@ async function dispatchIntent(input, mode = "dispatch") {
|
|
|
24
25
|
commandType: input.commandType,
|
|
25
26
|
infraKey: input.infraKey,
|
|
26
27
|
payload: input.payload,
|
|
27
|
-
runnerLabel: input.
|
|
28
|
+
runnerLabel: input.selfhosted ? "selfhosted" : "native",
|
|
28
29
|
keepLog: input.keepLog,
|
|
29
30
|
flowGates: input.flowGates,
|
|
30
31
|
};
|
|
@@ -44,7 +45,7 @@ async function dispatchIntent(input, mode = "dispatch") {
|
|
|
44
45
|
*/
|
|
45
46
|
export async function dispatchIntentAndWait(input, opts = {}) {
|
|
46
47
|
const policy = opts.log ?? "hide";
|
|
47
|
-
const mode = opts
|
|
48
|
+
const mode = resolveExecutionMode(opts);
|
|
48
49
|
const cliVersion = getCliVersion();
|
|
49
50
|
const meta = {
|
|
50
51
|
cliVersion,
|
package/dist/src/ui/banner.js
CHANGED
|
@@ -25,12 +25,12 @@ export function showDispatchBanner(input, meta) {
|
|
|
25
25
|
title: cfg.title,
|
|
26
26
|
subtitle,
|
|
27
27
|
color: cfg.color,
|
|
28
|
-
runner: input.
|
|
29
|
-
? {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
28
|
+
runner: input.selfhosted
|
|
29
|
+
? {
|
|
30
|
+
type: "selfhosted",
|
|
31
|
+
label: "viza-builder",
|
|
32
|
+
} :
|
|
33
|
+
{ type: "github" },
|
|
34
34
|
meta: {
|
|
35
35
|
version: meta?.cliVersion,
|
|
36
36
|
}
|
|
@@ -50,15 +50,17 @@ export function showBanner(opts) {
|
|
|
50
50
|
console.log(chalk.gray("Runner:"), chalk.yellowBright("GitHub-hosted"));
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
console.log(chalk.gray("Runner:"), chalk.yellowBright("self-hosted"), runner.label ? chalk.gray("|
|
|
53
|
+
console.log(chalk.gray("Runner:"), chalk.yellowBright("self-hosted"), runner.label ? chalk.gray(" | label:") : "", runner.label ? chalk.cyan(runner.label) : "");
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
// User-friendly info line
|
|
57
57
|
{
|
|
58
58
|
const parts = [];
|
|
59
|
+
parts.push(`Viza CLI`);
|
|
59
60
|
if (meta?.version) {
|
|
60
61
|
parts.push(`Version: ${chalk.cyan(meta.version)}`);
|
|
61
62
|
}
|
|
63
|
+
parts.push(`Install: ${chalk.gray(`npm i -g @vizamodo/viza-cli`)}`);
|
|
62
64
|
if (parts.length) {
|
|
63
65
|
console.log(chalk.gray(parts.join(chalk.gray(" | "))));
|
|
64
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizamodo/viza-cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Viza unified command line interface",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"release:prod": "rm -rf dist && npx npm-check-updates -u && npm install && git add package.json package-lock.json && git commit -m 'chore(deps): auto update dependencies before release' || echo 'No changes' && node versioning.js && npm login && npm publish --tag latest --access public && git push"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@vizamodo/viza-dispatcher": "^1.4.
|
|
19
|
+
"@vizamodo/viza-dispatcher": "^1.4.75",
|
|
20
20
|
"adm-zip": "^0.5.16",
|
|
21
21
|
"chalk": "^5.6.2",
|
|
22
22
|
"commander": "^14.0.2",
|