@midscene/cli 0.30.10 → 1.0.0
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/es/index.mjs +172 -208
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/index.js +150 -186
- package/dist/lib/index.js.map +1 -1
- package/package.json +9 -9
package/dist/es/index.mjs
CHANGED
|
@@ -21,22 +21,22 @@ import { EventEmitter } from "node:events";
|
|
|
21
21
|
import node_stream from "node:stream";
|
|
22
22
|
import { StringDecoder } from "node:string_decoder";
|
|
23
23
|
import { fileURLToPath as external_url_fileURLToPath } from "url";
|
|
24
|
-
import * as
|
|
25
|
-
import * as
|
|
26
|
-
import * as
|
|
27
|
-
import * as
|
|
28
|
-
import * as
|
|
29
|
-
import * as
|
|
30
|
-
import * as
|
|
31
|
-
import * as
|
|
24
|
+
import * as __rspack_external_assert from "assert";
|
|
25
|
+
import * as __rspack_external_crypto from "crypto";
|
|
26
|
+
import * as __rspack_external_fs from "fs";
|
|
27
|
+
import * as __rspack_external_os from "os";
|
|
28
|
+
import * as __rspack_external_path from "path";
|
|
29
|
+
import * as __rspack_external_tty from "tty";
|
|
30
|
+
import * as __rspack_external_util from "util";
|
|
31
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
32
32
|
var __webpack_modules__ = {
|
|
33
|
-
"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"
|
|
33
|
+
"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js" (module) {
|
|
34
34
|
module.exports = ({ onlyFirst = false } = {})=>{
|
|
35
35
|
const pattern = "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))";
|
|
36
36
|
return new RegExp(pattern, onlyFirst ? void 0 : 'g');
|
|
37
37
|
};
|
|
38
38
|
},
|
|
39
|
-
"../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"
|
|
39
|
+
"../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
40
40
|
module = __webpack_require__.nmd(module);
|
|
41
41
|
const wrapAnsi16 = (fn, offset)=>(...args)=>{
|
|
42
42
|
const code = fn(...args);
|
|
@@ -290,7 +290,7 @@ var __webpack_modules__ = {
|
|
|
290
290
|
get: assembleStyles
|
|
291
291
|
});
|
|
292
292
|
},
|
|
293
|
-
"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"
|
|
293
|
+
"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js" (module) {
|
|
294
294
|
module.exports = balanced;
|
|
295
295
|
function balanced(a, b, str) {
|
|
296
296
|
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
@@ -347,7 +347,7 @@ var __webpack_modules__ = {
|
|
|
347
347
|
return result;
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
|
-
"../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"
|
|
350
|
+
"../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
351
351
|
var balanced = __webpack_require__("../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js");
|
|
352
352
|
module.exports = expandTop;
|
|
353
353
|
var escSlash = '\0SLASH' + Math.random() + '\0';
|
|
@@ -483,7 +483,7 @@ var __webpack_modules__ = {
|
|
|
483
483
|
return expansions;
|
|
484
484
|
}
|
|
485
485
|
},
|
|
486
|
-
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"
|
|
486
|
+
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
487
487
|
const ansiStyles = __webpack_require__("../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js");
|
|
488
488
|
const { stdout: stdoutColor, stderr: stderrColor } = __webpack_require__("../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");
|
|
489
489
|
const { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = __webpack_require__("../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js");
|
|
@@ -644,7 +644,7 @@ var __webpack_modules__ = {
|
|
|
644
644
|
chalk.stderr.supportsColor = stderrColor;
|
|
645
645
|
module.exports = chalk;
|
|
646
646
|
},
|
|
647
|
-
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"
|
|
647
|
+
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js" (module) {
|
|
648
648
|
const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
649
649
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
650
650
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -766,7 +766,7 @@ var __webpack_modules__ = {
|
|
|
766
766
|
return chunks.join('');
|
|
767
767
|
};
|
|
768
768
|
},
|
|
769
|
-
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"
|
|
769
|
+
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js" (module) {
|
|
770
770
|
const stringReplaceAll = (string, substring, replacer)=>{
|
|
771
771
|
let index = string.indexOf(substring);
|
|
772
772
|
if (-1 === index) return string;
|
|
@@ -798,7 +798,7 @@ var __webpack_modules__ = {
|
|
|
798
798
|
stringEncaseCRLFWithFirstIndex
|
|
799
799
|
};
|
|
800
800
|
},
|
|
801
|
-
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"
|
|
801
|
+
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
802
802
|
const cssKeywords = __webpack_require__("../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js");
|
|
803
803
|
const reverseKeywords = {};
|
|
804
804
|
for (const key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]] = key;
|
|
@@ -1621,7 +1621,7 @@ var __webpack_modules__ = {
|
|
|
1621
1621
|
];
|
|
1622
1622
|
};
|
|
1623
1623
|
},
|
|
1624
|
-
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"
|
|
1624
|
+
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1625
1625
|
const conversions = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
|
|
1626
1626
|
const route = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js");
|
|
1627
1627
|
const convert = {};
|
|
@@ -1666,7 +1666,7 @@ var __webpack_modules__ = {
|
|
|
1666
1666
|
});
|
|
1667
1667
|
module.exports = convert;
|
|
1668
1668
|
},
|
|
1669
|
-
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"
|
|
1669
|
+
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1670
1670
|
const conversions = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
|
|
1671
1671
|
function buildGraph() {
|
|
1672
1672
|
const graph = {};
|
|
@@ -1730,7 +1730,7 @@ var __webpack_modules__ = {
|
|
|
1730
1730
|
return conversion;
|
|
1731
1731
|
};
|
|
1732
1732
|
},
|
|
1733
|
-
"../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"
|
|
1733
|
+
"../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js" (module) {
|
|
1734
1734
|
module.exports = {
|
|
1735
1735
|
aliceblue: [
|
|
1736
1736
|
240,
|
|
@@ -2474,7 +2474,7 @@ var __webpack_modules__ = {
|
|
|
2474
2474
|
]
|
|
2475
2475
|
};
|
|
2476
2476
|
},
|
|
2477
|
-
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js"
|
|
2477
|
+
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2478
2478
|
const fs = __webpack_require__("fs");
|
|
2479
2479
|
const path = __webpack_require__("path");
|
|
2480
2480
|
const os = __webpack_require__("os");
|
|
@@ -2700,12 +2700,12 @@ var __webpack_modules__ = {
|
|
|
2700
2700
|
module.exports.populate = DotenvModule.populate;
|
|
2701
2701
|
module.exports = DotenvModule;
|
|
2702
2702
|
},
|
|
2703
|
-
"../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"
|
|
2703
|
+
"../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js" (module) {
|
|
2704
2704
|
module.exports = function() {
|
|
2705
2705
|
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
2706
2706
|
};
|
|
2707
2707
|
},
|
|
2708
|
-
"../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.js"
|
|
2708
|
+
"../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2709
2709
|
const { dirname, resolve } = __webpack_require__("path");
|
|
2710
2710
|
const { readdirSync, statSync } = __webpack_require__("fs");
|
|
2711
2711
|
module.exports = function(start, callback) {
|
|
@@ -2720,7 +2720,7 @@ var __webpack_modules__ = {
|
|
|
2720
2720
|
}
|
|
2721
2721
|
};
|
|
2722
2722
|
},
|
|
2723
|
-
"../../node_modules/.pnpm/get-caller-file@2.0.5/node_modules/get-caller-file/index.js"
|
|
2723
|
+
"../../node_modules/.pnpm/get-caller-file@2.0.5/node_modules/get-caller-file/index.js" (module) {
|
|
2724
2724
|
module.exports = function(position) {
|
|
2725
2725
|
if (void 0 === position) position = 2;
|
|
2726
2726
|
if (position >= Error.stackTraceLimit) throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`');
|
|
@@ -2733,7 +2733,7 @@ var __webpack_modules__ = {
|
|
|
2733
2733
|
if (null !== stack && 'object' == typeof stack) return stack[position] ? stack[position].getFileName() : void 0;
|
|
2734
2734
|
};
|
|
2735
2735
|
},
|
|
2736
|
-
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"
|
|
2736
|
+
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js" (module) {
|
|
2737
2737
|
module.exports = (flag, argv = process.argv)=>{
|
|
2738
2738
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
2739
2739
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -2741,7 +2741,7 @@ var __webpack_modules__ = {
|
|
|
2741
2741
|
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
2742
2742
|
};
|
|
2743
2743
|
},
|
|
2744
|
-
"../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"
|
|
2744
|
+
"../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js" (module) {
|
|
2745
2745
|
const isFullwidthCodePoint = (codePoint)=>{
|
|
2746
2746
|
if (Number.isNaN(codePoint)) return false;
|
|
2747
2747
|
if (codePoint >= 0x1100 && (codePoint <= 0x115F || 0x2329 === codePoint || 0x232A === codePoint || 0x2E80 <= codePoint && codePoint <= 0x3247 && 0x303F !== codePoint || 0x3250 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE6B || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x3FFFD)) return true;
|
|
@@ -2750,7 +2750,7 @@ var __webpack_modules__ = {
|
|
|
2750
2750
|
module.exports = isFullwidthCodePoint;
|
|
2751
2751
|
module.exports["default"] = isFullwidthCodePoint;
|
|
2752
2752
|
},
|
|
2753
|
-
"../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js"
|
|
2753
|
+
"../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2754
2754
|
var fs = __webpack_require__("fs"), join = __webpack_require__("path").join, resolve = __webpack_require__("path").resolve, dirname = __webpack_require__("path").dirname, defaultOptions = {
|
|
2755
2755
|
extensions: [
|
|
2756
2756
|
'js',
|
|
@@ -2793,7 +2793,7 @@ var __webpack_modules__ = {
|
|
|
2793
2793
|
module.exports = requireDirectory;
|
|
2794
2794
|
module.exports.defaults = defaultOptions;
|
|
2795
2795
|
},
|
|
2796
|
-
"../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"
|
|
2796
|
+
"../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2797
2797
|
const stripAnsi = __webpack_require__("../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js");
|
|
2798
2798
|
const isFullwidthCodePoint = __webpack_require__("../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js");
|
|
2799
2799
|
const emojiRegex = __webpack_require__("../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js");
|
|
@@ -2817,11 +2817,11 @@ var __webpack_modules__ = {
|
|
|
2817
2817
|
module.exports = stringWidth;
|
|
2818
2818
|
module.exports["default"] = stringWidth;
|
|
2819
2819
|
},
|
|
2820
|
-
"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"
|
|
2820
|
+
"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2821
2821
|
const ansiRegex = __webpack_require__("../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js");
|
|
2822
2822
|
module.exports = (string)=>'string' == typeof string ? string.replace(ansiRegex(), '') : string;
|
|
2823
2823
|
},
|
|
2824
|
-
"../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"
|
|
2824
|
+
"../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2825
2825
|
const os = __webpack_require__("os");
|
|
2826
2826
|
const tty = __webpack_require__("tty");
|
|
2827
2827
|
const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
|
|
@@ -2888,7 +2888,7 @@ var __webpack_modules__ = {
|
|
|
2888
2888
|
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
2889
2889
|
};
|
|
2890
2890
|
},
|
|
2891
|
-
"../../node_modules/.pnpm/wrap-ansi@7.0.0/node_modules/wrap-ansi/index.js"
|
|
2891
|
+
"../../node_modules/.pnpm/wrap-ansi@7.0.0/node_modules/wrap-ansi/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
2892
2892
|
const stringWidth = __webpack_require__("../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
|
|
2893
2893
|
const stripAnsi = __webpack_require__("../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js");
|
|
2894
2894
|
const ansiStyles = __webpack_require__("../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js");
|
|
@@ -3021,11 +3021,11 @@ var __webpack_modules__ = {
|
|
|
3021
3021
|
};
|
|
3022
3022
|
module.exports = (string, columns, options)=>String(string).normalize().replace(/\r\n/g, '\n').split('\n').map((line)=>exec(line, columns, options)).join('\n');
|
|
3023
3023
|
},
|
|
3024
|
-
"./src/index.ts"
|
|
3024
|
+
"./src/index.ts" (__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
3025
3025
|
var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js");
|
|
3026
3026
|
var main_default = /*#__PURE__*/ __webpack_require__.n(main);
|
|
3027
3027
|
var package_namespaceObject = {
|
|
3028
|
-
|
|
3028
|
+
rE: "1.0.0"
|
|
3029
3029
|
};
|
|
3030
3030
|
class Node {
|
|
3031
3031
|
value;
|
|
@@ -3153,35 +3153,45 @@ var __webpack_modules__ = {
|
|
|
3153
3153
|
resolve(server);
|
|
3154
3154
|
});
|
|
3155
3155
|
});
|
|
3156
|
+
function resolveTestId(cliTestId, yamlTestId, fileName) {
|
|
3157
|
+
return cliTestId ?? yamlTestId ?? fileName;
|
|
3158
|
+
}
|
|
3159
|
+
function buildAgentOptions(yamlAgent, preferenceTestId, fileName) {
|
|
3160
|
+
return {
|
|
3161
|
+
...yamlAgent || {},
|
|
3162
|
+
cache: processCacheConfig(yamlAgent?.cache, fileName),
|
|
3163
|
+
testId: preferenceTestId
|
|
3164
|
+
};
|
|
3165
|
+
}
|
|
3156
3166
|
async function createYamlPlayer(file, script, options) {
|
|
3157
|
-
const yamlScript = script || parseYamlScript((0,
|
|
3167
|
+
const yamlScript = script || parseYamlScript((0, __rspack_external_node_fs_5ea92f0c.readFileSync)(file, 'utf-8'), file);
|
|
3168
|
+
const clonedYamlScript = structuredClone(yamlScript);
|
|
3158
3169
|
const fileName = basename(file, extname(file));
|
|
3159
3170
|
const preference = {
|
|
3160
|
-
headed:
|
|
3161
|
-
keepWindow:
|
|
3162
|
-
testId: fileName
|
|
3171
|
+
headed: options?.headed,
|
|
3172
|
+
keepWindow: options?.keepWindow,
|
|
3173
|
+
testId: resolveTestId(options?.testId, clonedYamlScript.agent?.testId, fileName)
|
|
3163
3174
|
};
|
|
3164
|
-
const player = new ScriptPlayer(
|
|
3175
|
+
const player = new ScriptPlayer(clonedYamlScript, async ()=>{
|
|
3165
3176
|
const freeFn = [];
|
|
3166
|
-
const webTarget =
|
|
3177
|
+
const webTarget = clonedYamlScript.web || clonedYamlScript.target;
|
|
3167
3178
|
const targetCount = [
|
|
3168
3179
|
void 0 !== webTarget,
|
|
3169
|
-
void 0 !==
|
|
3170
|
-
void 0 !==
|
|
3171
|
-
void 0 !==
|
|
3180
|
+
void 0 !== clonedYamlScript.android,
|
|
3181
|
+
void 0 !== clonedYamlScript.ios,
|
|
3182
|
+
void 0 !== clonedYamlScript.interface
|
|
3172
3183
|
].filter(Boolean).length;
|
|
3173
3184
|
if (targetCount > 1) {
|
|
3174
3185
|
const specifiedTargets = [
|
|
3175
3186
|
void 0 !== webTarget ? 'web' : null,
|
|
3176
|
-
void 0 !==
|
|
3177
|
-
void 0 !==
|
|
3178
|
-
void 0 !==
|
|
3187
|
+
void 0 !== clonedYamlScript.android ? 'android' : null,
|
|
3188
|
+
void 0 !== clonedYamlScript.ios ? 'ios' : null,
|
|
3189
|
+
void 0 !== clonedYamlScript.interface ? 'interface' : null
|
|
3179
3190
|
].filter(Boolean);
|
|
3180
3191
|
throw new Error(`Only one target type can be specified, but found multiple: ${specifiedTargets.join(', ')}. Please specify only one of: web, android, ios, or interface.`);
|
|
3181
3192
|
}
|
|
3182
3193
|
if (void 0 !== webTarget) {
|
|
3183
|
-
|
|
3184
|
-
if (void 0 !== yamlScript.target) console.warn("target is deprecated, please use web instead. See https://midscenejs.com/automate-with-scripts-in-yaml for more information. Sorry for the inconvenience.");
|
|
3194
|
+
if (void 0 !== clonedYamlScript.target) console.warn("target is deprecated, please use web instead. See https://midscenejs.com/automate-with-scripts-in-yaml for more information. Sorry for the inconvenience.");
|
|
3185
3195
|
let localServer;
|
|
3186
3196
|
let urlToVisit;
|
|
3187
3197
|
if (webTarget.serve) {
|
|
@@ -3190,17 +3200,16 @@ var __webpack_modules__ = {
|
|
|
3190
3200
|
const serverAddress = localServer.server.address();
|
|
3191
3201
|
freeFn.push({
|
|
3192
3202
|
name: 'local_server',
|
|
3193
|
-
fn: ()=>
|
|
3203
|
+
fn: ()=>localServer?.server.close()
|
|
3194
3204
|
});
|
|
3195
|
-
urlToVisit = webTarget.url.startsWith('/') ? `http://${
|
|
3205
|
+
urlToVisit = webTarget.url.startsWith('/') ? `http://${serverAddress?.address}:${serverAddress?.port}${webTarget.url}` : `http://${serverAddress?.address}:${serverAddress?.port}/${webTarget.url}`;
|
|
3196
3206
|
webTarget.url = urlToVisit;
|
|
3197
3207
|
}
|
|
3198
3208
|
if (!webTarget.bridgeMode) {
|
|
3199
|
-
var _yamlScript_agent1;
|
|
3200
3209
|
const { agent, freeFn: newFreeFn } = await puppeteerAgentForTarget(webTarget, {
|
|
3201
3210
|
...preference,
|
|
3202
|
-
|
|
3203
|
-
},
|
|
3211
|
+
...buildAgentOptions(clonedYamlScript.agent, preference.testId, fileName)
|
|
3212
|
+
}, options?.browser);
|
|
3204
3213
|
freeFn.push(...newFreeFn);
|
|
3205
3214
|
return {
|
|
3206
3215
|
agent,
|
|
@@ -3208,10 +3217,10 @@ var __webpack_modules__ = {
|
|
|
3208
3217
|
};
|
|
3209
3218
|
}
|
|
3210
3219
|
node_assert('newTabWithUrl' === webTarget.bridgeMode || 'currentTab' === webTarget.bridgeMode, `bridgeMode config value must be either "newTabWithUrl" or "currentTab", but got ${webTarget.bridgeMode}`);
|
|
3211
|
-
if (webTarget.userAgent || webTarget.viewportWidth || webTarget.viewportHeight || webTarget.viewportScale || webTarget.waitForNetworkIdle || webTarget.cookie) console.warn('puppeteer options (userAgent, viewportWidth, viewportHeight, viewportScale, waitForNetworkIdle, cookie) are not supported in bridge mode. They will be ignored.');
|
|
3220
|
+
if (webTarget.userAgent || webTarget.viewportWidth || webTarget.viewportHeight || webTarget.viewportScale || webTarget.waitForNetworkIdle || webTarget.cookie || webTarget.chromeArgs) console.warn('puppeteer options (userAgent, viewportWidth, viewportHeight, viewportScale, waitForNetworkIdle, cookie, chromeArgs) are not supported in bridge mode. They will be ignored.');
|
|
3212
3221
|
const agent = new AgentOverChromeBridge({
|
|
3213
3222
|
closeNewTabsAfterDisconnect: webTarget.closeNewTabsAfterDisconnect,
|
|
3214
|
-
|
|
3223
|
+
...buildAgentOptions(clonedYamlScript.agent, preference.testId, fileName)
|
|
3215
3224
|
});
|
|
3216
3225
|
if ('newTabWithUrl' === webTarget.bridgeMode) await agent.connectNewTabWithUrl(webTarget.url);
|
|
3217
3226
|
else {
|
|
@@ -3227,13 +3236,13 @@ var __webpack_modules__ = {
|
|
|
3227
3236
|
freeFn
|
|
3228
3237
|
};
|
|
3229
3238
|
}
|
|
3230
|
-
if (void 0 !==
|
|
3231
|
-
|
|
3232
|
-
const
|
|
3233
|
-
|
|
3234
|
-
|
|
3239
|
+
if (void 0 !== clonedYamlScript.android) {
|
|
3240
|
+
const androidTarget = clonedYamlScript.android;
|
|
3241
|
+
const agent = await agentFromAdbDevice(androidTarget?.deviceId, {
|
|
3242
|
+
...androidTarget,
|
|
3243
|
+
...buildAgentOptions(clonedYamlScript.agent, preference.testId, fileName)
|
|
3235
3244
|
});
|
|
3236
|
-
if (
|
|
3245
|
+
if (androidTarget?.launch) await agent.launch(androidTarget.launch);
|
|
3237
3246
|
freeFn.push({
|
|
3238
3247
|
name: 'destroy_android_agent',
|
|
3239
3248
|
fn: ()=>agent.destroy()
|
|
@@ -3243,13 +3252,13 @@ var __webpack_modules__ = {
|
|
|
3243
3252
|
freeFn
|
|
3244
3253
|
};
|
|
3245
3254
|
}
|
|
3246
|
-
if (void 0 !==
|
|
3247
|
-
const iosTarget =
|
|
3255
|
+
if (void 0 !== clonedYamlScript.ios) {
|
|
3256
|
+
const iosTarget = clonedYamlScript.ios;
|
|
3248
3257
|
const agent = await agentFromWebDriverAgent({
|
|
3249
|
-
|
|
3250
|
-
|
|
3258
|
+
...iosTarget,
|
|
3259
|
+
...buildAgentOptions(clonedYamlScript.agent, preference.testId, fileName)
|
|
3251
3260
|
});
|
|
3252
|
-
if (
|
|
3261
|
+
if (iosTarget?.launch) await agent.launch(iosTarget.launch);
|
|
3253
3262
|
freeFn.push({
|
|
3254
3263
|
name: 'destroy_ios_agent',
|
|
3255
3264
|
fn: ()=>agent.destroy()
|
|
@@ -3259,9 +3268,8 @@ var __webpack_modules__ = {
|
|
|
3259
3268
|
freeFn
|
|
3260
3269
|
};
|
|
3261
3270
|
}
|
|
3262
|
-
if (void 0 !==
|
|
3263
|
-
|
|
3264
|
-
const interfaceTarget = yamlScript.interface;
|
|
3271
|
+
if (void 0 !== clonedYamlScript.interface) {
|
|
3272
|
+
const interfaceTarget = clonedYamlScript.interface;
|
|
3265
3273
|
const moduleSpecifier = interfaceTarget.module;
|
|
3266
3274
|
let finalModuleSpecifier;
|
|
3267
3275
|
if (moduleSpecifier.startsWith('./') || moduleSpecifier.startsWith('../') || node_path.isAbsolute(moduleSpecifier)) {
|
|
@@ -3274,10 +3282,7 @@ var __webpack_modules__ = {
|
|
|
3274
3282
|
debug('DeviceClass', DeviceClass, 'with param', interfaceTarget.param);
|
|
3275
3283
|
const device = new DeviceClass(interfaceTarget.param || {});
|
|
3276
3284
|
debug('creating agent from device', device);
|
|
3277
|
-
const agent = createAgent(device,
|
|
3278
|
-
...yamlScript.agent,
|
|
3279
|
-
cache: processCacheConfig(null == (_yamlScript_agent3 = yamlScript.agent) ? void 0 : _yamlScript_agent3.cache, fileName)
|
|
3280
|
-
});
|
|
3285
|
+
const agent = createAgent(device, buildAgentOptions(clonedYamlScript.agent, preference.testId, fileName));
|
|
3281
3286
|
freeFn.push({
|
|
3282
3287
|
name: 'destroy_general_interface_agent',
|
|
3283
3288
|
fn: ()=>{
|
|
@@ -3299,26 +3304,25 @@ var __webpack_modules__ = {
|
|
|
3299
3304
|
const printer_indent = ' ';
|
|
3300
3305
|
const spinnerInterval = 80;
|
|
3301
3306
|
const spinnerFrames = [
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3307
|
+
'◰',
|
|
3308
|
+
'◳',
|
|
3309
|
+
'◲',
|
|
3310
|
+
'◱'
|
|
3306
3311
|
];
|
|
3307
3312
|
const currentSpinningFrame = ()=>spinnerFrames[Math.floor(Date.now() / spinnerInterval) % spinnerFrames.length];
|
|
3308
3313
|
function indicatorForStatus(status) {
|
|
3309
|
-
if ('init' === status) return source_default().gray(
|
|
3314
|
+
if ('init' === status) return source_default().gray('◌');
|
|
3310
3315
|
if ('running' === status) return source_default().yellowBright(currentSpinningFrame());
|
|
3311
|
-
if ('done' === status) return source_default().green(
|
|
3312
|
-
if ('error' === status) return source_default().red(
|
|
3316
|
+
if ('done' === status) return source_default().green('✔︎');
|
|
3317
|
+
if ('error' === status) return source_default().red('✘');
|
|
3313
3318
|
}
|
|
3314
3319
|
const contextInfo = (context)=>{
|
|
3315
|
-
var _context_player_errorInSetup, _context_player_errorInSetup1;
|
|
3316
3320
|
const filePath = context.file;
|
|
3317
3321
|
const filePathToShow = external_node_path_relative(process.cwd(), filePath);
|
|
3318
3322
|
const fileNameToPrint = `${source_default().gray(`${filePathToShow}`)}`;
|
|
3319
3323
|
const fileStatusText = indicatorForStatus(context.player.status);
|
|
3320
3324
|
const contextActionText = void 0 === context.player.currentTaskIndex && 'running' === context.player.status ? source_default().gray('(navigating)') : '';
|
|
3321
|
-
const errorText = context.player.errorInSetup ? `\n${printer_indent}${source_default().red('error:')} ${
|
|
3325
|
+
const errorText = context.player.errorInSetup ? `\n${printer_indent}${source_default().red('error:')} ${context.player.errorInSetup?.message}\n${printer_indent}${printer_indent}${context.player.errorInSetup?.stack}` : '';
|
|
3322
3326
|
const outputFile = context.player.output;
|
|
3323
3327
|
const outputText = outputFile && Object.keys(context.player.result || {}).length > 0 ? `\n${printer_indent}${source_default().gray(`output: ${outputFile}`)}` : '';
|
|
3324
3328
|
const reportFile = context.player.reportFile;
|
|
@@ -3336,7 +3340,6 @@ var __webpack_modules__ = {
|
|
|
3336
3340
|
};
|
|
3337
3341
|
};
|
|
3338
3342
|
const singleTaskInfo = (task)=>{
|
|
3339
|
-
var _task_error;
|
|
3340
3343
|
let stepText = '';
|
|
3341
3344
|
if ('init' === task.status) stepText = '';
|
|
3342
3345
|
else if ('running' === task.status || 'error' === task.status) if (void 0 === task.currentStep) stepText = source_default().gray('(navigating)');
|
|
@@ -3344,7 +3347,7 @@ var __webpack_modules__ = {
|
|
|
3344
3347
|
const actionText = '';
|
|
3345
3348
|
stepText = source_default().gray(`(task ${task.currentStep + 1}/${task.totalSteps}${actionText})`.trim());
|
|
3346
3349
|
} else stepText = source_default().gray('(unknown task)');
|
|
3347
|
-
const errorText = 'error' === task.status ? `\n${printer_indent}${source_default().gray('error:')}\n${printer_indent}${printer_indent}${
|
|
3350
|
+
const errorText = 'error' === task.status ? `\n${printer_indent}${source_default().gray('error:')}\n${printer_indent}${printer_indent}${task.error?.message}` : '';
|
|
3348
3351
|
const statusText = indicatorForStatus(task.status);
|
|
3349
3352
|
const mergedLine = `${statusText} ${task.name} ${stepText}${errorText}`;
|
|
3350
3353
|
return {
|
|
@@ -3645,7 +3648,7 @@ var __webpack_modules__ = {
|
|
|
3645
3648
|
}
|
|
3646
3649
|
current.message += next.message;
|
|
3647
3650
|
}
|
|
3648
|
-
if (current) this.render(
|
|
3651
|
+
if (current) this.render(current?.message, current?.type);
|
|
3649
3652
|
}
|
|
3650
3653
|
render(message, type = 'output') {
|
|
3651
3654
|
if (this.finished) {
|
|
@@ -3680,7 +3683,7 @@ var __webpack_modules__ = {
|
|
|
3680
3683
|
type,
|
|
3681
3684
|
message: chunk.toString()
|
|
3682
3685
|
});
|
|
3683
|
-
|
|
3686
|
+
callback?.();
|
|
3684
3687
|
};
|
|
3685
3688
|
return function() {
|
|
3686
3689
|
stream.write = original;
|
|
@@ -3773,7 +3776,7 @@ var __webpack_modules__ = {
|
|
|
3773
3776
|
};
|
|
3774
3777
|
delete clonedFileConfig.target;
|
|
3775
3778
|
}
|
|
3776
|
-
if (
|
|
3779
|
+
if (globalConfig?.target) {
|
|
3777
3780
|
globalConfig.web = {
|
|
3778
3781
|
...globalConfig.target,
|
|
3779
3782
|
...globalConfig.web
|
|
@@ -3839,7 +3842,7 @@ var __webpack_modules__ = {
|
|
|
3839
3842
|
};
|
|
3840
3843
|
await this.executeConcurrently(fileContextList, executeFile, executedResults, notExecutedContexts);
|
|
3841
3844
|
if (!isTTY) {
|
|
3842
|
-
console.log(
|
|
3845
|
+
console.log('\n📋 Execution Results:');
|
|
3843
3846
|
for (const context of executedResults)console.log(contextTaskListSummary(context.player.taskStatusList, context));
|
|
3844
3847
|
}
|
|
3845
3848
|
} finally{
|
|
@@ -3887,9 +3890,8 @@ var __webpack_modules__ = {
|
|
|
3887
3890
|
async processResults(executedContexts, notExecutedContexts) {
|
|
3888
3891
|
const results = [];
|
|
3889
3892
|
for (const context of executedContexts){
|
|
3890
|
-
var _player_taskStatusList, _player_errorInSetup;
|
|
3891
3893
|
const { file, player, duration } = context;
|
|
3892
|
-
const hasFailedTasks =
|
|
3894
|
+
const hasFailedTasks = player.taskStatusList?.some((task)=>'error' === task.status) ?? false;
|
|
3893
3895
|
const hasPlayerError = 'error' === player.status;
|
|
3894
3896
|
let success;
|
|
3895
3897
|
let resultType;
|
|
@@ -3906,7 +3908,7 @@ var __webpack_modules__ = {
|
|
|
3906
3908
|
let reportFile;
|
|
3907
3909
|
if (player.reportFile) reportFile = player.reportFile;
|
|
3908
3910
|
let outputPath = player.output || void 0;
|
|
3909
|
-
if (outputPath && !(0,
|
|
3911
|
+
if (outputPath && !(0, __rspack_external_node_fs_5ea92f0c.existsSync)(outputPath)) outputPath = void 0;
|
|
3910
3912
|
results.push({
|
|
3911
3913
|
file,
|
|
3912
3914
|
success,
|
|
@@ -3915,7 +3917,7 @@ var __webpack_modules__ = {
|
|
|
3915
3917
|
report: reportFile,
|
|
3916
3918
|
duration,
|
|
3917
3919
|
resultType,
|
|
3918
|
-
error:
|
|
3920
|
+
error: player.errorInSetup?.message || (hasPlayerError ? 'Execution failed' : void 0) || (hasFailedTasks ? 'Some tasks failed' : void 0)
|
|
3919
3921
|
});
|
|
3920
3922
|
}
|
|
3921
3923
|
for (const context of notExecutedContexts)results.push({
|
|
@@ -3931,7 +3933,7 @@ var __webpack_modules__ = {
|
|
|
3931
3933
|
return results;
|
|
3932
3934
|
}
|
|
3933
3935
|
async loadFileConfig(file) {
|
|
3934
|
-
const content = (0,
|
|
3936
|
+
const content = (0, __rspack_external_node_fs_5ea92f0c.readFileSync)(file, 'utf8');
|
|
3935
3937
|
return parseYamlScript(content, file);
|
|
3936
3938
|
}
|
|
3937
3939
|
getSummaryAbsolutePath() {
|
|
@@ -3940,7 +3942,7 @@ var __webpack_modules__ = {
|
|
|
3940
3942
|
printExecutionPlan() {
|
|
3941
3943
|
console.log(' Scripts:');
|
|
3942
3944
|
for (const file of this.config.files)console.log(` - ${file}`);
|
|
3943
|
-
console.log(
|
|
3945
|
+
console.log('📋 Execution plan');
|
|
3944
3946
|
console.log(` Concurrency: ${this.config.concurrent}`);
|
|
3945
3947
|
console.log(` Keep window: ${this.config.keepWindow}`);
|
|
3946
3948
|
console.log(` Headed: ${this.config.headed}`);
|
|
@@ -3952,7 +3954,7 @@ var __webpack_modules__ = {
|
|
|
3952
3954
|
const indexPath = external_node_path_resolve(getMidsceneRunSubDir('output'), this.config.summary);
|
|
3953
3955
|
const outputDir = dirname(indexPath);
|
|
3954
3956
|
try {
|
|
3955
|
-
(0,
|
|
3957
|
+
(0, __rspack_external_node_fs_5ea92f0c.mkdirSync)(outputDir, {
|
|
3956
3958
|
recursive: true
|
|
3957
3959
|
});
|
|
3958
3960
|
const indexData = {
|
|
@@ -3978,7 +3980,7 @@ var __webpack_modules__ = {
|
|
|
3978
3980
|
duration: result.duration
|
|
3979
3981
|
}))
|
|
3980
3982
|
};
|
|
3981
|
-
(0,
|
|
3983
|
+
(0, __rspack_external_node_fs_5ea92f0c.writeFileSync)(indexPath, JSON.stringify(indexData, null, 2));
|
|
3982
3984
|
console.log('Execution finished:');
|
|
3983
3985
|
} catch (error) {
|
|
3984
3986
|
console.error('Failed to generate output index:', error);
|
|
@@ -4018,7 +4020,7 @@ var __webpack_modules__ = {
|
|
|
4018
4020
|
printExecutionSummary() {
|
|
4019
4021
|
const summary = this.getExecutionSummary();
|
|
4020
4022
|
const success = 0 === summary.failed && 0 === summary.partialFailed && 0 === summary.notExecuted;
|
|
4021
|
-
console.log(
|
|
4023
|
+
console.log('\n📊 Execution Summary:');
|
|
4022
4024
|
console.log(` Total files: ${summary.total}`);
|
|
4023
4025
|
console.log(` Successful: ${summary.successful}`);
|
|
4024
4026
|
console.log(` Failed: ${summary.failed}`);
|
|
@@ -4027,31 +4029,31 @@ var __webpack_modules__ = {
|
|
|
4027
4029
|
console.log(` Duration: ${(summary.totalDuration / 1000).toFixed(2)}s`);
|
|
4028
4030
|
console.log(` Summary: ${this.getSummaryAbsolutePath()}`);
|
|
4029
4031
|
if (summary.successful > 0) {
|
|
4030
|
-
console.log(
|
|
4032
|
+
console.log('\n✅ Successful files:');
|
|
4031
4033
|
this.getSuccessfulFiles().forEach((file)=>{
|
|
4032
4034
|
console.log(` ${file}`);
|
|
4033
4035
|
});
|
|
4034
4036
|
}
|
|
4035
4037
|
if (summary.failed > 0) {
|
|
4036
|
-
console.log(
|
|
4038
|
+
console.log('\n❌ Failed files');
|
|
4037
4039
|
this.getFailedFiles().forEach((file)=>{
|
|
4038
4040
|
console.log(` ${file}`);
|
|
4039
4041
|
});
|
|
4040
4042
|
}
|
|
4041
4043
|
if (summary.partialFailed > 0) {
|
|
4042
|
-
console.log(
|
|
4044
|
+
console.log('\n⚠️ Partial failed files (some tasks failed with continueOnError)');
|
|
4043
4045
|
this.getPartialFailedFiles().forEach((file)=>{
|
|
4044
4046
|
console.log(` ${file}`);
|
|
4045
4047
|
});
|
|
4046
4048
|
}
|
|
4047
4049
|
if (summary.notExecuted > 0) {
|
|
4048
|
-
console.log(
|
|
4050
|
+
console.log('\n⏸️ Not executed files');
|
|
4049
4051
|
this.getNotExecutedFiles().forEach((file)=>{
|
|
4050
4052
|
console.log(` ${file}`);
|
|
4051
4053
|
});
|
|
4052
4054
|
}
|
|
4053
|
-
if (success) console.log(
|
|
4054
|
-
else console.log(
|
|
4055
|
+
if (success) console.log('\n🎉 All files executed successfully!');
|
|
4056
|
+
else console.log('\n⚠️ Some files failed or were not executed.');
|
|
4055
4057
|
return success;
|
|
4056
4058
|
}
|
|
4057
4059
|
constructor(config){
|
|
@@ -6700,7 +6702,7 @@ var __webpack_modules__ = {
|
|
|
6700
6702
|
realpath: realpath
|
|
6701
6703
|
}
|
|
6702
6704
|
};
|
|
6703
|
-
const fsFromOption = (fsOption)=>fsOption && fsOption !== defaultFS && fsOption !==
|
|
6705
|
+
const fsFromOption = (fsOption)=>fsOption && fsOption !== defaultFS && fsOption !== __rspack_external_node_fs_5ea92f0c ? {
|
|
6704
6706
|
...defaultFS,
|
|
6705
6707
|
...fsOption,
|
|
6706
6708
|
promises: {
|
|
@@ -11723,15 +11725,11 @@ var __webpack_modules__ = {
|
|
|
11723
11725
|
};
|
|
11724
11726
|
async function expandFilePatterns(patterns, basePath) {
|
|
11725
11727
|
const allFiles = [];
|
|
11726
|
-
const seenFiles = new Set();
|
|
11727
11728
|
for (const pattern of patterns)try {
|
|
11728
11729
|
const yamlFiles = await matchYamlFiles(pattern, {
|
|
11729
11730
|
cwd: basePath
|
|
11730
11731
|
});
|
|
11731
|
-
for (const file of yamlFiles)
|
|
11732
|
-
seenFiles.add(file);
|
|
11733
|
-
allFiles.push(file);
|
|
11734
|
-
}
|
|
11732
|
+
for (const file of yamlFiles)allFiles.push(file);
|
|
11735
11733
|
} catch (error) {
|
|
11736
11734
|
console.warn(`Warning: Failed to expand pattern "${pattern}":`, error);
|
|
11737
11735
|
}
|
|
@@ -11739,7 +11737,7 @@ var __webpack_modules__ = {
|
|
|
11739
11737
|
}
|
|
11740
11738
|
async function parseConfigYaml(configYamlPath) {
|
|
11741
11739
|
const basePath = dirname(external_node_path_resolve(configYamlPath));
|
|
11742
|
-
const configContent = (0,
|
|
11740
|
+
const configContent = (0, __rspack_external_node_fs_5ea92f0c.readFileSync)(configYamlPath, 'utf8');
|
|
11743
11741
|
const interpolatedContent = interpolateEnvVars(configContent);
|
|
11744
11742
|
let configYaml;
|
|
11745
11743
|
try {
|
|
@@ -11747,8 +11745,8 @@ var __webpack_modules__ = {
|
|
|
11747
11745
|
} catch (error) {
|
|
11748
11746
|
throw new Error(`Failed to parse config YAML: ${error}`);
|
|
11749
11747
|
}
|
|
11750
|
-
if (!
|
|
11751
|
-
const files = await expandFilePatterns(
|
|
11748
|
+
if (!configYaml?.files || !Array.isArray(configYaml?.files)) throw new Error('Config YAML must contain a "files" array');
|
|
11749
|
+
const files = await expandFilePatterns(configYaml?.files, basePath);
|
|
11752
11750
|
if (0 === files.length) throw new Error('No YAML files found matching the patterns in "files"');
|
|
11753
11751
|
const configFileName = basename(configYamlPath, extname(configYamlPath));
|
|
11754
11752
|
const timestamp = Date.now();
|
|
@@ -11778,23 +11776,23 @@ var __webpack_modules__ = {
|
|
|
11778
11776
|
ios: parsedConfig.ios,
|
|
11779
11777
|
target: parsedConfig.target
|
|
11780
11778
|
}, {
|
|
11781
|
-
web:
|
|
11782
|
-
android:
|
|
11783
|
-
ios:
|
|
11779
|
+
web: options?.web,
|
|
11780
|
+
android: options?.android,
|
|
11781
|
+
ios: options?.ios
|
|
11784
11782
|
});
|
|
11785
|
-
const keepWindow =
|
|
11786
|
-
const headed =
|
|
11783
|
+
const keepWindow = options?.keepWindow ?? parsedConfig.keepWindow;
|
|
11784
|
+
const headed = options?.headed ?? parsedConfig.headed;
|
|
11787
11785
|
const finalHeaded = keepWindow || headed;
|
|
11788
11786
|
return {
|
|
11789
11787
|
files: parsedConfig.files,
|
|
11790
|
-
concurrent:
|
|
11791
|
-
continueOnError:
|
|
11792
|
-
summary:
|
|
11793
|
-
shareBrowserContext:
|
|
11788
|
+
concurrent: options?.concurrent ?? parsedConfig.concurrent,
|
|
11789
|
+
continueOnError: options?.continueOnError ?? parsedConfig.continueOnError,
|
|
11790
|
+
summary: options?.summary ?? parsedConfig.summary,
|
|
11791
|
+
shareBrowserContext: options?.shareBrowserContext ?? parsedConfig.shareBrowserContext,
|
|
11794
11792
|
headed: finalHeaded,
|
|
11795
11793
|
keepWindow: keepWindow,
|
|
11796
|
-
dotenvOverride:
|
|
11797
|
-
dotenvDebug:
|
|
11794
|
+
dotenvOverride: options?.dotenvOverride ?? parsedConfig.dotenvOverride,
|
|
11795
|
+
dotenvDebug: options?.dotenvDebug ?? parsedConfig.dotenvDebug,
|
|
11798
11796
|
globalConfig
|
|
11799
11797
|
};
|
|
11800
11798
|
}
|
|
@@ -11823,8 +11821,16 @@ var __webpack_modules__ = {
|
|
|
11823
11821
|
};
|
|
11824
11822
|
}
|
|
11825
11823
|
const cli_utils_debug = getDebug('midscene:cli');
|
|
11824
|
+
function kebabToCamel(str) {
|
|
11825
|
+
return str.replace(/-([a-z])/g, (_, letter)=>letter.toUpperCase());
|
|
11826
|
+
}
|
|
11827
|
+
function camelToKebab(str) {
|
|
11828
|
+
return str.replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`).replace(/^-/, '');
|
|
11829
|
+
}
|
|
11826
11830
|
const parseProcessArgs = async ()=>{
|
|
11827
|
-
const args = yargs(hideBin(process.argv)).
|
|
11831
|
+
const args = yargs(hideBin(process.argv)).parserConfiguration({
|
|
11832
|
+
'dot-notation': true
|
|
11833
|
+
}).usage(`Midscene.js helps you automate browser actions, assertions, and data extraction by AI.
|
|
11828
11834
|
Homepage: https://midscenejs.com
|
|
11829
11835
|
Github: https://github.com/web-infra-dev/midscene
|
|
11830
11836
|
|
|
@@ -11872,76 +11878,34 @@ Usage:
|
|
|
11872
11878
|
'dotenv-debug': {
|
|
11873
11879
|
type: 'boolean',
|
|
11874
11880
|
description: `Turn on logging to help debug why certain keys or values are not being set as you expect, default is ${config_factory_defaultConfig.dotenvDebug}`
|
|
11875
|
-
},
|
|
11876
|
-
'web.user-agent': {
|
|
11877
|
-
alias: 'web.userAgent',
|
|
11878
|
-
type: 'string',
|
|
11879
|
-
description: 'Override user agent for web environments.'
|
|
11880
|
-
},
|
|
11881
|
-
'web.viewport-width': {
|
|
11882
|
-
alias: 'web.viewportWidth',
|
|
11883
|
-
type: 'number',
|
|
11884
|
-
description: 'Override viewport width for web environments.'
|
|
11885
|
-
},
|
|
11886
|
-
'web.viewport-height': {
|
|
11887
|
-
alias: 'web.viewportHeight',
|
|
11888
|
-
type: 'number',
|
|
11889
|
-
description: 'Override viewport height for web environments.'
|
|
11890
|
-
},
|
|
11891
|
-
'android.device-id': {
|
|
11892
|
-
alias: 'android.deviceId',
|
|
11893
|
-
type: 'string',
|
|
11894
|
-
description: 'Override device ID for Android environments.'
|
|
11895
|
-
},
|
|
11896
|
-
'ios.device-id': {
|
|
11897
|
-
alias: 'ios.deviceId',
|
|
11898
|
-
type: 'string',
|
|
11899
|
-
description: 'Override device ID for iOS environments.'
|
|
11900
|
-
},
|
|
11901
|
-
'ios.wda-port': {
|
|
11902
|
-
alias: 'ios.wdaPort',
|
|
11903
|
-
type: 'number',
|
|
11904
|
-
description: 'Override WebDriverAgent port for iOS environments.'
|
|
11905
|
-
},
|
|
11906
|
-
'ios.wda-host': {
|
|
11907
|
-
alias: 'ios.wdaHost',
|
|
11908
|
-
type: 'string',
|
|
11909
|
-
description: 'Override WebDriverAgent host for iOS environments.'
|
|
11910
11881
|
}
|
|
11911
|
-
}).version('version', 'Show version number', "0.
|
|
11882
|
+
}).version('version', 'Show version number', "1.0.0").help().epilogue(`For complete list of configuration options, please visit:
|
|
11883
|
+
• Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
|
|
11884
|
+
• Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
|
|
11885
|
+
• iOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-ios-part
|
|
11886
|
+
|
|
11887
|
+
Examples:
|
|
11888
|
+
$0 script.yaml --web.user-agent "Custom Agent" --web.viewport-width 1920
|
|
11889
|
+
$0 script.yaml --android.device-id emulator-5554 --android.ime-strategy yadb-for-non-ascii
|
|
11890
|
+
$0 script.yaml --ios.wda-port 8100 --ios.auto-dismiss-keyboard`).wrap(yargs().terminalWidth());
|
|
11912
11891
|
const argv = await args.argv;
|
|
11913
11892
|
cli_utils_debug('argv', argv);
|
|
11914
11893
|
const transformedArgv = {
|
|
11915
11894
|
...argv
|
|
11916
11895
|
};
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11929
|
-
if (argv
|
|
11930
|
-
transformedArgv.android = transformedArgv.android || {};
|
|
11931
|
-
transformedArgv.android.deviceId = argv['android.device-id'];
|
|
11932
|
-
}
|
|
11933
|
-
if (argv['ios.device-id']) {
|
|
11934
|
-
transformedArgv.ios = transformedArgv.ios || {};
|
|
11935
|
-
transformedArgv.ios.deviceId = argv['ios.device-id'];
|
|
11936
|
-
}
|
|
11937
|
-
if (argv['ios.wda-port']) {
|
|
11938
|
-
transformedArgv.ios = transformedArgv.ios || {};
|
|
11939
|
-
transformedArgv.ios.wdaPort = argv['ios.wda-port'];
|
|
11940
|
-
}
|
|
11941
|
-
if (argv['ios.wda-host']) {
|
|
11942
|
-
transformedArgv.ios = transformedArgv.ios || {};
|
|
11943
|
-
transformedArgv.ios.wdaHost = argv['ios.wda-host'];
|
|
11944
|
-
}
|
|
11896
|
+
const ensureBothFormats = (obj)=>{
|
|
11897
|
+
const result = {};
|
|
11898
|
+
Object.keys(obj).forEach((key)=>{
|
|
11899
|
+
const camelKey = kebabToCamel(key);
|
|
11900
|
+
const kebabKey = camelToKebab(key);
|
|
11901
|
+
result[kebabKey] = obj[key];
|
|
11902
|
+
result[camelKey] = obj[key];
|
|
11903
|
+
});
|
|
11904
|
+
return result;
|
|
11905
|
+
};
|
|
11906
|
+
if (argv.web && 'object' == typeof argv.web) transformedArgv.web = ensureBothFormats(argv.web);
|
|
11907
|
+
if (argv.android && 'object' == typeof argv.android) transformedArgv.android = ensureBothFormats(argv.android);
|
|
11908
|
+
if (argv.ios && 'object' == typeof argv.ios) transformedArgv.ios = ensureBothFormats(argv.ios);
|
|
11945
11909
|
return {
|
|
11946
11910
|
path: argv._[0],
|
|
11947
11911
|
files: argv.files,
|
|
@@ -11949,7 +11913,7 @@ Usage:
|
|
|
11949
11913
|
};
|
|
11950
11914
|
};
|
|
11951
11915
|
async function matchYamlFiles(fileGlob, options) {
|
|
11952
|
-
if ((0,
|
|
11916
|
+
if ((0, __rspack_external_node_fs_5ea92f0c.existsSync)(fileGlob) && (0, __rspack_external_node_fs_5ea92f0c.statSync)(fileGlob).isDirectory()) fileGlob = join(fileGlob, '**/*.{yml,yaml}');
|
|
11953
11917
|
const { cwd } = options || {};
|
|
11954
11918
|
const ignore = [
|
|
11955
11919
|
'**/node_modules/**'
|
|
@@ -11965,7 +11929,7 @@ Usage:
|
|
|
11965
11929
|
}
|
|
11966
11930
|
Promise.resolve((async ()=>{
|
|
11967
11931
|
const { options, path, files: cmdFiles } = await parseProcessArgs();
|
|
11968
|
-
const welcome = `\nWelcome to @midscene/cli v${package_namespaceObject.
|
|
11932
|
+
const welcome = `\nWelcome to @midscene/cli v${package_namespaceObject.rE}\n`;
|
|
11969
11933
|
console.log(welcome);
|
|
11970
11934
|
if (options.url) {
|
|
11971
11935
|
console.error("the cli mode is no longer supported, please use yaml file instead. See https://midscenejs.com/automate-with-scripts-in-yaml for more information. Sorry for the inconvenience.");
|
|
@@ -12010,7 +11974,7 @@ Usage:
|
|
|
12010
11974
|
process.exit(1);
|
|
12011
11975
|
}
|
|
12012
11976
|
const dotEnvConfigFile = join(process.cwd(), '.env');
|
|
12013
|
-
if ((0,
|
|
11977
|
+
if ((0, __rspack_external_node_fs_5ea92f0c.existsSync)(dotEnvConfigFile)) {
|
|
12014
11978
|
console.log(` Env file: ${dotEnvConfigFile}`);
|
|
12015
11979
|
main_default().config({
|
|
12016
11980
|
path: dotEnvConfigFile,
|
|
@@ -12033,28 +11997,28 @@ Usage:
|
|
|
12033
11997
|
process.exit(1);
|
|
12034
11998
|
}));
|
|
12035
11999
|
},
|
|
12036
|
-
assert
|
|
12037
|
-
module.exports =
|
|
12000
|
+
assert (module) {
|
|
12001
|
+
module.exports = __rspack_external_assert;
|
|
12038
12002
|
},
|
|
12039
|
-
crypto
|
|
12040
|
-
module.exports =
|
|
12003
|
+
crypto (module) {
|
|
12004
|
+
module.exports = __rspack_external_crypto;
|
|
12041
12005
|
},
|
|
12042
|
-
fs
|
|
12043
|
-
module.exports =
|
|
12006
|
+
fs (module) {
|
|
12007
|
+
module.exports = __rspack_external_fs;
|
|
12044
12008
|
},
|
|
12045
|
-
os
|
|
12046
|
-
module.exports =
|
|
12009
|
+
os (module) {
|
|
12010
|
+
module.exports = __rspack_external_os;
|
|
12047
12011
|
},
|
|
12048
|
-
path
|
|
12049
|
-
module.exports =
|
|
12012
|
+
path (module) {
|
|
12013
|
+
module.exports = __rspack_external_path;
|
|
12050
12014
|
},
|
|
12051
|
-
tty
|
|
12052
|
-
module.exports =
|
|
12015
|
+
tty (module) {
|
|
12016
|
+
module.exports = __rspack_external_tty;
|
|
12053
12017
|
},
|
|
12054
|
-
util
|
|
12055
|
-
module.exports =
|
|
12018
|
+
util (module) {
|
|
12019
|
+
module.exports = __rspack_external_util;
|
|
12056
12020
|
},
|
|
12057
|
-
"../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/index.cjs"
|
|
12021
|
+
"../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/index.cjs" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12058
12022
|
const align = {
|
|
12059
12023
|
right: alignRight,
|
|
12060
12024
|
center: alignCenter
|
|
@@ -12274,7 +12238,7 @@ Usage:
|
|
|
12274
12238
|
}
|
|
12275
12239
|
module.exports = ui;
|
|
12276
12240
|
},
|
|
12277
|
-
"../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs"
|
|
12241
|
+
"../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12278
12242
|
var fs = __webpack_require__("fs");
|
|
12279
12243
|
var util = __webpack_require__("util");
|
|
12280
12244
|
var path = __webpack_require__("path");
|
|
@@ -12431,7 +12395,7 @@ Usage:
|
|
|
12431
12395
|
const y18n = (opts)=>y18n$1(opts, nodePlatformShim);
|
|
12432
12396
|
module.exports = y18n;
|
|
12433
12397
|
},
|
|
12434
|
-
"../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/index.cjs"
|
|
12398
|
+
"../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/index.cjs" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12435
12399
|
var util = __webpack_require__("util");
|
|
12436
12400
|
var path = __webpack_require__("path");
|
|
12437
12401
|
__webpack_require__("fs");
|
|
@@ -13239,7 +13203,7 @@ Usage:
|
|
|
13239
13203
|
yargsParser.looksLikeNumber = looksLikeNumber;
|
|
13240
13204
|
module.exports = yargsParser;
|
|
13241
13205
|
},
|
|
13242
|
-
"../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/index.cjs"
|
|
13206
|
+
"../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/index.cjs" (module, __unused_rspack_exports, __webpack_require__) {
|
|
13243
13207
|
var t1 = __webpack_require__("assert");
|
|
13244
13208
|
class e1 extends Error {
|
|
13245
13209
|
constructor(t1){
|
|
@@ -15323,7 +15287,7 @@ Usage:
|
|
|
15323
15287
|
};
|
|
15324
15288
|
module.exports = ue;
|
|
15325
15289
|
},
|
|
15326
|
-
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json"
|
|
15290
|
+
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json" (module) {
|
|
15327
15291
|
module.exports = JSON.parse('{"name":"dotenv","version":"16.4.5","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","test:coverage":"tap --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}');
|
|
15328
15292
|
}
|
|
15329
15293
|
};
|