@vizamodo/viza-cli 1.4.4 → 1.4.8

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
@@ -1,13 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
- import { fileURLToPath } from "node:url";
4
- import path from "node:path";
5
- import fs from "node:fs";
6
3
  import { handleError } from "../src/errors/handleError.js";
4
+ import { getCliVersion } from "../src/core/version.js";
7
5
  import { bootstrapCommand } from "../src/commands/bootstrap/index.js";
8
6
  import { loginAwsCommand } from "../src/commands/login/aws.js";
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
7
  /**
12
8
  * Helper: Gộp tất cả options từ root xuống sub-command
13
9
  */
@@ -20,21 +16,11 @@ function getResolvedOptions(command) {
20
16
  }
21
17
  return allOptions;
22
18
  }
23
- function readCliVersion() {
24
- try {
25
- const pkgPath = path.resolve(__dirname, "../package.json");
26
- const json = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
27
- return json.version || "dev";
28
- }
29
- catch {
30
- return "dev";
31
- }
32
- }
33
19
  const program = new Command();
34
20
  program
35
21
  .name("viza")
36
22
  .description("Viza CLI")
37
- .version(readCliVersion())
23
+ .version(getCliVersion())
38
24
  // Global Options
39
25
  .option("--status", "Show status only (no execution)")
40
26
  .option("--keep-log", "Keep execution logs", false)
@@ -25,6 +25,7 @@ export function showDispatchBanner(input, meta) {
25
25
  title: cfg.title,
26
26
  subtitle,
27
27
  color: cfg.color,
28
+ env: input.targetEnv,
28
29
  runner: input.selfHosted
29
30
  ? {
30
31
  type: "selfhosted",
@@ -39,7 +40,12 @@ export function showDispatchBanner(input, meta) {
39
40
  export function showBanner(opts) {
40
41
  const { title, subtitle, color = "cyanBright", runner, meta } = opts;
41
42
  process.stdout.write("\u001b[2J\u001b[3J\u001b[H");
42
- const bannerText = figlet.textSync(title, { font: "Standard" });
43
+ const font = opts.env === "prod"
44
+ ? "Colossal"
45
+ : opts.env === "dev"
46
+ ? "Big"
47
+ : "Standard";
48
+ const bannerText = figlet.textSync(title, { font });
43
49
  console.log(chalk[color](bannerText));
44
50
  if (subtitle) {
45
51
  console.log(chalk.gray("Command:"), chalk.magentaBright(subtitle));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizamodo/viza-cli",
3
- "version": "1.4.4",
3
+ "version": "1.4.8",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {