@mechris3/glassbox 0.1.32 → 0.1.34

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.
@@ -4,6 +4,10 @@
4
4
  * Both the server-driven TestExecutor and the CLI batch runner need to spawn
5
5
  * a child process per journey with identical environment setup. This module
6
6
  * is the single source of truth for that logic.
7
+ *
8
+ * Uses tsx as the runner binary (not --import tsx) so that consumer projects
9
+ * don't need "type": "module" or .js extensions on relative imports — tsx
10
+ * owns the entire module resolution pipeline.
7
11
  */
8
12
  import { type ChildProcess } from 'child_process';
9
13
  export interface SpawnJourneyOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"spawn-journey.d.ts","sourceRoot":"","sources":["../../../src/runner/spawn-journey.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGzD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAKD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAuBzE"}
1
+ {"version":3,"file":"spawn-journey.d.ts","sourceRoot":"","sources":["../../../src/runner/spawn-journey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGzD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAWD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAyBzE"}
@@ -5,6 +5,10 @@
5
5
  * Both the server-driven TestExecutor and the CLI batch runner need to spawn
6
6
  * a child process per journey with identical environment setup. This module
7
7
  * is the single source of truth for that logic.
8
+ *
9
+ * Uses tsx as the runner binary (not --import tsx) so that consumer projects
10
+ * don't need "type": "module" or .js extensions on relative imports — tsx
11
+ * owns the entire module resolution pipeline.
8
12
  */
9
13
  Object.defineProperty(exports, "__esModule", { value: true });
10
14
  exports.spawnJourney = spawnJourney;
@@ -12,6 +16,11 @@ const child_process_1 = require("child_process");
12
16
  const path_1 = require("path");
13
17
  /** Path to the runner entry point — resolved from this module's location. */
14
18
  const RUNNER_ENTRY = (0, path_1.resolve)(__dirname, 'run-journey.js');
19
+ /** Resolve the tsx CLI binary from our own dependencies. */
20
+ function resolveTsxBin() {
21
+ const tsxPkgPath = require.resolve('tsx/package.json');
22
+ return (0, path_1.resolve)((0, path_1.dirname)(tsxPkgPath), 'dist', 'cli.mjs');
23
+ }
15
24
  /**
16
25
  * Spawn a journey runner child process with the correct environment.
17
26
  * Returns the process handle and a promise for the exit code.
@@ -27,7 +36,8 @@ function spawnJourney(options) {
27
36
  ACTION_DELAY: String(options.actionDelay),
28
37
  TEST_BREAKPOINTS: JSON.stringify(options.breakpoints),
29
38
  };
30
- const child = (0, child_process_1.spawn)(process.execPath, ['--import', 'tsx', RUNNER_ENTRY], {
39
+ const tsxBin = resolveTsxBin();
40
+ const child = (0, child_process_1.spawn)(process.execPath, [tsxBin, RUNNER_ENTRY], {
31
41
  env,
32
42
  stdio: ['pipe', 'pipe', 'pipe'],
33
43
  cwd: process.cwd(),
@@ -1 +1 @@
1
- {"version":3,"file":"spawn-journey.js","sourceRoot":"","sources":["../../../src/runner/spawn-journey.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAoCH,oCAuBC;AAzDD,iDAAyD;AACzD,+BAA+B;AA0B/B,6EAA6E;AAC7E,MAAM,YAAY,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,SAAgB,YAAY,CAAC,OAA4B;IACvD,MAAM,GAAG,GAA2B;QAClC,GAAG,OAAO,CAAC,GAA6B;QACxC,qBAAqB,EAAE,OAAO,CAAC,WAAW;QAC1C,oBAAoB,EAAE,OAAO,CAAC,UAAU;QACxC,WAAW,EAAE,OAAO,CAAC,SAAS;QAC9B,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;QAC7C,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;QAC/C,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;QACzC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;KACtD,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,YAAY,CAAC,EAAE;QACvE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CAAC,WAAW,CAAC;QACzC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;KACtD,CAAC;IAEF,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE;QAC5D,GAAG;QACH,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAC/B,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;KACnB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QAC/C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechris3/glassbox",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "Debugger-style browser automation test runner with live execution control via CDP",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",