@yoqa/cli 0.3.12 → 0.3.14

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 +79 -19
  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.12",
7853
+ version: "0.3.14",
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.12"
7891
+ "@yoqa/runner": "0.3.14"
7892
7892
  },
7893
7893
  devDependencies: {
7894
7894
  "@types/node": "^22.15.30",
@@ -7902,6 +7902,81 @@ var package_default = {
7902
7902
  }
7903
7903
  };
7904
7904
 
7905
+ // src/doctor-table.ts
7906
+ var ANSI = {
7907
+ reset: "\x1B[0m",
7908
+ bold: "\x1B[1m",
7909
+ dim: "\x1B[2m",
7910
+ green: "\x1B[32m",
7911
+ red: "\x1B[31m",
7912
+ yellow: "\x1B[33m"
7913
+ };
7914
+ var BULLET = "•";
7915
+ function doctorColorEnabled(env = process.env, isTty = Boolean(process.stdout.isTTY)) {
7916
+ if (env.NO_COLOR != null && env.NO_COLOR !== "")
7917
+ return false;
7918
+ if (env.FORCE_COLOR != null && env.FORCE_COLOR !== "" && env.FORCE_COLOR !== "0")
7919
+ return true;
7920
+ return isTty;
7921
+ }
7922
+ function paint(text, color, enabled) {
7923
+ if (!enabled)
7924
+ return text;
7925
+ if (color === "dim")
7926
+ return `${ANSI.dim}${text}${ANSI.reset}`;
7927
+ if (color === "bold")
7928
+ return `${ANSI.bold}${text}${ANSI.reset}`;
7929
+ return `${ANSI.bold}${ANSI[color]}${text}${ANSI.reset}`;
7930
+ }
7931
+ function checkColor(status) {
7932
+ if (status === "pass")
7933
+ return "green";
7934
+ if (status === "fail")
7935
+ return "red";
7936
+ return "yellow";
7937
+ }
7938
+ function stepColor(severity) {
7939
+ if (severity === "error")
7940
+ return "red";
7941
+ if (severity === "warn")
7942
+ return "yellow";
7943
+ return "green";
7944
+ }
7945
+ function detailText(value) {
7946
+ return value?.replace(/\s+/g, " ").trim() ?? "";
7947
+ }
7948
+ function checkDetail(check) {
7949
+ const parts = [check.detail, check.status !== "pass" ? check.fixHint : undefined].filter((part) => Boolean(part));
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)}`;
7958
+ }
7959
+ function formatDoctorReport(report, color = doctorColorEnabled()) {
7960
+ const lines = [];
7961
+ const summary = report.ok ? "doctor ok" : "doctor issues found";
7962
+ lines.push(paint(summary, report.ok ? "green" : "red", color));
7963
+ if (report.checks.length > 0) {
7964
+ lines.push("");
7965
+ for (const check of report.checks) {
7966
+ lines.push(bulletLine(check.label, checkDetail(check), checkColor(check.status), color));
7967
+ }
7968
+ }
7969
+ if (report.steps.length > 0) {
7970
+ lines.push("");
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
+ }
7975
+ }
7976
+ return lines.join(`
7977
+ `);
7978
+ }
7979
+
7905
7980
  // src/ensure-runner.ts
7906
7981
  import { spawn } from "node:child_process";
7907
7982
  import { existsSync } from "node:fs";
@@ -8742,13 +8817,7 @@ program2.command("doctor").description("Diagnose local tooling, drivers, and lef
8742
8817
  console.log(JSON.stringify(result, null, 2));
8743
8818
  } else {
8744
8819
  console.log(result.message);
8745
- console.log(result.report.ok ? "doctor: ok" : "doctor: issues remain");
8746
- for (const check of result.report.checks) {
8747
- console.log(` [${check.status}] ${check.label}${check.detail ? ` — ${check.detail}` : ""}`);
8748
- }
8749
- for (const step of result.report.steps) {
8750
- console.log(` → [${step.severity}] ${step.title}: ${step.detail}`);
8751
- }
8820
+ console.log(formatDoctorReport(result.report));
8752
8821
  }
8753
8822
  if (!result.report.ok)
8754
8823
  process.exitCode = 1;
@@ -8758,16 +8827,7 @@ program2.command("doctor").description("Diagnose local tooling, drivers, and lef
8758
8827
  if (options.json) {
8759
8828
  console.log(JSON.stringify(report, null, 2));
8760
8829
  } else {
8761
- console.log(report.ok ? "doctor: ok" : "doctor: issues found");
8762
- for (const check of report.checks) {
8763
- console.log(` [${check.status}] ${check.label}${check.detail ? ` — ${check.detail}` : ""}`);
8764
- }
8765
- if (report.steps.length > 0) {
8766
- console.log("steps:");
8767
- for (const step of report.steps) {
8768
- console.log(` → [${step.severity}] ${step.title}: ${step.detail}`);
8769
- }
8770
- }
8830
+ console.log(formatDoctorReport(report));
8771
8831
  }
8772
8832
  if (!report.ok)
8773
8833
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoqa/cli",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
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.12"
41
+ "@yoqa/runner": "0.3.14"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.15.30",