@tankpkg/cli 0.15.0 → 0.15.2

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/tank.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as VERSION, i as USER_AGENT, l as setConfig, n as flushLogs, o as getConfig, s as getConfigDir, t as authFlowLog } from "../debug-logger-DaiRHwM9.js";
2
+ import { a as VERSION, i as USER_AGENT, l as setConfig, n as flushLogs, o as getConfig, s as getConfigDir, t as authFlowLog } from "../debug-logger--sXI92X9.js";
3
3
  import { t as logger } from "../logger-BhULz3Uz.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { Command } from "commander";
@@ -497,7 +497,7 @@ function scoreColor$3(score) {
497
497
  if (score >= 4) return chalk.yellow;
498
498
  return chalk.red;
499
499
  }
500
- function formatScore(result) {
500
+ function formatScore$1(result) {
501
501
  if (result.error) return chalk.dim("error");
502
502
  if (result.score == null || result.status !== "completed") return chalk.dim("pending");
503
503
  return scoreColor$3(result.score)(result.score.toFixed(1));
@@ -540,7 +540,7 @@ function displayDetailedAudit(result) {
540
540
  console.log(chalk.bold(result.name));
541
541
  console.log("");
542
542
  console.log(`${chalk.dim("Version:".padEnd(14))}${result.version}`);
543
- console.log(`${chalk.dim("Audit Score:".padEnd(14))}${formatScore(result)}`);
543
+ console.log(`${chalk.dim("Audit Score:".padEnd(14))}${formatScore$1(result)}`);
544
544
  console.log(`${chalk.dim("Status:".padEnd(14))}${result.status}`);
545
545
  const perms = result.permissions;
546
546
  if (perms) {
@@ -564,7 +564,7 @@ function displayTable(results) {
564
564
  for (const result of results) {
565
565
  const name = chalk.bold(padRight$1(result.name, 30));
566
566
  const version = padRight$1(result.version, 12);
567
- const score = padRight$1(formatScore(result), 10);
567
+ const score = padRight$1(formatScore$1(result), 10);
568
568
  const status = formatStatus(result);
569
569
  console.log(`${name}${version}${score}${status}`);
570
570
  }
@@ -11256,6 +11256,11 @@ function scoreColor(score) {
11256
11256
  if (score >= 4) return chalk.yellow;
11257
11257
  return chalk.red;
11258
11258
  }
11259
+ function formatScore(score) {
11260
+ if (score == null || !Number.isFinite(score)) return chalk.dim(padRight("N/A", 8));
11261
+ const scoreStr = Number.isInteger(score) ? score.toFixed(1) : String(score);
11262
+ return scoreColor(score)(padRight(scoreStr, 8));
11263
+ }
11259
11264
  function truncate(text, maxLen) {
11260
11265
  if (text.length <= maxLen) return text;
11261
11266
  return `${text.slice(0, maxLen - 3)}...`;
@@ -11288,9 +11293,8 @@ async function searchCommand(options) {
11288
11293
  console.log(`${padRight("NAME", 30) + padRight("VERSION", 10) + padRight("SCORE", 8)}DESCRIPTION`);
11289
11294
  for (const result of data.results) {
11290
11295
  const name = chalk.bold(padRight(result.name, 30));
11291
- const version = padRight(result.latestVersion, 10);
11292
- const scoreStr = Number.isInteger(result.auditScore) ? result.auditScore.toFixed(1) : String(result.auditScore);
11293
- const score = scoreColor(result.auditScore)(padRight(scoreStr, 8));
11296
+ const version = padRight(result.latestVersion ?? "-", 10);
11297
+ const score = formatScore(result.auditScore);
11294
11298
  const desc = truncate(result.description ?? "", MAX_DESC_LENGTH);
11295
11299
  console.log(`${name}${version}${score}${desc}`);
11296
11300
  }