@yoqa/cli 0.3.13 → 0.3.15

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.
Files changed (2) hide show
  1. package/dist/main.js +21 -67
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -7850,7 +7850,7 @@ var {
7850
7850
  // package.json
7851
7851
  var package_default = {
7852
7852
  name: "@yoqa/cli",
7853
- version: "0.3.13",
7853
+ version: "0.3.15",
7854
7854
  description: "Yoqa CLI — drive local mobile QA from the terminal or CI (talks to the Yoqa runner over HTTP)",
7855
7855
  license: "UNLICENSED",
7856
7856
  type: "module",
@@ -7888,7 +7888,7 @@ var package_default = {
7888
7888
  health: "bun run src/main.ts health"
7889
7889
  },
7890
7890
  dependencies: {
7891
- "@yoqa/runner": "0.3.13"
7891
+ "@yoqa/runner": "0.3.15"
7892
7892
  },
7893
7893
  devDependencies: {
7894
7894
  "@types/node": "^22.15.30",
@@ -7911,16 +7911,7 @@ var ANSI = {
7911
7911
  red: "\x1B[31m",
7912
7912
  yellow: "\x1B[33m"
7913
7913
  };
7914
- var CHECK_STATUS_LABEL = {
7915
- pass: "PASS",
7916
- fail: "FAIL",
7917
- warn: "WARN"
7918
- };
7919
- var STEP_SEVERITY_LABEL = {
7920
- error: "ERROR",
7921
- warn: "WARN",
7922
- info: "INFO"
7923
- };
7914
+ var BULLET = "•";
7924
7915
  function doctorColorEnabled(env = process.env, isTty = Boolean(process.stdout.isTTY)) {
7925
7916
  if (env.NO_COLOR != null && env.NO_COLOR !== "")
7926
7917
  return false;
@@ -7951,73 +7942,36 @@ function stepColor(severity) {
7951
7942
  return "yellow";
7952
7943
  return "green";
7953
7944
  }
7954
- var ESC = "\x1B";
7955
- function stripAnsi(text) {
7956
- let out = "";
7957
- for (let i = 0;i < text.length; i++) {
7958
- if (text[i] === ESC && text[i + 1] === "[") {
7959
- const end = text.indexOf("m", i + 2);
7960
- if (end !== -1) {
7961
- i = end;
7962
- continue;
7963
- }
7964
- }
7965
- out += text[i];
7966
- }
7967
- return out;
7968
- }
7969
- function visibleWidth(text) {
7970
- return stripAnsi(text).length;
7971
- }
7972
- function padEndVisible(text, width) {
7973
- const extra = width - visibleWidth(text);
7974
- return extra > 0 ? `${text}${" ".repeat(extra)}` : text;
7975
- }
7976
- function cell(value) {
7977
- const text = value?.replace(/\s+/g, " ").trim() ?? "";
7978
- return text.length > 0 ? text : "—";
7979
- }
7980
- function columnWidths(headers, rows) {
7981
- return headers.map((header, index) => {
7982
- let width = header.length;
7983
- for (const row of rows) {
7984
- const value = row[index] ?? "";
7985
- width = Math.max(width, visibleWidth(value));
7986
- }
7987
- return width;
7988
- });
7989
- }
7990
- function formatTable(headers, rows, color) {
7991
- const widths = columnWidths(headers, rows);
7992
- const headerLine = headers.map((header, index) => padEndVisible(paint(header, "dim", color), widths[index] ?? header.length)).join(" ");
7993
- const rule = widths.map((width) => "─".repeat(width)).join(" ");
7994
- const body = rows.map((row) => row.map((value, index) => padEndVisible(value, widths[index] ?? visibleWidth(value))).join(" "));
7995
- return [headerLine, paint(rule, "dim", color), ...body].join(`
7996
- `);
7945
+ function detailText(value) {
7946
+ return value?.replace(/\s+/g, " ").trim() ?? "";
7997
7947
  }
7998
7948
  function checkDetail(check) {
7999
7949
  const parts = [check.detail, check.status !== "pass" ? check.fixHint : undefined].filter((part) => Boolean(part));
8000
- return cell(parts.join(" · "));
7950
+ return detailText(parts.join(" · "));
7951
+ }
7952
+ function bulletLine(label, detail, color, enabled) {
7953
+ const mark = paint(BULLET, color, enabled);
7954
+ const name = paint(label, color, enabled);
7955
+ if (!detail)
7956
+ return `${mark} ${name}`;
7957
+ return `${mark} ${name} ${paint(`— ${detail}`, "dim", enabled)}`;
8001
7958
  }
8002
7959
  function formatDoctorReport(report, color = doctorColorEnabled()) {
8003
7960
  const lines = [];
8004
7961
  const summary = report.ok ? "doctor ok" : "doctor issues found";
8005
7962
  lines.push(paint(summary, report.ok ? "green" : "red", color));
8006
- lines.push("");
8007
7963
  if (report.checks.length > 0) {
8008
- const rows = report.checks.map((check) => {
8009
- const status = paint(CHECK_STATUS_LABEL[check.status], checkColor(check.status), color);
8010
- return [status, check.label, checkDetail(check)];
8011
- });
8012
- lines.push(formatTable(["STATUS", "CHECK", "DETAIL"], rows, color));
7964
+ lines.push("");
7965
+ for (const check of report.checks) {
7966
+ lines.push(bulletLine(check.label, checkDetail(check), checkColor(check.status), color));
7967
+ }
8013
7968
  }
8014
7969
  if (report.steps.length > 0) {
8015
7970
  lines.push("");
8016
- const rows = report.steps.map((step) => {
8017
- const severity = paint(STEP_SEVERITY_LABEL[step.severity], stepColor(step.severity), color);
8018
- return [severity, step.title, cell(step.detail)];
8019
- });
8020
- lines.push(formatTable(["SEV", "STEP", "DETAIL"], rows, color));
7971
+ lines.push(paint("next", "dim", color));
7972
+ for (const step of report.steps) {
7973
+ lines.push(bulletLine(step.title, detailText(step.detail), stepColor(step.severity), color));
7974
+ }
8021
7975
  }
8022
7976
  return lines.join(`
8023
7977
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoqa/cli",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "Yoqa CLI — drive local mobile QA from the terminal or CI (talks to the Yoqa runner over HTTP)",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "health": "bun run src/main.ts health"
39
39
  },
40
40
  "dependencies": {
41
- "@yoqa/runner": "0.3.13"
41
+ "@yoqa/runner": "0.3.15"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.15.30",