@yoqa/runner 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +46 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -103615,7 +103615,7 @@ async function connectUsbmux(udid, port, socketPath = USBMUXD_SOCKET) {
103615
103615
 
103616
103616
  // src/domains/devices/yoqa-runner.ts
103617
103617
  import { X509Certificate, createHash } from "crypto";
103618
- import { existsSync as existsSync5 } from "fs";
103618
+ import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync, renameSync, rmSync } from "fs";
103619
103619
  import { copyFile, cp, mkdir as mkdir4, readFile as readFile4, readdir as readdir2, rename, rm as rm6, writeFile as writeFile4 } from "fs/promises";
103620
103620
  import { homedir as homedir9 } from "os";
103621
103621
  import { dirname as dirname5, join as join17, relative } from "path";
@@ -103938,6 +103938,9 @@ function prepareYoqaRunner(udid, deps) {
103938
103938
  return next;
103939
103939
  }
103940
103940
  async function prepare(udid, deps) {
103941
+ if (!existsSync5(join17(deps.projectDir, "YoqaRunner.xcodeproj"))) {
103942
+ throw new YoqaRunnerError(`YoqaRunner's Xcode project is missing from this install (looked in ${deps.projectDir}). Reinstall yoqa, or set YOQA_RUNNER_PROJECT to a native/yoqa-runner checkout.`);
103943
+ }
103941
103944
  const team = await signingTeam(deps);
103942
103945
  const [sources, xcode] = await Promise.all([
103943
103946
  hashSources(deps.projectDir),
@@ -104128,7 +104131,36 @@ async function execCommand(command) {
104128
104131
  return { stdout: "", stderr: `failed to spawn: ${command[0]}`, exitCode: 127 };
104129
104132
  }
104130
104133
  }
104134
+ var RUNNER_SOURCE_ARCHIVE = "yoqa-runner-src.tar.gz";
104135
+ function resolveYoqaRunnerProject(at) {
104136
+ const fromEnv = at.env.YOQA_RUNNER_PROJECT?.trim();
104137
+ if (fromEnv)
104138
+ return fromEnv;
104139
+ if (existsSync5(join17(at.checkout, "YoqaRunner.xcodeproj")))
104140
+ return at.checkout;
104141
+ if (!existsSync5(at.archive))
104142
+ return at.checkout;
104143
+ const key = createHash("sha256").update(readFileSync(at.archive)).digest("hex").slice(0, 16);
104144
+ const dir = join17(at.cacheRoot, "source", key);
104145
+ if (existsSync5(join17(dir, "YoqaRunner.xcodeproj")))
104146
+ return dir;
104147
+ const staging = `${dir}.${process.pid}.tmp`;
104148
+ rmSync(staging, { recursive: true, force: true });
104149
+ mkdirSync2(staging, { recursive: true });
104150
+ const tar = Bun.spawnSync(["tar", "-xzf", at.archive, "-C", staging]);
104151
+ if (tar.exitCode !== 0) {
104152
+ rmSync(staging, { recursive: true, force: true });
104153
+ return at.checkout;
104154
+ }
104155
+ try {
104156
+ renameSync(staging, dir);
104157
+ } catch {
104158
+ rmSync(staging, { recursive: true, force: true });
104159
+ }
104160
+ return dir;
104161
+ }
104131
104162
  function yoqaRunnerDeps() {
104163
+ const cacheRoot = join17(homedir9(), ".yoqa", "yoqa-runner");
104132
104164
  return {
104133
104165
  exec: execCommand,
104134
104166
  spawn: (command, env) => Bun.spawn(command, {
@@ -104138,8 +104170,13 @@ function yoqaRunnerDeps() {
104138
104170
  stderr: "pipe"
104139
104171
  }),
104140
104172
  env: process.env,
104141
- projectDir: join17(import.meta.dir, "../../../../../native/yoqa-runner"),
104142
- cacheRoot: join17(homedir9(), ".yoqa", "yoqa-runner"),
104173
+ projectDir: resolveYoqaRunnerProject({
104174
+ env: process.env,
104175
+ checkout: join17(import.meta.dir, "../../../../../native/yoqa-runner"),
104176
+ archive: join17(dirname5(process.execPath), RUNNER_SOURCE_ARCHIVE),
104177
+ cacheRoot
104178
+ }),
104179
+ cacheRoot,
104143
104180
  settingsPath: join17(homedir9(), ".yoqa", "ios-signing.json"),
104144
104181
  now: () => new Date
104145
104182
  };
@@ -104503,7 +104540,7 @@ function directOptIn(deviceClass, env = process.env) {
104503
104540
 
104504
104541
  // src/domains/devices/yoqa-ax.ts
104505
104542
  import { randomBytes } from "crypto";
104506
- import { existsSync as existsSync6, rmSync } from "fs";
104543
+ import { existsSync as existsSync6, rmSync as rmSync2 } from "fs";
104507
104544
  import { createServer } from "net";
104508
104545
  import { join as join19 } from "path";
104509
104546
  var CONNECT_TIMEOUT_MS = 1e4;
@@ -104635,7 +104672,7 @@ async function startYoqaAx(udid, options) {
104635
104672
  stopped = true;
104636
104673
  client?.close("is stopped");
104637
104674
  server.close();
104638
- rmSync(path, { force: true });
104675
+ rmSync2(path, { force: true });
104639
104676
  const exited = await Promise.race([
104640
104677
  proc.exited.then(() => true),
104641
104678
  Bun.sleep(STOP_GRACE_MS2).then(() => false)
@@ -105021,7 +105058,7 @@ import {
105021
105058
  createDecipheriv,
105022
105059
  randomBytes as randomBytes2
105023
105060
  } from "crypto";
105024
- import { chmodSync, existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
105061
+ import { chmodSync, existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync2, writeFileSync } from "fs";
105025
105062
  import { homedir as homedir10 } from "os";
105026
105063
  import { dirname as dirname6, join as join20 } from "path";
105027
105064
  var YOQA_ROOT2 = join20(homedir10(), ".yoqa");
@@ -105058,9 +105095,9 @@ function base64ToBytes(value) {
105058
105095
  return bytes;
105059
105096
  }
105060
105097
  function ensureProviderKey() {
105061
- mkdirSync2(YOQA_ROOT2, { recursive: true });
105098
+ mkdirSync3(YOQA_ROOT2, { recursive: true });
105062
105099
  if (existsSync7(KEY_PATH)) {
105063
- const existing = toBytes(readFileSync(KEY_PATH));
105100
+ const existing = toBytes(readFileSync2(KEY_PATH));
105064
105101
  if (existing.length === KEY_LENGTH) {
105065
105102
  return existing;
105066
105103
  }
@@ -109367,7 +109404,7 @@ import { join as join22 } from "path";
109367
109404
  // package.json
109368
109405
  var package_default = {
109369
109406
  name: "@yoqa/runner",
109370
- version: "1.0.0",
109407
+ version: "1.0.2",
109371
109408
  description: "Yoqa local runner \u2014 device control + catalog HTTP API (Bun). Start with yoqa serve or the yoqa-runner bin.",
109372
109409
  license: "UNLICENSED",
109373
109410
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoqa/runner",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Yoqa local runner — device control + catalog HTTP API (Bun). Start with yoqa serve or the yoqa-runner bin.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",