@yoqa/cli 1.0.3 → 1.0.5

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 +31 -25
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -16512,7 +16512,7 @@ function recommendScreenDefault(vision, tree) {
16512
16512
  // package.json
16513
16513
  var package_default = {
16514
16514
  name: "@yoqa/cli",
16515
- version: "1.0.3",
16515
+ version: "1.0.5",
16516
16516
  description: "Yoqa CLI — drive local mobile QA from the terminal or CI (talks to the Yoqa runner over HTTP)",
16517
16517
  license: "UNLICENSED",
16518
16518
  type: "module",
@@ -16549,7 +16549,7 @@ var package_default = {
16549
16549
  health: "bun run src/main.ts health"
16550
16550
  },
16551
16551
  dependencies: {
16552
- "@yoqa/runner": "1.0.3"
16552
+ "@yoqa/runner": "1.0.5"
16553
16553
  },
16554
16554
  devDependencies: {
16555
16555
  "@types/node": "^22.15.30",
@@ -16653,7 +16653,7 @@ import { existsSync } from "node:fs";
16653
16653
  import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
16654
16654
  import { createRequire as createRequire2 } from "node:module";
16655
16655
  import { homedir as osHomedir } from "node:os";
16656
- import { dirname, join } from "node:path";
16656
+ import { dirname, join, posix, win32 } from "node:path";
16657
16657
  import { fileURLToPath } from "node:url";
16658
16658
  var DEFAULT_RUNNER_HOST = "127.0.0.1";
16659
16659
  var DEFAULT_RUNNER_PORT = 7420;
@@ -16698,11 +16698,12 @@ function execRootsFrom(execPath, argv0) {
16698
16698
  }
16699
16699
  return roots;
16700
16700
  }
16701
- function packagedYoqaRunnerCandidates(roots) {
16702
- const fileName = "yoqa-runner";
16701
+ function packagedYoqaRunnerCandidates(roots, platform = process.platform) {
16702
+ const { join: join2 } = pathModule(platform);
16703
+ const fileName = platform === "win32" ? "yoqa-runner.exe" : "yoqa-runner";
16703
16704
  const paths = [];
16704
16705
  for (const root of roots) {
16705
- paths.push(join(root, fileName), join(root, "../Resources/app.asar.unpacked/runner", fileName), join(root, "../Resources/runner", fileName), join(root, "Resources/app.asar.unpacked/runner", fileName), join(root, "Resources/runner", fileName));
16706
+ paths.push(join2(root, fileName), join2(root, "../Resources/app.asar.unpacked/runner", fileName), join2(root, "../Resources/runner", fileName), join2(root, "Resources/app.asar.unpacked/runner", fileName), join2(root, "Resources/runner", fileName));
16706
16707
  }
16707
16708
  return paths;
16708
16709
  }
@@ -16804,44 +16805,49 @@ async function waitForRunnerHealth(fetchHealth, options) {
16804
16805
  }
16805
16806
  return fetchHealth();
16806
16807
  }
16807
- function pathWithHostTools(env, homedir) {
16808
+ function pathModule(platform) {
16809
+ return platform === "win32" ? win32 : posix;
16810
+ }
16811
+ function pathWithHostTools(env, homedir, platform = process.platform) {
16812
+ const { delimiter, join: join2 } = pathModule(platform);
16808
16813
  const extras = [
16809
- "/opt/homebrew/bin",
16810
- "/opt/homebrew/sbin",
16811
- "/usr/local/bin",
16812
- join(homedir, ".local", "bin"),
16813
- join(homedir, ".bun", "bin")
16814
+ ...platform === "win32" ? [] : ["/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin"],
16815
+ join2(homedir, ".local", "bin"),
16816
+ join2(homedir, ".bun", "bin")
16814
16817
  ];
16815
- const existing = (env.PATH ?? "").split(":").filter(Boolean);
16818
+ const existing = (env.PATH ?? "").split(delimiter).filter(Boolean);
16816
16819
  const prepend = extras.filter((dir) => !existing.includes(dir));
16817
- return [...prepend, ...existing].join(":");
16820
+ return [...prepend, ...existing].join(delimiter);
16821
+ }
16822
+ function bunCandidates(homedir, env, platform = process.platform) {
16823
+ const { join: join2 } = pathModule(platform);
16824
+ const bin = platform === "win32" ? "bun.exe" : "bun";
16825
+ const fromEnv = env.BUN_INSTALL ? join2(env.BUN_INSTALL, "bin", bin) : null;
16826
+ return [
16827
+ fromEnv,
16828
+ join2(homedir, ".bun", "bin", bin),
16829
+ ...platform === "win32" ? [] : ["/opt/homebrew/bin/bun", "/usr/local/bin/bun"]
16830
+ ].filter((path) => Boolean(path));
16818
16831
  }
16819
16832
  async function defaultPathExists(path) {
16820
16833
  return existsSync(path);
16821
16834
  }
16822
16835
  async function defaultWhich(bin) {
16823
16836
  const { execFile } = await import("node:child_process");
16837
+ const locator = process.platform === "win32" ? "where" : "which";
16824
16838
  return new Promise((resolve) => {
16825
- execFile("which", [bin], (error, stdout) => {
16839
+ execFile(locator, [bin], (error, stdout) => {
16826
16840
  if (error) {
16827
16841
  resolve(null);
16828
16842
  return;
16829
16843
  }
16830
- const path = stdout.trim().split(`
16831
- `)[0]?.trim();
16844
+ const path = stdout.trim().split(/\r?\n/)[0]?.trim();
16832
16845
  resolve(path || null);
16833
16846
  });
16834
16847
  });
16835
16848
  }
16836
16849
  async function defaultFindBun(pathExists, which, homedir, env) {
16837
- const fromEnv = env.BUN_INSTALL ? join(env.BUN_INSTALL, "bin", "bun") : null;
16838
- const candidates = [
16839
- fromEnv,
16840
- join(homedir, ".bun", "bin", "bun"),
16841
- "/opt/homebrew/bin/bun",
16842
- "/usr/local/bin/bun"
16843
- ].filter((path) => Boolean(path));
16844
- for (const candidate of candidates) {
16850
+ for (const candidate of bunCandidates(homedir, env)) {
16845
16851
  if (await pathExists(candidate))
16846
16852
  return candidate;
16847
16853
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoqa/cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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",
@@ -37,7 +37,7 @@
37
37
  "health": "bun run src/main.ts health"
38
38
  },
39
39
  "dependencies": {
40
- "@yoqa/runner": "1.0.3"
40
+ "@yoqa/runner": "1.0.5"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.15.30",