hot-updater 0.18.2 → 0.18.4
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 +1181 -449
- package/dist/index.js +1320 -585
- package/dist/plugins/babel.cjs +1 -1
- package/dist/plugins/babel.js +1 -1
- package/package.json +8 -9
package/dist/index.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { __commonJS, __require, __toESM, require_picocolors } from "./picocolors-OFVOrezl.js";
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import path from "path";
|
|
5
3
|
import { createServer } from "http";
|
|
6
4
|
import { Http2ServerRequest } from "http2";
|
|
7
5
|
import { Readable } from "stream";
|
|
8
6
|
import crypto from "crypto";
|
|
9
7
|
import app from "@hot-updater/console";
|
|
10
8
|
import { banner, createZipTargetFiles, getCwd, loadConfig, log, printBanner } from "@hot-updater/plugin-core";
|
|
9
|
+
import fs from "fs";
|
|
11
10
|
import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
|
|
12
11
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
13
|
-
import path
|
|
12
|
+
import path from "node:path";
|
|
14
13
|
import { fileURLToPath } from "node:url";
|
|
15
14
|
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
16
|
-
import
|
|
15
|
+
import fs$1, { constants } from "node:fs/promises";
|
|
17
16
|
import os, { constants as constants$1 } from "node:os";
|
|
18
|
-
import fs$
|
|
17
|
+
import fs$2, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
19
18
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
20
19
|
import net from "node:net";
|
|
20
|
+
import * as p$7 from "@clack/prompts";
|
|
21
|
+
import * as p$6 from "@clack/prompts";
|
|
22
|
+
import * as p$5 from "@clack/prompts";
|
|
21
23
|
import * as p$4 from "@clack/prompts";
|
|
22
24
|
import * as p$3 from "@clack/prompts";
|
|
23
25
|
import * as p$2 from "@clack/prompts";
|
|
24
26
|
import * as p$1 from "@clack/prompts";
|
|
25
27
|
import * as p from "@clack/prompts";
|
|
26
|
-
import fs$
|
|
28
|
+
import fs$3 from "fs/promises";
|
|
27
29
|
import { openRepository } from "es-git";
|
|
30
|
+
import path$1 from "path";
|
|
28
31
|
import { XcodeProject } from "@bacons/xcode";
|
|
29
32
|
import { globby, globbySync } from "globby";
|
|
30
33
|
import { nativeFingerprint } from "@rnef/tools";
|
|
@@ -484,11 +487,11 @@ var require_re = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_module
|
|
|
484
487
|
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
|
|
485
488
|
const debug$3 = require_debug();
|
|
486
489
|
exports = module.exports = {};
|
|
487
|
-
const re$
|
|
490
|
+
const re$4 = exports.re = [];
|
|
488
491
|
const safeRe = exports.safeRe = [];
|
|
489
492
|
const src = exports.src = [];
|
|
490
493
|
const safeSrc = exports.safeSrc = [];
|
|
491
|
-
const t$
|
|
494
|
+
const t$4 = exports.t = {};
|
|
492
495
|
let R = 0;
|
|
493
496
|
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
494
497
|
const safeRegexReplacements = [
|
|
@@ -504,55 +507,55 @@ var require_re = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_module
|
|
|
504
507
|
const safe = makeSafeRegex(value);
|
|
505
508
|
const index$1 = R++;
|
|
506
509
|
debug$3(name, index$1, value);
|
|
507
|
-
t$
|
|
510
|
+
t$4[name] = index$1;
|
|
508
511
|
src[index$1] = value;
|
|
509
512
|
safeSrc[index$1] = safe;
|
|
510
|
-
re$
|
|
513
|
+
re$4[index$1] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
511
514
|
safeRe[index$1] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
512
515
|
};
|
|
513
516
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
514
517
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
515
518
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
516
|
-
createToken("MAINVERSION", `(${src[t$
|
|
517
|
-
createToken("MAINVERSIONLOOSE", `(${src[t$
|
|
518
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t$
|
|
519
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$
|
|
520
|
-
createToken("PRERELEASE", `(?:-(${src[t$
|
|
521
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t$
|
|
519
|
+
createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
|
|
520
|
+
createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
521
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
|
|
522
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
523
|
+
createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
|
|
524
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
522
525
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
523
|
-
createToken("BUILD", `(?:\\+(${src[t$
|
|
524
|
-
createToken("FULLPLAIN", `v?${src[t$
|
|
525
|
-
createToken("FULL", `^${src[t$
|
|
526
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t$
|
|
527
|
-
createToken("LOOSE", `^${src[t$
|
|
526
|
+
createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
|
|
527
|
+
createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
|
|
528
|
+
createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
|
|
529
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
|
|
530
|
+
createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
|
|
528
531
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
529
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t$
|
|
530
|
-
createToken("XRANGEIDENTIFIER", `${src[t$
|
|
531
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$
|
|
532
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$
|
|
533
|
-
createToken("XRANGE", `^${src[t$
|
|
534
|
-
createToken("XRANGELOOSE", `^${src[t$
|
|
532
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
533
|
+
createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
534
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
|
|
535
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
|
|
536
|
+
createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
|
|
537
|
+
createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
535
538
|
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
536
|
-
createToken("COERCE", `${src[t$
|
|
537
|
-
createToken("COERCEFULL", src[t$
|
|
538
|
-
createToken("COERCERTL", src[t$
|
|
539
|
-
createToken("COERCERTLFULL", src[t$
|
|
539
|
+
createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
540
|
+
createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
|
|
541
|
+
createToken("COERCERTL", src[t$4.COERCE], true);
|
|
542
|
+
createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
|
|
540
543
|
createToken("LONETILDE", "(?:~>?)");
|
|
541
|
-
createToken("TILDETRIM", `(\\s*)${src[t$
|
|
544
|
+
createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
|
|
542
545
|
exports.tildeTrimReplace = "$1~";
|
|
543
|
-
createToken("TILDE", `^${src[t$
|
|
544
|
-
createToken("TILDELOOSE", `^${src[t$
|
|
546
|
+
createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
|
|
547
|
+
createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
545
548
|
createToken("LONECARET", "(?:\\^)");
|
|
546
|
-
createToken("CARETTRIM", `(\\s*)${src[t$
|
|
549
|
+
createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
|
|
547
550
|
exports.caretTrimReplace = "$1^";
|
|
548
|
-
createToken("CARET", `^${src[t$
|
|
549
|
-
createToken("CARETLOOSE", `^${src[t$
|
|
550
|
-
createToken("COMPARATORLOOSE", `^${src[t$
|
|
551
|
-
createToken("COMPARATOR", `^${src[t$
|
|
552
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t$
|
|
551
|
+
createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
|
|
552
|
+
createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
553
|
+
createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
|
|
554
|
+
createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
|
|
555
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
|
|
553
556
|
exports.comparatorTrimReplace = "$1$2$3";
|
|
554
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t$
|
|
555
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$
|
|
557
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
|
|
558
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
|
|
556
559
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
557
560
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
558
561
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
@@ -580,16 +583,16 @@ var require_identifiers = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/no
|
|
|
580
583
|
|
|
581
584
|
//#endregion
|
|
582
585
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
|
|
583
|
-
var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module) {
|
|
586
|
+
var require_semver$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module) {
|
|
584
587
|
const debug$2 = require_debug();
|
|
585
588
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
586
|
-
const { safeRe: re$
|
|
589
|
+
const { safeRe: re$3, t: t$3 } = require_re();
|
|
587
590
|
const parseOptions$2 = require_parse_options();
|
|
588
591
|
const { compareIdentifiers } = require_identifiers();
|
|
589
|
-
var SemVer$
|
|
592
|
+
var SemVer$15 = class SemVer$15 {
|
|
590
593
|
constructor(version$1, options) {
|
|
591
594
|
options = parseOptions$2(options);
|
|
592
|
-
if (version$1 instanceof SemVer$
|
|
595
|
+
if (version$1 instanceof SemVer$15) if (version$1.loose === !!options.loose && version$1.includePrerelease === !!options.includePrerelease) return version$1;
|
|
593
596
|
else version$1 = version$1.version;
|
|
594
597
|
else if (typeof version$1 !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version$1}".`);
|
|
595
598
|
if (version$1.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
@@ -597,7 +600,7 @@ var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mo
|
|
|
597
600
|
this.options = options;
|
|
598
601
|
this.loose = !!options.loose;
|
|
599
602
|
this.includePrerelease = !!options.includePrerelease;
|
|
600
|
-
const m = version$1.trim().match(options.loose ? re$
|
|
603
|
+
const m = version$1.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
|
|
601
604
|
if (!m) throw new TypeError(`Invalid Version: ${version$1}`);
|
|
602
605
|
this.raw = version$1;
|
|
603
606
|
this.major = +m[1];
|
|
@@ -627,19 +630,19 @@ var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mo
|
|
|
627
630
|
}
|
|
628
631
|
compare(other) {
|
|
629
632
|
debug$2("SemVer.compare", this.version, this.options, other);
|
|
630
|
-
if (!(other instanceof SemVer$
|
|
633
|
+
if (!(other instanceof SemVer$15)) {
|
|
631
634
|
if (typeof other === "string" && other === this.version) return 0;
|
|
632
|
-
other = new SemVer$
|
|
635
|
+
other = new SemVer$15(other, this.options);
|
|
633
636
|
}
|
|
634
637
|
if (other.version === this.version) return 0;
|
|
635
638
|
return this.compareMain(other) || this.comparePre(other);
|
|
636
639
|
}
|
|
637
640
|
compareMain(other) {
|
|
638
|
-
if (!(other instanceof SemVer$
|
|
641
|
+
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
639
642
|
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
640
643
|
}
|
|
641
644
|
comparePre(other) {
|
|
642
|
-
if (!(other instanceof SemVer$
|
|
645
|
+
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
643
646
|
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
644
647
|
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
645
648
|
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
@@ -656,7 +659,7 @@ var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mo
|
|
|
656
659
|
} while (++i$2);
|
|
657
660
|
}
|
|
658
661
|
compareBuild(other) {
|
|
659
|
-
if (!(other instanceof SemVer$
|
|
662
|
+
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
660
663
|
let i$2 = 0;
|
|
661
664
|
do {
|
|
662
665
|
const a$1 = this.build[i$2];
|
|
@@ -673,7 +676,7 @@ var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mo
|
|
|
673
676
|
if (release.startsWith("pre")) {
|
|
674
677
|
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
675
678
|
if (identifier) {
|
|
676
|
-
const match = `-${identifier}`.match(this.options.loose ? re$
|
|
679
|
+
const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
|
|
677
680
|
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
678
681
|
}
|
|
679
682
|
}
|
|
@@ -734,11 +737,11 @@ var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mo
|
|
|
734
737
|
}
|
|
735
738
|
}
|
|
736
739
|
if (identifier) {
|
|
737
|
-
let prerelease = [identifier, base];
|
|
738
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
740
|
+
let prerelease$2 = [identifier, base];
|
|
741
|
+
if (identifierBase === false) prerelease$2 = [identifier];
|
|
739
742
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
740
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
741
|
-
} else this.prerelease = prerelease;
|
|
743
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
|
|
744
|
+
} else this.prerelease = prerelease$2;
|
|
742
745
|
}
|
|
743
746
|
break;
|
|
744
747
|
}
|
|
@@ -749,75 +752,75 @@ var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mo
|
|
|
749
752
|
return this;
|
|
750
753
|
}
|
|
751
754
|
};
|
|
752
|
-
module.exports = SemVer$
|
|
755
|
+
module.exports = SemVer$15;
|
|
753
756
|
} });
|
|
754
757
|
|
|
755
758
|
//#endregion
|
|
756
759
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
|
|
757
760
|
var require_compare = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports, module) {
|
|
758
|
-
const SemVer$
|
|
759
|
-
const compare$
|
|
760
|
-
module.exports = compare$
|
|
761
|
+
const SemVer$14 = require_semver$1();
|
|
762
|
+
const compare$11 = (a$1, b, loose) => new SemVer$14(a$1, loose).compare(new SemVer$14(b, loose));
|
|
763
|
+
module.exports = compare$11;
|
|
761
764
|
} });
|
|
762
765
|
|
|
763
766
|
//#endregion
|
|
764
767
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
|
|
765
768
|
var require_eq = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports, module) {
|
|
766
|
-
const compare$
|
|
767
|
-
const eq$
|
|
768
|
-
module.exports = eq$
|
|
769
|
+
const compare$10 = require_compare();
|
|
770
|
+
const eq$2 = (a$1, b, loose) => compare$10(a$1, b, loose) === 0;
|
|
771
|
+
module.exports = eq$2;
|
|
769
772
|
} });
|
|
770
773
|
|
|
771
774
|
//#endregion
|
|
772
775
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
|
|
773
776
|
var require_neq = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports, module) {
|
|
774
|
-
const compare$
|
|
775
|
-
const neq$
|
|
776
|
-
module.exports = neq$
|
|
777
|
+
const compare$9 = require_compare();
|
|
778
|
+
const neq$2 = (a$1, b, loose) => compare$9(a$1, b, loose) !== 0;
|
|
779
|
+
module.exports = neq$2;
|
|
777
780
|
} });
|
|
778
781
|
|
|
779
782
|
//#endregion
|
|
780
783
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
|
|
781
784
|
var require_gt = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports, module) {
|
|
782
|
-
const compare$
|
|
783
|
-
const gt$
|
|
784
|
-
module.exports = gt$
|
|
785
|
+
const compare$8 = require_compare();
|
|
786
|
+
const gt$4 = (a$1, b, loose) => compare$8(a$1, b, loose) > 0;
|
|
787
|
+
module.exports = gt$4;
|
|
785
788
|
} });
|
|
786
789
|
|
|
787
790
|
//#endregion
|
|
788
791
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
|
|
789
792
|
var require_gte = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports, module) {
|
|
790
|
-
const compare$
|
|
791
|
-
const gte$
|
|
792
|
-
module.exports = gte$
|
|
793
|
+
const compare$7 = require_compare();
|
|
794
|
+
const gte$3 = (a$1, b, loose) => compare$7(a$1, b, loose) >= 0;
|
|
795
|
+
module.exports = gte$3;
|
|
793
796
|
} });
|
|
794
797
|
|
|
795
798
|
//#endregion
|
|
796
799
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
|
|
797
800
|
var require_lt = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports, module) {
|
|
798
|
-
const compare$
|
|
799
|
-
const lt$
|
|
800
|
-
module.exports = lt$
|
|
801
|
+
const compare$6 = require_compare();
|
|
802
|
+
const lt$3 = (a$1, b, loose) => compare$6(a$1, b, loose) < 0;
|
|
803
|
+
module.exports = lt$3;
|
|
801
804
|
} });
|
|
802
805
|
|
|
803
806
|
//#endregion
|
|
804
807
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
|
|
805
808
|
var require_lte = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports, module) {
|
|
806
|
-
const compare = require_compare();
|
|
807
|
-
const lte$
|
|
808
|
-
module.exports = lte$
|
|
809
|
+
const compare$5 = require_compare();
|
|
810
|
+
const lte$3 = (a$1, b, loose) => compare$5(a$1, b, loose) <= 0;
|
|
811
|
+
module.exports = lte$3;
|
|
809
812
|
} });
|
|
810
813
|
|
|
811
814
|
//#endregion
|
|
812
815
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
|
|
813
816
|
var require_cmp = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
814
|
-
const eq = require_eq();
|
|
815
|
-
const neq = require_neq();
|
|
816
|
-
const gt = require_gt();
|
|
817
|
-
const gte = require_gte();
|
|
818
|
-
const lt = require_lt();
|
|
819
|
-
const lte = require_lte();
|
|
820
|
-
const cmp$
|
|
817
|
+
const eq$1 = require_eq();
|
|
818
|
+
const neq$1 = require_neq();
|
|
819
|
+
const gt$3 = require_gt();
|
|
820
|
+
const gte$2 = require_gte();
|
|
821
|
+
const lt$2 = require_lt();
|
|
822
|
+
const lte$2 = require_lte();
|
|
823
|
+
const cmp$2 = (a$1, op, b, loose) => {
|
|
821
824
|
switch (op) {
|
|
822
825
|
case "===":
|
|
823
826
|
if (typeof a$1 === "object") a$1 = a$1.version;
|
|
@@ -829,69 +832,69 @@ var require_cmp = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modul
|
|
|
829
832
|
return a$1 !== b;
|
|
830
833
|
case "":
|
|
831
834
|
case "=":
|
|
832
|
-
case "==": return eq(a$1, b, loose);
|
|
833
|
-
case "!=": return neq(a$1, b, loose);
|
|
834
|
-
case ">": return gt(a$1, b, loose);
|
|
835
|
-
case ">=": return gte(a$1, b, loose);
|
|
836
|
-
case "<": return lt(a$1, b, loose);
|
|
837
|
-
case "<=": return lte(a$1, b, loose);
|
|
835
|
+
case "==": return eq$1(a$1, b, loose);
|
|
836
|
+
case "!=": return neq$1(a$1, b, loose);
|
|
837
|
+
case ">": return gt$3(a$1, b, loose);
|
|
838
|
+
case ">=": return gte$2(a$1, b, loose);
|
|
839
|
+
case "<": return lt$2(a$1, b, loose);
|
|
840
|
+
case "<=": return lte$2(a$1, b, loose);
|
|
838
841
|
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
839
842
|
}
|
|
840
843
|
};
|
|
841
|
-
module.exports = cmp$
|
|
844
|
+
module.exports = cmp$2;
|
|
842
845
|
} });
|
|
843
846
|
|
|
844
847
|
//#endregion
|
|
845
848
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
|
|
846
849
|
var require_comparator = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
847
|
-
const ANY = Symbol("SemVer ANY");
|
|
848
|
-
var Comparator$
|
|
850
|
+
const ANY$2 = Symbol("SemVer ANY");
|
|
851
|
+
var Comparator$4 = class Comparator$4 {
|
|
849
852
|
static get ANY() {
|
|
850
|
-
return ANY;
|
|
853
|
+
return ANY$2;
|
|
851
854
|
}
|
|
852
855
|
constructor(comp, options) {
|
|
853
856
|
options = parseOptions$1(options);
|
|
854
|
-
if (comp instanceof Comparator$
|
|
857
|
+
if (comp instanceof Comparator$4) if (comp.loose === !!options.loose) return comp;
|
|
855
858
|
else comp = comp.value;
|
|
856
859
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
857
860
|
debug$1("comparator", comp, options);
|
|
858
861
|
this.options = options;
|
|
859
862
|
this.loose = !!options.loose;
|
|
860
863
|
this.parse(comp);
|
|
861
|
-
if (this.semver === ANY) this.value = "";
|
|
864
|
+
if (this.semver === ANY$2) this.value = "";
|
|
862
865
|
else this.value = this.operator + this.semver.version;
|
|
863
866
|
debug$1("comp", this);
|
|
864
867
|
}
|
|
865
868
|
parse(comp) {
|
|
866
|
-
const r = this.options.loose ? re$
|
|
869
|
+
const r = this.options.loose ? re$2[t$2.COMPARATORLOOSE] : re$2[t$2.COMPARATOR];
|
|
867
870
|
const m = comp.match(r);
|
|
868
871
|
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
869
872
|
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
870
873
|
if (this.operator === "=") this.operator = "";
|
|
871
|
-
if (!m[2]) this.semver = ANY;
|
|
872
|
-
else this.semver = new SemVer$
|
|
874
|
+
if (!m[2]) this.semver = ANY$2;
|
|
875
|
+
else this.semver = new SemVer$13(m[2], this.options.loose);
|
|
873
876
|
}
|
|
874
877
|
toString() {
|
|
875
878
|
return this.value;
|
|
876
879
|
}
|
|
877
880
|
test(version$1) {
|
|
878
881
|
debug$1("Comparator.test", version$1, this.options.loose);
|
|
879
|
-
if (this.semver === ANY || version$1 === ANY) return true;
|
|
882
|
+
if (this.semver === ANY$2 || version$1 === ANY$2) return true;
|
|
880
883
|
if (typeof version$1 === "string") try {
|
|
881
|
-
version$1 = new SemVer$
|
|
884
|
+
version$1 = new SemVer$13(version$1, this.options);
|
|
882
885
|
} catch (er) {
|
|
883
886
|
return false;
|
|
884
887
|
}
|
|
885
|
-
return cmp(version$1, this.operator, this.semver, this.options);
|
|
888
|
+
return cmp$1(version$1, this.operator, this.semver, this.options);
|
|
886
889
|
}
|
|
887
890
|
intersects(comp, options) {
|
|
888
|
-
if (!(comp instanceof Comparator$
|
|
891
|
+
if (!(comp instanceof Comparator$4)) throw new TypeError("a Comparator is required");
|
|
889
892
|
if (this.operator === "") {
|
|
890
893
|
if (this.value === "") return true;
|
|
891
|
-
return new Range$
|
|
894
|
+
return new Range$11(comp.value, options).test(this.value);
|
|
892
895
|
} else if (comp.operator === "") {
|
|
893
896
|
if (comp.value === "") return true;
|
|
894
|
-
return new Range$
|
|
897
|
+
return new Range$11(this.value, options).test(comp.semver);
|
|
895
898
|
}
|
|
896
899
|
options = parseOptions$1(options);
|
|
897
900
|
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
@@ -899,30 +902,30 @@ var require_comparator = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/nod
|
|
|
899
902
|
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
900
903
|
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
901
904
|
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
902
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
903
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
905
|
+
if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
906
|
+
if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
904
907
|
return false;
|
|
905
908
|
}
|
|
906
909
|
};
|
|
907
|
-
module.exports = Comparator$
|
|
910
|
+
module.exports = Comparator$4;
|
|
908
911
|
const parseOptions$1 = require_parse_options();
|
|
909
|
-
const { safeRe: re$
|
|
910
|
-
const cmp = require_cmp();
|
|
912
|
+
const { safeRe: re$2, t: t$2 } = require_re();
|
|
913
|
+
const cmp$1 = require_cmp();
|
|
911
914
|
const debug$1 = require_debug();
|
|
912
|
-
const SemVer$
|
|
913
|
-
const Range$
|
|
915
|
+
const SemVer$13 = require_semver$1();
|
|
916
|
+
const Range$11 = require_range();
|
|
914
917
|
} });
|
|
915
918
|
|
|
916
919
|
//#endregion
|
|
917
920
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
|
|
918
921
|
var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports, module) {
|
|
919
922
|
const SPACE_CHARACTERS = /\s+/g;
|
|
920
|
-
var Range$
|
|
923
|
+
var Range$10 = class Range$10 {
|
|
921
924
|
constructor(range, options) {
|
|
922
925
|
options = parseOptions(options);
|
|
923
|
-
if (range instanceof Range$
|
|
924
|
-
else return new Range$
|
|
925
|
-
if (range instanceof Comparator) {
|
|
926
|
+
if (range instanceof Range$10) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
927
|
+
else return new Range$10(range.raw, options);
|
|
928
|
+
if (range instanceof Comparator$3) {
|
|
926
929
|
this.raw = range.value;
|
|
927
930
|
this.set = [[range]];
|
|
928
931
|
this.formatted = void 0;
|
|
@@ -973,23 +976,23 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
973
976
|
const cached = cache$1.get(memoKey);
|
|
974
977
|
if (cached) return cached;
|
|
975
978
|
const loose = this.options.loose;
|
|
976
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
979
|
+
const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
|
|
977
980
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
978
981
|
debug("hyphen replace", range);
|
|
979
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
982
|
+
range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
|
|
980
983
|
debug("comparator trim", range);
|
|
981
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
984
|
+
range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
|
|
982
985
|
debug("tilde trim", range);
|
|
983
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
986
|
+
range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
|
|
984
987
|
debug("caret trim", range);
|
|
985
988
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
986
989
|
if (loose) rangeList = rangeList.filter((comp) => {
|
|
987
990
|
debug("loose invalid filter", comp, this.options);
|
|
988
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
991
|
+
return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
|
|
989
992
|
});
|
|
990
993
|
debug("range list", rangeList);
|
|
991
994
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
992
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
995
|
+
const comparators = rangeList.map((comp) => new Comparator$3(comp, this.options));
|
|
993
996
|
for (const comp of comparators) {
|
|
994
997
|
if (isNullSet(comp)) return [comp];
|
|
995
998
|
rangeMap.set(comp.value, comp);
|
|
@@ -1000,7 +1003,7 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1000
1003
|
return result;
|
|
1001
1004
|
}
|
|
1002
1005
|
intersects(range, options) {
|
|
1003
|
-
if (!(range instanceof Range$
|
|
1006
|
+
if (!(range instanceof Range$10)) throw new TypeError("a Range is required");
|
|
1004
1007
|
return this.set.some((thisComparators) => {
|
|
1005
1008
|
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1006
1009
|
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
@@ -1014,7 +1017,7 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1014
1017
|
test(version$1) {
|
|
1015
1018
|
if (!version$1) return false;
|
|
1016
1019
|
if (typeof version$1 === "string") try {
|
|
1017
|
-
version$1 = new SemVer$
|
|
1020
|
+
version$1 = new SemVer$12(version$1, this.options);
|
|
1018
1021
|
} catch (er) {
|
|
1019
1022
|
return false;
|
|
1020
1023
|
}
|
|
@@ -1022,14 +1025,14 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1022
1025
|
return false;
|
|
1023
1026
|
}
|
|
1024
1027
|
};
|
|
1025
|
-
module.exports = Range$
|
|
1028
|
+
module.exports = Range$10;
|
|
1026
1029
|
const LRU = require_lrucache();
|
|
1027
1030
|
const cache$1 = new LRU();
|
|
1028
1031
|
const parseOptions = require_parse_options();
|
|
1029
|
-
const Comparator = require_comparator();
|
|
1032
|
+
const Comparator$3 = require_comparator();
|
|
1030
1033
|
const debug = require_debug();
|
|
1031
|
-
const SemVer$
|
|
1032
|
-
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
1034
|
+
const SemVer$12 = require_semver$1();
|
|
1035
|
+
const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
1033
1036
|
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1034
1037
|
const isNullSet = (c$1) => c$1.value === "<0.0.0-0";
|
|
1035
1038
|
const isAny = (c$1) => c$1.value === "";
|
|
@@ -1062,17 +1065,17 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1062
1065
|
return comp.trim().split(/\s+/).map((c$1) => replaceTilde(c$1, options)).join(" ");
|
|
1063
1066
|
};
|
|
1064
1067
|
const replaceTilde = (comp, options) => {
|
|
1065
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1066
|
-
return comp.replace(r, (_, M, m, p$
|
|
1067
|
-
debug("tilde", comp, _, M, m, p$
|
|
1068
|
+
const r = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
|
|
1069
|
+
return comp.replace(r, (_, M, m, p$8, pr) => {
|
|
1070
|
+
debug("tilde", comp, _, M, m, p$8, pr);
|
|
1068
1071
|
let ret;
|
|
1069
1072
|
if (isX(M)) ret = "";
|
|
1070
1073
|
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1071
|
-
else if (isX(p$
|
|
1074
|
+
else if (isX(p$8)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1072
1075
|
else if (pr) {
|
|
1073
1076
|
debug("replaceTilde pr", pr);
|
|
1074
|
-
ret = `>=${M}.${m}.${p$
|
|
1075
|
-
} else ret = `>=${M}.${m}.${p$
|
|
1077
|
+
ret = `>=${M}.${m}.${p$8}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1078
|
+
} else ret = `>=${M}.${m}.${p$8} <${M}.${+m + 1}.0-0`;
|
|
1076
1079
|
debug("tilde return", ret);
|
|
1077
1080
|
return ret;
|
|
1078
1081
|
});
|
|
@@ -1082,25 +1085,25 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1082
1085
|
};
|
|
1083
1086
|
const replaceCaret = (comp, options) => {
|
|
1084
1087
|
debug("caret", comp, options);
|
|
1085
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1088
|
+
const r = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
|
|
1086
1089
|
const z = options.includePrerelease ? "-0" : "";
|
|
1087
|
-
return comp.replace(r, (_, M, m, p$
|
|
1088
|
-
debug("caret", comp, _, M, m, p$
|
|
1090
|
+
return comp.replace(r, (_, M, m, p$8, pr) => {
|
|
1091
|
+
debug("caret", comp, _, M, m, p$8, pr);
|
|
1089
1092
|
let ret;
|
|
1090
1093
|
if (isX(M)) ret = "";
|
|
1091
1094
|
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1092
|
-
else if (isX(p$
|
|
1095
|
+
else if (isX(p$8)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1093
1096
|
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1094
1097
|
else if (pr) {
|
|
1095
1098
|
debug("replaceCaret pr", pr);
|
|
1096
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p$
|
|
1097
|
-
else ret = `>=${M}.${m}.${p$
|
|
1098
|
-
else ret = `>=${M}.${m}.${p$
|
|
1099
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p$8}-${pr} <${M}.${m}.${+p$8 + 1}-0`;
|
|
1100
|
+
else ret = `>=${M}.${m}.${p$8}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1101
|
+
else ret = `>=${M}.${m}.${p$8}-${pr} <${+M + 1}.0.0-0`;
|
|
1099
1102
|
} else {
|
|
1100
1103
|
debug("no pr");
|
|
1101
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p$
|
|
1102
|
-
else ret = `>=${M}.${m}.${p$
|
|
1103
|
-
else ret = `>=${M}.${m}.${p$
|
|
1104
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p$8}${z} <${M}.${m}.${+p$8 + 1}-0`;
|
|
1105
|
+
else ret = `>=${M}.${m}.${p$8}${z} <${M}.${+m + 1}.0-0`;
|
|
1106
|
+
else ret = `>=${M}.${m}.${p$8} <${+M + 1}.0.0-0`;
|
|
1104
1107
|
}
|
|
1105
1108
|
debug("caret return", ret);
|
|
1106
1109
|
return ret;
|
|
@@ -1112,12 +1115,12 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1112
1115
|
};
|
|
1113
1116
|
const replaceXRange = (comp, options) => {
|
|
1114
1117
|
comp = comp.trim();
|
|
1115
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1116
|
-
return comp.replace(r, (ret, gtlt, M, m, p$
|
|
1117
|
-
debug("xRange", comp, ret, gtlt, M, m, p$
|
|
1118
|
+
const r = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
|
|
1119
|
+
return comp.replace(r, (ret, gtlt, M, m, p$8, pr) => {
|
|
1120
|
+
debug("xRange", comp, ret, gtlt, M, m, p$8, pr);
|
|
1118
1121
|
const xM = isX(M);
|
|
1119
1122
|
const xm = xM || isX(m);
|
|
1120
|
-
const xp = xm || isX(p$
|
|
1123
|
+
const xp = xm || isX(p$8);
|
|
1121
1124
|
const anyX = xp;
|
|
1122
1125
|
if (gtlt === "=" && anyX) gtlt = "";
|
|
1123
1126
|
pr = options.includePrerelease ? "-0" : "";
|
|
@@ -1125,16 +1128,16 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1125
1128
|
else ret = "*";
|
|
1126
1129
|
else if (gtlt && anyX) {
|
|
1127
1130
|
if (xm) m = 0;
|
|
1128
|
-
p$
|
|
1131
|
+
p$8 = 0;
|
|
1129
1132
|
if (gtlt === ">") {
|
|
1130
1133
|
gtlt = ">=";
|
|
1131
1134
|
if (xm) {
|
|
1132
1135
|
M = +M + 1;
|
|
1133
1136
|
m = 0;
|
|
1134
|
-
p$
|
|
1137
|
+
p$8 = 0;
|
|
1135
1138
|
} else {
|
|
1136
1139
|
m = +m + 1;
|
|
1137
|
-
p$
|
|
1140
|
+
p$8 = 0;
|
|
1138
1141
|
}
|
|
1139
1142
|
} else if (gtlt === "<=") {
|
|
1140
1143
|
gtlt = "<";
|
|
@@ -1142,7 +1145,7 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1142
1145
|
else m = +m + 1;
|
|
1143
1146
|
}
|
|
1144
1147
|
if (gtlt === "<") pr = "-0";
|
|
1145
|
-
ret = `${gtlt + M}.${m}.${p$
|
|
1148
|
+
ret = `${gtlt + M}.${m}.${p$8}${pr}`;
|
|
1146
1149
|
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1147
1150
|
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1148
1151
|
debug("xRange return", ret);
|
|
@@ -1151,11 +1154,11 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1151
1154
|
};
|
|
1152
1155
|
const replaceStars = (comp, options) => {
|
|
1153
1156
|
debug("replaceStars", comp, options);
|
|
1154
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
1157
|
+
return comp.trim().replace(re$1[t$1.STAR], "");
|
|
1155
1158
|
};
|
|
1156
1159
|
const replaceGTE0 = (comp, options) => {
|
|
1157
1160
|
debug("replaceGTE0", comp, options);
|
|
1158
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1161
|
+
return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
|
|
1159
1162
|
};
|
|
1160
1163
|
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1161
1164
|
if (isX(fM)) from = "";
|
|
@@ -1176,7 +1179,7 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1176
1179
|
if (version$1.prerelease.length && !options.includePrerelease) {
|
|
1177
1180
|
for (let i$2 = 0; i$2 < set.length; i$2++) {
|
|
1178
1181
|
debug(set[i$2].semver);
|
|
1179
|
-
if (set[i$2].semver === Comparator.ANY) continue;
|
|
1182
|
+
if (set[i$2].semver === Comparator$3.ANY) continue;
|
|
1180
1183
|
if (set[i$2].semver.prerelease.length > 0) {
|
|
1181
1184
|
const allowed = set[i$2].semver;
|
|
1182
1185
|
if (allowed.major === version$1.major && allowed.minor === version$1.minor && allowed.patch === version$1.patch) return true;
|
|
@@ -1191,15 +1194,15 @@ var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_mod
|
|
|
1191
1194
|
//#endregion
|
|
1192
1195
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
|
|
1193
1196
|
var require_valid$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1194
|
-
const Range = require_range();
|
|
1195
|
-
const validRange = (range, options) => {
|
|
1197
|
+
const Range$9 = require_range();
|
|
1198
|
+
const validRange$1 = (range, options) => {
|
|
1196
1199
|
try {
|
|
1197
|
-
return new Range(range, options).range || "*";
|
|
1200
|
+
return new Range$9(range, options).range || "*";
|
|
1198
1201
|
} catch (er) {
|
|
1199
1202
|
return null;
|
|
1200
1203
|
}
|
|
1201
1204
|
};
|
|
1202
|
-
module.exports = validRange;
|
|
1205
|
+
module.exports = validRange$1;
|
|
1203
1206
|
} });
|
|
1204
1207
|
|
|
1205
1208
|
//#endregion
|
|
@@ -1207,7 +1210,7 @@ var require_valid$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_m
|
|
|
1207
1210
|
let isDockerCached;
|
|
1208
1211
|
function hasDockerEnv() {
|
|
1209
1212
|
try {
|
|
1210
|
-
fs$
|
|
1213
|
+
fs$2.statSync("/.dockerenv");
|
|
1211
1214
|
return true;
|
|
1212
1215
|
} catch {
|
|
1213
1216
|
return false;
|
|
@@ -1215,7 +1218,7 @@ function hasDockerEnv() {
|
|
|
1215
1218
|
}
|
|
1216
1219
|
function hasDockerCGroup() {
|
|
1217
1220
|
try {
|
|
1218
|
-
return fs$
|
|
1221
|
+
return fs$2.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
1219
1222
|
} catch {
|
|
1220
1223
|
return false;
|
|
1221
1224
|
}
|
|
@@ -1230,7 +1233,7 @@ function isDocker() {
|
|
|
1230
1233
|
let cachedResult;
|
|
1231
1234
|
const hasContainerEnv = () => {
|
|
1232
1235
|
try {
|
|
1233
|
-
fs$
|
|
1236
|
+
fs$2.statSync("/run/.containerenv");
|
|
1234
1237
|
return true;
|
|
1235
1238
|
} catch {
|
|
1236
1239
|
return false;
|
|
@@ -1250,7 +1253,7 @@ const isWsl = () => {
|
|
|
1250
1253
|
return true;
|
|
1251
1254
|
}
|
|
1252
1255
|
try {
|
|
1253
|
-
return fs$
|
|
1256
|
+
return fs$2.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
1254
1257
|
} catch {
|
|
1255
1258
|
return false;
|
|
1256
1259
|
}
|
|
@@ -1403,8 +1406,8 @@ async function defaultBrowser() {
|
|
|
1403
1406
|
|
|
1404
1407
|
//#endregion
|
|
1405
1408
|
//#region ../../node_modules/.pnpm/open@10.1.0/node_modules/open/index.js
|
|
1406
|
-
const __dirname$1 = path
|
|
1407
|
-
const localXdgOpenPath = path
|
|
1409
|
+
const __dirname$1 = path.dirname(fileURLToPath(import.meta.url));
|
|
1410
|
+
const localXdgOpenPath = path.join(__dirname$1, "xdg-open");
|
|
1408
1411
|
const { platform: platform$1, arch } = process$1;
|
|
1409
1412
|
/**
|
|
1410
1413
|
Get the mount point for fixed drives in WSL.
|
|
@@ -1420,11 +1423,11 @@ const getWslDrivesMountPoint = (() => {
|
|
|
1420
1423
|
const configFilePath = "/etc/wsl.conf";
|
|
1421
1424
|
let isConfigFileExists = false;
|
|
1422
1425
|
try {
|
|
1423
|
-
await
|
|
1426
|
+
await fs$1.access(configFilePath, constants.F_OK);
|
|
1424
1427
|
isConfigFileExists = true;
|
|
1425
1428
|
} catch {}
|
|
1426
1429
|
if (!isConfigFileExists) return defaultMountPoint;
|
|
1427
|
-
const configContent = await
|
|
1430
|
+
const configContent = await fs$1.readFile(configFilePath, { encoding: "utf8" });
|
|
1428
1431
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
1429
1432
|
if (!configMountPoint) return defaultMountPoint;
|
|
1430
1433
|
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
@@ -1522,7 +1525,7 @@ const baseOpen = async (options) => {
|
|
|
1522
1525
|
const isBundled = !__dirname$1 || __dirname$1 === "/";
|
|
1523
1526
|
let exeLocalXdgOpen = false;
|
|
1524
1527
|
try {
|
|
1525
|
-
await
|
|
1528
|
+
await fs$1.access(localXdgOpenPath, constants.X_OK);
|
|
1526
1529
|
exeLocalXdgOpen = true;
|
|
1527
1530
|
} catch {}
|
|
1528
1531
|
const useSystemXdgOpen = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen);
|
|
@@ -1622,38 +1625,60 @@ async function isPortReachable(port, { host, timeout = 1e3 } = {}) {
|
|
|
1622
1625
|
}
|
|
1623
1626
|
|
|
1624
1627
|
//#endregion
|
|
1625
|
-
//#region
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
directory = path$1.dirname(directory);
|
|
1628
|
+
//#region src/utils/getFileHash.ts
|
|
1629
|
+
const getFileHashFromFile = async (filepath) => {
|
|
1630
|
+
try {
|
|
1631
|
+
const fileBuffer = await fs$3.readFile(filepath).catch((error) => {
|
|
1632
|
+
console.error("Error reading the file:", error);
|
|
1633
|
+
throw error;
|
|
1634
|
+
});
|
|
1635
|
+
const hash = crypto.createHash("sha256");
|
|
1636
|
+
hash.update(fileBuffer);
|
|
1637
|
+
const fileHash = hash.digest("hex");
|
|
1638
|
+
return fileHash;
|
|
1639
|
+
} catch (error) {
|
|
1640
|
+
console.error("Error fetching or processing the file:", error);
|
|
1641
|
+
throw error;
|
|
1640
1642
|
}
|
|
1641
|
-
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
if (directory === stopAt || directory === root) break;
|
|
1654
|
-
directory = path$1.dirname(directory);
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
//#endregion
|
|
1646
|
+
//#region src/utils/git.ts
|
|
1647
|
+
const getLatestGitCommit = async () => {
|
|
1648
|
+
try {
|
|
1649
|
+
const repo = await openRepository(getCwd());
|
|
1650
|
+
const headSha = repo.revparse("HEAD").from;
|
|
1651
|
+
if (headSha) return repo.getCommit(headSha);
|
|
1652
|
+
return null;
|
|
1653
|
+
} catch (error) {
|
|
1654
|
+
return null;
|
|
1655
1655
|
}
|
|
1656
|
-
}
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#region src/utils/version/getAndroidVersion.ts
|
|
1660
|
+
var import_valid$4 = __toESM(require_valid$1());
|
|
1661
|
+
const getAndroidVersionFromAppBuildGradle = async () => {
|
|
1662
|
+
const buildGradlePath = path$1.join(getCwd(), "android", "app", "build.gradle");
|
|
1663
|
+
try {
|
|
1664
|
+
const buildGradleContent = await fs$3.readFile(buildGradlePath, "utf8");
|
|
1665
|
+
const versionNameMatch = buildGradleContent.match(/versionName\s+['"]([^"]+)['"]/);
|
|
1666
|
+
return versionNameMatch?.[1] ?? null;
|
|
1667
|
+
} catch (error) {
|
|
1668
|
+
return null;
|
|
1669
|
+
}
|
|
1670
|
+
};
|
|
1671
|
+
const AndroidVersionParsers = { "app-build-gradle": getAndroidVersionFromAppBuildGradle };
|
|
1672
|
+
const getAndroidVersion = async ({ parser, validateWithSemver = false }) => {
|
|
1673
|
+
const parsers = Array.isArray(parser) ? parser : [parser];
|
|
1674
|
+
for (const parserKey of parsers) {
|
|
1675
|
+
const parsedVersion = await AndroidVersionParsers[parserKey]();
|
|
1676
|
+
if (!parsedVersion) continue;
|
|
1677
|
+
if (validateWithSemver && !(0, import_valid$4.default)(parsedVersion)) continue;
|
|
1678
|
+
return parsedVersion;
|
|
1679
|
+
}
|
|
1680
|
+
return null;
|
|
1681
|
+
};
|
|
1657
1682
|
|
|
1658
1683
|
//#endregion
|
|
1659
1684
|
//#region ../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js
|
|
@@ -1814,7 +1839,7 @@ var require_dom = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
1814
1839
|
};
|
|
1815
1840
|
}
|
|
1816
1841
|
function copy(src$1, dest) {
|
|
1817
|
-
for (var p$
|
|
1842
|
+
for (var p$8 in src$1) if (Object.prototype.hasOwnProperty.call(src$1, p$8)) dest[p$8] = src$1[p$8];
|
|
1818
1843
|
}
|
|
1819
1844
|
/**
|
|
1820
1845
|
^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
|
|
@@ -1823,11 +1848,11 @@ var require_dom = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
1823
1848
|
function _extends(Class, Super) {
|
|
1824
1849
|
var pt = Class.prototype;
|
|
1825
1850
|
if (!(pt instanceof Super)) {
|
|
1826
|
-
function t$
|
|
1827
|
-
t$
|
|
1828
|
-
t$
|
|
1829
|
-
copy(pt, t$
|
|
1830
|
-
Class.prototype = pt = t$
|
|
1851
|
+
function t$5() {}
|
|
1852
|
+
t$5.prototype = Super.prototype;
|
|
1853
|
+
t$5 = new t$5();
|
|
1854
|
+
copy(pt, t$5);
|
|
1855
|
+
Class.prototype = pt = t$5;
|
|
1831
1856
|
}
|
|
1832
1857
|
if (pt.constructor != Class) {
|
|
1833
1858
|
if (typeof Class != "function") console.error("unknown Class:" + Class);
|
|
@@ -1912,15 +1937,15 @@ var require_dom = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
1912
1937
|
_updateLiveList(this);
|
|
1913
1938
|
}
|
|
1914
1939
|
function _updateLiveList(list) {
|
|
1915
|
-
var inc = list._node._inc || list._node.ownerDocument._inc;
|
|
1916
|
-
if (list._inc !== inc) {
|
|
1940
|
+
var inc$2 = list._node._inc || list._node.ownerDocument._inc;
|
|
1941
|
+
if (list._inc !== inc$2) {
|
|
1917
1942
|
var ls = list._refresh(list._node);
|
|
1918
1943
|
__set__(list, "length", ls.length);
|
|
1919
1944
|
if (!list.$$length || ls.length < list.$$length) {
|
|
1920
1945
|
for (var i$2 = ls.length; i$2 in list; i$2++) if (Object.prototype.hasOwnProperty.call(list, i$2)) delete list[i$2];
|
|
1921
1946
|
}
|
|
1922
1947
|
copy(ls, list);
|
|
1923
|
-
list._inc = inc;
|
|
1948
|
+
list._inc = inc$2;
|
|
1924
1949
|
}
|
|
1925
1950
|
}
|
|
1926
1951
|
LiveNodeList.prototype.item = function(i$2) {
|
|
@@ -5236,10 +5261,10 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5236
5261
|
var domBuilder = this.domBuilder;
|
|
5237
5262
|
domBuilder.startDocument();
|
|
5238
5263
|
_copy(defaultNSMap, defaultNSMap = {});
|
|
5239
|
-
parse$
|
|
5264
|
+
parse$13(source, defaultNSMap, entityMap, domBuilder, this.errorHandler);
|
|
5240
5265
|
domBuilder.endDocument();
|
|
5241
5266
|
} };
|
|
5242
|
-
function parse$
|
|
5267
|
+
function parse$13(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
|
|
5243
5268
|
function fixedFromCharCode(code$1) {
|
|
5244
5269
|
if (code$1 > 65535) {
|
|
5245
5270
|
code$1 -= 65536;
|
|
@@ -5264,13 +5289,13 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5264
5289
|
start = end$1;
|
|
5265
5290
|
}
|
|
5266
5291
|
}
|
|
5267
|
-
function position$1(p$
|
|
5268
|
-
while (p$
|
|
5292
|
+
function position$1(p$8, m) {
|
|
5293
|
+
while (p$8 >= lineEnd && (m = linePattern.exec(source))) {
|
|
5269
5294
|
lineStart = m.index;
|
|
5270
5295
|
lineEnd = lineStart + m[0].length;
|
|
5271
5296
|
locator.lineNumber++;
|
|
5272
5297
|
}
|
|
5273
|
-
locator.columnNumber = p$
|
|
5298
|
+
locator.columnNumber = p$8 - lineStart + 1;
|
|
5274
5299
|
}
|
|
5275
5300
|
var lineStart = 0;
|
|
5276
5301
|
var lineEnd = 0;
|
|
@@ -5359,10 +5384,10 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5359
5384
|
else appendText(Math.max(tagStart, start) + 1);
|
|
5360
5385
|
}
|
|
5361
5386
|
}
|
|
5362
|
-
function copyLocator(f, t$
|
|
5363
|
-
t$
|
|
5364
|
-
t$
|
|
5365
|
-
return t$
|
|
5387
|
+
function copyLocator(f, t$5) {
|
|
5388
|
+
t$5.lineNumber = f.lineNumber;
|
|
5389
|
+
t$5.columnNumber = f.columnNumber;
|
|
5390
|
+
return t$5;
|
|
5366
5391
|
}
|
|
5367
5392
|
/**
|
|
5368
5393
|
* @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
|
|
@@ -5380,14 +5405,14 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5380
5405
|
}
|
|
5381
5406
|
var attrName;
|
|
5382
5407
|
var value;
|
|
5383
|
-
var p$
|
|
5408
|
+
var p$8 = ++start;
|
|
5384
5409
|
var s = S_TAG;
|
|
5385
5410
|
while (true) {
|
|
5386
|
-
var c$1 = source.charAt(p$
|
|
5411
|
+
var c$1 = source.charAt(p$8);
|
|
5387
5412
|
switch (c$1) {
|
|
5388
5413
|
case "=":
|
|
5389
5414
|
if (s === S_ATTR) {
|
|
5390
|
-
attrName = source.slice(start, p$
|
|
5415
|
+
attrName = source.slice(start, p$8);
|
|
5391
5416
|
s = S_EQ;
|
|
5392
5417
|
} else if (s === S_ATTR_SPACE) s = S_EQ;
|
|
5393
5418
|
else throw new Error("attribute equal must after attrName");
|
|
@@ -5397,26 +5422,26 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5397
5422
|
if (s === S_EQ || s === S_ATTR) {
|
|
5398
5423
|
if (s === S_ATTR) {
|
|
5399
5424
|
errorHandler.warning("attribute value must after \"=\"");
|
|
5400
|
-
attrName = source.slice(start, p$
|
|
5425
|
+
attrName = source.slice(start, p$8);
|
|
5401
5426
|
}
|
|
5402
|
-
start = p$
|
|
5403
|
-
p$
|
|
5404
|
-
if (p$
|
|
5405
|
-
value = source.slice(start, p$
|
|
5427
|
+
start = p$8 + 1;
|
|
5428
|
+
p$8 = source.indexOf(c$1, start);
|
|
5429
|
+
if (p$8 > 0) {
|
|
5430
|
+
value = source.slice(start, p$8);
|
|
5406
5431
|
addAttribute(attrName, value, start - 1);
|
|
5407
5432
|
s = S_ATTR_END;
|
|
5408
5433
|
} else throw new Error("attribute value no end '" + c$1 + "' match");
|
|
5409
5434
|
} else if (s == S_ATTR_NOQUOT_VALUE) {
|
|
5410
|
-
value = source.slice(start, p$
|
|
5435
|
+
value = source.slice(start, p$8);
|
|
5411
5436
|
addAttribute(attrName, value, start);
|
|
5412
5437
|
errorHandler.warning("attribute \"" + attrName + "\" missed start quot(" + c$1 + ")!!");
|
|
5413
|
-
start = p$
|
|
5438
|
+
start = p$8 + 1;
|
|
5414
5439
|
s = S_ATTR_END;
|
|
5415
5440
|
} else throw new Error("attribute value must after \"=\"");
|
|
5416
5441
|
break;
|
|
5417
5442
|
case "/":
|
|
5418
5443
|
switch (s) {
|
|
5419
|
-
case S_TAG: el.setTagName(source.slice(start, p$
|
|
5444
|
+
case S_TAG: el.setTagName(source.slice(start, p$8));
|
|
5420
5445
|
case S_ATTR_END:
|
|
5421
5446
|
case S_TAG_SPACE:
|
|
5422
5447
|
case S_TAG_CLOSE:
|
|
@@ -5432,17 +5457,17 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5432
5457
|
break;
|
|
5433
5458
|
case "":
|
|
5434
5459
|
errorHandler.error("unexpected end of input");
|
|
5435
|
-
if (s == S_TAG) el.setTagName(source.slice(start, p$
|
|
5436
|
-
return p$
|
|
5460
|
+
if (s == S_TAG) el.setTagName(source.slice(start, p$8));
|
|
5461
|
+
return p$8;
|
|
5437
5462
|
case ">":
|
|
5438
5463
|
switch (s) {
|
|
5439
|
-
case S_TAG: el.setTagName(source.slice(start, p$
|
|
5464
|
+
case S_TAG: el.setTagName(source.slice(start, p$8));
|
|
5440
5465
|
case S_ATTR_END:
|
|
5441
5466
|
case S_TAG_SPACE:
|
|
5442
5467
|
case S_TAG_CLOSE: break;
|
|
5443
5468
|
case S_ATTR_NOQUOT_VALUE:
|
|
5444
5469
|
case S_ATTR:
|
|
5445
|
-
value = source.slice(start, p$
|
|
5470
|
+
value = source.slice(start, p$8);
|
|
5446
5471
|
if (value.slice(-1) === "/") {
|
|
5447
5472
|
el.closed = true;
|
|
5448
5473
|
value = value.slice(0, -1);
|
|
@@ -5459,19 +5484,19 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5459
5484
|
break;
|
|
5460
5485
|
case S_EQ: throw new Error("attribute value missed!!");
|
|
5461
5486
|
}
|
|
5462
|
-
return p$
|
|
5487
|
+
return p$8;
|
|
5463
5488
|
case "": c$1 = " ";
|
|
5464
5489
|
default: if (c$1 <= " ") switch (s) {
|
|
5465
5490
|
case S_TAG:
|
|
5466
|
-
el.setTagName(source.slice(start, p$
|
|
5491
|
+
el.setTagName(source.slice(start, p$8));
|
|
5467
5492
|
s = S_TAG_SPACE;
|
|
5468
5493
|
break;
|
|
5469
5494
|
case S_ATTR:
|
|
5470
|
-
attrName = source.slice(start, p$
|
|
5495
|
+
attrName = source.slice(start, p$8);
|
|
5471
5496
|
s = S_ATTR_SPACE;
|
|
5472
5497
|
break;
|
|
5473
5498
|
case S_ATTR_NOQUOT_VALUE:
|
|
5474
|
-
var value = source.slice(start, p$
|
|
5499
|
+
var value = source.slice(start, p$8);
|
|
5475
5500
|
errorHandler.warning("attribute \"" + value + "\" missed quot(\")!!");
|
|
5476
5501
|
addAttribute(attrName, value, start);
|
|
5477
5502
|
case S_ATTR_END:
|
|
@@ -5483,22 +5508,22 @@ var require_sax = __commonJS({ "../../node_modules/.pnpm/@xmldom+xmldom@0.8.10/n
|
|
|
5483
5508
|
var tagName = el.tagName;
|
|
5484
5509
|
if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) errorHandler.warning("attribute \"" + attrName + "\" missed value!! \"" + attrName + "\" instead2!!");
|
|
5485
5510
|
addAttribute(attrName, attrName, start);
|
|
5486
|
-
start = p$
|
|
5511
|
+
start = p$8;
|
|
5487
5512
|
s = S_ATTR;
|
|
5488
5513
|
break;
|
|
5489
5514
|
case S_ATTR_END: errorHandler.warning("attribute space is required\"" + attrName + "\"!!");
|
|
5490
5515
|
case S_TAG_SPACE:
|
|
5491
5516
|
s = S_ATTR;
|
|
5492
|
-
start = p$
|
|
5517
|
+
start = p$8;
|
|
5493
5518
|
break;
|
|
5494
5519
|
case S_EQ:
|
|
5495
5520
|
s = S_ATTR_NOQUOT_VALUE;
|
|
5496
|
-
start = p$
|
|
5521
|
+
start = p$8;
|
|
5497
5522
|
break;
|
|
5498
5523
|
case S_TAG_CLOSE: throw new Error("elements closed character '/' and '>' must be connected to");
|
|
5499
5524
|
}
|
|
5500
5525
|
}
|
|
5501
|
-
p$
|
|
5526
|
+
p$8++;
|
|
5502
5527
|
}
|
|
5503
5528
|
}
|
|
5504
5529
|
/**
|
|
@@ -5947,7 +5972,7 @@ var require_parse$3 = __commonJS({ "../../node_modules/.pnpm/plist@3.1.0/node_mo
|
|
|
5947
5972
|
/**
|
|
5948
5973
|
* Module exports.
|
|
5949
5974
|
*/
|
|
5950
|
-
exports.parse = parse$
|
|
5975
|
+
exports.parse = parse$12;
|
|
5951
5976
|
var TEXT_NODE = 3;
|
|
5952
5977
|
var CDATA_NODE = 4;
|
|
5953
5978
|
var COMMENT_NODE = 8;
|
|
@@ -5986,12 +6011,12 @@ var require_parse$3 = __commonJS({ "../../node_modules/.pnpm/plist@3.1.0/node_mo
|
|
|
5986
6011
|
* @returns {Mixed} the decoded value from the Plist XML
|
|
5987
6012
|
* @api public
|
|
5988
6013
|
*/
|
|
5989
|
-
function parse$
|
|
6014
|
+
function parse$12(xml) {
|
|
5990
6015
|
var doc = new DOMParser().parseFromString(xml);
|
|
5991
6016
|
invariant(doc.documentElement.nodeName === "plist", "malformed document. First element should be <plist>");
|
|
5992
|
-
var plist$
|
|
5993
|
-
if (plist$
|
|
5994
|
-
return plist$
|
|
6017
|
+
var plist$2 = parsePlistXML(doc.documentElement);
|
|
6018
|
+
if (plist$2.length == 1) plist$2 = plist$2[0];
|
|
6019
|
+
return plist$2;
|
|
5995
6020
|
}
|
|
5996
6021
|
/**
|
|
5997
6022
|
* Convert an XML based plist document into a JSON representation.
|
|
@@ -9245,83 +9270,101 @@ var require_plist = __commonJS({ "../../node_modules/.pnpm/plist@3.1.0/node_modu
|
|
|
9245
9270
|
} });
|
|
9246
9271
|
|
|
9247
9272
|
//#endregion
|
|
9248
|
-
//#region src/utils/
|
|
9249
|
-
|
|
9250
|
-
const
|
|
9273
|
+
//#region src/utils/getIosAppTargetDirectoryName.ts
|
|
9274
|
+
const getIosAppTargetDirectoryName = () => {
|
|
9275
|
+
const iosDirectory = path$1.join(getCwd(), "ios");
|
|
9276
|
+
const [xcodeprojPath] = globbySync("*.xcodeproj/project.pbxproj", {
|
|
9277
|
+
cwd: iosDirectory,
|
|
9278
|
+
absolute: false,
|
|
9279
|
+
onlyFiles: true
|
|
9280
|
+
});
|
|
9281
|
+
return xcodeprojPath?.split(".")?.[0] ?? null;
|
|
9282
|
+
};
|
|
9283
|
+
|
|
9284
|
+
//#endregion
|
|
9285
|
+
//#region src/utils/version/getIOSVersion.ts
|
|
9286
|
+
var import_plist$1 = __toESM(require_plist());
|
|
9287
|
+
var import_valid$3 = __toESM(require_valid$1());
|
|
9288
|
+
const isFileExist = async (path$5) => {
|
|
9251
9289
|
try {
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9290
|
+
await fs$3.access(path$5);
|
|
9291
|
+
return true;
|
|
9292
|
+
} catch {
|
|
9293
|
+
return false;
|
|
9294
|
+
}
|
|
9295
|
+
};
|
|
9296
|
+
const getIOSVersionFromInfoPlist = async () => {
|
|
9297
|
+
try {
|
|
9298
|
+
const iosAppTargetDirectory = getIosAppTargetDirectoryName();
|
|
9299
|
+
if (!iosAppTargetDirectory) return null;
|
|
9300
|
+
const plistPath = path$1.join(getCwd(), "ios", iosAppTargetDirectory, "Info.plist");
|
|
9301
|
+
if (!await isFileExist(plistPath)) return null;
|
|
9302
|
+
const file = await fs$3.readFile(plistPath, "utf8");
|
|
9303
|
+
const data = import_plist$1.default.parse(file);
|
|
9259
9304
|
return data["CFBundleShortVersionString"] ?? null;
|
|
9260
9305
|
} catch {
|
|
9261
9306
|
return null;
|
|
9262
9307
|
}
|
|
9263
9308
|
};
|
|
9264
|
-
const
|
|
9265
|
-
const buildGradlePath = path.join(cwd, "android", "app", "build.gradle");
|
|
9309
|
+
const getIOSVersionFromXcodeProject = async () => {
|
|
9266
9310
|
try {
|
|
9267
|
-
const
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9311
|
+
const [xcodeprojPath] = globbySync("*.xcodeproj/project.pbxproj", {
|
|
9312
|
+
cwd: path$1.join(getCwd(), "ios"),
|
|
9313
|
+
absolute: true,
|
|
9314
|
+
onlyFiles: true
|
|
9315
|
+
});
|
|
9316
|
+
if (!xcodeprojPath) return null;
|
|
9317
|
+
const project = XcodeProject.open(xcodeprojPath).toJSON();
|
|
9318
|
+
const objects = project.objects ?? {};
|
|
9319
|
+
for (const key of Object.keys(objects)) {
|
|
9320
|
+
const obj = objects[key];
|
|
9321
|
+
if (obj?.isa === "XCBuildConfiguration" && obj?.name === "Release" && typeof obj.buildSettings?.MARKETING_VERSION === "string") return obj.buildSettings.MARKETING_VERSION;
|
|
9322
|
+
}
|
|
9271
9323
|
return null;
|
|
9324
|
+
} catch {
|
|
9325
|
+
return null;
|
|
9326
|
+
}
|
|
9327
|
+
};
|
|
9328
|
+
const IOSVersionParsers = {
|
|
9329
|
+
xcodeproj: getIOSVersionFromXcodeProject,
|
|
9330
|
+
"info-plist": getIOSVersionFromInfoPlist
|
|
9331
|
+
};
|
|
9332
|
+
const getIOSVersion = async ({ parser, validateWithSemver = false }) => {
|
|
9333
|
+
const parsers = Array.isArray(parser) ? parser : [parser];
|
|
9334
|
+
for (const parserKey of parsers) {
|
|
9335
|
+
const parsedVersion = await IOSVersionParsers[parserKey]();
|
|
9336
|
+
if (!parsedVersion) continue;
|
|
9337
|
+
if (validateWithSemver && !(0, import_valid$3.default)(parsedVersion)) continue;
|
|
9338
|
+
return parsedVersion;
|
|
9272
9339
|
}
|
|
9340
|
+
return null;
|
|
9273
9341
|
};
|
|
9274
|
-
|
|
9342
|
+
|
|
9343
|
+
//#endregion
|
|
9344
|
+
//#region src/utils/version/getDefaultTargetAppVersion.ts
|
|
9345
|
+
var import_valid$2 = __toESM(require_valid$1());
|
|
9346
|
+
const getDefaultTargetAppVersion = async (platform$2) => {
|
|
9275
9347
|
let version$1 = null;
|
|
9276
9348
|
switch (platform$2) {
|
|
9277
9349
|
case "ios":
|
|
9278
|
-
version$1 = await getIOSVersion
|
|
9350
|
+
version$1 = await getIOSVersion({ parser: "info-plist" });
|
|
9279
9351
|
break;
|
|
9280
9352
|
case "android":
|
|
9281
|
-
version$1 = await getAndroidVersion
|
|
9353
|
+
version$1 = await getAndroidVersion({ parser: "app-build-gradle" });
|
|
9282
9354
|
break;
|
|
9283
9355
|
}
|
|
9284
9356
|
if (!version$1) return null;
|
|
9357
|
+
const isAcceptableFormat = /^\d+\.\d+$/.test(version$1) || (0, import_valid$2.default)(version$1);
|
|
9358
|
+
if (!isAcceptableFormat) return null;
|
|
9285
9359
|
const dotCount = version$1.split(".").length - 1;
|
|
9286
9360
|
if (dotCount === 1) version$1 = `${version$1}.x`;
|
|
9287
9361
|
return version$1;
|
|
9288
9362
|
};
|
|
9289
9363
|
|
|
9290
|
-
//#endregion
|
|
9291
|
-
//#region src/utils/getFileHash.ts
|
|
9292
|
-
const getFileHashFromFile = async (filepath) => {
|
|
9293
|
-
try {
|
|
9294
|
-
const fileBuffer = await fs$2.readFile(filepath).catch((error) => {
|
|
9295
|
-
console.error("Error reading the file:", error);
|
|
9296
|
-
throw error;
|
|
9297
|
-
});
|
|
9298
|
-
const hash = crypto.createHash("sha256");
|
|
9299
|
-
hash.update(fileBuffer);
|
|
9300
|
-
const fileHash = hash.digest("hex");
|
|
9301
|
-
return fileHash;
|
|
9302
|
-
} catch (error) {
|
|
9303
|
-
console.error("Error fetching or processing the file:", error);
|
|
9304
|
-
throw error;
|
|
9305
|
-
}
|
|
9306
|
-
};
|
|
9307
|
-
|
|
9308
|
-
//#endregion
|
|
9309
|
-
//#region src/utils/git.ts
|
|
9310
|
-
const getLatestGitCommit = async () => {
|
|
9311
|
-
try {
|
|
9312
|
-
const repo = await openRepository(getCwd());
|
|
9313
|
-
const headSha = repo.revparse("HEAD").from;
|
|
9314
|
-
if (headSha) return repo.getCommit(headSha);
|
|
9315
|
-
return null;
|
|
9316
|
-
} catch (error) {
|
|
9317
|
-
return null;
|
|
9318
|
-
}
|
|
9319
|
-
};
|
|
9320
|
-
|
|
9321
9364
|
//#endregion
|
|
9322
9365
|
//#region src/prompts/getPlatform.ts
|
|
9323
9366
|
const getPlatform = async (message) => {
|
|
9324
|
-
const platform$2 = await p$
|
|
9367
|
+
const platform$2 = await p$7.select({
|
|
9325
9368
|
message,
|
|
9326
9369
|
initialValue: "ios",
|
|
9327
9370
|
options: [{
|
|
@@ -9332,7 +9375,6 @@ const getPlatform = async (message) => {
|
|
|
9332
9375
|
value: "android"
|
|
9333
9376
|
}]
|
|
9334
9377
|
});
|
|
9335
|
-
if (typeof platform$2 !== "string") throw new Error("Invalid platform");
|
|
9336
9378
|
return platform$2;
|
|
9337
9379
|
};
|
|
9338
9380
|
|
|
@@ -9341,15 +9383,15 @@ const getPlatform = async (message) => {
|
|
|
9341
9383
|
async function getBundleZipTargets(basePath, files) {
|
|
9342
9384
|
const bundleCandidates = {};
|
|
9343
9385
|
const targets = [];
|
|
9344
|
-
const normalizeToPosix = (filePath) => filePath.split(path.sep).join("/");
|
|
9345
|
-
const normalizedBase = normalizeToPosix(path.normalize(basePath));
|
|
9386
|
+
const normalizeToPosix = (filePath) => filePath.split(path$1.sep).join("/");
|
|
9387
|
+
const normalizedBase = normalizeToPosix(path$1.normalize(basePath));
|
|
9346
9388
|
const getRelative = (file) => {
|
|
9347
|
-
const normalizedFile = normalizeToPosix(path.normalize(file));
|
|
9389
|
+
const normalizedFile = normalizeToPosix(path$1.normalize(file));
|
|
9348
9390
|
if (normalizedFile.startsWith(`${normalizedBase}/`)) return normalizedFile.slice(normalizedBase.length + 1);
|
|
9349
9391
|
return normalizedFile;
|
|
9350
9392
|
};
|
|
9351
9393
|
for (const file of files) {
|
|
9352
|
-
const normalizedFile = normalizeToPosix(path.normalize(file));
|
|
9394
|
+
const normalizedFile = normalizeToPosix(path$1.normalize(file));
|
|
9353
9395
|
if (normalizedFile.endsWith(".map")) continue;
|
|
9354
9396
|
const relative = getRelative(normalizedFile);
|
|
9355
9397
|
if (relative.endsWith(".bundle") || relative.endsWith(".bundle.hbc")) {
|
|
@@ -9373,72 +9415,46 @@ async function getBundleZipTargets(basePath, files) {
|
|
|
9373
9415
|
return targets;
|
|
9374
9416
|
}
|
|
9375
9417
|
|
|
9376
|
-
//#endregion
|
|
9377
|
-
//#region src/utils/getNativeAppVersion.ts
|
|
9378
|
-
var import_plist$1 = __toESM(require_plist());
|
|
9379
|
-
const getNativeAppVersion = async (platform$2) => {
|
|
9380
|
-
switch (platform$2) {
|
|
9381
|
-
case "ios": {
|
|
9382
|
-
const iosVersion = await getIOSVersion();
|
|
9383
|
-
if (iosVersion) return iosVersion;
|
|
9384
|
-
const plistVersion = await getPlistVersion();
|
|
9385
|
-
if (plistVersion) return plistVersion;
|
|
9386
|
-
return null;
|
|
9387
|
-
}
|
|
9388
|
-
case "android": return getAndroidVersion();
|
|
9389
|
-
default: return null;
|
|
9390
|
-
}
|
|
9391
|
-
};
|
|
9392
|
-
const getIOSVersion = async () => {
|
|
9393
|
-
try {
|
|
9394
|
-
const [xcodeprojPath] = globbySync("*.xcodeproj/project.pbxproj", {
|
|
9395
|
-
cwd: path.join(getCwd(), "ios"),
|
|
9396
|
-
absolute: true,
|
|
9397
|
-
onlyFiles: true
|
|
9398
|
-
});
|
|
9399
|
-
if (!xcodeprojPath) return null;
|
|
9400
|
-
const project = XcodeProject.open(xcodeprojPath).toJSON();
|
|
9401
|
-
const objects = project.objects ?? {};
|
|
9402
|
-
for (const key of Object.keys(objects)) {
|
|
9403
|
-
const obj = objects[key];
|
|
9404
|
-
if (obj?.isa === "XCBuildConfiguration" && obj?.name === "Release" && typeof obj.buildSettings?.MARKETING_VERSION === "string") return obj.buildSettings.MARKETING_VERSION;
|
|
9405
|
-
}
|
|
9406
|
-
return null;
|
|
9407
|
-
} catch {
|
|
9408
|
-
return null;
|
|
9409
|
-
}
|
|
9410
|
-
};
|
|
9411
|
-
const getPlistVersion = async () => {
|
|
9412
|
-
try {
|
|
9413
|
-
const plistPath = await findUp("Info.plist", {
|
|
9414
|
-
cwd: path.join(getCwd(), "ios"),
|
|
9415
|
-
type: "file"
|
|
9416
|
-
});
|
|
9417
|
-
if (!plistPath) return null;
|
|
9418
|
-
const file = await fs$2.readFile(plistPath, "utf8");
|
|
9419
|
-
const data = import_plist$1.default.parse(file);
|
|
9420
|
-
return data["CFBundleShortVersionString"] ?? null;
|
|
9421
|
-
} catch {
|
|
9422
|
-
return null;
|
|
9423
|
-
}
|
|
9424
|
-
};
|
|
9425
|
-
const getAndroidVersion = async () => {
|
|
9426
|
-
const buildGradlePath = path.join(getCwd(), "android", "app", "build.gradle");
|
|
9427
|
-
try {
|
|
9428
|
-
const buildGradleContent = await fs$2.readFile(buildGradlePath, "utf8");
|
|
9429
|
-
const versionNameMatch = buildGradleContent.match(/versionName\s+"([^"]+)"/);
|
|
9430
|
-
return versionNameMatch?.[1] ?? null;
|
|
9431
|
-
} catch (error) {
|
|
9432
|
-
return null;
|
|
9433
|
-
}
|
|
9434
|
-
};
|
|
9435
|
-
|
|
9436
9418
|
//#endregion
|
|
9437
9419
|
//#region ../../node_modules/.pnpm/tsdown@0.12.6_typescript@5.8.3/node_modules/tsdown/esm-shims.js
|
|
9438
9420
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
9439
|
-
const getDirname = () => path
|
|
9421
|
+
const getDirname = () => path.dirname(getFilename());
|
|
9440
9422
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
9441
9423
|
|
|
9424
|
+
//#endregion
|
|
9425
|
+
//#region ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
|
|
9426
|
+
const toPath$2 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
9427
|
+
async function findUp(name, { cwd = process$1.cwd(), type: type$1 = "file", stopAt } = {}) {
|
|
9428
|
+
let directory = path.resolve(toPath$2(cwd) ?? "");
|
|
9429
|
+
const { root } = path.parse(directory);
|
|
9430
|
+
stopAt = path.resolve(directory, toPath$2(stopAt ?? root));
|
|
9431
|
+
const isAbsoluteName = path.isAbsolute(name);
|
|
9432
|
+
while (directory) {
|
|
9433
|
+
const filePath = isAbsoluteName ? name : path.join(directory, name);
|
|
9434
|
+
try {
|
|
9435
|
+
const stats = await fs$1.stat(filePath);
|
|
9436
|
+
if (type$1 === "file" && stats.isFile() || type$1 === "directory" && stats.isDirectory()) return filePath;
|
|
9437
|
+
} catch {}
|
|
9438
|
+
if (directory === stopAt || directory === root) break;
|
|
9439
|
+
directory = path.dirname(directory);
|
|
9440
|
+
}
|
|
9441
|
+
}
|
|
9442
|
+
function findUpSync(name, { cwd = process$1.cwd(), type: type$1 = "file", stopAt } = {}) {
|
|
9443
|
+
let directory = path.resolve(toPath$2(cwd) ?? "");
|
|
9444
|
+
const { root } = path.parse(directory);
|
|
9445
|
+
stopAt = path.resolve(directory, toPath$2(stopAt) ?? root);
|
|
9446
|
+
const isAbsoluteName = path.isAbsolute(name);
|
|
9447
|
+
while (directory) {
|
|
9448
|
+
const filePath = isAbsoluteName ? name : path.join(directory, name);
|
|
9449
|
+
try {
|
|
9450
|
+
const stats = fs$2.statSync(filePath, { throwIfNoEntry: false });
|
|
9451
|
+
if (type$1 === "file" && stats?.isFile() || type$1 === "directory" && stats?.isDirectory()) return filePath;
|
|
9452
|
+
} catch {}
|
|
9453
|
+
if (directory === stopAt || directory === root) break;
|
|
9454
|
+
directory = path.dirname(directory);
|
|
9455
|
+
}
|
|
9456
|
+
}
|
|
9457
|
+
|
|
9442
9458
|
//#endregion
|
|
9443
9459
|
//#region ../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js
|
|
9444
9460
|
var require_js_tokens = __commonJS({ "../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js"(exports) {
|
|
@@ -9463,8 +9479,8 @@ var require_js_tokens = __commonJS({ "../../node_modules/.pnpm/js-tokens@4.0.0/n
|
|
|
9463
9479
|
} });
|
|
9464
9480
|
|
|
9465
9481
|
//#endregion
|
|
9466
|
-
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.
|
|
9467
|
-
var require_identifier = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.
|
|
9482
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.27.1/node_modules/@babel/helper-validator-identifier/lib/identifier.js
|
|
9483
|
+
var require_identifier = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.27.1/node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports) {
|
|
9468
9484
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9469
9485
|
exports.isIdentifierChar = isIdentifierChar;
|
|
9470
9486
|
exports.isIdentifierName = isIdentifierName;
|
|
@@ -10440,8 +10456,8 @@ var require_identifier = __commonJS({ "../../node_modules/.pnpm/@babel+helper-va
|
|
|
10440
10456
|
} });
|
|
10441
10457
|
|
|
10442
10458
|
//#endregion
|
|
10443
|
-
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.
|
|
10444
|
-
var require_keyword = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.
|
|
10459
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.27.1/node_modules/@babel/helper-validator-identifier/lib/keyword.js
|
|
10460
|
+
var require_keyword = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.27.1/node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports) {
|
|
10445
10461
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10446
10462
|
exports.isKeyword = isKeyword;
|
|
10447
10463
|
exports.isReservedWord = isReservedWord;
|
|
@@ -10520,8 +10536,8 @@ var require_keyword = __commonJS({ "../../node_modules/.pnpm/@babel+helper-valid
|
|
|
10520
10536
|
} });
|
|
10521
10537
|
|
|
10522
10538
|
//#endregion
|
|
10523
|
-
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.
|
|
10524
|
-
var require_lib$2 = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.
|
|
10539
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.27.1/node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
10540
|
+
var require_lib$2 = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.27.1/node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) {
|
|
10525
10541
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10526
10542
|
Object.defineProperty(exports, "isIdentifierChar", {
|
|
10527
10543
|
enumerable: true,
|
|
@@ -10576,14 +10592,14 @@ var require_lib$2 = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validat
|
|
|
10576
10592
|
} });
|
|
10577
10593
|
|
|
10578
10594
|
//#endregion
|
|
10579
|
-
//#region ../../node_modules/.pnpm/@babel+code-frame@7.
|
|
10580
|
-
var require_lib$1 = __commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.
|
|
10595
|
+
//#region ../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js
|
|
10596
|
+
var require_lib$1 = __commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"(exports) {
|
|
10581
10597
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10582
|
-
var picocolors$
|
|
10598
|
+
var picocolors$3 = require_picocolors();
|
|
10583
10599
|
var jsTokens = require_js_tokens();
|
|
10584
10600
|
var helperValidatorIdentifier = require_lib$2();
|
|
10585
10601
|
function isColorSupported() {
|
|
10586
|
-
return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$
|
|
10602
|
+
return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$3.isColorSupported;
|
|
10587
10603
|
}
|
|
10588
10604
|
const compose = (f, g) => (v) => f(g(v));
|
|
10589
10605
|
function buildDefs(colors) {
|
|
@@ -10603,8 +10619,8 @@ var require_lib$1 = __commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.2
|
|
|
10603
10619
|
reset: colors.reset
|
|
10604
10620
|
};
|
|
10605
10621
|
}
|
|
10606
|
-
const defsOn = buildDefs(picocolors$
|
|
10607
|
-
const defsOff = buildDefs(picocolors$
|
|
10622
|
+
const defsOn = buildDefs(picocolors$3.createColors(true));
|
|
10623
|
+
const defsOff = buildDefs(picocolors$3.createColors(false));
|
|
10608
10624
|
function getDefs(enabled) {
|
|
10609
10625
|
return enabled ? defsOn : defsOff;
|
|
10610
10626
|
}
|
|
@@ -10846,39 +10862,39 @@ function parseJson(string, reviver, fileName) {
|
|
|
10846
10862
|
//#endregion
|
|
10847
10863
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
|
|
10848
10864
|
var require_parse$2 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js"(exports, module) {
|
|
10849
|
-
const SemVer = require_semver();
|
|
10850
|
-
const parse$
|
|
10851
|
-
if (version$1 instanceof SemVer) return version$1;
|
|
10865
|
+
const SemVer$11 = require_semver$1();
|
|
10866
|
+
const parse$11 = (version$1, options, throwErrors = false) => {
|
|
10867
|
+
if (version$1 instanceof SemVer$11) return version$1;
|
|
10852
10868
|
try {
|
|
10853
|
-
return new SemVer(version$1, options);
|
|
10869
|
+
return new SemVer$11(version$1, options);
|
|
10854
10870
|
} catch (er) {
|
|
10855
10871
|
if (!throwErrors) return null;
|
|
10856
10872
|
throw er;
|
|
10857
10873
|
}
|
|
10858
10874
|
};
|
|
10859
|
-
module.exports = parse$
|
|
10875
|
+
module.exports = parse$11;
|
|
10860
10876
|
} });
|
|
10861
10877
|
|
|
10862
10878
|
//#endregion
|
|
10863
10879
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js
|
|
10864
10880
|
var require_valid = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js"(exports, module) {
|
|
10865
|
-
const parse$
|
|
10866
|
-
const valid$
|
|
10867
|
-
const v = parse$
|
|
10881
|
+
const parse$10 = require_parse$2();
|
|
10882
|
+
const valid$2 = (version$1, options) => {
|
|
10883
|
+
const v = parse$10(version$1, options);
|
|
10868
10884
|
return v ? v.version : null;
|
|
10869
10885
|
};
|
|
10870
|
-
module.exports = valid$
|
|
10886
|
+
module.exports = valid$2;
|
|
10871
10887
|
} });
|
|
10872
10888
|
|
|
10873
10889
|
//#endregion
|
|
10874
10890
|
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
|
|
10875
10891
|
var require_clean = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js"(exports, module) {
|
|
10876
|
-
const parse$
|
|
10877
|
-
const clean = (version$1, options) => {
|
|
10878
|
-
const s = parse$
|
|
10892
|
+
const parse$9 = require_parse$2();
|
|
10893
|
+
const clean$1 = (version$1, options) => {
|
|
10894
|
+
const s = parse$9(version$1.trim().replace(/^[=v]+/, ""), options);
|
|
10879
10895
|
return s ? s.version : null;
|
|
10880
10896
|
};
|
|
10881
|
-
module.exports = clean;
|
|
10897
|
+
module.exports = clean$1;
|
|
10882
10898
|
} });
|
|
10883
10899
|
|
|
10884
10900
|
//#endregion
|
|
@@ -11738,18 +11754,18 @@ var require_parse$1 = __commonJS({ "../../node_modules/.pnpm/spdx-expression-par
|
|
|
11738
11754
|
index$1++;
|
|
11739
11755
|
}
|
|
11740
11756
|
function parseOperator(operator) {
|
|
11741
|
-
var t$
|
|
11742
|
-
if (t$
|
|
11757
|
+
var t$5 = token();
|
|
11758
|
+
if (t$5 && t$5.type === "OPERATOR" && operator === t$5.string) {
|
|
11743
11759
|
next();
|
|
11744
|
-
return t$
|
|
11760
|
+
return t$5.string;
|
|
11745
11761
|
}
|
|
11746
11762
|
}
|
|
11747
11763
|
function parseWith() {
|
|
11748
11764
|
if (parseOperator("WITH")) {
|
|
11749
|
-
var t$
|
|
11750
|
-
if (t$
|
|
11765
|
+
var t$5 = token();
|
|
11766
|
+
if (t$5 && t$5.type === "EXCEPTION") {
|
|
11751
11767
|
next();
|
|
11752
|
-
return t$
|
|
11768
|
+
return t$5.string;
|
|
11753
11769
|
}
|
|
11754
11770
|
throw new Error("Expected exception after `WITH`");
|
|
11755
11771
|
}
|
|
@@ -11757,25 +11773,25 @@ var require_parse$1 = __commonJS({ "../../node_modules/.pnpm/spdx-expression-par
|
|
|
11757
11773
|
function parseLicenseRef() {
|
|
11758
11774
|
var begin = index$1;
|
|
11759
11775
|
var string = "";
|
|
11760
|
-
var t$
|
|
11761
|
-
if (t$
|
|
11776
|
+
var t$5 = token();
|
|
11777
|
+
if (t$5.type === "DOCUMENTREF") {
|
|
11762
11778
|
next();
|
|
11763
|
-
string += "DocumentRef-" + t$
|
|
11779
|
+
string += "DocumentRef-" + t$5.string + ":";
|
|
11764
11780
|
if (!parseOperator(":")) throw new Error("Expected `:` after `DocumentRef-...`");
|
|
11765
11781
|
}
|
|
11766
|
-
t$
|
|
11767
|
-
if (t$
|
|
11782
|
+
t$5 = token();
|
|
11783
|
+
if (t$5.type === "LICENSEREF") {
|
|
11768
11784
|
next();
|
|
11769
|
-
string += "LicenseRef-" + t$
|
|
11785
|
+
string += "LicenseRef-" + t$5.string;
|
|
11770
11786
|
return { license: string };
|
|
11771
11787
|
}
|
|
11772
11788
|
index$1 = begin;
|
|
11773
11789
|
}
|
|
11774
11790
|
function parseLicense() {
|
|
11775
|
-
var t$
|
|
11776
|
-
if (t$
|
|
11791
|
+
var t$5 = token();
|
|
11792
|
+
if (t$5 && t$5.type === "LICENSE") {
|
|
11777
11793
|
next();
|
|
11778
|
-
var node$1 = { license: t$
|
|
11794
|
+
var node$1 = { license: t$5.string };
|
|
11779
11795
|
if (parseOperator("+")) node$1.plus = true;
|
|
11780
11796
|
var exception = parseWith();
|
|
11781
11797
|
if (exception) node$1.exception = exception;
|
|
@@ -11818,20 +11834,20 @@ var require_parse$1 = __commonJS({ "../../node_modules/.pnpm/spdx-expression-par
|
|
|
11818
11834
|
//#region ../../node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/index.js
|
|
11819
11835
|
var require_spdx_expression_parse = __commonJS({ "../../node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/index.js"(exports, module) {
|
|
11820
11836
|
var scan = require_scan();
|
|
11821
|
-
var parse$
|
|
11837
|
+
var parse$8 = require_parse$1();
|
|
11822
11838
|
module.exports = function(source) {
|
|
11823
|
-
return parse$
|
|
11839
|
+
return parse$8(scan(source));
|
|
11824
11840
|
};
|
|
11825
11841
|
} });
|
|
11826
11842
|
|
|
11827
11843
|
//#endregion
|
|
11828
11844
|
//#region ../../node_modules/.pnpm/spdx-correct@3.2.0/node_modules/spdx-correct/index.js
|
|
11829
11845
|
var require_spdx_correct = __commonJS({ "../../node_modules/.pnpm/spdx-correct@3.2.0/node_modules/spdx-correct/index.js"(exports, module) {
|
|
11830
|
-
var parse$
|
|
11846
|
+
var parse$7 = require_spdx_expression_parse();
|
|
11831
11847
|
var spdxLicenseIds = require_spdx_license_ids();
|
|
11832
|
-
function valid(string) {
|
|
11848
|
+
function valid$1(string) {
|
|
11833
11849
|
try {
|
|
11834
|
-
parse$
|
|
11850
|
+
parse$7(string);
|
|
11835
11851
|
return true;
|
|
11836
11852
|
} catch (error) {
|
|
11837
11853
|
return false;
|
|
@@ -12018,7 +12034,7 @@ var require_spdx_correct = __commonJS({ "../../node_modules/.pnpm/spdx-correct@3
|
|
|
12018
12034
|
var validTransformation = function(identifier) {
|
|
12019
12035
|
for (var i$2 = 0; i$2 < transforms.length; i$2++) {
|
|
12020
12036
|
var transformed = transforms[i$2](identifier).trim();
|
|
12021
|
-
if (transformed !== identifier && valid(transformed)) return transformed;
|
|
12037
|
+
if (transformed !== identifier && valid$1(transformed)) return transformed;
|
|
12022
12038
|
}
|
|
12023
12039
|
return null;
|
|
12024
12040
|
};
|
|
@@ -12051,13 +12067,13 @@ var require_spdx_correct = __commonJS({ "../../node_modules/.pnpm/spdx-correct@3
|
|
|
12051
12067
|
var validArugment = typeof identifier === "string" && identifier.trim().length !== 0;
|
|
12052
12068
|
if (!validArugment) throw Error("Invalid argument. Expected non-empty string.");
|
|
12053
12069
|
identifier = identifier.trim();
|
|
12054
|
-
if (valid(identifier)) return postprocess(identifier);
|
|
12070
|
+
if (valid$1(identifier)) return postprocess(identifier);
|
|
12055
12071
|
var noPlus = identifier.replace(/\+$/, "").trim();
|
|
12056
|
-
if (valid(noPlus)) return postprocess(noPlus);
|
|
12072
|
+
if (valid$1(noPlus)) return postprocess(noPlus);
|
|
12057
12073
|
var transformed = validTransformation(identifier);
|
|
12058
12074
|
if (transformed !== null) return postprocess(transformed);
|
|
12059
12075
|
transformed = anyCorrection(identifier, function(argument) {
|
|
12060
|
-
if (valid(argument)) return argument;
|
|
12076
|
+
if (valid$1(argument)) return argument;
|
|
12061
12077
|
return validTransformation(argument);
|
|
12062
12078
|
});
|
|
12063
12079
|
if (transformed !== null) return postprocess(transformed);
|
|
@@ -12099,7 +12115,7 @@ var require_spdx_correct = __commonJS({ "../../node_modules/.pnpm/spdx-correct@3
|
|
|
12099
12115
|
//#endregion
|
|
12100
12116
|
//#region ../../node_modules/.pnpm/validate-npm-package-license@3.0.4/node_modules/validate-npm-package-license/index.js
|
|
12101
12117
|
var require_validate_npm_package_license = __commonJS({ "../../node_modules/.pnpm/validate-npm-package-license@3.0.4/node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
12102
|
-
var parse$
|
|
12118
|
+
var parse$6 = require_spdx_expression_parse();
|
|
12103
12119
|
var correct = require_spdx_correct();
|
|
12104
12120
|
var genericWarning = "license should be a valid SPDX license expression (without \"LicenseRef\"), \"UNLICENSED\", or \"SEE LICENSE IN <filename>\"";
|
|
12105
12121
|
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
@@ -12115,7 +12131,7 @@ var require_validate_npm_package_license = __commonJS({ "../../node_modules/.pnp
|
|
|
12115
12131
|
module.exports = function(argument) {
|
|
12116
12132
|
var ast;
|
|
12117
12133
|
try {
|
|
12118
|
-
ast = parse$
|
|
12134
|
+
ast = parse$6(argument);
|
|
12119
12135
|
} catch (e) {
|
|
12120
12136
|
var match;
|
|
12121
12137
|
if (argument === "UNLICENSED" || argument === "UNLICENCED") return {
|
|
@@ -12361,7 +12377,7 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
12361
12377
|
return c$1.#tail;
|
|
12362
12378
|
},
|
|
12363
12379
|
free: c$1.#free,
|
|
12364
|
-
isBackgroundFetch: (p$
|
|
12380
|
+
isBackgroundFetch: (p$8) => c$1.#isBackgroundFetch(p$8),
|
|
12365
12381
|
backgroundFetch: (k, index$1, options, context) => c$1.#backgroundFetch(k, index$1, options, context),
|
|
12366
12382
|
moveToTail: (index$1) => c$1.#moveToTail(index$1),
|
|
12367
12383
|
indexes: (options) => c$1.#indexes(options),
|
|
@@ -12496,11 +12512,11 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
12496
12512
|
starts[index$1] = ttl !== 0 ? start : 0;
|
|
12497
12513
|
ttls[index$1] = ttl;
|
|
12498
12514
|
if (ttl !== 0 && this.ttlAutopurge) {
|
|
12499
|
-
const t$
|
|
12515
|
+
const t$5 = setTimeout(() => {
|
|
12500
12516
|
if (this.#isStale(index$1)) this.delete(this.#keyList[index$1]);
|
|
12501
12517
|
}, ttl + 1);
|
|
12502
12518
|
/* c8 ignore start */
|
|
12503
|
-
if (t$
|
|
12519
|
+
if (t$5.unref) t$5.unref();
|
|
12504
12520
|
}
|
|
12505
12521
|
};
|
|
12506
12522
|
this.#updateItemAge = (index$1) => {
|
|
@@ -12524,9 +12540,9 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
12524
12540
|
const n$1 = perf.now();
|
|
12525
12541
|
if (this.ttlResolution > 0) {
|
|
12526
12542
|
cachedNow = n$1;
|
|
12527
|
-
const t$
|
|
12543
|
+
const t$5 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
12528
12544
|
/* c8 ignore start */
|
|
12529
|
-
if (t$
|
|
12545
|
+
if (t$5.unref) t$5.unref();
|
|
12530
12546
|
}
|
|
12531
12547
|
return n$1;
|
|
12532
12548
|
};
|
|
@@ -12541,8 +12557,8 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
12541
12557
|
};
|
|
12542
12558
|
this.#isStale = (index$1) => {
|
|
12543
12559
|
const s = starts[index$1];
|
|
12544
|
-
const t$
|
|
12545
|
-
return !!t$
|
|
12560
|
+
const t$5 = ttls[index$1];
|
|
12561
|
+
return !!t$5 && !!s && (cachedNow || getNow()) - s > t$5;
|
|
12546
12562
|
};
|
|
12547
12563
|
}
|
|
12548
12564
|
#updateItemAge = () => {};
|
|
@@ -12979,8 +12995,8 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
12979
12995
|
if (ignoreAbort) options.status.fetchAbortIgnored = true;
|
|
12980
12996
|
} else options.status.fetchResolved = true;
|
|
12981
12997
|
if (aborted$1 && !ignoreAbort && !updateCache) return fetchFail(ac.signal.reason);
|
|
12982
|
-
const bf$1 = p$
|
|
12983
|
-
if (this.#valList[index$1] === p$
|
|
12998
|
+
const bf$1 = p$8;
|
|
12999
|
+
if (this.#valList[index$1] === p$8) if (v$1 === void 0) if (bf$1.__staleWhileFetching) this.#valList[index$1] = bf$1.__staleWhileFetching;
|
|
12984
13000
|
else this.delete(k);
|
|
12985
13001
|
else {
|
|
12986
13002
|
if (options.status) options.status.fetchUpdated = true;
|
|
@@ -13000,8 +13016,8 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
13000
13016
|
const allowStaleAborted = aborted$1 && options.allowStaleOnFetchAbort;
|
|
13001
13017
|
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
13002
13018
|
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
13003
|
-
const bf$1 = p$
|
|
13004
|
-
if (this.#valList[index$1] === p$
|
|
13019
|
+
const bf$1 = p$8;
|
|
13020
|
+
if (this.#valList[index$1] === p$8) {
|
|
13005
13021
|
const del = !noDelete || bf$1.__staleWhileFetching === void 0;
|
|
13006
13022
|
if (del) this.delete(k);
|
|
13007
13023
|
else if (!allowStaleAborted) this.#valList[index$1] = bf$1.__staleWhileFetching;
|
|
@@ -13022,8 +13038,8 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
13022
13038
|
});
|
|
13023
13039
|
};
|
|
13024
13040
|
if (options.status) options.status.fetchDispatched = true;
|
|
13025
|
-
const p$
|
|
13026
|
-
const bf = Object.assign(p$
|
|
13041
|
+
const p$8 = new Promise(pcall).then(cb, eb);
|
|
13042
|
+
const bf = Object.assign(p$8, {
|
|
13027
13043
|
__abortController: ac,
|
|
13028
13044
|
__staleWhileFetching: v,
|
|
13029
13045
|
__returned: void 0
|
|
@@ -13037,9 +13053,9 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
13037
13053
|
} else this.#valList[index$1] = bf;
|
|
13038
13054
|
return bf;
|
|
13039
13055
|
}
|
|
13040
|
-
#isBackgroundFetch(p$
|
|
13056
|
+
#isBackgroundFetch(p$8) {
|
|
13041
13057
|
if (!this.#hasFetchMethod) return false;
|
|
13042
|
-
const b = p$
|
|
13058
|
+
const b = p$8;
|
|
13043
13059
|
return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC;
|
|
13044
13060
|
}
|
|
13045
13061
|
async fetch(k, fetchOptions = {}) {
|
|
@@ -13072,8 +13088,8 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
13072
13088
|
let index$1 = this.#keyMap.get(k);
|
|
13073
13089
|
if (index$1 === void 0) {
|
|
13074
13090
|
if (status) status.fetch = "miss";
|
|
13075
|
-
const p$
|
|
13076
|
-
return p$
|
|
13091
|
+
const p$8 = this.#backgroundFetch(k, index$1, options, context);
|
|
13092
|
+
return p$8.__returned = p$8;
|
|
13077
13093
|
} else {
|
|
13078
13094
|
const v = this.#valList[index$1];
|
|
13079
13095
|
if (this.#isBackgroundFetch(v)) {
|
|
@@ -13092,14 +13108,14 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
13092
13108
|
if (status) this.#statusTTL(status, index$1);
|
|
13093
13109
|
return v;
|
|
13094
13110
|
}
|
|
13095
|
-
const p$
|
|
13096
|
-
const hasStale = p$
|
|
13111
|
+
const p$8 = this.#backgroundFetch(k, index$1, options, context);
|
|
13112
|
+
const hasStale = p$8.__staleWhileFetching !== void 0;
|
|
13097
13113
|
const staleVal = hasStale && allowStale;
|
|
13098
13114
|
if (status) {
|
|
13099
13115
|
status.fetch = isStale ? "stale" : "refresh";
|
|
13100
13116
|
if (staleVal && isStale) status.returnedStale = true;
|
|
13101
13117
|
}
|
|
13102
|
-
return staleVal ? p$
|
|
13118
|
+
return staleVal ? p$8.__staleWhileFetching : p$8.__returned = p$8;
|
|
13103
13119
|
}
|
|
13104
13120
|
}
|
|
13105
13121
|
/**
|
|
@@ -13134,9 +13150,9 @@ var require_commonjs = __commonJS({ "../../node_modules/.pnpm/lru-cache@10.2.2/n
|
|
|
13134
13150
|
}
|
|
13135
13151
|
} else if (status) status.get = "miss";
|
|
13136
13152
|
}
|
|
13137
|
-
#connect(p$
|
|
13138
|
-
this.#prev[n$1] = p$
|
|
13139
|
-
this.#next[p$
|
|
13153
|
+
#connect(p$8, n$1) {
|
|
13154
|
+
this.#prev[n$1] = p$8;
|
|
13155
|
+
this.#next[p$8] = n$1;
|
|
13140
13156
|
}
|
|
13141
13157
|
#moveToTail(index$1) {
|
|
13142
13158
|
if (index$1 !== this.#tail) {
|
|
@@ -14155,18 +14171,18 @@ function toPath$1(urlOrPath) {
|
|
|
14155
14171
|
//#endregion
|
|
14156
14172
|
//#region ../../node_modules/.pnpm/read-pkg@9.0.1/node_modules/read-pkg/index.js
|
|
14157
14173
|
var import_normalize = __toESM(require_normalize(), 1);
|
|
14158
|
-
const getPackagePath = (cwd) => path
|
|
14174
|
+
const getPackagePath = (cwd) => path.resolve(toPath$1(cwd) ?? ".", "package.json");
|
|
14159
14175
|
const _readPackage = (file, normalize$1) => {
|
|
14160
14176
|
const json = typeof file === "string" ? parseJson(file) : file;
|
|
14161
14177
|
if (normalize$1) (0, import_normalize.default)(json);
|
|
14162
14178
|
return json;
|
|
14163
14179
|
};
|
|
14164
14180
|
async function readPackage({ cwd, normalize: normalize$1 = true } = {}) {
|
|
14165
|
-
const packageFile = await
|
|
14181
|
+
const packageFile = await fs$1.readFile(getPackagePath(cwd), "utf8");
|
|
14166
14182
|
return _readPackage(packageFile, normalize$1);
|
|
14167
14183
|
}
|
|
14168
14184
|
function readPackageSync({ cwd, normalize: normalize$1 = true } = {}) {
|
|
14169
|
-
const packageFile = fs$
|
|
14185
|
+
const packageFile = fs$2.readFileSync(getPackagePath(cwd), "utf8");
|
|
14170
14186
|
return _readPackage(packageFile, normalize$1);
|
|
14171
14187
|
}
|
|
14172
14188
|
|
|
@@ -14178,7 +14194,7 @@ async function readPackageUp(options) {
|
|
|
14178
14194
|
return {
|
|
14179
14195
|
packageJson: await readPackage({
|
|
14180
14196
|
...options,
|
|
14181
|
-
cwd: path
|
|
14197
|
+
cwd: path.dirname(filePath)
|
|
14182
14198
|
}),
|
|
14183
14199
|
path: filePath
|
|
14184
14200
|
};
|
|
@@ -14189,7 +14205,7 @@ function readPackageUpSync(options) {
|
|
|
14189
14205
|
return {
|
|
14190
14206
|
packageJson: readPackageSync({
|
|
14191
14207
|
...options,
|
|
14192
|
-
cwd: path
|
|
14208
|
+
cwd: path.dirname(filePath)
|
|
14193
14209
|
}),
|
|
14194
14210
|
path: filePath
|
|
14195
14211
|
};
|
|
@@ -14206,6 +14222,16 @@ const printBanner$1 = () => {
|
|
|
14206
14222
|
printBanner(version);
|
|
14207
14223
|
};
|
|
14208
14224
|
|
|
14225
|
+
//#endregion
|
|
14226
|
+
//#region src/utils/version/getNativeAppVersion.ts
|
|
14227
|
+
const getNativeAppVersion = async (platform$2) => {
|
|
14228
|
+
switch (platform$2) {
|
|
14229
|
+
case "ios": return getIOSVersion({ parser: ["xcodeproj", "info-plist"] });
|
|
14230
|
+
case "android": return getAndroidVersion({ parser: "app-build-gradle" });
|
|
14231
|
+
default: return null;
|
|
14232
|
+
}
|
|
14233
|
+
};
|
|
14234
|
+
|
|
14209
14235
|
//#endregion
|
|
14210
14236
|
//#region src/commands/deploy.ts
|
|
14211
14237
|
var import_valid$1 = __toESM(require_valid$1());
|
|
@@ -14215,9 +14241,9 @@ const deploy = async (options) => {
|
|
|
14215
14241
|
const gitCommit = await getLatestGitCommit();
|
|
14216
14242
|
const [gitCommitHash, gitMessage] = [gitCommit?.id() ?? null, gitCommit?.summary() ?? null];
|
|
14217
14243
|
const platform$2 = options.platform ?? (options.interactive ? await getPlatform("Which platform do you want to deploy?") : null);
|
|
14218
|
-
if (p$
|
|
14244
|
+
if (p$6.isCancel(platform$2)) return;
|
|
14219
14245
|
if (!platform$2) {
|
|
14220
|
-
p$
|
|
14246
|
+
p$6.log.error("Platform not found. -p <ios | android> or --platform <ios | android>");
|
|
14221
14247
|
return;
|
|
14222
14248
|
}
|
|
14223
14249
|
const channel = options.channel;
|
|
@@ -14233,29 +14259,29 @@ const deploy = async (options) => {
|
|
|
14233
14259
|
appVersion: null,
|
|
14234
14260
|
fingerprintHash: null
|
|
14235
14261
|
};
|
|
14236
|
-
p$
|
|
14262
|
+
p$6.log.step(`Channel: ${channel}`);
|
|
14237
14263
|
if (config.updateStrategy === "fingerprint") {
|
|
14238
|
-
const s = p$
|
|
14264
|
+
const s = p$6.spinner();
|
|
14239
14265
|
s.start(`Fingerprinting (${platform$2})`);
|
|
14240
|
-
if (!fs.existsSync(path.join(cwd, "fingerprint.json"))) {
|
|
14241
|
-
p$
|
|
14266
|
+
if (!fs.existsSync(path$1.join(cwd, "fingerprint.json"))) {
|
|
14267
|
+
p$6.log.error("Fingerprint.json not found. Please run 'hot-updater fingerprint create' to update fingerprint.json");
|
|
14242
14268
|
process.exit(1);
|
|
14243
14269
|
}
|
|
14244
14270
|
const fingerprint = await nativeFingerprint(cwd, {
|
|
14245
14271
|
platform: platform$2,
|
|
14246
14272
|
...config.fingerprint
|
|
14247
14273
|
});
|
|
14248
|
-
const projectFingerprintJsonFile = fs.readFileSync(path.join(cwd, "fingerprint.json"), "utf-8");
|
|
14274
|
+
const projectFingerprintJsonFile = fs.readFileSync(path$1.join(cwd, "fingerprint.json"), "utf-8");
|
|
14249
14275
|
const projectFingerprint = JSON.parse(projectFingerprintJsonFile);
|
|
14250
14276
|
if (fingerprint.hash !== projectFingerprint[platform$2].hash) {
|
|
14251
|
-
p$
|
|
14277
|
+
p$6.log.error("Fingerprint mismatch. 'hot-updater fingerprint create' to update fingerprint.json");
|
|
14252
14278
|
process.exit(1);
|
|
14253
14279
|
}
|
|
14254
14280
|
target.fingerprintHash = fingerprint.hash;
|
|
14255
14281
|
s.stop(`Fingerprint(${platform$2}): ${fingerprint.hash}`);
|
|
14256
14282
|
} else {
|
|
14257
|
-
const defaultTargetAppVersion = await getDefaultTargetAppVersion(
|
|
14258
|
-
const targetAppVersion = options.targetAppVersion ?? (options.interactive ? await p$
|
|
14283
|
+
const defaultTargetAppVersion = await getDefaultTargetAppVersion(platform$2) ?? "1.0.0";
|
|
14284
|
+
const targetAppVersion = options.targetAppVersion ?? (options.interactive ? await p$6.text({
|
|
14259
14285
|
message: "Target app version",
|
|
14260
14286
|
placeholder: defaultTargetAppVersion,
|
|
14261
14287
|
initialValue: defaultTargetAppVersion,
|
|
@@ -14264,24 +14290,24 @@ const deploy = async (options) => {
|
|
|
14264
14290
|
return;
|
|
14265
14291
|
}
|
|
14266
14292
|
}) : null);
|
|
14267
|
-
if (p$
|
|
14293
|
+
if (p$6.isCancel(targetAppVersion)) return;
|
|
14268
14294
|
if (!targetAppVersion) {
|
|
14269
|
-
p$
|
|
14295
|
+
p$6.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
|
|
14270
14296
|
return;
|
|
14271
14297
|
}
|
|
14272
|
-
p$
|
|
14298
|
+
p$6.log.info(`Target app version: ${(0, import_valid$1.default)(targetAppVersion)}`);
|
|
14273
14299
|
target.appVersion = targetAppVersion;
|
|
14274
14300
|
}
|
|
14275
14301
|
if (!target.fingerprintHash && !target.appVersion) {
|
|
14276
|
-
if (config.updateStrategy === "fingerprint") p$
|
|
14277
|
-
else p$
|
|
14302
|
+
if (config.updateStrategy === "fingerprint") p$6.log.error("Fingerprint hash not found. Please run 'hot-updater fingerprint create' to update fingerprint.json");
|
|
14303
|
+
else p$6.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
|
|
14278
14304
|
process.exit(1);
|
|
14279
14305
|
}
|
|
14280
14306
|
const outputPath = options.bundleOutputPath ?? cwd;
|
|
14281
14307
|
let bundleId = null;
|
|
14282
14308
|
let fileHash;
|
|
14283
|
-
const normalizeOutputPath = path.isAbsolute(outputPath) ? outputPath : path.join(cwd, outputPath);
|
|
14284
|
-
const bundlePath = path.join(normalizeOutputPath, "bundle.zip");
|
|
14309
|
+
const normalizeOutputPath = path$1.isAbsolute(outputPath) ? outputPath : path$1.join(cwd, outputPath);
|
|
14310
|
+
const bundlePath = path$1.join(normalizeOutputPath, "bundle.zip");
|
|
14285
14311
|
const [buildPlugin, storagePlugin, databasePlugin] = await Promise.all([
|
|
14286
14312
|
config.build({ cwd }),
|
|
14287
14313
|
config.storage({ cwd }),
|
|
@@ -14292,7 +14318,7 @@ const deploy = async (options) => {
|
|
|
14292
14318
|
buildResult: null,
|
|
14293
14319
|
storageUri: null
|
|
14294
14320
|
};
|
|
14295
|
-
await p$
|
|
14321
|
+
await p$6.tasks([{
|
|
14296
14322
|
title: `📦 Building Bundle (${buildPlugin.name})`,
|
|
14297
14323
|
task: async () => {
|
|
14298
14324
|
taskRef.buildResult = await buildPlugin.build({
|
|
@@ -14303,7 +14329,7 @@ const deploy = async (options) => {
|
|
|
14303
14329
|
const buildPath = taskRef.buildResult?.buildPath;
|
|
14304
14330
|
if (!buildPath) throw new Error("Build result not found");
|
|
14305
14331
|
const files = await fs.promises.readdir(buildPath, { recursive: true });
|
|
14306
|
-
const targetFiles = await getBundleZipTargets(buildPath, files.filter((file) => !fs.statSync(path.join(buildPath, file)).isDirectory()).map((file) => path.join(buildPath, file)));
|
|
14332
|
+
const targetFiles = await getBundleZipTargets(buildPath, files.filter((file) => !fs.statSync(path$1.join(buildPath, file)).isDirectory()).map((file) => path$1.join(buildPath, file)));
|
|
14307
14333
|
await createZipTargetFiles({
|
|
14308
14334
|
outfile: bundlePath,
|
|
14309
14335
|
targetFiles
|
|
@@ -14313,8 +14339,8 @@ const deploy = async (options) => {
|
|
|
14313
14339
|
return `✅ Build Complete (${buildPlugin.name})`;
|
|
14314
14340
|
}
|
|
14315
14341
|
}]);
|
|
14316
|
-
if (taskRef.buildResult?.stdout) p$
|
|
14317
|
-
await p$
|
|
14342
|
+
if (taskRef.buildResult?.stdout) p$6.log.success(taskRef.buildResult.stdout);
|
|
14343
|
+
await p$6.tasks([{
|
|
14318
14344
|
title: `📦 Uploading to Storage (${storagePlugin.name})`,
|
|
14319
14345
|
task: async () => {
|
|
14320
14346
|
if (!bundleId) throw new Error("Bundle ID not found");
|
|
@@ -14322,7 +14348,7 @@ const deploy = async (options) => {
|
|
|
14322
14348
|
const { storageUri } = await storagePlugin.uploadBundle(bundleId, bundlePath);
|
|
14323
14349
|
taskRef.storageUri = storageUri;
|
|
14324
14350
|
} catch (e) {
|
|
14325
|
-
if (e instanceof Error) p$
|
|
14351
|
+
if (e instanceof Error) p$6.log.error(e.message);
|
|
14326
14352
|
throw new Error("Failed to upload bundle to storage");
|
|
14327
14353
|
}
|
|
14328
14354
|
return `✅ Upload Complete (${storagePlugin.name})`;
|
|
@@ -14350,7 +14376,7 @@ const deploy = async (options) => {
|
|
|
14350
14376
|
});
|
|
14351
14377
|
await databasePlugin.commitBundle();
|
|
14352
14378
|
} catch (e) {
|
|
14353
|
-
if (e instanceof Error) p$
|
|
14379
|
+
if (e instanceof Error) p$6.log.error(e.message);
|
|
14354
14380
|
throw e;
|
|
14355
14381
|
}
|
|
14356
14382
|
await databasePlugin.onUnmount?.();
|
|
@@ -14369,17 +14395,17 @@ const deploy = async (options) => {
|
|
|
14369
14395
|
const url$2 = openUrl.toString();
|
|
14370
14396
|
const note = `Console: ${url$2}`;
|
|
14371
14397
|
if (!isConsoleOpen) {
|
|
14372
|
-
const result = await p$
|
|
14398
|
+
const result = await p$6.confirm({
|
|
14373
14399
|
message: "Console server is not running. Would you like to start it?",
|
|
14374
14400
|
initialValue: false
|
|
14375
14401
|
});
|
|
14376
|
-
if (!p$
|
|
14402
|
+
if (!p$6.isCancel(result) && result) await openConsole(port, () => {
|
|
14377
14403
|
open_default(url$2);
|
|
14378
14404
|
});
|
|
14379
14405
|
} else open_default(url$2);
|
|
14380
|
-
p$
|
|
14406
|
+
p$6.note(note);
|
|
14381
14407
|
}
|
|
14382
|
-
p$
|
|
14408
|
+
p$6.outro("🚀 Deployment Successful");
|
|
14383
14409
|
} catch (e) {
|
|
14384
14410
|
await databasePlugin.onUnmount?.();
|
|
14385
14411
|
await fs.promises.rm(bundlePath, { force: true });
|
|
@@ -15205,15 +15231,15 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
15205
15231
|
var require_windows = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
|
|
15206
15232
|
module.exports = isexe$3;
|
|
15207
15233
|
isexe$3.sync = sync$2;
|
|
15208
|
-
var fs$
|
|
15234
|
+
var fs$7 = __require("fs");
|
|
15209
15235
|
function checkPathExt(path$5, options) {
|
|
15210
15236
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
15211
15237
|
if (!pathext) return true;
|
|
15212
15238
|
pathext = pathext.split(";");
|
|
15213
15239
|
if (pathext.indexOf("") !== -1) return true;
|
|
15214
15240
|
for (var i$2 = 0; i$2 < pathext.length; i$2++) {
|
|
15215
|
-
var p$
|
|
15216
|
-
if (p$
|
|
15241
|
+
var p$8 = pathext[i$2].toLowerCase();
|
|
15242
|
+
if (p$8 && path$5.substr(-p$8.length).toLowerCase() === p$8) return true;
|
|
15217
15243
|
}
|
|
15218
15244
|
return false;
|
|
15219
15245
|
}
|
|
@@ -15222,12 +15248,12 @@ var require_windows = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_mo
|
|
|
15222
15248
|
return checkPathExt(path$5, options);
|
|
15223
15249
|
}
|
|
15224
15250
|
function isexe$3(path$5, options, cb) {
|
|
15225
|
-
fs$
|
|
15251
|
+
fs$7.stat(path$5, function(er, stat) {
|
|
15226
15252
|
cb(er, er ? false : checkStat$1(stat, path$5, options));
|
|
15227
15253
|
});
|
|
15228
15254
|
}
|
|
15229
15255
|
function sync$2(path$5, options) {
|
|
15230
|
-
return checkStat$1(fs$
|
|
15256
|
+
return checkStat$1(fs$7.statSync(path$5), path$5, options);
|
|
15231
15257
|
}
|
|
15232
15258
|
} });
|
|
15233
15259
|
|
|
@@ -15236,14 +15262,14 @@ var require_windows = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_mo
|
|
|
15236
15262
|
var require_mode = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
|
|
15237
15263
|
module.exports = isexe$2;
|
|
15238
15264
|
isexe$2.sync = sync$1;
|
|
15239
|
-
var fs$
|
|
15265
|
+
var fs$6 = __require("fs");
|
|
15240
15266
|
function isexe$2(path$5, options, cb) {
|
|
15241
|
-
fs$
|
|
15267
|
+
fs$6.stat(path$5, function(er, stat) {
|
|
15242
15268
|
cb(er, er ? false : checkStat(stat, options));
|
|
15243
15269
|
});
|
|
15244
15270
|
}
|
|
15245
15271
|
function sync$1(path$5, options) {
|
|
15246
|
-
return checkStat(fs$
|
|
15272
|
+
return checkStat(fs$6.statSync(path$5), options);
|
|
15247
15273
|
}
|
|
15248
15274
|
function checkStat(stat, options) {
|
|
15249
15275
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -15266,7 +15292,7 @@ var require_mode = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modul
|
|
|
15266
15292
|
//#endregion
|
|
15267
15293
|
//#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
15268
15294
|
var require_isexe = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
15269
|
-
var fs$
|
|
15295
|
+
var fs$5 = __require("fs");
|
|
15270
15296
|
var core;
|
|
15271
15297
|
if (process.platform === "win32" || global.TESTING_WINDOWS) core = require_windows();
|
|
15272
15298
|
else core = require_mode();
|
|
@@ -15341,16 +15367,16 @@ var require_which = __commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modu
|
|
|
15341
15367
|
const ppRaw = pathEnv[i$2];
|
|
15342
15368
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
15343
15369
|
const pCmd = path$4.join(pathPart, cmd);
|
|
15344
|
-
const p$
|
|
15345
|
-
resolve(subStep(p$
|
|
15370
|
+
const p$8 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
15371
|
+
resolve(subStep(p$8, i$2, 0));
|
|
15346
15372
|
});
|
|
15347
|
-
const subStep = (p$
|
|
15373
|
+
const subStep = (p$8, i$2, ii) => new Promise((resolve, reject) => {
|
|
15348
15374
|
if (ii === pathExt.length) return resolve(step(i$2 + 1));
|
|
15349
15375
|
const ext = pathExt[ii];
|
|
15350
|
-
isexe(p$
|
|
15351
|
-
if (!er && is) if (opt.all) found.push(p$
|
|
15352
|
-
else return resolve(p$
|
|
15353
|
-
return resolve(subStep(p$
|
|
15376
|
+
isexe(p$8 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
15377
|
+
if (!er && is) if (opt.all) found.push(p$8 + ext);
|
|
15378
|
+
else return resolve(p$8 + ext);
|
|
15379
|
+
return resolve(subStep(p$8, i$2, ii + 1));
|
|
15354
15380
|
});
|
|
15355
15381
|
});
|
|
15356
15382
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -15363,9 +15389,9 @@ var require_which = __commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modu
|
|
|
15363
15389
|
const ppRaw = pathEnv[i$2];
|
|
15364
15390
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
15365
15391
|
const pCmd = path$4.join(pathPart, cmd);
|
|
15366
|
-
const p$
|
|
15392
|
+
const p$8 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
15367
15393
|
for (let j = 0; j < pathExt.length; j++) {
|
|
15368
|
-
const cur = p$
|
|
15394
|
+
const cur = p$8 + pathExt[j];
|
|
15369
15395
|
try {
|
|
15370
15396
|
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
15371
15397
|
if (is) if (opt.all) found.push(cur);
|
|
@@ -15470,16 +15496,16 @@ var require_shebang_command = __commonJS({ "../../node_modules/.pnpm/shebang-com
|
|
|
15470
15496
|
//#endregion
|
|
15471
15497
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
15472
15498
|
var require_readShebang = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
15473
|
-
const fs$
|
|
15499
|
+
const fs$4 = __require("fs");
|
|
15474
15500
|
const shebangCommand = require_shebang_command();
|
|
15475
15501
|
function readShebang$1(command) {
|
|
15476
15502
|
const size = 150;
|
|
15477
15503
|
const buffer = Buffer.alloc(size);
|
|
15478
15504
|
let fd;
|
|
15479
15505
|
try {
|
|
15480
|
-
fd = fs$
|
|
15481
|
-
fs$
|
|
15482
|
-
fs$
|
|
15506
|
+
fd = fs$4.openSync(command, "r");
|
|
15507
|
+
fs$4.readSync(fd, buffer, 0, size, 0);
|
|
15508
|
+
fs$4.closeSync(fd);
|
|
15483
15509
|
} catch (e) {}
|
|
15484
15510
|
return shebangCommand(buffer.toString());
|
|
15485
15511
|
}
|
|
@@ -15527,7 +15553,7 @@ var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/nod
|
|
|
15527
15553
|
}
|
|
15528
15554
|
return parsed;
|
|
15529
15555
|
}
|
|
15530
|
-
function parse$
|
|
15556
|
+
function parse$5(command, args, options) {
|
|
15531
15557
|
if (args && !Array.isArray(args)) {
|
|
15532
15558
|
options = args;
|
|
15533
15559
|
args = null;
|
|
@@ -15546,7 +15572,7 @@ var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/nod
|
|
|
15546
15572
|
};
|
|
15547
15573
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
15548
15574
|
}
|
|
15549
|
-
module.exports = parse$
|
|
15575
|
+
module.exports = parse$5;
|
|
15550
15576
|
} });
|
|
15551
15577
|
|
|
15552
15578
|
//#endregion
|
|
@@ -15593,16 +15619,16 @@ var require_enoent = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/no
|
|
|
15593
15619
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
|
15594
15620
|
var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
|
|
15595
15621
|
const cp = __require("child_process");
|
|
15596
|
-
const parse = require_parse();
|
|
15622
|
+
const parse$4 = require_parse();
|
|
15597
15623
|
const enoent = require_enoent();
|
|
15598
15624
|
function spawn$1(command, args, options) {
|
|
15599
|
-
const parsed = parse(command, args, options);
|
|
15625
|
+
const parsed = parse$4(command, args, options);
|
|
15600
15626
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
15601
15627
|
enoent.hookChildProcess(spawned, parsed);
|
|
15602
15628
|
return spawned;
|
|
15603
15629
|
}
|
|
15604
15630
|
function spawnSync$1(command, args, options) {
|
|
15605
|
-
const parsed = parse(command, args, options);
|
|
15631
|
+
const parsed = parse$4(command, args, options);
|
|
15606
15632
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
15607
15633
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
15608
15634
|
return result;
|
|
@@ -15610,7 +15636,7 @@ var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0
|
|
|
15610
15636
|
module.exports = spawn$1;
|
|
15611
15637
|
module.exports.spawn = spawn$1;
|
|
15612
15638
|
module.exports.sync = spawnSync$1;
|
|
15613
|
-
module.exports._parse = parse;
|
|
15639
|
+
module.exports._parse = parse$4;
|
|
15614
15640
|
module.exports._enoent = enoent;
|
|
15615
15641
|
} });
|
|
15616
15642
|
|
|
@@ -15630,12 +15656,12 @@ function toPath(urlOrPath) {
|
|
|
15630
15656
|
}
|
|
15631
15657
|
function traversePathUp(startPath) {
|
|
15632
15658
|
return { *[Symbol.iterator]() {
|
|
15633
|
-
let currentPath = path
|
|
15659
|
+
let currentPath = path.resolve(toPath(startPath));
|
|
15634
15660
|
let previousPath;
|
|
15635
15661
|
while (previousPath !== currentPath) {
|
|
15636
15662
|
yield currentPath;
|
|
15637
15663
|
previousPath = currentPath;
|
|
15638
|
-
currentPath = path
|
|
15664
|
+
currentPath = path.resolve(currentPath, "..");
|
|
15639
15665
|
}
|
|
15640
15666
|
} };
|
|
15641
15667
|
}
|
|
@@ -15644,21 +15670,21 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
15644
15670
|
//#endregion
|
|
15645
15671
|
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
15646
15672
|
const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
|
|
15647
|
-
const cwdPath = path
|
|
15673
|
+
const cwdPath = path.resolve(toPath(cwd));
|
|
15648
15674
|
const result = [];
|
|
15649
|
-
const pathParts = pathOption.split(path
|
|
15675
|
+
const pathParts = pathOption.split(path.delimiter);
|
|
15650
15676
|
if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
|
|
15651
15677
|
if (addExecPath) applyExecPath(result, pathParts, execPath$1, cwdPath);
|
|
15652
|
-
return pathOption === "" || pathOption === path
|
|
15678
|
+
return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
|
|
15653
15679
|
};
|
|
15654
15680
|
const applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
15655
15681
|
for (const directory of traversePathUp(cwdPath)) {
|
|
15656
|
-
const pathPart = path
|
|
15682
|
+
const pathPart = path.join(directory, "node_modules/.bin");
|
|
15657
15683
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
15658
15684
|
}
|
|
15659
15685
|
};
|
|
15660
15686
|
const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
15661
|
-
const pathPart = path
|
|
15687
|
+
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
15662
15688
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
15663
15689
|
};
|
|
15664
15690
|
const npmRunPathEnv = ({ env = process$1.env,...options } = {}) => {
|
|
@@ -16701,7 +16727,7 @@ const mapNode = ({ options }) => {
|
|
|
16701
16727
|
const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath,...options }) => {
|
|
16702
16728
|
if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
|
|
16703
16729
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
|
|
16704
|
-
const resolvedNodePath = path
|
|
16730
|
+
const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
|
|
16705
16731
|
const newOptions = {
|
|
16706
16732
|
...options,
|
|
16707
16733
|
nodePath: resolvedNodePath,
|
|
@@ -16713,7 +16739,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
|
|
|
16713
16739
|
commandArguments,
|
|
16714
16740
|
newOptions
|
|
16715
16741
|
];
|
|
16716
|
-
if (path
|
|
16742
|
+
if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
|
|
16717
16743
|
return [
|
|
16718
16744
|
resolvedNodePath,
|
|
16719
16745
|
[
|
|
@@ -16800,7 +16826,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
|
|
|
16800
16826
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
|
|
16801
16827
|
const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
16802
16828
|
const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
|
|
16803
|
-
return path
|
|
16829
|
+
return path.resolve(cwdString);
|
|
16804
16830
|
};
|
|
16805
16831
|
const getDefaultCwd = () => {
|
|
16806
16832
|
try {
|
|
@@ -16841,7 +16867,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
16841
16867
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
16842
16868
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
16843
16869
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
16844
|
-
if (process$1.platform === "win32" && path
|
|
16870
|
+
if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
16845
16871
|
return {
|
|
16846
16872
|
file,
|
|
16847
16873
|
commandArguments,
|
|
@@ -16921,16 +16947,16 @@ var c = class {
|
|
|
16921
16947
|
#n;
|
|
16922
16948
|
#r = !1;
|
|
16923
16949
|
#e = void 0;
|
|
16924
|
-
constructor(e, t$
|
|
16925
|
-
this.#t = e, this.#n = t$
|
|
16950
|
+
constructor(e, t$5) {
|
|
16951
|
+
this.#t = e, this.#n = t$5;
|
|
16926
16952
|
}
|
|
16927
16953
|
next() {
|
|
16928
16954
|
const e = () => this.#s();
|
|
16929
16955
|
return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;
|
|
16930
16956
|
}
|
|
16931
16957
|
return(e) {
|
|
16932
|
-
const t$
|
|
16933
|
-
return this.#e ? this.#e.then(t$
|
|
16958
|
+
const t$5 = () => this.#i(e);
|
|
16959
|
+
return this.#e ? this.#e.then(t$5, t$5) : t$5();
|
|
16934
16960
|
}
|
|
16935
16961
|
async #s() {
|
|
16936
16962
|
if (this.#r) return {
|
|
@@ -16940,8 +16966,8 @@ var c = class {
|
|
|
16940
16966
|
let e;
|
|
16941
16967
|
try {
|
|
16942
16968
|
e = await this.#t.read();
|
|
16943
|
-
} catch (t$
|
|
16944
|
-
throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t$
|
|
16969
|
+
} catch (t$5) {
|
|
16970
|
+
throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t$5;
|
|
16945
16971
|
}
|
|
16946
16972
|
return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;
|
|
16947
16973
|
}
|
|
@@ -16951,8 +16977,8 @@ var c = class {
|
|
|
16951
16977
|
value: e
|
|
16952
16978
|
};
|
|
16953
16979
|
if (this.#r = !0, !this.#n) {
|
|
16954
|
-
const t$
|
|
16955
|
-
return this.#t.releaseLock(), await t$
|
|
16980
|
+
const t$5 = this.#t.cancel(e);
|
|
16981
|
+
return this.#t.releaseLock(), await t$5, {
|
|
16956
16982
|
done: !0,
|
|
16957
16983
|
value: e
|
|
16958
16984
|
};
|
|
@@ -16987,8 +17013,8 @@ const u = Object.create(a, {
|
|
|
16987
17013
|
}
|
|
16988
17014
|
});
|
|
16989
17015
|
function h({ preventCancel: r = !1 } = {}) {
|
|
16990
|
-
const e = this.getReader(), t$
|
|
16991
|
-
return s[n] = t$
|
|
17016
|
+
const e = this.getReader(), t$5 = new c(e, r), s = Object.create(u);
|
|
17017
|
+
return s[n] = t$5, s;
|
|
16992
17018
|
}
|
|
16993
17019
|
|
|
16994
17020
|
//#endregion
|
|
@@ -19471,8 +19497,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
19471
19497
|
const listeners = this.#process.listeners(sig);
|
|
19472
19498
|
let { count: count$1 } = this.#emitter;
|
|
19473
19499
|
/* c8 ignore start */
|
|
19474
|
-
const p$
|
|
19475
|
-
if (typeof p$
|
|
19500
|
+
const p$8 = process$3;
|
|
19501
|
+
if (typeof p$8.__signal_exit_emitter__ === "object" && typeof p$8.__signal_exit_emitter__.count === "number") count$1 += p$8.__signal_exit_emitter__.count;
|
|
19476
19502
|
/* c8 ignore stop */
|
|
19477
19503
|
if (listeners.length === count$1) {
|
|
19478
19504
|
this.unload();
|
|
@@ -20826,7 +20852,7 @@ const ensureInstallPackages = async (buildPluginPackages) => {
|
|
|
20826
20852
|
return !packages?.packageJson?.devDependencies?.[pkg];
|
|
20827
20853
|
});
|
|
20828
20854
|
const packageManager = getPackageManager();
|
|
20829
|
-
await p$
|
|
20855
|
+
await p$5.tasks([{
|
|
20830
20856
|
enabled: dependenciesToInstall.length > 0,
|
|
20831
20857
|
title: "Checking packages",
|
|
20832
20858
|
task: async (message) => {
|
|
@@ -20834,13 +20860,13 @@ const ensureInstallPackages = async (buildPluginPackages) => {
|
|
|
20834
20860
|
try {
|
|
20835
20861
|
const result = await execa(packageManager, [packageManager === "yarn" ? "add" : "install", ...dependenciesToInstall.map(ensurePackageVersion)]);
|
|
20836
20862
|
if (result.exitCode !== 0 && result.stderr) {
|
|
20837
|
-
p$
|
|
20863
|
+
p$5.log.error(result.stderr);
|
|
20838
20864
|
process.exit(1);
|
|
20839
20865
|
}
|
|
20840
20866
|
return `Installed ${dependenciesToInstall.join(", ")}`;
|
|
20841
20867
|
} catch (e) {
|
|
20842
|
-
if (e instanceof ExecaError) p$
|
|
20843
|
-
else if (e instanceof Error) p$
|
|
20868
|
+
if (e instanceof ExecaError) p$5.log.error(e.stderr || e.stdout || e.message);
|
|
20869
|
+
else if (e instanceof Error) p$5.log.error(e.message);
|
|
20844
20870
|
process.exit(1);
|
|
20845
20871
|
}
|
|
20846
20872
|
}
|
|
@@ -20856,13 +20882,13 @@ const ensureInstallPackages = async (buildPluginPackages) => {
|
|
|
20856
20882
|
packageManager === "yarn" ? "--dev" : "--save-dev"
|
|
20857
20883
|
]);
|
|
20858
20884
|
if (result.exitCode !== 0 && result.stderr) {
|
|
20859
|
-
p$
|
|
20885
|
+
p$5.log.error(result.stderr);
|
|
20860
20886
|
process.exit(1);
|
|
20861
20887
|
}
|
|
20862
20888
|
return `Installed ${devDependenciesToInstall.join(", ")}`;
|
|
20863
20889
|
} catch (e) {
|
|
20864
|
-
if (e instanceof ExecaError) p$
|
|
20865
|
-
else if (e instanceof Error) p$
|
|
20890
|
+
if (e instanceof ExecaError) p$5.log.error(e.stderr || e.stdout || e.message);
|
|
20891
|
+
else if (e instanceof Error) p$5.log.error(e.message);
|
|
20866
20892
|
process.exit(1);
|
|
20867
20893
|
}
|
|
20868
20894
|
}
|
|
@@ -20899,7 +20925,7 @@ const PACKAGE_MAP = {
|
|
|
20899
20925
|
};
|
|
20900
20926
|
const init = async () => {
|
|
20901
20927
|
printBanner$1();
|
|
20902
|
-
const buildPluginPackage = await p$
|
|
20928
|
+
const buildPluginPackage = await p$4.select({
|
|
20903
20929
|
message: "Select a build plugin",
|
|
20904
20930
|
options: [
|
|
20905
20931
|
{
|
|
@@ -20930,8 +20956,8 @@ const init = async () => {
|
|
|
20930
20956
|
}
|
|
20931
20957
|
]
|
|
20932
20958
|
});
|
|
20933
|
-
if (p$
|
|
20934
|
-
const provider = await p$
|
|
20959
|
+
if (p$4.isCancel(buildPluginPackage)) process.exit(0);
|
|
20960
|
+
const provider = await p$4.select({
|
|
20935
20961
|
message: "Select a provider",
|
|
20936
20962
|
options: [
|
|
20937
20963
|
{
|
|
@@ -20952,7 +20978,7 @@ const init = async () => {
|
|
|
20952
20978
|
}
|
|
20953
20979
|
]
|
|
20954
20980
|
});
|
|
20955
|
-
if (p$
|
|
20981
|
+
if (p$4.isCancel(provider)) process.exit(0);
|
|
20956
20982
|
try {
|
|
20957
20983
|
await ensureInstallPackages({
|
|
20958
20984
|
dependencies: [
|
|
@@ -20967,8 +20993,8 @@ const init = async () => {
|
|
|
20967
20993
|
]
|
|
20968
20994
|
});
|
|
20969
20995
|
} catch (e) {
|
|
20970
|
-
if (e instanceof ExecaError) p$
|
|
20971
|
-
else if (e instanceof Error) p$
|
|
20996
|
+
if (e instanceof ExecaError) p$4.log.error(e.stderr ?? e.message);
|
|
20997
|
+
else if (e instanceof Error) p$4.log.error(e.message);
|
|
20972
20998
|
process.exit(1);
|
|
20973
20999
|
}
|
|
20974
21000
|
const build$1 = buildPluginPackage.name;
|
|
@@ -21031,7 +21057,7 @@ var AndroidConfigParser = class {
|
|
|
21031
21057
|
parser;
|
|
21032
21058
|
builder;
|
|
21033
21059
|
constructor() {
|
|
21034
|
-
this.stringsXmlPath = path.join(getCwd(), "android", "app", "src", "main", "res", "values", "strings.xml");
|
|
21060
|
+
this.stringsXmlPath = path$1.join(getCwd(), "android", "app", "src", "main", "res", "values", "strings.xml");
|
|
21035
21061
|
const options = {
|
|
21036
21062
|
ignoreAttributes: false,
|
|
21037
21063
|
attributeNamePrefix: "@_",
|
|
@@ -21055,25 +21081,25 @@ var AndroidConfigParser = class {
|
|
|
21055
21081
|
async get(key) {
|
|
21056
21082
|
if (!await this.exists()) return {
|
|
21057
21083
|
value: null,
|
|
21058
|
-
path: path.relative(getCwd(), this.stringsXmlPath)
|
|
21084
|
+
path: path$1.relative(getCwd(), this.stringsXmlPath)
|
|
21059
21085
|
};
|
|
21060
21086
|
try {
|
|
21061
21087
|
const content = await fs.promises.readFile(this.stringsXmlPath, "utf-8");
|
|
21062
21088
|
const result = this.parser.parse(content);
|
|
21063
21089
|
if (!result.resources.string) return {
|
|
21064
21090
|
value: null,
|
|
21065
|
-
path: path.relative(getCwd(), this.stringsXmlPath)
|
|
21091
|
+
path: path$1.relative(getCwd(), this.stringsXmlPath)
|
|
21066
21092
|
};
|
|
21067
21093
|
const strings = Array.isArray(result.resources.string) ? result.resources.string : [result.resources.string];
|
|
21068
21094
|
const stringElement = strings.find((str) => str["@_name"] === key && str["@_moduleConfig"] === "true");
|
|
21069
21095
|
return {
|
|
21070
21096
|
value: stringElement?.["#text"]?.trim() ?? null,
|
|
21071
|
-
path: path.relative(getCwd(), this.stringsXmlPath)
|
|
21097
|
+
path: path$1.relative(getCwd(), this.stringsXmlPath)
|
|
21072
21098
|
};
|
|
21073
21099
|
} catch (error) {
|
|
21074
21100
|
return {
|
|
21075
21101
|
value: null,
|
|
21076
|
-
path: path.relative(getCwd(), this.stringsXmlPath)
|
|
21102
|
+
path: path$1.relative(getCwd(), this.stringsXmlPath)
|
|
21077
21103
|
};
|
|
21078
21104
|
}
|
|
21079
21105
|
}
|
|
@@ -21095,7 +21121,7 @@ var AndroidConfigParser = class {
|
|
|
21095
21121
|
result.resources.string = strings.length === 1 ? strings[0] : strings;
|
|
21096
21122
|
const newContent = this.builder.build(result);
|
|
21097
21123
|
await fs.promises.writeFile(this.stringsXmlPath, newContent, "utf-8");
|
|
21098
|
-
return { path: path.relative(getCwd(), this.stringsXmlPath) };
|
|
21124
|
+
return { path: path$1.relative(getCwd(), this.stringsXmlPath) };
|
|
21099
21125
|
} catch (error) {
|
|
21100
21126
|
throw new Error(`Failed to parse or update strings.xml: ${error}`);
|
|
21101
21127
|
}
|
|
@@ -21108,7 +21134,7 @@ var import_plist = __toESM(require_plist());
|
|
|
21108
21134
|
var IosConfigParser = class {
|
|
21109
21135
|
async getPlistPath() {
|
|
21110
21136
|
const [plistFile] = await globby("*/Info.plist", {
|
|
21111
|
-
cwd: path.join(getCwd(), "ios"),
|
|
21137
|
+
cwd: path$1.join(getCwd(), "ios"),
|
|
21112
21138
|
absolute: true,
|
|
21113
21139
|
onlyFiles: true
|
|
21114
21140
|
});
|
|
@@ -21132,25 +21158,25 @@ var IosConfigParser = class {
|
|
|
21132
21158
|
const value = plistObject[key];
|
|
21133
21159
|
if (value === null || value === void 0) return {
|
|
21134
21160
|
value: null,
|
|
21135
|
-
path: path.relative(getCwd(), plistFile)
|
|
21161
|
+
path: path$1.relative(getCwd(), plistFile)
|
|
21136
21162
|
};
|
|
21137
21163
|
if (typeof value === "string") return {
|
|
21138
21164
|
value,
|
|
21139
|
-
path: path.relative(getCwd(), plistFile)
|
|
21165
|
+
path: path$1.relative(getCwd(), plistFile)
|
|
21140
21166
|
};
|
|
21141
21167
|
return {
|
|
21142
21168
|
value: String(value),
|
|
21143
|
-
path: path.relative(getCwd(), plistFile)
|
|
21169
|
+
path: path$1.relative(getCwd(), plistFile)
|
|
21144
21170
|
};
|
|
21145
21171
|
}
|
|
21146
21172
|
return {
|
|
21147
21173
|
value: null,
|
|
21148
|
-
path: path.relative(getCwd(), plistFile)
|
|
21174
|
+
path: path$1.relative(getCwd(), plistFile)
|
|
21149
21175
|
};
|
|
21150
21176
|
} catch (error) {
|
|
21151
21177
|
return {
|
|
21152
21178
|
value: null,
|
|
21153
|
-
path: path.relative(getCwd(), await this.getPlistPath())
|
|
21179
|
+
path: path$1.relative(getCwd(), await this.getPlistPath())
|
|
21154
21180
|
};
|
|
21155
21181
|
}
|
|
21156
21182
|
}
|
|
@@ -21164,7 +21190,7 @@ var IosConfigParser = class {
|
|
|
21164
21190
|
pretty: true
|
|
21165
21191
|
});
|
|
21166
21192
|
await fs.promises.writeFile(plistFile, newPlistXml);
|
|
21167
|
-
return { path: path.relative(getCwd(), plistFile) };
|
|
21193
|
+
return { path: path$1.relative(getCwd(), plistFile) };
|
|
21168
21194
|
}
|
|
21169
21195
|
};
|
|
21170
21196
|
|
|
@@ -21203,25 +21229,19 @@ const getChannel = async (platform$2) => {
|
|
|
21203
21229
|
};
|
|
21204
21230
|
|
|
21205
21231
|
//#endregion
|
|
21206
|
-
//#region src/
|
|
21207
|
-
var import_picocolors = __toESM(require_picocolors());
|
|
21208
|
-
|
|
21209
|
-
const DEFAULT_CHANNEL = "production";
|
|
21210
|
-
const program = new Command();
|
|
21211
|
-
program.name("hot-updater").description(banner(version)).version(version);
|
|
21212
|
-
program.command("init").description("Initialize Hot Updater").action(init);
|
|
21213
|
-
const fingerprintCommand = program.command("fingerprint").description("Generate fingerprint");
|
|
21214
|
-
fingerprintCommand.action(async () => {
|
|
21232
|
+
//#region src/commands/fingerprint.ts
|
|
21233
|
+
var import_picocolors$2 = __toESM(require_picocolors());
|
|
21234
|
+
const handleFingerprint = async () => {
|
|
21215
21235
|
const config = await loadConfig(null);
|
|
21216
21236
|
if (config.updateStrategy === "appVersion") {
|
|
21217
|
-
p.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
|
|
21237
|
+
p$3.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
|
|
21218
21238
|
process.exit(1);
|
|
21219
21239
|
}
|
|
21220
21240
|
const fingerPrintRef = {
|
|
21221
21241
|
ios: null,
|
|
21222
21242
|
android: null
|
|
21223
21243
|
};
|
|
21224
|
-
await p.tasks([{
|
|
21244
|
+
await p$3.tasks([{
|
|
21225
21245
|
title: "Generating fingerprint (iOS)",
|
|
21226
21246
|
task: async () => {
|
|
21227
21247
|
const fingerprint = await nativeFingerprint(getCwd(), {
|
|
@@ -21242,22 +21262,22 @@ fingerprintCommand.action(async () => {
|
|
|
21242
21262
|
return `Fingerprint(Android): ${fingerprint.hash}`;
|
|
21243
21263
|
}
|
|
21244
21264
|
}]);
|
|
21245
|
-
const localFingerprintPath = path.join(getCwd(), "fingerprint.json");
|
|
21265
|
+
const localFingerprintPath = path$1.join(getCwd(), "fingerprint.json");
|
|
21246
21266
|
if (!fs.existsSync(localFingerprintPath)) return;
|
|
21247
21267
|
const readFingerprint = await fs.promises.readFile(localFingerprintPath, "utf-8");
|
|
21248
21268
|
const localFingerprint = JSON.parse(readFingerprint);
|
|
21249
21269
|
if (localFingerprint.ios.hash !== fingerPrintRef.ios?.hash) {
|
|
21250
|
-
p.log.error("iOS fingerprint mismatch. Please update using 'hot-updater fingerprint create' command.");
|
|
21270
|
+
p$3.log.error("iOS fingerprint mismatch. Please update using 'hot-updater fingerprint create' command.");
|
|
21251
21271
|
process.exit(1);
|
|
21252
21272
|
}
|
|
21253
21273
|
if (localFingerprint.android.hash !== fingerPrintRef.android?.hash) {
|
|
21254
|
-
p.log.error("Android fingerprint mismatch. Please update using 'hot-updater fingerprint create' command.");
|
|
21274
|
+
p$3.log.error("Android fingerprint mismatch. Please update using 'hot-updater fingerprint create' command.");
|
|
21255
21275
|
process.exit(1);
|
|
21256
21276
|
}
|
|
21257
|
-
p.log.success("Fingerprint matched");
|
|
21258
|
-
}
|
|
21259
|
-
|
|
21260
|
-
const FINGERPRINT_FILE_PATH = path.join(getCwd(), "fingerprint.json");
|
|
21277
|
+
p$3.log.success("Fingerprint matched");
|
|
21278
|
+
};
|
|
21279
|
+
const handleCreateFingerprint = async () => {
|
|
21280
|
+
const FINGERPRINT_FILE_PATH = path$1.join(getCwd(), "fingerprint.json");
|
|
21261
21281
|
const createFingerprintData = async (config) => {
|
|
21262
21282
|
const [ios, android] = await Promise.all([nativeFingerprint(getCwd(), {
|
|
21263
21283
|
platform: "ios",
|
|
@@ -21280,12 +21300,12 @@ fingerprintCommand.command("create").description("Create fingerprint").action(as
|
|
|
21280
21300
|
}
|
|
21281
21301
|
};
|
|
21282
21302
|
let diffChanged = false;
|
|
21283
|
-
await p.tasks([{
|
|
21303
|
+
await p$3.tasks([{
|
|
21284
21304
|
title: "Creating fingerprint.json",
|
|
21285
21305
|
task: async () => {
|
|
21286
21306
|
const config = await loadConfig(null);
|
|
21287
21307
|
if (config.updateStrategy === "appVersion") {
|
|
21288
|
-
p.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
|
|
21308
|
+
p$3.log.error("The updateStrategy in hot-updater.config.ts is set to 'appVersion'. This command only works with 'fingerprint' strategy.");
|
|
21289
21309
|
process.exit(1);
|
|
21290
21310
|
}
|
|
21291
21311
|
const newFingerprint = await createFingerprintData(config);
|
|
@@ -21295,26 +21315,742 @@ fingerprintCommand.command("create").description("Create fingerprint").action(as
|
|
|
21295
21315
|
return "Created fingerprint.json";
|
|
21296
21316
|
}
|
|
21297
21317
|
}]);
|
|
21298
|
-
if (diffChanged) p.log.success(import_picocolors.default.bold(`${import_picocolors.default.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
|
|
21299
|
-
});
|
|
21300
|
-
|
|
21301
|
-
|
|
21318
|
+
if (diffChanged) p$3.log.success(import_picocolors$2.default.bold(`${import_picocolors$2.default.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
|
|
21319
|
+
else p$3.log.success(import_picocolors$2.default.bold(`${import_picocolors$2.default.blue("fingerprint.json")} is up to date.`));
|
|
21320
|
+
};
|
|
21321
|
+
|
|
21322
|
+
//#endregion
|
|
21323
|
+
//#region src/commands/channel.ts
|
|
21324
|
+
var import_picocolors$1 = __toESM(require_picocolors());
|
|
21325
|
+
const handleChannel = async () => {
|
|
21302
21326
|
const androidChannel = await getChannel("android");
|
|
21303
21327
|
const iosChannel = await getChannel("ios");
|
|
21304
|
-
p.log.info(`Current Android channel: ${import_picocolors.default.green(androidChannel.value)}`);
|
|
21305
|
-
p.log.info(` from: ${import_picocolors.default.blue(androidChannel.path)}`);
|
|
21306
|
-
p.log.info(`Current iOS channel: ${import_picocolors.default.green(iosChannel.value)}`);
|
|
21307
|
-
p.log.info(` from: ${import_picocolors.default.blue(iosChannel.path)}`);
|
|
21308
|
-
}
|
|
21309
|
-
|
|
21328
|
+
p$2.log.info(`Current Android channel: ${import_picocolors$1.default.green(androidChannel.value)}`);
|
|
21329
|
+
p$2.log.info(` from: ${import_picocolors$1.default.blue(androidChannel.path)}`);
|
|
21330
|
+
p$2.log.info(`Current iOS channel: ${import_picocolors$1.default.green(iosChannel.value)}`);
|
|
21331
|
+
p$2.log.info(` from: ${import_picocolors$1.default.blue(iosChannel.path)}`);
|
|
21332
|
+
};
|
|
21333
|
+
const handleSetChannel = async (channel) => {
|
|
21310
21334
|
const { path: androidPath } = await setChannel("android", channel);
|
|
21311
|
-
p.log.success(`Set Android channel to: ${import_picocolors.default.green(channel)}`);
|
|
21312
|
-
p.log.info(` from: ${import_picocolors.default.blue(androidPath)}`);
|
|
21335
|
+
p$2.log.success(`Set Android channel to: ${import_picocolors$1.default.green(channel)}`);
|
|
21336
|
+
p$2.log.info(` from: ${import_picocolors$1.default.blue(androidPath)}`);
|
|
21313
21337
|
const { path: iosPath } = await setChannel("ios", channel);
|
|
21314
|
-
p.log.success(`Set iOS channel to: ${import_picocolors.default.green(channel)}`);
|
|
21315
|
-
p.log.info(` from: ${import_picocolors.default.blue(iosPath)}`);
|
|
21316
|
-
p.log.success("You need to rebuild the native app if the channel has changed.");
|
|
21317
|
-
|
|
21338
|
+
p$2.log.success(`Set iOS channel to: ${import_picocolors$1.default.green(channel)}`);
|
|
21339
|
+
p$2.log.info(` from: ${import_picocolors$1.default.blue(iosPath)}`);
|
|
21340
|
+
p$2.log.success("You need to rebuild the native app if the channel has changed.");
|
|
21341
|
+
const config = await loadConfig(null);
|
|
21342
|
+
if (config.updateStrategy === "fingerprint") await handleCreateFingerprint();
|
|
21343
|
+
};
|
|
21344
|
+
|
|
21345
|
+
//#endregion
|
|
21346
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
|
|
21347
|
+
var require_inc = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js"(exports, module) {
|
|
21348
|
+
const SemVer$10 = require_semver$1();
|
|
21349
|
+
const inc$1 = (version$1, release, options, identifier, identifierBase) => {
|
|
21350
|
+
if (typeof options === "string") {
|
|
21351
|
+
identifierBase = identifier;
|
|
21352
|
+
identifier = options;
|
|
21353
|
+
options = void 0;
|
|
21354
|
+
}
|
|
21355
|
+
try {
|
|
21356
|
+
return new SemVer$10(version$1 instanceof SemVer$10 ? version$1.version : version$1, options).inc(release, identifier, identifierBase).version;
|
|
21357
|
+
} catch (er) {
|
|
21358
|
+
return null;
|
|
21359
|
+
}
|
|
21360
|
+
};
|
|
21361
|
+
module.exports = inc$1;
|
|
21362
|
+
} });
|
|
21363
|
+
|
|
21364
|
+
//#endregion
|
|
21365
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
|
|
21366
|
+
var require_diff = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js"(exports, module) {
|
|
21367
|
+
const parse$3 = require_parse$2();
|
|
21368
|
+
const diff$1 = (version1, version2) => {
|
|
21369
|
+
const v1 = parse$3(version1, null, true);
|
|
21370
|
+
const v2 = parse$3(version2, null, true);
|
|
21371
|
+
const comparison = v1.compare(v2);
|
|
21372
|
+
if (comparison === 0) return null;
|
|
21373
|
+
const v1Higher = comparison > 0;
|
|
21374
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
21375
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
21376
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
21377
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
21378
|
+
if (lowHasPre && !highHasPre) {
|
|
21379
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
21380
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
21381
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
21382
|
+
return "patch";
|
|
21383
|
+
}
|
|
21384
|
+
}
|
|
21385
|
+
const prefix = highHasPre ? "pre" : "";
|
|
21386
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
21387
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
21388
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
21389
|
+
return "prerelease";
|
|
21390
|
+
};
|
|
21391
|
+
module.exports = diff$1;
|
|
21392
|
+
} });
|
|
21393
|
+
|
|
21394
|
+
//#endregion
|
|
21395
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
|
|
21396
|
+
var require_major = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js"(exports, module) {
|
|
21397
|
+
const SemVer$9 = require_semver$1();
|
|
21398
|
+
const major$1 = (a$1, loose) => new SemVer$9(a$1, loose).major;
|
|
21399
|
+
module.exports = major$1;
|
|
21400
|
+
} });
|
|
21401
|
+
|
|
21402
|
+
//#endregion
|
|
21403
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
|
|
21404
|
+
var require_minor = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js"(exports, module) {
|
|
21405
|
+
const SemVer$8 = require_semver$1();
|
|
21406
|
+
const minor$1 = (a$1, loose) => new SemVer$8(a$1, loose).minor;
|
|
21407
|
+
module.exports = minor$1;
|
|
21408
|
+
} });
|
|
21409
|
+
|
|
21410
|
+
//#endregion
|
|
21411
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
|
|
21412
|
+
var require_patch = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js"(exports, module) {
|
|
21413
|
+
const SemVer$7 = require_semver$1();
|
|
21414
|
+
const patch$1 = (a$1, loose) => new SemVer$7(a$1, loose).patch;
|
|
21415
|
+
module.exports = patch$1;
|
|
21416
|
+
} });
|
|
21417
|
+
|
|
21418
|
+
//#endregion
|
|
21419
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
|
|
21420
|
+
var require_prerelease = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
21421
|
+
const parse$2 = require_parse$2();
|
|
21422
|
+
const prerelease$1 = (version$1, options) => {
|
|
21423
|
+
const parsed = parse$2(version$1, options);
|
|
21424
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
21425
|
+
};
|
|
21426
|
+
module.exports = prerelease$1;
|
|
21427
|
+
} });
|
|
21428
|
+
|
|
21429
|
+
//#endregion
|
|
21430
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
|
|
21431
|
+
var require_rcompare = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
21432
|
+
const compare$4 = require_compare();
|
|
21433
|
+
const rcompare$1 = (a$1, b, loose) => compare$4(b, a$1, loose);
|
|
21434
|
+
module.exports = rcompare$1;
|
|
21435
|
+
} });
|
|
21436
|
+
|
|
21437
|
+
//#endregion
|
|
21438
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
|
|
21439
|
+
var require_compare_loose = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
21440
|
+
const compare$3 = require_compare();
|
|
21441
|
+
const compareLoose$1 = (a$1, b) => compare$3(a$1, b, true);
|
|
21442
|
+
module.exports = compareLoose$1;
|
|
21443
|
+
} });
|
|
21444
|
+
|
|
21445
|
+
//#endregion
|
|
21446
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
|
|
21447
|
+
var require_compare_build = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
21448
|
+
const SemVer$6 = require_semver$1();
|
|
21449
|
+
const compareBuild$3 = (a$1, b, loose) => {
|
|
21450
|
+
const versionA = new SemVer$6(a$1, loose);
|
|
21451
|
+
const versionB = new SemVer$6(b, loose);
|
|
21452
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
21453
|
+
};
|
|
21454
|
+
module.exports = compareBuild$3;
|
|
21455
|
+
} });
|
|
21456
|
+
|
|
21457
|
+
//#endregion
|
|
21458
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
|
|
21459
|
+
var require_sort = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js"(exports, module) {
|
|
21460
|
+
const compareBuild$2 = require_compare_build();
|
|
21461
|
+
const sort$1 = (list, loose) => list.sort((a$1, b) => compareBuild$2(a$1, b, loose));
|
|
21462
|
+
module.exports = sort$1;
|
|
21463
|
+
} });
|
|
21464
|
+
|
|
21465
|
+
//#endregion
|
|
21466
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
|
|
21467
|
+
var require_rsort = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
21468
|
+
const compareBuild$1 = require_compare_build();
|
|
21469
|
+
const rsort$1 = (list, loose) => list.sort((a$1, b) => compareBuild$1(b, a$1, loose));
|
|
21470
|
+
module.exports = rsort$1;
|
|
21471
|
+
} });
|
|
21472
|
+
|
|
21473
|
+
//#endregion
|
|
21474
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
|
|
21475
|
+
var require_coerce = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
21476
|
+
const SemVer$5 = require_semver$1();
|
|
21477
|
+
const parse$1 = require_parse$2();
|
|
21478
|
+
const { safeRe: re, t } = require_re();
|
|
21479
|
+
const coerce$1 = (version$1, options) => {
|
|
21480
|
+
if (version$1 instanceof SemVer$5) return version$1;
|
|
21481
|
+
if (typeof version$1 === "number") version$1 = String(version$1);
|
|
21482
|
+
if (typeof version$1 !== "string") return null;
|
|
21483
|
+
options = options || {};
|
|
21484
|
+
let match = null;
|
|
21485
|
+
if (!options.rtl) match = version$1.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
21486
|
+
else {
|
|
21487
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
21488
|
+
let next;
|
|
21489
|
+
while ((next = coerceRtlRegex.exec(version$1)) && (!match || match.index + match[0].length !== version$1.length)) {
|
|
21490
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
21491
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
21492
|
+
}
|
|
21493
|
+
coerceRtlRegex.lastIndex = -1;
|
|
21494
|
+
}
|
|
21495
|
+
if (match === null) return null;
|
|
21496
|
+
const major$2 = match[2];
|
|
21497
|
+
const minor$2 = match[3] || "0";
|
|
21498
|
+
const patch$2 = match[4] || "0";
|
|
21499
|
+
const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
21500
|
+
const build$1 = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
21501
|
+
return parse$1(`${major$2}.${minor$2}.${patch$2}${prerelease$2}${build$1}`, options);
|
|
21502
|
+
};
|
|
21503
|
+
module.exports = coerce$1;
|
|
21504
|
+
} });
|
|
21505
|
+
|
|
21506
|
+
//#endregion
|
|
21507
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
|
|
21508
|
+
var require_satisfies = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
21509
|
+
const Range$8 = require_range();
|
|
21510
|
+
const satisfies$4 = (version$1, range, options) => {
|
|
21511
|
+
try {
|
|
21512
|
+
range = new Range$8(range, options);
|
|
21513
|
+
} catch (er) {
|
|
21514
|
+
return false;
|
|
21515
|
+
}
|
|
21516
|
+
return range.test(version$1);
|
|
21517
|
+
};
|
|
21518
|
+
module.exports = satisfies$4;
|
|
21519
|
+
} });
|
|
21520
|
+
|
|
21521
|
+
//#endregion
|
|
21522
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
|
|
21523
|
+
var require_to_comparators = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
21524
|
+
const Range$7 = require_range();
|
|
21525
|
+
const toComparators$1 = (range, options) => new Range$7(range, options).set.map((comp) => comp.map((c$1) => c$1.value).join(" ").trim().split(" "));
|
|
21526
|
+
module.exports = toComparators$1;
|
|
21527
|
+
} });
|
|
21528
|
+
|
|
21529
|
+
//#endregion
|
|
21530
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
|
|
21531
|
+
var require_max_satisfying = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
21532
|
+
const SemVer$4 = require_semver$1();
|
|
21533
|
+
const Range$6 = require_range();
|
|
21534
|
+
const maxSatisfying$1 = (versions, range, options) => {
|
|
21535
|
+
let max = null;
|
|
21536
|
+
let maxSV = null;
|
|
21537
|
+
let rangeObj = null;
|
|
21538
|
+
try {
|
|
21539
|
+
rangeObj = new Range$6(range, options);
|
|
21540
|
+
} catch (er) {
|
|
21541
|
+
return null;
|
|
21542
|
+
}
|
|
21543
|
+
versions.forEach((v) => {
|
|
21544
|
+
if (rangeObj.test(v)) {
|
|
21545
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
21546
|
+
max = v;
|
|
21547
|
+
maxSV = new SemVer$4(max, options);
|
|
21548
|
+
}
|
|
21549
|
+
}
|
|
21550
|
+
});
|
|
21551
|
+
return max;
|
|
21552
|
+
};
|
|
21553
|
+
module.exports = maxSatisfying$1;
|
|
21554
|
+
} });
|
|
21555
|
+
|
|
21556
|
+
//#endregion
|
|
21557
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
|
|
21558
|
+
var require_min_satisfying = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
21559
|
+
const SemVer$3 = require_semver$1();
|
|
21560
|
+
const Range$5 = require_range();
|
|
21561
|
+
const minSatisfying$1 = (versions, range, options) => {
|
|
21562
|
+
let min = null;
|
|
21563
|
+
let minSV = null;
|
|
21564
|
+
let rangeObj = null;
|
|
21565
|
+
try {
|
|
21566
|
+
rangeObj = new Range$5(range, options);
|
|
21567
|
+
} catch (er) {
|
|
21568
|
+
return null;
|
|
21569
|
+
}
|
|
21570
|
+
versions.forEach((v) => {
|
|
21571
|
+
if (rangeObj.test(v)) {
|
|
21572
|
+
if (!min || minSV.compare(v) === 1) {
|
|
21573
|
+
min = v;
|
|
21574
|
+
minSV = new SemVer$3(min, options);
|
|
21575
|
+
}
|
|
21576
|
+
}
|
|
21577
|
+
});
|
|
21578
|
+
return min;
|
|
21579
|
+
};
|
|
21580
|
+
module.exports = minSatisfying$1;
|
|
21581
|
+
} });
|
|
21582
|
+
|
|
21583
|
+
//#endregion
|
|
21584
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
|
|
21585
|
+
var require_min_version = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
21586
|
+
const SemVer$2 = require_semver$1();
|
|
21587
|
+
const Range$4 = require_range();
|
|
21588
|
+
const gt$2 = require_gt();
|
|
21589
|
+
const minVersion$1 = (range, loose) => {
|
|
21590
|
+
range = new Range$4(range, loose);
|
|
21591
|
+
let minver = new SemVer$2("0.0.0");
|
|
21592
|
+
if (range.test(minver)) return minver;
|
|
21593
|
+
minver = new SemVer$2("0.0.0-0");
|
|
21594
|
+
if (range.test(minver)) return minver;
|
|
21595
|
+
minver = null;
|
|
21596
|
+
for (let i$2 = 0; i$2 < range.set.length; ++i$2) {
|
|
21597
|
+
const comparators = range.set[i$2];
|
|
21598
|
+
let setMin = null;
|
|
21599
|
+
comparators.forEach((comparator) => {
|
|
21600
|
+
const compver = new SemVer$2(comparator.semver.version);
|
|
21601
|
+
switch (comparator.operator) {
|
|
21602
|
+
case ">":
|
|
21603
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
21604
|
+
else compver.prerelease.push(0);
|
|
21605
|
+
compver.raw = compver.format();
|
|
21606
|
+
case "":
|
|
21607
|
+
case ">=":
|
|
21608
|
+
if (!setMin || gt$2(compver, setMin)) setMin = compver;
|
|
21609
|
+
break;
|
|
21610
|
+
case "<":
|
|
21611
|
+
case "<=": break;
|
|
21612
|
+
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
21613
|
+
}
|
|
21614
|
+
});
|
|
21615
|
+
if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
|
|
21616
|
+
}
|
|
21617
|
+
if (minver && range.test(minver)) return minver;
|
|
21618
|
+
return null;
|
|
21619
|
+
};
|
|
21620
|
+
module.exports = minVersion$1;
|
|
21621
|
+
} });
|
|
21622
|
+
|
|
21623
|
+
//#endregion
|
|
21624
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
|
|
21625
|
+
var require_outside = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
21626
|
+
const SemVer$1 = require_semver$1();
|
|
21627
|
+
const Comparator$2 = require_comparator();
|
|
21628
|
+
const { ANY: ANY$1 } = Comparator$2;
|
|
21629
|
+
const Range$3 = require_range();
|
|
21630
|
+
const satisfies$3 = require_satisfies();
|
|
21631
|
+
const gt$1 = require_gt();
|
|
21632
|
+
const lt$1 = require_lt();
|
|
21633
|
+
const lte$1 = require_lte();
|
|
21634
|
+
const gte$1 = require_gte();
|
|
21635
|
+
const outside$3 = (version$1, range, hilo, options) => {
|
|
21636
|
+
version$1 = new SemVer$1(version$1, options);
|
|
21637
|
+
range = new Range$3(range, options);
|
|
21638
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
21639
|
+
switch (hilo) {
|
|
21640
|
+
case ">":
|
|
21641
|
+
gtfn = gt$1;
|
|
21642
|
+
ltefn = lte$1;
|
|
21643
|
+
ltfn = lt$1;
|
|
21644
|
+
comp = ">";
|
|
21645
|
+
ecomp = ">=";
|
|
21646
|
+
break;
|
|
21647
|
+
case "<":
|
|
21648
|
+
gtfn = lt$1;
|
|
21649
|
+
ltefn = gte$1;
|
|
21650
|
+
ltfn = gt$1;
|
|
21651
|
+
comp = "<";
|
|
21652
|
+
ecomp = "<=";
|
|
21653
|
+
break;
|
|
21654
|
+
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
21655
|
+
}
|
|
21656
|
+
if (satisfies$3(version$1, range, options)) return false;
|
|
21657
|
+
for (let i$2 = 0; i$2 < range.set.length; ++i$2) {
|
|
21658
|
+
const comparators = range.set[i$2];
|
|
21659
|
+
let high = null;
|
|
21660
|
+
let low = null;
|
|
21661
|
+
comparators.forEach((comparator) => {
|
|
21662
|
+
if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
|
|
21663
|
+
high = high || comparator;
|
|
21664
|
+
low = low || comparator;
|
|
21665
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
21666
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
21667
|
+
});
|
|
21668
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
21669
|
+
if ((!low.operator || low.operator === comp) && ltefn(version$1, low.semver)) return false;
|
|
21670
|
+
else if (low.operator === ecomp && ltfn(version$1, low.semver)) return false;
|
|
21671
|
+
}
|
|
21672
|
+
return true;
|
|
21673
|
+
};
|
|
21674
|
+
module.exports = outside$3;
|
|
21675
|
+
} });
|
|
21676
|
+
|
|
21677
|
+
//#endregion
|
|
21678
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
|
|
21679
|
+
var require_gtr = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
21680
|
+
const outside$2 = require_outside();
|
|
21681
|
+
const gtr$1 = (version$1, range, options) => outside$2(version$1, range, ">", options);
|
|
21682
|
+
module.exports = gtr$1;
|
|
21683
|
+
} });
|
|
21684
|
+
|
|
21685
|
+
//#endregion
|
|
21686
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
|
|
21687
|
+
var require_ltr = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
21688
|
+
const outside$1 = require_outside();
|
|
21689
|
+
const ltr$1 = (version$1, range, options) => outside$1(version$1, range, "<", options);
|
|
21690
|
+
module.exports = ltr$1;
|
|
21691
|
+
} });
|
|
21692
|
+
|
|
21693
|
+
//#endregion
|
|
21694
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
|
|
21695
|
+
var require_intersects = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
21696
|
+
const Range$2 = require_range();
|
|
21697
|
+
const intersects$1 = (r1, r2, options) => {
|
|
21698
|
+
r1 = new Range$2(r1, options);
|
|
21699
|
+
r2 = new Range$2(r2, options);
|
|
21700
|
+
return r1.intersects(r2, options);
|
|
21701
|
+
};
|
|
21702
|
+
module.exports = intersects$1;
|
|
21703
|
+
} });
|
|
21704
|
+
|
|
21705
|
+
//#endregion
|
|
21706
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
|
|
21707
|
+
var require_simplify = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
21708
|
+
const satisfies$2 = require_satisfies();
|
|
21709
|
+
const compare$2 = require_compare();
|
|
21710
|
+
module.exports = (versions, range, options) => {
|
|
21711
|
+
const set = [];
|
|
21712
|
+
let first = null;
|
|
21713
|
+
let prev = null;
|
|
21714
|
+
const v = versions.sort((a$1, b) => compare$2(a$1, b, options));
|
|
21715
|
+
for (const version$1 of v) {
|
|
21716
|
+
const included = satisfies$2(version$1, range, options);
|
|
21717
|
+
if (included) {
|
|
21718
|
+
prev = version$1;
|
|
21719
|
+
if (!first) first = version$1;
|
|
21720
|
+
} else {
|
|
21721
|
+
if (prev) set.push([first, prev]);
|
|
21722
|
+
prev = null;
|
|
21723
|
+
first = null;
|
|
21724
|
+
}
|
|
21725
|
+
}
|
|
21726
|
+
if (first) set.push([first, null]);
|
|
21727
|
+
const ranges = [];
|
|
21728
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
21729
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
21730
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
21731
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
21732
|
+
else ranges.push(`${min} - ${max}`);
|
|
21733
|
+
const simplified = ranges.join(" || ");
|
|
21734
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
21735
|
+
return simplified.length < original.length ? simplified : range;
|
|
21736
|
+
};
|
|
21737
|
+
} });
|
|
21738
|
+
|
|
21739
|
+
//#endregion
|
|
21740
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
|
|
21741
|
+
var require_subset = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
21742
|
+
const Range$1 = require_range();
|
|
21743
|
+
const Comparator$1 = require_comparator();
|
|
21744
|
+
const { ANY } = Comparator$1;
|
|
21745
|
+
const satisfies$1 = require_satisfies();
|
|
21746
|
+
const compare$1 = require_compare();
|
|
21747
|
+
const subset$1 = (sub, dom$2, options = {}) => {
|
|
21748
|
+
if (sub === dom$2) return true;
|
|
21749
|
+
sub = new Range$1(sub, options);
|
|
21750
|
+
dom$2 = new Range$1(dom$2, options);
|
|
21751
|
+
let sawNonNull = false;
|
|
21752
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
21753
|
+
for (const simpleDom of dom$2.set) {
|
|
21754
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
21755
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
21756
|
+
if (isSub) continue OUTER;
|
|
21757
|
+
}
|
|
21758
|
+
if (sawNonNull) return false;
|
|
21759
|
+
}
|
|
21760
|
+
return true;
|
|
21761
|
+
};
|
|
21762
|
+
const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
|
|
21763
|
+
const minimumVersion = [new Comparator$1(">=0.0.0")];
|
|
21764
|
+
const simpleSubset = (sub, dom$2, options) => {
|
|
21765
|
+
if (sub === dom$2) return true;
|
|
21766
|
+
if (sub.length === 1 && sub[0].semver === ANY) if (dom$2.length === 1 && dom$2[0].semver === ANY) return true;
|
|
21767
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
21768
|
+
else sub = minimumVersion;
|
|
21769
|
+
if (dom$2.length === 1 && dom$2[0].semver === ANY) if (options.includePrerelease) return true;
|
|
21770
|
+
else dom$2 = minimumVersion;
|
|
21771
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
21772
|
+
let gt$5, lt$4;
|
|
21773
|
+
for (const c$1 of sub) if (c$1.operator === ">" || c$1.operator === ">=") gt$5 = higherGT(gt$5, c$1, options);
|
|
21774
|
+
else if (c$1.operator === "<" || c$1.operator === "<=") lt$4 = lowerLT(lt$4, c$1, options);
|
|
21775
|
+
else eqSet.add(c$1.semver);
|
|
21776
|
+
if (eqSet.size > 1) return null;
|
|
21777
|
+
let gtltComp;
|
|
21778
|
+
if (gt$5 && lt$4) {
|
|
21779
|
+
gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
|
|
21780
|
+
if (gtltComp > 0) return null;
|
|
21781
|
+
else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
|
|
21782
|
+
}
|
|
21783
|
+
for (const eq$3 of eqSet) {
|
|
21784
|
+
if (gt$5 && !satisfies$1(eq$3, String(gt$5), options)) return null;
|
|
21785
|
+
if (lt$4 && !satisfies$1(eq$3, String(lt$4), options)) return null;
|
|
21786
|
+
for (const c$1 of dom$2) if (!satisfies$1(eq$3, String(c$1), options)) return false;
|
|
21787
|
+
return true;
|
|
21788
|
+
}
|
|
21789
|
+
let higher, lower;
|
|
21790
|
+
let hasDomLT, hasDomGT;
|
|
21791
|
+
let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
|
|
21792
|
+
let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
|
|
21793
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
21794
|
+
for (const c$1 of dom$2) {
|
|
21795
|
+
hasDomGT = hasDomGT || c$1.operator === ">" || c$1.operator === ">=";
|
|
21796
|
+
hasDomLT = hasDomLT || c$1.operator === "<" || c$1.operator === "<=";
|
|
21797
|
+
if (gt$5) {
|
|
21798
|
+
if (needDomGTPre) {
|
|
21799
|
+
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;
|
|
21800
|
+
}
|
|
21801
|
+
if (c$1.operator === ">" || c$1.operator === ">=") {
|
|
21802
|
+
higher = higherGT(gt$5, c$1, options);
|
|
21803
|
+
if (higher === c$1 && higher !== gt$5) return false;
|
|
21804
|
+
} else if (gt$5.operator === ">=" && !satisfies$1(gt$5.semver, String(c$1), options)) return false;
|
|
21805
|
+
}
|
|
21806
|
+
if (lt$4) {
|
|
21807
|
+
if (needDomLTPre) {
|
|
21808
|
+
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;
|
|
21809
|
+
}
|
|
21810
|
+
if (c$1.operator === "<" || c$1.operator === "<=") {
|
|
21811
|
+
lower = lowerLT(lt$4, c$1, options);
|
|
21812
|
+
if (lower === c$1 && lower !== lt$4) return false;
|
|
21813
|
+
} else if (lt$4.operator === "<=" && !satisfies$1(lt$4.semver, String(c$1), options)) return false;
|
|
21814
|
+
}
|
|
21815
|
+
if (!c$1.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
|
|
21816
|
+
}
|
|
21817
|
+
if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
|
|
21818
|
+
if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
|
|
21819
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
21820
|
+
return true;
|
|
21821
|
+
};
|
|
21822
|
+
const higherGT = (a$1, b, options) => {
|
|
21823
|
+
if (!a$1) return b;
|
|
21824
|
+
const comp = compare$1(a$1.semver, b.semver, options);
|
|
21825
|
+
return comp > 0 ? a$1 : comp < 0 ? b : b.operator === ">" && a$1.operator === ">=" ? b : a$1;
|
|
21826
|
+
};
|
|
21827
|
+
const lowerLT = (a$1, b, options) => {
|
|
21828
|
+
if (!a$1) return b;
|
|
21829
|
+
const comp = compare$1(a$1.semver, b.semver, options);
|
|
21830
|
+
return comp < 0 ? a$1 : comp > 0 ? b : b.operator === "<" && a$1.operator === "<=" ? b : a$1;
|
|
21831
|
+
};
|
|
21832
|
+
module.exports = subset$1;
|
|
21833
|
+
} });
|
|
21834
|
+
|
|
21835
|
+
//#endregion
|
|
21836
|
+
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js
|
|
21837
|
+
var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js"(exports, module) {
|
|
21838
|
+
const internalRe = require_re();
|
|
21839
|
+
const constants$2 = require_constants();
|
|
21840
|
+
const SemVer = require_semver$1();
|
|
21841
|
+
const identifiers = require_identifiers();
|
|
21842
|
+
const parse = require_parse$2();
|
|
21843
|
+
const valid = require_valid();
|
|
21844
|
+
const clean = require_clean();
|
|
21845
|
+
const inc = require_inc();
|
|
21846
|
+
const diff = require_diff();
|
|
21847
|
+
const major = require_major();
|
|
21848
|
+
const minor = require_minor();
|
|
21849
|
+
const patch = require_patch();
|
|
21850
|
+
const prerelease = require_prerelease();
|
|
21851
|
+
const compare = require_compare();
|
|
21852
|
+
const rcompare = require_rcompare();
|
|
21853
|
+
const compareLoose = require_compare_loose();
|
|
21854
|
+
const compareBuild = require_compare_build();
|
|
21855
|
+
const sort = require_sort();
|
|
21856
|
+
const rsort = require_rsort();
|
|
21857
|
+
const gt = require_gt();
|
|
21858
|
+
const lt = require_lt();
|
|
21859
|
+
const eq = require_eq();
|
|
21860
|
+
const neq = require_neq();
|
|
21861
|
+
const gte = require_gte();
|
|
21862
|
+
const lte = require_lte();
|
|
21863
|
+
const cmp = require_cmp();
|
|
21864
|
+
const coerce = require_coerce();
|
|
21865
|
+
const Comparator = require_comparator();
|
|
21866
|
+
const Range = require_range();
|
|
21867
|
+
const satisfies = require_satisfies();
|
|
21868
|
+
const toComparators = require_to_comparators();
|
|
21869
|
+
const maxSatisfying = require_max_satisfying();
|
|
21870
|
+
const minSatisfying = require_min_satisfying();
|
|
21871
|
+
const minVersion = require_min_version();
|
|
21872
|
+
const validRange = require_valid$1();
|
|
21873
|
+
const outside = require_outside();
|
|
21874
|
+
const gtr = require_gtr();
|
|
21875
|
+
const ltr = require_ltr();
|
|
21876
|
+
const intersects = require_intersects();
|
|
21877
|
+
const simplifyRange = require_simplify();
|
|
21878
|
+
const subset = require_subset();
|
|
21879
|
+
module.exports = {
|
|
21880
|
+
parse,
|
|
21881
|
+
valid,
|
|
21882
|
+
clean,
|
|
21883
|
+
inc,
|
|
21884
|
+
diff,
|
|
21885
|
+
major,
|
|
21886
|
+
minor,
|
|
21887
|
+
patch,
|
|
21888
|
+
prerelease,
|
|
21889
|
+
compare,
|
|
21890
|
+
rcompare,
|
|
21891
|
+
compareLoose,
|
|
21892
|
+
compareBuild,
|
|
21893
|
+
sort,
|
|
21894
|
+
rsort,
|
|
21895
|
+
gt,
|
|
21896
|
+
lt,
|
|
21897
|
+
eq,
|
|
21898
|
+
neq,
|
|
21899
|
+
gte,
|
|
21900
|
+
lte,
|
|
21901
|
+
cmp,
|
|
21902
|
+
coerce,
|
|
21903
|
+
Comparator,
|
|
21904
|
+
Range,
|
|
21905
|
+
satisfies,
|
|
21906
|
+
toComparators,
|
|
21907
|
+
maxSatisfying,
|
|
21908
|
+
minSatisfying,
|
|
21909
|
+
minVersion,
|
|
21910
|
+
validRange,
|
|
21911
|
+
outside,
|
|
21912
|
+
gtr,
|
|
21913
|
+
ltr,
|
|
21914
|
+
intersects,
|
|
21915
|
+
simplifyRange,
|
|
21916
|
+
subset,
|
|
21917
|
+
SemVer,
|
|
21918
|
+
re: internalRe.re,
|
|
21919
|
+
src: internalRe.src,
|
|
21920
|
+
tokens: internalRe.t,
|
|
21921
|
+
SEMVER_SPEC_VERSION: constants$2.SEMVER_SPEC_VERSION,
|
|
21922
|
+
RELEASE_TYPES: constants$2.RELEASE_TYPES,
|
|
21923
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
21924
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
21925
|
+
};
|
|
21926
|
+
} });
|
|
21927
|
+
|
|
21928
|
+
//#endregion
|
|
21929
|
+
//#region src/commands/doctor.ts
|
|
21930
|
+
var import_semver = __toESM(require_semver());
|
|
21931
|
+
/**
|
|
21932
|
+
* Checks if two versions (or version and range) are compatible.
|
|
21933
|
+
* @param versionA - First version or range string.
|
|
21934
|
+
* @param versionB - Second version or range string.
|
|
21935
|
+
* @returns True if compatible, false otherwise.
|
|
21936
|
+
*/
|
|
21937
|
+
function areVersionsCompatible(versionA, versionB) {
|
|
21938
|
+
if (versionA === versionB) return true;
|
|
21939
|
+
const options = { includePrerelease: true };
|
|
21940
|
+
if (import_semver.valid(versionA) && import_semver.validRange(versionB) && import_semver.satisfies(versionA, versionB, options)) return true;
|
|
21941
|
+
if (import_semver.valid(versionB) && import_semver.validRange(versionA) && import_semver.satisfies(versionB, versionA, options)) return true;
|
|
21942
|
+
return false;
|
|
21943
|
+
}
|
|
21944
|
+
/**
|
|
21945
|
+
* Performs health check on Hot Updater installation
|
|
21946
|
+
* @param cwd - Current working directory (optional)
|
|
21947
|
+
* @returns true if everything is healthy, or DoctorResult with details if there are issues
|
|
21948
|
+
*/
|
|
21949
|
+
async function doctor(cwd = getCwd()) {
|
|
21950
|
+
try {
|
|
21951
|
+
const packageResult = await readPackageUp({ cwd });
|
|
21952
|
+
if (!packageResult) return {
|
|
21953
|
+
success: false,
|
|
21954
|
+
error: "Could not find package.json"
|
|
21955
|
+
};
|
|
21956
|
+
const packageJson = packageResult.packageJson;
|
|
21957
|
+
const packageJsonPath = packageResult.path;
|
|
21958
|
+
const allDependencies = merge(packageJson.dependencies ?? {}, packageJson.devDependencies ?? {});
|
|
21959
|
+
const hotUpdaterVersion = allDependencies["hot-updater"];
|
|
21960
|
+
if (!hotUpdaterVersion) return {
|
|
21961
|
+
success: false,
|
|
21962
|
+
error: "hot-updater CLI not found. Please install it first."
|
|
21963
|
+
};
|
|
21964
|
+
const hotUpdaterPackages = Object.keys(allDependencies).filter((key) => key.startsWith("@hot-updater/"));
|
|
21965
|
+
const versionMismatches = [];
|
|
21966
|
+
for (const packageName of hotUpdaterPackages) {
|
|
21967
|
+
const currentVersion = allDependencies[packageName];
|
|
21968
|
+
if (hotUpdaterVersion && currentVersion && !areVersionsCompatible(currentVersion, hotUpdaterVersion)) versionMismatches.push({
|
|
21969
|
+
packageName,
|
|
21970
|
+
currentVersion,
|
|
21971
|
+
expectedVersion: hotUpdaterVersion
|
|
21972
|
+
});
|
|
21973
|
+
}
|
|
21974
|
+
const details = {
|
|
21975
|
+
hotUpdaterVersion,
|
|
21976
|
+
packageJsonPath,
|
|
21977
|
+
installedHotUpdaterPackages: hotUpdaterPackages
|
|
21978
|
+
};
|
|
21979
|
+
if (versionMismatches.length > 0) details.versionMismatches = versionMismatches;
|
|
21980
|
+
const hasIssues = versionMismatches.length > 0;
|
|
21981
|
+
if (hasIssues) return {
|
|
21982
|
+
success: false,
|
|
21983
|
+
details
|
|
21984
|
+
};
|
|
21985
|
+
return true;
|
|
21986
|
+
} catch (error) {
|
|
21987
|
+
return {
|
|
21988
|
+
success: false,
|
|
21989
|
+
error: error.message
|
|
21990
|
+
};
|
|
21991
|
+
}
|
|
21992
|
+
}
|
|
21993
|
+
/**
|
|
21994
|
+
* Fix version mismatches in package.json
|
|
21995
|
+
* This is a separate utility function for CLI usage
|
|
21996
|
+
*/
|
|
21997
|
+
async function fixVersionMismatches(packageJsonPath, versionMismatches) {
|
|
21998
|
+
const packageResult = await fs.promises.readFile(packageJsonPath, "utf-8");
|
|
21999
|
+
if (!packageResult) throw new Error("Could not read package.json");
|
|
22000
|
+
const packageJson = JSON.parse(packageResult);
|
|
22001
|
+
for (const mismatch of versionMismatches) if (packageJson.dependencies?.[mismatch.packageName]) packageJson.dependencies[mismatch.packageName] = mismatch.expectedVersion;
|
|
22002
|
+
else if (packageJson.devDependencies?.[mismatch.packageName]) packageJson.devDependencies[mismatch.packageName] = mismatch.expectedVersion;
|
|
22003
|
+
const content = `${JSON.stringify(packageJson, null, 2)}\n`;
|
|
22004
|
+
await fs.promises.writeFile(packageJsonPath, content);
|
|
22005
|
+
}
|
|
22006
|
+
const handleDoctor = async ({ fix }) => {
|
|
22007
|
+
p$1.intro("Checking the health of Hot Updater.");
|
|
22008
|
+
const result = await doctor();
|
|
22009
|
+
if (result === true) {
|
|
22010
|
+
p$1.log.success("✅ All Hot Updater checks passed!");
|
|
22011
|
+
p$1.outro("Hot Updater is healthy.");
|
|
22012
|
+
return;
|
|
22013
|
+
}
|
|
22014
|
+
if (result.error) {
|
|
22015
|
+
p$1.log.error(result.error);
|
|
22016
|
+
p$1.outro("Doctor check failed.");
|
|
22017
|
+
return;
|
|
22018
|
+
}
|
|
22019
|
+
const { details } = result;
|
|
22020
|
+
if (details?.hotUpdaterVersion) p$1.log.info(`hot-updater CLI version: ${details.hotUpdaterVersion}`);
|
|
22021
|
+
if (details?.versionMismatches && details.versionMismatches.length > 0) {
|
|
22022
|
+
p$1.log.warn("Version mismatches found:");
|
|
22023
|
+
for (const mismatch of details.versionMismatches) p$1.log.error(`❌ ${mismatch.packageName}: ${mismatch.currentVersion} (expected ${mismatch.expectedVersion})`);
|
|
22024
|
+
if (fix && details.packageJsonPath) try {
|
|
22025
|
+
await fixVersionMismatches(details.packageJsonPath, details.versionMismatches);
|
|
22026
|
+
p$1.log.success("✅ Fixed version mismatches in package.json");
|
|
22027
|
+
p$1.log.info("Run your package manager to install the updated versions.");
|
|
22028
|
+
} catch (error) {
|
|
22029
|
+
p$1.log.error(`Failed to fix versions: ${error.message}`);
|
|
22030
|
+
}
|
|
22031
|
+
else if (!fix) {
|
|
22032
|
+
p$1.log.info("Run with --fix to automatically update versions.");
|
|
22033
|
+
process.exit(1);
|
|
22034
|
+
}
|
|
22035
|
+
}
|
|
22036
|
+
p$1.outro("Doctor check complete.");
|
|
22037
|
+
};
|
|
22038
|
+
|
|
22039
|
+
//#endregion
|
|
22040
|
+
//#region src/index.ts
|
|
22041
|
+
var import_picocolors = __toESM(require_picocolors());
|
|
22042
|
+
var import_valid = __toESM(require_valid$1());
|
|
22043
|
+
const DEFAULT_CHANNEL = "production";
|
|
22044
|
+
const program = new Command();
|
|
22045
|
+
program.name("hot-updater").description(banner(version)).version(version);
|
|
22046
|
+
program.command("init").description("Initialize Hot Updater").action(init);
|
|
22047
|
+
program.command("doctor").description("Check the health of Hot Updater").option("-f, --fix", "fix the issues", false).action(handleDoctor);
|
|
22048
|
+
const fingerprintCommand = program.command("fingerprint").description("Generate fingerprint");
|
|
22049
|
+
fingerprintCommand.action(handleFingerprint);
|
|
22050
|
+
fingerprintCommand.command("create").description("Create fingerprint").action(handleCreateFingerprint);
|
|
22051
|
+
const channelCommand = program.command("channel").description("Manage channels");
|
|
22052
|
+
channelCommand.action(handleChannel);
|
|
22053
|
+
channelCommand.command("set").description("Set the channel for Android (BuildConfig) and iOS (Info.plist)").argument("<channel>", "the channel to set").action(handleSetChannel);
|
|
21318
22054
|
program.command("deploy").description("deploy a new version").addOption(new Option("-p, --platform <platform>", "specify the platform").choices(["ios", "android"])).addOption(new Option("-t, --target-app-version <targetAppVersion>", "specify the target app version (semver format e.g. 1.0.0, 1.x.x)").argParser((value) => {
|
|
21319
22055
|
if (!(0, import_valid.default)(value)) {
|
|
21320
22056
|
p.log.error("Invalid semver format (e.g. 1.0.0, 1.x.x)");
|
|
@@ -21332,9 +22068,8 @@ program.command("console").description("open the console").action(async () => {
|
|
|
21332
22068
|
});
|
|
21333
22069
|
});
|
|
21334
22070
|
program.command("app-version").description("get the current app version").action(async () => {
|
|
21335
|
-
const
|
|
21336
|
-
const
|
|
21337
|
-
const iosVersion = await getDefaultTargetAppVersion(path$5, "ios");
|
|
22071
|
+
const androidVersion = await getNativeAppVersion("android");
|
|
22072
|
+
const iosVersion = await getNativeAppVersion("ios");
|
|
21338
22073
|
log.info(`Android version: ${androidVersion}`);
|
|
21339
22074
|
log.info(`iOS version: ${iosVersion}`);
|
|
21340
22075
|
});
|