@qontinui/ui-bridge-wrapper 0.4.1 → 0.4.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.
- package/README.md +8 -0
- package/dist/capture-specs-cli.cjs +48 -24
- package/dist/capture-specs-cli.cjs.map +1 -1
- package/dist/cli-args.d.ts +11 -1
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/index.cjs +35 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -14
- package/dist/index.js.map +1 -1
- package/dist/inject-cli.cjs +48 -27
- package/dist/inject-cli.cjs.map +1 -1
- package/dist/inject-cli.d.ts.map +1 -1
- package/dist/login-drive.d.ts.map +1 -1
- package/dist/login-web-cli.cjs +60 -26
- package/dist/login-web-cli.cjs.map +1 -1
- package/dist/login-web-cli.d.ts.map +1 -1
- package/dist/react/index.cjs +4 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +4 -4
- package/dist/react/index.js.map +1 -1
- package/dist/transports/headless.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli-args.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export declare const COMMON_FLAGS: ReadonlySet<string>;
|
|
|
32
32
|
* value, it's an omitted argument.
|
|
33
33
|
*/
|
|
34
34
|
export declare function consumeValue(flag: string, raw: string | undefined, error: ArgErrorFactory): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Reject a present-but-empty value (`--success ''`). An empty value on a
|
|
37
|
+
* matching/target flag is never intended — e.g. an empty `--success` makes
|
|
38
|
+
* `landingPath.includes('')` true on ANY landing page, turning a stuck login
|
|
39
|
+
* into a false success (the exact exit-code-trust failure #83 exists to
|
|
40
|
+
* prevent). `null` (flag absent — caller defaults it) passes through.
|
|
41
|
+
*/
|
|
42
|
+
export declare function rejectEmptyValue(flag: string, value: string | null, error: ArgErrorFactory): string | null;
|
|
35
43
|
/**
|
|
36
44
|
* An `indexOf`-based reader for the browser bins' flat arg lists. Rejects unknown
|
|
37
45
|
* `--flags` up front (matching each bin's prior behavior) and rejects flag-shaped
|
|
@@ -51,7 +59,9 @@ export declare class ArgReader {
|
|
|
51
59
|
/**
|
|
52
60
|
* Value following the value-flag `name`, or `null` when the flag is absent OR
|
|
53
61
|
* has no following token (the caller defaults it). Throws when the following
|
|
54
|
-
* token is flag-shaped — the swallow this kit exists to kill.
|
|
62
|
+
* token is flag-shaped — the swallow this kit exists to kill. Delegates to
|
|
63
|
+
* {@link consumeValue} so the guard (and its message) live in exactly one
|
|
64
|
+
* place for both the indexOf-style and switch-style parsers.
|
|
55
65
|
*/
|
|
56
66
|
value(name: string): string | null;
|
|
57
67
|
}
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAAwC,CAAC;AAWtF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,eAAe,GACrB,MAAM,GAAG,IAAI,CAMf;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IAExC;;;;OAIG;gBACS,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,eAAe;IAUvF,qDAAqD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAAwC,CAAC;AAWtF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,eAAe,GACrB,MAAM,GAAG,IAAI,CAMf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,KAAK,EAAE,eAAe,GACrB,MAAM,GAAG,IAAI,CAOf;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IAExC;;;;OAIG;gBACS,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,eAAe;IAUvF,qDAAqD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAKnC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAKpF"}
|
package/dist/index.cjs
CHANGED
|
@@ -231,27 +231,48 @@ var HeadlessTransport = class extends BaseTransport {
|
|
|
231
231
|
({ launchHeadlessTab } = await import('@qontinui/ui-bridge-headless'));
|
|
232
232
|
} catch (err) {
|
|
233
233
|
const cause = err instanceof Error ? err.message : String(err);
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
const code = err?.code;
|
|
235
|
+
if (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") {
|
|
236
|
+
throw new WrapperTransportError(
|
|
237
|
+
"INVALID_CONFIG",
|
|
238
|
+
`Transport kind '${this.kind}' needs the optional '@qontinui/ui-bridge-headless' peer, which is not installed. Install it and the Chromium browser:
|
|
237
239
|
npm i @qontinui/ui-bridge-headless && npx playwright install chromium
|
|
238
240
|
(bare \`npx @qontinui/ui-bridge-wrapper \u2026\` does NOT install peers \u2014 pass each peer with \`-p\`, e.g.
|
|
239
241
|
npx -y -p @qontinui/ui-bridge-wrapper -p @qontinui/ui-bridge -p @qontinui/ui-bridge-headless -p playwright ui-bridge-login-web \u2026)
|
|
240
242
|
Underlying import error: ${cause}`
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
throw new WrapperTransportError(
|
|
246
|
+
"INVALID_CONFIG",
|
|
247
|
+
`'@qontinui/ui-bridge-headless' is installed but failed to load \u2014 this is a broken install (missing transitive dependency or version skew), not a missing peer. Try reinstalling it. Underlying error: ${cause}`
|
|
241
248
|
);
|
|
242
249
|
}
|
|
243
250
|
const initScripts = await this.buildInitScripts();
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
let tab;
|
|
252
|
+
try {
|
|
253
|
+
tab = await launchHeadlessTab({
|
|
254
|
+
url: this.options.targetUrl,
|
|
255
|
+
headless: this.headless,
|
|
256
|
+
uiBridgeBase: this.options.uiBridgeBase,
|
|
257
|
+
waitForUiBridgeMs: this.options.waitForUiBridgeMs,
|
|
258
|
+
viewportWidth: this.options.viewportWidth,
|
|
259
|
+
viewportHeight: this.options.viewportHeight,
|
|
260
|
+
userAgent: this.options.userAgent,
|
|
261
|
+
forwardConsole: this.options.forwardConsole,
|
|
262
|
+
initScripts: initScripts.length > 0 ? initScripts : void 0
|
|
263
|
+
});
|
|
264
|
+
} catch (err) {
|
|
265
|
+
const cause = err instanceof Error ? err.message : String(err);
|
|
266
|
+
if (/Executable doesn't exist|browserType\.launch/i.test(cause)) {
|
|
267
|
+
throw new WrapperTransportError(
|
|
268
|
+
"INVALID_CONFIG",
|
|
269
|
+
`Playwright's Chromium browser is not installed (the '@qontinui/ui-bridge-headless' peer itself loaded fine). Run:
|
|
270
|
+
npx playwright install chromium
|
|
271
|
+
Underlying launch error: ${cause}`
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
throw err;
|
|
275
|
+
}
|
|
255
276
|
this.tab = {
|
|
256
277
|
browser: tab.browser,
|
|
257
278
|
context: tab.context,
|