@vibgrate/cli 1.0.80 → 1.0.82

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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  Vibgrate Proprietary License
2
2
 
3
- Copyright (c) 2026 Vibgrate. All rights reserved.
3
+ Copyright © 2026 Vibgrate. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person or organisation
6
6
  obtaining a copy of this software in compiled/distributed form (the "Software"),
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  baselineCommand,
3
3
  runBaseline
4
- } from "./chunk-UH7CY33M.js";
5
- import "./chunk-22VJDYG5.js";
4
+ } from "./chunk-32UVQ5PT.js";
5
+ import "./chunk-2E4MGFBS.js";
6
6
  import "./chunk-JQHUH6A3.js";
7
7
  export {
8
8
  baselineCommand,
@@ -577,7 +577,7 @@ function formatArchitectureDiagram(arch) {
577
577
  lines.push("");
578
578
  if (arch.layers.length > 0) {
579
579
  for (const layer of arch.layers) {
580
- const risk = layer.riskLevel === "low" ? chalk.green("low") : layer.riskLevel === "moderate" ? chalk.yellow("moderate") : chalk.red("high");
580
+ const risk = layer.riskLevel === "none" ? chalk.dim("none") : layer.riskLevel === "low" ? chalk.green("low") : layer.riskLevel === "moderate" ? chalk.yellow("moderate") : chalk.red("high");
581
581
  lines.push(` ${chalk.bold(layer.layer)} ${layer.fileCount} file${layer.fileCount !== 1 ? "s" : ""} drift ${scoreBar(layer.driftScore)} risk ${risk}`);
582
582
  }
583
583
  lines.push("");
@@ -7384,10 +7384,7 @@ var ScanProgress = class {
7384
7384
  let buf = "";
7385
7385
  if (this.lastLineCount > 0) {
7386
7386
  buf += `\x1B[${this.lastLineCount}A`;
7387
- for (let i = 0; i < this.lastLineCount; i++) {
7388
- buf += "\x1B[2K\n";
7389
- }
7390
- buf += `\x1B[${this.lastLineCount}A`;
7387
+ buf += "\x1B[J";
7391
7388
  }
7392
7389
  buf += "\x1B[?25h";
7393
7390
  if (buf) process.stderr.write(buf);
@@ -7430,6 +7427,10 @@ var ScanProgress = class {
7430
7427
  lines.push(` ${ROBOT[2]}`);
7431
7428
  lines.push(` ${ROBOT[3]} ${chalk4.dim(this.rootDir)}`);
7432
7429
  lines.push("");
7430
+ for (const step of this.steps) {
7431
+ lines.push(this.renderStep(step));
7432
+ }
7433
+ lines.push("");
7433
7434
  const totalWeight = this.steps.reduce((sum, s) => sum + (s.weight ?? 1), 0);
7434
7435
  let completedWeight = 0;
7435
7436
  for (const step of this.steps) {
@@ -7457,10 +7458,6 @@ var ScanProgress = class {
7457
7458
  const treePart = this.stats.treeSummary ? chalk4.dim(` \xB7 ${this.stats.treeSummary.totalFiles.toLocaleString()} files \xB7 ${this.stats.treeSummary.totalDirs.toLocaleString()} dirs`) : "";
7458
7459
  lines.push(` ${bar} ${chalk4.bold.white(`${pct}%`)} ${chalk4.dim(elapsedStr)}${etaStr}${treePart}`);
7459
7460
  lines.push("");
7460
- for (const step of this.steps) {
7461
- lines.push(this.renderStep(step));
7462
- }
7463
- lines.push("");
7464
7461
  lines.push(this.renderStats());
7465
7462
  lines.push("");
7466
7463
  const content = lines.join("\n") + "\n";
@@ -7471,10 +7468,7 @@ var ScanProgress = class {
7471
7468
  let buf = "";
7472
7469
  if (this.lastLineCount > 0) {
7473
7470
  buf += `\x1B[${this.lastLineCount}A`;
7474
- for (let i = 0; i < this.lastLineCount; i++) {
7475
- buf += "\x1B[2K\n";
7476
- }
7477
- buf += `\x1B[${this.lastLineCount}A`;
7471
+ buf += "\x1B[J";
7478
7472
  }
7479
7473
  buf += content;
7480
7474
  process.stderr.write(buf);
@@ -10023,7 +10017,7 @@ function classifyFile(filePath, archetype) {
10023
10017
  }
10024
10018
  function computeLayerDrift(packages) {
10025
10019
  if (packages.length === 0) {
10026
- return { score: 100, riskLevel: "low" };
10020
+ return { score: 0, riskLevel: "none" };
10027
10021
  }
10028
10022
  let current = 0;
10029
10023
  let oneBehind = 0;
@@ -10041,7 +10035,7 @@ function computeLayerDrift(packages) {
10041
10035
  }
10042
10036
  }
10043
10037
  const known = current + oneBehind + twoPlusBehind;
10044
- if (known === 0) return { score: 100, riskLevel: "low" };
10038
+ if (known === 0) return { score: 0, riskLevel: "none" };
10045
10039
  const currentPct = current / known;
10046
10040
  const onePct = oneBehind / known;
10047
10041
  const twoPct = twoPlusBehind / known;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runScan
3
- } from "./chunk-22VJDYG5.js";
3
+ } from "./chunk-2E4MGFBS.js";
4
4
  import {
5
5
  writeJsonFile
6
6
  } from "./chunk-JQHUH6A3.js";
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  baselineCommand
4
- } from "./chunk-UH7CY33M.js";
4
+ } from "./chunk-32UVQ5PT.js";
5
5
  import {
6
6
  VERSION,
7
7
  computeHmac,
@@ -12,7 +12,7 @@ import {
12
12
  pushCommand,
13
13
  scanCommand,
14
14
  writeDefaultConfig
15
- } from "./chunk-22VJDYG5.js";
15
+ } from "./chunk-2E4MGFBS.js";
16
16
  import {
17
17
  Semaphore,
18
18
  ensureDir,
@@ -42,7 +42,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
42
42
  console.log(chalk.green("\u2714") + ` Created ${chalk.bold("vibgrate.config.ts")}`);
43
43
  }
44
44
  if (opts.baseline) {
45
- const { runBaseline } = await import("./baseline-WDQNMJ4M.js");
45
+ const { runBaseline } = await import("./baseline-YIHDZC5Y.js");
46
46
  await runBaseline(rootDir);
47
47
  }
48
48
  console.log("");
@@ -172,6 +172,32 @@ async function writeCache(data) {
172
172
  }
173
173
 
174
174
  // src/commands/update.ts
175
+ function detectGlobalInstall() {
176
+ const execPath = process.argv[1] || "";
177
+ if (execPath.includes("/lib/node_modules/") || execPath.includes("\\node_modules\\")) {
178
+ if (!execPath.includes(process.cwd())) {
179
+ if (execPath.includes("pnpm")) return "pnpm";
180
+ if (execPath.includes("yarn")) return "yarn";
181
+ if (execPath.includes("bun")) return "bun";
182
+ return "npm";
183
+ }
184
+ }
185
+ return null;
186
+ }
187
+ function getGlobalUpdateCommand(pm, pkg, version) {
188
+ const spec = `${pkg}@${version}`;
189
+ switch (pm) {
190
+ case "pnpm":
191
+ return `pnpm add -g ${spec}`;
192
+ case "yarn":
193
+ return `yarn global add ${spec}`;
194
+ case "bun":
195
+ return `bun add -g ${spec}`;
196
+ case "npm":
197
+ default:
198
+ return `npm install -g ${spec}`;
199
+ }
200
+ }
175
201
  async function detectPackageManager(cwd) {
176
202
  if (await pathExists(path4.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
177
203
  if (await pathExists(path4.join(cwd, "bun.lockb"))) return "bun";
@@ -202,7 +228,7 @@ async function isDevDependency(cwd) {
202
228
  return true;
203
229
  }
204
230
  }
205
- var updateCommand = new Command3("update").description("Update vibgrate to the latest version").option("--check", "Only check for updates, do not install").option("--pm <manager>", "Package manager to use (npm, pnpm, yarn, bun)").action(async (opts) => {
231
+ var updateCommand = new Command3("update").description("Update vibgrate to the latest version").option("--check", "Only check for updates, do not install").option("--pm <manager>", "Package manager to use (npm, pnpm, yarn, bun)").option("--global", "Update global installation").action(async (opts) => {
206
232
  console.log(chalk3.dim(`Current version: ${VERSION}`));
207
233
  console.log(chalk3.dim("Checking npm registry..."));
208
234
  const latest = await fetchLatestVersion();
@@ -221,10 +247,18 @@ var updateCommand = new Command3("update").description("Update vibgrate to the l
221
247
  return;
222
248
  }
223
249
  const cwd = process.cwd();
224
- const pm = opts.pm || await detectPackageManager(cwd);
225
- const isDev = await isDevDependency(cwd);
226
- const cmd = getInstallCommand(pm, "@vibgrate/cli", latest, isDev);
227
- console.log(chalk3.dim(`Using ${pm}: ${cmd}`));
250
+ const globalPm = detectGlobalInstall();
251
+ const isGlobal = opts.global || globalPm !== null;
252
+ const pm = opts.pm || (globalPm ?? await detectPackageManager(cwd));
253
+ let cmd;
254
+ if (isGlobal) {
255
+ cmd = getGlobalUpdateCommand(pm, "@vibgrate/cli", latest);
256
+ console.log(chalk3.dim(`Updating global installation with ${pm}: ${cmd}`));
257
+ } else {
258
+ const isDev = await isDevDependency(cwd);
259
+ cmd = getInstallCommand(pm, "@vibgrate/cli", latest, isDev);
260
+ console.log(chalk3.dim(`Using ${pm}: ${cmd}`));
261
+ }
228
262
  try {
229
263
  execSync(cmd, { cwd, stdio: "inherit" });
230
264
  console.log(chalk3.green("\u2714") + ` Updated to @vibgrate/cli@${latest}`);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type DepSection = 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies';
2
- type RiskLevel = 'low' | 'moderate' | 'high';
2
+ type RiskLevel = 'low' | 'moderate' | 'high' | 'none';
3
3
  type ProjectType = 'node' | 'dotnet' | 'python' | 'java' | 'go' | 'rust' | 'php' | 'typescript' | 'ruby' | 'swift' | 'kotlin' | 'dart' | 'scala' | 'r' | 'objective-c' | 'elixir' | 'haskell' | 'lua' | 'perl' | 'julia' | 'shell' | 'clojure' | 'groovy' | 'c' | 'cpp' | 'cobol' | 'fortran' | 'visual-basic' | 'pascal' | 'ada' | 'assembly' | 'rpg';
4
4
  type OutputFormat = 'text' | 'json' | 'sarif' | 'md';
5
5
  interface DependencyRow {
@@ -392,9 +392,9 @@ interface LayerSummary {
392
392
  layer: ArchitectureLayer;
393
393
  /** Number of files in this layer */
394
394
  fileCount: number;
395
- /** Drift score for dependencies used in this layer (0–100, 100 when no packages) */
395
+ /** Drift score for dependencies used in this layer (0–100, 0 when no packages to track) */
396
396
  driftScore: number;
397
- /** Risk level derived from drift score ('low' when no packages in layer) */
397
+ /** Risk level derived from drift score ('none' when no packages to track) */
398
398
  riskLevel: RiskLevel;
399
399
  /** Tech stack components detected in this layer */
400
400
  techStack: InventoryItem[];
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  formatText,
6
6
  generateFindings,
7
7
  runScan
8
- } from "./chunk-22VJDYG5.js";
8
+ } from "./chunk-2E4MGFBS.js";
9
9
  import "./chunk-JQHUH6A3.js";
10
10
  export {
11
11
  computeDriftScore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibgrate/cli",
3
- "version": "1.0.80",
3
+ "version": "1.0.82",
4
4
  "description": "CLI for measuring upgrade drift across Node, .NET, Python & Java projects",
5
5
  "type": "module",
6
6
  "bin": {