@ramarivera/chofi 0.1.3 → 0.1.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.
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AA2sCD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,YAAY,GAAE,eAAoB,GACjC,OAAO,CAAC,MAAM,CAAC,CA2DjB"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAIA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AA2sCD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,YAAY,GAAE,eAAoB,GACjC,OAAO,CAAC,MAAM,CAAC,CA2DjB"}
package/dist/cli.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, Option } from "commander";
3
+ import { realpathSync } from "node:fs";
4
+ import { fileURLToPath } from "node:url";
3
5
  import { createChofiEvent, NdjsonEventWriter } from "./events.js";
4
6
  import { discoverMobileProjectContext } from "./discovery.js";
5
7
  import { createCommandRunner, summarizeOutput } from "./executor.js";
@@ -1284,7 +1286,7 @@ async function runSimAction(input) {
1284
1286
  status: "failed",
1285
1287
  data: { target: input.target, message: String(error) }
1286
1288
  }));
1287
- return 1;
1289
+ throw new CliError(String(error), 1);
1288
1290
  }
1289
1291
  }
1290
1292
  async function runExecution(input) {
@@ -1363,6 +1365,12 @@ function writeToolCheck(writer, clock, availability) {
1363
1365
  data: { maestro: availability }
1364
1366
  }));
1365
1367
  }
1366
- if (import.meta.url === `file://${process.argv[1]}`) {
1368
+ function isCliEntrypoint() {
1369
+ if (!process.argv[1]) {
1370
+ return false;
1371
+ }
1372
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
1373
+ }
1374
+ if (isCliEntrypoint()) {
1367
1375
  process.exitCode = await runChofiCli(process.argv.slice(2));
1368
1376
  }
package/dist/runtime.js CHANGED
@@ -5,7 +5,7 @@ import { ExpoDriver } from "./drivers/expo.js";
5
5
  import { IdbDriver } from "./drivers/idb.js";
6
6
  import { SimulatorStateError, AppNotInstalledError, BuildFailedError, TestsFailedError, ToolOutputError, classifyError } from "./errors.js";
7
7
  function isAppAlreadyStopped(output) {
8
- return /not\s+(?:currently\s+)?running|no such process|could not find process/i.test(output);
8
+ return /not\s+(?:currently\s+)?running|no such process|could not find process|found nothing to terminate/i.test(output);
9
9
  }
10
10
  export class RuntimeController {
11
11
  apple;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramarivera/chofi",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "JSON-first CLI for iOS, Android, Expo, simulator, device, build, test, screenshot, logs, and Maestro workflows",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",