hot-updater 0.18.2 → 0.18.3

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/index.cjs CHANGED
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  const require_picocolors$1 = require('./picocolors-nLcU57DT.cjs');
3
- const fs = require_picocolors$1.__toESM(require("fs"));
4
- const path = require_picocolors$1.__toESM(require("path"));
5
3
  const http = require_picocolors$1.__toESM(require("http"));
6
4
  const http2 = require_picocolors$1.__toESM(require("http2"));
7
5
  const stream = require_picocolors$1.__toESM(require("stream"));
8
6
  const crypto = require_picocolors$1.__toESM(require("crypto"));
9
7
  const __hot_updater_console = require_picocolors$1.__toESM(require("@hot-updater/console"));
10
8
  const __hot_updater_plugin_core = require_picocolors$1.__toESM(require("@hot-updater/plugin-core"));
9
+ const fs = require_picocolors$1.__toESM(require("fs"));
11
10
  const node_process = require_picocolors$1.__toESM(require("node:process"));
12
11
  const node_buffer = require_picocolors$1.__toESM(require("node:buffer"));
13
12
  const node_path = require_picocolors$1.__toESM(require("node:path"));
@@ -21,6 +20,7 @@ const node_net = require_picocolors$1.__toESM(require("node:net"));
21
20
  const __clack_prompts = require_picocolors$1.__toESM(require("@clack/prompts"));
22
21
  const fs_promises = require_picocolors$1.__toESM(require("fs/promises"));
23
22
  const es_git = require_picocolors$1.__toESM(require("es-git"));
23
+ const path = require_picocolors$1.__toESM(require("path"));
24
24
  const __bacons_xcode = require_picocolors$1.__toESM(require("@bacons/xcode"));
25
25
  const globby = require_picocolors$1.__toESM(require("globby"));
26
26
  const __rnef_tools = require_picocolors$1.__toESM(require("@rnef/tools"));
@@ -480,11 +480,11 @@ var require_re = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/sem
480
480
  const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
481
481
  const debug$3 = require_debug();
482
482
  exports = module.exports = {};
483
- const re$3 = exports.re = [];
483
+ const re$4 = exports.re = [];
484
484
  const safeRe = exports.safeRe = [];
485
485
  const src = exports.src = [];
486
486
  const safeSrc = exports.safeSrc = [];
487
- const t$3 = exports.t = {};
487
+ const t$4 = exports.t = {};
488
488
  let R = 0;
489
489
  const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
490
490
  const safeRegexReplacements = [
@@ -500,55 +500,55 @@ var require_re = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/sem
500
500
  const safe = makeSafeRegex(value);
501
501
  const index$1 = R++;
502
502
  debug$3(name, index$1, value);
503
- t$3[name] = index$1;
503
+ t$4[name] = index$1;
504
504
  src[index$1] = value;
505
505
  safeSrc[index$1] = safe;
506
- re$3[index$1] = new RegExp(value, isGlobal ? "g" : void 0);
506
+ re$4[index$1] = new RegExp(value, isGlobal ? "g" : void 0);
507
507
  safeRe[index$1] = new RegExp(safe, isGlobal ? "g" : void 0);
508
508
  };
509
509
  createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
510
510
  createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
511
511
  createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
512
- createToken("MAINVERSION", `(${src[t$3.NUMERICIDENTIFIER]})\\.(${src[t$3.NUMERICIDENTIFIER]})\\.(${src[t$3.NUMERICIDENTIFIER]})`);
513
- createToken("MAINVERSIONLOOSE", `(${src[t$3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$3.NUMERICIDENTIFIERLOOSE]})`);
514
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t$3.NONNUMERICIDENTIFIER]}|${src[t$3.NUMERICIDENTIFIER]})`);
515
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$3.NONNUMERICIDENTIFIER]}|${src[t$3.NUMERICIDENTIFIERLOOSE]})`);
516
- createToken("PRERELEASE", `(?:-(${src[t$3.PRERELEASEIDENTIFIER]}(?:\\.${src[t$3.PRERELEASEIDENTIFIER]})*))`);
517
- createToken("PRERELEASELOOSE", `(?:-?(${src[t$3.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$3.PRERELEASEIDENTIFIERLOOSE]})*))`);
512
+ createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
513
+ createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
514
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
515
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
516
+ createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
517
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
518
518
  createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
519
- createToken("BUILD", `(?:\\+(${src[t$3.BUILDIDENTIFIER]}(?:\\.${src[t$3.BUILDIDENTIFIER]})*))`);
520
- createToken("FULLPLAIN", `v?${src[t$3.MAINVERSION]}${src[t$3.PRERELEASE]}?${src[t$3.BUILD]}?`);
521
- createToken("FULL", `^${src[t$3.FULLPLAIN]}$`);
522
- createToken("LOOSEPLAIN", `[v=\\s]*${src[t$3.MAINVERSIONLOOSE]}${src[t$3.PRERELEASELOOSE]}?${src[t$3.BUILD]}?`);
523
- createToken("LOOSE", `^${src[t$3.LOOSEPLAIN]}$`);
519
+ createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
520
+ createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
521
+ createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
522
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
523
+ createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
524
524
  createToken("GTLT", "((?:<|>)?=?)");
525
- createToken("XRANGEIDENTIFIERLOOSE", `${src[t$3.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
526
- createToken("XRANGEIDENTIFIER", `${src[t$3.NUMERICIDENTIFIER]}|x|X|\\*`);
527
- createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$3.XRANGEIDENTIFIER]})(?:\\.(${src[t$3.XRANGEIDENTIFIER]})(?:\\.(${src[t$3.XRANGEIDENTIFIER]})(?:${src[t$3.PRERELEASE]})?${src[t$3.BUILD]}?)?)?`);
528
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$3.XRANGEIDENTIFIERLOOSE]})(?:${src[t$3.PRERELEASELOOSE]})?${src[t$3.BUILD]}?)?)?`);
529
- createToken("XRANGE", `^${src[t$3.GTLT]}\\s*${src[t$3.XRANGEPLAIN]}$`);
530
- createToken("XRANGELOOSE", `^${src[t$3.GTLT]}\\s*${src[t$3.XRANGEPLAINLOOSE]}$`);
525
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
526
+ createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
527
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
528
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
529
+ createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
530
+ createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
531
531
  createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
532
- createToken("COERCE", `${src[t$3.COERCEPLAIN]}(?:$|[^\\d])`);
533
- createToken("COERCEFULL", src[t$3.COERCEPLAIN] + `(?:${src[t$3.PRERELEASE]})?(?:${src[t$3.BUILD]})?(?:$|[^\\d])`);
534
- createToken("COERCERTL", src[t$3.COERCE], true);
535
- createToken("COERCERTLFULL", src[t$3.COERCEFULL], true);
532
+ createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
533
+ createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
534
+ createToken("COERCERTL", src[t$4.COERCE], true);
535
+ createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
536
536
  createToken("LONETILDE", "(?:~>?)");
537
- createToken("TILDETRIM", `(\\s*)${src[t$3.LONETILDE]}\\s+`, true);
537
+ createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
538
538
  exports.tildeTrimReplace = "$1~";
539
- createToken("TILDE", `^${src[t$3.LONETILDE]}${src[t$3.XRANGEPLAIN]}$`);
540
- createToken("TILDELOOSE", `^${src[t$3.LONETILDE]}${src[t$3.XRANGEPLAINLOOSE]}$`);
539
+ createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
540
+ createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
541
541
  createToken("LONECARET", "(?:\\^)");
542
- createToken("CARETTRIM", `(\\s*)${src[t$3.LONECARET]}\\s+`, true);
542
+ createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
543
543
  exports.caretTrimReplace = "$1^";
544
- createToken("CARET", `^${src[t$3.LONECARET]}${src[t$3.XRANGEPLAIN]}$`);
545
- createToken("CARETLOOSE", `^${src[t$3.LONECARET]}${src[t$3.XRANGEPLAINLOOSE]}$`);
546
- createToken("COMPARATORLOOSE", `^${src[t$3.GTLT]}\\s*(${src[t$3.LOOSEPLAIN]})$|^$`);
547
- createToken("COMPARATOR", `^${src[t$3.GTLT]}\\s*(${src[t$3.FULLPLAIN]})$|^$`);
548
- createToken("COMPARATORTRIM", `(\\s*)${src[t$3.GTLT]}\\s*(${src[t$3.LOOSEPLAIN]}|${src[t$3.XRANGEPLAIN]})`, true);
544
+ createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
545
+ createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
546
+ createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
547
+ createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
548
+ createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
549
549
  exports.comparatorTrimReplace = "$1$2$3";
550
- createToken("HYPHENRANGE", `^\\s*(${src[t$3.XRANGEPLAIN]})\\s+-\\s+(${src[t$3.XRANGEPLAIN]})\\s*$`);
551
- createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$3.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$3.XRANGEPLAINLOOSE]})\\s*$`);
550
+ createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
551
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
552
552
  createToken("STAR", "(<|>)?=?\\s*\\*");
553
553
  createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
554
554
  createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
@@ -576,16 +576,16 @@ var require_identifiers = require_picocolors$1.__commonJS({ "../../node_modules/
576
576
 
577
577
  //#endregion
578
578
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
579
- var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module) {
579
+ var require_semver$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module) {
580
580
  const debug$2 = require_debug();
581
581
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
582
- const { safeRe: re$2, t: t$2 } = require_re();
582
+ const { safeRe: re$3, t: t$3 } = require_re();
583
583
  const parseOptions$2 = require_parse_options();
584
584
  const { compareIdentifiers } = require_identifiers();
585
- var SemVer$4 = class SemVer$4 {
585
+ var SemVer$15 = class SemVer$15 {
586
586
  constructor(version$1, options) {
587
587
  options = parseOptions$2(options);
588
- if (version$1 instanceof SemVer$4) if (version$1.loose === !!options.loose && version$1.includePrerelease === !!options.includePrerelease) return version$1;
588
+ if (version$1 instanceof SemVer$15) if (version$1.loose === !!options.loose && version$1.includePrerelease === !!options.includePrerelease) return version$1;
589
589
  else version$1 = version$1.version;
590
590
  else if (typeof version$1 !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version$1}".`);
591
591
  if (version$1.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
@@ -593,7 +593,7 @@ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
593
593
  this.options = options;
594
594
  this.loose = !!options.loose;
595
595
  this.includePrerelease = !!options.includePrerelease;
596
- const m = version$1.trim().match(options.loose ? re$2[t$2.LOOSE] : re$2[t$2.FULL]);
596
+ const m = version$1.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
597
597
  if (!m) throw new TypeError(`Invalid Version: ${version$1}`);
598
598
  this.raw = version$1;
599
599
  this.major = +m[1];
@@ -623,19 +623,19 @@ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
623
623
  }
624
624
  compare(other) {
625
625
  debug$2("SemVer.compare", this.version, this.options, other);
626
- if (!(other instanceof SemVer$4)) {
626
+ if (!(other instanceof SemVer$15)) {
627
627
  if (typeof other === "string" && other === this.version) return 0;
628
- other = new SemVer$4(other, this.options);
628
+ other = new SemVer$15(other, this.options);
629
629
  }
630
630
  if (other.version === this.version) return 0;
631
631
  return this.compareMain(other) || this.comparePre(other);
632
632
  }
633
633
  compareMain(other) {
634
- if (!(other instanceof SemVer$4)) other = new SemVer$4(other, this.options);
634
+ if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
635
635
  return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
636
636
  }
637
637
  comparePre(other) {
638
- if (!(other instanceof SemVer$4)) other = new SemVer$4(other, this.options);
638
+ if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
639
639
  if (this.prerelease.length && !other.prerelease.length) return -1;
640
640
  else if (!this.prerelease.length && other.prerelease.length) return 1;
641
641
  else if (!this.prerelease.length && !other.prerelease.length) return 0;
@@ -652,7 +652,7 @@ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
652
652
  } while (++i$2);
653
653
  }
654
654
  compareBuild(other) {
655
- if (!(other instanceof SemVer$4)) other = new SemVer$4(other, this.options);
655
+ if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
656
656
  let i$2 = 0;
657
657
  do {
658
658
  const a$1 = this.build[i$2];
@@ -669,7 +669,7 @@ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
669
669
  if (release.startsWith("pre")) {
670
670
  if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
671
671
  if (identifier) {
672
- const match = `-${identifier}`.match(this.options.loose ? re$2[t$2.PRERELEASELOOSE] : re$2[t$2.PRERELEASE]);
672
+ const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
673
673
  if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
674
674
  }
675
675
  }
@@ -730,11 +730,11 @@ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
730
730
  }
731
731
  }
732
732
  if (identifier) {
733
- let prerelease = [identifier, base];
734
- if (identifierBase === false) prerelease = [identifier];
733
+ let prerelease$2 = [identifier, base];
734
+ if (identifierBase === false) prerelease$2 = [identifier];
735
735
  if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
736
- if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
737
- } else this.prerelease = prerelease;
736
+ if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
737
+ } else this.prerelease = prerelease$2;
738
738
  }
739
739
  break;
740
740
  }
@@ -745,75 +745,75 @@ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
745
745
  return this;
746
746
  }
747
747
  };
748
- module.exports = SemVer$4;
748
+ module.exports = SemVer$15;
749
749
  } });
750
750
 
751
751
  //#endregion
752
752
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
753
753
  var require_compare = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports, module) {
754
- const SemVer$3 = require_semver();
755
- const compare$6 = (a$1, b, loose) => new SemVer$3(a$1, loose).compare(new SemVer$3(b, loose));
756
- module.exports = compare$6;
754
+ const SemVer$14 = require_semver$1();
755
+ const compare$11 = (a$1, b, loose) => new SemVer$14(a$1, loose).compare(new SemVer$14(b, loose));
756
+ module.exports = compare$11;
757
757
  } });
758
758
 
759
759
  //#endregion
760
760
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
761
761
  var require_eq = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports, module) {
762
- const compare$5 = require_compare();
763
- const eq$1 = (a$1, b, loose) => compare$5(a$1, b, loose) === 0;
764
- module.exports = eq$1;
762
+ const compare$10 = require_compare();
763
+ const eq$2 = (a$1, b, loose) => compare$10(a$1, b, loose) === 0;
764
+ module.exports = eq$2;
765
765
  } });
766
766
 
767
767
  //#endregion
768
768
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
769
769
  var require_neq = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports, module) {
770
- const compare$4 = require_compare();
771
- const neq$1 = (a$1, b, loose) => compare$4(a$1, b, loose) !== 0;
772
- module.exports = neq$1;
770
+ const compare$9 = require_compare();
771
+ const neq$2 = (a$1, b, loose) => compare$9(a$1, b, loose) !== 0;
772
+ module.exports = neq$2;
773
773
  } });
774
774
 
775
775
  //#endregion
776
776
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
777
777
  var require_gt = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports, module) {
778
- const compare$3 = require_compare();
779
- const gt$1 = (a$1, b, loose) => compare$3(a$1, b, loose) > 0;
780
- module.exports = gt$1;
778
+ const compare$8 = require_compare();
779
+ const gt$4 = (a$1, b, loose) => compare$8(a$1, b, loose) > 0;
780
+ module.exports = gt$4;
781
781
  } });
782
782
 
783
783
  //#endregion
784
784
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
785
785
  var require_gte = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports, module) {
786
- const compare$2 = require_compare();
787
- const gte$1 = (a$1, b, loose) => compare$2(a$1, b, loose) >= 0;
788
- module.exports = gte$1;
786
+ const compare$7 = require_compare();
787
+ const gte$3 = (a$1, b, loose) => compare$7(a$1, b, loose) >= 0;
788
+ module.exports = gte$3;
789
789
  } });
790
790
 
791
791
  //#endregion
792
792
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
793
793
  var require_lt = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports, module) {
794
- const compare$1 = require_compare();
795
- const lt$1 = (a$1, b, loose) => compare$1(a$1, b, loose) < 0;
796
- module.exports = lt$1;
794
+ const compare$6 = require_compare();
795
+ const lt$3 = (a$1, b, loose) => compare$6(a$1, b, loose) < 0;
796
+ module.exports = lt$3;
797
797
  } });
798
798
 
799
799
  //#endregion
800
800
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
801
801
  var require_lte = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports, module) {
802
- const compare = require_compare();
803
- const lte$1 = (a$1, b, loose) => compare(a$1, b, loose) <= 0;
804
- module.exports = lte$1;
802
+ const compare$5 = require_compare();
803
+ const lte$3 = (a$1, b, loose) => compare$5(a$1, b, loose) <= 0;
804
+ module.exports = lte$3;
805
805
  } });
806
806
 
807
807
  //#endregion
808
808
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
809
809
  var require_cmp = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports, module) {
810
- const eq = require_eq();
811
- const neq = require_neq();
812
- const gt = require_gt();
813
- const gte = require_gte();
814
- const lt = require_lt();
815
- const lte = require_lte();
816
- const cmp$1 = (a$1, op, b, loose) => {
810
+ const eq$1 = require_eq();
811
+ const neq$1 = require_neq();
812
+ const gt$3 = require_gt();
813
+ const gte$2 = require_gte();
814
+ const lt$2 = require_lt();
815
+ const lte$2 = require_lte();
816
+ const cmp$2 = (a$1, op, b, loose) => {
817
817
  switch (op) {
818
818
  case "===":
819
819
  if (typeof a$1 === "object") a$1 = a$1.version;
@@ -825,69 +825,69 @@ var require_cmp = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/se
825
825
  return a$1 !== b;
826
826
  case "":
827
827
  case "=":
828
- case "==": return eq(a$1, b, loose);
829
- case "!=": return neq(a$1, b, loose);
830
- case ">": return gt(a$1, b, loose);
831
- case ">=": return gte(a$1, b, loose);
832
- case "<": return lt(a$1, b, loose);
833
- case "<=": return lte(a$1, b, loose);
828
+ case "==": return eq$1(a$1, b, loose);
829
+ case "!=": return neq$1(a$1, b, loose);
830
+ case ">": return gt$3(a$1, b, loose);
831
+ case ">=": return gte$2(a$1, b, loose);
832
+ case "<": return lt$2(a$1, b, loose);
833
+ case "<=": return lte$2(a$1, b, loose);
834
834
  default: throw new TypeError(`Invalid operator: ${op}`);
835
835
  }
836
836
  };
837
- module.exports = cmp$1;
837
+ module.exports = cmp$2;
838
838
  } });
839
839
 
840
840
  //#endregion
841
841
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
842
842
  var require_comparator = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports, module) {
843
- const ANY = Symbol("SemVer ANY");
844
- var Comparator$1 = class Comparator$1 {
843
+ const ANY$2 = Symbol("SemVer ANY");
844
+ var Comparator$4 = class Comparator$4 {
845
845
  static get ANY() {
846
- return ANY;
846
+ return ANY$2;
847
847
  }
848
848
  constructor(comp, options) {
849
849
  options = parseOptions$1(options);
850
- if (comp instanceof Comparator$1) if (comp.loose === !!options.loose) return comp;
850
+ if (comp instanceof Comparator$4) if (comp.loose === !!options.loose) return comp;
851
851
  else comp = comp.value;
852
852
  comp = comp.trim().split(/\s+/).join(" ");
853
853
  debug$1("comparator", comp, options);
854
854
  this.options = options;
855
855
  this.loose = !!options.loose;
856
856
  this.parse(comp);
857
- if (this.semver === ANY) this.value = "";
857
+ if (this.semver === ANY$2) this.value = "";
858
858
  else this.value = this.operator + this.semver.version;
859
859
  debug$1("comp", this);
860
860
  }
861
861
  parse(comp) {
862
- const r = this.options.loose ? re$1[t$1.COMPARATORLOOSE] : re$1[t$1.COMPARATOR];
862
+ const r = this.options.loose ? re$2[t$2.COMPARATORLOOSE] : re$2[t$2.COMPARATOR];
863
863
  const m = comp.match(r);
864
864
  if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
865
865
  this.operator = m[1] !== void 0 ? m[1] : "";
866
866
  if (this.operator === "=") this.operator = "";
867
- if (!m[2]) this.semver = ANY;
868
- else this.semver = new SemVer$2(m[2], this.options.loose);
867
+ if (!m[2]) this.semver = ANY$2;
868
+ else this.semver = new SemVer$13(m[2], this.options.loose);
869
869
  }
870
870
  toString() {
871
871
  return this.value;
872
872
  }
873
873
  test(version$1) {
874
874
  debug$1("Comparator.test", version$1, this.options.loose);
875
- if (this.semver === ANY || version$1 === ANY) return true;
875
+ if (this.semver === ANY$2 || version$1 === ANY$2) return true;
876
876
  if (typeof version$1 === "string") try {
877
- version$1 = new SemVer$2(version$1, this.options);
877
+ version$1 = new SemVer$13(version$1, this.options);
878
878
  } catch (er) {
879
879
  return false;
880
880
  }
881
- return cmp(version$1, this.operator, this.semver, this.options);
881
+ return cmp$1(version$1, this.operator, this.semver, this.options);
882
882
  }
883
883
  intersects(comp, options) {
884
- if (!(comp instanceof Comparator$1)) throw new TypeError("a Comparator is required");
884
+ if (!(comp instanceof Comparator$4)) throw new TypeError("a Comparator is required");
885
885
  if (this.operator === "") {
886
886
  if (this.value === "") return true;
887
- return new Range$2(comp.value, options).test(this.value);
887
+ return new Range$11(comp.value, options).test(this.value);
888
888
  } else if (comp.operator === "") {
889
889
  if (comp.value === "") return true;
890
- return new Range$2(this.value, options).test(comp.semver);
890
+ return new Range$11(this.value, options).test(comp.semver);
891
891
  }
892
892
  options = parseOptions$1(options);
893
893
  if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
@@ -895,30 +895,30 @@ var require_comparator = require_picocolors$1.__commonJS({ "../../node_modules/.
895
895
  if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
896
896
  if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
897
897
  if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
898
- if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
899
- if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
898
+ if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
899
+ if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
900
900
  return false;
901
901
  }
902
902
  };
903
- module.exports = Comparator$1;
903
+ module.exports = Comparator$4;
904
904
  const parseOptions$1 = require_parse_options();
905
- const { safeRe: re$1, t: t$1 } = require_re();
906
- const cmp = require_cmp();
905
+ const { safeRe: re$2, t: t$2 } = require_re();
906
+ const cmp$1 = require_cmp();
907
907
  const debug$1 = require_debug();
908
- const SemVer$2 = require_semver();
909
- const Range$2 = require_range();
908
+ const SemVer$13 = require_semver$1();
909
+ const Range$11 = require_range();
910
910
  } });
911
911
 
912
912
  //#endregion
913
913
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
914
914
  var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports, module) {
915
915
  const SPACE_CHARACTERS = /\s+/g;
916
- var Range$1 = class Range$1 {
916
+ var Range$10 = class Range$10 {
917
917
  constructor(range, options) {
918
918
  options = parseOptions(options);
919
- if (range instanceof Range$1) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
920
- else return new Range$1(range.raw, options);
921
- if (range instanceof Comparator) {
919
+ if (range instanceof Range$10) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
920
+ else return new Range$10(range.raw, options);
921
+ if (range instanceof Comparator$3) {
922
922
  this.raw = range.value;
923
923
  this.set = [[range]];
924
924
  this.formatted = void 0;
@@ -969,23 +969,23 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
969
969
  const cached = cache$1.get(memoKey);
970
970
  if (cached) return cached;
971
971
  const loose = this.options.loose;
972
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
972
+ const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
973
973
  range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
974
974
  debug("hyphen replace", range);
975
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
975
+ range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
976
976
  debug("comparator trim", range);
977
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
977
+ range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
978
978
  debug("tilde trim", range);
979
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
979
+ range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
980
980
  debug("caret trim", range);
981
981
  let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
982
982
  if (loose) rangeList = rangeList.filter((comp) => {
983
983
  debug("loose invalid filter", comp, this.options);
984
- return !!comp.match(re[t.COMPARATORLOOSE]);
984
+ return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
985
985
  });
986
986
  debug("range list", rangeList);
987
987
  const rangeMap = /* @__PURE__ */ new Map();
988
- const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
988
+ const comparators = rangeList.map((comp) => new Comparator$3(comp, this.options));
989
989
  for (const comp of comparators) {
990
990
  if (isNullSet(comp)) return [comp];
991
991
  rangeMap.set(comp.value, comp);
@@ -996,7 +996,7 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
996
996
  return result;
997
997
  }
998
998
  intersects(range, options) {
999
- if (!(range instanceof Range$1)) throw new TypeError("a Range is required");
999
+ if (!(range instanceof Range$10)) throw new TypeError("a Range is required");
1000
1000
  return this.set.some((thisComparators) => {
1001
1001
  return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
1002
1002
  return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
@@ -1010,7 +1010,7 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1010
1010
  test(version$1) {
1011
1011
  if (!version$1) return false;
1012
1012
  if (typeof version$1 === "string") try {
1013
- version$1 = new SemVer$1(version$1, this.options);
1013
+ version$1 = new SemVer$12(version$1, this.options);
1014
1014
  } catch (er) {
1015
1015
  return false;
1016
1016
  }
@@ -1018,14 +1018,14 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1018
1018
  return false;
1019
1019
  }
1020
1020
  };
1021
- module.exports = Range$1;
1021
+ module.exports = Range$10;
1022
1022
  const LRU = require_lrucache();
1023
1023
  const cache$1 = new LRU();
1024
1024
  const parseOptions = require_parse_options();
1025
- const Comparator = require_comparator();
1025
+ const Comparator$3 = require_comparator();
1026
1026
  const debug = require_debug();
1027
- const SemVer$1 = require_semver();
1028
- const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
1027
+ const SemVer$12 = require_semver$1();
1028
+ const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
1029
1029
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1030
1030
  const isNullSet = (c$1) => c$1.value === "<0.0.0-0";
1031
1031
  const isAny = (c$1) => c$1.value === "";
@@ -1058,7 +1058,7 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1058
1058
  return comp.trim().split(/\s+/).map((c$1) => replaceTilde(c$1, options)).join(" ");
1059
1059
  };
1060
1060
  const replaceTilde = (comp, options) => {
1061
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1061
+ const r = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
1062
1062
  return comp.replace(r, (_, M, m, p, pr) => {
1063
1063
  debug("tilde", comp, _, M, m, p, pr);
1064
1064
  let ret;
@@ -1078,7 +1078,7 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1078
1078
  };
1079
1079
  const replaceCaret = (comp, options) => {
1080
1080
  debug("caret", comp, options);
1081
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1081
+ const r = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
1082
1082
  const z = options.includePrerelease ? "-0" : "";
1083
1083
  return comp.replace(r, (_, M, m, p, pr) => {
1084
1084
  debug("caret", comp, _, M, m, p, pr);
@@ -1108,7 +1108,7 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1108
1108
  };
1109
1109
  const replaceXRange = (comp, options) => {
1110
1110
  comp = comp.trim();
1111
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1111
+ const r = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
1112
1112
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1113
1113
  debug("xRange", comp, ret, gtlt, M, m, p, pr);
1114
1114
  const xM = isX(M);
@@ -1147,11 +1147,11 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1147
1147
  };
1148
1148
  const replaceStars = (comp, options) => {
1149
1149
  debug("replaceStars", comp, options);
1150
- return comp.trim().replace(re[t.STAR], "");
1150
+ return comp.trim().replace(re$1[t$1.STAR], "");
1151
1151
  };
1152
1152
  const replaceGTE0 = (comp, options) => {
1153
1153
  debug("replaceGTE0", comp, options);
1154
- return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1154
+ return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
1155
1155
  };
1156
1156
  const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1157
1157
  if (isX(fM)) from = "";
@@ -1172,7 +1172,7 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1172
1172
  if (version$1.prerelease.length && !options.includePrerelease) {
1173
1173
  for (let i$2 = 0; i$2 < set.length; i$2++) {
1174
1174
  debug(set[i$2].semver);
1175
- if (set[i$2].semver === Comparator.ANY) continue;
1175
+ if (set[i$2].semver === Comparator$3.ANY) continue;
1176
1176
  if (set[i$2].semver.prerelease.length > 0) {
1177
1177
  const allowed = set[i$2].semver;
1178
1178
  if (allowed.major === version$1.major && allowed.minor === version$1.minor && allowed.patch === version$1.patch) return true;
@@ -1187,15 +1187,15 @@ var require_range = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
1187
1187
  //#endregion
1188
1188
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
1189
1189
  var require_valid$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js"(exports, module) {
1190
- const Range = require_range();
1191
- const validRange = (range, options) => {
1190
+ const Range$9 = require_range();
1191
+ const validRange$1 = (range, options) => {
1192
1192
  try {
1193
- return new Range(range, options).range || "*";
1193
+ return new Range$9(range, options).range || "*";
1194
1194
  } catch (er) {
1195
1195
  return null;
1196
1196
  }
1197
1197
  };
1198
- module.exports = validRange;
1198
+ module.exports = validRange$1;
1199
1199
  } });
1200
1200
 
1201
1201
  //#endregion
@@ -1618,38 +1618,60 @@ async function isPortReachable(port, { host, timeout = 1e3 } = {}) {
1618
1618
  }
1619
1619
 
1620
1620
  //#endregion
1621
- //#region ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
1622
- const toPath$2 = (urlOrPath) => urlOrPath instanceof URL ? (0, node_url.fileURLToPath)(urlOrPath) : urlOrPath;
1623
- async function findUp(name, { cwd = node_process.default.cwd(), type: type$1 = "file", stopAt } = {}) {
1624
- let directory = node_path.default.resolve(toPath$2(cwd) ?? "");
1625
- const { root } = node_path.default.parse(directory);
1626
- stopAt = node_path.default.resolve(directory, toPath$2(stopAt ?? root));
1627
- const isAbsoluteName = node_path.default.isAbsolute(name);
1628
- while (directory) {
1629
- const filePath = isAbsoluteName ? name : node_path.default.join(directory, name);
1630
- try {
1631
- const stats = await node_fs_promises.default.stat(filePath);
1632
- if (type$1 === "file" && stats.isFile() || type$1 === "directory" && stats.isDirectory()) return filePath;
1633
- } catch {}
1634
- if (directory === stopAt || directory === root) break;
1635
- directory = node_path.default.dirname(directory);
1621
+ //#region src/utils/getFileHash.ts
1622
+ const getFileHashFromFile = async (filepath) => {
1623
+ try {
1624
+ const fileBuffer = await fs_promises.default.readFile(filepath).catch((error) => {
1625
+ console.error("Error reading the file:", error);
1626
+ throw error;
1627
+ });
1628
+ const hash = crypto.default.createHash("sha256");
1629
+ hash.update(fileBuffer);
1630
+ const fileHash = hash.digest("hex");
1631
+ return fileHash;
1632
+ } catch (error) {
1633
+ console.error("Error fetching or processing the file:", error);
1634
+ throw error;
1636
1635
  }
1637
- }
1638
- function findUpSync(name, { cwd = node_process.default.cwd(), type: type$1 = "file", stopAt } = {}) {
1639
- let directory = node_path.default.resolve(toPath$2(cwd) ?? "");
1640
- const { root } = node_path.default.parse(directory);
1641
- stopAt = node_path.default.resolve(directory, toPath$2(stopAt) ?? root);
1642
- const isAbsoluteName = node_path.default.isAbsolute(name);
1643
- while (directory) {
1644
- const filePath = isAbsoluteName ? name : node_path.default.join(directory, name);
1645
- try {
1646
- const stats = node_fs.default.statSync(filePath, { throwIfNoEntry: false });
1647
- if (type$1 === "file" && stats?.isFile() || type$1 === "directory" && stats?.isDirectory()) return filePath;
1648
- } catch {}
1649
- if (directory === stopAt || directory === root) break;
1650
- directory = node_path.default.dirname(directory);
1636
+ };
1637
+
1638
+ //#endregion
1639
+ //#region src/utils/git.ts
1640
+ const getLatestGitCommit = async () => {
1641
+ try {
1642
+ const repo = await (0, es_git.openRepository)((0, __hot_updater_plugin_core.getCwd)());
1643
+ const headSha = repo.revparse("HEAD").from;
1644
+ if (headSha) return repo.getCommit(headSha);
1645
+ return null;
1646
+ } catch (error) {
1647
+ return null;
1651
1648
  }
1652
- }
1649
+ };
1650
+
1651
+ //#endregion
1652
+ //#region src/utils/version/getAndroidVersion.ts
1653
+ var import_valid$4 = require_picocolors$1.__toESM(require_valid$1());
1654
+ const getAndroidVersionFromAppBuildGradle = async () => {
1655
+ const buildGradlePath = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "android", "app", "build.gradle");
1656
+ try {
1657
+ const buildGradleContent = await fs_promises.default.readFile(buildGradlePath, "utf8");
1658
+ const versionNameMatch = buildGradleContent.match(/versionName\s+['"]([^"]+)['"]/);
1659
+ return versionNameMatch?.[1] ?? null;
1660
+ } catch (error) {
1661
+ return null;
1662
+ }
1663
+ };
1664
+ const AndroidVersionParsers = { "app-build-gradle": getAndroidVersionFromAppBuildGradle };
1665
+ const getAndroidVersion = async ({ parser, validateWithSemver = false }) => {
1666
+ const parsers = Array.isArray(parser) ? parser : [parser];
1667
+ for (const parserKey of parsers) {
1668
+ const parsedVersion = await AndroidVersionParsers[parserKey]();
1669
+ if (!parsedVersion) continue;
1670
+ if (validateWithSemver && !(0, import_valid$4.default)(parsedVersion)) continue;
1671
+ return parsedVersion;
1672
+ }
1673
+ return null;
1674
+ };
1653
1675
 
1654
1676
  //#endregion
1655
1677
  //#region ../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js
@@ -1819,11 +1841,11 @@ var require_dom = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/@x
1819
1841
  function _extends(Class, Super) {
1820
1842
  var pt = Class.prototype;
1821
1843
  if (!(pt instanceof Super)) {
1822
- function t$4() {}
1823
- t$4.prototype = Super.prototype;
1824
- t$4 = new t$4();
1825
- copy(pt, t$4);
1826
- Class.prototype = pt = t$4;
1844
+ function t$5() {}
1845
+ t$5.prototype = Super.prototype;
1846
+ t$5 = new t$5();
1847
+ copy(pt, t$5);
1848
+ Class.prototype = pt = t$5;
1827
1849
  }
1828
1850
  if (pt.constructor != Class) {
1829
1851
  if (typeof Class != "function") console.error("unknown Class:" + Class);
@@ -1908,15 +1930,15 @@ var require_dom = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/@x
1908
1930
  _updateLiveList(this);
1909
1931
  }
1910
1932
  function _updateLiveList(list) {
1911
- var inc = list._node._inc || list._node.ownerDocument._inc;
1912
- if (list._inc !== inc) {
1933
+ var inc$2 = list._node._inc || list._node.ownerDocument._inc;
1934
+ if (list._inc !== inc$2) {
1913
1935
  var ls = list._refresh(list._node);
1914
1936
  __set__(list, "length", ls.length);
1915
1937
  if (!list.$$length || ls.length < list.$$length) {
1916
1938
  for (var i$2 = ls.length; i$2 in list; i$2++) if (Object.prototype.hasOwnProperty.call(list, i$2)) delete list[i$2];
1917
1939
  }
1918
1940
  copy(ls, list);
1919
- list._inc = inc;
1941
+ list._inc = inc$2;
1920
1942
  }
1921
1943
  }
1922
1944
  LiveNodeList.prototype.item = function(i$2) {
@@ -5232,10 +5254,10 @@ var require_sax = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/@x
5232
5254
  var domBuilder = this.domBuilder;
5233
5255
  domBuilder.startDocument();
5234
5256
  _copy(defaultNSMap, defaultNSMap = {});
5235
- parse$9(source, defaultNSMap, entityMap, domBuilder, this.errorHandler);
5257
+ parse$13(source, defaultNSMap, entityMap, domBuilder, this.errorHandler);
5236
5258
  domBuilder.endDocument();
5237
5259
  } };
5238
- function parse$9(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
5260
+ function parse$13(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
5239
5261
  function fixedFromCharCode(code$1) {
5240
5262
  if (code$1 > 65535) {
5241
5263
  code$1 -= 65536;
@@ -5355,10 +5377,10 @@ var require_sax = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/@x
5355
5377
  else appendText(Math.max(tagStart, start) + 1);
5356
5378
  }
5357
5379
  }
5358
- function copyLocator(f, t$4) {
5359
- t$4.lineNumber = f.lineNumber;
5360
- t$4.columnNumber = f.columnNumber;
5361
- return t$4;
5380
+ function copyLocator(f, t$5) {
5381
+ t$5.lineNumber = f.lineNumber;
5382
+ t$5.columnNumber = f.columnNumber;
5383
+ return t$5;
5362
5384
  }
5363
5385
  /**
5364
5386
  * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
@@ -5943,7 +5965,7 @@ var require_parse$3 = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
5943
5965
  /**
5944
5966
  * Module exports.
5945
5967
  */
5946
- exports.parse = parse$8;
5968
+ exports.parse = parse$12;
5947
5969
  var TEXT_NODE = 3;
5948
5970
  var CDATA_NODE = 4;
5949
5971
  var COMMENT_NODE = 8;
@@ -5982,12 +6004,12 @@ var require_parse$3 = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
5982
6004
  * @returns {Mixed} the decoded value from the Plist XML
5983
6005
  * @api public
5984
6006
  */
5985
- function parse$8(xml) {
6007
+ function parse$12(xml) {
5986
6008
  var doc = new DOMParser().parseFromString(xml);
5987
6009
  invariant(doc.documentElement.nodeName === "plist", "malformed document. First element should be <plist>");
5988
- var plist$3 = parsePlistXML(doc.documentElement);
5989
- if (plist$3.length == 1) plist$3 = plist$3[0];
5990
- return plist$3;
6010
+ var plist$2 = parsePlistXML(doc.documentElement);
6011
+ if (plist$2.length == 1) plist$2 = plist$2[0];
6012
+ return plist$2;
5991
6013
  }
5992
6014
  /**
5993
6015
  * Convert an XML based plist document into a JSON representation.
@@ -9241,79 +9263,97 @@ var require_plist = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
9241
9263
  } });
9242
9264
 
9243
9265
  //#endregion
9244
- //#region src/utils/getDefaultTargetAppVersion.ts
9245
- var import_plist$2 = require_picocolors$1.__toESM(require_plist());
9246
- const getIOSVersion$1 = async (cwd) => {
9266
+ //#region src/utils/getIosAppTargetDirectoryName.ts
9267
+ const getIosAppTargetDirectoryName = () => {
9268
+ const iosDirectory = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "ios");
9269
+ const [xcodeprojPath] = (0, globby.globbySync)("*.xcodeproj/project.pbxproj", {
9270
+ cwd: iosDirectory,
9271
+ absolute: false,
9272
+ onlyFiles: true
9273
+ });
9274
+ return xcodeprojPath?.split(".")?.[0] ?? null;
9275
+ };
9276
+
9277
+ //#endregion
9278
+ //#region src/utils/version/getIOSVersion.ts
9279
+ var import_plist$1 = require_picocolors$1.__toESM(require_plist());
9280
+ var import_valid$3 = require_picocolors$1.__toESM(require_valid$1());
9281
+ const isFileExist = async (path$21) => {
9247
9282
  try {
9248
- const plistPath = await findUp("Info.plist", {
9249
- cwd,
9250
- type: "file"
9251
- });
9252
- if (!plistPath) return null;
9283
+ await fs_promises.default.access(path$21);
9284
+ return true;
9285
+ } catch {
9286
+ return false;
9287
+ }
9288
+ };
9289
+ const getIOSVersionFromInfoPlist = async () => {
9290
+ try {
9291
+ const iosAppTargetDirectory = getIosAppTargetDirectoryName();
9292
+ if (!iosAppTargetDirectory) return null;
9293
+ const plistPath = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "ios", iosAppTargetDirectory, "Info.plist");
9294
+ if (!await isFileExist(plistPath)) return null;
9253
9295
  const file = await fs_promises.default.readFile(plistPath, "utf8");
9254
- const data = import_plist$2.default.parse(file);
9296
+ const data = import_plist$1.default.parse(file);
9255
9297
  return data["CFBundleShortVersionString"] ?? null;
9256
9298
  } catch {
9257
9299
  return null;
9258
9300
  }
9259
9301
  };
9260
- const getAndroidVersion$1 = async (cwd) => {
9261
- const buildGradlePath = path.default.join(cwd, "android", "app", "build.gradle");
9302
+ const getIOSVersionFromXcodeProject = async () => {
9262
9303
  try {
9263
- const buildGradleContent = await fs_promises.default.readFile(buildGradlePath, "utf8");
9264
- const versionNameMatch = buildGradleContent.match(/versionName\s+"([\d.]+)"/);
9265
- return versionNameMatch?.[1] ? versionNameMatch[1] : null;
9266
- } catch (error) {
9304
+ const [xcodeprojPath] = (0, globby.globbySync)("*.xcodeproj/project.pbxproj", {
9305
+ cwd: path.default.join((0, __hot_updater_plugin_core.getCwd)(), "ios"),
9306
+ absolute: true,
9307
+ onlyFiles: true
9308
+ });
9309
+ if (!xcodeprojPath) return null;
9310
+ const project = __bacons_xcode.XcodeProject.open(xcodeprojPath).toJSON();
9311
+ const objects = project.objects ?? {};
9312
+ for (const key of Object.keys(objects)) {
9313
+ const obj = objects[key];
9314
+ if (obj?.isa === "XCBuildConfiguration" && obj?.name === "Release" && typeof obj.buildSettings?.MARKETING_VERSION === "string") return obj.buildSettings.MARKETING_VERSION;
9315
+ }
9316
+ return null;
9317
+ } catch {
9267
9318
  return null;
9268
9319
  }
9269
9320
  };
9270
- const getDefaultTargetAppVersion = async (cwd, platform$2) => {
9321
+ const IOSVersionParsers = {
9322
+ xcodeproj: getIOSVersionFromXcodeProject,
9323
+ "info-plist": getIOSVersionFromInfoPlist
9324
+ };
9325
+ const getIOSVersion = async ({ parser, validateWithSemver = false }) => {
9326
+ const parsers = Array.isArray(parser) ? parser : [parser];
9327
+ for (const parserKey of parsers) {
9328
+ const parsedVersion = await IOSVersionParsers[parserKey]();
9329
+ if (!parsedVersion) continue;
9330
+ if (validateWithSemver && !(0, import_valid$3.default)(parsedVersion)) continue;
9331
+ return parsedVersion;
9332
+ }
9333
+ return null;
9334
+ };
9335
+
9336
+ //#endregion
9337
+ //#region src/utils/version/getDefaultTargetAppVersion.ts
9338
+ var import_valid$2 = require_picocolors$1.__toESM(require_valid$1());
9339
+ const getDefaultTargetAppVersion = async (platform$2) => {
9271
9340
  let version$1 = null;
9272
9341
  switch (platform$2) {
9273
9342
  case "ios":
9274
- version$1 = await getIOSVersion$1(cwd);
9343
+ version$1 = await getIOSVersion({ parser: "info-plist" });
9275
9344
  break;
9276
9345
  case "android":
9277
- version$1 = await getAndroidVersion$1(cwd);
9346
+ version$1 = await getAndroidVersion({ parser: "app-build-gradle" });
9278
9347
  break;
9279
9348
  }
9280
9349
  if (!version$1) return null;
9350
+ const isAcceptableFormat = /^\d+\.\d+$/.test(version$1) || (0, import_valid$2.default)(version$1);
9351
+ if (!isAcceptableFormat) return null;
9281
9352
  const dotCount = version$1.split(".").length - 1;
9282
9353
  if (dotCount === 1) version$1 = `${version$1}.x`;
9283
9354
  return version$1;
9284
9355
  };
9285
9356
 
9286
- //#endregion
9287
- //#region src/utils/getFileHash.ts
9288
- const getFileHashFromFile = async (filepath) => {
9289
- try {
9290
- const fileBuffer = await fs_promises.default.readFile(filepath).catch((error) => {
9291
- console.error("Error reading the file:", error);
9292
- throw error;
9293
- });
9294
- const hash = crypto.default.createHash("sha256");
9295
- hash.update(fileBuffer);
9296
- const fileHash = hash.digest("hex");
9297
- return fileHash;
9298
- } catch (error) {
9299
- console.error("Error fetching or processing the file:", error);
9300
- throw error;
9301
- }
9302
- };
9303
-
9304
- //#endregion
9305
- //#region src/utils/git.ts
9306
- const getLatestGitCommit = async () => {
9307
- try {
9308
- const repo = await (0, es_git.openRepository)((0, __hot_updater_plugin_core.getCwd)());
9309
- const headSha = repo.revparse("HEAD").from;
9310
- if (headSha) return repo.getCommit(headSha);
9311
- return null;
9312
- } catch (error) {
9313
- return null;
9314
- }
9315
- };
9316
-
9317
9357
  //#endregion
9318
9358
  //#region src/prompts/getPlatform.ts
9319
9359
  const getPlatform = async (message) => {
@@ -9370,64 +9410,38 @@ async function getBundleZipTargets(basePath, files) {
9370
9410
  }
9371
9411
 
9372
9412
  //#endregion
9373
- //#region src/utils/getNativeAppVersion.ts
9374
- var import_plist$1 = require_picocolors$1.__toESM(require_plist());
9375
- const getNativeAppVersion = async (platform$2) => {
9376
- switch (platform$2) {
9377
- case "ios": {
9378
- const iosVersion = await getIOSVersion();
9379
- if (iosVersion) return iosVersion;
9380
- const plistVersion = await getPlistVersion();
9381
- if (plistVersion) return plistVersion;
9382
- return null;
9383
- }
9384
- case "android": return getAndroidVersion();
9385
- default: return null;
9386
- }
9387
- };
9388
- const getIOSVersion = async () => {
9389
- try {
9390
- const [xcodeprojPath] = (0, globby.globbySync)("*.xcodeproj/project.pbxproj", {
9391
- cwd: path.default.join((0, __hot_updater_plugin_core.getCwd)(), "ios"),
9392
- absolute: true,
9393
- onlyFiles: true
9394
- });
9395
- if (!xcodeprojPath) return null;
9396
- const project = __bacons_xcode.XcodeProject.open(xcodeprojPath).toJSON();
9397
- const objects = project.objects ?? {};
9398
- for (const key of Object.keys(objects)) {
9399
- const obj = objects[key];
9400
- if (obj?.isa === "XCBuildConfiguration" && obj?.name === "Release" && typeof obj.buildSettings?.MARKETING_VERSION === "string") return obj.buildSettings.MARKETING_VERSION;
9401
- }
9402
- return null;
9403
- } catch {
9404
- return null;
9405
- }
9406
- };
9407
- const getPlistVersion = async () => {
9408
- try {
9409
- const plistPath = await findUp("Info.plist", {
9410
- cwd: path.default.join((0, __hot_updater_plugin_core.getCwd)(), "ios"),
9411
- type: "file"
9412
- });
9413
- if (!plistPath) return null;
9414
- const file = await fs_promises.default.readFile(plistPath, "utf8");
9415
- const data = import_plist$1.default.parse(file);
9416
- return data["CFBundleShortVersionString"] ?? null;
9417
- } catch {
9418
- return null;
9413
+ //#region ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
9414
+ const toPath$2 = (urlOrPath) => urlOrPath instanceof URL ? (0, node_url.fileURLToPath)(urlOrPath) : urlOrPath;
9415
+ async function findUp(name, { cwd = node_process.default.cwd(), type: type$1 = "file", stopAt } = {}) {
9416
+ let directory = node_path.default.resolve(toPath$2(cwd) ?? "");
9417
+ const { root } = node_path.default.parse(directory);
9418
+ stopAt = node_path.default.resolve(directory, toPath$2(stopAt ?? root));
9419
+ const isAbsoluteName = node_path.default.isAbsolute(name);
9420
+ while (directory) {
9421
+ const filePath = isAbsoluteName ? name : node_path.default.join(directory, name);
9422
+ try {
9423
+ const stats = await node_fs_promises.default.stat(filePath);
9424
+ if (type$1 === "file" && stats.isFile() || type$1 === "directory" && stats.isDirectory()) return filePath;
9425
+ } catch {}
9426
+ if (directory === stopAt || directory === root) break;
9427
+ directory = node_path.default.dirname(directory);
9419
9428
  }
9420
- };
9421
- const getAndroidVersion = async () => {
9422
- const buildGradlePath = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "android", "app", "build.gradle");
9423
- try {
9424
- const buildGradleContent = await fs_promises.default.readFile(buildGradlePath, "utf8");
9425
- const versionNameMatch = buildGradleContent.match(/versionName\s+"([^"]+)"/);
9426
- return versionNameMatch?.[1] ?? null;
9427
- } catch (error) {
9428
- return null;
9429
+ }
9430
+ function findUpSync(name, { cwd = node_process.default.cwd(), type: type$1 = "file", stopAt } = {}) {
9431
+ let directory = node_path.default.resolve(toPath$2(cwd) ?? "");
9432
+ const { root } = node_path.default.parse(directory);
9433
+ stopAt = node_path.default.resolve(directory, toPath$2(stopAt) ?? root);
9434
+ const isAbsoluteName = node_path.default.isAbsolute(name);
9435
+ while (directory) {
9436
+ const filePath = isAbsoluteName ? name : node_path.default.join(directory, name);
9437
+ try {
9438
+ const stats = node_fs.default.statSync(filePath, { throwIfNoEntry: false });
9439
+ if (type$1 === "file" && stats?.isFile() || type$1 === "directory" && stats?.isDirectory()) return filePath;
9440
+ } catch {}
9441
+ if (directory === stopAt || directory === root) break;
9442
+ directory = node_path.default.dirname(directory);
9429
9443
  }
9430
- };
9444
+ }
9431
9445
 
9432
9446
  //#endregion
9433
9447
  //#region ../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js
@@ -10569,11 +10583,11 @@ var require_lib$2 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
10569
10583
  //#region ../../node_modules/.pnpm/@babel+code-frame@7.26.2/node_modules/@babel/code-frame/lib/index.js
10570
10584
  var require_lib$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.26.2/node_modules/@babel/code-frame/lib/index.js"(exports) {
10571
10585
  Object.defineProperty(exports, "__esModule", { value: true });
10572
- var picocolors$1 = require_picocolors$1.require_picocolors();
10586
+ var picocolors$3 = require_picocolors$1.require_picocolors();
10573
10587
  var jsTokens = require_js_tokens();
10574
10588
  var helperValidatorIdentifier = require_lib$2();
10575
10589
  function isColorSupported() {
10576
- return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$1.isColorSupported;
10590
+ return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$3.isColorSupported;
10577
10591
  }
10578
10592
  const compose = (f, g) => (v) => f(g(v));
10579
10593
  function buildDefs(colors) {
@@ -10593,8 +10607,8 @@ var require_lib$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
10593
10607
  reset: colors.reset
10594
10608
  };
10595
10609
  }
10596
- const defsOn = buildDefs(picocolors$1.createColors(true));
10597
- const defsOff = buildDefs(picocolors$1.createColors(false));
10610
+ const defsOn = buildDefs(picocolors$3.createColors(true));
10611
+ const defsOff = buildDefs(picocolors$3.createColors(false));
10598
10612
  function getDefs(enabled) {
10599
10613
  return enabled ? defsOn : defsOff;
10600
10614
  }
@@ -10836,39 +10850,39 @@ function parseJson(string, reviver, fileName) {
10836
10850
  //#endregion
10837
10851
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
10838
10852
  var require_parse$2 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js"(exports, module) {
10839
- const SemVer = require_semver();
10840
- const parse$7 = (version$1, options, throwErrors = false) => {
10841
- if (version$1 instanceof SemVer) return version$1;
10853
+ const SemVer$11 = require_semver$1();
10854
+ const parse$11 = (version$1, options, throwErrors = false) => {
10855
+ if (version$1 instanceof SemVer$11) return version$1;
10842
10856
  try {
10843
- return new SemVer(version$1, options);
10857
+ return new SemVer$11(version$1, options);
10844
10858
  } catch (er) {
10845
10859
  if (!throwErrors) return null;
10846
10860
  throw er;
10847
10861
  }
10848
10862
  };
10849
- module.exports = parse$7;
10863
+ module.exports = parse$11;
10850
10864
  } });
10851
10865
 
10852
10866
  //#endregion
10853
10867
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js
10854
10868
  var require_valid = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js"(exports, module) {
10855
- const parse$6 = require_parse$2();
10856
- const valid$1 = (version$1, options) => {
10857
- const v = parse$6(version$1, options);
10869
+ const parse$10 = require_parse$2();
10870
+ const valid$2 = (version$1, options) => {
10871
+ const v = parse$10(version$1, options);
10858
10872
  return v ? v.version : null;
10859
10873
  };
10860
- module.exports = valid$1;
10874
+ module.exports = valid$2;
10861
10875
  } });
10862
10876
 
10863
10877
  //#endregion
10864
10878
  //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
10865
10879
  var require_clean = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js"(exports, module) {
10866
- const parse$5 = require_parse$2();
10867
- const clean = (version$1, options) => {
10868
- const s = parse$5(version$1.trim().replace(/^[=v]+/, ""), options);
10880
+ const parse$9 = require_parse$2();
10881
+ const clean$1 = (version$1, options) => {
10882
+ const s = parse$9(version$1.trim().replace(/^[=v]+/, ""), options);
10869
10883
  return s ? s.version : null;
10870
10884
  };
10871
- module.exports = clean;
10885
+ module.exports = clean$1;
10872
10886
  } });
10873
10887
 
10874
10888
  //#endregion
@@ -11728,18 +11742,18 @@ var require_parse$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
11728
11742
  index$1++;
11729
11743
  }
11730
11744
  function parseOperator(operator) {
11731
- var t$4 = token();
11732
- if (t$4 && t$4.type === "OPERATOR" && operator === t$4.string) {
11745
+ var t$5 = token();
11746
+ if (t$5 && t$5.type === "OPERATOR" && operator === t$5.string) {
11733
11747
  next();
11734
- return t$4.string;
11748
+ return t$5.string;
11735
11749
  }
11736
11750
  }
11737
11751
  function parseWith() {
11738
11752
  if (parseOperator("WITH")) {
11739
- var t$4 = token();
11740
- if (t$4 && t$4.type === "EXCEPTION") {
11753
+ var t$5 = token();
11754
+ if (t$5 && t$5.type === "EXCEPTION") {
11741
11755
  next();
11742
- return t$4.string;
11756
+ return t$5.string;
11743
11757
  }
11744
11758
  throw new Error("Expected exception after `WITH`");
11745
11759
  }
@@ -11747,25 +11761,25 @@ var require_parse$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
11747
11761
  function parseLicenseRef() {
11748
11762
  var begin = index$1;
11749
11763
  var string = "";
11750
- var t$4 = token();
11751
- if (t$4.type === "DOCUMENTREF") {
11764
+ var t$5 = token();
11765
+ if (t$5.type === "DOCUMENTREF") {
11752
11766
  next();
11753
- string += "DocumentRef-" + t$4.string + ":";
11767
+ string += "DocumentRef-" + t$5.string + ":";
11754
11768
  if (!parseOperator(":")) throw new Error("Expected `:` after `DocumentRef-...`");
11755
11769
  }
11756
- t$4 = token();
11757
- if (t$4.type === "LICENSEREF") {
11770
+ t$5 = token();
11771
+ if (t$5.type === "LICENSEREF") {
11758
11772
  next();
11759
- string += "LicenseRef-" + t$4.string;
11773
+ string += "LicenseRef-" + t$5.string;
11760
11774
  return { license: string };
11761
11775
  }
11762
11776
  index$1 = begin;
11763
11777
  }
11764
11778
  function parseLicense() {
11765
- var t$4 = token();
11766
- if (t$4 && t$4.type === "LICENSE") {
11779
+ var t$5 = token();
11780
+ if (t$5 && t$5.type === "LICENSE") {
11767
11781
  next();
11768
- var node$1 = { license: t$4.string };
11782
+ var node$1 = { license: t$5.string };
11769
11783
  if (parseOperator("+")) node$1.plus = true;
11770
11784
  var exception = parseWith();
11771
11785
  if (exception) node$1.exception = exception;
@@ -11808,20 +11822,20 @@ var require_parse$1 = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
11808
11822
  //#region ../../node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/index.js
11809
11823
  var require_spdx_expression_parse = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/index.js"(exports, module) {
11810
11824
  var scan = require_scan();
11811
- var parse$4 = require_parse$1();
11825
+ var parse$8 = require_parse$1();
11812
11826
  module.exports = function(source) {
11813
- return parse$4(scan(source));
11827
+ return parse$8(scan(source));
11814
11828
  };
11815
11829
  } });
11816
11830
 
11817
11831
  //#endregion
11818
11832
  //#region ../../node_modules/.pnpm/spdx-correct@3.2.0/node_modules/spdx-correct/index.js
11819
11833
  var require_spdx_correct = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/spdx-correct@3.2.0/node_modules/spdx-correct/index.js"(exports, module) {
11820
- var parse$3 = require_spdx_expression_parse();
11834
+ var parse$7 = require_spdx_expression_parse();
11821
11835
  var spdxLicenseIds = require_spdx_license_ids();
11822
- function valid(string) {
11836
+ function valid$1(string) {
11823
11837
  try {
11824
- parse$3(string);
11838
+ parse$7(string);
11825
11839
  return true;
11826
11840
  } catch (error) {
11827
11841
  return false;
@@ -12008,7 +12022,7 @@ var require_spdx_correct = require_picocolors$1.__commonJS({ "../../node_modules
12008
12022
  var validTransformation = function(identifier) {
12009
12023
  for (var i$2 = 0; i$2 < transforms.length; i$2++) {
12010
12024
  var transformed = transforms[i$2](identifier).trim();
12011
- if (transformed !== identifier && valid(transformed)) return transformed;
12025
+ if (transformed !== identifier && valid$1(transformed)) return transformed;
12012
12026
  }
12013
12027
  return null;
12014
12028
  };
@@ -12041,13 +12055,13 @@ var require_spdx_correct = require_picocolors$1.__commonJS({ "../../node_modules
12041
12055
  var validArugment = typeof identifier === "string" && identifier.trim().length !== 0;
12042
12056
  if (!validArugment) throw Error("Invalid argument. Expected non-empty string.");
12043
12057
  identifier = identifier.trim();
12044
- if (valid(identifier)) return postprocess(identifier);
12058
+ if (valid$1(identifier)) return postprocess(identifier);
12045
12059
  var noPlus = identifier.replace(/\+$/, "").trim();
12046
- if (valid(noPlus)) return postprocess(noPlus);
12060
+ if (valid$1(noPlus)) return postprocess(noPlus);
12047
12061
  var transformed = validTransformation(identifier);
12048
12062
  if (transformed !== null) return postprocess(transformed);
12049
12063
  transformed = anyCorrection(identifier, function(argument) {
12050
- if (valid(argument)) return argument;
12064
+ if (valid$1(argument)) return argument;
12051
12065
  return validTransformation(argument);
12052
12066
  });
12053
12067
  if (transformed !== null) return postprocess(transformed);
@@ -12089,7 +12103,7 @@ var require_spdx_correct = require_picocolors$1.__commonJS({ "../../node_modules
12089
12103
  //#endregion
12090
12104
  //#region ../../node_modules/.pnpm/validate-npm-package-license@3.0.4/node_modules/validate-npm-package-license/index.js
12091
12105
  var require_validate_npm_package_license = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/validate-npm-package-license@3.0.4/node_modules/validate-npm-package-license/index.js"(exports, module) {
12092
- var parse$2 = require_spdx_expression_parse();
12106
+ var parse$6 = require_spdx_expression_parse();
12093
12107
  var correct = require_spdx_correct();
12094
12108
  var genericWarning = "license should be a valid SPDX license expression (without \"LicenseRef\"), \"UNLICENSED\", or \"SEE LICENSE IN <filename>\"";
12095
12109
  var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
@@ -12105,7 +12119,7 @@ var require_validate_npm_package_license = require_picocolors$1.__commonJS({ "..
12105
12119
  module.exports = function(argument) {
12106
12120
  var ast;
12107
12121
  try {
12108
- ast = parse$2(argument);
12122
+ ast = parse$6(argument);
12109
12123
  } catch (e) {
12110
12124
  var match;
12111
12125
  if (argument === "UNLICENSED" || argument === "UNLICENCED") return {
@@ -12486,11 +12500,11 @@ var require_commonjs = require_picocolors$1.__commonJS({ "../../node_modules/.pn
12486
12500
  starts[index$1] = ttl !== 0 ? start : 0;
12487
12501
  ttls[index$1] = ttl;
12488
12502
  if (ttl !== 0 && this.ttlAutopurge) {
12489
- const t$4 = setTimeout(() => {
12503
+ const t$5 = setTimeout(() => {
12490
12504
  if (this.#isStale(index$1)) this.delete(this.#keyList[index$1]);
12491
12505
  }, ttl + 1);
12492
12506
  /* c8 ignore start */
12493
- if (t$4.unref) t$4.unref();
12507
+ if (t$5.unref) t$5.unref();
12494
12508
  }
12495
12509
  };
12496
12510
  this.#updateItemAge = (index$1) => {
@@ -12514,9 +12528,9 @@ var require_commonjs = require_picocolors$1.__commonJS({ "../../node_modules/.pn
12514
12528
  const n$1 = perf.now();
12515
12529
  if (this.ttlResolution > 0) {
12516
12530
  cachedNow = n$1;
12517
- const t$4 = setTimeout(() => cachedNow = 0, this.ttlResolution);
12531
+ const t$5 = setTimeout(() => cachedNow = 0, this.ttlResolution);
12518
12532
  /* c8 ignore start */
12519
- if (t$4.unref) t$4.unref();
12533
+ if (t$5.unref) t$5.unref();
12520
12534
  }
12521
12535
  return n$1;
12522
12536
  };
@@ -12531,8 +12545,8 @@ var require_commonjs = require_picocolors$1.__commonJS({ "../../node_modules/.pn
12531
12545
  };
12532
12546
  this.#isStale = (index$1) => {
12533
12547
  const s = starts[index$1];
12534
- const t$4 = ttls[index$1];
12535
- return !!t$4 && !!s && (cachedNow || getNow()) - s > t$4;
12548
+ const t$5 = ttls[index$1];
12549
+ return !!t$5 && !!s && (cachedNow || getNow()) - s > t$5;
12536
12550
  };
12537
12551
  }
12538
12552
  #updateItemAge = () => {};
@@ -13231,13 +13245,13 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13231
13245
  const defaults = {
13232
13246
  sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
13233
13247
  sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13234
- edittemplate: ({ domain, user, project, committish, editpath, path: path$20 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path$20)}`,
13248
+ edittemplate: ({ domain, user, project, committish, editpath, path: path$21 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path$21)}`,
13235
13249
  browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
13236
- browsetreetemplate: ({ domain, user, project, committish, treepath, path: path$20, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path$20}${maybeJoin("#", hashformat(fragment || ""))}`,
13237
- browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path$20, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path$20}${maybeJoin("#", hashformat(fragment || ""))}`,
13250
+ browsetreetemplate: ({ domain, user, project, committish, treepath, path: path$21, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path$21}${maybeJoin("#", hashformat(fragment || ""))}`,
13251
+ browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path$21, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path$21}${maybeJoin("#", hashformat(fragment || ""))}`,
13238
13252
  docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
13239
13253
  httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13240
- filetemplate: ({ domain, user, project, committish, path: path$20 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path$20}`,
13254
+ filetemplate: ({ domain, user, project, committish, path: path$21 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path$21}`,
13241
13255
  shortcuttemplate: ({ type: type$1, user, project, committish }) => `${type$1}:${user}/${project}${maybeJoin("#", committish)}`,
13242
13256
  pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
13243
13257
  bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
@@ -13257,7 +13271,7 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13257
13271
  treepath: "tree",
13258
13272
  blobpath: "blob",
13259
13273
  editpath: "edit",
13260
- filetemplate: ({ auth, user, project, committish, path: path$20 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path$20}`,
13274
+ filetemplate: ({ auth, user, project, committish, path: path$21 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path$21}`,
13261
13275
  gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13262
13276
  tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
13263
13277
  extract: (url$2) => {
@@ -13284,7 +13298,7 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13284
13298
  treepath: "src",
13285
13299
  blobpath: "src",
13286
13300
  editpath: "?mode=edit",
13287
- edittemplate: ({ domain, user, project, committish, treepath, path: path$20, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path$20, editpath)}`,
13301
+ edittemplate: ({ domain, user, project, committish, treepath, path: path$21, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path$21, editpath)}`,
13288
13302
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
13289
13303
  extract: (url$2) => {
13290
13304
  let [, user, project, aux] = url$2.pathname.split("/", 4);
@@ -13312,9 +13326,9 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13312
13326
  httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13313
13327
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
13314
13328
  extract: (url$2) => {
13315
- const path$20 = url$2.pathname.slice(1);
13316
- if (path$20.includes("/-/") || path$20.includes("/archive.tar.gz")) return;
13317
- const segments = path$20.split("/");
13329
+ const path$21 = url$2.pathname.slice(1);
13330
+ if (path$21.includes("/-/") || path$21.includes("/archive.tar.gz")) return;
13331
+ const segments = path$21.split("/");
13318
13332
  let project = segments.pop();
13319
13333
  if (project.endsWith(".git")) project = project.slice(0, -4);
13320
13334
  const user = segments.join("/");
@@ -13340,11 +13354,11 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13340
13354
  sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
13341
13355
  edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
13342
13356
  browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
13343
- browsetreetemplate: ({ domain, project, committish, path: path$20, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$20))}`,
13344
- browseblobtemplate: ({ domain, project, committish, path: path$20, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$20))}`,
13357
+ browsetreetemplate: ({ domain, project, committish, path: path$21, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$21))}`,
13358
+ browseblobtemplate: ({ domain, project, committish, path: path$21, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$21))}`,
13345
13359
  docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
13346
13360
  httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
13347
- filetemplate: ({ user, project, committish, path: path$20 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path$20}`,
13361
+ filetemplate: ({ user, project, committish, path: path$21 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path$21}`,
13348
13362
  shortcuttemplate: ({ type: type$1, project, committish }) => `${type$1}:${project}${maybeJoin("#", committish)}`,
13349
13363
  pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
13350
13364
  bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
@@ -13374,7 +13388,7 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13374
13388
  domain: "git.sr.ht",
13375
13389
  treepath: "tree",
13376
13390
  blobpath: "tree",
13377
- filetemplate: ({ domain, user, project, committish, path: path$20 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path$20}`,
13391
+ filetemplate: ({ domain, user, project, committish, path: path$21 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path$21}`,
13378
13392
  httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13379
13393
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
13380
13394
  bugstemplate: () => null,
@@ -13586,27 +13600,27 @@ var require_lib = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/ho
13586
13600
  sshurl(opts) {
13587
13601
  return this.#fill(this.sshurltemplate, opts);
13588
13602
  }
13589
- browse(path$20, ...args) {
13590
- if (typeof path$20 !== "string") return this.#fill(this.browsetemplate, path$20);
13603
+ browse(path$21, ...args) {
13604
+ if (typeof path$21 !== "string") return this.#fill(this.browsetemplate, path$21);
13591
13605
  if (typeof args[0] !== "string") return this.#fill(this.browsetreetemplate, {
13592
13606
  ...args[0],
13593
- path: path$20
13607
+ path: path$21
13594
13608
  });
13595
13609
  return this.#fill(this.browsetreetemplate, {
13596
13610
  ...args[1],
13597
13611
  fragment: args[0],
13598
- path: path$20
13612
+ path: path$21
13599
13613
  });
13600
13614
  }
13601
- browseFile(path$20, ...args) {
13615
+ browseFile(path$21, ...args) {
13602
13616
  if (typeof args[0] !== "string") return this.#fill(this.browseblobtemplate, {
13603
13617
  ...args[0],
13604
- path: path$20
13618
+ path: path$21
13605
13619
  });
13606
13620
  return this.#fill(this.browseblobtemplate, {
13607
13621
  ...args[1],
13608
13622
  fragment: args[0],
13609
- path: path$20
13623
+ path: path$21
13610
13624
  });
13611
13625
  }
13612
13626
  docs(opts) {
@@ -13633,16 +13647,16 @@ var require_lib = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/ho
13633
13647
  noCommittish: false
13634
13648
  });
13635
13649
  }
13636
- file(path$20, opts) {
13650
+ file(path$21, opts) {
13637
13651
  return this.#fill(this.filetemplate, {
13638
13652
  ...opts,
13639
- path: path$20
13653
+ path: path$21
13640
13654
  });
13641
13655
  }
13642
- edit(path$20, opts) {
13656
+ edit(path$21, opts) {
13643
13657
  return this.#fill(this.edittemplate, {
13644
13658
  ...opts,
13645
- path: path$20
13659
+ path: path$21
13646
13660
  });
13647
13661
  }
13648
13662
  getDefaultRepresentation() {
@@ -14196,6 +14210,16 @@ const printBanner = () => {
14196
14210
  (0, __hot_updater_plugin_core.printBanner)(version);
14197
14211
  };
14198
14212
 
14213
+ //#endregion
14214
+ //#region src/utils/version/getNativeAppVersion.ts
14215
+ const getNativeAppVersion = async (platform$2) => {
14216
+ switch (platform$2) {
14217
+ case "ios": return getIOSVersion({ parser: ["xcodeproj", "info-plist"] });
14218
+ case "android": return getAndroidVersion({ parser: "app-build-gradle" });
14219
+ default: return null;
14220
+ }
14221
+ };
14222
+
14199
14223
  //#endregion
14200
14224
  //#region src/commands/deploy.ts
14201
14225
  var import_valid$1 = require_picocolors$1.__toESM(require_valid$1());
@@ -14244,7 +14268,7 @@ const deploy = async (options) => {
14244
14268
  target.fingerprintHash = fingerprint.hash;
14245
14269
  s.stop(`Fingerprint(${platform$2}): ${fingerprint.hash}`);
14246
14270
  } else {
14247
- const defaultTargetAppVersion = await getDefaultTargetAppVersion(cwd, platform$2) ?? "1.0.0";
14271
+ const defaultTargetAppVersion = await getDefaultTargetAppVersion(platform$2) ?? "1.0.0";
14248
14272
  const targetAppVersion = options.targetAppVersion ?? (options.interactive ? await __clack_prompts.text({
14249
14273
  message: "Target app version",
14250
14274
  placeholder: defaultTargetAppVersion,
@@ -15195,29 +15219,29 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
15195
15219
  var require_windows = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
15196
15220
  module.exports = isexe$3;
15197
15221
  isexe$3.sync = sync$2;
15198
- var fs$7 = require("fs");
15199
- function checkPathExt(path$20, options) {
15222
+ var fs$8 = require("fs");
15223
+ function checkPathExt(path$21, options) {
15200
15224
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
15201
15225
  if (!pathext) return true;
15202
15226
  pathext = pathext.split(";");
15203
15227
  if (pathext.indexOf("") !== -1) return true;
15204
15228
  for (var i$2 = 0; i$2 < pathext.length; i$2++) {
15205
15229
  var p = pathext[i$2].toLowerCase();
15206
- if (p && path$20.substr(-p.length).toLowerCase() === p) return true;
15230
+ if (p && path$21.substr(-p.length).toLowerCase() === p) return true;
15207
15231
  }
15208
15232
  return false;
15209
15233
  }
15210
- function checkStat$1(stat, path$20, options) {
15234
+ function checkStat$1(stat, path$21, options) {
15211
15235
  if (!stat.isSymbolicLink() && !stat.isFile()) return false;
15212
- return checkPathExt(path$20, options);
15236
+ return checkPathExt(path$21, options);
15213
15237
  }
15214
- function isexe$3(path$20, options, cb) {
15215
- fs$7.stat(path$20, function(er, stat) {
15216
- cb(er, er ? false : checkStat$1(stat, path$20, options));
15238
+ function isexe$3(path$21, options, cb) {
15239
+ fs$8.stat(path$21, function(er, stat) {
15240
+ cb(er, er ? false : checkStat$1(stat, path$21, options));
15217
15241
  });
15218
15242
  }
15219
- function sync$2(path$20, options) {
15220
- return checkStat$1(fs$7.statSync(path$20), path$20, options);
15243
+ function sync$2(path$21, options) {
15244
+ return checkStat$1(fs$8.statSync(path$21), path$21, options);
15221
15245
  }
15222
15246
  } });
15223
15247
 
@@ -15226,14 +15250,14 @@ var require_windows = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
15226
15250
  var require_mode = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
15227
15251
  module.exports = isexe$2;
15228
15252
  isexe$2.sync = sync$1;
15229
- var fs$6 = require("fs");
15230
- function isexe$2(path$20, options, cb) {
15231
- fs$6.stat(path$20, function(er, stat) {
15253
+ var fs$7 = require("fs");
15254
+ function isexe$2(path$21, options, cb) {
15255
+ fs$7.stat(path$21, function(er, stat) {
15232
15256
  cb(er, er ? false : checkStat(stat, options));
15233
15257
  });
15234
15258
  }
15235
- function sync$1(path$20, options) {
15236
- return checkStat(fs$6.statSync(path$20), options);
15259
+ function sync$1(path$21, options) {
15260
+ return checkStat(fs$7.statSync(path$21), options);
15237
15261
  }
15238
15262
  function checkStat(stat, options) {
15239
15263
  return stat.isFile() && checkMode(stat, options);
@@ -15256,13 +15280,13 @@ var require_mode = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/i
15256
15280
  //#endregion
15257
15281
  //#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
15258
15282
  var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
15259
- var fs$5 = require("fs");
15283
+ var fs$6 = require("fs");
15260
15284
  var core;
15261
15285
  if (process.platform === "win32" || global.TESTING_WINDOWS) core = require_windows();
15262
15286
  else core = require_mode();
15263
15287
  module.exports = isexe$1;
15264
15288
  isexe$1.sync = sync;
15265
- function isexe$1(path$20, options, cb) {
15289
+ function isexe$1(path$21, options, cb) {
15266
15290
  if (typeof options === "function") {
15267
15291
  cb = options;
15268
15292
  options = {};
@@ -15270,13 +15294,13 @@ var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
15270
15294
  if (!cb) {
15271
15295
  if (typeof Promise !== "function") throw new TypeError("callback not provided");
15272
15296
  return new Promise(function(resolve, reject) {
15273
- isexe$1(path$20, options || {}, function(er, is) {
15297
+ isexe$1(path$21, options || {}, function(er, is) {
15274
15298
  if (er) reject(er);
15275
15299
  else resolve(is);
15276
15300
  });
15277
15301
  });
15278
15302
  }
15279
- core(path$20, options || {}, function(er, is) {
15303
+ core(path$21, options || {}, function(er, is) {
15280
15304
  if (er) {
15281
15305
  if (er.code === "EACCES" || options && options.ignoreErrors) {
15282
15306
  er = null;
@@ -15286,9 +15310,9 @@ var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
15286
15310
  cb(er, is);
15287
15311
  });
15288
15312
  }
15289
- function sync(path$20, options) {
15313
+ function sync(path$21, options) {
15290
15314
  try {
15291
- return core.sync(path$20, options || {});
15315
+ return core.sync(path$21, options || {});
15292
15316
  } catch (er) {
15293
15317
  if (options && options.ignoreErrors || er.code === "EACCES") return false;
15294
15318
  else throw er;
@@ -15450,8 +15474,8 @@ var require_shebang_command = require_picocolors$1.__commonJS({ "../../node_modu
15450
15474
  module.exports = (string = "") => {
15451
15475
  const match = string.match(shebangRegex);
15452
15476
  if (!match) return null;
15453
- const [path$20, argument] = match[0].replace(/#! ?/, "").split(" ");
15454
- const binary = path$20.split("/").pop();
15477
+ const [path$21, argument] = match[0].replace(/#! ?/, "").split(" ");
15478
+ const binary = path$21.split("/").pop();
15455
15479
  if (binary === "env") return argument;
15456
15480
  return argument ? `${binary} ${argument}` : binary;
15457
15481
  };
@@ -15460,16 +15484,16 @@ var require_shebang_command = require_picocolors$1.__commonJS({ "../../node_modu
15460
15484
  //#endregion
15461
15485
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
15462
15486
  var require_readShebang = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
15463
- const fs$4 = require("fs");
15487
+ const fs$5 = require("fs");
15464
15488
  const shebangCommand = require_shebang_command();
15465
15489
  function readShebang$1(command) {
15466
15490
  const size = 150;
15467
15491
  const buffer = Buffer.alloc(size);
15468
15492
  let fd;
15469
15493
  try {
15470
- fd = fs$4.openSync(command, "r");
15471
- fs$4.readSync(fd, buffer, 0, size, 0);
15472
- fs$4.closeSync(fd);
15494
+ fd = fs$5.openSync(command, "r");
15495
+ fs$5.readSync(fd, buffer, 0, size, 0);
15496
+ fs$5.closeSync(fd);
15473
15497
  } catch (e) {}
15474
15498
  return shebangCommand(buffer.toString());
15475
15499
  }
@@ -15517,7 +15541,7 @@ var require_parse = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
15517
15541
  }
15518
15542
  return parsed;
15519
15543
  }
15520
- function parse$1(command, args, options) {
15544
+ function parse$5(command, args, options) {
15521
15545
  if (args && !Array.isArray(args)) {
15522
15546
  options = args;
15523
15547
  args = null;
@@ -15536,7 +15560,7 @@ var require_parse = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
15536
15560
  };
15537
15561
  return options.shell ? parsed : parseNonShell(parsed);
15538
15562
  }
15539
- module.exports = parse$1;
15563
+ module.exports = parse$5;
15540
15564
  } });
15541
15565
 
15542
15566
  //#endregion
@@ -15583,16 +15607,16 @@ var require_enoent = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm
15583
15607
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
15584
15608
  var require_cross_spawn = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
15585
15609
  const cp = require("child_process");
15586
- const parse = require_parse();
15610
+ const parse$4 = require_parse();
15587
15611
  const enoent = require_enoent();
15588
15612
  function spawn$1(command, args, options) {
15589
- const parsed = parse(command, args, options);
15613
+ const parsed = parse$4(command, args, options);
15590
15614
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
15591
15615
  enoent.hookChildProcess(spawned, parsed);
15592
15616
  return spawned;
15593
15617
  }
15594
15618
  function spawnSync$1(command, args, options) {
15595
- const parsed = parse(command, args, options);
15619
+ const parsed = parse$4(command, args, options);
15596
15620
  const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
15597
15621
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
15598
15622
  return result;
@@ -15600,7 +15624,7 @@ var require_cross_spawn = require_picocolors$1.__commonJS({ "../../node_modules/
15600
15624
  module.exports = spawn$1;
15601
15625
  module.exports.spawn = spawn$1;
15602
15626
  module.exports.sync = spawnSync$1;
15603
- module.exports._parse = parse;
15627
+ module.exports._parse = parse$4;
15604
15628
  module.exports._enoent = enoent;
15605
15629
  } });
15606
15630
 
@@ -16911,16 +16935,16 @@ var c = class {
16911
16935
  #n;
16912
16936
  #r = !1;
16913
16937
  #e = void 0;
16914
- constructor(e, t$4) {
16915
- this.#t = e, this.#n = t$4;
16938
+ constructor(e, t$5) {
16939
+ this.#t = e, this.#n = t$5;
16916
16940
  }
16917
16941
  next() {
16918
16942
  const e = () => this.#s();
16919
16943
  return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;
16920
16944
  }
16921
16945
  return(e) {
16922
- const t$4 = () => this.#i(e);
16923
- return this.#e ? this.#e.then(t$4, t$4) : t$4();
16946
+ const t$5 = () => this.#i(e);
16947
+ return this.#e ? this.#e.then(t$5, t$5) : t$5();
16924
16948
  }
16925
16949
  async #s() {
16926
16950
  if (this.#r) return {
@@ -16930,8 +16954,8 @@ var c = class {
16930
16954
  let e;
16931
16955
  try {
16932
16956
  e = await this.#t.read();
16933
- } catch (t$4) {
16934
- throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t$4;
16957
+ } catch (t$5) {
16958
+ throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t$5;
16935
16959
  }
16936
16960
  return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;
16937
16961
  }
@@ -16941,8 +16965,8 @@ var c = class {
16941
16965
  value: e
16942
16966
  };
16943
16967
  if (this.#r = !0, !this.#n) {
16944
- const t$4 = this.#t.cancel(e);
16945
- return this.#t.releaseLock(), await t$4, {
16968
+ const t$5 = this.#t.cancel(e);
16969
+ return this.#t.releaseLock(), await t$5, {
16946
16970
  done: !0,
16947
16971
  value: e
16948
16972
  };
@@ -16977,8 +17001,8 @@ const u = Object.create(a, {
16977
17001
  }
16978
17002
  });
16979
17003
  function h({ preventCancel: r = !1 } = {}) {
16980
- const e = this.getReader(), t$4 = new c(e, r), s = Object.create(u);
16981
- return s[n] = t$4, s;
17004
+ const e = this.getReader(), t$5 = new c(e, r), s = Object.create(u);
17005
+ return s[n] = t$5, s;
16982
17006
  }
16983
17007
 
16984
17008
  //#endregion
@@ -18634,12 +18658,12 @@ const logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encodin
18634
18658
  }
18635
18659
  };
18636
18660
  const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
18637
- for (const { path: path$20, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
18638
- const pathString = typeof path$20 === "string" ? path$20 : path$20.toString();
18639
- if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path$20, serializedResult);
18661
+ for (const { path: path$21, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
18662
+ const pathString = typeof path$21 === "string" ? path$21 : path$21.toString();
18663
+ if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path$21, serializedResult);
18640
18664
  else {
18641
18665
  outputFiles.add(pathString);
18642
- (0, node_fs.writeFileSync)(path$20, serializedResult);
18666
+ (0, node_fs.writeFileSync)(path$21, serializedResult);
18643
18667
  }
18644
18668
  }
18645
18669
  };
@@ -21193,15 +21217,9 @@ const getChannel = async (platform$2) => {
21193
21217
  };
21194
21218
 
21195
21219
  //#endregion
21196
- //#region src/index.ts
21197
- var import_picocolors = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
21198
- var import_valid = require_picocolors$1.__toESM(require_valid$1());
21199
- const DEFAULT_CHANNEL = "production";
21200
- const program = new __commander_js_extra_typings.Command();
21201
- program.name("hot-updater").description((0, __hot_updater_plugin_core.banner)(version)).version(version);
21202
- program.command("init").description("Initialize Hot Updater").action(init);
21203
- const fingerprintCommand = program.command("fingerprint").description("Generate fingerprint");
21204
- fingerprintCommand.action(async () => {
21220
+ //#region src/commands/fingerprint.ts
21221
+ var import_picocolors$2 = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
21222
+ const handleFingerprint = async () => {
21205
21223
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
21206
21224
  if (config.updateStrategy === "appVersion") {
21207
21225
  __clack_prompts.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
@@ -21245,8 +21263,8 @@ fingerprintCommand.action(async () => {
21245
21263
  process.exit(1);
21246
21264
  }
21247
21265
  __clack_prompts.log.success("Fingerprint matched");
21248
- });
21249
- fingerprintCommand.command("create").description("Create fingerprint").action(async () => {
21266
+ };
21267
+ const handleCreateFingerprint = async () => {
21250
21268
  const FINGERPRINT_FILE_PATH = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "fingerprint.json");
21251
21269
  const createFingerprintData = async (config) => {
21252
21270
  const [ios, android] = await Promise.all([(0, __rnef_tools.nativeFingerprint)((0, __hot_updater_plugin_core.getCwd)(), {
@@ -21285,26 +21303,742 @@ fingerprintCommand.command("create").description("Create fingerprint").action(as
21285
21303
  return "Created fingerprint.json";
21286
21304
  }
21287
21305
  }]);
21288
- if (diffChanged) __clack_prompts.log.success(import_picocolors.default.bold(`${import_picocolors.default.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
21289
- });
21290
- const channelCommand = program.command("channel").description("Manage channels");
21291
- channelCommand.action(async () => {
21306
+ if (diffChanged) __clack_prompts.log.success(import_picocolors$2.default.bold(`${import_picocolors$2.default.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
21307
+ else __clack_prompts.log.success(import_picocolors$2.default.bold(`${import_picocolors$2.default.blue("fingerprint.json")} is up to date.`));
21308
+ };
21309
+
21310
+ //#endregion
21311
+ //#region src/commands/channel.ts
21312
+ var import_picocolors$1 = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
21313
+ const handleChannel = async () => {
21292
21314
  const androidChannel = await getChannel("android");
21293
21315
  const iosChannel = await getChannel("ios");
21294
- __clack_prompts.log.info(`Current Android channel: ${import_picocolors.default.green(androidChannel.value)}`);
21295
- __clack_prompts.log.info(` from: ${import_picocolors.default.blue(androidChannel.path)}`);
21296
- __clack_prompts.log.info(`Current iOS channel: ${import_picocolors.default.green(iosChannel.value)}`);
21297
- __clack_prompts.log.info(` from: ${import_picocolors.default.blue(iosChannel.path)}`);
21298
- });
21299
- channelCommand.command("set").description("Set the channel for Android (BuildConfig) and iOS (Info.plist)").argument("<channel>", "the channel to set").action(async (channel) => {
21316
+ __clack_prompts.log.info(`Current Android channel: ${import_picocolors$1.default.green(androidChannel.value)}`);
21317
+ __clack_prompts.log.info(` from: ${import_picocolors$1.default.blue(androidChannel.path)}`);
21318
+ __clack_prompts.log.info(`Current iOS channel: ${import_picocolors$1.default.green(iosChannel.value)}`);
21319
+ __clack_prompts.log.info(` from: ${import_picocolors$1.default.blue(iosChannel.path)}`);
21320
+ };
21321
+ const handleSetChannel = async (channel) => {
21300
21322
  const { path: androidPath } = await setChannel("android", channel);
21301
- __clack_prompts.log.success(`Set Android channel to: ${import_picocolors.default.green(channel)}`);
21302
- __clack_prompts.log.info(` from: ${import_picocolors.default.blue(androidPath)}`);
21323
+ __clack_prompts.log.success(`Set Android channel to: ${import_picocolors$1.default.green(channel)}`);
21324
+ __clack_prompts.log.info(` from: ${import_picocolors$1.default.blue(androidPath)}`);
21303
21325
  const { path: iosPath } = await setChannel("ios", channel);
21304
- __clack_prompts.log.success(`Set iOS channel to: ${import_picocolors.default.green(channel)}`);
21305
- __clack_prompts.log.info(` from: ${import_picocolors.default.blue(iosPath)}`);
21326
+ __clack_prompts.log.success(`Set iOS channel to: ${import_picocolors$1.default.green(channel)}`);
21327
+ __clack_prompts.log.info(` from: ${import_picocolors$1.default.blue(iosPath)}`);
21306
21328
  __clack_prompts.log.success("You need to rebuild the native app if the channel has changed.");
21307
- });
21329
+ const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
21330
+ if (config.updateStrategy === "fingerprint") await handleCreateFingerprint();
21331
+ };
21332
+
21333
+ //#endregion
21334
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
21335
+ var require_inc = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js"(exports, module) {
21336
+ const SemVer$10 = require_semver$1();
21337
+ const inc$1 = (version$1, release, options, identifier, identifierBase) => {
21338
+ if (typeof options === "string") {
21339
+ identifierBase = identifier;
21340
+ identifier = options;
21341
+ options = void 0;
21342
+ }
21343
+ try {
21344
+ return new SemVer$10(version$1 instanceof SemVer$10 ? version$1.version : version$1, options).inc(release, identifier, identifierBase).version;
21345
+ } catch (er) {
21346
+ return null;
21347
+ }
21348
+ };
21349
+ module.exports = inc$1;
21350
+ } });
21351
+
21352
+ //#endregion
21353
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
21354
+ var require_diff = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js"(exports, module) {
21355
+ const parse$3 = require_parse$2();
21356
+ const diff$1 = (version1, version2) => {
21357
+ const v1 = parse$3(version1, null, true);
21358
+ const v2 = parse$3(version2, null, true);
21359
+ const comparison = v1.compare(v2);
21360
+ if (comparison === 0) return null;
21361
+ const v1Higher = comparison > 0;
21362
+ const highVersion = v1Higher ? v1 : v2;
21363
+ const lowVersion = v1Higher ? v2 : v1;
21364
+ const highHasPre = !!highVersion.prerelease.length;
21365
+ const lowHasPre = !!lowVersion.prerelease.length;
21366
+ if (lowHasPre && !highHasPre) {
21367
+ if (!lowVersion.patch && !lowVersion.minor) return "major";
21368
+ if (lowVersion.compareMain(highVersion) === 0) {
21369
+ if (lowVersion.minor && !lowVersion.patch) return "minor";
21370
+ return "patch";
21371
+ }
21372
+ }
21373
+ const prefix = highHasPre ? "pre" : "";
21374
+ if (v1.major !== v2.major) return prefix + "major";
21375
+ if (v1.minor !== v2.minor) return prefix + "minor";
21376
+ if (v1.patch !== v2.patch) return prefix + "patch";
21377
+ return "prerelease";
21378
+ };
21379
+ module.exports = diff$1;
21380
+ } });
21381
+
21382
+ //#endregion
21383
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
21384
+ var require_major = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js"(exports, module) {
21385
+ const SemVer$9 = require_semver$1();
21386
+ const major$1 = (a$1, loose) => new SemVer$9(a$1, loose).major;
21387
+ module.exports = major$1;
21388
+ } });
21389
+
21390
+ //#endregion
21391
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
21392
+ var require_minor = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js"(exports, module) {
21393
+ const SemVer$8 = require_semver$1();
21394
+ const minor$1 = (a$1, loose) => new SemVer$8(a$1, loose).minor;
21395
+ module.exports = minor$1;
21396
+ } });
21397
+
21398
+ //#endregion
21399
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
21400
+ var require_patch = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js"(exports, module) {
21401
+ const SemVer$7 = require_semver$1();
21402
+ const patch$1 = (a$1, loose) => new SemVer$7(a$1, loose).patch;
21403
+ module.exports = patch$1;
21404
+ } });
21405
+
21406
+ //#endregion
21407
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
21408
+ var require_prerelease = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js"(exports, module) {
21409
+ const parse$2 = require_parse$2();
21410
+ const prerelease$1 = (version$1, options) => {
21411
+ const parsed = parse$2(version$1, options);
21412
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
21413
+ };
21414
+ module.exports = prerelease$1;
21415
+ } });
21416
+
21417
+ //#endregion
21418
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
21419
+ var require_rcompare = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js"(exports, module) {
21420
+ const compare$4 = require_compare();
21421
+ const rcompare$1 = (a$1, b, loose) => compare$4(b, a$1, loose);
21422
+ module.exports = rcompare$1;
21423
+ } });
21424
+
21425
+ //#endregion
21426
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
21427
+ var require_compare_loose = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js"(exports, module) {
21428
+ const compare$3 = require_compare();
21429
+ const compareLoose$1 = (a$1, b) => compare$3(a$1, b, true);
21430
+ module.exports = compareLoose$1;
21431
+ } });
21432
+
21433
+ //#endregion
21434
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
21435
+ var require_compare_build = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js"(exports, module) {
21436
+ const SemVer$6 = require_semver$1();
21437
+ const compareBuild$3 = (a$1, b, loose) => {
21438
+ const versionA = new SemVer$6(a$1, loose);
21439
+ const versionB = new SemVer$6(b, loose);
21440
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
21441
+ };
21442
+ module.exports = compareBuild$3;
21443
+ } });
21444
+
21445
+ //#endregion
21446
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
21447
+ var require_sort = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js"(exports, module) {
21448
+ const compareBuild$2 = require_compare_build();
21449
+ const sort$1 = (list, loose) => list.sort((a$1, b) => compareBuild$2(a$1, b, loose));
21450
+ module.exports = sort$1;
21451
+ } });
21452
+
21453
+ //#endregion
21454
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
21455
+ var require_rsort = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js"(exports, module) {
21456
+ const compareBuild$1 = require_compare_build();
21457
+ const rsort$1 = (list, loose) => list.sort((a$1, b) => compareBuild$1(b, a$1, loose));
21458
+ module.exports = rsort$1;
21459
+ } });
21460
+
21461
+ //#endregion
21462
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
21463
+ var require_coerce = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js"(exports, module) {
21464
+ const SemVer$5 = require_semver$1();
21465
+ const parse$1 = require_parse$2();
21466
+ const { safeRe: re, t } = require_re();
21467
+ const coerce$1 = (version$1, options) => {
21468
+ if (version$1 instanceof SemVer$5) return version$1;
21469
+ if (typeof version$1 === "number") version$1 = String(version$1);
21470
+ if (typeof version$1 !== "string") return null;
21471
+ options = options || {};
21472
+ let match = null;
21473
+ if (!options.rtl) match = version$1.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
21474
+ else {
21475
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
21476
+ let next;
21477
+ while ((next = coerceRtlRegex.exec(version$1)) && (!match || match.index + match[0].length !== version$1.length)) {
21478
+ if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
21479
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
21480
+ }
21481
+ coerceRtlRegex.lastIndex = -1;
21482
+ }
21483
+ if (match === null) return null;
21484
+ const major$2 = match[2];
21485
+ const minor$2 = match[3] || "0";
21486
+ const patch$2 = match[4] || "0";
21487
+ const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
21488
+ const build$1 = options.includePrerelease && match[6] ? `+${match[6]}` : "";
21489
+ return parse$1(`${major$2}.${minor$2}.${patch$2}${prerelease$2}${build$1}`, options);
21490
+ };
21491
+ module.exports = coerce$1;
21492
+ } });
21493
+
21494
+ //#endregion
21495
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
21496
+ var require_satisfies = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports, module) {
21497
+ const Range$8 = require_range();
21498
+ const satisfies$4 = (version$1, range, options) => {
21499
+ try {
21500
+ range = new Range$8(range, options);
21501
+ } catch (er) {
21502
+ return false;
21503
+ }
21504
+ return range.test(version$1);
21505
+ };
21506
+ module.exports = satisfies$4;
21507
+ } });
21508
+
21509
+ //#endregion
21510
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
21511
+ var require_to_comparators = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js"(exports, module) {
21512
+ const Range$7 = require_range();
21513
+ const toComparators$1 = (range, options) => new Range$7(range, options).set.map((comp) => comp.map((c$1) => c$1.value).join(" ").trim().split(" "));
21514
+ module.exports = toComparators$1;
21515
+ } });
21516
+
21517
+ //#endregion
21518
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
21519
+ var require_max_satisfying = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
21520
+ const SemVer$4 = require_semver$1();
21521
+ const Range$6 = require_range();
21522
+ const maxSatisfying$1 = (versions, range, options) => {
21523
+ let max = null;
21524
+ let maxSV = null;
21525
+ let rangeObj = null;
21526
+ try {
21527
+ rangeObj = new Range$6(range, options);
21528
+ } catch (er) {
21529
+ return null;
21530
+ }
21531
+ versions.forEach((v) => {
21532
+ if (rangeObj.test(v)) {
21533
+ if (!max || maxSV.compare(v) === -1) {
21534
+ max = v;
21535
+ maxSV = new SemVer$4(max, options);
21536
+ }
21537
+ }
21538
+ });
21539
+ return max;
21540
+ };
21541
+ module.exports = maxSatisfying$1;
21542
+ } });
21543
+
21544
+ //#endregion
21545
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
21546
+ var require_min_satisfying = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
21547
+ const SemVer$3 = require_semver$1();
21548
+ const Range$5 = require_range();
21549
+ const minSatisfying$1 = (versions, range, options) => {
21550
+ let min = null;
21551
+ let minSV = null;
21552
+ let rangeObj = null;
21553
+ try {
21554
+ rangeObj = new Range$5(range, options);
21555
+ } catch (er) {
21556
+ return null;
21557
+ }
21558
+ versions.forEach((v) => {
21559
+ if (rangeObj.test(v)) {
21560
+ if (!min || minSV.compare(v) === 1) {
21561
+ min = v;
21562
+ minSV = new SemVer$3(min, options);
21563
+ }
21564
+ }
21565
+ });
21566
+ return min;
21567
+ };
21568
+ module.exports = minSatisfying$1;
21569
+ } });
21570
+
21571
+ //#endregion
21572
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
21573
+ var require_min_version = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports, module) {
21574
+ const SemVer$2 = require_semver$1();
21575
+ const Range$4 = require_range();
21576
+ const gt$2 = require_gt();
21577
+ const minVersion$1 = (range, loose) => {
21578
+ range = new Range$4(range, loose);
21579
+ let minver = new SemVer$2("0.0.0");
21580
+ if (range.test(minver)) return minver;
21581
+ minver = new SemVer$2("0.0.0-0");
21582
+ if (range.test(minver)) return minver;
21583
+ minver = null;
21584
+ for (let i$2 = 0; i$2 < range.set.length; ++i$2) {
21585
+ const comparators = range.set[i$2];
21586
+ let setMin = null;
21587
+ comparators.forEach((comparator) => {
21588
+ const compver = new SemVer$2(comparator.semver.version);
21589
+ switch (comparator.operator) {
21590
+ case ">":
21591
+ if (compver.prerelease.length === 0) compver.patch++;
21592
+ else compver.prerelease.push(0);
21593
+ compver.raw = compver.format();
21594
+ case "":
21595
+ case ">=":
21596
+ if (!setMin || gt$2(compver, setMin)) setMin = compver;
21597
+ break;
21598
+ case "<":
21599
+ case "<=": break;
21600
+ default: throw new Error(`Unexpected operation: ${comparator.operator}`);
21601
+ }
21602
+ });
21603
+ if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
21604
+ }
21605
+ if (minver && range.test(minver)) return minver;
21606
+ return null;
21607
+ };
21608
+ module.exports = minVersion$1;
21609
+ } });
21610
+
21611
+ //#endregion
21612
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
21613
+ var require_outside = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports, module) {
21614
+ const SemVer$1 = require_semver$1();
21615
+ const Comparator$2 = require_comparator();
21616
+ const { ANY: ANY$1 } = Comparator$2;
21617
+ const Range$3 = require_range();
21618
+ const satisfies$3 = require_satisfies();
21619
+ const gt$1 = require_gt();
21620
+ const lt$1 = require_lt();
21621
+ const lte$1 = require_lte();
21622
+ const gte$1 = require_gte();
21623
+ const outside$3 = (version$1, range, hilo, options) => {
21624
+ version$1 = new SemVer$1(version$1, options);
21625
+ range = new Range$3(range, options);
21626
+ let gtfn, ltefn, ltfn, comp, ecomp;
21627
+ switch (hilo) {
21628
+ case ">":
21629
+ gtfn = gt$1;
21630
+ ltefn = lte$1;
21631
+ ltfn = lt$1;
21632
+ comp = ">";
21633
+ ecomp = ">=";
21634
+ break;
21635
+ case "<":
21636
+ gtfn = lt$1;
21637
+ ltefn = gte$1;
21638
+ ltfn = gt$1;
21639
+ comp = "<";
21640
+ ecomp = "<=";
21641
+ break;
21642
+ default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
21643
+ }
21644
+ if (satisfies$3(version$1, range, options)) return false;
21645
+ for (let i$2 = 0; i$2 < range.set.length; ++i$2) {
21646
+ const comparators = range.set[i$2];
21647
+ let high = null;
21648
+ let low = null;
21649
+ comparators.forEach((comparator) => {
21650
+ if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
21651
+ high = high || comparator;
21652
+ low = low || comparator;
21653
+ if (gtfn(comparator.semver, high.semver, options)) high = comparator;
21654
+ else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
21655
+ });
21656
+ if (high.operator === comp || high.operator === ecomp) return false;
21657
+ if ((!low.operator || low.operator === comp) && ltefn(version$1, low.semver)) return false;
21658
+ else if (low.operator === ecomp && ltfn(version$1, low.semver)) return false;
21659
+ }
21660
+ return true;
21661
+ };
21662
+ module.exports = outside$3;
21663
+ } });
21664
+
21665
+ //#endregion
21666
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
21667
+ var require_gtr = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports, module) {
21668
+ const outside$2 = require_outside();
21669
+ const gtr$1 = (version$1, range, options) => outside$2(version$1, range, ">", options);
21670
+ module.exports = gtr$1;
21671
+ } });
21672
+
21673
+ //#endregion
21674
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
21675
+ var require_ltr = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports, module) {
21676
+ const outside$1 = require_outside();
21677
+ const ltr$1 = (version$1, range, options) => outside$1(version$1, range, "<", options);
21678
+ module.exports = ltr$1;
21679
+ } });
21680
+
21681
+ //#endregion
21682
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
21683
+ var require_intersects = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js"(exports, module) {
21684
+ const Range$2 = require_range();
21685
+ const intersects$1 = (r1, r2, options) => {
21686
+ r1 = new Range$2(r1, options);
21687
+ r2 = new Range$2(r2, options);
21688
+ return r1.intersects(r2, options);
21689
+ };
21690
+ module.exports = intersects$1;
21691
+ } });
21692
+
21693
+ //#endregion
21694
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
21695
+ var require_simplify = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js"(exports, module) {
21696
+ const satisfies$2 = require_satisfies();
21697
+ const compare$2 = require_compare();
21698
+ module.exports = (versions, range, options) => {
21699
+ const set = [];
21700
+ let first = null;
21701
+ let prev = null;
21702
+ const v = versions.sort((a$1, b) => compare$2(a$1, b, options));
21703
+ for (const version$1 of v) {
21704
+ const included = satisfies$2(version$1, range, options);
21705
+ if (included) {
21706
+ prev = version$1;
21707
+ if (!first) first = version$1;
21708
+ } else {
21709
+ if (prev) set.push([first, prev]);
21710
+ prev = null;
21711
+ first = null;
21712
+ }
21713
+ }
21714
+ if (first) set.push([first, null]);
21715
+ const ranges = [];
21716
+ for (const [min, max] of set) if (min === max) ranges.push(min);
21717
+ else if (!max && min === v[0]) ranges.push("*");
21718
+ else if (!max) ranges.push(`>=${min}`);
21719
+ else if (min === v[0]) ranges.push(`<=${max}`);
21720
+ else ranges.push(`${min} - ${max}`);
21721
+ const simplified = ranges.join(" || ");
21722
+ const original = typeof range.raw === "string" ? range.raw : String(range);
21723
+ return simplified.length < original.length ? simplified : range;
21724
+ };
21725
+ } });
21726
+
21727
+ //#endregion
21728
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
21729
+ var require_subset = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js"(exports, module) {
21730
+ const Range$1 = require_range();
21731
+ const Comparator$1 = require_comparator();
21732
+ const { ANY } = Comparator$1;
21733
+ const satisfies$1 = require_satisfies();
21734
+ const compare$1 = require_compare();
21735
+ const subset$1 = (sub, dom$2, options = {}) => {
21736
+ if (sub === dom$2) return true;
21737
+ sub = new Range$1(sub, options);
21738
+ dom$2 = new Range$1(dom$2, options);
21739
+ let sawNonNull = false;
21740
+ OUTER: for (const simpleSub of sub.set) {
21741
+ for (const simpleDom of dom$2.set) {
21742
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
21743
+ sawNonNull = sawNonNull || isSub !== null;
21744
+ if (isSub) continue OUTER;
21745
+ }
21746
+ if (sawNonNull) return false;
21747
+ }
21748
+ return true;
21749
+ };
21750
+ const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
21751
+ const minimumVersion = [new Comparator$1(">=0.0.0")];
21752
+ const simpleSubset = (sub, dom$2, options) => {
21753
+ if (sub === dom$2) return true;
21754
+ if (sub.length === 1 && sub[0].semver === ANY) if (dom$2.length === 1 && dom$2[0].semver === ANY) return true;
21755
+ else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
21756
+ else sub = minimumVersion;
21757
+ if (dom$2.length === 1 && dom$2[0].semver === ANY) if (options.includePrerelease) return true;
21758
+ else dom$2 = minimumVersion;
21759
+ const eqSet = /* @__PURE__ */ new Set();
21760
+ let gt$5, lt$4;
21761
+ for (const c$1 of sub) if (c$1.operator === ">" || c$1.operator === ">=") gt$5 = higherGT(gt$5, c$1, options);
21762
+ else if (c$1.operator === "<" || c$1.operator === "<=") lt$4 = lowerLT(lt$4, c$1, options);
21763
+ else eqSet.add(c$1.semver);
21764
+ if (eqSet.size > 1) return null;
21765
+ let gtltComp;
21766
+ if (gt$5 && lt$4) {
21767
+ gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
21768
+ if (gtltComp > 0) return null;
21769
+ else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
21770
+ }
21771
+ for (const eq$3 of eqSet) {
21772
+ if (gt$5 && !satisfies$1(eq$3, String(gt$5), options)) return null;
21773
+ if (lt$4 && !satisfies$1(eq$3, String(lt$4), options)) return null;
21774
+ for (const c$1 of dom$2) if (!satisfies$1(eq$3, String(c$1), options)) return false;
21775
+ return true;
21776
+ }
21777
+ let higher, lower;
21778
+ let hasDomLT, hasDomGT;
21779
+ let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
21780
+ let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
21781
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
21782
+ for (const c$1 of dom$2) {
21783
+ hasDomGT = hasDomGT || c$1.operator === ">" || c$1.operator === ">=";
21784
+ hasDomLT = hasDomLT || c$1.operator === "<" || c$1.operator === "<=";
21785
+ if (gt$5) {
21786
+ if (needDomGTPre) {
21787
+ if (c$1.semver.prerelease && c$1.semver.prerelease.length && c$1.semver.major === needDomGTPre.major && c$1.semver.minor === needDomGTPre.minor && c$1.semver.patch === needDomGTPre.patch) needDomGTPre = false;
21788
+ }
21789
+ if (c$1.operator === ">" || c$1.operator === ">=") {
21790
+ higher = higherGT(gt$5, c$1, options);
21791
+ if (higher === c$1 && higher !== gt$5) return false;
21792
+ } else if (gt$5.operator === ">=" && !satisfies$1(gt$5.semver, String(c$1), options)) return false;
21793
+ }
21794
+ if (lt$4) {
21795
+ if (needDomLTPre) {
21796
+ if (c$1.semver.prerelease && c$1.semver.prerelease.length && c$1.semver.major === needDomLTPre.major && c$1.semver.minor === needDomLTPre.minor && c$1.semver.patch === needDomLTPre.patch) needDomLTPre = false;
21797
+ }
21798
+ if (c$1.operator === "<" || c$1.operator === "<=") {
21799
+ lower = lowerLT(lt$4, c$1, options);
21800
+ if (lower === c$1 && lower !== lt$4) return false;
21801
+ } else if (lt$4.operator === "<=" && !satisfies$1(lt$4.semver, String(c$1), options)) return false;
21802
+ }
21803
+ if (!c$1.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
21804
+ }
21805
+ if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
21806
+ if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
21807
+ if (needDomGTPre || needDomLTPre) return false;
21808
+ return true;
21809
+ };
21810
+ const higherGT = (a$1, b, options) => {
21811
+ if (!a$1) return b;
21812
+ const comp = compare$1(a$1.semver, b.semver, options);
21813
+ return comp > 0 ? a$1 : comp < 0 ? b : b.operator === ">" && a$1.operator === ">=" ? b : a$1;
21814
+ };
21815
+ const lowerLT = (a$1, b, options) => {
21816
+ if (!a$1) return b;
21817
+ const comp = compare$1(a$1.semver, b.semver, options);
21818
+ return comp < 0 ? a$1 : comp > 0 ? b : b.operator === "<" && a$1.operator === "<=" ? b : a$1;
21819
+ };
21820
+ module.exports = subset$1;
21821
+ } });
21822
+
21823
+ //#endregion
21824
+ //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js
21825
+ var require_semver = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js"(exports, module) {
21826
+ const internalRe = require_re();
21827
+ const constants = require_constants();
21828
+ const SemVer = require_semver$1();
21829
+ const identifiers = require_identifiers();
21830
+ const parse = require_parse$2();
21831
+ const valid = require_valid();
21832
+ const clean = require_clean();
21833
+ const inc = require_inc();
21834
+ const diff = require_diff();
21835
+ const major = require_major();
21836
+ const minor = require_minor();
21837
+ const patch = require_patch();
21838
+ const prerelease = require_prerelease();
21839
+ const compare = require_compare();
21840
+ const rcompare = require_rcompare();
21841
+ const compareLoose = require_compare_loose();
21842
+ const compareBuild = require_compare_build();
21843
+ const sort = require_sort();
21844
+ const rsort = require_rsort();
21845
+ const gt = require_gt();
21846
+ const lt = require_lt();
21847
+ const eq = require_eq();
21848
+ const neq = require_neq();
21849
+ const gte = require_gte();
21850
+ const lte = require_lte();
21851
+ const cmp = require_cmp();
21852
+ const coerce = require_coerce();
21853
+ const Comparator = require_comparator();
21854
+ const Range = require_range();
21855
+ const satisfies = require_satisfies();
21856
+ const toComparators = require_to_comparators();
21857
+ const maxSatisfying = require_max_satisfying();
21858
+ const minSatisfying = require_min_satisfying();
21859
+ const minVersion = require_min_version();
21860
+ const validRange = require_valid$1();
21861
+ const outside = require_outside();
21862
+ const gtr = require_gtr();
21863
+ const ltr = require_ltr();
21864
+ const intersects = require_intersects();
21865
+ const simplifyRange = require_simplify();
21866
+ const subset = require_subset();
21867
+ module.exports = {
21868
+ parse,
21869
+ valid,
21870
+ clean,
21871
+ inc,
21872
+ diff,
21873
+ major,
21874
+ minor,
21875
+ patch,
21876
+ prerelease,
21877
+ compare,
21878
+ rcompare,
21879
+ compareLoose,
21880
+ compareBuild,
21881
+ sort,
21882
+ rsort,
21883
+ gt,
21884
+ lt,
21885
+ eq,
21886
+ neq,
21887
+ gte,
21888
+ lte,
21889
+ cmp,
21890
+ coerce,
21891
+ Comparator,
21892
+ Range,
21893
+ satisfies,
21894
+ toComparators,
21895
+ maxSatisfying,
21896
+ minSatisfying,
21897
+ minVersion,
21898
+ validRange,
21899
+ outside,
21900
+ gtr,
21901
+ ltr,
21902
+ intersects,
21903
+ simplifyRange,
21904
+ subset,
21905
+ SemVer,
21906
+ re: internalRe.re,
21907
+ src: internalRe.src,
21908
+ tokens: internalRe.t,
21909
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
21910
+ RELEASE_TYPES: constants.RELEASE_TYPES,
21911
+ compareIdentifiers: identifiers.compareIdentifiers,
21912
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
21913
+ };
21914
+ } });
21915
+
21916
+ //#endregion
21917
+ //#region src/commands/doctor.ts
21918
+ var import_semver = require_picocolors$1.__toESM(require_semver());
21919
+ /**
21920
+ * Checks if two versions (or version and range) are compatible.
21921
+ * @param versionA - First version or range string.
21922
+ * @param versionB - Second version or range string.
21923
+ * @returns True if compatible, false otherwise.
21924
+ */
21925
+ function areVersionsCompatible(versionA, versionB) {
21926
+ if (versionA === versionB) return true;
21927
+ const options = { includePrerelease: true };
21928
+ if (import_semver.valid(versionA) && import_semver.validRange(versionB) && import_semver.satisfies(versionA, versionB, options)) return true;
21929
+ if (import_semver.valid(versionB) && import_semver.validRange(versionA) && import_semver.satisfies(versionB, versionA, options)) return true;
21930
+ return false;
21931
+ }
21932
+ /**
21933
+ * Performs health check on Hot Updater installation
21934
+ * @param cwd - Current working directory (optional)
21935
+ * @returns true if everything is healthy, or DoctorResult with details if there are issues
21936
+ */
21937
+ async function doctor(cwd = (0, __hot_updater_plugin_core.getCwd)()) {
21938
+ try {
21939
+ const packageResult = await readPackageUp({ cwd });
21940
+ if (!packageResult) return {
21941
+ success: false,
21942
+ error: "Could not find package.json"
21943
+ };
21944
+ const packageJson = packageResult.packageJson;
21945
+ const packageJsonPath = packageResult.path;
21946
+ const allDependencies = merge(packageJson.dependencies ?? {}, packageJson.devDependencies ?? {});
21947
+ const hotUpdaterVersion = allDependencies["hot-updater"];
21948
+ if (!hotUpdaterVersion) return {
21949
+ success: false,
21950
+ error: "hot-updater CLI not found. Please install it first."
21951
+ };
21952
+ const hotUpdaterPackages = Object.keys(allDependencies).filter((key) => key.startsWith("@hot-updater/"));
21953
+ const versionMismatches = [];
21954
+ for (const packageName of hotUpdaterPackages) {
21955
+ const currentVersion = allDependencies[packageName];
21956
+ if (hotUpdaterVersion && currentVersion && !areVersionsCompatible(currentVersion, hotUpdaterVersion)) versionMismatches.push({
21957
+ packageName,
21958
+ currentVersion,
21959
+ expectedVersion: hotUpdaterVersion
21960
+ });
21961
+ }
21962
+ const details = {
21963
+ hotUpdaterVersion,
21964
+ packageJsonPath,
21965
+ installedHotUpdaterPackages: hotUpdaterPackages
21966
+ };
21967
+ if (versionMismatches.length > 0) details.versionMismatches = versionMismatches;
21968
+ const hasIssues = versionMismatches.length > 0;
21969
+ if (hasIssues) return {
21970
+ success: false,
21971
+ details
21972
+ };
21973
+ return true;
21974
+ } catch (error) {
21975
+ return {
21976
+ success: false,
21977
+ error: error.message
21978
+ };
21979
+ }
21980
+ }
21981
+ /**
21982
+ * Fix version mismatches in package.json
21983
+ * This is a separate utility function for CLI usage
21984
+ */
21985
+ async function fixVersionMismatches(packageJsonPath, versionMismatches) {
21986
+ const packageResult = await fs.default.promises.readFile(packageJsonPath, "utf-8");
21987
+ if (!packageResult) throw new Error("Could not read package.json");
21988
+ const packageJson = JSON.parse(packageResult);
21989
+ for (const mismatch of versionMismatches) if (packageJson.dependencies?.[mismatch.packageName]) packageJson.dependencies[mismatch.packageName] = mismatch.expectedVersion;
21990
+ else if (packageJson.devDependencies?.[mismatch.packageName]) packageJson.devDependencies[mismatch.packageName] = mismatch.expectedVersion;
21991
+ const content = `${JSON.stringify(packageJson, null, 2)}\n`;
21992
+ await fs.default.promises.writeFile(packageJsonPath, content);
21993
+ }
21994
+ const handleDoctor = async ({ fix }) => {
21995
+ __clack_prompts.intro("Checking the health of Hot Updater.");
21996
+ const result = await doctor();
21997
+ if (result === true) {
21998
+ __clack_prompts.log.success("✅ All Hot Updater checks passed!");
21999
+ __clack_prompts.outro("Hot Updater is healthy.");
22000
+ return;
22001
+ }
22002
+ if (result.error) {
22003
+ __clack_prompts.log.error(result.error);
22004
+ __clack_prompts.outro("Doctor check failed.");
22005
+ return;
22006
+ }
22007
+ const { details } = result;
22008
+ if (details?.hotUpdaterVersion) __clack_prompts.log.info(`hot-updater CLI version: ${details.hotUpdaterVersion}`);
22009
+ if (details?.versionMismatches && details.versionMismatches.length > 0) {
22010
+ __clack_prompts.log.warn("Version mismatches found:");
22011
+ for (const mismatch of details.versionMismatches) __clack_prompts.log.error(`❌ ${mismatch.packageName}: ${mismatch.currentVersion} (expected ${mismatch.expectedVersion})`);
22012
+ if (fix && details.packageJsonPath) try {
22013
+ await fixVersionMismatches(details.packageJsonPath, details.versionMismatches);
22014
+ __clack_prompts.log.success("✅ Fixed version mismatches in package.json");
22015
+ __clack_prompts.log.info("Run your package manager to install the updated versions.");
22016
+ } catch (error) {
22017
+ __clack_prompts.log.error(`Failed to fix versions: ${error.message}`);
22018
+ }
22019
+ else if (!fix) {
22020
+ __clack_prompts.log.info("Run with --fix to automatically update versions.");
22021
+ process.exit(1);
22022
+ }
22023
+ }
22024
+ __clack_prompts.outro("Doctor check complete.");
22025
+ };
22026
+
22027
+ //#endregion
22028
+ //#region src/index.ts
22029
+ var import_picocolors = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
22030
+ var import_valid = require_picocolors$1.__toESM(require_valid$1());
22031
+ const DEFAULT_CHANNEL = "production";
22032
+ const program = new __commander_js_extra_typings.Command();
22033
+ program.name("hot-updater").description((0, __hot_updater_plugin_core.banner)(version)).version(version);
22034
+ program.command("init").description("Initialize Hot Updater").action(init);
22035
+ program.command("doctor").description("Check the health of Hot Updater").option("-f, --fix", "fix the issues", false).action(handleDoctor);
22036
+ const fingerprintCommand = program.command("fingerprint").description("Generate fingerprint");
22037
+ fingerprintCommand.action(handleFingerprint);
22038
+ fingerprintCommand.command("create").description("Create fingerprint").action(handleCreateFingerprint);
22039
+ const channelCommand = program.command("channel").description("Manage channels");
22040
+ channelCommand.action(handleChannel);
22041
+ channelCommand.command("set").description("Set the channel for Android (BuildConfig) and iOS (Info.plist)").argument("<channel>", "the channel to set").action(handleSetChannel);
21308
22042
  program.command("deploy").description("deploy a new version").addOption(new __commander_js_extra_typings.Option("-p, --platform <platform>", "specify the platform").choices(["ios", "android"])).addOption(new __commander_js_extra_typings.Option("-t, --target-app-version <targetAppVersion>", "specify the target app version (semver format e.g. 1.0.0, 1.x.x)").argParser((value) => {
21309
22043
  if (!(0, import_valid.default)(value)) {
21310
22044
  __clack_prompts.log.error("Invalid semver format (e.g. 1.0.0, 1.x.x)");
@@ -21322,9 +22056,8 @@ program.command("console").description("open the console").action(async () => {
21322
22056
  });
21323
22057
  });
21324
22058
  program.command("app-version").description("get the current app version").action(async () => {
21325
- const path$20 = (0, __hot_updater_plugin_core.getCwd)();
21326
- const androidVersion = await getDefaultTargetAppVersion(path$20, "android");
21327
- const iosVersion = await getDefaultTargetAppVersion(path$20, "ios");
22059
+ const androidVersion = await getNativeAppVersion("android");
22060
+ const iosVersion = await getNativeAppVersion("ios");
21328
22061
  __hot_updater_plugin_core.log.info(`Android version: ${androidVersion}`);
21329
22062
  __hot_updater_plugin_core.log.info(`iOS version: ${iosVersion}`);
21330
22063
  });