arcane-cli 0.22.7 → 0.22.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/index.js CHANGED
@@ -3371,6 +3371,33 @@ async function checkForUpdate(currentVersion, feedUrl, cachePath = DEFAULT_CACHE
3371
3371
  }
3372
3372
  }
3373
3373
 
3374
+ // src/modules/diagram-generator.ts
3375
+ function generateVersionDriftDiagram(repoFilesVersion, installedCliVersion, npmLatestVersion) {
3376
+ if (repoFilesVersion === installedCliVersion && installedCliVersion === npmLatestVersion) {
3377
+ return null;
3378
+ }
3379
+ const lines = ["gitGraph", ` commit id: "${repoFilesVersion}"`];
3380
+ let lastDistinctVersion = repoFilesVersion;
3381
+ if (installedCliVersion !== repoFilesVersion) {
3382
+ lines.push(
3383
+ " branch repo-files",
3384
+ " checkout main",
3385
+ ` commit id: "${installedCliVersion}"`
3386
+ );
3387
+ lastDistinctVersion = installedCliVersion;
3388
+ }
3389
+ if (npmLatestVersion !== lastDistinctVersion) {
3390
+ lines.push(
3391
+ " branch installed-cli",
3392
+ " checkout main",
3393
+ ` commit id: "${npmLatestVersion}" tag: "latest"`
3394
+ );
3395
+ } else {
3396
+ lines[lines.length - 1] += ' tag: "latest"';
3397
+ }
3398
+ return lines.join("\n");
3399
+ }
3400
+
3374
3401
  // src/commands/status.ts
3375
3402
  async function runStatus(targetDir, packageVersion) {
3376
3403
  let manifest;
@@ -3429,6 +3456,26 @@ async function runStatus(targetDir, packageVersion) {
3429
3456
  footer += " (spell update available)";
3430
3457
  }
3431
3458
  console.log(footer);
3459
+ if (versionResult.latest !== null) {
3460
+ const diagram = generateVersionDriftDiagram(
3461
+ manifest.version,
3462
+ packageVersion,
3463
+ versionResult.latest
3464
+ );
3465
+ if (diagram !== null) {
3466
+ console.log("");
3467
+ if (process.stdout.isTTY) {
3468
+ console.log(" Version drift:");
3469
+ console.log(` repo-files: ${manifest.version}`);
3470
+ console.log(` installed-cli: ${packageVersion}`);
3471
+ console.log(` latest (npm): ${versionResult.latest}`);
3472
+ } else {
3473
+ console.log("```mermaid");
3474
+ console.log(diagram);
3475
+ console.log("```");
3476
+ }
3477
+ }
3478
+ }
3432
3479
  }
3433
3480
 
3434
3481
  // src/commands/uninstall.ts