@dpuse/dpuse-development 0.3.744 → 0.3.745
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/dist/dpuse-development.es.js +749 -650
- package/dist/dpuse-development.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ var l = Object.defineProperty, u = /* @__PURE__ */ ((e, t) => {
|
|
|
19
19
|
Position: () => _e,
|
|
20
20
|
SourceLocation: () => ve,
|
|
21
21
|
TokContext: () => P,
|
|
22
|
-
Token: () =>
|
|
22
|
+
Token: () => Xt,
|
|
23
23
|
TokenType: () => x,
|
|
24
24
|
defaultOptions: () => be,
|
|
25
25
|
getLineInfo: () => ye,
|
|
@@ -30,12 +30,12 @@ var l = Object.defineProperty, u = /* @__PURE__ */ ((e, t) => {
|
|
|
30
30
|
lineBreak: () => D,
|
|
31
31
|
lineBreakG: () => ie,
|
|
32
32
|
nonASCIIwhitespace: () => se,
|
|
33
|
-
parse: () =>
|
|
34
|
-
parseExpressionAt: () =>
|
|
33
|
+
parse: () => tn,
|
|
34
|
+
parseExpressionAt: () => nn,
|
|
35
35
|
tokContexts: () => F,
|
|
36
36
|
tokTypes: () => E,
|
|
37
|
-
tokenizer: () =>
|
|
38
|
-
version: () =>
|
|
37
|
+
tokenizer: () => rn,
|
|
38
|
+
version: () => en
|
|
39
39
|
}), d = [
|
|
40
40
|
509,
|
|
41
41
|
0,
|
|
@@ -2438,15 +2438,15 @@ kt.prototype.separatedFrom = function(e) {
|
|
|
2438
2438
|
}, kt.prototype.sibling = function() {
|
|
2439
2439
|
return new kt(this.parent, this.base);
|
|
2440
2440
|
};
|
|
2441
|
-
var
|
|
2441
|
+
var At = function(e) {
|
|
2442
2442
|
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = wt[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
2443
2443
|
};
|
|
2444
|
-
|
|
2444
|
+
At.prototype.reset = function(e, t, n) {
|
|
2445
2445
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2446
2446
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2447
|
-
},
|
|
2447
|
+
}, At.prototype.raise = function(e) {
|
|
2448
2448
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2449
|
-
},
|
|
2449
|
+
}, At.prototype.at = function(e, t) {
|
|
2450
2450
|
t === void 0 && (t = !1);
|
|
2451
2451
|
var n = this.source, r = n.length;
|
|
2452
2452
|
if (e >= r) return -1;
|
|
@@ -2454,21 +2454,21 @@ R.prototype.reset = function(e, t, n) {
|
|
|
2454
2454
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2455
2455
|
var a = n.charCodeAt(e + 1);
|
|
2456
2456
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2457
|
-
},
|
|
2457
|
+
}, At.prototype.nextIndex = function(e, t) {
|
|
2458
2458
|
t === void 0 && (t = !1);
|
|
2459
2459
|
var n = this.source, r = n.length;
|
|
2460
2460
|
if (e >= r) return r;
|
|
2461
2461
|
var i = n.charCodeAt(e), a;
|
|
2462
2462
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2463
|
-
},
|
|
2463
|
+
}, At.prototype.current = function(e) {
|
|
2464
2464
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2465
|
-
},
|
|
2465
|
+
}, At.prototype.lookahead = function(e) {
|
|
2466
2466
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2467
|
-
},
|
|
2467
|
+
}, At.prototype.advance = function(e) {
|
|
2468
2468
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2469
|
-
},
|
|
2469
|
+
}, At.prototype.eat = function(e, t) {
|
|
2470
2470
|
return t === void 0 && (t = !1), this.current(t) === e && (this.advance(t), !0);
|
|
2471
|
-
},
|
|
2471
|
+
}, At.prototype.eatChars = function(e, t) {
|
|
2472
2472
|
t === void 0 && (t = !1);
|
|
2473
2473
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
2474
2474
|
var a = i[r], o = this.at(n, t);
|
|
@@ -2483,12 +2483,12 @@ R.prototype.reset = function(e, t, n) {
|
|
|
2483
2483
|
}
|
|
2484
2484
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
2485
2485
|
};
|
|
2486
|
-
function
|
|
2486
|
+
function jt(e) {
|
|
2487
2487
|
for (var t in e) return !0;
|
|
2488
2488
|
return !1;
|
|
2489
2489
|
}
|
|
2490
2490
|
L.validateRegExpPattern = function(e) {
|
|
2491
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
2491
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && jt(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2492
2492
|
}, L.regexp_pattern = function(e) {
|
|
2493
2493
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
2494
2494
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
@@ -2572,10 +2572,10 @@ L.validateRegExpPattern = function(e) {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
return !1;
|
|
2574
2574
|
}, L.regexp_eatModifiers = function(e) {
|
|
2575
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
2575
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && Mt(n);) t += he(n), e.advance();
|
|
2576
2576
|
return t;
|
|
2577
2577
|
};
|
|
2578
|
-
function
|
|
2578
|
+
function Mt(e) {
|
|
2579
2579
|
return e === 105 || e === 109 || e === 115;
|
|
2580
2580
|
}
|
|
2581
2581
|
L.regexp_eatExtendedAtom = function(e) {
|
|
@@ -2584,13 +2584,13 @@ L.regexp_eatExtendedAtom = function(e) {
|
|
|
2584
2584
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2585
2585
|
}, L.regexp_eatSyntaxCharacter = function(e) {
|
|
2586
2586
|
var t = e.current();
|
|
2587
|
-
return
|
|
2587
|
+
return Nt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2588
2588
|
};
|
|
2589
|
-
function
|
|
2589
|
+
function Nt(e) {
|
|
2590
2590
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
2591
2591
|
}
|
|
2592
2592
|
L.regexp_eatPatternCharacters = function(e) {
|
|
2593
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
2593
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !Nt(n);) e.advance();
|
|
2594
2594
|
return e.pos !== t;
|
|
2595
2595
|
}, L.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2596
2596
|
var t = e.current();
|
|
@@ -2619,16 +2619,16 @@ L.regexp_eatPatternCharacters = function(e) {
|
|
|
2619
2619
|
return !1;
|
|
2620
2620
|
}, L.regexp_eatRegExpIdentifierStart = function(e) {
|
|
2621
2621
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2622
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
2622
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Pt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2623
2623
|
};
|
|
2624
|
-
function
|
|
2624
|
+
function Pt(e) {
|
|
2625
2625
|
return y(e, !0) || e === 36 || e === 95;
|
|
2626
2626
|
}
|
|
2627
2627
|
L.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2628
2628
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2629
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
2629
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Ft(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2630
2630
|
};
|
|
2631
|
-
function
|
|
2631
|
+
function Ft(e) {
|
|
2632
2632
|
return b(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2633
2633
|
}
|
|
2634
2634
|
L.regexp_eatAtomEscape = function(e) {
|
|
@@ -2658,15 +2658,15 @@ L.regexp_eatAtomEscape = function(e) {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
return !1;
|
|
2660
2660
|
}, L.regexp_eatZero = function(e) {
|
|
2661
|
-
return e.current() === 48 && !
|
|
2661
|
+
return e.current() === 48 && !Kt(e.lookahead()) && (e.lastIntValue = 0, e.advance(), !0);
|
|
2662
2662
|
}, L.regexp_eatControlEscape = function(e) {
|
|
2663
2663
|
var t = e.current();
|
|
2664
2664
|
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 && (e.lastIntValue = 13, e.advance(), !0);
|
|
2665
2665
|
}, L.regexp_eatControlLetter = function(e) {
|
|
2666
2666
|
var t = e.current();
|
|
2667
|
-
return
|
|
2667
|
+
return It(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2668
2668
|
};
|
|
2669
|
-
function
|
|
2669
|
+
function It(e) {
|
|
2670
2670
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2671
2671
|
}
|
|
2672
2672
|
L.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
@@ -2685,12 +2685,12 @@ L.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
2685
2685
|
}
|
|
2686
2686
|
return !0;
|
|
2687
2687
|
}
|
|
2688
|
-
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) &&
|
|
2688
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && Lt(e.lastIntValue)) return !0;
|
|
2689
2689
|
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
2690
2690
|
}
|
|
2691
2691
|
return !1;
|
|
2692
2692
|
};
|
|
2693
|
-
function
|
|
2693
|
+
function Lt(e) {
|
|
2694
2694
|
return e >= 0 && e <= 1114111;
|
|
2695
2695
|
}
|
|
2696
2696
|
L.regexp_eatIdentityEscape = function(e) {
|
|
@@ -2708,20 +2708,20 @@ L.regexp_eatIdentityEscape = function(e) {
|
|
|
2708
2708
|
}
|
|
2709
2709
|
return !1;
|
|
2710
2710
|
};
|
|
2711
|
-
var
|
|
2711
|
+
var Rt = 0, zt = 1, R = 2;
|
|
2712
2712
|
L.regexp_eatCharacterClassEscape = function(e) {
|
|
2713
2713
|
var t = e.current();
|
|
2714
|
-
if (
|
|
2714
|
+
if (Bt(t)) return e.lastIntValue = -1, e.advance(), zt;
|
|
2715
2715
|
var n = !1;
|
|
2716
2716
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
2717
2717
|
e.lastIntValue = -1, e.advance();
|
|
2718
2718
|
var r;
|
|
2719
|
-
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r ===
|
|
2719
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === R && e.raise("Invalid property name"), r;
|
|
2720
2720
|
e.raise("Invalid property name");
|
|
2721
2721
|
}
|
|
2722
|
-
return
|
|
2722
|
+
return Rt;
|
|
2723
2723
|
};
|
|
2724
|
-
function
|
|
2724
|
+
function Bt(e) {
|
|
2725
2725
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2726
2726
|
}
|
|
2727
2727
|
L.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
@@ -2730,46 +2730,46 @@ L.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
2730
2730
|
var n = e.lastStringValue;
|
|
2731
2731
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
2732
2732
|
var r = e.lastStringValue;
|
|
2733
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
2733
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), zt;
|
|
2734
2734
|
}
|
|
2735
2735
|
}
|
|
2736
2736
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
2737
2737
|
var i = e.lastStringValue;
|
|
2738
2738
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
2739
2739
|
}
|
|
2740
|
-
return
|
|
2740
|
+
return Rt;
|
|
2741
2741
|
}, L.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2742
2742
|
de(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2743
2743
|
}, L.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2744
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
2745
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return
|
|
2744
|
+
if (e.unicodeProperties.binary.test(t)) return zt;
|
|
2745
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return R;
|
|
2746
2746
|
e.raise("Invalid property name");
|
|
2747
2747
|
}, L.regexp_eatUnicodePropertyName = function(e) {
|
|
2748
2748
|
var t = 0;
|
|
2749
|
-
for (e.lastStringValue = "";
|
|
2749
|
+
for (e.lastStringValue = ""; Vt(t = e.current());) e.lastStringValue += he(t), e.advance();
|
|
2750
2750
|
return e.lastStringValue !== "";
|
|
2751
2751
|
};
|
|
2752
|
-
function
|
|
2753
|
-
return
|
|
2752
|
+
function Vt(e) {
|
|
2753
|
+
return It(e) || e === 95;
|
|
2754
2754
|
}
|
|
2755
2755
|
L.regexp_eatUnicodePropertyValue = function(e) {
|
|
2756
2756
|
var t = 0;
|
|
2757
|
-
for (e.lastStringValue = "";
|
|
2757
|
+
for (e.lastStringValue = ""; Ht(t = e.current());) e.lastStringValue += he(t), e.advance();
|
|
2758
2758
|
return e.lastStringValue !== "";
|
|
2759
2759
|
};
|
|
2760
|
-
function
|
|
2761
|
-
return
|
|
2760
|
+
function Ht(e) {
|
|
2761
|
+
return Vt(e) || Kt(e);
|
|
2762
2762
|
}
|
|
2763
2763
|
L.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2764
2764
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
2765
2765
|
}, L.regexp_eatCharacterClass = function(e) {
|
|
2766
2766
|
if (e.eat(91)) {
|
|
2767
2767
|
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
2768
|
-
return e.eat(93) || e.raise("Unterminated character class"), t && n ===
|
|
2768
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === R && e.raise("Negated character class may contain strings"), !0;
|
|
2769
2769
|
}
|
|
2770
2770
|
return !1;
|
|
2771
2771
|
}, L.regexp_classContents = function(e) {
|
|
2772
|
-
return e.current() === 93 ?
|
|
2772
|
+
return e.current() === 93 ? zt : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), zt);
|
|
2773
2773
|
}, L.regexp_nonEmptyClassRanges = function(e) {
|
|
2774
2774
|
for (; this.regexp_eatClassAtom(e);) {
|
|
2775
2775
|
var t = e.lastIntValue;
|
|
@@ -2784,7 +2784,7 @@ L.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2784
2784
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
2785
2785
|
if (e.switchU) {
|
|
2786
2786
|
var n = e.current();
|
|
2787
|
-
(n === 99 ||
|
|
2787
|
+
(n === 99 || Yt(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
2788
2788
|
}
|
|
2789
2789
|
e.pos = t;
|
|
2790
2790
|
}
|
|
@@ -2800,13 +2800,13 @@ L.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2800
2800
|
}
|
|
2801
2801
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2802
2802
|
}, L.regexp_classSetExpression = function(e) {
|
|
2803
|
-
var t =
|
|
2803
|
+
var t = zt, n;
|
|
2804
2804
|
if (!this.regexp_eatClassSetRange(e)) {
|
|
2805
2805
|
if (n = this.regexp_eatClassSetOperand(e)) {
|
|
2806
|
-
n ===
|
|
2806
|
+
n === R && (t = R);
|
|
2807
2807
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
2808
2808
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
2809
|
-
n !==
|
|
2809
|
+
n !== R && (t = zt);
|
|
2810
2810
|
continue;
|
|
2811
2811
|
}
|
|
2812
2812
|
e.raise("Invalid character in character class");
|
|
@@ -2818,7 +2818,7 @@ L.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2818
2818
|
}
|
|
2819
2819
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
2820
2820
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
2821
|
-
n ===
|
|
2821
|
+
n === R && (t = R);
|
|
2822
2822
|
}
|
|
2823
2823
|
}, L.regexp_eatClassSetRange = function(e) {
|
|
2824
2824
|
var t = e.pos;
|
|
@@ -2832,12 +2832,12 @@ L.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
return !1;
|
|
2834
2834
|
}, L.regexp_eatClassSetOperand = function(e) {
|
|
2835
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
2835
|
+
return this.regexp_eatClassSetCharacter(e) ? zt : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
2836
2836
|
}, L.regexp_eatNestedClass = function(e) {
|
|
2837
2837
|
var t = e.pos;
|
|
2838
2838
|
if (e.eat(91)) {
|
|
2839
2839
|
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
2840
|
-
if (e.eat(93)) return n && r ===
|
|
2840
|
+
if (e.eat(93)) return n && r === R && e.raise("Negated character class may contain strings"), r;
|
|
2841
2841
|
e.pos = t;
|
|
2842
2842
|
}
|
|
2843
2843
|
if (e.eat(92)) {
|
|
@@ -2857,33 +2857,33 @@ L.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
return null;
|
|
2859
2859
|
}, L.regexp_classStringDisjunctionContents = function(e) {
|
|
2860
|
-
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) ===
|
|
2860
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === R && (t = R);
|
|
2861
2861
|
return t;
|
|
2862
2862
|
}, L.regexp_classString = function(e) {
|
|
2863
2863
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
2864
|
-
return t === 1 ?
|
|
2864
|
+
return t === 1 ? zt : R;
|
|
2865
2865
|
}, L.regexp_eatClassSetCharacter = function(e) {
|
|
2866
2866
|
var t = e.pos;
|
|
2867
2867
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
2868
2868
|
var n = e.current();
|
|
2869
|
-
return n < 0 || n === e.lookahead() &&
|
|
2869
|
+
return n < 0 || n === e.lookahead() && Ut(n) || Wt(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
2870
2870
|
};
|
|
2871
|
-
function
|
|
2871
|
+
function Ut(e) {
|
|
2872
2872
|
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
2873
2873
|
}
|
|
2874
|
-
function
|
|
2874
|
+
function Wt(e) {
|
|
2875
2875
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2876
2876
|
}
|
|
2877
2877
|
L.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2878
2878
|
var t = e.current();
|
|
2879
|
-
return
|
|
2879
|
+
return Gt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2880
2880
|
};
|
|
2881
|
-
function
|
|
2881
|
+
function Gt(e) {
|
|
2882
2882
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
2883
2883
|
}
|
|
2884
2884
|
L.regexp_eatClassControlLetter = function(e) {
|
|
2885
2885
|
var t = e.current();
|
|
2886
|
-
return
|
|
2886
|
+
return Kt(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2887
2887
|
}, L.regexp_eatHexEscapeSequence = function(e) {
|
|
2888
2888
|
var t = e.pos;
|
|
2889
2889
|
if (e.eat(120)) {
|
|
@@ -2893,21 +2893,21 @@ L.regexp_eatClassControlLetter = function(e) {
|
|
|
2893
2893
|
return !1;
|
|
2894
2894
|
}, L.regexp_eatDecimalDigits = function(e) {
|
|
2895
2895
|
var t = e.pos, n = 0;
|
|
2896
|
-
for (e.lastIntValue = 0;
|
|
2896
|
+
for (e.lastIntValue = 0; Kt(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
2897
2897
|
return e.pos !== t;
|
|
2898
2898
|
};
|
|
2899
|
-
function
|
|
2899
|
+
function Kt(e) {
|
|
2900
2900
|
return e >= 48 && e <= 57;
|
|
2901
2901
|
}
|
|
2902
2902
|
L.regexp_eatHexDigits = function(e) {
|
|
2903
2903
|
var t = e.pos, n = 0;
|
|
2904
|
-
for (e.lastIntValue = 0;
|
|
2904
|
+
for (e.lastIntValue = 0; qt(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Jt(n), e.advance();
|
|
2905
2905
|
return e.pos !== t;
|
|
2906
2906
|
};
|
|
2907
|
-
function
|
|
2907
|
+
function qt(e) {
|
|
2908
2908
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
2909
2909
|
}
|
|
2910
|
-
function
|
|
2910
|
+
function Jt(e) {
|
|
2911
2911
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2912
2912
|
}
|
|
2913
2913
|
L.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
@@ -2922,9 +2922,9 @@ L.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
2922
2922
|
return !1;
|
|
2923
2923
|
}, L.regexp_eatOctalDigit = function(e) {
|
|
2924
2924
|
var t = e.current();
|
|
2925
|
-
return
|
|
2925
|
+
return Yt(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2926
2926
|
};
|
|
2927
|
-
function
|
|
2927
|
+
function Yt(e) {
|
|
2928
2928
|
return e >= 48 && e <= 55;
|
|
2929
2929
|
}
|
|
2930
2930
|
L.regexp_eatFixedHexDigits = function(e, t) {
|
|
@@ -2932,19 +2932,19 @@ L.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
2932
2932
|
e.lastIntValue = 0;
|
|
2933
2933
|
for (var r = 0; r < t; ++r) {
|
|
2934
2934
|
var i = e.current();
|
|
2935
|
-
if (!
|
|
2936
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
2935
|
+
if (!qt(i)) return e.pos = n, !1;
|
|
2936
|
+
e.lastIntValue = 16 * e.lastIntValue + Jt(i), e.advance();
|
|
2937
2937
|
}
|
|
2938
2938
|
return !0;
|
|
2939
2939
|
};
|
|
2940
|
-
var
|
|
2940
|
+
var Xt = function(e) {
|
|
2941
2941
|
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new ve(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2942
|
-
},
|
|
2943
|
-
|
|
2944
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
2945
|
-
},
|
|
2946
|
-
return this.next(), new
|
|
2947
|
-
}, typeof Symbol < "u" && (
|
|
2942
|
+
}, z = k.prototype;
|
|
2943
|
+
z.next = function(e) {
|
|
2944
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Xt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2945
|
+
}, z.getToken = function() {
|
|
2946
|
+
return this.next(), new Xt(this);
|
|
2947
|
+
}, typeof Symbol < "u" && (z[Symbol.iterator] = function() {
|
|
2948
2948
|
var e = this;
|
|
2949
2949
|
return { next: function() {
|
|
2950
2950
|
var t = e.getToken();
|
|
@@ -2953,28 +2953,28 @@ B.next = function(e) {
|
|
|
2953
2953
|
value: t
|
|
2954
2954
|
};
|
|
2955
2955
|
} };
|
|
2956
|
-
}),
|
|
2956
|
+
}), z.nextToken = function() {
|
|
2957
2957
|
var e = this.curContext();
|
|
2958
2958
|
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(E.eof);
|
|
2959
2959
|
if (e.override) return e.override(this);
|
|
2960
2960
|
this.readToken(this.fullCharCodeAtPos());
|
|
2961
|
-
},
|
|
2961
|
+
}, z.readToken = function(e) {
|
|
2962
2962
|
return y(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2963
|
-
},
|
|
2963
|
+
}, z.fullCharCodeAt = function(e) {
|
|
2964
2964
|
var t = this.input.charCodeAt(e);
|
|
2965
2965
|
if (t <= 55295 || t >= 56320) return t;
|
|
2966
2966
|
var n = this.input.charCodeAt(e + 1);
|
|
2967
2967
|
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
2968
|
-
},
|
|
2968
|
+
}, z.fullCharCodeAtPos = function() {
|
|
2969
2969
|
return this.fullCharCodeAt(this.pos);
|
|
2970
|
-
},
|
|
2970
|
+
}, z.skipBlockComment = function() {
|
|
2971
2971
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2972
2972
|
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = oe(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2973
2973
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2974
|
-
},
|
|
2974
|
+
}, z.skipLineComment = function(e) {
|
|
2975
2975
|
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !ae(r);) r = this.input.charCodeAt(++this.pos);
|
|
2976
2976
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2977
|
-
},
|
|
2977
|
+
}, z.skipSpace = function() {
|
|
2978
2978
|
loop: for (; this.pos < this.input.length;) {
|
|
2979
2979
|
var e = this.input.charCodeAt(this.pos);
|
|
2980
2980
|
switch (e) {
|
|
@@ -3003,36 +3003,36 @@ B.next = function(e) {
|
|
|
3003
3003
|
else break loop;
|
|
3004
3004
|
}
|
|
3005
3005
|
}
|
|
3006
|
-
},
|
|
3006
|
+
}, z.finishToken = function(e, t) {
|
|
3007
3007
|
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
3008
3008
|
var n = this.type;
|
|
3009
3009
|
this.type = e, this.value = t, this.updateContext(n);
|
|
3010
|
-
},
|
|
3010
|
+
}, z.readToken_dot = function() {
|
|
3011
3011
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
3012
3012
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
3013
3013
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
3014
3014
|
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(E.ellipsis)) : (++this.pos, this.finishToken(E.dot));
|
|
3015
|
-
},
|
|
3015
|
+
}, z.readToken_slash = function() {
|
|
3016
3016
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
3017
3017
|
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.slash, 1);
|
|
3018
|
-
},
|
|
3018
|
+
}, z.readToken_mult_modulo_exp = function(e) {
|
|
3019
3019
|
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? E.star : E.modulo;
|
|
3020
3020
|
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = E.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(E.assign, n + 1) : this.finishOp(r, n);
|
|
3021
|
-
},
|
|
3021
|
+
}, z.readToken_pipe_amp = function(e) {
|
|
3022
3022
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3023
3023
|
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(E.assign, 3) : this.finishOp(e === 124 ? E.logicalOR : E.logicalAND, 2) : t === 61 ? this.finishOp(E.assign, 2) : this.finishOp(e === 124 ? E.bitwiseOR : E.bitwiseAND, 1);
|
|
3024
|
-
},
|
|
3024
|
+
}, z.readToken_caret = function() {
|
|
3025
3025
|
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.bitwiseXOR, 1);
|
|
3026
|
-
},
|
|
3026
|
+
}, z.readToken_plus_min = function(e) {
|
|
3027
3027
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3028
3028
|
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || D.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(E.incDec, 2) : t === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.plusMin, 1);
|
|
3029
|
-
},
|
|
3029
|
+
}, z.readToken_lt_gt = function(e) {
|
|
3030
3030
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
3031
3031
|
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(E.assign, n + 1) : this.finishOp(E.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(E.relational, n));
|
|
3032
|
-
},
|
|
3032
|
+
}, z.readToken_eq_excl = function(e) {
|
|
3033
3033
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3034
3034
|
return t === 61 ? this.finishOp(E.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(E.arrow)) : this.finishOp(e === 61 ? E.eq : E.prefix, 1);
|
|
3035
|
-
},
|
|
3035
|
+
}, z.readToken_question = function() {
|
|
3036
3036
|
var e = this.options.ecmaVersion;
|
|
3037
3037
|
if (e >= 11) {
|
|
3038
3038
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
@@ -3043,11 +3043,11 @@ B.next = function(e) {
|
|
|
3043
3043
|
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(E.assign, 3) : this.finishOp(E.coalesce, 2);
|
|
3044
3044
|
}
|
|
3045
3045
|
return this.finishOp(E.question, 1);
|
|
3046
|
-
},
|
|
3046
|
+
}, z.readToken_numberSign = function() {
|
|
3047
3047
|
var e = this.options.ecmaVersion, t = 35;
|
|
3048
3048
|
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), y(t, !0) || t === 92)) return this.finishToken(E.privateId, this.readWord1());
|
|
3049
3049
|
this.raise(this.pos, "Unexpected character '" + he(t) + "'");
|
|
3050
|
-
},
|
|
3050
|
+
}, z.getTokenFromCode = function(e) {
|
|
3051
3051
|
switch (e) {
|
|
3052
3052
|
case 46: return this.readToken_dot();
|
|
3053
3053
|
case 40: return ++this.pos, this.finishToken(E.parenL);
|
|
@@ -3097,10 +3097,10 @@ B.next = function(e) {
|
|
|
3097
3097
|
case 35: return this.readToken_numberSign();
|
|
3098
3098
|
}
|
|
3099
3099
|
this.raise(this.pos, "Unexpected character '" + he(e) + "'");
|
|
3100
|
-
},
|
|
3100
|
+
}, z.finishOp = function(e, t) {
|
|
3101
3101
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3102
3102
|
return this.pos += t, this.finishToken(e, n);
|
|
3103
|
-
},
|
|
3103
|
+
}, z.readRegexp = function() {
|
|
3104
3104
|
for (var e, t, n = this.pos;;) {
|
|
3105
3105
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3106
3106
|
var r = this.input.charAt(this.pos);
|
|
@@ -3117,7 +3117,7 @@ B.next = function(e) {
|
|
|
3117
3117
|
++this.pos;
|
|
3118
3118
|
var a = this.pos, o = this.readWord1();
|
|
3119
3119
|
this.containsEsc && this.unexpected(a);
|
|
3120
|
-
var s = this.regexpState ||= new
|
|
3120
|
+
var s = this.regexpState ||= new At(this);
|
|
3121
3121
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3122
3122
|
var c = null;
|
|
3123
3123
|
try {
|
|
@@ -3128,7 +3128,7 @@ B.next = function(e) {
|
|
|
3128
3128
|
flags: o,
|
|
3129
3129
|
value: c
|
|
3130
3130
|
});
|
|
3131
|
-
},
|
|
3131
|
+
}, z.readInt = function(e, t, n) {
|
|
3132
3132
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
3133
3133
|
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
3134
3134
|
if (r && u === 95) {
|
|
@@ -3140,31 +3140,31 @@ B.next = function(e) {
|
|
|
3140
3140
|
}
|
|
3141
3141
|
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
3142
3142
|
};
|
|
3143
|
-
function
|
|
3143
|
+
function Zt(e, t) {
|
|
3144
3144
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3145
3145
|
}
|
|
3146
|
-
function
|
|
3146
|
+
function Qt(e) {
|
|
3147
3147
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3148
3148
|
}
|
|
3149
|
-
|
|
3149
|
+
z.readRadixNumber = function(e) {
|
|
3150
3150
|
var t = this.pos;
|
|
3151
3151
|
this.pos += 2;
|
|
3152
3152
|
var n = this.readInt(e);
|
|
3153
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n =
|
|
3154
|
-
},
|
|
3153
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Qt(this.input.slice(t, this.pos)), ++this.pos) : y(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(E.num, n);
|
|
3154
|
+
}, z.readNumber = function(e) {
|
|
3155
3155
|
var t = this.pos;
|
|
3156
3156
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
3157
3157
|
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
3158
3158
|
n && this.strict && this.raise(t, "Invalid number");
|
|
3159
3159
|
var r = this.input.charCodeAt(this.pos);
|
|
3160
3160
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3161
|
-
var i =
|
|
3161
|
+
var i = Qt(this.input.slice(t, this.pos));
|
|
3162
3162
|
return ++this.pos, y(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(E.num, i);
|
|
3163
3163
|
}
|
|
3164
3164
|
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), y(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3165
|
-
var a =
|
|
3165
|
+
var a = Zt(this.input.slice(t, this.pos), n);
|
|
3166
3166
|
return this.finishToken(E.num, a);
|
|
3167
|
-
},
|
|
3167
|
+
}, z.readCodePoint = function() {
|
|
3168
3168
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3169
3169
|
if (e === 123) {
|
|
3170
3170
|
this.options.ecmaVersion < 6 && this.unexpected();
|
|
@@ -3172,7 +3172,7 @@ B.readRadixNumber = function(e) {
|
|
|
3172
3172
|
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
3173
3173
|
} else t = this.readHexChar(4);
|
|
3174
3174
|
return t;
|
|
3175
|
-
},
|
|
3175
|
+
}, z.readString = function(e) {
|
|
3176
3176
|
for (var t = "", n = ++this.pos;;) {
|
|
3177
3177
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3178
3178
|
var r = this.input.charCodeAt(this.pos);
|
|
@@ -3181,20 +3181,20 @@ B.readRadixNumber = function(e) {
|
|
|
3181
3181
|
}
|
|
3182
3182
|
return t += this.input.slice(n, this.pos++), this.finishToken(E.string, t);
|
|
3183
3183
|
};
|
|
3184
|
-
var
|
|
3185
|
-
|
|
3184
|
+
var $t = {};
|
|
3185
|
+
z.tryReadTemplateToken = function() {
|
|
3186
3186
|
this.inTemplateElement = !0;
|
|
3187
3187
|
try {
|
|
3188
3188
|
this.readTmplToken();
|
|
3189
3189
|
} catch (e) {
|
|
3190
|
-
if (e ===
|
|
3190
|
+
if (e === $t) this.readInvalidTemplateToken();
|
|
3191
3191
|
else throw e;
|
|
3192
3192
|
}
|
|
3193
3193
|
this.inTemplateElement = !1;
|
|
3194
|
-
},
|
|
3195
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
3194
|
+
}, z.invalidStringToken = function(e, t) {
|
|
3195
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw $t;
|
|
3196
3196
|
this.raise(e, t);
|
|
3197
|
-
},
|
|
3197
|
+
}, z.readTmplToken = function() {
|
|
3198
3198
|
for (var e = "", t = this.pos;;) {
|
|
3199
3199
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3200
3200
|
var n = this.input.charCodeAt(this.pos);
|
|
@@ -3211,7 +3211,7 @@ B.tryReadTemplateToken = function() {
|
|
|
3211
3211
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3212
3212
|
} else ++this.pos;
|
|
3213
3213
|
}
|
|
3214
|
-
},
|
|
3214
|
+
}, z.readInvalidTemplateToken = function() {
|
|
3215
3215
|
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
3216
3216
|
case "\\":
|
|
3217
3217
|
++this.pos;
|
|
@@ -3224,7 +3224,7 @@ B.tryReadTemplateToken = function() {
|
|
|
3224
3224
|
case "\u2029": ++this.curLine, this.lineStart = this.pos + 1;
|
|
3225
3225
|
}
|
|
3226
3226
|
this.raise(this.start, "Unterminated template");
|
|
3227
|
-
},
|
|
3227
|
+
}, z.readEscapedChar = function(e) {
|
|
3228
3228
|
var t = this.input.charCodeAt(++this.pos);
|
|
3229
3229
|
switch (++this.pos, t) {
|
|
3230
3230
|
case 110: return "\n";
|
|
@@ -3249,10 +3249,10 @@ B.tryReadTemplateToken = function() {
|
|
|
3249
3249
|
}
|
|
3250
3250
|
return ae(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3251
3251
|
}
|
|
3252
|
-
},
|
|
3252
|
+
}, z.readHexChar = function(e) {
|
|
3253
3253
|
var t = this.pos, n = this.readInt(16, e);
|
|
3254
3254
|
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
3255
|
-
},
|
|
3255
|
+
}, z.readWord1 = function() {
|
|
3256
3256
|
this.containsEsc = !1;
|
|
3257
3257
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3258
3258
|
var i = this.fullCharCodeAtPos();
|
|
@@ -3267,14 +3267,14 @@ B.tryReadTemplateToken = function() {
|
|
|
3267
3267
|
t = !1;
|
|
3268
3268
|
}
|
|
3269
3269
|
return e + this.input.slice(n, this.pos);
|
|
3270
|
-
},
|
|
3270
|
+
}, z.readWord = function() {
|
|
3271
3271
|
var e = this.readWord1(), t = E.name;
|
|
3272
3272
|
return this.keywords.test(e) && (t = re[e]), this.finishToken(t, e);
|
|
3273
3273
|
};
|
|
3274
|
-
var
|
|
3274
|
+
var en = "8.18.0";
|
|
3275
3275
|
k.acorn = {
|
|
3276
3276
|
Parser: k,
|
|
3277
|
-
version:
|
|
3277
|
+
version: en,
|
|
3278
3278
|
defaultOptions: be,
|
|
3279
3279
|
Position: _e,
|
|
3280
3280
|
SourceLocation: ve,
|
|
@@ -3287,24 +3287,24 @@ k.acorn = {
|
|
|
3287
3287
|
tokContexts: F,
|
|
3288
3288
|
isIdentifierChar: b,
|
|
3289
3289
|
isIdentifierStart: y,
|
|
3290
|
-
Token:
|
|
3290
|
+
Token: Xt,
|
|
3291
3291
|
isNewLine: ae,
|
|
3292
3292
|
lineBreak: D,
|
|
3293
3293
|
lineBreakG: ie,
|
|
3294
3294
|
nonASCIIwhitespace: se
|
|
3295
3295
|
};
|
|
3296
|
-
function
|
|
3296
|
+
function tn(e, t) {
|
|
3297
3297
|
return k.parse(e, t);
|
|
3298
3298
|
}
|
|
3299
|
-
function
|
|
3299
|
+
function nn(e, t, n) {
|
|
3300
3300
|
return k.parseExpressionAt(e, t, n);
|
|
3301
3301
|
}
|
|
3302
|
-
function
|
|
3302
|
+
function rn(e, t) {
|
|
3303
3303
|
return k.tokenizer(e, t);
|
|
3304
3304
|
}
|
|
3305
3305
|
//#endregion
|
|
3306
3306
|
//#region node_modules/acorn-typescript/lib/index.mjs
|
|
3307
|
-
function
|
|
3307
|
+
function an(e, t) {
|
|
3308
3308
|
for (var n = 0; n < t.length; n++) {
|
|
3309
3309
|
var r = t[n];
|
|
3310
3310
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, typeof (i = function(e, t) {
|
|
@@ -3320,36 +3320,36 @@ function rn(e, t) {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
var i;
|
|
3322
3322
|
}
|
|
3323
|
-
function
|
|
3324
|
-
return
|
|
3323
|
+
function on() {
|
|
3324
|
+
return on = Object.assign ? Object.assign.bind() : function(e) {
|
|
3325
3325
|
for (var t = 1; t < arguments.length; t++) {
|
|
3326
3326
|
var n = arguments[t];
|
|
3327
3327
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
3328
3328
|
}
|
|
3329
3329
|
return e;
|
|
3330
|
-
},
|
|
3331
|
-
}
|
|
3332
|
-
function on(e, t) {
|
|
3333
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, sn(e, t);
|
|
3330
|
+
}, on.apply(this, arguments);
|
|
3334
3331
|
}
|
|
3335
3332
|
function sn(e, t) {
|
|
3336
|
-
|
|
3337
|
-
return e.__proto__ = t, e;
|
|
3338
|
-
}, sn(e, t);
|
|
3333
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, cn(e, t);
|
|
3339
3334
|
}
|
|
3340
3335
|
function cn(e, t) {
|
|
3336
|
+
return cn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
3337
|
+
return e.__proto__ = t, e;
|
|
3338
|
+
}, cn(e, t);
|
|
3339
|
+
}
|
|
3340
|
+
function ln(e, t) {
|
|
3341
3341
|
(t == null || t > e.length) && (t = e.length);
|
|
3342
3342
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
3343
3343
|
return r;
|
|
3344
3344
|
}
|
|
3345
|
-
function
|
|
3345
|
+
function un(e, t) {
|
|
3346
3346
|
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
3347
3347
|
if (n) return (n = n.call(e)).next.bind(n);
|
|
3348
3348
|
if (Array.isArray(e) || (n = function(e, t) {
|
|
3349
3349
|
if (e) {
|
|
3350
|
-
if (typeof e == "string") return
|
|
3350
|
+
if (typeof e == "string") return ln(e, t);
|
|
3351
3351
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
3352
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
3352
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ln(e, t) : void 0;
|
|
3353
3353
|
}
|
|
3354
3354
|
}(e)) || t && e && typeof e.length == "number") {
|
|
3355
3355
|
n && (e = n);
|
|
@@ -3363,28 +3363,28 @@ function ln(e, t) {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3365
3365
|
}
|
|
3366
|
-
var
|
|
3367
|
-
function
|
|
3366
|
+
var B = !0;
|
|
3367
|
+
function V(e, t) {
|
|
3368
3368
|
return t === void 0 && (t = {}), new x("name", t);
|
|
3369
3369
|
}
|
|
3370
|
-
var
|
|
3371
|
-
function
|
|
3372
|
-
var t =
|
|
3370
|
+
var dn = /* @__PURE__ */ new WeakMap();
|
|
3371
|
+
function fn(e) {
|
|
3372
|
+
var t = dn.get(e.Parser.acorn || e);
|
|
3373
3373
|
if (!t) {
|
|
3374
3374
|
var n = {
|
|
3375
|
-
assert:
|
|
3376
|
-
asserts:
|
|
3377
|
-
global:
|
|
3378
|
-
keyof:
|
|
3379
|
-
readonly:
|
|
3380
|
-
unique:
|
|
3381
|
-
abstract:
|
|
3382
|
-
declare:
|
|
3383
|
-
enum:
|
|
3384
|
-
module:
|
|
3385
|
-
namespace:
|
|
3386
|
-
interface:
|
|
3387
|
-
type:
|
|
3375
|
+
assert: V(0, { startsExpr: B }),
|
|
3376
|
+
asserts: V(0, { startsExpr: B }),
|
|
3377
|
+
global: V(0, { startsExpr: B }),
|
|
3378
|
+
keyof: V(0, { startsExpr: B }),
|
|
3379
|
+
readonly: V(0, { startsExpr: B }),
|
|
3380
|
+
unique: V(0, { startsExpr: B }),
|
|
3381
|
+
abstract: V(0, { startsExpr: B }),
|
|
3382
|
+
declare: V(0, { startsExpr: B }),
|
|
3383
|
+
enum: V(0, { startsExpr: B }),
|
|
3384
|
+
module: V(0, { startsExpr: B }),
|
|
3385
|
+
namespace: V(0, { startsExpr: B }),
|
|
3386
|
+
interface: V(0, { startsExpr: B }),
|
|
3387
|
+
type: V(0, { startsExpr: B })
|
|
3388
3388
|
}, r = {
|
|
3389
3389
|
at: new x("@"),
|
|
3390
3390
|
jsxName: new x("jsxName"),
|
|
@@ -3402,8 +3402,8 @@ function dn(e) {
|
|
|
3402
3402
|
var t = this.context.pop();
|
|
3403
3403
|
t === i.tc_oTag && e === E.slash || t === i.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === i.tc_expr) : this.exprAllowed = !0;
|
|
3404
3404
|
}, t = {
|
|
3405
|
-
tokTypes:
|
|
3406
|
-
tokContexts:
|
|
3405
|
+
tokTypes: on({}, n, r),
|
|
3406
|
+
tokContexts: on({}, i),
|
|
3407
3407
|
keywordsRegExp: a,
|
|
3408
3408
|
tokenIsLiteralPropertyName: function(e) {
|
|
3409
3409
|
return [
|
|
@@ -3443,18 +3443,18 @@ function dn(e) {
|
|
|
3443
3443
|
}
|
|
3444
3444
|
return t;
|
|
3445
3445
|
}
|
|
3446
|
-
var
|
|
3446
|
+
var pn = 1024, mn = RegExp("(?=(" + (/* @__PURE__ */ RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*", "y")).source + "))\\1(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)", "y"), hn = function() {
|
|
3447
3447
|
this.shorthandAssign = void 0, this.trailingComma = void 0, this.parenthesizedAssign = void 0, this.parenthesizedBind = void 0, this.doubleProto = void 0, this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
3448
3448
|
};
|
|
3449
|
-
function
|
|
3449
|
+
function gn(e, t) {
|
|
3450
3450
|
var n = t.key.name, r = e[n], i = "true";
|
|
3451
3451
|
return t.type !== "MethodDefinition" || t.kind !== "get" && t.kind !== "set" || (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : !!r || (e[n] = i, !1);
|
|
3452
3452
|
}
|
|
3453
|
-
function
|
|
3453
|
+
function _n(e, t) {
|
|
3454
3454
|
var n = e.key;
|
|
3455
3455
|
return !e.computed && (n.type === "Identifier" && n.name === t || n.type === "Literal" && n.value === t);
|
|
3456
3456
|
}
|
|
3457
|
-
var
|
|
3457
|
+
var H = {
|
|
3458
3458
|
AbstractMethodHasImplementation: function(e) {
|
|
3459
3459
|
return "Method '" + e.methodName + "' cannot have an implementation because it is marked abstract.";
|
|
3460
3460
|
},
|
|
@@ -3555,7 +3555,7 @@ var U = {
|
|
|
3555
3555
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + e.type + ".";
|
|
3556
3556
|
},
|
|
3557
3557
|
LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations."
|
|
3558
|
-
},
|
|
3558
|
+
}, vn = {
|
|
3559
3559
|
quot: "\"",
|
|
3560
3560
|
amp: "&",
|
|
3561
3561
|
apos: "'",
|
|
@@ -3809,38 +3809,38 @@ var U = {
|
|
|
3809
3809
|
clubs: "♣",
|
|
3810
3810
|
hearts: "♥",
|
|
3811
3811
|
diams: "♦"
|
|
3812
|
-
},
|
|
3813
|
-
function
|
|
3814
|
-
return e && (e.type === "JSXIdentifier" ? e.name : e.type === "JSXNamespacedName" ? e.namespace.name + ":" + e.name.name : e.type === "JSXMemberExpression" ?
|
|
3812
|
+
}, yn = /^[\da-fA-F]+$/, bn = /^\d+$/;
|
|
3813
|
+
function xn(e) {
|
|
3814
|
+
return e && (e.type === "JSXIdentifier" ? e.name : e.type === "JSXNamespacedName" ? e.namespace.name + ":" + e.name.name : e.type === "JSXMemberExpression" ? xn(e.object) + "." + xn(e.property) : void 0);
|
|
3815
3815
|
}
|
|
3816
|
-
var
|
|
3817
|
-
function
|
|
3816
|
+
var Sn = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
3817
|
+
function Cn(e) {
|
|
3818
3818
|
if (!e) throw Error("Assert fail");
|
|
3819
3819
|
}
|
|
3820
|
-
function
|
|
3820
|
+
function wn(e) {
|
|
3821
3821
|
return e === "accessor";
|
|
3822
3822
|
}
|
|
3823
|
-
function
|
|
3823
|
+
function Tn(e) {
|
|
3824
3824
|
return e === "in" || e === "out";
|
|
3825
3825
|
}
|
|
3826
|
-
function
|
|
3826
|
+
function En(e, t) {
|
|
3827
3827
|
return 2 | (e ? 4 : 0) | (t ? 8 : 0);
|
|
3828
3828
|
}
|
|
3829
|
-
function
|
|
3829
|
+
function Dn(e) {
|
|
3830
3830
|
if (e.type !== "MemberExpression") return !1;
|
|
3831
3831
|
var t = e.property;
|
|
3832
|
-
return (!e.computed || !(t.type !== "TemplateLiteral" || t.expressions.length > 0)) &&
|
|
3833
|
-
}
|
|
3834
|
-
function Dn(e) {
|
|
3835
|
-
return e.type === "Identifier" || e.type === "MemberExpression" && !e.computed && Dn(e.object);
|
|
3832
|
+
return (!e.computed || !(t.type !== "TemplateLiteral" || t.expressions.length > 0)) && On(e.object);
|
|
3836
3833
|
}
|
|
3837
3834
|
function On(e) {
|
|
3838
|
-
return e === "
|
|
3835
|
+
return e.type === "Identifier" || e.type === "MemberExpression" && !e.computed && On(e.object);
|
|
3839
3836
|
}
|
|
3840
3837
|
function kn(e) {
|
|
3838
|
+
return e === "private" || e === "public" || e === "protected";
|
|
3839
|
+
}
|
|
3840
|
+
function An(e) {
|
|
3841
3841
|
var t = e || {}, n = t.dts, r = n !== void 0 && n, i = t.allowSatisfies, a = i !== void 0 && i;
|
|
3842
3842
|
return function(t) {
|
|
3843
|
-
var n = t.acorn || u, i =
|
|
3843
|
+
var n = t.acorn || u, i = fn(n), o = n.tokTypes, s = n.keywordTypes, c = n.isIdentifierStart, l = n.lineBreak, d = n.isNewLine, f = n.tokContexts, p = n.isIdentifierChar, m = i.tokTypes, h = i.tokContexts, g = i.keywordsRegExp, _ = i.tokenIsLiteralPropertyName, ee = i.tokenIsTemplate, te = i.tokenIsTSDeclarationStart, v = i.tokenIsIdentifier, ne = i.tokenIsKeywordOrIdentifier, y = i.tokenIsTSTypeOperator;
|
|
3844
3844
|
function b(e, t, n) {
|
|
3845
3845
|
n === void 0 && (n = e.length);
|
|
3846
3846
|
for (var r = t; r < n; r++) {
|
|
@@ -3855,7 +3855,7 @@ function kn(e) {
|
|
|
3855
3855
|
function t() {
|
|
3856
3856
|
return e.apply(this, arguments) || this;
|
|
3857
3857
|
}
|
|
3858
|
-
|
|
3858
|
+
sn(t, e);
|
|
3859
3859
|
var n = t.prototype;
|
|
3860
3860
|
return n.takeDecorators = function(e) {
|
|
3861
3861
|
var t = this.decoratorStack[this.decoratorStack.length - 1];
|
|
@@ -3898,7 +3898,7 @@ function kn(e) {
|
|
|
3898
3898
|
function t() {
|
|
3899
3899
|
return e.apply(this, arguments) || this;
|
|
3900
3900
|
}
|
|
3901
|
-
|
|
3901
|
+
sn(t, e);
|
|
3902
3902
|
var n = t.prototype;
|
|
3903
3903
|
return n.jsx_readToken = function() {
|
|
3904
3904
|
for (var e = "", t = this.pos;;) {
|
|
@@ -3931,7 +3931,7 @@ function kn(e) {
|
|
|
3931
3931
|
r !== "&" && this.raise(this.pos, "Entity must start with an ampersand");
|
|
3932
3932
|
for (var i = ++this.pos; this.pos < this.input.length && n++ < 10;) {
|
|
3933
3933
|
if ((r = this.input[this.pos++]) === ";") {
|
|
3934
|
-
t[0] === "#" ? t[1] === "x" ? (t = t.substr(2),
|
|
3934
|
+
t[0] === "#" ? t[1] === "x" ? (t = t.substr(2), yn.test(t) && (e = String.fromCharCode(parseInt(t, 16)))) : (t = t.substr(1), bn.test(t) && (e = String.fromCharCode(parseInt(t, 10)))) : e = vn[t];
|
|
3935
3935
|
break;
|
|
3936
3936
|
}
|
|
3937
3937
|
t += r;
|
|
@@ -4005,7 +4005,7 @@ function kn(e) {
|
|
|
4005
4005
|
break;
|
|
4006
4006
|
default: this.unexpected();
|
|
4007
4007
|
}
|
|
4008
|
-
|
|
4008
|
+
xn(s.name) !== xn(o.name) && this.raise(s.start, "Expected corresponding JSX closing tag for <" + xn(o.name) + ">");
|
|
4009
4009
|
}
|
|
4010
4010
|
var c = o.name ? "Element" : "Fragment";
|
|
4011
4011
|
return n["opening" + c] = o, n["closing" + c] = s, n.children = r, this.type === i.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(n, "JSX" + c);
|
|
@@ -4023,7 +4023,7 @@ function kn(e) {
|
|
|
4023
4023
|
function t() {
|
|
4024
4024
|
return e.apply(this, arguments) || this;
|
|
4025
4025
|
}
|
|
4026
|
-
|
|
4026
|
+
sn(t, e);
|
|
4027
4027
|
var n = t.prototype;
|
|
4028
4028
|
return n.parseMaybeImportAttributes = function(e) {
|
|
4029
4029
|
if (this.type === i._with || this.type === r.assert) {
|
|
@@ -4054,10 +4054,10 @@ function kn(e) {
|
|
|
4054
4054
|
}(i), {
|
|
4055
4055
|
allowedModifiers: ["const"],
|
|
4056
4056
|
disallowedModifiers: ["in", "out"],
|
|
4057
|
-
errorTemplate:
|
|
4057
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
4058
4058
|
}), i;
|
|
4059
4059
|
}
|
|
4060
|
-
|
|
4060
|
+
sn(t, e);
|
|
4061
4061
|
var u, x, S, C = t.prototype;
|
|
4062
4062
|
return C.getTokenFromCodeInType = function(t) {
|
|
4063
4063
|
return t === 62 || t === 60 ? this.finishOp(o.relational, 1) : e.prototype.getTokenFromCode.call(this, t);
|
|
@@ -4125,14 +4125,14 @@ function kn(e) {
|
|
|
4125
4125
|
return this.nextTokenStartSince(this.pos);
|
|
4126
4126
|
}, C.tsHasSomeModifiers = function(e, t) {
|
|
4127
4127
|
return t.some(function(t) {
|
|
4128
|
-
return
|
|
4128
|
+
return kn(t) ? e.accessibility === t : !!e[t];
|
|
4129
4129
|
});
|
|
4130
4130
|
}, C.tsIsStartOfStaticBlocks = function() {
|
|
4131
4131
|
return this.isContextual("static") && this.lookaheadCharCode() === 123;
|
|
4132
4132
|
}, C.tsCheckForInvalidTypeCasts = function(e) {
|
|
4133
4133
|
var t = this;
|
|
4134
4134
|
e.forEach(function(e) {
|
|
4135
|
-
e?.type === "TSTypeCastExpression" && t.raise(e.typeAnnotation.start,
|
|
4135
|
+
e?.type === "TSTypeCastExpression" && t.raise(e.typeAnnotation.start, H.UnexpectedTypeAnnotation);
|
|
4136
4136
|
});
|
|
4137
4137
|
}, C.atPossibleAsyncArrow = function(e) {
|
|
4138
4138
|
return e.type === "Identifier" && e.name === "async" && this.lastTokEndLoc.column === e.end && !this.canInsertSemicolon() && e.end - e.start == 5 && e.start === this.potentialArrowAt;
|
|
@@ -4173,7 +4173,7 @@ function kn(e) {
|
|
|
4173
4173
|
}, C.isAbstractConstructorSignature = function() {
|
|
4174
4174
|
return this.ts_isContextual(m.abstract) && this.lookahead().type === o._new;
|
|
4175
4175
|
}, C.nextTokenStartSince = function(e) {
|
|
4176
|
-
return
|
|
4176
|
+
return Sn.lastIndex = e, Sn.test(this.input) ? Sn.lastIndex : e;
|
|
4177
4177
|
}, C.lookaheadCharCode = function() {
|
|
4178
4178
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
4179
4179
|
}, C.compareLookaheadState = function(e, t) {
|
|
@@ -4257,7 +4257,7 @@ function kn(e) {
|
|
|
4257
4257
|
}, C.isLineTerminator = function() {
|
|
4258
4258
|
return this.eat(o.semi) || e.prototype.canInsertSemicolon.call(this);
|
|
4259
4259
|
}, C.hasFollowingLineBreak = function() {
|
|
4260
|
-
return
|
|
4260
|
+
return mn.lastIndex = this.end, mn.test(this.input);
|
|
4261
4261
|
}, C.addExtra = function(e, t, n, r) {
|
|
4262
4262
|
if (r === void 0 && (r = !0), e) {
|
|
4263
4263
|
var i = e.extra = e.extra || {};
|
|
@@ -4349,7 +4349,7 @@ function kn(e) {
|
|
|
4349
4349
|
}
|
|
4350
4350
|
return this.next(), e.prototype.exitScope.call(this), this.finishNode(t, "TSModuleBlock");
|
|
4351
4351
|
}, C.tsParseAmbientExternalModuleDeclaration = function(t) {
|
|
4352
|
-
return this.ts_isContextual(m.global) ? (t.global = !0, t.id = this.parseIdent()) : this.match(o.string) ? t.id = this.parseLiteral(this.value) : this.unexpected(), this.match(o.braceL) ? (e.prototype.enterScope.call(this,
|
|
4352
|
+
return this.ts_isContextual(m.global) ? (t.global = !0, t.id = this.parseIdent()) : this.match(o.string) ? t.id = this.parseLiteral(this.value) : this.unexpected(), this.match(o.braceL) ? (e.prototype.enterScope.call(this, pn), t.body = this.tsParseModuleBlock(), e.prototype.exitScope.call(this)) : e.prototype.semicolon.call(this), this.finishNode(t, "TSModuleDeclaration");
|
|
4353
4353
|
}, C.tsTryParseDeclare = function(e) {
|
|
4354
4354
|
var t = this;
|
|
4355
4355
|
if (!this.isLineTerminator()) {
|
|
@@ -4450,7 +4450,7 @@ function kn(e) {
|
|
|
4450
4450
|
}, C.tsParseBindingListForSignature = function() {
|
|
4451
4451
|
var t = this;
|
|
4452
4452
|
return e.prototype.parseBindingList.call(this, o.parenR, !0, !0).map(function(e) {
|
|
4453
|
-
return e.type !== "Identifier" && e.type !== "RestElement" && e.type !== "ObjectPattern" && e.type !== "ArrayPattern" && t.raise(e.start,
|
|
4453
|
+
return e.type !== "Identifier" && e.type !== "RestElement" && e.type !== "ObjectPattern" && e.type !== "ArrayPattern" && t.raise(e.start, H.UnsupportedSignatureParameterKind(e.type)), e;
|
|
4454
4454
|
});
|
|
4455
4455
|
}, C.tsParseTypePredicateAsserts = function() {
|
|
4456
4456
|
if (this.type !== m.asserts) return !1;
|
|
@@ -4496,7 +4496,7 @@ function kn(e) {
|
|
|
4496
4496
|
if (this.lookahead().type !== o._const) return null;
|
|
4497
4497
|
this.next();
|
|
4498
4498
|
var e = this.tsParseTypeReference();
|
|
4499
|
-
return e.typeParameters && this.raise(e.typeName.start,
|
|
4499
|
+
return e.typeParameters && this.raise(e.typeName.start, H.CannotFindName({ name: "const" })), e;
|
|
4500
4500
|
}, C.tsParseFunctionOrConstructorType = function(e, t) {
|
|
4501
4501
|
var n = this, r = this.startNode();
|
|
4502
4502
|
return e === "TSConstructorType" && (r.abstract = !!t, t && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
@@ -4512,7 +4512,7 @@ function kn(e) {
|
|
|
4512
4512
|
switch (e.typeAnnotation.type) {
|
|
4513
4513
|
case "TSTupleType":
|
|
4514
4514
|
case "TSArrayType": return;
|
|
4515
|
-
default: this.raise(e.start,
|
|
4515
|
+
default: this.raise(e.start, H.UnexpectedReadonly);
|
|
4516
4516
|
}
|
|
4517
4517
|
}, C.tsParseTypeOperator = function() {
|
|
4518
4518
|
var e = this.startNode(), t = this.value;
|
|
@@ -4545,7 +4545,7 @@ function kn(e) {
|
|
|
4545
4545
|
}(), this.finishNode(t, "TSLiteralType");
|
|
4546
4546
|
}, C.tsParseImportType = function() {
|
|
4547
4547
|
var e = this.startNode();
|
|
4548
|
-
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start,
|
|
4548
|
+
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start, H.UnsupportedImportTypeArgument), e.argument = this.parseExprAtom(), this.expect(o.parenR), this.eat(o.dot) && (e.qualifier = this.tsParseEntityName()), this.tsMatchLeftRelational() && (e.typeParameters = this.tsParseTypeArguments()), this.finishNode(e, "TSImportType");
|
|
4549
4549
|
}, C.tsParseTypeQuery = function() {
|
|
4550
4550
|
var e = this.startNode();
|
|
4551
4551
|
return this.expect(o._typeof), e.exprName = this.match(o._import) ? this.tsParseImportType() : this.tsParseEntityName(), !this.hasPrecedingLineBreak() && this.tsMatchLeftRelational() && (e.typeParameters = this.tsParseTypeArguments()), this.finishNode(e, "TSTypeQuery");
|
|
@@ -4562,7 +4562,7 @@ function kn(e) {
|
|
|
4562
4562
|
var e = this.startLoc, t = this.start, n = this.eat(o.ellipsis), r = this.tsParseType(), i = this.eat(o.question);
|
|
4563
4563
|
if (this.eat(o.colon)) {
|
|
4564
4564
|
var a = this.startNodeAtNode(r);
|
|
4565
|
-
a.optional = i, r.type !== "TSTypeReference" || r.typeParameters || r.typeName.type !== "Identifier" ? (this.raise(r.start,
|
|
4565
|
+
a.optional = i, r.type !== "TSTypeReference" || r.typeParameters || r.typeName.type !== "Identifier" ? (this.raise(r.start, H.InvalidTupleMemberLabel), a.label = r) : a.label = r.typeName, a.elementType = this.tsParseType(), r = this.finishNode(a, "TSNamedTupleMember");
|
|
4566
4566
|
} else if (i) {
|
|
4567
4567
|
var s = this.startNodeAtNode(r);
|
|
4568
4568
|
s.typeAnnotation = r, r = this.finishNode(s, "TSOptionalType");
|
|
@@ -4578,11 +4578,11 @@ function kn(e) {
|
|
|
4578
4578
|
var n = !1, r = null;
|
|
4579
4579
|
return t.elementTypes.forEach(function(t) {
|
|
4580
4580
|
var i = t.type;
|
|
4581
|
-
!n || i === "TSRestType" || i === "TSOptionalType" || i === "TSNamedTupleMember" && t.optional || e.raise(t.start,
|
|
4581
|
+
!n || i === "TSRestType" || i === "TSOptionalType" || i === "TSNamedTupleMember" && t.optional || e.raise(t.start, H.OptionalTypeBeforeRequired), n ||= i === "TSNamedTupleMember" && t.optional || i === "TSOptionalType";
|
|
4582
4582
|
var a = i;
|
|
4583
4583
|
i === "TSRestType" && (a = (t = t.typeAnnotation).type);
|
|
4584
4584
|
var o = a === "TSNamedTupleMember";
|
|
4585
|
-
r ??= o, r !== o && e.raise(t.start,
|
|
4585
|
+
r ??= o, r !== o && e.raise(t.start, H.MixedLabeledAndUnlabeledElements);
|
|
4586
4586
|
}), this.finishNode(t, "TSTupleType");
|
|
4587
4587
|
}, C.tsParseTemplateLiteralType = function() {
|
|
4588
4588
|
var e = this.startNode();
|
|
@@ -4665,7 +4665,7 @@ function kn(e) {
|
|
|
4665
4665
|
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(o._new) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
|
|
4666
4666
|
}, C.tsParseType = function() {
|
|
4667
4667
|
var e = this;
|
|
4668
|
-
|
|
4668
|
+
Cn(this.inType);
|
|
4669
4669
|
var t = this.tsParseNonConditionalType();
|
|
4670
4670
|
if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(o._extends)) return t;
|
|
4671
4671
|
var n = this.startNodeAtNode(t);
|
|
@@ -4699,7 +4699,7 @@ function kn(e) {
|
|
|
4699
4699
|
modified: e,
|
|
4700
4700
|
allowedModifiers: [],
|
|
4701
4701
|
disallowedModifiers: ["in", "out"],
|
|
4702
|
-
errorTemplate:
|
|
4702
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
4703
4703
|
});
|
|
4704
4704
|
}, C.tsParseTypeParameter = function(e) {
|
|
4705
4705
|
e === void 0 && (e = this.tsParseNoneModifiers.bind(this));
|
|
@@ -4709,7 +4709,7 @@ function kn(e) {
|
|
|
4709
4709
|
var t = this.startNode();
|
|
4710
4710
|
this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart") ? this.next() : this.unexpected();
|
|
4711
4711
|
var n = { value: -1 };
|
|
4712
|
-
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(this.start,
|
|
4712
|
+
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(this.start, H.EmptyTypeParameters), n.value !== -1 && this.addExtra(t, "trailingComma", n.value), this.finishNode(t, "TSTypeParameterDeclaration");
|
|
4713
4713
|
}, C.tsTryParseTypeParameters = function(e) {
|
|
4714
4714
|
if (this.tsMatchLeftRelational()) return this.tsParseTypeParameters(e);
|
|
4715
4715
|
}, C.tsTryParse = function(e) {
|
|
@@ -4733,14 +4733,14 @@ function kn(e) {
|
|
|
4733
4733
|
t[a] = n[a];
|
|
4734
4734
|
}
|
|
4735
4735
|
}, C.tsParseModifiers = function(e) {
|
|
4736
|
-
for (var t = this, n = e.modified, r = e.allowedModifiers, i = e.disallowedModifiers, a = e.stopOnStartOfClassStaticBlock, o = e.errorTemplate, s = o === void 0 ?
|
|
4737
|
-
r === i && n[a] && t.raise(e.column,
|
|
4736
|
+
for (var t = this, n = e.modified, r = e.allowedModifiers, i = e.disallowedModifiers, a = e.stopOnStartOfClassStaticBlock, o = e.errorTemplate, s = o === void 0 ? H.InvalidModifierOnTypeMember : o, c = {}, l = function(e, r, i, a) {
|
|
4737
|
+
r === i && n[a] && t.raise(e.column, H.InvalidModifiersOrder({ orderedModifiers: [i, a] }));
|
|
4738
4738
|
}, u = function(e, r, i, a) {
|
|
4739
|
-
(n[i] && r === a || n[a] && r === i) && t.raise(e.column,
|
|
4739
|
+
(n[i] && r === a || n[a] && r === i) && t.raise(e.column, H.IncompatibleModifiers({ modifiers: [i, a] }));
|
|
4740
4740
|
};;) {
|
|
4741
4741
|
var d = this.startLoc, f = this.tsParseModifier(r.concat(i ?? []), a);
|
|
4742
4742
|
if (!f) break;
|
|
4743
|
-
|
|
4743
|
+
kn(f) ? n.accessibility ? this.raise(this.start, H.DuplicateAccessibilityModifier()) : (l(d, f, f, "override"), l(d, f, f, "static"), l(d, f, f, "readonly"), l(d, f, f, "accessor"), c.accessibility = f, n.accessibility = f) : Tn(f) ? n[f] ? this.raise(this.start, H.DuplicateModifier({ modifier: f })) : (l(d, f, "in", "out"), c[f] = f, n[f] = !0) : wn(f) ? n[f] ? this.raise(this.start, H.DuplicateModifier({ modifier: f })) : (u(d, f, "accessor", "readonly"), u(d, f, "accessor", "static"), u(d, f, "accessor", "override"), c[f] = f, n[f] = !0) : Object.hasOwnProperty.call(n, f) ? this.raise(this.start, H.DuplicateModifier({ modifier: f })) : (l(d, f, "static", "readonly"), l(d, f, "static", "override"), l(d, f, "override", "readonly"), l(d, f, "abstract", "override"), u(d, f, "declare", "override"), u(d, f, "static", "abstract"), c[f] = f, n[f] = !0), i != null && i.includes(f) && this.raise(this.start, s);
|
|
4744
4744
|
}
|
|
4745
4745
|
return c;
|
|
4746
4746
|
}, C.tsParseInOutModifiers = function(e) {
|
|
@@ -4756,7 +4756,7 @@ function kn(e) {
|
|
|
4756
4756
|
"abstract",
|
|
4757
4757
|
"override"
|
|
4758
4758
|
],
|
|
4759
|
-
errorTemplate:
|
|
4759
|
+
errorTemplate: H.InvalidModifierOnTypeParameter
|
|
4760
4760
|
});
|
|
4761
4761
|
}, C.tsParseTypeArguments = function() {
|
|
4762
4762
|
var e = this, t = this.startNode();
|
|
@@ -4764,13 +4764,13 @@ function kn(e) {
|
|
|
4764
4764
|
return e.tsInNoContext(function() {
|
|
4765
4765
|
return e.expect(o.relational), e.tsParseDelimitedList("TypeParametersOrArguments", e.tsParseType.bind(e));
|
|
4766
4766
|
});
|
|
4767
|
-
}), t.params.length === 0 && this.raise(this.start,
|
|
4767
|
+
}), t.params.length === 0 && this.raise(this.start, H.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(t, "TSTypeParameterInstantiation");
|
|
4768
4768
|
}, C.tsParseHeritageClause = function(e) {
|
|
4769
4769
|
var t = this, n = this.start, r = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
4770
4770
|
var e = t.startNode();
|
|
4771
4771
|
return e.expression = t.tsParseEntityName(), t.tsMatchLeftRelational() && (e.typeParameters = t.tsParseTypeArguments()), t.finishNode(e, "TSExpressionWithTypeArguments");
|
|
4772
4772
|
});
|
|
4773
|
-
return r.length || this.raise(n,
|
|
4773
|
+
return r.length || this.raise(n, H.EmptyHeritageClauseType({ token: e })), r;
|
|
4774
4774
|
}, C.tsParseTypeMemberSemicolon = function() {
|
|
4775
4775
|
this.eat(o.comma) || this.isLineTerminator() || this.expect(o.semi);
|
|
4776
4776
|
}, C.tsTryParseAndCatch = function(e) {
|
|
@@ -4784,18 +4784,18 @@ function kn(e) {
|
|
|
4784
4784
|
this.eat(o.question) && (e.optional = !0);
|
|
4785
4785
|
var n = e;
|
|
4786
4786
|
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
4787
|
-
t && this.raise(e.start,
|
|
4787
|
+
t && this.raise(e.start, H.ReadonlyForMethodSignature);
|
|
4788
4788
|
var r = n;
|
|
4789
|
-
r.kind && this.tsMatchLeftRelational() && this.raise(this.start,
|
|
4789
|
+
r.kind && this.tsMatchLeftRelational() && this.raise(this.start, H.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, r), this.tsParseTypeMemberSemicolon();
|
|
4790
4790
|
var i = "parameters", a = "typeAnnotation";
|
|
4791
|
-
if (r.kind === "get") r[i].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(r[i][0]) && this.raise(this.start,
|
|
4791
|
+
if (r.kind === "get") r[i].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(r[i][0]) && this.raise(this.start, H.AccesorCannotDeclareThisParameter));
|
|
4792
4792
|
else if (r.kind === "set") {
|
|
4793
4793
|
if (r[i].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
4794
4794
|
else {
|
|
4795
4795
|
var s = r[i][0];
|
|
4796
|
-
this.isThisParam(s) && this.raise(this.start,
|
|
4796
|
+
this.isThisParam(s) && this.raise(this.start, H.AccesorCannotDeclareThisParameter), s.type === "Identifier" && s.optional && this.raise(this.start, H.SetAccesorCannotHaveOptionalParameter), s.type === "RestElement" && this.raise(this.start, H.SetAccesorCannotHaveRestParameter);
|
|
4797
4797
|
}
|
|
4798
|
-
r[a] && this.raise(r[a].start,
|
|
4798
|
+
r[a] && this.raise(r[a].start, H.SetAccesorCannotHaveReturnType);
|
|
4799
4799
|
} else r.kind = "method";
|
|
4800
4800
|
return this.finishNode(r, "TSMethodSignature");
|
|
4801
4801
|
}
|
|
@@ -4832,7 +4832,7 @@ function kn(e) {
|
|
|
4832
4832
|
return this.expect(o.braceR), e;
|
|
4833
4833
|
}, C.tsParseInterfaceDeclaration = function(e, t) {
|
|
4834
4834
|
if (t === void 0 && (t = {}), this.hasFollowingLineBreak()) return null;
|
|
4835
|
-
this.expectContextual("interface"), t.declare && (e.declare = !0), v(this.type) ? (e.id = this.parseIdent(), this.checkLValSimple(e.id, 7)) : (e.id = null, this.raise(this.start,
|
|
4835
|
+
this.expectContextual("interface"), t.declare && (e.declare = !0), v(this.type) ? (e.id = this.parseIdent(), this.checkLValSimple(e.id, 7)) : (e.id = null, this.raise(this.start, H.MissingInterfaceName)), e.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(o._extends) && (e.extends = this.tsParseHeritageClause("extends"));
|
|
4836
4836
|
var n = this.startNode();
|
|
4837
4837
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), e.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(e, "TSInterfaceDeclaration");
|
|
4838
4838
|
}, C.tsParseAbstractDeclaration = function(e) {
|
|
@@ -4850,7 +4850,7 @@ function kn(e) {
|
|
|
4850
4850
|
break;
|
|
4851
4851
|
case "global":
|
|
4852
4852
|
if (this.match(o.braceL)) {
|
|
4853
|
-
e.prototype.enterScope.call(this,
|
|
4853
|
+
e.prototype.enterScope.call(this, pn);
|
|
4854
4854
|
var i = t;
|
|
4855
4855
|
return i.global = !0, i.id = n, i.body = this.tsParseModuleBlock(), e.prototype.exitScope.call(this), this.finishNode(i, "TSModuleDeclaration");
|
|
4856
4856
|
}
|
|
@@ -4889,7 +4889,7 @@ function kn(e) {
|
|
|
4889
4889
|
if (n === void 0 && (n = !1), t.id = this.parseIdent(), n || this.checkLValSimple(t.id, 8), this.eat(o.dot)) {
|
|
4890
4890
|
var r = this.startNode();
|
|
4891
4891
|
this.tsParseModuleOrNamespaceDeclaration(r, !0), t.body = r;
|
|
4892
|
-
} else e.prototype.enterScope.call(this,
|
|
4892
|
+
} else e.prototype.enterScope.call(this, pn), t.body = this.tsParseModuleBlock(), e.prototype.exitScope.call(this);
|
|
4893
4893
|
return this.finishNode(t, "TSModuleDeclaration");
|
|
4894
4894
|
}, C.checkLValSimple = function(t, n, r) {
|
|
4895
4895
|
return n === void 0 && (n = 0), e.prototype.checkLValSimple.call(this, t, n, r);
|
|
@@ -4923,7 +4923,7 @@ function kn(e) {
|
|
|
4923
4923
|
}, C.tsParseImportEqualsDeclaration = function(t, n) {
|
|
4924
4924
|
t.isExport = n || !1, t.id = this.parseIdent(), this.checkLValSimple(t.id, 2), e.prototype.expect.call(this, o.eq);
|
|
4925
4925
|
var r = this.tsParseModuleReference();
|
|
4926
|
-
return t.importKind === "type" && r.type !== "TSExternalModuleReference" && this.raise(r.start,
|
|
4926
|
+
return t.importKind === "type" && r.type !== "TSExternalModuleReference" && this.raise(r.start, H.ImportAliasHasImportType), t.moduleReference = r, e.prototype.semicolon.call(this), this.finishNode(t, "TSImportEqualsDeclaration");
|
|
4927
4927
|
}, C.isExportDefaultSpecifier = function() {
|
|
4928
4928
|
if (this.tsIsDeclarationStart()) return !1;
|
|
4929
4929
|
var e = this.type;
|
|
@@ -4950,13 +4950,13 @@ function kn(e) {
|
|
|
4950
4950
|
}, C.parseFunction = function(e, t, n, r, i) {
|
|
4951
4951
|
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === o.star && 2 & t && this.unexpected(), e.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), 1 & t && (e.id = 4 & t && this.type !== o.name ? null : this.parseIdent());
|
|
4952
4952
|
var a = this.yieldPos, s = this.awaitPos, c = this.awaitIdentPos, l = this.maybeInArrowParameters;
|
|
4953
|
-
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
4953
|
+
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(En(e.async, e.generator)), 1 & t || (e.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(e);
|
|
4954
4954
|
var u = 1 & t;
|
|
4955
4955
|
return this.parseFunctionBody(e, n, !1, i, { isFunctionDeclaration: u }), this.yieldPos = a, this.awaitPos = s, this.awaitIdentPos = c, 1 & t && e.id && !(2 & t) && this.checkLValSimple(e.id, e.body ? this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = l, this.finishNode(e, u ? "FunctionDeclaration" : "FunctionExpression");
|
|
4956
4956
|
}, C.parseFunctionBody = function(t, n, r, i, a) {
|
|
4957
4957
|
n === void 0 && (n = !1), r === void 0 && (r = !1), i === void 0 && (i = !1), this.match(o.colon) && (t.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
4958
4958
|
var s = a != null && a.isFunctionDeclaration ? "TSDeclareFunction" : a != null && a.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
4959
|
-
return s && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(t, s) : s === "TSDeclareFunction" && this.isAmbientContext && (this.raise(t.start,
|
|
4959
|
+
return s && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(t, s) : s === "TSDeclareFunction" && this.isAmbientContext && (this.raise(t.start, H.DeclareFunctionHasImplementation), t.declare) ? (e.prototype.parseFunctionBody.call(this, t, n, r, !1), this.finishNode(t, s)) : (e.prototype.parseFunctionBody.call(this, t, n, r, i), t);
|
|
4960
4960
|
}, C.parseNew = function() {
|
|
4961
4961
|
var e;
|
|
4962
4962
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
@@ -4997,7 +4997,7 @@ function kn(e) {
|
|
|
4997
4997
|
return this.importOrExportOuterKind = "value", r;
|
|
4998
4998
|
}
|
|
4999
4999
|
}
|
|
5000
|
-
return this.next(), this.type === o.string ? (e.specifiers = [], e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === o.string ? this.parseExprAtom() : this.unexpected()), this.parseMaybeImportAttributes(e), this.semicolon(), this.finishNode(e, "ImportDeclaration"), this.importOrExportOuterKind = "value", e.importKind === "type" && e.specifiers.length > 1 && e.specifiers[0].type === "ImportDefaultSpecifier" && this.raise(e.start,
|
|
5000
|
+
return this.next(), this.type === o.string ? (e.specifiers = [], e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === o.string ? this.parseExprAtom() : this.unexpected()), this.parseMaybeImportAttributes(e), this.semicolon(), this.finishNode(e, "ImportDeclaration"), this.importOrExportOuterKind = "value", e.importKind === "type" && e.specifiers.length > 1 && e.specifiers[0].type === "ImportDefaultSpecifier" && this.raise(e.start, H.TypeImportCannotSpecifyDefaultAndNamed), e;
|
|
5001
5001
|
}, C.parseExportDefaultDeclaration = function() {
|
|
5002
5002
|
if (this.isAbstractClass()) {
|
|
5003
5003
|
var t = this.startNode();
|
|
@@ -5037,7 +5037,7 @@ function kn(e) {
|
|
|
5037
5037
|
else {
|
|
5038
5038
|
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== o.string && this.unexpected(), e.source = this.parseExprAtom(), this.parseMaybeImportAttributes(e);
|
|
5039
5039
|
else {
|
|
5040
|
-
for (var s, c =
|
|
5040
|
+
for (var s, c = un(e.specifiers); !(s = c()).done;) {
|
|
5041
5041
|
var l = s.value;
|
|
5042
5042
|
this.checkUnreserved(l.local), this.checkLocalExport(l.local), l.local.type === "Literal" && this.raise(l.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
5043
5043
|
}
|
|
@@ -5050,7 +5050,7 @@ function kn(e) {
|
|
|
5050
5050
|
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), e[t] = !0);
|
|
5051
5051
|
}, C.parseMaybeDefault = function(t, n, r) {
|
|
5052
5052
|
var i = e.prototype.parseMaybeDefault.call(this, t, n, r);
|
|
5053
|
-
return i.type === "AssignmentPattern" && i.typeAnnotation && i.right.start < i.typeAnnotation.start && this.raise(i.typeAnnotation.start,
|
|
5053
|
+
return i.type === "AssignmentPattern" && i.typeAnnotation && i.right.start < i.typeAnnotation.start && this.raise(i.typeAnnotation.start, H.TypeAnnotationAfterAssign), i;
|
|
5054
5054
|
}, C.typeCastToParameter = function(e) {
|
|
5055
5055
|
return e.expression.typeAnnotation = e.typeAnnotation, this.resetEndLocation(e.expression, e.typeAnnotation.end), e.expression;
|
|
5056
5056
|
}, C.toAssignableList = function(t, n) {
|
|
@@ -5099,9 +5099,9 @@ function kn(e) {
|
|
|
5099
5099
|
this.next(), e.prototype.parseVar.call(this, t, !1, n, r || i), this.semicolon();
|
|
5100
5100
|
var a = this.finishNode(t, "VariableDeclaration");
|
|
5101
5101
|
if (!i) return a;
|
|
5102
|
-
for (var o, s =
|
|
5102
|
+
for (var o, s = un(a.declarations); !(o = s()).done;) {
|
|
5103
5103
|
var c = o.value, l = c.init;
|
|
5104
|
-
l && (n !== "const" || c.id.typeAnnotation ? this.raise(l.start,
|
|
5104
|
+
l && (n !== "const" || c.id.typeAnnotation ? this.raise(l.start, H.InitializerNotAllowedInAmbientContext) : l.type !== "StringLiteral" && l.type !== "BooleanLiteral" && l.type !== "NumericLiteral" && l.type !== "BigIntLiteral" && (l.type !== "TemplateLiteral" || l.expressions.length > 0) && !Dn(l) && this.raise(l.start, H.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
5105
5105
|
}
|
|
5106
5106
|
return a;
|
|
5107
5107
|
}, C.parseStatement = function(t, n, r) {
|
|
@@ -5122,7 +5122,7 @@ function kn(e) {
|
|
|
5122
5122
|
"private"
|
|
5123
5123
|
]);
|
|
5124
5124
|
}, C.parsePostMemberNameModifiers = function(e) {
|
|
5125
|
-
this.eat(o.question) && (e.optional = !0), e.readonly && this.match(o.parenL) && this.raise(e.start,
|
|
5125
|
+
this.eat(o.question) && (e.optional = !0), e.readonly && this.match(o.parenL) && this.raise(e.start, H.ClassMethodHasReadonly), e.declare && this.match(o.parenL) && this.raise(e.start, H.ClassMethodHasDeclare);
|
|
5126
5126
|
}, C.parseExpressionStatement = function(t, n) {
|
|
5127
5127
|
return (n.type === "Identifier" ? this.tsParseExpressionStatement(t, n) : void 0) || e.prototype.parseExpressionStatement.call(this, t, n);
|
|
5128
5128
|
}, C.shouldParseExportStatement = function() {
|
|
@@ -5154,7 +5154,7 @@ function kn(e) {
|
|
|
5154
5154
|
return t.parseExportDeclaration(e);
|
|
5155
5155
|
});
|
|
5156
5156
|
var n = this.start, r = this.startLoc, i = this.eatContextual("declare");
|
|
5157
|
-
!i || !this.ts_isContextual(m.declare) && this.shouldParseExportStatement() || this.raise(this.start,
|
|
5157
|
+
!i || !this.ts_isContextual(m.declare) && this.shouldParseExportStatement() || this.raise(this.start, H.ExpectedAmbientAfterExportDeclare);
|
|
5158
5158
|
var a = v(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
5159
5159
|
return a ? ((a.type === "TSInterfaceDeclaration" || a.type === "TSTypeAliasDeclaration" || i) && (e.exportKind = "type"), i && (this.resetStartLocation(a, n, r), a.declare = !0), a) : null;
|
|
5160
5160
|
}, C.parseClassId = function(t, n) {
|
|
@@ -5168,19 +5168,19 @@ function kn(e) {
|
|
|
5168
5168
|
var t = this.tsTryParseTypeAnnotation();
|
|
5169
5169
|
t && (e.typeAnnotation = t);
|
|
5170
5170
|
}, C.parseClassField = function(t) {
|
|
5171
|
-
if (t.key.type === "PrivateIdentifier") t.abstract && this.raise(t.start,
|
|
5172
|
-
else if (this.parseClassPropertyAnnotation(t), this.isAmbientContext && (!t.readonly || t.typeAnnotation) && this.match(o.eq) && this.raise(this.start,
|
|
5171
|
+
if (t.key.type === "PrivateIdentifier") t.abstract && this.raise(t.start, H.PrivateElementHasAbstract), t.accessibility && this.raise(t.start, H.PrivateElementHasAccessibility({ modifier: t.accessibility })), this.parseClassPropertyAnnotation(t);
|
|
5172
|
+
else if (this.parseClassPropertyAnnotation(t), this.isAmbientContext && (!t.readonly || t.typeAnnotation) && this.match(o.eq) && this.raise(this.start, H.DeclareClassFieldHasInitializer), t.abstract && this.match(o.eq)) {
|
|
5173
5173
|
var n = t.key;
|
|
5174
|
-
this.raise(this.start,
|
|
5174
|
+
this.raise(this.start, H.AbstractPropertyHasInitializer({ propertyName: n.type !== "Identifier" || t.computed ? "[" + this.input.slice(n.start, n.end) + "]" : n.name }));
|
|
5175
5175
|
}
|
|
5176
5176
|
return e.prototype.parseClassField.call(this, t);
|
|
5177
5177
|
}, C.parseClassMethod = function(e, t, n, r) {
|
|
5178
5178
|
var i = e.kind === "constructor", a = e.key.type === "PrivateIdentifier", o = this.tsTryParseTypeParameters();
|
|
5179
|
-
a ? (o && (e.typeParameters = o), e.accessibility && this.raise(e.start,
|
|
5179
|
+
a ? (o && (e.typeParameters = o), e.accessibility && this.raise(e.start, H.PrivateMethodsHasAccessibility({ modifier: e.accessibility }))) : o && i && this.raise(o.start, H.ConstructorHasTypeParameters);
|
|
5180
5180
|
var s = e.declare, c = e.kind;
|
|
5181
|
-
!(s !== void 0 && s) || c !== "get" && c !== "set" || this.raise(e.start,
|
|
5181
|
+
!(s !== void 0 && s) || c !== "get" && c !== "set" || this.raise(e.start, H.DeclareAccessor({ kind: c })), o && (e.typeParameters = o);
|
|
5182
5182
|
var l = e.key;
|
|
5183
|
-
e.kind === "constructor" ? (t && this.raise(l.start, "Constructor can't be a generator"), n && this.raise(l.start, "Constructor can't be an async method")) : e.static &&
|
|
5183
|
+
e.kind === "constructor" ? (t && this.raise(l.start, "Constructor can't be a generator"), n && this.raise(l.start, "Constructor can't be an async method")) : e.static && _n(e, "prototype") && this.raise(l.start, "Classes may not have a static property named prototype");
|
|
5184
5184
|
var u = e.value = this.parseMethod(t, n, r, !0, e);
|
|
5185
5185
|
return e.kind === "get" && u.params.length !== 0 && this.raiseRecoverable(u.start, "getter should have no params"), e.kind === "set" && u.params.length !== 1 && this.raiseRecoverable(u.start, "setter should have exactly one param"), e.kind === "set" && u.params[0].type === "RestElement" && this.raiseRecoverable(u.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
5186
5186
|
}, C.isClassMethod = function() {
|
|
@@ -5204,23 +5204,23 @@ function kn(e) {
|
|
|
5204
5204
|
allowedModifiers: d,
|
|
5205
5205
|
disallowedModifiers: ["in", "out"],
|
|
5206
5206
|
stopOnStartOfClassStaticBlock: !0,
|
|
5207
|
-
errorTemplate:
|
|
5207
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
5208
5208
|
}).static;
|
|
5209
5209
|
var f = function() {
|
|
5210
5210
|
if (!n.tsIsStartOfStaticBlocks()) {
|
|
5211
5211
|
var f = n.tsTryParseIndexSignature(a);
|
|
5212
|
-
if (f) return a.abstract && n.raise(a.start,
|
|
5213
|
-
if (!n.inAbstractClass && a.abstract && n.raise(a.start,
|
|
5212
|
+
if (f) return a.abstract && n.raise(a.start, H.IndexSignatureHasAbstract), a.accessibility && n.raise(a.start, H.IndexSignatureHasAccessibility({ modifier: a.accessibility })), a.declare && n.raise(a.start, H.IndexSignatureHasDeclare), a.override && n.raise(a.start, H.IndexSignatureHasOverride), f;
|
|
5213
|
+
if (!n.inAbstractClass && a.abstract && n.raise(a.start, H.NonAbstractClassHasAbstractMethod), a.override && t && n.raise(a.start, H.OverrideNotInSubClass), a.static = r, r && (n.isClassElementNameStart() || n.type === o.star || (s = "static")), !s && i >= 8 && n.eatContextual("async") && (!n.isClassElementNameStart() && n.type !== o.star || n.canInsertSemicolon() ? s = "async" : l = !0), !s && (i >= 9 || !l) && n.eat(o.star) && (c = !0), !s && !l && !c) {
|
|
5214
5214
|
var p = n.value;
|
|
5215
5215
|
(n.eatContextual("get") || n.eatContextual("set")) && (n.isClassElementNameStart() ? u = p : s = p);
|
|
5216
5216
|
}
|
|
5217
5217
|
if (s ? (a.computed = !1, a.key = n.startNodeAt(n.lastTokStart, n.lastTokStartLoc), a.key.name = s, n.finishNode(a.key, "Identifier")) : n.parseClassElementName(a), n.parsePostMemberNameModifiers(a), n.isClassMethod() || i < 13 || n.type === o.parenL || u !== "method" || c || l) {
|
|
5218
|
-
var m = !a.static &&
|
|
5218
|
+
var m = !a.static && _n(a, "constructor"), h = m && t;
|
|
5219
5219
|
m && u !== "method" && n.raise(a.key.start, "Constructor can't have get/set modifier"), a.kind = m ? "constructor" : u, n.parseClassMethod(a, c, l, h);
|
|
5220
5220
|
} else n.parseClassField(a);
|
|
5221
5221
|
return a;
|
|
5222
5222
|
}
|
|
5223
|
-
if (n.next(), n.next(), n.tsHasSomeModifiers(a, d) && n.raise(n.start,
|
|
5223
|
+
if (n.next(), n.next(), n.tsHasSomeModifiers(a, d) && n.raise(n.start, H.StaticBlockCannotHaveModifier), i >= 13) return e.prototype.parseClassStaticBlock.call(n, a), a;
|
|
5224
5224
|
};
|
|
5225
5225
|
return a.declare ? this.tsInAmbientContext(f) : f(), a;
|
|
5226
5226
|
}, C.isClassElementNameStart = function() {
|
|
@@ -5237,7 +5237,7 @@ function kn(e) {
|
|
|
5237
5237
|
}, C.parseArrowExpression = function(e, t, n, r) {
|
|
5238
5238
|
this.match(o.colon) && (e.returnType = this.tsParseTypeAnnotation());
|
|
5239
5239
|
var i = this.yieldPos, a = this.awaitPos, s = this.awaitIdentPos;
|
|
5240
|
-
this.enterScope(16 |
|
|
5240
|
+
this.enterScope(16 | En(n, !1)), this.initFunction(e);
|
|
5241
5241
|
var c = this.maybeInArrowParameters;
|
|
5242
5242
|
return this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, e.params = this.toAssignableList(t, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = s, this.maybeInArrowParameters = c, this.finishNode(e, "ArrowFunctionExpression");
|
|
5243
5243
|
}, C.parseMaybeAssignOrigin = function(e, t, n) {
|
|
@@ -5246,7 +5246,7 @@ function kn(e) {
|
|
|
5246
5246
|
this.exprAllowed = !1;
|
|
5247
5247
|
}
|
|
5248
5248
|
var r = !1, i = -1, a = -1, s = -1;
|
|
5249
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, s = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
5249
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, s = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new hn(), r = !0);
|
|
5250
5250
|
var c = this.start, l = this.startLoc;
|
|
5251
5251
|
(this.type === o.parenL || v(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
5252
5252
|
var u = this.parseMaybeConditional(e, t);
|
|
@@ -5273,7 +5273,7 @@ function kn(e) {
|
|
|
5273
5273
|
return (a.type !== "ArrowFunctionExpression" || (i = a.extra) != null && i.parenthesized) && r(), f?.params.length !== 0 && p.resetStartLocationFromNode(a, f), a.typeParameters = f, a;
|
|
5274
5274
|
}, l);
|
|
5275
5275
|
if (!g.error && !g.aborted) return f && this.reportReservedArrowTypeParam(f), g.node;
|
|
5276
|
-
if (!u && (
|
|
5276
|
+
if (!u && (Cn(!0), !(d = this.tryParse(function() {
|
|
5277
5277
|
return p.parseMaybeAssignOrigin(e, t, n);
|
|
5278
5278
|
}, l)).error)) return d.node;
|
|
5279
5279
|
if ((a = u) != null && a.node) return this.setLookaheadState(u.failState), u.node;
|
|
@@ -5294,20 +5294,20 @@ function kn(e) {
|
|
|
5294
5294
|
"override",
|
|
5295
5295
|
"readonly"
|
|
5296
5296
|
]
|
|
5297
|
-
}), n = s.accessibility, o = s.override, a = s.readonly, !1 === e && (n || a || o) && this.raise(i.start,
|
|
5297
|
+
}), n = s.accessibility, o = s.override, a = s.readonly, !1 === e && (n || a || o) && this.raise(i.start, H.UnexpectedParameterModifier);
|
|
5298
5298
|
}
|
|
5299
5299
|
var c = this.parseMaybeDefault(r, i);
|
|
5300
5300
|
this.parseBindingListItem(c);
|
|
5301
5301
|
var l = this.parseMaybeDefault(c.start, c.loc, c);
|
|
5302
5302
|
if (t.length && (l.decorators = t), n || a || o) {
|
|
5303
5303
|
var u = this.startNodeAt(r, i);
|
|
5304
|
-
return n && (u.accessibility = n), a && (u.readonly = a), o && (u.override = o), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(u.start,
|
|
5304
|
+
return n && (u.accessibility = n), a && (u.readonly = a), o && (u.override = o), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(u.start, H.UnsupportedParameterPropertyKind), u.parameter = l, this.finishNode(u, "TSParameterProperty");
|
|
5305
5305
|
}
|
|
5306
5306
|
return l;
|
|
5307
5307
|
}, C.checkLValInnerPattern = function(t, n, r) {
|
|
5308
5308
|
n === void 0 && (n = 0), t.type === "TSParameterProperty" ? this.checkLValInnerPattern(t.parameter, n, r) : e.prototype.checkLValInnerPattern.call(this, t, n, r);
|
|
5309
5309
|
}, C.parseBindingListItem = function(e) {
|
|
5310
|
-
this.eat(o.question) && (e.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(e.start,
|
|
5310
|
+
this.eat(o.question) && (e.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(e.start, H.PatternIsOptional), e.optional = !0);
|
|
5311
5311
|
var t = this.tsTryParseTypeAnnotation();
|
|
5312
5312
|
return t && (e.typeAnnotation = t), this.resetEndLocation(e), e;
|
|
5313
5313
|
}, C.isAssignable = function(e, t) {
|
|
@@ -5338,12 +5338,12 @@ function kn(e) {
|
|
|
5338
5338
|
default: return !1;
|
|
5339
5339
|
}
|
|
5340
5340
|
}, C.toAssignable = function(t, n, r) {
|
|
5341
|
-
switch (n === void 0 && (n = !1), r === void 0 && (r = new
|
|
5341
|
+
switch (n === void 0 && (n = !1), r === void 0 && (r = new hn()), t.type) {
|
|
5342
5342
|
case "ParenthesizedExpression": return this.toAssignableParenthesizedExpression(t, n, r);
|
|
5343
5343
|
case "TSAsExpression":
|
|
5344
5344
|
case "TSSatisfiesExpression":
|
|
5345
5345
|
case "TSNonNullExpression":
|
|
5346
|
-
case "TSTypeAssertion": return n || this.raise(t.start,
|
|
5346
|
+
case "TSTypeAssertion": return n || this.raise(t.start, H.UnexpectedTypeCastInParameter), this.toAssignable(t.expression, n, r);
|
|
5347
5347
|
case "MemberExpression": break;
|
|
5348
5348
|
case "AssignmentExpression": return n || t.left.type !== "TSTypeCastExpression" || (t.left = this.typeCastToParameter(t.left)), e.prototype.toAssignable.call(this, t, n, r);
|
|
5349
5349
|
case "TSTypeCastExpression": return this.typeCastToParameter(t);
|
|
@@ -5395,7 +5395,7 @@ function kn(e) {
|
|
|
5395
5395
|
if (this.options.ecmaVersion >= 6) {
|
|
5396
5396
|
var s = this.maybeInArrowParameters;
|
|
5397
5397
|
this.maybeInArrowParameters = !0, this.next();
|
|
5398
|
-
var c, l = this.start, u = this.startLoc, d = [], f = !0, p = !1, m = new
|
|
5398
|
+
var c, l = this.start, u = this.startLoc, d = [], f = !0, p = !1, m = new hn(), h = this.yieldPos, g = this.awaitPos;
|
|
5399
5399
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== o.parenR;) {
|
|
5400
5400
|
if (f ? f = !1 : this.expect(o.comma), a && this.afterTrailingComma(o.parenR, !0)) {
|
|
5401
5401
|
p = !0;
|
|
@@ -5464,7 +5464,7 @@ function kn(e) {
|
|
|
5464
5464
|
return u.typeParameters = a, u;
|
|
5465
5465
|
}
|
|
5466
5466
|
if (!r && c.eat(o.parenL)) {
|
|
5467
|
-
var p = new
|
|
5467
|
+
var p = new hn(), m = c.startNodeAt(t, n);
|
|
5468
5468
|
return m.callee = e, m.arguments = c.parseExprList(o.parenR, c.options.ecmaVersion >= 8, !1, p), c.tsCheckForInvalidTypeCasts(m.arguments), m.typeParameters = a, l && (m.optional = d), c.checkExpressionErrors(p, !0), e = c.finishNode(m, "CallExpression");
|
|
5469
5469
|
}
|
|
5470
5470
|
var h = c.type;
|
|
@@ -5473,7 +5473,7 @@ function kn(e) {
|
|
|
5473
5473
|
return _.expression = e, _.typeParameters = a, c.finishNode(_, "TSInstantiationExpression");
|
|
5474
5474
|
}
|
|
5475
5475
|
});
|
|
5476
|
-
if (f && this.unexpected(f), p) return p.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start,
|
|
5476
|
+
if (f && this.unexpected(f), p) return p.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, H.InvalidPropertyAccessAfterInstantiationExpression), e = p;
|
|
5477
5477
|
}
|
|
5478
5478
|
var m = this.options.ecmaVersion >= 11, h = m && this.eat(o.questionDot);
|
|
5479
5479
|
r && h && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
@@ -5484,7 +5484,7 @@ function kn(e) {
|
|
|
5484
5484
|
} else if (!r && this.eat(o.parenL)) {
|
|
5485
5485
|
var te = this.maybeInArrowParameters;
|
|
5486
5486
|
this.maybeInArrowParameters = !0;
|
|
5487
|
-
var v = new
|
|
5487
|
+
var v = new hn(), ne = this.yieldPos, y = this.awaitPos, b = this.awaitIdentPos;
|
|
5488
5488
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
5489
5489
|
var x = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, v);
|
|
5490
5490
|
if (i && !h && this.shouldParseAsyncArrow()) this.checkPatternErrors(v, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = ne, this.awaitPos = y, this.awaitIdentPos = b, e = this.parseSubscriptAsyncArrow(t, n, x, s);
|
|
@@ -5530,7 +5530,7 @@ function kn(e) {
|
|
|
5530
5530
|
for (this.expect(o.braceL); this.type !== o.braceR;) if (this.match(m.at)) c.push(this.parseDecorator());
|
|
5531
5531
|
else {
|
|
5532
5532
|
var l = this.parseClassElement(e.superClass !== null);
|
|
5533
|
-
c.length && (l.decorators = c, this.resetStartLocationFromNode(l, c[0]), c = []), l && (a.body.push(l), l.type === "MethodDefinition" && l.kind === "constructor" && l.value.type === "FunctionExpression" ? (s && this.raiseRecoverable(l.start, "Duplicate constructor in the same class"), s = !0, l.decorators && l.decorators.length > 0 && this.raise(l.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : l.key && l.key.type === "PrivateIdentifier" &&
|
|
5533
|
+
c.length && (l.decorators = c, this.resetStartLocationFromNode(l, c[0]), c = []), l && (a.body.push(l), l.type === "MethodDefinition" && l.kind === "constructor" && l.value.type === "FunctionExpression" ? (s && this.raiseRecoverable(l.start, "Duplicate constructor in the same class"), s = !0, l.decorators && l.decorators.length > 0 && this.raise(l.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : l.key && l.key.type === "PrivateIdentifier" && gn(i, l) && this.raiseRecoverable(l.key.start, "Identifier '#" + l.key.name + "' has already been declared"));
|
|
5534
5534
|
}
|
|
5535
5535
|
return this.strict = r, this.next(), c.length && this.raise(this.start, "Decorators must be attached to a class element."), e.body = this.finishNode(a, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
5536
5536
|
} finally {
|
|
@@ -5541,9 +5541,9 @@ function kn(e) {
|
|
|
5541
5541
|
return e && (t.typeParameters = e), t;
|
|
5542
5542
|
}, C.parseMethod = function(e, t, n, r, i) {
|
|
5543
5543
|
var a = this.startNode(), s = this.yieldPos, c = this.awaitPos, l = this.awaitIdentPos;
|
|
5544
|
-
if (this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = e), this.options.ecmaVersion >= 8 && (a.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 |
|
|
5544
|
+
if (this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = e), this.options.ecmaVersion >= 8 && (a.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | En(t, a.generator) | (n ? 128 : 0)), this.expect(o.parenL), a.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1, { isClassMethod: r }), this.yieldPos = s, this.awaitPos = c, this.awaitIdentPos = l, i && i.abstract && a.body) {
|
|
5545
5545
|
var u = i.key;
|
|
5546
|
-
this.raise(i.start,
|
|
5546
|
+
this.raise(i.start, H.AbstractMethodHasImplementation({ methodName: u.type !== "Identifier" || i.computed ? "[" + this.input.slice(u.start, u.end) + "]" : u.name }));
|
|
5547
5547
|
}
|
|
5548
5548
|
return this.finishNode(a, "FunctionExpression");
|
|
5549
5549
|
}, t.parse = function(e, t) {
|
|
@@ -5580,7 +5580,7 @@ function kn(e) {
|
|
|
5580
5580
|
ne(this.type) ? (c = !0, s = d, i = n ? this.parseIdent() : this.parseModuleExportName(), l = !1) : (i = f, l = !1);
|
|
5581
5581
|
} else ne(this.type) ? (l = !1, i = n ? this.parseIdent() : this.parseModuleExportName()) : (c = !0, s = d);
|
|
5582
5582
|
} else ne(this.type) && (c = !0, n ? (s = e.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(s)) : s = this.parseModuleExportName());
|
|
5583
|
-
c && r && this.raise(u, n ?
|
|
5583
|
+
c && r && this.raise(u, n ? H.TypeModifierIsUsedInTypeImports : H.TypeModifierIsUsedInTypeExports), t[a] = s, t[o] = i, t[n ? "importKind" : "exportKind"] = c ? "type" : "value", l && this.eatContextual("as") && (t[o] = n ? this.parseIdent() : this.parseModuleExportName()), t[o] || (t[o] = this.copyNode(t[a])), n && this.checkLValSimple(t[o], 2);
|
|
5584
5584
|
}, C.raiseCommonCheck = function(t, n, r) {
|
|
5585
5585
|
return n === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : e.prototype.raise.call(this, t, n) : r ? e.prototype.raiseRecoverable.call(this, t, n) : e.prototype.raise.call(this, t, n);
|
|
5586
5586
|
}, C.raiseRecoverable = function(e, t) {
|
|
@@ -5607,11 +5607,11 @@ function kn(e) {
|
|
|
5607
5607
|
for (r.attributes = []; this.type !== o.slash && this.type !== m.jsxTagEnd;) r.attributes.push(this.jsx_parseAttribute());
|
|
5608
5608
|
return r.selfClosing = this.eat(o.slash), this.expect(m.jsxTagEnd), this.finishNode(r, i ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
5609
5609
|
}, C.enterScope = function(t) {
|
|
5610
|
-
t ===
|
|
5610
|
+
t === pn && this.importsStack.push([]), e.prototype.enterScope.call(this, t);
|
|
5611
5611
|
var n = e.prototype.currentScope.call(this);
|
|
5612
5612
|
n.types = [], n.enums = [], n.constEnums = [], n.classes = [], n.exportOnlyBindings = [];
|
|
5613
5613
|
}, C.exitScope = function() {
|
|
5614
|
-
e.prototype.currentScope.call(this).flags ===
|
|
5614
|
+
e.prototype.currentScope.call(this).flags === pn && this.importsStack.pop(), e.prototype.exitScope.call(this);
|
|
5615
5615
|
}, C.hasImport = function(e, t) {
|
|
5616
5616
|
var n = this.importsStack.length;
|
|
5617
5617
|
if (this.importsStack[n - 1].indexOf(e) > -1) return !0;
|
|
@@ -5649,13 +5649,13 @@ function kn(e) {
|
|
|
5649
5649
|
get: function() {
|
|
5650
5650
|
return i;
|
|
5651
5651
|
}
|
|
5652
|
-
}]) &&
|
|
5652
|
+
}]) && an(u.prototype, x), S && an(u, S), Object.defineProperty(u, "prototype", { writable: !1 }), t;
|
|
5653
5653
|
}(t);
|
|
5654
5654
|
};
|
|
5655
5655
|
}
|
|
5656
5656
|
//#endregion
|
|
5657
5657
|
//#region src/utilities/index.ts
|
|
5658
|
-
var
|
|
5658
|
+
var jn = [
|
|
5659
5659
|
{
|
|
5660
5660
|
idPrefix: "dpuse-app",
|
|
5661
5661
|
typeId: "app",
|
|
@@ -5740,9 +5740,9 @@ var An = [
|
|
|
5740
5740
|
publishedTo: "github",
|
|
5741
5741
|
uploadGroupName: void 0
|
|
5742
5742
|
}
|
|
5743
|
-
],
|
|
5744
|
-
async function
|
|
5745
|
-
e !== void 0 &&
|
|
5743
|
+
], Mn = r(i);
|
|
5744
|
+
async function Nn(e, r) {
|
|
5745
|
+
e !== void 0 && q(`${e} - clear(${r})`);
|
|
5746
5746
|
let i;
|
|
5747
5747
|
try {
|
|
5748
5748
|
i = await t.readdir(r, { withFileTypes: !0 });
|
|
@@ -5762,16 +5762,16 @@ async function Mn(e, r) {
|
|
|
5762
5762
|
}
|
|
5763
5763
|
}));
|
|
5764
5764
|
}
|
|
5765
|
-
async function
|
|
5765
|
+
async function Pn(e, n) {
|
|
5766
5766
|
return t.readdir(e, n);
|
|
5767
5767
|
}
|
|
5768
|
-
async function
|
|
5769
|
-
e !== void 0 &&
|
|
5770
|
-
let { stdout: a, stderr: o } = await
|
|
5768
|
+
async function Fn(e, n, r, i) {
|
|
5769
|
+
e !== void 0 && q(`${e} - exec(${n} ${r.join(" ")})`);
|
|
5770
|
+
let { stdout: a, stderr: o } = await Mn(n, r);
|
|
5771
5771
|
i === void 0 ? a.trim() && console.log(a.trim()) : await t.writeFile(i, a.trim(), "utf-8"), o.trim() && console.error(o.trim());
|
|
5772
5772
|
}
|
|
5773
|
-
async function
|
|
5774
|
-
return
|
|
5773
|
+
async function U(e, t, n, r = !1, i = !1) {
|
|
5774
|
+
return q(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, o) => {
|
|
5775
5775
|
a(t, n, {
|
|
5776
5776
|
shell: i,
|
|
5777
5777
|
stdio: "inherit"
|
|
@@ -5780,8 +5780,8 @@ async function W(e, t, n, r = !1, i = !1) {
|
|
|
5780
5780
|
});
|
|
5781
5781
|
});
|
|
5782
5782
|
}
|
|
5783
|
-
async function
|
|
5784
|
-
return
|
|
5783
|
+
async function In(e, r, i, o, s = !1) {
|
|
5784
|
+
return q(`${e} - spawn(${r} ${i.join(" ")}) > ${o}`), new Promise((e, c) => {
|
|
5785
5785
|
let l = a(r, i, {
|
|
5786
5786
|
shell: !1,
|
|
5787
5787
|
stdio: [
|
|
@@ -5803,13 +5803,13 @@ async function Fn(e, r, i, o, s = !1) {
|
|
|
5803
5803
|
});
|
|
5804
5804
|
});
|
|
5805
5805
|
}
|
|
5806
|
-
async function
|
|
5806
|
+
async function W(e) {
|
|
5807
5807
|
return JSON.parse(await t.readFile(e, "utf-8"));
|
|
5808
5808
|
}
|
|
5809
|
-
async function
|
|
5809
|
+
async function Ln(e) {
|
|
5810
5810
|
return await t.readFile(e, "utf-8");
|
|
5811
5811
|
}
|
|
5812
|
-
async function
|
|
5812
|
+
async function Rn(e) {
|
|
5813
5813
|
try {
|
|
5814
5814
|
return await t.readFile(e, "utf-8");
|
|
5815
5815
|
} catch (e) {
|
|
@@ -5817,31 +5817,31 @@ async function Ln(e) {
|
|
|
5817
5817
|
throw e;
|
|
5818
5818
|
}
|
|
5819
5819
|
}
|
|
5820
|
-
async function
|
|
5820
|
+
async function zn(e, n) {
|
|
5821
5821
|
await t.writeFile(e, JSON.stringify(n, void 0, 4), "utf-8");
|
|
5822
5822
|
}
|
|
5823
|
-
async function
|
|
5824
|
-
await
|
|
5823
|
+
async function Bn(e, t, n) {
|
|
5824
|
+
await Vn("README.md", qn(await Ln("./README.md"), e, t, n));
|
|
5825
5825
|
}
|
|
5826
|
-
async function
|
|
5826
|
+
async function Vn(e, n) {
|
|
5827
5827
|
await t.writeFile(e, n, "utf-8");
|
|
5828
5828
|
}
|
|
5829
|
-
function
|
|
5829
|
+
function G(e) {
|
|
5830
5830
|
let t = "────────────────────────────────────────────────────────────────────────────────";
|
|
5831
5831
|
console.info(`\n[36m${t}`), console.info(`▶️ ${e}`), console.info(`${t}[0m`);
|
|
5832
5832
|
}
|
|
5833
|
-
function
|
|
5833
|
+
function K(e) {
|
|
5834
5834
|
console.info(`\n✅ ${e}\n`);
|
|
5835
5835
|
}
|
|
5836
|
-
function
|
|
5836
|
+
function q(e) {
|
|
5837
5837
|
console.info(`\n${e}\n`);
|
|
5838
5838
|
}
|
|
5839
|
-
function
|
|
5840
|
-
let t =
|
|
5839
|
+
function Hn(e) {
|
|
5840
|
+
let t = jn.find((t) => e.startsWith(t.idPrefix));
|
|
5841
5841
|
if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
|
|
5842
5842
|
return t;
|
|
5843
5843
|
}
|
|
5844
|
-
function
|
|
5844
|
+
function Un(e, t) {
|
|
5845
5845
|
let n = e.repository, r = typeof n == "string" ? n : n?.url;
|
|
5846
5846
|
if (r == null || r === "") throw Error(`package.json 'repository' field is required to ${t}.`);
|
|
5847
5847
|
let i = r.replace(/^git\+/, "").replace(/\.git$/, ""), a = /github\.com[/:]([^/]+)\/([^/]+)$/.exec(i);
|
|
@@ -5851,16 +5851,16 @@ function Hn(e, t) {
|
|
|
5851
5851
|
repo: a[2]
|
|
5852
5852
|
};
|
|
5853
5853
|
}
|
|
5854
|
-
async function
|
|
5854
|
+
async function Wn(e) {
|
|
5855
5855
|
return await t.stat(e);
|
|
5856
5856
|
}
|
|
5857
|
-
function
|
|
5858
|
-
let t = k.extend(
|
|
5857
|
+
function Gn(e) {
|
|
5858
|
+
let t = k.extend(An()).parse(e, {
|
|
5859
5859
|
ecmaVersion: "latest",
|
|
5860
5860
|
sourceType: "module",
|
|
5861
5861
|
locations: !0
|
|
5862
5862
|
}), n = [];
|
|
5863
|
-
return
|
|
5863
|
+
return Kn(t, (e) => {
|
|
5864
5864
|
if (e.type !== "MethodDefinition") return;
|
|
5865
5865
|
let t = e, r = t.key;
|
|
5866
5866
|
if (r.type !== "Identifier") return;
|
|
@@ -5868,7 +5868,7 @@ function Wn(e) {
|
|
|
5868
5868
|
i && i !== "constructor" && t.accessibility !== "private" && n.push(i);
|
|
5869
5869
|
}), n;
|
|
5870
5870
|
}
|
|
5871
|
-
function
|
|
5871
|
+
function Kn(e, t) {
|
|
5872
5872
|
t(e);
|
|
5873
5873
|
for (let [n, r] of Object.entries(e)) {
|
|
5874
5874
|
if ([
|
|
@@ -5881,12 +5881,12 @@ function Gn(e, t) {
|
|
|
5881
5881
|
let e = r;
|
|
5882
5882
|
if (Array.isArray(e)) for (let n of e) {
|
|
5883
5883
|
let e = n;
|
|
5884
|
-
e && typeof e.type == "string" &&
|
|
5884
|
+
e && typeof e.type == "string" && Kn(e, t);
|
|
5885
5885
|
}
|
|
5886
|
-
else e && typeof e == "object" && typeof e.type == "string" &&
|
|
5886
|
+
else e && typeof e == "object" && typeof e.type == "string" && Kn(e, t);
|
|
5887
5887
|
}
|
|
5888
5888
|
}
|
|
5889
|
-
function
|
|
5889
|
+
function qn(e, t, n, r) {
|
|
5890
5890
|
let i = e.indexOf(n), a = e.indexOf(r);
|
|
5891
5891
|
if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
|
|
5892
5892
|
let o = t.trim();
|
|
@@ -5894,47 +5894,47 @@ function Kn(e, t, n, r) {
|
|
|
5894
5894
|
}
|
|
5895
5895
|
//#endregion
|
|
5896
5896
|
//#region src/actions/auditDependencies.ts
|
|
5897
|
-
async function
|
|
5897
|
+
async function Jn() {
|
|
5898
5898
|
try {
|
|
5899
|
-
|
|
5899
|
+
G("Audit Dependencies"), await U("1️⃣ Check using 'npm audit'", "npm", ["audit"]), K("Dependencies audited");
|
|
5900
5900
|
} catch (e) {
|
|
5901
5901
|
console.error("❌ Error auditing dependencies", e), process.exit(1);
|
|
5902
5902
|
}
|
|
5903
5903
|
}
|
|
5904
5904
|
//#endregion
|
|
5905
5905
|
//#region src/actions/checkConfigFiles.ts
|
|
5906
|
-
async function
|
|
5906
|
+
async function Yn() {
|
|
5907
5907
|
try {
|
|
5908
|
-
|
|
5909
|
-
let e =
|
|
5910
|
-
await
|
|
5908
|
+
G("Check configuration files"), q("1️⃣ Check individual files");
|
|
5909
|
+
let e = Hn((await W("config.json")).id), t = n.dirname(o(import.meta.url));
|
|
5910
|
+
await J(t, ".editorconfig"), await Xn(e, t), await J(t, ".gitignore", [".gitignore_default"]), await J(t, ".markdownlint.json"), await J(t, ".ncurc.json"), await Zn(e, t), await J(t, "LICENSE"), await Qn(e, t), await $n(e, t), await er(e, t), await tr(e, t), K("Configuration files checked");
|
|
5911
5911
|
} catch (e) {
|
|
5912
5912
|
console.error("❌ Error checking configuration files", e), process.exit(1);
|
|
5913
5913
|
}
|
|
5914
5914
|
}
|
|
5915
|
-
async function Yn(e, t) {
|
|
5916
|
-
["development"].includes(e.typeId) ? console.info("ℹ️ File '.gitattributes' is UNIQUE to this project") : await Y(t, ".gitattributes", [".gitattributes_default"]);
|
|
5917
|
-
}
|
|
5918
5915
|
async function Xn(e, t) {
|
|
5916
|
+
["development"].includes(e.typeId) ? console.info("ℹ️ File '.gitattributes' is UNIQUE to this project") : await J(t, ".gitattributes", [".gitattributes_default"]);
|
|
5917
|
+
}
|
|
5918
|
+
async function Zn(e, t) {
|
|
5919
5919
|
["github", "kb"].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is NOT required by this project") : [
|
|
5920
5920
|
"app",
|
|
5921
5921
|
"api",
|
|
5922
5922
|
"development",
|
|
5923
5923
|
"eslint"
|
|
5924
|
-
].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is UNIQUE to this project") : await
|
|
5924
|
+
].includes(e.typeId) ? console.info("ℹ️ File 'eslint.config.js' is UNIQUE to this project") : await J(t, "eslint.config.js", ["eslint.config.default.js"]);
|
|
5925
5925
|
}
|
|
5926
|
-
async function
|
|
5926
|
+
async function Qn(e, t) {
|
|
5927
5927
|
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.json' is NOT required by this project") : [
|
|
5928
5928
|
"connector",
|
|
5929
5929
|
"engine",
|
|
5930
5930
|
"shared",
|
|
5931
5931
|
"tool"
|
|
5932
|
-
].includes(e.typeId) ? await
|
|
5933
|
-
}
|
|
5934
|
-
async function Qn(e, t) {
|
|
5935
|
-
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.scripts.json' is NOT required by this project") : await Y(t, "tsconfig.scripts.json");
|
|
5932
|
+
].includes(e.typeId) ? await J(t, "tsconfig.json", ["tsconfig.default.json"]) : console.info("ℹ️ File 'tsconfig.json' is UNIQUE to this project");
|
|
5936
5933
|
}
|
|
5937
5934
|
async function $n(e, t) {
|
|
5935
|
+
["github"].includes(e.typeId) ? console.info("ℹ️ File 'tsconfig.scripts.json' is NOT required by this project") : await J(t, "tsconfig.scripts.json");
|
|
5936
|
+
}
|
|
5937
|
+
async function er(e, t) {
|
|
5938
5938
|
if ([
|
|
5939
5939
|
"eslint",
|
|
5940
5940
|
"github",
|
|
@@ -5949,27 +5949,27 @@ async function $n(e, t) {
|
|
|
5949
5949
|
].includes(e.typeId)) console.info("ℹ️ File 'vite.config.ts' is UNIQUE to this project");
|
|
5950
5950
|
else {
|
|
5951
5951
|
let n;
|
|
5952
|
-
n = e.typeId === "connector" ? ["vite.config.default.ts", "vite.config.wasm.ts"] : e.typeId === "tool" ? ["vite.config.tool.ts"] : ["vite.config.default.ts"], await
|
|
5952
|
+
n = e.typeId === "connector" ? ["vite.config.default.ts", "vite.config.wasm.ts"] : e.typeId === "tool" ? ["vite.config.tool.ts"] : ["vite.config.default.ts"], await J(t, "vite.config.ts", n);
|
|
5953
5953
|
}
|
|
5954
5954
|
}
|
|
5955
|
-
async function
|
|
5955
|
+
async function tr(e, t) {
|
|
5956
5956
|
[
|
|
5957
5957
|
"app",
|
|
5958
5958
|
"api",
|
|
5959
5959
|
"eslint",
|
|
5960
5960
|
"github",
|
|
5961
5961
|
"kb"
|
|
5962
|
-
].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await
|
|
5962
|
+
].includes(e.typeId) ? console.info("ℹ️ File 'vitest.config.ts' is NOT required by this project") : await J(t, "vitest.config.ts");
|
|
5963
5963
|
}
|
|
5964
|
-
async function
|
|
5964
|
+
async function J(e, t, r = []) {
|
|
5965
5965
|
let i = n.resolve(process.cwd(), t), a = r.length > 0 ? r : [t], o;
|
|
5966
5966
|
try {
|
|
5967
|
-
o = await
|
|
5967
|
+
o = await Ln(i);
|
|
5968
5968
|
} catch (e) {
|
|
5969
5969
|
if (e.code !== "ENOENT") throw e;
|
|
5970
5970
|
}
|
|
5971
5971
|
for (let r of a) {
|
|
5972
|
-
let i = await
|
|
5972
|
+
let i = await Ln(n.resolve(e, `../${r}`));
|
|
5973
5973
|
if (o === i) {
|
|
5974
5974
|
console.info(`ℹ️ File '${t.split("_", 1)[0] ?? t}' is the same as '${r}'`);
|
|
5975
5975
|
return;
|
|
@@ -5979,12 +5979,12 @@ async function Y(e, t, r = []) {
|
|
|
5979
5979
|
}
|
|
5980
5980
|
//#endregion
|
|
5981
5981
|
//#region src/actions/checkDependencies.ts
|
|
5982
|
-
async function
|
|
5982
|
+
async function nr() {
|
|
5983
5983
|
try {
|
|
5984
|
-
|
|
5984
|
+
G("Check Dependencies"), await U("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), q("2️⃣ Check using 'npm-check-updates'");
|
|
5985
5985
|
let e = {};
|
|
5986
5986
|
try {
|
|
5987
|
-
e = await
|
|
5987
|
+
e = await W(n.resolve(process.cwd(), ".ncurc.json"));
|
|
5988
5988
|
} catch (e) {
|
|
5989
5989
|
if (e.code !== "ENOENT") throw e;
|
|
5990
5990
|
}
|
|
@@ -5994,104 +5994,104 @@ async function tr() {
|
|
|
5994
5994
|
dep: "dev,prod,peer,optional",
|
|
5995
5995
|
install: "never",
|
|
5996
5996
|
...e
|
|
5997
|
-
}), await
|
|
5997
|
+
}), await U("3️⃣ Install updated dependencies", "npm", [
|
|
5998
5998
|
"install",
|
|
5999
5999
|
"--prefer-online",
|
|
6000
6000
|
"--no-strict-allow-scripts"
|
|
6001
6001
|
]);
|
|
6002
|
-
let t = await
|
|
6003
|
-
t.length > 0 ? await
|
|
6002
|
+
let t = await rr();
|
|
6003
|
+
t.length > 0 ? await U("4️⃣ Move install-script pins to installed versions", "npm", [
|
|
6004
6004
|
"install-scripts",
|
|
6005
6005
|
"approve",
|
|
6006
6006
|
...t
|
|
6007
|
-
]) :
|
|
6007
|
+
]) : q("4️⃣ No pinned install-script approvals to move"), process.platform === "darwin" ? await U("5️⃣ Remove unused install-script entries", "npm", ["install-scripts", "prune"]) : q("5️⃣ Skipped removing unused install-script entries (macOS only)"), t.length > 0 && await U("6️⃣ Run install scripts skipped in step 3", "npm", [
|
|
6008
6008
|
"rebuild",
|
|
6009
6009
|
...t,
|
|
6010
6010
|
"--no-strict-allow-scripts"
|
|
6011
|
-
]), await
|
|
6011
|
+
]), await U("7️⃣ Confirm every install script is reviewed", "npm", ["install", "--strict-allow-scripts"]), K("Dependencies checked");
|
|
6012
6012
|
} catch (e) {
|
|
6013
6013
|
console.error("❌ Error checking dependencies", e), process.exit(1);
|
|
6014
6014
|
}
|
|
6015
6015
|
}
|
|
6016
|
-
async function
|
|
6017
|
-
let { allowScripts: e = {} } = await
|
|
6016
|
+
async function rr() {
|
|
6017
|
+
let { allowScripts: e = {} } = await W(n.resolve(process.cwd(), "package.json")), t = Object.entries(e).filter(([e, t]) => t && e.lastIndexOf("@") > 0).map(([e]) => e.slice(0, e.lastIndexOf("@")));
|
|
6018
6018
|
return [...new Set(t)];
|
|
6019
6019
|
}
|
|
6020
6020
|
//#endregion
|
|
6021
6021
|
//#region src/actions/documentBundleSizes.ts
|
|
6022
|
-
var
|
|
6023
|
-
async function
|
|
6022
|
+
var ir = "<!-- BUNDLE_START -->", ar = "<!-- BUNDLE_END -->", or = " ", sr = 20, cr = "The Bundle Analysis Report is generated automatically on each release using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", lr = "(bundler output, whitespace & JSON)", ur = `${lr} = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as \`config.json\`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.`;
|
|
6023
|
+
async function dr(e) {
|
|
6024
6024
|
try {
|
|
6025
|
-
|
|
6026
|
-
let t = await
|
|
6027
|
-
|
|
6025
|
+
G("Document Bundle Sizes"), q("1️⃣ Read bundle analysis report");
|
|
6026
|
+
let t = await W("./bundle-analysis-reports/sonda/index.json");
|
|
6027
|
+
q("2️⃣ Insert table into 'README.md'"), await Bn(`## Bundle Analysis\n\n${cr}\n\n${fr(t, e?.moduleLevel ?? !1)}\n\n${ur}`, ir, ar), K("Bundle sizes documented");
|
|
6028
6028
|
} catch (e) {
|
|
6029
6029
|
console.error("❌ Error documenting bundle sizes", e), process.exit(1);
|
|
6030
6030
|
}
|
|
6031
6031
|
}
|
|
6032
|
-
function
|
|
6033
|
-
let n =
|
|
6032
|
+
function fr(e, t) {
|
|
6033
|
+
let n = yr(e), r = n.values().flatMap((e) => e.values().toArray()).reduce((e, t) => e + t.sizes.uncompressed, 0), i = e.resources.filter((e) => e.kind === "asset").map((e) => [e.name, Cr(e)]).toSorted((e, t) => t[1].uncompressed - e[1].uncompressed), a = ["|Chunk/Module/File|Composition|", "|:------ |:-----------|"];
|
|
6034
6034
|
for (let [e, o] of i) {
|
|
6035
|
-
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ?
|
|
6035
|
+
let i = [...n.get(e) ?? /* @__PURE__ */ new Map()].toSorted((e, t) => t[1].sizes.uncompressed - e[1].sizes.uncompressed), s = i.length === 1 ? pr(e, o, _r(i), r, t) : mr(e, o, i, r, t);
|
|
6036
6036
|
a.push(...s);
|
|
6037
6037
|
}
|
|
6038
6038
|
return a.join("\n");
|
|
6039
6039
|
}
|
|
6040
|
-
function
|
|
6040
|
+
function pr(e, t, n, r, i) {
|
|
6041
6041
|
let [a, { sizes: o, files: s }] = n, c = r > 0 ? o.uncompressed / r * 100 : 0;
|
|
6042
|
-
if (s.size === 1) return [`| ${e} → ${
|
|
6043
|
-
let l = [`| ${e} → ${a} | ${
|
|
6044
|
-
return i || l.push(...
|
|
6042
|
+
if (s.size === 1) return [`| ${e} → ${gr(a, vr(s))} | ${wr(t)} · ${Tr(c)} |`];
|
|
6043
|
+
let l = [`| ${e} → ${a} | ${wr(t)} · ${Tr(c)} |`];
|
|
6044
|
+
return i || l.push(...hr(s, or, r)), l;
|
|
6045
6045
|
}
|
|
6046
|
-
function
|
|
6047
|
-
let a = [`| ${e} | ${
|
|
6046
|
+
function mr(e, t, n, r, i) {
|
|
6047
|
+
let a = [`| ${e} | ${wr(t)} |`];
|
|
6048
6048
|
for (let [e, { sizes: t, files: o }] of n) {
|
|
6049
6049
|
let n = r > 0 ? t.uncompressed / r * 100 : 0;
|
|
6050
6050
|
if (o.size === 1) {
|
|
6051
|
-
let t =
|
|
6052
|
-
a.push(`| ${
|
|
6051
|
+
let t = vr(o);
|
|
6052
|
+
a.push(`| ${or}${gr(e, t)} | ${Tr(n)} |`);
|
|
6053
6053
|
continue;
|
|
6054
6054
|
}
|
|
6055
|
-
a.push(`| ${
|
|
6055
|
+
a.push(`| ${or}${e} | ${Tr(n)} |`), i || a.push(...hr(o, `${or}${or}`, r));
|
|
6056
6056
|
}
|
|
6057
6057
|
return a;
|
|
6058
6058
|
}
|
|
6059
|
-
function
|
|
6060
|
-
return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${
|
|
6059
|
+
function hr(e, t, n) {
|
|
6060
|
+
return [...e].toSorted((e, t) => t[1].uncompressed - e[1].uncompressed).map(([e, r]) => `| ${t}${e} | ${Tr(n > 0 ? r.uncompressed / n * 100 : 0)} |`);
|
|
6061
6061
|
}
|
|
6062
|
-
function
|
|
6062
|
+
function gr(e, t) {
|
|
6063
6063
|
return t === "" ? e : `${e} → ${t}`;
|
|
6064
6064
|
}
|
|
6065
|
-
function
|
|
6065
|
+
function _r(e) {
|
|
6066
6066
|
let [t] = e;
|
|
6067
6067
|
if (t === void 0) throw Error("Expected exactly one entry");
|
|
6068
6068
|
return t;
|
|
6069
6069
|
}
|
|
6070
|
-
function
|
|
6070
|
+
function vr(e) {
|
|
6071
6071
|
let [t] = e.keys();
|
|
6072
6072
|
if (t === void 0) throw Error("Expected exactly one file");
|
|
6073
6073
|
return t;
|
|
6074
6074
|
}
|
|
6075
|
-
function
|
|
6076
|
-
let t =
|
|
6075
|
+
function yr(e) {
|
|
6076
|
+
let t = br(e.dependencies), n = /* @__PURE__ */ new Map();
|
|
6077
6077
|
for (let r of e.resources) {
|
|
6078
6078
|
if (r.kind !== "chunk" || !r.parent) continue;
|
|
6079
|
-
let { group: e, file: i } =
|
|
6079
|
+
let { group: e, file: i } = xr(r.name, t), a = Cr(r), o = n.get(r.parent) ?? /* @__PURE__ */ new Map();
|
|
6080
6080
|
n.set(r.parent, o);
|
|
6081
6081
|
let s = o.get(e) ?? {
|
|
6082
|
-
sizes:
|
|
6082
|
+
sizes: Er(),
|
|
6083
6083
|
files: /* @__PURE__ */ new Map()
|
|
6084
6084
|
};
|
|
6085
|
-
o.set(e, s),
|
|
6086
|
-
let c = s.files.get(i) ??
|
|
6087
|
-
s.files.set(i, c),
|
|
6085
|
+
o.set(e, s), Dr(s.sizes, a);
|
|
6086
|
+
let c = s.files.get(i) ?? Er();
|
|
6087
|
+
s.files.set(i, c), Dr(c, a);
|
|
6088
6088
|
}
|
|
6089
6089
|
return n;
|
|
6090
6090
|
}
|
|
6091
|
-
function
|
|
6091
|
+
function br(e) {
|
|
6092
6092
|
return e.flatMap((e) => e.paths.map((t) => [t, e.name])).toSorted((e, t) => t[0].length - e[0].length);
|
|
6093
6093
|
}
|
|
6094
|
-
function
|
|
6094
|
+
function xr(e, t) {
|
|
6095
6095
|
let n = t.find(([t]) => e === t || e.startsWith(`${t}/`));
|
|
6096
6096
|
if (n) {
|
|
6097
6097
|
let [t, r] = n;
|
|
@@ -6101,56 +6101,56 @@ function br(e, t) {
|
|
|
6101
6101
|
};
|
|
6102
6102
|
}
|
|
6103
6103
|
return e === "[unassigned]" ? {
|
|
6104
|
-
group:
|
|
6104
|
+
group: lr,
|
|
6105
6105
|
file: ""
|
|
6106
6106
|
} : e.startsWith("\0") ? {
|
|
6107
6107
|
group: "(runtime)",
|
|
6108
6108
|
file: e.slice(1)
|
|
6109
6109
|
} : {
|
|
6110
6110
|
group: e.startsWith("rust/") || e.includes("vite-plugin-wasm") ? "wasm" : "src",
|
|
6111
|
-
file:
|
|
6111
|
+
file: Sr(e)
|
|
6112
6112
|
};
|
|
6113
6113
|
}
|
|
6114
|
-
function
|
|
6114
|
+
function Sr(e) {
|
|
6115
6115
|
return e.split("/").at(-1) ?? e;
|
|
6116
6116
|
}
|
|
6117
|
-
function
|
|
6117
|
+
function Cr(e) {
|
|
6118
6118
|
return {
|
|
6119
6119
|
uncompressed: e.uncompressed,
|
|
6120
6120
|
gzip: e.gzip ?? 0
|
|
6121
6121
|
};
|
|
6122
6122
|
}
|
|
6123
|
-
function Cr(e) {
|
|
6124
|
-
return `${Dr(e.uncompressed)} · gzip ${Dr(e.gzip)}`;
|
|
6125
|
-
}
|
|
6126
6123
|
function wr(e) {
|
|
6127
|
-
|
|
6128
|
-
return `\`${"█".repeat(t)}${"░".repeat(or - t)}\` ${e.toFixed(1)}%`;
|
|
6124
|
+
return `${Or(e.uncompressed)} · gzip ${Or(e.gzip)}`;
|
|
6129
6125
|
}
|
|
6130
|
-
function Tr() {
|
|
6126
|
+
function Tr(e) {
|
|
6127
|
+
let t = Math.round(e / 100 * sr);
|
|
6128
|
+
return `\`${"█".repeat(t)}${"░".repeat(sr - t)}\` ${e.toFixed(1)}%`;
|
|
6129
|
+
}
|
|
6130
|
+
function Er() {
|
|
6131
6131
|
return {
|
|
6132
6132
|
uncompressed: 0,
|
|
6133
6133
|
gzip: 0
|
|
6134
6134
|
};
|
|
6135
6135
|
}
|
|
6136
|
-
function
|
|
6136
|
+
function Dr(e, t) {
|
|
6137
6137
|
e.uncompressed += t.uncompressed, e.gzip += t.gzip;
|
|
6138
6138
|
}
|
|
6139
|
-
function
|
|
6139
|
+
function Or(e) {
|
|
6140
6140
|
return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
|
|
6141
6141
|
}
|
|
6142
6142
|
//#endregion
|
|
6143
6143
|
//#region src/actions/documentDependencies.ts
|
|
6144
|
-
var
|
|
6145
|
-
async function
|
|
6144
|
+
var kr = "<!-- DEPENDENCY_LICENSES_START -->", Ar = "<!-- DEPENDENCY_LICENSES_END -->", jr = "## Dependency Licenses", Mr = "The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.";
|
|
6145
|
+
async function Nr(e = "MIT") {
|
|
6146
6146
|
try {
|
|
6147
|
-
|
|
6148
|
-
let t = await
|
|
6147
|
+
G("Document Dependencies");
|
|
6148
|
+
let t = await W("package.json");
|
|
6149
6149
|
if (t.name === "@dpuse/dpuse-development" || t.name === "@dpuse/eslint-config-dpuse") {
|
|
6150
|
-
await
|
|
6150
|
+
await Pr(t.name), K("Dependencies documented");
|
|
6151
6151
|
return;
|
|
6152
6152
|
}
|
|
6153
|
-
await
|
|
6153
|
+
await Nn("1️⃣ Clear downloaded licenses", "licenses/downloads"), q("2️⃣ Identify production licenses"), await new Promise((n, r) => {
|
|
6154
6154
|
let i = {
|
|
6155
6155
|
start: process.cwd(),
|
|
6156
6156
|
production: !0,
|
|
@@ -6165,41 +6165,41 @@ async function Mr(e = "MIT") {
|
|
|
6165
6165
|
c(i, (e) => {
|
|
6166
6166
|
e == null ? n() : r(e);
|
|
6167
6167
|
});
|
|
6168
|
-
}), await
|
|
6168
|
+
}), await In("3️⃣ Identify transitive dependencies", "npm", [
|
|
6169
6169
|
"ls",
|
|
6170
6170
|
"--all",
|
|
6171
6171
|
"--json",
|
|
6172
6172
|
"--omit=dev"
|
|
6173
|
-
], "licenses/licenseTree.json"), await
|
|
6173
|
+
], "licenses/licenseTree.json"), await Fr("4️⃣ ", e), K("Dependencies documented");
|
|
6174
6174
|
} catch (e) {
|
|
6175
6175
|
console.error("❌ Error documenting dependencies", e), process.exit(1);
|
|
6176
6176
|
}
|
|
6177
6177
|
}
|
|
6178
|
-
async function
|
|
6179
|
-
|
|
6178
|
+
async function Pr(e) {
|
|
6179
|
+
q(`1️⃣ Skip: ${e} is a development-only tool and is never part of a production release.`), await Bn(`${jr}\n\n${`> [!WARNING]\n> Dependency licenses are not documented here: ${e} is a development-only tool and is never part of a production release.`}`, kr, Ar);
|
|
6180
6180
|
}
|
|
6181
|
-
async function
|
|
6182
|
-
|
|
6183
|
-
let [n, r] = await Promise.all([
|
|
6184
|
-
for (let [e, t] of Object.entries(n)) i.set(e,
|
|
6181
|
+
async function Fr(e, t) {
|
|
6182
|
+
q(`${e} Insert licenses into 'README.md'`);
|
|
6183
|
+
let [n, r] = await Promise.all([W("licenses/licenses.json"), W("licenses/licenseTree.json")]), i = /* @__PURE__ */ new Map();
|
|
6184
|
+
for (let [e, t] of Object.entries(n)) i.set(e, Rr(e, t));
|
|
6185
6185
|
await Promise.all(i.values().map(async (e) => {
|
|
6186
|
-
let t = await
|
|
6186
|
+
let t = await zr(e.name, e.installedVersion);
|
|
6187
6187
|
e.latestVersion = t.latestVersion, e.latestPublishedDate = t.latestPublishedDate, e.publishedDate = t.publishedDate;
|
|
6188
6188
|
}));
|
|
6189
|
-
let a = `${
|
|
6190
|
-
for (let e of i.values()) a +=
|
|
6189
|
+
let a = `${Ir(t)}\n\n|Dependency|Version|License(s)|Document|\n|:-|:-:|:-|:-|\n`;
|
|
6190
|
+
for (let e of i.values()) a += Br(e);
|
|
6191
6191
|
let o = [];
|
|
6192
|
-
r.dependencies != null &&
|
|
6193
|
-
let s = `${
|
|
6194
|
-
await
|
|
6195
|
-
}
|
|
6196
|
-
function Fr(e) {
|
|
6197
|
-
return `License data is collected automatically on each release using [license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn). The following table lists all production dependencies. These dependencies (including transitive ones) have been checked and confirmed to use ${Ir(e.split(";"))} — all permissive, commercially-friendly licenses. Users of the uploaded library are covered by these checks; developers cloning this repository should independently verify development dependencies.`;
|
|
6192
|
+
r.dependencies != null && Vr(r.dependencies, i, o, 0);
|
|
6193
|
+
let s = `${Mr}\n\n${o.join("\n")}`;
|
|
6194
|
+
await Bn(`${jr}\n\n${a.trimEnd()}\n\n### Dependency Tree\n\n${s}`, kr, Ar);
|
|
6198
6195
|
}
|
|
6199
6196
|
function Ir(e) {
|
|
6197
|
+
return `License data is collected automatically on each release using [license-checker](https://github.com/RSeidelsohn/license-checker-rseidelsohn). The following table lists all production dependencies. These dependencies (including transitive ones) have been checked and confirmed to use ${Lr(e.split(";"))} — all permissive, commercially-friendly licenses. Users of the uploaded library are covered by these checks; developers cloning this repository should independently verify development dependencies.`;
|
|
6198
|
+
}
|
|
6199
|
+
function Lr(e) {
|
|
6200
6200
|
return e.length === 1 ? e[0] ?? "" : e.length === 2 ? `${String(e[0])} or ${String(e[1])}` : `${e.slice(0, -1).join(", ")}, or ${String(e.at(-1))}`;
|
|
6201
6201
|
}
|
|
6202
|
-
function
|
|
6202
|
+
function Rr(e, t) {
|
|
6203
6203
|
let n = e.lastIndexOf("@"), r = n > 0 ? e.slice(0, n) : e, i = n > 0 ? e.slice(n + 1) : "";
|
|
6204
6204
|
return {
|
|
6205
6205
|
name: r,
|
|
@@ -6213,7 +6213,7 @@ function Lr(e, t) {
|
|
|
6213
6213
|
...t.licenseFile != null && { licenseFileLink: t.licenseFile }
|
|
6214
6214
|
};
|
|
6215
6215
|
}
|
|
6216
|
-
async function
|
|
6216
|
+
async function zr(e, t) {
|
|
6217
6217
|
try {
|
|
6218
6218
|
let n = await fetch(`https://registry.npmjs.org/${encodeURIComponent(e)}`);
|
|
6219
6219
|
if (n.ok) {
|
|
@@ -6231,25 +6231,25 @@ async function Rr(e, t) {
|
|
|
6231
6231
|
publishedDate: ""
|
|
6232
6232
|
};
|
|
6233
6233
|
}
|
|
6234
|
-
function
|
|
6234
|
+
function Br(e) {
|
|
6235
6235
|
let t = e.licenseFileLink == null || e.licenseFileLink === "" ? "⚠️ No license file" : `[LICENSE](licenses/${e.licenseFileLink})`;
|
|
6236
6236
|
return `|[${e.name}](${e.repository})|${e.installedVersion}|${e.licenseTypes}|${t}|\n`;
|
|
6237
6237
|
}
|
|
6238
|
-
function
|
|
6238
|
+
function Vr(e, t, n, r) {
|
|
6239
6239
|
let i = " ".repeat(r);
|
|
6240
6240
|
for (let [a, o] of Object.entries(e)) {
|
|
6241
|
-
let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l =
|
|
6242
|
-
n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null &&
|
|
6241
|
+
let e = o.version ?? "", s = t.get(`${a}@${e}`), c = s == null ? a : `[${a}](${s.repository})`, l = Hr(s);
|
|
6242
|
+
n.push(`${i}- **${c}** ${e}${l}`), o.dependencies != null && Vr(o.dependencies, t, n, r + 1);
|
|
6243
6243
|
}
|
|
6244
6244
|
}
|
|
6245
|
-
function
|
|
6245
|
+
function Hr(e) {
|
|
6246
6246
|
if (e == null) return "";
|
|
6247
|
-
let t = e.publishedDate ?
|
|
6247
|
+
let t = e.publishedDate ? Ur(e.publishedDate.split("T", 1)[0]) : "";
|
|
6248
6248
|
if (e.latestVersion === "" || e.latestVersion === e.installedVersion) return t === "" ? "" : ` — ${t}`;
|
|
6249
|
-
let n = e.latestPublishedDate ?
|
|
6249
|
+
let n = e.latestPublishedDate ? Ur(e.latestPublishedDate.split("T", 1)[0]) : "", r = n === "" ? `**latest**: ${e.latestVersion} ❗` : `**latest**: ${e.latestVersion} — ${n} ❗`;
|
|
6250
6250
|
return t === "" ? ` — → ${r}` : ` — ${t} → ${r}`;
|
|
6251
6251
|
}
|
|
6252
|
-
function
|
|
6252
|
+
function Ur(e) {
|
|
6253
6253
|
if (e == null || e === "") return "n/a";
|
|
6254
6254
|
let t = e.split("T", 1)[0];
|
|
6255
6255
|
if (t == null || t === "") return "n/a";
|
|
@@ -6258,43 +6258,49 @@ function Hr(e) {
|
|
|
6258
6258
|
}
|
|
6259
6259
|
//#endregion
|
|
6260
6260
|
//#region src/actions/documentGovernance.ts
|
|
6261
|
-
var
|
|
6261
|
+
var Wr = "<!-- GOVERNANCE_START -->", Gr = "<!-- GOVERNANCE_END -->", Kr = {
|
|
6262
|
+
actions: "GitHub Actions",
|
|
6263
|
+
"javascript-typescript": "JavaScript/TypeScript",
|
|
6264
|
+
rust: "Rust"
|
|
6265
|
+
}, qr = "code-health-reports/fallow", Jr = {
|
|
6262
6266
|
A: "brightgreen",
|
|
6263
6267
|
B: "green",
|
|
6264
6268
|
C: "yellow",
|
|
6265
6269
|
D: "orange",
|
|
6266
6270
|
F: "red"
|
|
6267
|
-
},
|
|
6268
|
-
async function
|
|
6271
|
+
}, Yr = `${qr}/health.json`, Xr = `${qr}/index.md`, Zr = r(i);
|
|
6272
|
+
async function Qr() {
|
|
6269
6273
|
try {
|
|
6270
|
-
|
|
6271
|
-
let [e, t] = await Promise.all([
|
|
6272
|
-
|
|
6273
|
-
let a = await
|
|
6274
|
-
|
|
6274
|
+
G("Document Governance");
|
|
6275
|
+
let [e, t] = await Promise.all([W("package.json"), W("config.json")]), n = await $r(e), { owner: r, repo: i } = Un(e, "document governance");
|
|
6276
|
+
q("3️⃣ Read security checks and settings");
|
|
6277
|
+
let a = await ti(r, i, e);
|
|
6278
|
+
q("4️⃣ Look up OpenSSF Best Practices badge");
|
|
6279
|
+
let o = await ri(`https://github.com/${r}/${i}`);
|
|
6280
|
+
q("5️⃣ Insert governance content into 'README.md'"), await Bn(si(r, i, ii(e), ai(t.firstCreatedAt), n, o, a), Wr, Gr), K("Governance documented");
|
|
6275
6281
|
} catch (e) {
|
|
6276
6282
|
console.error("❌ Error documenting governance", e), process.exit(1);
|
|
6277
6283
|
}
|
|
6278
6284
|
}
|
|
6279
|
-
async function
|
|
6285
|
+
async function $r(e) {
|
|
6280
6286
|
if (e.devDependencies?.fallow == null) {
|
|
6281
|
-
|
|
6287
|
+
q("1️⃣ Code health NOT measured, as Fallow is not installed"), q("2️⃣ Code health report NOT required");
|
|
6282
6288
|
return;
|
|
6283
6289
|
}
|
|
6284
|
-
return await
|
|
6290
|
+
return await In("1️⃣ Measure code health", "fallow", [
|
|
6285
6291
|
"health",
|
|
6286
6292
|
"--report-only",
|
|
6287
6293
|
"--format",
|
|
6288
6294
|
"json"
|
|
6289
|
-
],
|
|
6295
|
+
], Yr), await In("2️⃣ Write code health report", "fallow", ["--format", "markdown"], Xr, !0), await W(Yr);
|
|
6290
6296
|
}
|
|
6291
|
-
function
|
|
6297
|
+
function ei(e) {
|
|
6292
6298
|
let { score: t, grade: n } = e.health_score, { functions_above_threshold: r, functions_analyzed: i, average_maintainability: a } = e.summary, o = e.vital_signs;
|
|
6293
6299
|
return `### Code Health
|
|
6294
6300
|
|
|
6295
|
-
[)})`).replaceAll("-", "--").replaceAll("(", "%28").replaceAll(")", "%29")}-${
|
|
6301
|
+
[)})`).replaceAll("-", "--").replaceAll("(", "%28").replaceAll(")", "%29")}-${Jr[n] ?? "lightgrey"}`})](./${Xr})
|
|
6296
6302
|
|
|
6297
|
-
[Fallow](https://github.com/fallow-rs/fallow) analyses the TypeScript source on each release for unused code, duplication, complexity, and dependency hygiene. See the [full Fallow report](./${
|
|
6303
|
+
[Fallow](https://github.com/fallow-rs/fallow) analyses the TypeScript source on each release for unused code, duplication, complexity, and dependency hygiene. See the [full Fallow report](./${Xr}) for every finding.
|
|
6298
6304
|
|
|
6299
6305
|
|Measure|Value|
|
|
6300
6306
|
|:-|-:|
|
|
@@ -6310,92 +6316,185 @@ function Zr(e) {
|
|
|
6310
6316
|
|
|
6311
6317
|
`;
|
|
6312
6318
|
}
|
|
6313
|
-
async function
|
|
6319
|
+
async function ti(e, t, n) {
|
|
6320
|
+
let [r, i, a] = await Promise.all([
|
|
6321
|
+
Rn(".github/workflows/ci.yml"),
|
|
6322
|
+
Rn(".github/workflows/codeql.yml"),
|
|
6323
|
+
Rn(".github/dependabot.yml")
|
|
6324
|
+
]), [o, s, c, l] = await Promise.all([
|
|
6325
|
+
ni(`repos/${e}/${t}`),
|
|
6326
|
+
ni(`repos/${e}/${t}/private-vulnerability-reporting`),
|
|
6327
|
+
ni(`repos/${e}/${t}/vulnerability-alerts`),
|
|
6328
|
+
ni(`repos/${e}/${t}/commits/main/check-runs?per_page=100`)
|
|
6329
|
+
]), u = o === void 0 ? void 0 : JSON.parse(o).security_and_analysis, d = (e) => u?.[e] === void 0 ? void 0 : u[e].status === "enabled", f = new Set((l === void 0 ? [] : JSON.parse(l).check_runs).map((e) => e.app?.slug)), p = a?.match(/package-ecosystem:/g)?.length ?? 0, m = a?.match(/open-pull-requests-limit: 0\b/g)?.length ?? 0;
|
|
6330
|
+
return {
|
|
6331
|
+
codeQLLanguages: (i ?? "").matchAll(/- language: ([\w-]+)/g).map(([, e = ""]) => Kr[e] ?? e).toArray(),
|
|
6332
|
+
dependabotAlerts: c !== void 0,
|
|
6333
|
+
dependabotSecurityUpdates: d("dependabot_security_updates"),
|
|
6334
|
+
dependabotVersionUpdates: p > m,
|
|
6335
|
+
npmAuditInCI: /npm (?:run )?audit/.test(r ?? ""),
|
|
6336
|
+
npmAuditLevel: /npm audit --audit-level=(\w+)/.exec(r ?? "")?.[1],
|
|
6337
|
+
privateVulnerabilityReporting: s === void 0 ? void 0 : JSON.parse(s).enabled,
|
|
6338
|
+
propertyTests: n.devDependencies?.["fast-check"] != null,
|
|
6339
|
+
pushProtection: d("secret_scanning_push_protection"),
|
|
6340
|
+
secretScanning: d("secret_scanning"),
|
|
6341
|
+
socket: f.has("socket-security"),
|
|
6342
|
+
sonarCloud: f.has("sonarqubecloud"),
|
|
6343
|
+
testsInCI: r?.includes("npm test") ?? !1
|
|
6344
|
+
};
|
|
6345
|
+
}
|
|
6346
|
+
async function ni(e) {
|
|
6347
|
+
try {
|
|
6348
|
+
let { stdout: t } = await Zr("gh", ["api", e]);
|
|
6349
|
+
return t;
|
|
6350
|
+
} catch (e) {
|
|
6351
|
+
if (String(e.stderr).includes("HTTP 404")) return;
|
|
6352
|
+
throw e;
|
|
6353
|
+
}
|
|
6354
|
+
}
|
|
6355
|
+
async function ri(e) {
|
|
6314
6356
|
let t = await fetch(`https://www.bestpractices.dev/projects.json?url=${encodeURIComponent(e)}`);
|
|
6315
6357
|
if (!t.ok) throw Error(`OpenSSF Best Practices lookup failed with status ${String(t.status)}.`);
|
|
6316
6358
|
return (await t.json()).find((t) => t.repo_url === e)?.id;
|
|
6317
6359
|
}
|
|
6318
|
-
function
|
|
6360
|
+
function ii(e) {
|
|
6319
6361
|
let t = e.author, n = typeof t == "string" ? t : t?.name;
|
|
6320
6362
|
if (n == null || n === "") throw Error("package.json 'author' field is required to document governance.");
|
|
6321
6363
|
let r = n.indexOf("<"), i = r === -1 ? -1 : n.indexOf(">", r);
|
|
6322
6364
|
return (i === -1 ? n : n.slice(0, r).trimEnd() + n.slice(i + 1).trimStart()).trim();
|
|
6323
6365
|
}
|
|
6324
|
-
function
|
|
6366
|
+
function ai(e) {
|
|
6325
6367
|
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6326
6368
|
if (e == null) return String(t);
|
|
6327
6369
|
let n = new Date(e).getFullYear();
|
|
6328
6370
|
return n === t ? String(t) : `${String(n)}-present`;
|
|
6329
6371
|
}
|
|
6330
|
-
function
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
[CodeQL](${o}/security/code-scanning) static analysis runs on every push to \`main\` and on a weekly schedule, scanning TypeScript, JavaScript, Rust, and GitHub Actions workflow files for security vulnerabilities and coding errors.
|
|
6337
|
-
|
|
6338
|
-
### SonarCloud
|
|
6339
|
-
|
|
6340
|
-
[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t}) performs continuous code quality and security analysis on every push, detecting bugs, code smells, and security vulnerabilities in the TypeScript source.
|
|
6341
|
-
|
|
6342
|
-
${i === void 0 ? "" : Zr(i)}### Vulnerability Scanning
|
|
6343
|
-
|
|
6344
|
-
Two complementary tools continuously monitor dependencies for known vulnerabilities:
|
|
6372
|
+
function Y(e, t = "On") {
|
|
6373
|
+
return e === void 0 ? "❔ Unknown" : e ? `✅ ${t}` : "❌ Off";
|
|
6374
|
+
}
|
|
6375
|
+
function oi(e, t, n) {
|
|
6376
|
+
let r = `https://github.com/${e}/${t}`, i = Y(n.codeQLLanguages.length > 0, n.codeQLLanguages.join(", "));
|
|
6377
|
+
return `### Checks & Settings
|
|
6345
6378
|
|
|
6346
|
-
|
|
6347
|
-
- [GitHub Dependabot](https://docs.github.com/en/code-security/dependabot) automatically raises pull requests to update vulnerable dependencies, drawing on the GitHub Advisory Database which combines NVD and npm-specific advisories.
|
|
6379
|
+
Read from the repository each time this README is generated, so the status is current as of the latest release.
|
|
6348
6380
|
|
|
6349
|
-
|
|
6381
|
+
|Check or setting|Status|What it does|
|
|
6382
|
+
|:-|:-|:-|
|
|
6383
|
+
${[
|
|
6384
|
+
[
|
|
6385
|
+
`[CodeQL](${r}/security/code-scanning)`,
|
|
6386
|
+
i,
|
|
6387
|
+
"Static analysis for security vulnerabilities and coding errors, on every push and pull request to `main` and weekly."
|
|
6388
|
+
],
|
|
6389
|
+
[
|
|
6390
|
+
`[SonarCloud](https://sonarcloud.io/summary/new_code?id=${e}_${t})`,
|
|
6391
|
+
Y(n.sonarCloud),
|
|
6392
|
+
"Code quality and security analysis on every push: bugs, code smells and vulnerabilities."
|
|
6393
|
+
],
|
|
6394
|
+
[
|
|
6395
|
+
"Unit tests",
|
|
6396
|
+
Y(n.testsInCI),
|
|
6397
|
+
"Run in CI on every push to `main`."
|
|
6398
|
+
],
|
|
6399
|
+
[
|
|
6400
|
+
"Property-based tests",
|
|
6401
|
+
Y(n.propertyTests, "fast-check"),
|
|
6402
|
+
"Fuzz testing: many random inputs per test to find edge cases, run with the unit tests."
|
|
6403
|
+
],
|
|
6404
|
+
[
|
|
6405
|
+
"npm audit",
|
|
6406
|
+
Y(n.npmAuditInCI),
|
|
6407
|
+
n.npmAuditLevel === void 0 ? "Fails CI when any dependency has a known vulnerability." : `Fails CI when a dependency has a known vulnerability of ${n.npmAuditLevel} severity or above.`
|
|
6408
|
+
],
|
|
6409
|
+
[
|
|
6410
|
+
"[Socket.dev](https://socket.dev)",
|
|
6411
|
+
Y(n.socket),
|
|
6412
|
+
"Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE."
|
|
6413
|
+
],
|
|
6414
|
+
[
|
|
6415
|
+
"Dependabot alerts",
|
|
6416
|
+
Y(n.dependabotAlerts),
|
|
6417
|
+
"Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database."
|
|
6418
|
+
],
|
|
6419
|
+
[
|
|
6420
|
+
"Dependabot security updates",
|
|
6421
|
+
Y(n.dependabotSecurityUpdates),
|
|
6422
|
+
"Opens pull requests that update vulnerable dependencies."
|
|
6423
|
+
],
|
|
6424
|
+
[
|
|
6425
|
+
"Dependabot version updates",
|
|
6426
|
+
Y(n.dependabotVersionUpdates),
|
|
6427
|
+
"Opens pull requests for new dependency versions."
|
|
6428
|
+
],
|
|
6429
|
+
[
|
|
6430
|
+
"Secret scanning",
|
|
6431
|
+
Y(n.secretScanning),
|
|
6432
|
+
"Detects credentials, such as API keys and tokens, committed to the repository."
|
|
6433
|
+
],
|
|
6434
|
+
[
|
|
6435
|
+
"Push protection",
|
|
6436
|
+
Y(n.pushProtection),
|
|
6437
|
+
"Blocks pushes that contain credentials."
|
|
6438
|
+
],
|
|
6439
|
+
[
|
|
6440
|
+
"Private vulnerability reporting",
|
|
6441
|
+
Y(n.privateVulnerabilityReporting),
|
|
6442
|
+
"Lets anyone report a vulnerability privately. See [Reporting Vulnerabilities](#reporting-vulnerabilities)."
|
|
6443
|
+
]
|
|
6444
|
+
].map((e) => `|${e.join("|")}|`).join("\n")}
|
|
6350
6445
|
|
|
6351
|
-
|
|
6446
|
+
`;
|
|
6447
|
+
}
|
|
6448
|
+
function si(e, t, n, r, i, a, o) {
|
|
6449
|
+
let s = `https://github.com/${e}/${t}`, c = `github.com/${e}/${t}`, l = `https://www.bestpractices.dev/projects/${String(a)}`, u = a === void 0 ? "" : `[](${l})\n`, d = o.privateVulnerabilityReporting === !0 ? `Use [GitHub private vulnerability reporting](${s}/security/advisories/new) instead. See [SECURITY.md](./SECURITY.md) for the full disclosure policy, contact details, and expected response times.` : "See [SECURITY.md](./SECURITY.md) for how to report one privately, the full disclosure policy, and expected response times.";
|
|
6450
|
+
return `## Security & Quality
|
|
6352
6451
|
|
|
6353
|
-
### Reporting Vulnerabilities
|
|
6452
|
+
${oi(e, t, o)}${i === void 0 ? "" : ei(i)}### Reporting Vulnerabilities
|
|
6354
6453
|
|
|
6355
|
-
Please do not open public GitHub issues for security vulnerabilities.
|
|
6454
|
+
Please do not open public GitHub issues for security vulnerabilities. ${d}
|
|
6356
6455
|
|
|
6357
6456
|
### OpenSSF 🚧
|
|
6358
6457
|
|
|
6359
|
-
${
|
|
6458
|
+
${u}[](https://scorecard.dev/viewer/?uri=${c})
|
|
6360
6459
|
|
|
6361
|
-
This project is working towards the [OpenSSF Best Practices](https://www.bestpractices.dev) Passing badge, a self-certification covering security policy, vulnerability reporting, build processes, code quality, and more. Currently the [OpenSSF Scorecard](https://scorecard.dev/viewer/?uri=${
|
|
6460
|
+
This project is working towards the [OpenSSF Best Practices](https://www.bestpractices.dev) Passing badge, a self-certification covering security policy, vulnerability reporting, build processes, code quality, and more. Currently the [OpenSSF Scorecard](https://scorecard.dev/viewer/?uri=${c}) provides an independent automated assessment of the project's security practices and is an ongoing area of improvement.
|
|
6362
6461
|
|
|
6363
6462
|
## Contributing
|
|
6364
6463
|
|
|
6365
6464
|
This repository is maintained solely by its owner and does not, at present, accept external contributions into the canonical repo. Its source is published openly under the MIT License — every DPUse project is fully open source except DPUse Engine, which remains closed and proprietary.
|
|
6366
6465
|
|
|
6367
|
-
For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${
|
|
6466
|
+
For security vulnerabilities, see [Reporting Vulnerabilities](#reporting-vulnerabilities). For bugs, inconsistencies, or other feedback, [open a GitHub issue](${s}/issues) — feedback is read, but responses and fixes are at the maintainer's discretion.
|
|
6368
6467
|
|
|
6369
6468
|
## License
|
|
6370
6469
|
|
|
6371
6470
|
This project is licensed under the MIT License, permitting free use, modification, and distribution.
|
|
6372
6471
|
|
|
6373
|
-
[MIT](./LICENSE) © ${r}
|
|
6472
|
+
[MIT](./LICENSE) © ${r} ${n}`;
|
|
6374
6473
|
}
|
|
6375
6474
|
//#endregion
|
|
6376
6475
|
//#region node_modules/@dpuse/dpuse-shared/dist/componentConfig.schema-DT3mO5rS.js
|
|
6377
|
-
var
|
|
6476
|
+
var ci = {
|
|
6378
6477
|
lang: void 0,
|
|
6379
6478
|
message: void 0,
|
|
6380
6479
|
abortEarly: void 0,
|
|
6381
6480
|
abortPipeEarly: void 0
|
|
6382
6481
|
};
|
|
6383
6482
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6384
|
-
function
|
|
6483
|
+
function li(e) {
|
|
6385
6484
|
return e ? {
|
|
6386
6485
|
lang: e?.lang ?? void 0,
|
|
6387
6486
|
message: e?.message,
|
|
6388
6487
|
abortEarly: e?.abortEarly ?? void 0,
|
|
6389
6488
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
6390
|
-
} :
|
|
6489
|
+
} : ci;
|
|
6391
6490
|
}
|
|
6392
6491
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6393
|
-
function
|
|
6492
|
+
function ui(e) {
|
|
6394
6493
|
let t = typeof e;
|
|
6395
6494
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
6396
6495
|
}
|
|
6397
6496
|
function X(e, t, n, r, i) {
|
|
6398
|
-
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */
|
|
6497
|
+
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ ui(a), c = {
|
|
6399
6498
|
kind: e.kind,
|
|
6400
6499
|
type: e.type,
|
|
6401
6500
|
input: a,
|
|
@@ -6412,39 +6511,39 @@ function X(e, t, n, r, i) {
|
|
|
6412
6511
|
u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
|
|
6413
6512
|
}
|
|
6414
6513
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6415
|
-
function
|
|
6514
|
+
function di(e, t) {
|
|
6416
6515
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
6417
6516
|
}
|
|
6418
6517
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6419
|
-
function
|
|
6518
|
+
function fi(e, t) {
|
|
6420
6519
|
return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
|
|
6421
6520
|
}
|
|
6422
6521
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6423
|
-
function
|
|
6522
|
+
function pi(e, t) {
|
|
6424
6523
|
let n = [...new Set(e)];
|
|
6425
6524
|
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
6426
6525
|
}
|
|
6427
|
-
function
|
|
6526
|
+
function mi(e) {
|
|
6428
6527
|
return e["~standard"] = {
|
|
6429
6528
|
version: 1,
|
|
6430
6529
|
vendor: "valibot",
|
|
6431
|
-
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */
|
|
6530
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ li())
|
|
6432
6531
|
}, e;
|
|
6433
6532
|
}
|
|
6434
6533
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6435
|
-
function
|
|
6534
|
+
function hi(e, t, n) {
|
|
6436
6535
|
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
6437
6536
|
}
|
|
6438
6537
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6439
|
-
function
|
|
6538
|
+
function gi(e, t, n) {
|
|
6440
6539
|
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
6441
6540
|
}
|
|
6442
6541
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6443
|
-
function
|
|
6444
|
-
return
|
|
6542
|
+
function _i(e, t) {
|
|
6543
|
+
return mi({
|
|
6445
6544
|
kind: "schema",
|
|
6446
6545
|
type: "array",
|
|
6447
|
-
reference:
|
|
6546
|
+
reference: _i,
|
|
6448
6547
|
expects: "Array",
|
|
6449
6548
|
async: !1,
|
|
6450
6549
|
item: e,
|
|
@@ -6477,11 +6576,11 @@ function di(e, t) {
|
|
|
6477
6576
|
});
|
|
6478
6577
|
}
|
|
6479
6578
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6480
|
-
function
|
|
6481
|
-
return
|
|
6579
|
+
function vi(e) {
|
|
6580
|
+
return mi({
|
|
6482
6581
|
kind: "schema",
|
|
6483
6582
|
type: "boolean",
|
|
6484
|
-
reference:
|
|
6583
|
+
reference: vi,
|
|
6485
6584
|
expects: "boolean",
|
|
6486
6585
|
async: !1,
|
|
6487
6586
|
message: e,
|
|
@@ -6491,23 +6590,23 @@ function fi(e) {
|
|
|
6491
6590
|
});
|
|
6492
6591
|
}
|
|
6493
6592
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6494
|
-
function
|
|
6495
|
-
return
|
|
6593
|
+
function yi(e, t) {
|
|
6594
|
+
return mi({
|
|
6496
6595
|
kind: "schema",
|
|
6497
6596
|
type: "literal",
|
|
6498
|
-
reference:
|
|
6499
|
-
expects: /* @__PURE__ */
|
|
6597
|
+
reference: yi,
|
|
6598
|
+
expects: /* @__PURE__ */ ui(e),
|
|
6500
6599
|
async: !1,
|
|
6501
6600
|
literal: e,
|
|
6502
6601
|
message: t,
|
|
6503
6602
|
"~run"(e, t) {
|
|
6504
|
-
return /* @__PURE__ */
|
|
6603
|
+
return /* @__PURE__ */ di(e.value, this.literal) ? e.typed = !0 : X(this, "type", e, t), e;
|
|
6505
6604
|
}
|
|
6506
6605
|
});
|
|
6507
6606
|
}
|
|
6508
6607
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6509
6608
|
function Z(e, t) {
|
|
6510
|
-
return
|
|
6609
|
+
return mi({
|
|
6511
6610
|
kind: "schema",
|
|
6512
6611
|
type: "nullable",
|
|
6513
6612
|
reference: Z,
|
|
@@ -6516,16 +6615,16 @@ function Z(e, t) {
|
|
|
6516
6615
|
wrapped: e,
|
|
6517
6616
|
default: t,
|
|
6518
6617
|
"~run"(e, t) {
|
|
6519
|
-
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
6618
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ gi(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
6520
6619
|
}
|
|
6521
6620
|
});
|
|
6522
6621
|
}
|
|
6523
6622
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6524
|
-
function
|
|
6525
|
-
return
|
|
6623
|
+
function bi(e) {
|
|
6624
|
+
return mi({
|
|
6526
6625
|
kind: "schema",
|
|
6527
6626
|
type: "number",
|
|
6528
|
-
reference:
|
|
6627
|
+
reference: bi,
|
|
6529
6628
|
expects: "number",
|
|
6530
6629
|
async: !1,
|
|
6531
6630
|
message: e,
|
|
@@ -6535,26 +6634,26 @@ function mi(e) {
|
|
|
6535
6634
|
});
|
|
6536
6635
|
}
|
|
6537
6636
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6538
|
-
function
|
|
6539
|
-
return
|
|
6637
|
+
function xi(e, t) {
|
|
6638
|
+
return mi({
|
|
6540
6639
|
kind: "schema",
|
|
6541
6640
|
type: "optional",
|
|
6542
|
-
reference:
|
|
6641
|
+
reference: xi,
|
|
6543
6642
|
expects: `(${e.expects} | undefined)`,
|
|
6544
6643
|
async: !1,
|
|
6545
6644
|
wrapped: e,
|
|
6546
6645
|
default: t,
|
|
6547
6646
|
"~run"(e, t) {
|
|
6548
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
6647
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ gi(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
6549
6648
|
}
|
|
6550
6649
|
});
|
|
6551
6650
|
}
|
|
6552
6651
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6553
|
-
function
|
|
6554
|
-
return
|
|
6652
|
+
function Si(e, t, n) {
|
|
6653
|
+
return mi({
|
|
6555
6654
|
kind: "schema",
|
|
6556
6655
|
type: "record",
|
|
6557
|
-
reference:
|
|
6656
|
+
reference: Si,
|
|
6558
6657
|
expects: "Object",
|
|
6559
6658
|
async: !1,
|
|
6560
6659
|
key: e,
|
|
@@ -6564,7 +6663,7 @@ function gi(e, t, n) {
|
|
|
6564
6663
|
let n = e.value;
|
|
6565
6664
|
if (n && typeof n == "object") {
|
|
6566
6665
|
e.typed = !0, e.value = {};
|
|
6567
|
-
for (let r in n) if (/* @__PURE__ */
|
|
6666
|
+
for (let r in n) if (/* @__PURE__ */ fi(n, r)) {
|
|
6568
6667
|
let i = n[r], a = this.key["~run"]({ value: r }, t);
|
|
6569
6668
|
if (a.issues) {
|
|
6570
6669
|
let o = {
|
|
@@ -6604,7 +6703,7 @@ function gi(e, t, n) {
|
|
|
6604
6703
|
}
|
|
6605
6704
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6606
6705
|
function Q(e, t) {
|
|
6607
|
-
return
|
|
6706
|
+
return mi({
|
|
6608
6707
|
kind: "schema",
|
|
6609
6708
|
type: "strict_object",
|
|
6610
6709
|
reference: Q,
|
|
@@ -6619,7 +6718,7 @@ function Q(e, t) {
|
|
|
6619
6718
|
for (let r in this.entries) {
|
|
6620
6719
|
let i = this.entries[r];
|
|
6621
6720
|
if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
|
|
6622
|
-
let a = r in n ? n[r] : /* @__PURE__ */
|
|
6721
|
+
let a = r in n ? n[r] : /* @__PURE__ */ gi(i), o = i["~run"]({ value: a }, t);
|
|
6623
6722
|
if (o.issues) {
|
|
6624
6723
|
let i = {
|
|
6625
6724
|
type: "object",
|
|
@@ -6635,7 +6734,7 @@ function Q(e, t) {
|
|
|
6635
6734
|
}
|
|
6636
6735
|
}
|
|
6637
6736
|
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
6638
|
-
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */
|
|
6737
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ hi(i);
|
|
6639
6738
|
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (X(this, "key", e, t, {
|
|
6640
6739
|
input: void 0,
|
|
6641
6740
|
expected: `"${r}"`,
|
|
@@ -6671,7 +6770,7 @@ function Q(e, t) {
|
|
|
6671
6770
|
}
|
|
6672
6771
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6673
6772
|
function $(e) {
|
|
6674
|
-
return
|
|
6773
|
+
return mi({
|
|
6675
6774
|
kind: "schema",
|
|
6676
6775
|
type: "string",
|
|
6677
6776
|
reference: $,
|
|
@@ -6684,19 +6783,19 @@ function $(e) {
|
|
|
6684
6783
|
});
|
|
6685
6784
|
}
|
|
6686
6785
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6687
|
-
function
|
|
6786
|
+
function Ci(e) {
|
|
6688
6787
|
let t;
|
|
6689
6788
|
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
6690
6789
|
else t = n.issues;
|
|
6691
6790
|
return t;
|
|
6692
6791
|
}
|
|
6693
6792
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6694
|
-
function
|
|
6695
|
-
return
|
|
6793
|
+
function wi(e, t) {
|
|
6794
|
+
return mi({
|
|
6696
6795
|
kind: "schema",
|
|
6697
6796
|
type: "union",
|
|
6698
|
-
reference:
|
|
6699
|
-
expects: /* @__PURE__ */
|
|
6797
|
+
reference: wi,
|
|
6798
|
+
expects: /* @__PURE__ */ pi(e.map((e) => e.expects), "|"),
|
|
6700
6799
|
async: !1,
|
|
6701
6800
|
options: e,
|
|
6702
6801
|
message: t,
|
|
@@ -6715,29 +6814,29 @@ function vi(e, t) {
|
|
|
6715
6814
|
if (n) return n;
|
|
6716
6815
|
if (r) {
|
|
6717
6816
|
if (r.length === 1) return r[0];
|
|
6718
|
-
X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6817
|
+
X(this, "type", e, t, { issues: /* @__PURE__ */ Ci(r) }), e.typed = !0;
|
|
6719
6818
|
} else if (i?.length === 1) return i[0];
|
|
6720
|
-
else X(this, "type", e, t, { issues: /* @__PURE__ */
|
|
6819
|
+
else X(this, "type", e, t, { issues: /* @__PURE__ */ Ci(i) });
|
|
6721
6820
|
return e;
|
|
6722
6821
|
}
|
|
6723
6822
|
});
|
|
6724
6823
|
}
|
|
6725
|
-
var
|
|
6824
|
+
var Ti = /* @__PURE__ */ Q({
|
|
6726
6825
|
en: /* @__PURE__ */ $(),
|
|
6727
6826
|
es: /* @__PURE__ */ $()
|
|
6728
|
-
}),
|
|
6827
|
+
}), Ei = {
|
|
6729
6828
|
id: /* @__PURE__ */ $(),
|
|
6730
6829
|
label: /* @__PURE__ */ Q({
|
|
6731
|
-
en: /* @__PURE__ */
|
|
6732
|
-
es: /* @__PURE__ */
|
|
6830
|
+
en: /* @__PURE__ */ xi(/* @__PURE__ */ $()),
|
|
6831
|
+
es: /* @__PURE__ */ xi(/* @__PURE__ */ $())
|
|
6733
6832
|
}),
|
|
6734
6833
|
description: /* @__PURE__ */ Q({
|
|
6735
|
-
en: /* @__PURE__ */
|
|
6736
|
-
es: /* @__PURE__ */
|
|
6834
|
+
en: /* @__PURE__ */ xi(/* @__PURE__ */ $()),
|
|
6835
|
+
es: /* @__PURE__ */ xi(/* @__PURE__ */ $())
|
|
6737
6836
|
}),
|
|
6738
6837
|
icon: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6739
6838
|
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ $())
|
|
6740
|
-
},
|
|
6839
|
+
}, Di = (e) => /* @__PURE__ */ wi(e.map((e) => /* @__PURE__ */ yi(e))), Oi = Di([
|
|
6741
6840
|
"app",
|
|
6742
6841
|
"connector",
|
|
6743
6842
|
"connectorConnection",
|
|
@@ -6759,33 +6858,33 @@ var yi = /* @__PURE__ */ Q({
|
|
|
6759
6858
|
"presenter",
|
|
6760
6859
|
"presenterPresentation",
|
|
6761
6860
|
"tool"
|
|
6762
|
-
]),
|
|
6861
|
+
]), ki = Di([
|
|
6763
6862
|
"danger",
|
|
6764
6863
|
"success",
|
|
6765
6864
|
"warning"
|
|
6766
|
-
]),
|
|
6865
|
+
]), Ai = Di([
|
|
6767
6866
|
"alpha",
|
|
6768
6867
|
"beta",
|
|
6769
6868
|
"releaseCandidate",
|
|
6770
6869
|
"generalAvailability"
|
|
6771
|
-
]),
|
|
6772
|
-
color:
|
|
6870
|
+
]), ji = /* @__PURE__ */ Q({
|
|
6871
|
+
color: ki,
|
|
6773
6872
|
label: /* @__PURE__ */ $()
|
|
6774
|
-
}),
|
|
6775
|
-
...bi,
|
|
6776
|
-
typeId: Si
|
|
6777
|
-
}, Di = /* @__PURE__ */ Q({
|
|
6873
|
+
}), Mi = {
|
|
6778
6874
|
...Ei,
|
|
6779
|
-
|
|
6875
|
+
typeId: Oi
|
|
6876
|
+
}, Ni = /* @__PURE__ */ Q({
|
|
6877
|
+
...Mi,
|
|
6878
|
+
order: /* @__PURE__ */ bi(),
|
|
6780
6879
|
path: /* @__PURE__ */ $()
|
|
6781
|
-
}),
|
|
6782
|
-
...
|
|
6783
|
-
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6784
|
-
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6785
|
-
status: /* @__PURE__ */ Z(
|
|
6786
|
-
statusId: /* @__PURE__ */ Z(
|
|
6880
|
+
}), Pi = {
|
|
6881
|
+
...Mi,
|
|
6882
|
+
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ bi()),
|
|
6883
|
+
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ bi()),
|
|
6884
|
+
status: /* @__PURE__ */ Z(ji),
|
|
6885
|
+
statusId: /* @__PURE__ */ Z(Ai)
|
|
6787
6886
|
};
|
|
6788
|
-
({ ...
|
|
6887
|
+
({ ...Pi }), Di([
|
|
6789
6888
|
"app",
|
|
6790
6889
|
"engine",
|
|
6791
6890
|
"connector",
|
|
@@ -6795,17 +6894,17 @@ var yi = /* @__PURE__ */ Q({
|
|
|
6795
6894
|
]);
|
|
6796
6895
|
//#endregion
|
|
6797
6896
|
//#region node_modules/@dpuse/dpuse-shared/dist/moduleConfig.schema-aYmFWSrn.js
|
|
6798
|
-
var
|
|
6799
|
-
...
|
|
6897
|
+
var Fi = {
|
|
6898
|
+
...Pi,
|
|
6800
6899
|
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6801
6900
|
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6802
6901
|
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ $()),
|
|
6803
6902
|
version: /* @__PURE__ */ $()
|
|
6804
6903
|
};
|
|
6805
|
-
({ ...
|
|
6904
|
+
({ ...Fi });
|
|
6806
6905
|
//#endregion
|
|
6807
6906
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleConnector.es.js
|
|
6808
|
-
var
|
|
6907
|
+
var Ii = Di([
|
|
6809
6908
|
"abortOperation",
|
|
6810
6909
|
"auditObjectContent",
|
|
6811
6910
|
"createObject",
|
|
@@ -6821,39 +6920,39 @@ var Ai = xi([
|
|
|
6821
6920
|
"retrieveChunks",
|
|
6822
6921
|
"retrieveRecords",
|
|
6823
6922
|
"upsertRecords"
|
|
6824
|
-
]),
|
|
6923
|
+
]), Li = Di([
|
|
6825
6924
|
"application",
|
|
6826
6925
|
"curatedDataset",
|
|
6827
6926
|
"database",
|
|
6828
6927
|
"fileStore"
|
|
6829
|
-
]),
|
|
6928
|
+
]), Ri = /* @__PURE__ */ Q({ label: Ti }), zi = Di([
|
|
6830
6929
|
"bidirectional",
|
|
6831
6930
|
"destination",
|
|
6832
6931
|
"source",
|
|
6833
6932
|
"unknown"
|
|
6834
|
-
]),
|
|
6835
|
-
authMethodId:
|
|
6933
|
+
]), Bi = /* @__PURE__ */ Q({ label: Ti }), Vi = /* @__PURE__ */ Q({
|
|
6934
|
+
authMethodId: Di([
|
|
6836
6935
|
"apiKey",
|
|
6837
6936
|
"disabled",
|
|
6838
6937
|
"oAuth2",
|
|
6839
6938
|
"none"
|
|
6840
6939
|
]),
|
|
6841
|
-
activeConnectionCount: /* @__PURE__ */
|
|
6842
|
-
canDescribe: /* @__PURE__ */
|
|
6843
|
-
id: /* @__PURE__ */
|
|
6844
|
-
label: /* @__PURE__ */
|
|
6845
|
-
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */
|
|
6846
|
-
params: /* @__PURE__ */
|
|
6847
|
-
}),
|
|
6848
|
-
...
|
|
6849
|
-
typeId: /* @__PURE__ */
|
|
6850
|
-
actionNames: /* @__PURE__ */
|
|
6851
|
-
category: /* @__PURE__ */ Z(
|
|
6852
|
-
categoryId:
|
|
6853
|
-
implementations: /* @__PURE__ */
|
|
6854
|
-
usage: /* @__PURE__ */ Z(
|
|
6855
|
-
usageId: /* @__PURE__ */ Z(
|
|
6856
|
-
}),
|
|
6940
|
+
activeConnectionCount: /* @__PURE__ */ xi(/* @__PURE__ */ bi()),
|
|
6941
|
+
canDescribe: /* @__PURE__ */ xi(/* @__PURE__ */ vi()),
|
|
6942
|
+
id: /* @__PURE__ */ xi(/* @__PURE__ */ $()),
|
|
6943
|
+
label: /* @__PURE__ */ xi(Ti),
|
|
6944
|
+
maxConnectionCount: /* @__PURE__ */ Z(/* @__PURE__ */ bi()),
|
|
6945
|
+
params: /* @__PURE__ */ xi(/* @__PURE__ */ _i(/* @__PURE__ */ Si(/* @__PURE__ */ $(), /* @__PURE__ */ $())))
|
|
6946
|
+
}), Hi = /* @__PURE__ */ Q({
|
|
6947
|
+
...Fi,
|
|
6948
|
+
typeId: /* @__PURE__ */ yi("connector"),
|
|
6949
|
+
actionNames: /* @__PURE__ */ _i(Ii),
|
|
6950
|
+
category: /* @__PURE__ */ Z(Ri),
|
|
6951
|
+
categoryId: Li,
|
|
6952
|
+
implementations: /* @__PURE__ */ Si(/* @__PURE__ */ $(), Vi),
|
|
6953
|
+
usage: /* @__PURE__ */ Z(Bi),
|
|
6954
|
+
usageId: /* @__PURE__ */ Z(zi)
|
|
6955
|
+
}), Ui = {
|
|
6857
6956
|
abortOperation: "Abort Operation",
|
|
6858
6957
|
auditObjectContent: "Audit Object Content",
|
|
6859
6958
|
createObject: "Create Object",
|
|
@@ -6869,12 +6968,12 @@ var Ai = xi([
|
|
|
6869
6968
|
retrieveChunks: "Retrieve Chunks",
|
|
6870
6969
|
retrieveRecords: "Retrieve Records",
|
|
6871
6970
|
upsertRecords: "Upsert Records"
|
|
6872
|
-
},
|
|
6971
|
+
}, Wi = /* @__PURE__ */ new Set([
|
|
6873
6972
|
"createObject",
|
|
6874
6973
|
"dropObject",
|
|
6875
6974
|
"removeRecords",
|
|
6876
6975
|
"upsertRecords"
|
|
6877
|
-
]),
|
|
6976
|
+
]), Gi = /* @__PURE__ */ new Set([
|
|
6878
6977
|
"auditObjectContent",
|
|
6879
6978
|
"findObject",
|
|
6880
6979
|
"getInfo",
|
|
@@ -6885,57 +6984,57 @@ var Ai = xi([
|
|
|
6885
6984
|
"retrieveChunks",
|
|
6886
6985
|
"retrieveRecords"
|
|
6887
6986
|
]);
|
|
6888
|
-
function
|
|
6987
|
+
function Ki(e) {
|
|
6889
6988
|
let t = !1, n = !1;
|
|
6890
|
-
for (let r of e)
|
|
6989
|
+
for (let r of e) Gi.has(r) && (t = !0), Wi.has(r) && (n = !0);
|
|
6891
6990
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
6892
6991
|
}
|
|
6893
|
-
function
|
|
6992
|
+
function qi(e) {
|
|
6894
6993
|
let t = new Set(e), n = "|Action|Supported|\n";
|
|
6895
6994
|
n += "|:----|:-------:|\n";
|
|
6896
|
-
for (let e of Object.keys(
|
|
6995
|
+
for (let e of Object.keys(Ui)) n += `| ${Ui[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
6897
6996
|
return n;
|
|
6898
6997
|
}
|
|
6899
6998
|
//#endregion
|
|
6900
6999
|
//#region src/actions/documentActions.ts
|
|
6901
|
-
var
|
|
7000
|
+
var Ji = "<!-- CONNECTOR_ACTIONS_START -->", Yi = "<!-- CONNECTOR_ACTIONS_END -->", Xi = "Connectors conform to a unified interface contract by implementing a specific subset of standard actions. These standardised actions allow the DPUse application to interact with any underlying data source in the same way, enabling Connectors to be built independently and loaded dynamically at runtime.", Zi = {
|
|
6902
7001
|
source: "This connector is a Source connector that supports only read actions. Connectors can also function as a Destination (write-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
6903
7002
|
destination: "This connector is a Destination connector that supports only write actions. Connectors can also function as a Source (read-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
6904
7003
|
bidirectional: "This connector is a Bidirectional connector that supports both read and write actions. Connectors can also function as a Source (read-only) or Destination (write-only), depending on the actions they support.",
|
|
6905
7004
|
unknown: "This connector does not yet implement any read or write actions, so its type cannot be determined. Connectors function as a Source (read-only), a Destination (write-only), or Bidirectional (read/write), depending on the actions they support."
|
|
6906
|
-
},
|
|
6907
|
-
async function
|
|
7005
|
+
}, Qi = "The table below lists all connector actions and highlights those supported by this connector.";
|
|
7006
|
+
async function $i() {
|
|
6908
7007
|
try {
|
|
6909
|
-
|
|
6910
|
-
let e = (await
|
|
6911
|
-
await
|
|
7008
|
+
G("Document Actions"), q("1️⃣ Insert actions description and table into 'README.md'");
|
|
7009
|
+
let e = (await W("config.json")).actionNames ?? [], t = Ki(e), n = qi(e);
|
|
7010
|
+
await Bn(`${Xi}\n\n${Zi[t]} ${Qi}\n\n${n}`, Ji, Yi), K("Actions documented");
|
|
6912
7011
|
} catch (e) {
|
|
6913
7012
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
6914
7013
|
}
|
|
6915
7014
|
}
|
|
6916
7015
|
//#endregion
|
|
6917
7016
|
//#region src/actions/documentOpening.ts
|
|
6918
|
-
var
|
|
6919
|
-
async function
|
|
7017
|
+
var ea = "<!-- OPENING_START -->", ta = "<!-- OPENING_END -->";
|
|
7018
|
+
async function na() {
|
|
6920
7019
|
try {
|
|
6921
|
-
|
|
6922
|
-
let e = await
|
|
6923
|
-
await
|
|
7020
|
+
G("Document Opening"), q("1️⃣ Insert opening content into 'README.md'");
|
|
7021
|
+
let e = await W("package.json"), t = await W("config.json"), { owner: n, repo: r } = Un(e, "document opening");
|
|
7022
|
+
await Bn(aa(n, r, ra(e), ia(t)), ea, ta), K("Opening documented");
|
|
6924
7023
|
} catch (e) {
|
|
6925
7024
|
console.error("❌ Error documenting opening", e), process.exit(1);
|
|
6926
7025
|
}
|
|
6927
7026
|
}
|
|
6928
|
-
function
|
|
7027
|
+
function ra(e) {
|
|
6929
7028
|
let t = e.license;
|
|
6930
7029
|
if (t == null || t === "") throw Error("package.json 'license' field is required to document opening.");
|
|
6931
7030
|
return t;
|
|
6932
7031
|
}
|
|
6933
|
-
function
|
|
7032
|
+
function ia(e) {
|
|
6934
7033
|
let t = e.description.en;
|
|
6935
7034
|
if (t == null || t.length === 0) throw Error("config.json 'description.en' field is required to document opening.");
|
|
6936
7035
|
return t;
|
|
6937
7036
|
}
|
|
6938
|
-
function
|
|
7037
|
+
function aa(e, t, n, r) {
|
|
6939
7038
|
let i = `https://github.com/${e}/${t}`;
|
|
6940
7039
|
return `[}-blue.svg)](./LICENSE)
|
|
6941
7040
|
[](${i}/releases/latest)
|
|
@@ -6963,31 +7062,31 @@ ${r}`;
|
|
|
6963
7062
|
}
|
|
6964
7063
|
//#endregion
|
|
6965
7064
|
//#region src/actions/documentUsage.ts
|
|
6966
|
-
var
|
|
6967
|
-
async function
|
|
7065
|
+
var oa = "<!-- USAGE_START -->", sa = "<!-- USAGE_END -->";
|
|
7066
|
+
async function ca() {
|
|
6968
7067
|
try {
|
|
6969
|
-
|
|
6970
|
-
let e = await
|
|
6971
|
-
await
|
|
7068
|
+
G("Document Usage"), q("1️⃣ Insert usage content into 'README.md'");
|
|
7069
|
+
let e = await W("package.json"), t = la(e);
|
|
7070
|
+
await Bn(fa(t, ua(t), da(e.engines?.node), da(e.engines?.npm), da(e.devDependencies?.typescript)), oa, sa), K("Usage documented");
|
|
6972
7071
|
} catch (e) {
|
|
6973
7072
|
console.error("❌ Error documenting usage", e), process.exit(1);
|
|
6974
7073
|
}
|
|
6975
7074
|
}
|
|
6976
|
-
function
|
|
7075
|
+
function la(e) {
|
|
6977
7076
|
let t = e.repository, n = typeof t == "string" ? t : t?.url;
|
|
6978
7077
|
if (n == null || n === "") throw Error("package.json 'repository' field is required to document usage.");
|
|
6979
7078
|
return n.replace(/^git\+/, "");
|
|
6980
7079
|
}
|
|
6981
|
-
function
|
|
7080
|
+
function ua(e) {
|
|
6982
7081
|
return (e.split("/").at(-1) ?? "").replace(/\.git$/, "");
|
|
6983
7082
|
}
|
|
6984
|
-
function
|
|
7083
|
+
function da(e) {
|
|
6985
7084
|
if (e == null) throw Error("package.json version range is required to document usage.");
|
|
6986
7085
|
let t = /\d+(?:\.\d+)*/.exec(e);
|
|
6987
7086
|
if (t == null) throw Error(`Unable to parse version from '${e}'.`);
|
|
6988
7087
|
return t[0];
|
|
6989
7088
|
}
|
|
6990
|
-
function
|
|
7089
|
+
function fa(e, t, n, r, i) {
|
|
6991
7090
|
return `This connector is automatically uploaded to the DPUse Engine cloud once released and becomes instantly available to all new browser app instances, with existing instances notified of the update.
|
|
6992
7091
|
|
|
6993
7092
|
You may view or clone this repository for your own purposes, such as building a new, similar connector, though there is currently no process to accept third-party connectors into DPUse at this stage. Cloned or forked code is unsupported and isn't guaranteed to remain compatible with the DPUse Engine as it evolves.
|
|
@@ -7002,43 +7101,43 @@ _Requires [Node.js](https://nodejs.org/) ${n} or later, [npm](https://www.npmjs.
|
|
|
7002
7101
|
}
|
|
7003
7102
|
//#endregion
|
|
7004
7103
|
//#region src/actions/formatCode.ts
|
|
7005
|
-
async function
|
|
7104
|
+
async function pa() {
|
|
7006
7105
|
try {
|
|
7007
|
-
|
|
7106
|
+
G("Format Code"), await U("1️⃣ Format", "prettier", [
|
|
7008
7107
|
"--write",
|
|
7009
7108
|
"*.json",
|
|
7010
7109
|
"*.md",
|
|
7011
7110
|
"*.ts",
|
|
7012
7111
|
...["app", "src"].filter((t) => e(t)).map((e) => `${e}/**`)
|
|
7013
|
-
]),
|
|
7112
|
+
]), K("Code formatted");
|
|
7014
7113
|
} catch (e) {
|
|
7015
7114
|
console.error("❌ Error formatting code", e), process.exit(1);
|
|
7016
7115
|
}
|
|
7017
7116
|
}
|
|
7018
7117
|
//#endregion
|
|
7019
7118
|
//#region src/actions/lintCode.ts
|
|
7020
|
-
async function
|
|
7119
|
+
async function ma() {
|
|
7021
7120
|
try {
|
|
7022
|
-
|
|
7121
|
+
G("Lint Code"), await U("1️⃣ Lint", "eslint", ["."]), K("Code linted");
|
|
7023
7122
|
} catch (e) {
|
|
7024
7123
|
console.error("❌ Error linting code", e), process.exit(1);
|
|
7025
7124
|
}
|
|
7026
7125
|
}
|
|
7027
7126
|
//#endregion
|
|
7028
7127
|
//#region src/utilities/cloudflare.ts
|
|
7029
|
-
async function
|
|
7030
|
-
let e = await
|
|
7128
|
+
async function ha() {
|
|
7129
|
+
let e = await W("config.json"), t = {
|
|
7031
7130
|
body: JSON.stringify(e),
|
|
7032
7131
|
headers: { "Content-Type": "application/json" },
|
|
7033
7132
|
method: "PUT"
|
|
7034
7133
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
7035
7134
|
if (!n.ok) throw Error(await n.text());
|
|
7036
7135
|
}
|
|
7037
|
-
async function
|
|
7136
|
+
async function ga(e, t) {
|
|
7038
7137
|
async function n(e, t, r) {
|
|
7039
7138
|
for (let i of r) {
|
|
7040
7139
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
7041
|
-
(await
|
|
7140
|
+
(await Wn(r)).isDirectory() ? await n(r, a, await Pn(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Fn(void 0, "wrangler", [
|
|
7042
7141
|
"r2",
|
|
7043
7142
|
"object",
|
|
7044
7143
|
"put",
|
|
@@ -7049,10 +7148,10 @@ async function ua(e, t) {
|
|
|
7049
7148
|
]));
|
|
7050
7149
|
}
|
|
7051
7150
|
}
|
|
7052
|
-
let r = await
|
|
7151
|
+
let r = await Pn(`${e}/${t}/`);
|
|
7053
7152
|
await n(`${e}/${t}`, t, r);
|
|
7054
7153
|
}
|
|
7055
|
-
async function
|
|
7154
|
+
async function _a(e) {
|
|
7056
7155
|
let t = e.id, n = {
|
|
7057
7156
|
body: JSON.stringify(e),
|
|
7058
7157
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7060,14 +7159,14 @@ async function da(e) {
|
|
|
7060
7159
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
7061
7160
|
if (!r.ok) throw Error(await r.text());
|
|
7062
7161
|
}
|
|
7063
|
-
async function
|
|
7162
|
+
async function va(e, t) {
|
|
7064
7163
|
let n = `v${e.version ?? "unknown"}`;
|
|
7065
7164
|
async function r(e, r = "") {
|
|
7066
|
-
let i = await
|
|
7165
|
+
let i = await Pn(e, { withFileTypes: !0 });
|
|
7067
7166
|
for (let a of i) {
|
|
7068
7167
|
if (a.isDirectory() || a.name.endsWith(".map")) continue;
|
|
7069
7168
|
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = a.name.endsWith(".css") ? "text/css" : "application/octet-stream", l = a.name.endsWith(".js") ? "application/javascript" : c;
|
|
7070
|
-
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await
|
|
7169
|
+
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Fn(void 0, "wrangler", [
|
|
7071
7170
|
"r2",
|
|
7072
7171
|
"object",
|
|
7073
7172
|
"put",
|
|
@@ -7084,24 +7183,24 @@ async function fa(e, t) {
|
|
|
7084
7183
|
}
|
|
7085
7184
|
//#endregion
|
|
7086
7185
|
//#region node_modules/valibot/dist/index.mjs
|
|
7087
|
-
var
|
|
7186
|
+
var ya = {
|
|
7088
7187
|
lang: void 0,
|
|
7089
7188
|
message: void 0,
|
|
7090
7189
|
abortEarly: void 0,
|
|
7091
7190
|
abortPipeEarly: void 0
|
|
7092
7191
|
};
|
|
7093
7192
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7094
|
-
function
|
|
7193
|
+
function ba(e) {
|
|
7095
7194
|
return e ? {
|
|
7096
7195
|
lang: e?.lang ?? void 0,
|
|
7097
7196
|
message: e?.message,
|
|
7098
7197
|
abortEarly: e?.abortEarly ?? void 0,
|
|
7099
7198
|
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
7100
|
-
} :
|
|
7199
|
+
} : ya;
|
|
7101
7200
|
}
|
|
7102
7201
|
/* @__NO_SIDE_EFFECTS__ */
|
|
7103
|
-
function
|
|
7104
|
-
let r = e["~run"]({ value: t }, /* @__PURE__ */
|
|
7202
|
+
function xa(e, t, n) {
|
|
7203
|
+
let r = e["~run"]({ value: t }, /* @__PURE__ */ ba(n));
|
|
7105
7204
|
return {
|
|
7106
7205
|
typed: r.typed,
|
|
7107
7206
|
success: !r.issues,
|
|
@@ -7111,21 +7210,21 @@ function ha(e, t, n) {
|
|
|
7111
7210
|
}
|
|
7112
7211
|
//#endregion
|
|
7113
7212
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModulePresenter.es.js
|
|
7114
|
-
var
|
|
7213
|
+
var Sa = Di([
|
|
7115
7214
|
"list",
|
|
7116
7215
|
"render",
|
|
7117
7216
|
"setColorMode"
|
|
7118
|
-
]),
|
|
7119
|
-
...
|
|
7120
|
-
typeId: /* @__PURE__ */
|
|
7121
|
-
actionNames: /* @__PURE__ */
|
|
7122
|
-
presentations: /* @__PURE__ */
|
|
7123
|
-
}),
|
|
7217
|
+
]), Ca = /* @__PURE__ */ Q({
|
|
7218
|
+
...Fi,
|
|
7219
|
+
typeId: /* @__PURE__ */ yi("presenter"),
|
|
7220
|
+
actionNames: /* @__PURE__ */ _i(Sa),
|
|
7221
|
+
presentations: /* @__PURE__ */ _i(Ni)
|
|
7222
|
+
}), wa = [
|
|
7124
7223
|
"1️⃣ ",
|
|
7125
7224
|
"2️⃣ ",
|
|
7126
7225
|
"3️⃣ ",
|
|
7127
7226
|
"4️⃣ "
|
|
7128
|
-
],
|
|
7227
|
+
], Ta = [{
|
|
7129
7228
|
id: "unit",
|
|
7130
7229
|
label: "Run unit tests",
|
|
7131
7230
|
command: "vitest",
|
|
@@ -7138,46 +7237,46 @@ var ga = xi([
|
|
|
7138
7237
|
arguments: ["test", "--pass-with-no-tests"],
|
|
7139
7238
|
configFileName: "playwright.config.ts"
|
|
7140
7239
|
}];
|
|
7141
|
-
async function
|
|
7240
|
+
async function Ea() {
|
|
7142
7241
|
try {
|
|
7143
|
-
|
|
7242
|
+
G("Build Project"), await U("1️⃣ Bundle project", "vite", ["build"]), K("Project built");
|
|
7144
7243
|
} catch (e) {
|
|
7145
7244
|
console.error("❌ Error building project", e), process.exit(1);
|
|
7146
7245
|
}
|
|
7147
7246
|
}
|
|
7148
|
-
async function
|
|
7247
|
+
async function Da() {
|
|
7149
7248
|
try {
|
|
7150
|
-
|
|
7151
|
-
let e = await
|
|
7152
|
-
await
|
|
7249
|
+
G("Publish Project");
|
|
7250
|
+
let e = await W("package.json"), t = await W("config.json");
|
|
7251
|
+
await Ia("1️⃣ ", e, t, Hn(t.id)), K(`Project version '${e.version ?? "unknown"}' published.`);
|
|
7153
7252
|
} catch (e) {
|
|
7154
7253
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
7155
7254
|
}
|
|
7156
7255
|
}
|
|
7157
|
-
async function
|
|
7256
|
+
async function Oa() {
|
|
7158
7257
|
try {
|
|
7159
|
-
|
|
7160
|
-
let e = await
|
|
7161
|
-
await
|
|
7162
|
-
let n =
|
|
7258
|
+
G("Release Project");
|
|
7259
|
+
let e = await W("package.json"), t = await W("config.json");
|
|
7260
|
+
await Fa("1️⃣ ", e);
|
|
7261
|
+
let n = Hn(t.id);
|
|
7163
7262
|
switch (n.typeId) {
|
|
7164
7263
|
case "connector":
|
|
7165
|
-
t = await
|
|
7264
|
+
t = await Aa("2️⃣ ", e);
|
|
7166
7265
|
break;
|
|
7167
7266
|
case "presenter":
|
|
7168
|
-
t = await
|
|
7267
|
+
t = await ja("2️⃣ ", e);
|
|
7169
7268
|
break;
|
|
7170
|
-
default: t = await
|
|
7269
|
+
default: t = await ka("2️⃣ ", e);
|
|
7171
7270
|
}
|
|
7172
|
-
await
|
|
7271
|
+
await U("3️⃣ Bundle project", "vite", ["build"]), await Fn("4️⃣ Stage changes", "git", ["add", "."]), await Fn("5️⃣ Commit changes", "git", [
|
|
7173
7272
|
"commit",
|
|
7174
7273
|
"-m",
|
|
7175
7274
|
`v${e.version ?? "unknown"}`
|
|
7176
|
-
]), await
|
|
7275
|
+
]), await Fn("6️⃣ Push changes", "git", [
|
|
7177
7276
|
"push",
|
|
7178
7277
|
"origin",
|
|
7179
7278
|
"main:main"
|
|
7180
|
-
]), await
|
|
7279
|
+
]), await Ia("7️⃣ ", e, t, n), n.publishedTo === "npm" ? await U("8️⃣ Create GitHub release", "gh", [
|
|
7181
7280
|
"release",
|
|
7182
7281
|
"create",
|
|
7183
7282
|
`v${e.version ?? "unknown"}`,
|
|
@@ -7185,95 +7284,95 @@ async function Sa() {
|
|
|
7185
7284
|
"main",
|
|
7186
7285
|
"--generate-notes",
|
|
7187
7286
|
"--latest"
|
|
7188
|
-
]) :
|
|
7287
|
+
]) : q(`8️⃣ Publishing NOT required for package with type identifier of '${n.typeId}'.`), K(`Project version '${e.version ?? "unknown"}' released.`);
|
|
7189
7288
|
} catch (e) {
|
|
7190
7289
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
7191
7290
|
}
|
|
7192
7291
|
}
|
|
7193
|
-
async function
|
|
7194
|
-
|
|
7195
|
-
let n = await
|
|
7196
|
-
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await
|
|
7292
|
+
async function ka(e, t) {
|
|
7293
|
+
q(`${e} Build project configuration`);
|
|
7294
|
+
let n = await W("config.json");
|
|
7295
|
+
return t.name != null && (n.id = t.name.replace("@dpuse/", "")), t.version != null && (n.version = t.version), n.icon ??= await Rn("logo.svg"), n.iconDark ??= await Rn("logoDark.svg"), await zn("config.json", n), n;
|
|
7197
7296
|
}
|
|
7198
|
-
async function
|
|
7199
|
-
|
|
7200
|
-
let [n, r] = await Promise.all([
|
|
7297
|
+
async function Aa(e, t) {
|
|
7298
|
+
q(`${e} Build connector project configuration`);
|
|
7299
|
+
let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */ xa(Hi, n);
|
|
7201
7300
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7202
|
-
let a =
|
|
7203
|
-
return await
|
|
7301
|
+
let a = Gn(r);
|
|
7302
|
+
return await Ma(t, n, a, Ki(a));
|
|
7204
7303
|
}
|
|
7205
|
-
async function
|
|
7206
|
-
|
|
7207
|
-
let [n, r] = await Promise.all([
|
|
7304
|
+
async function ja(e, t) {
|
|
7305
|
+
q(`${e} Build presenter project configuration`);
|
|
7306
|
+
let [n, r] = await Promise.all([W("config.json"), Ln("src/index.ts")]), i = /* @__PURE__ */ xa(Ca, n);
|
|
7208
7307
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid");
|
|
7209
|
-
return await
|
|
7308
|
+
return await Ma(t, n, Gn(r));
|
|
7210
7309
|
}
|
|
7211
|
-
async function
|
|
7212
|
-
return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await
|
|
7310
|
+
async function Ma(e, t, n, r) {
|
|
7311
|
+
return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations"), r === "unknown" ? console.warn("⚠️ No usage identified") : r && console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.actionNames = n, r !== void 0 && (t.usageId = r), await zn("config.json", t), t;
|
|
7213
7312
|
}
|
|
7214
|
-
async function
|
|
7313
|
+
async function Na() {
|
|
7215
7314
|
try {
|
|
7216
|
-
|
|
7217
|
-
let e = await
|
|
7218
|
-
switch (await
|
|
7315
|
+
G("Synchronise Project with GitHub");
|
|
7316
|
+
let e = await W("package.json"), t = await W("config.json");
|
|
7317
|
+
switch (await Fa("1️⃣ ", e), Hn(t.id).typeId) {
|
|
7219
7318
|
case "connector":
|
|
7220
|
-
await
|
|
7319
|
+
await Aa("2️⃣ ", e);
|
|
7221
7320
|
break;
|
|
7222
7321
|
case "presenter":
|
|
7223
|
-
await
|
|
7322
|
+
await ja("2️⃣ ", e);
|
|
7224
7323
|
break;
|
|
7225
|
-
default: await
|
|
7324
|
+
default: await ka("2️⃣ ", e);
|
|
7226
7325
|
}
|
|
7227
|
-
await
|
|
7326
|
+
await Fn("3️⃣ Stage changes", "git", ["add", "."]), await Fn("4️⃣ Commit changes", "git", [
|
|
7228
7327
|
"commit",
|
|
7229
7328
|
"-m",
|
|
7230
7329
|
`v${e.version ?? "unknown"}`
|
|
7231
|
-
]), await
|
|
7330
|
+
]), await Fn("5️⃣ Push changes", "git", [
|
|
7232
7331
|
"push",
|
|
7233
7332
|
"origin",
|
|
7234
7333
|
"main:main"
|
|
7235
|
-
]),
|
|
7334
|
+
]), K(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
|
|
7236
7335
|
} catch (e) {
|
|
7237
7336
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
7238
7337
|
}
|
|
7239
7338
|
}
|
|
7240
|
-
async function
|
|
7339
|
+
async function Pa(e = ["unit"], t = !1) {
|
|
7241
7340
|
try {
|
|
7242
|
-
|
|
7341
|
+
G("Test Project");
|
|
7243
7342
|
let n = 0;
|
|
7244
|
-
for (let r of
|
|
7245
|
-
if (!e.includes(r.id) || await
|
|
7343
|
+
for (let r of Ta) {
|
|
7344
|
+
if (!e.includes(r.id) || await Rn(r.configFileName) === null) continue;
|
|
7246
7345
|
let i = t && r.id === "unit" ? ["--coverage"] : [];
|
|
7247
|
-
await
|
|
7346
|
+
await U(`${wa[n] ?? ""} ${r.label}`, r.command, [...r.arguments, ...i]), n += 1;
|
|
7248
7347
|
}
|
|
7249
7348
|
if (n === 0) {
|
|
7250
7349
|
console.warn("\n⚠️ No tests configured for this project.\n");
|
|
7251
7350
|
return;
|
|
7252
7351
|
}
|
|
7253
|
-
|
|
7352
|
+
K("Project tested");
|
|
7254
7353
|
} catch (e) {
|
|
7255
7354
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
7256
7355
|
}
|
|
7257
7356
|
}
|
|
7258
|
-
async function
|
|
7259
|
-
if (
|
|
7357
|
+
async function Fa(e, t, n = "./") {
|
|
7358
|
+
if (q(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`);
|
|
7260
7359
|
else {
|
|
7261
7360
|
let e = t.version, n = t.version.split(".");
|
|
7262
7361
|
t.version = `${n[0] ?? "unknown"}.${n[1] ?? "unknown"}.${String(Number(n[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`);
|
|
7263
7362
|
}
|
|
7264
|
-
await
|
|
7363
|
+
await zn(`${n}package.json`, t);
|
|
7265
7364
|
}
|
|
7266
|
-
async function
|
|
7267
|
-
if (r.typeId === "app")
|
|
7268
|
-
else if (r.typeId === "engine")
|
|
7269
|
-
else if (r.uploadGroupName === void 0)
|
|
7365
|
+
async function Ia(e, t, n, r) {
|
|
7366
|
+
if (r.typeId === "app") q(`${e} Register module`), await ha();
|
|
7367
|
+
else if (r.typeId === "engine") q(`${e} Register module`), await va(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await _a(n);
|
|
7368
|
+
else if (r.uploadGroupName === void 0) q(`${e} Registration NOT required`);
|
|
7270
7369
|
else {
|
|
7271
|
-
|
|
7370
|
+
q(`${e} Register module`);
|
|
7272
7371
|
let i = n.id.split("-").slice(2).join("-");
|
|
7273
|
-
await
|
|
7372
|
+
await va(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await _a(n);
|
|
7274
7373
|
}
|
|
7275
7374
|
}
|
|
7276
7375
|
//#endregion
|
|
7277
|
-
export {
|
|
7376
|
+
export { Jn as auditDependencies, Ea as buildProject, Yn as checkConfigFiles, nr as checkDependencies, $i as documentActions, dr as documentBundleSizes, Nr as documentDependencies, Qr as documentGovernance, na as documentOpening, ca as documentUsage, pa as formatCode, ma as lintCode, Da as publishProject, Oa as releaseProject, Na as syncProjectWithGitHub, Pa as testProject, ga as uploadDirectoryToR2 };
|
|
7278
7377
|
|
|
7279
7378
|
//# sourceMappingURL=dpuse-development.es.js.map
|