@midscene/cli 0.10.0 → 0.10.1-beta-20250121074221.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.js CHANGED
@@ -457,63 +457,6 @@ var require_main = __commonJS({
457
457
  }
458
458
  });
459
459
 
460
- // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js
461
- var require_env_options = __commonJS({
462
- "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js"(exports, module) {
463
- "use strict";
464
- var options = {};
465
- if (process.env.DOTENV_CONFIG_ENCODING != null) {
466
- options.encoding = process.env.DOTENV_CONFIG_ENCODING;
467
- }
468
- if (process.env.DOTENV_CONFIG_PATH != null) {
469
- options.path = process.env.DOTENV_CONFIG_PATH;
470
- }
471
- if (process.env.DOTENV_CONFIG_DEBUG != null) {
472
- options.debug = process.env.DOTENV_CONFIG_DEBUG;
473
- }
474
- if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
475
- options.override = process.env.DOTENV_CONFIG_OVERRIDE;
476
- }
477
- if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
478
- options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
479
- }
480
- module.exports = options;
481
- }
482
- });
483
-
484
- // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js
485
- var require_cli_options = __commonJS({
486
- "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js"(exports, module) {
487
- "use strict";
488
- var re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
489
- module.exports = function optionMatcher(args) {
490
- return args.reduce(function(acc, cur) {
491
- const matches = cur.match(re);
492
- if (matches) {
493
- acc[matches[1]] = matches[2];
494
- }
495
- return acc;
496
- }, {});
497
- };
498
- }
499
- });
500
-
501
- // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/config.js
502
- var init_config = __esm({
503
- "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/config.js"() {
504
- "use strict";
505
- (function() {
506
- require_main().config(
507
- Object.assign(
508
- {},
509
- require_env_options(),
510
- require_cli_options()(process.argv)
511
- )
512
- );
513
- })();
514
- }
515
- });
516
-
517
460
  // ../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
518
461
  var require_balanced_match = __commonJS({
519
462
  "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module) {
@@ -7471,6 +7414,63 @@ var init_esm5 = __esm({
7471
7414
  }
7472
7415
  });
7473
7416
 
7417
+ // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js
7418
+ var require_env_options = __commonJS({
7419
+ "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js"(exports, module) {
7420
+ "use strict";
7421
+ var options = {};
7422
+ if (process.env.DOTENV_CONFIG_ENCODING != null) {
7423
+ options.encoding = process.env.DOTENV_CONFIG_ENCODING;
7424
+ }
7425
+ if (process.env.DOTENV_CONFIG_PATH != null) {
7426
+ options.path = process.env.DOTENV_CONFIG_PATH;
7427
+ }
7428
+ if (process.env.DOTENV_CONFIG_DEBUG != null) {
7429
+ options.debug = process.env.DOTENV_CONFIG_DEBUG;
7430
+ }
7431
+ if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
7432
+ options.override = process.env.DOTENV_CONFIG_OVERRIDE;
7433
+ }
7434
+ if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
7435
+ options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
7436
+ }
7437
+ module.exports = options;
7438
+ }
7439
+ });
7440
+
7441
+ // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js
7442
+ var require_cli_options = __commonJS({
7443
+ "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js"(exports, module) {
7444
+ "use strict";
7445
+ var re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
7446
+ module.exports = function optionMatcher(args) {
7447
+ return args.reduce(function(acc, cur) {
7448
+ const matches = cur.match(re);
7449
+ if (matches) {
7450
+ acc[matches[1]] = matches[2];
7451
+ }
7452
+ return acc;
7453
+ }, {});
7454
+ };
7455
+ }
7456
+ });
7457
+
7458
+ // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/config.js
7459
+ var init_config = __esm({
7460
+ "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/config.js"() {
7461
+ "use strict";
7462
+ (function() {
7463
+ require_main().config(
7464
+ Object.assign(
7465
+ {},
7466
+ require_env_options(),
7467
+ require_cli_options()(process.argv)
7468
+ )
7469
+ );
7470
+ })();
7471
+ }
7472
+ });
7473
+
7474
7474
  // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs
7475
7475
  var require_build = __commonJS({
7476
7476
  "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs"(exports, module) {
@@ -10325,7 +10325,7 @@ var require_require_directory = __commonJS({
10325
10325
  "../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js"(exports, module) {
10326
10326
  "use strict";
10327
10327
  var fs = __require("fs");
10328
- var join2 = __require("path").join;
10328
+ var join3 = __require("path").join;
10329
10329
  var resolve = __require("path").resolve;
10330
10330
  var dirname2 = __require("path").dirname;
10331
10331
  var defaultOptions = {
@@ -10362,7 +10362,7 @@ var require_require_directory = __commonJS({
10362
10362
  }
10363
10363
  path2 = !path2 ? dirname2(m.filename) : resolve(dirname2(m.filename), path2);
10364
10364
  fs.readdirSync(path2).forEach(function(filename) {
10365
- var joined = join2(path2, filename), files, key, obj;
10365
+ var joined = join3(path2, filename), files, key, obj;
10366
10366
  if (fs.statSync(joined).isDirectory() && options.recurse) {
10367
10367
  files = requireDirectory(m, joined, options);
10368
10368
  if (Object.keys(files).length) {
@@ -12137,7 +12137,7 @@ var require_package2 = __commonJS({
12137
12137
  module.exports = {
12138
12138
  name: "@midscene/cli",
12139
12139
  description: "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
12140
- version: "0.10.0",
12140
+ version: "0.10.1-beta-20250121074221.0",
12141
12141
  repository: "https://github.com/web-infra-dev/midscene",
12142
12142
  homepage: "https://midscenejs.com/",
12143
12143
  "jsnext:source": "./src/index.ts",
@@ -13508,9 +13508,11 @@ var init_yaml_runner = __esm({
13508
13508
  });
13509
13509
 
13510
13510
  // src/index.ts
13511
+ import { existsSync as existsSync2 } from "fs";
13512
+ import { join as join2 } from "path";
13511
13513
  var require_src = __commonJS({
13512
13514
  "src/index.ts"(exports) {
13513
- init_config();
13515
+ var import_dotenv = __toESM(require_main());
13514
13516
  init_cli_utils();
13515
13517
  init_yaml_runner();
13516
13518
  Promise.resolve(
@@ -13518,6 +13520,11 @@ var require_src = __commonJS({
13518
13520
  const { options, path: path2 } = yield parseProcessArgs();
13519
13521
  const welcome = "\nWelcome to @midscene/cli\n";
13520
13522
  console.log(welcome);
13523
+ const dotEnvConfigFile = join2(process.cwd(), ".env");
13524
+ if (existsSync2(dotEnvConfigFile)) {
13525
+ console.log(`loading .env file from ${dotEnvConfigFile}`);
13526
+ import_dotenv.default.config({ path: dotEnvConfigFile });
13527
+ }
13521
13528
  if (options.url) {
13522
13529
  console.error(
13523
13530
  "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."
package/dist/lib/index.js CHANGED
@@ -448,47 +448,6 @@ var require_main = __commonJS({
448
448
  }
449
449
  });
450
450
 
451
- // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js
452
- var require_env_options = __commonJS({
453
- "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js"(exports2, module2) {
454
- "use strict";
455
- var options = {};
456
- if (process.env.DOTENV_CONFIG_ENCODING != null) {
457
- options.encoding = process.env.DOTENV_CONFIG_ENCODING;
458
- }
459
- if (process.env.DOTENV_CONFIG_PATH != null) {
460
- options.path = process.env.DOTENV_CONFIG_PATH;
461
- }
462
- if (process.env.DOTENV_CONFIG_DEBUG != null) {
463
- options.debug = process.env.DOTENV_CONFIG_DEBUG;
464
- }
465
- if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
466
- options.override = process.env.DOTENV_CONFIG_OVERRIDE;
467
- }
468
- if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
469
- options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
470
- }
471
- module2.exports = options;
472
- }
473
- });
474
-
475
- // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js
476
- var require_cli_options = __commonJS({
477
- "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js"(exports2, module2) {
478
- "use strict";
479
- var re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
480
- module2.exports = function optionMatcher(args) {
481
- return args.reduce(function(acc, cur) {
482
- const matches = cur.match(re);
483
- if (matches) {
484
- acc[matches[1]] = matches[2];
485
- }
486
- return acc;
487
- }, {});
488
- };
489
- }
490
- });
491
-
492
451
  // ../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
493
452
  var require_balanced_match = __commonJS({
494
453
  "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports2, module2) {
@@ -701,6 +660,47 @@ var require_brace_expansion = __commonJS({
701
660
  }
702
661
  });
703
662
 
663
+ // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js
664
+ var require_env_options = __commonJS({
665
+ "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/env-options.js"(exports2, module2) {
666
+ "use strict";
667
+ var options = {};
668
+ if (process.env.DOTENV_CONFIG_ENCODING != null) {
669
+ options.encoding = process.env.DOTENV_CONFIG_ENCODING;
670
+ }
671
+ if (process.env.DOTENV_CONFIG_PATH != null) {
672
+ options.path = process.env.DOTENV_CONFIG_PATH;
673
+ }
674
+ if (process.env.DOTENV_CONFIG_DEBUG != null) {
675
+ options.debug = process.env.DOTENV_CONFIG_DEBUG;
676
+ }
677
+ if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
678
+ options.override = process.env.DOTENV_CONFIG_OVERRIDE;
679
+ }
680
+ if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
681
+ options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;
682
+ }
683
+ module2.exports = options;
684
+ }
685
+ });
686
+
687
+ // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js
688
+ var require_cli_options = __commonJS({
689
+ "../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/cli-options.js"(exports2, module2) {
690
+ "use strict";
691
+ var re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
692
+ module2.exports = function optionMatcher(args) {
693
+ return args.reduce(function(acc, cur) {
694
+ const matches = cur.match(re);
695
+ if (matches) {
696
+ acc[matches[1]] = matches[2];
697
+ }
698
+ return acc;
699
+ }, {});
700
+ };
701
+ }
702
+ });
703
+
704
704
  // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs
705
705
  var require_build = __commonJS({
706
706
  "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs"(exports2, module2) {
@@ -3555,7 +3555,7 @@ var require_require_directory = __commonJS({
3555
3555
  "../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js"(exports2, module2) {
3556
3556
  "use strict";
3557
3557
  var fs = require("fs");
3558
- var join2 = require("path").join;
3558
+ var join3 = require("path").join;
3559
3559
  var resolve = require("path").resolve;
3560
3560
  var dirname2 = require("path").dirname;
3561
3561
  var defaultOptions = {
@@ -3592,7 +3592,7 @@ var require_require_directory = __commonJS({
3592
3592
  }
3593
3593
  path2 = !path2 ? dirname2(m.filename) : resolve(dirname2(m.filename), path2);
3594
3594
  fs.readdirSync(path2).forEach(function(filename) {
3595
- var joined = join2(path2, filename), files, key, obj;
3595
+ var joined = join3(path2, filename), files, key, obj;
3596
3596
  if (fs.statSync(joined).isDirectory() && options.recurse) {
3597
3597
  files = requireDirectory(m, joined, options);
3598
3598
  if (Object.keys(files).length) {
@@ -5351,7 +5351,7 @@ var require_package2 = __commonJS({
5351
5351
  module2.exports = {
5352
5352
  name: "@midscene/cli",
5353
5353
  description: "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
5354
- version: "0.10.0",
5354
+ version: "0.10.1-beta-20250121074221.0",
5355
5355
  repository: "https://github.com/web-infra-dev/midscene",
5356
5356
  homepage: "https://midscenejs.com/",
5357
5357
  "jsnext:source": "./src/index.ts",
@@ -5870,16 +5870,10 @@ var require_source = __commonJS({
5870
5870
  }
5871
5871
  });
5872
5872
 
5873
- // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/config.js
5874
- (function() {
5875
- require_main().config(
5876
- Object.assign(
5877
- {},
5878
- require_env_options(),
5879
- require_cli_options()(process.argv)
5880
- )
5881
- );
5882
- })();
5873
+ // src/index.ts
5874
+ var import_node_fs4 = require("fs");
5875
+ var import_node_path5 = require("path");
5876
+ var import_dotenv = __toESM(require_main());
5883
5877
 
5884
5878
  // ../../node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.js
5885
5879
  var import_brace_expansion = __toESM(require_brace_expansion());
@@ -12515,6 +12509,17 @@ var glob = Object.assign(glob_, {
12515
12509
  });
12516
12510
  glob.glob = glob;
12517
12511
 
12512
+ // ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/config.js
12513
+ (function() {
12514
+ require_main().config(
12515
+ Object.assign(
12516
+ {},
12517
+ require_env_options(),
12518
+ require_cli_options()(process.argv)
12519
+ )
12520
+ );
12521
+ })();
12522
+
12518
12523
  // src/cli-utils.ts
12519
12524
  var import_node_fs = require("fs");
12520
12525
  var import_node_fs2 = require("fs");
@@ -13322,6 +13327,11 @@ Promise.resolve(
13322
13327
  const { options, path: path2 } = yield parseProcessArgs();
13323
13328
  const welcome = "\nWelcome to @midscene/cli\n";
13324
13329
  console.log(welcome);
13330
+ const dotEnvConfigFile = (0, import_node_path5.join)(process.cwd(), ".env");
13331
+ if ((0, import_node_fs4.existsSync)(dotEnvConfigFile)) {
13332
+ console.log(`loading .env file from ${dotEnvConfigFile}`);
13333
+ import_dotenv.default.config({ path: dotEnvConfigFile });
13334
+ }
13325
13335
  if (options.url) {
13326
13336
  console.error(
13327
13337
  "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."
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/cli",
3
3
  "description": "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
4
- "version": "0.10.0",
4
+ "version": "0.10.1-beta-20250121074221.0",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "jsnext:source": "./src/index.ts",
@@ -17,8 +17,8 @@
17
17
  "dependencies": {
18
18
  "puppeteer": "23.0.2",
19
19
  "http-server": "14.1.1",
20
- "@midscene/core": "0.10.0",
21
- "@midscene/web": "0.10.0"
20
+ "@midscene/core": "0.10.1-beta-20250121074221.0",
21
+ "@midscene/web": "0.10.1-beta-20250121074221.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@modern-js/module-tools": "2.60.6",