houdini 1.3.1 → 1.4.1
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/build/cmd-cjs/index.js +143 -28
- package/build/cmd-esm/index.js +143 -28
- package/build/codegen-cjs/index.js +123 -10
- package/build/codegen-esm/index.js +123 -10
- package/build/lib/config.d.ts +1 -0
- package/build/lib/router/types.d.ts +3 -1
- package/build/lib-cjs/index.js +92 -19
- package/build/lib-esm/index.js +91 -19
- package/build/runtime/cache/cache.d.ts +1 -1
- package/build/runtime/cache/lists.d.ts +3 -1
- package/build/runtime/lib/config.d.ts +10 -1
- package/build/runtime/lib/types.d.ts +14 -2
- package/build/runtime-cjs/cache/cache.d.ts +1 -1
- package/build/runtime-cjs/cache/cache.js +31 -5
- package/build/runtime-cjs/cache/lists.d.ts +3 -1
- package/build/runtime-cjs/cache/lists.js +15 -1
- package/build/runtime-cjs/client/documentStore.js +27 -7
- package/build/runtime-cjs/client/plugins/fetch.js +5 -0
- package/build/runtime-cjs/lib/config.d.ts +10 -1
- package/build/runtime-cjs/lib/types.d.ts +14 -2
- package/build/runtime-cjs/lib/types.js +7 -0
- package/build/runtime-cjs/router/match.js +1 -1
- package/build/runtime-esm/cache/cache.d.ts +1 -1
- package/build/runtime-esm/cache/cache.js +31 -5
- package/build/runtime-esm/cache/lists.d.ts +3 -1
- package/build/runtime-esm/cache/lists.js +15 -1
- package/build/runtime-esm/client/documentStore.js +28 -8
- package/build/runtime-esm/client/plugins/fetch.js +5 -0
- package/build/runtime-esm/lib/config.d.ts +10 -1
- package/build/runtime-esm/lib/types.d.ts +14 -2
- package/build/runtime-esm/lib/types.js +6 -0
- package/build/runtime-esm/router/match.js +1 -1
- package/build/test-cjs/index.js +129 -15
- package/build/test-esm/index.js +129 -15
- package/build/vite/ast.d.ts +8 -2
- package/build/vite-cjs/index.js +374 -255
- package/build/vite-esm/index.js +374 -255
- package/package.json +3 -3
package/build/vite-cjs/index.js
CHANGED
|
@@ -19745,30 +19745,30 @@ var require_utils5 = __commonJS({
|
|
|
19745
19745
|
validate3.oneOf = values;
|
|
19746
19746
|
return validate3;
|
|
19747
19747
|
}
|
|
19748
|
-
function assertNodeType(...
|
|
19748
|
+
function assertNodeType(...types18) {
|
|
19749
19749
|
function validate3(node, key, val) {
|
|
19750
|
-
for (const type of
|
|
19750
|
+
for (const type of types18) {
|
|
19751
19751
|
if ((0, _is.default)(type, val)) {
|
|
19752
19752
|
(0, _validate.validateChild)(node, key, val);
|
|
19753
19753
|
return;
|
|
19754
19754
|
}
|
|
19755
19755
|
}
|
|
19756
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
19756
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types18)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
19757
19757
|
}
|
|
19758
|
-
validate3.oneOfNodeTypes =
|
|
19758
|
+
validate3.oneOfNodeTypes = types18;
|
|
19759
19759
|
return validate3;
|
|
19760
19760
|
}
|
|
19761
|
-
function assertNodeOrValueType(...
|
|
19761
|
+
function assertNodeOrValueType(...types18) {
|
|
19762
19762
|
function validate3(node, key, val) {
|
|
19763
|
-
for (const type of
|
|
19763
|
+
for (const type of types18) {
|
|
19764
19764
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
19765
19765
|
(0, _validate.validateChild)(node, key, val);
|
|
19766
19766
|
return;
|
|
19767
19767
|
}
|
|
19768
19768
|
}
|
|
19769
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
19769
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types18)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
19770
19770
|
}
|
|
19771
|
-
validate3.oneOfNodeOrValueTypes =
|
|
19771
|
+
validate3.oneOfNodeOrValueTypes = types18;
|
|
19772
19772
|
return validate3;
|
|
19773
19773
|
}
|
|
19774
19774
|
function assertValueType(type) {
|
|
@@ -24196,10 +24196,10 @@ var require_generated2 = __commonJS({
|
|
|
24196
24196
|
body
|
|
24197
24197
|
});
|
|
24198
24198
|
}
|
|
24199
|
-
function intersectionTypeAnnotation(
|
|
24199
|
+
function intersectionTypeAnnotation(types18) {
|
|
24200
24200
|
return (0, _validateNode.default)({
|
|
24201
24201
|
type: "IntersectionTypeAnnotation",
|
|
24202
|
-
types:
|
|
24202
|
+
types: types18
|
|
24203
24203
|
});
|
|
24204
24204
|
}
|
|
24205
24205
|
function mixedTypeAnnotation() {
|
|
@@ -24322,10 +24322,10 @@ var require_generated2 = __commonJS({
|
|
|
24322
24322
|
type: "ThisTypeAnnotation"
|
|
24323
24323
|
};
|
|
24324
24324
|
}
|
|
24325
|
-
function tupleTypeAnnotation(
|
|
24325
|
+
function tupleTypeAnnotation(types18) {
|
|
24326
24326
|
return (0, _validateNode.default)({
|
|
24327
24327
|
type: "TupleTypeAnnotation",
|
|
24328
|
-
types:
|
|
24328
|
+
types: types18
|
|
24329
24329
|
});
|
|
24330
24330
|
}
|
|
24331
24331
|
function typeofTypeAnnotation(argument) {
|
|
@@ -24376,10 +24376,10 @@ var require_generated2 = __commonJS({
|
|
|
24376
24376
|
params
|
|
24377
24377
|
});
|
|
24378
24378
|
}
|
|
24379
|
-
function unionTypeAnnotation(
|
|
24379
|
+
function unionTypeAnnotation(types18) {
|
|
24380
24380
|
return (0, _validateNode.default)({
|
|
24381
24381
|
type: "UnionTypeAnnotation",
|
|
24382
|
-
types:
|
|
24382
|
+
types: types18
|
|
24383
24383
|
});
|
|
24384
24384
|
}
|
|
24385
24385
|
function variance(kind) {
|
|
@@ -24892,16 +24892,16 @@ var require_generated2 = __commonJS({
|
|
|
24892
24892
|
optional
|
|
24893
24893
|
});
|
|
24894
24894
|
}
|
|
24895
|
-
function tsUnionType(
|
|
24895
|
+
function tsUnionType(types18) {
|
|
24896
24896
|
return (0, _validateNode.default)({
|
|
24897
24897
|
type: "TSUnionType",
|
|
24898
|
-
types:
|
|
24898
|
+
types: types18
|
|
24899
24899
|
});
|
|
24900
24900
|
}
|
|
24901
|
-
function tsIntersectionType(
|
|
24901
|
+
function tsIntersectionType(types18) {
|
|
24902
24902
|
return (0, _validateNode.default)({
|
|
24903
24903
|
type: "TSIntersectionType",
|
|
24904
|
-
types:
|
|
24904
|
+
types: types18
|
|
24905
24905
|
});
|
|
24906
24906
|
}
|
|
24907
24907
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -26516,12 +26516,12 @@ var require_removeTypeDuplicates = __commonJS({
|
|
|
26516
26516
|
const generics = /* @__PURE__ */ new Map();
|
|
26517
26517
|
const bases = /* @__PURE__ */ new Map();
|
|
26518
26518
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
26519
|
-
const
|
|
26519
|
+
const types18 = [];
|
|
26520
26520
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
26521
26521
|
const node = nodes[i2];
|
|
26522
26522
|
if (!node)
|
|
26523
26523
|
continue;
|
|
26524
|
-
if (
|
|
26524
|
+
if (types18.indexOf(node) >= 0) {
|
|
26525
26525
|
continue;
|
|
26526
26526
|
}
|
|
26527
26527
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -26555,15 +26555,15 @@ var require_removeTypeDuplicates = __commonJS({
|
|
|
26555
26555
|
}
|
|
26556
26556
|
continue;
|
|
26557
26557
|
}
|
|
26558
|
-
|
|
26558
|
+
types18.push(node);
|
|
26559
26559
|
}
|
|
26560
26560
|
for (const [, baseType] of bases) {
|
|
26561
|
-
|
|
26561
|
+
types18.push(baseType);
|
|
26562
26562
|
}
|
|
26563
26563
|
for (const [, genericName] of generics) {
|
|
26564
|
-
|
|
26564
|
+
types18.push(genericName);
|
|
26565
26565
|
}
|
|
26566
|
-
return
|
|
26566
|
+
return types18;
|
|
26567
26567
|
}
|
|
26568
26568
|
}
|
|
26569
26569
|
});
|
|
@@ -26578,8 +26578,8 @@ var require_createFlowUnionType = __commonJS({
|
|
|
26578
26578
|
exports.default = createFlowUnionType;
|
|
26579
26579
|
var _generated = require_generated2();
|
|
26580
26580
|
var _removeTypeDuplicates = require_removeTypeDuplicates();
|
|
26581
|
-
function createFlowUnionType(
|
|
26582
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
26581
|
+
function createFlowUnionType(types18) {
|
|
26582
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
26583
26583
|
if (flattened.length === 1) {
|
|
26584
26584
|
return flattened[0];
|
|
26585
26585
|
} else {
|
|
@@ -26606,12 +26606,12 @@ var require_removeTypeDuplicates2 = __commonJS({
|
|
|
26606
26606
|
const generics = /* @__PURE__ */ new Map();
|
|
26607
26607
|
const bases = /* @__PURE__ */ new Map();
|
|
26608
26608
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
26609
|
-
const
|
|
26609
|
+
const types18 = [];
|
|
26610
26610
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
26611
26611
|
const node = nodes[i2];
|
|
26612
26612
|
if (!node)
|
|
26613
26613
|
continue;
|
|
26614
|
-
if (
|
|
26614
|
+
if (types18.indexOf(node) >= 0) {
|
|
26615
26615
|
continue;
|
|
26616
26616
|
}
|
|
26617
26617
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -26645,15 +26645,15 @@ var require_removeTypeDuplicates2 = __commonJS({
|
|
|
26645
26645
|
}
|
|
26646
26646
|
continue;
|
|
26647
26647
|
}
|
|
26648
|
-
|
|
26648
|
+
types18.push(node);
|
|
26649
26649
|
}
|
|
26650
26650
|
for (const [, baseType] of bases) {
|
|
26651
|
-
|
|
26651
|
+
types18.push(baseType);
|
|
26652
26652
|
}
|
|
26653
26653
|
for (const [, genericName] of generics) {
|
|
26654
|
-
|
|
26654
|
+
types18.push(genericName);
|
|
26655
26655
|
}
|
|
26656
|
-
return
|
|
26656
|
+
return types18;
|
|
26657
26657
|
}
|
|
26658
26658
|
}
|
|
26659
26659
|
});
|
|
@@ -26670,10 +26670,10 @@ var require_createTSUnionType = __commonJS({
|
|
|
26670
26670
|
var _removeTypeDuplicates = require_removeTypeDuplicates2();
|
|
26671
26671
|
var _index = require_generated();
|
|
26672
26672
|
function createTSUnionType(typeAnnotations) {
|
|
26673
|
-
const
|
|
26673
|
+
const types18 = typeAnnotations.map((type) => {
|
|
26674
26674
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
26675
26675
|
});
|
|
26676
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
26676
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
26677
26677
|
if (flattened.length === 1) {
|
|
26678
26678
|
return flattened[0];
|
|
26679
26679
|
} else {
|
|
@@ -31031,14 +31031,14 @@ var require_lib6 = __commonJS({
|
|
|
31031
31031
|
this.preserveSpace = !!preserveSpace;
|
|
31032
31032
|
}
|
|
31033
31033
|
};
|
|
31034
|
-
var
|
|
31034
|
+
var types18 = {
|
|
31035
31035
|
brace: new TokContext("{"),
|
|
31036
31036
|
j_oTag: new TokContext("<tag"),
|
|
31037
31037
|
j_cTag: new TokContext("</tag"),
|
|
31038
31038
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
31039
31039
|
};
|
|
31040
31040
|
{
|
|
31041
|
-
|
|
31041
|
+
types18.template = new TokContext("`", true);
|
|
31042
31042
|
}
|
|
31043
31043
|
var beforeExpr = true;
|
|
31044
31044
|
var startsExpr = true;
|
|
@@ -31576,17 +31576,17 @@ var require_lib6 = __commonJS({
|
|
|
31576
31576
|
context.pop();
|
|
31577
31577
|
};
|
|
31578
31578
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
31579
|
-
context.push(
|
|
31579
|
+
context.push(types18.brace);
|
|
31580
31580
|
};
|
|
31581
31581
|
tokenTypes[22].updateContext = (context) => {
|
|
31582
|
-
if (context[context.length - 1] ===
|
|
31582
|
+
if (context[context.length - 1] === types18.template) {
|
|
31583
31583
|
context.pop();
|
|
31584
31584
|
} else {
|
|
31585
|
-
context.push(
|
|
31585
|
+
context.push(types18.template);
|
|
31586
31586
|
}
|
|
31587
31587
|
};
|
|
31588
31588
|
tokenTypes[142].updateContext = (context) => {
|
|
31589
|
-
context.push(
|
|
31589
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
31590
31590
|
};
|
|
31591
31591
|
}
|
|
31592
31592
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -32146,7 +32146,7 @@ var require_lib6 = __commonJS({
|
|
|
32146
32146
|
this.end = 0;
|
|
32147
32147
|
this.lastTokEndLoc = null;
|
|
32148
32148
|
this.lastTokStartLoc = null;
|
|
32149
|
-
this.context = [
|
|
32149
|
+
this.context = [types18.brace];
|
|
32150
32150
|
this.firstInvalidTemplateEscapePos = null;
|
|
32151
32151
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
32152
32152
|
this.tokensLength = 0;
|
|
@@ -35973,7 +35973,7 @@ var require_lib6 = __commonJS({
|
|
|
35973
35973
|
context
|
|
35974
35974
|
} = this.state;
|
|
35975
35975
|
const currentContext = context[context.length - 1];
|
|
35976
|
-
if (currentContext ===
|
|
35976
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
35977
35977
|
context.pop();
|
|
35978
35978
|
}
|
|
35979
35979
|
}
|
|
@@ -36995,9 +36995,9 @@ var require_lib6 = __commonJS({
|
|
|
36995
36995
|
switch (this.state.type) {
|
|
36996
36996
|
case 5:
|
|
36997
36997
|
node = this.startNode();
|
|
36998
|
-
this.setContext(
|
|
36998
|
+
this.setContext(types18.brace);
|
|
36999
36999
|
this.next();
|
|
37000
|
-
node = this.jsxParseExpressionContainer(node,
|
|
37000
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
37001
37001
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
37002
37002
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
37003
37003
|
}
|
|
@@ -37016,7 +37016,7 @@ var require_lib6 = __commonJS({
|
|
|
37016
37016
|
jsxParseSpreadChild(node) {
|
|
37017
37017
|
this.next();
|
|
37018
37018
|
node.expression = this.parseExpression();
|
|
37019
|
-
this.setContext(
|
|
37019
|
+
this.setContext(types18.j_expr);
|
|
37020
37020
|
this.state.canStartJSXElement = true;
|
|
37021
37021
|
this.expect(8);
|
|
37022
37022
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -37036,11 +37036,11 @@ var require_lib6 = __commonJS({
|
|
|
37036
37036
|
jsxParseAttribute() {
|
|
37037
37037
|
const node = this.startNode();
|
|
37038
37038
|
if (this.match(5)) {
|
|
37039
|
-
this.setContext(
|
|
37039
|
+
this.setContext(types18.brace);
|
|
37040
37040
|
this.next();
|
|
37041
37041
|
this.expect(21);
|
|
37042
37042
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
37043
|
-
this.setContext(
|
|
37043
|
+
this.setContext(types18.j_oTag);
|
|
37044
37044
|
this.state.canStartJSXElement = true;
|
|
37045
37045
|
this.expect(8);
|
|
37046
37046
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -37099,12 +37099,12 @@ var require_lib6 = __commonJS({
|
|
|
37099
37099
|
break;
|
|
37100
37100
|
case 5: {
|
|
37101
37101
|
const node2 = this.startNode();
|
|
37102
|
-
this.setContext(
|
|
37102
|
+
this.setContext(types18.brace);
|
|
37103
37103
|
this.next();
|
|
37104
37104
|
if (this.match(21)) {
|
|
37105
37105
|
children.push(this.jsxParseSpreadChild(node2));
|
|
37106
37106
|
} else {
|
|
37107
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
37107
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
37108
37108
|
}
|
|
37109
37109
|
break;
|
|
37110
37110
|
}
|
|
@@ -37169,11 +37169,11 @@ var require_lib6 = __commonJS({
|
|
|
37169
37169
|
}
|
|
37170
37170
|
getTokenFromCode(code2) {
|
|
37171
37171
|
const context = this.curContext();
|
|
37172
|
-
if (context ===
|
|
37172
|
+
if (context === types18.j_expr) {
|
|
37173
37173
|
this.jsxReadToken();
|
|
37174
37174
|
return;
|
|
37175
37175
|
}
|
|
37176
|
-
if (context ===
|
|
37176
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
37177
37177
|
if (isIdentifierStart(code2)) {
|
|
37178
37178
|
this.jsxReadWord();
|
|
37179
37179
|
return;
|
|
@@ -37183,7 +37183,7 @@ var require_lib6 = __commonJS({
|
|
|
37183
37183
|
this.finishToken(143);
|
|
37184
37184
|
return;
|
|
37185
37185
|
}
|
|
37186
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
37186
|
+
if ((code2 === 34 || code2 === 39) && context === types18.j_oTag) {
|
|
37187
37187
|
this.jsxReadString(code2);
|
|
37188
37188
|
return;
|
|
37189
37189
|
}
|
|
@@ -37201,17 +37201,17 @@ var require_lib6 = __commonJS({
|
|
|
37201
37201
|
type
|
|
37202
37202
|
} = this.state;
|
|
37203
37203
|
if (type === 56 && prevType === 142) {
|
|
37204
|
-
context.splice(-2, 2,
|
|
37204
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
37205
37205
|
this.state.canStartJSXElement = false;
|
|
37206
37206
|
} else if (type === 142) {
|
|
37207
|
-
context.push(
|
|
37207
|
+
context.push(types18.j_oTag);
|
|
37208
37208
|
} else if (type === 143) {
|
|
37209
37209
|
const out = context[context.length - 1];
|
|
37210
|
-
if (out ===
|
|
37210
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
37211
37211
|
context.pop();
|
|
37212
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
37212
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
37213
37213
|
} else {
|
|
37214
|
-
this.setContext(
|
|
37214
|
+
this.setContext(types18.j_expr);
|
|
37215
37215
|
this.state.canStartJSXElement = true;
|
|
37216
37216
|
}
|
|
37217
37217
|
} else {
|
|
@@ -38586,14 +38586,14 @@ var require_lib6 = __commonJS({
|
|
|
38586
38586
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
38587
38587
|
const node = this.startNode();
|
|
38588
38588
|
const hasLeadingOperator = this.eat(operator);
|
|
38589
|
-
const
|
|
38589
|
+
const types19 = [];
|
|
38590
38590
|
do {
|
|
38591
|
-
|
|
38591
|
+
types19.push(parseConstituentType());
|
|
38592
38592
|
} while (this.eat(operator));
|
|
38593
|
-
if (
|
|
38594
|
-
return
|
|
38593
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
38594
|
+
return types19[0];
|
|
38595
38595
|
}
|
|
38596
|
-
node.types =
|
|
38596
|
+
node.types = types19;
|
|
38597
38597
|
return this.finishNode(node, kind);
|
|
38598
38598
|
}
|
|
38599
38599
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -39157,7 +39157,7 @@ var require_lib6 = __commonJS({
|
|
|
39157
39157
|
}));
|
|
39158
39158
|
if (node.params.length === 0) {
|
|
39159
39159
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
39160
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
39160
|
+
} else if (!this.state.inType && this.curContext() === types18.brace) {
|
|
39161
39161
|
this.reScan_lt_gt();
|
|
39162
39162
|
}
|
|
39163
39163
|
this.expect(48);
|
|
@@ -39783,7 +39783,7 @@ var require_lib6 = __commonJS({
|
|
|
39783
39783
|
context
|
|
39784
39784
|
} = this.state;
|
|
39785
39785
|
const currentContext = context[context.length - 1];
|
|
39786
|
-
if (currentContext ===
|
|
39786
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
39787
39787
|
context.pop();
|
|
39788
39788
|
}
|
|
39789
39789
|
}
|
|
@@ -44915,9 +44915,9 @@ var require_shared = __commonJS({
|
|
|
44915
44915
|
var tslib_1 = require_tslib();
|
|
44916
44916
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
44917
44917
|
function default_1(fork) {
|
|
44918
|
-
var
|
|
44919
|
-
var Type =
|
|
44920
|
-
var builtin =
|
|
44918
|
+
var types18 = fork.use(types_1.default);
|
|
44919
|
+
var Type = types18.Type;
|
|
44920
|
+
var builtin = types18.builtInTypes;
|
|
44921
44921
|
var isNumber = builtin.number;
|
|
44922
44922
|
function geq(than) {
|
|
44923
44923
|
return Type.from(function(value) {
|
|
@@ -45067,9 +45067,9 @@ var require_types = __commonJS({
|
|
|
45067
45067
|
}(BaseType);
|
|
45068
45068
|
var OrType = function(_super) {
|
|
45069
45069
|
tslib_1.__extends(OrType2, _super);
|
|
45070
|
-
function OrType2(
|
|
45070
|
+
function OrType2(types18) {
|
|
45071
45071
|
var _this = _super.call(this) || this;
|
|
45072
|
-
_this.types =
|
|
45072
|
+
_this.types = types18;
|
|
45073
45073
|
_this.kind = "OrType";
|
|
45074
45074
|
return _this;
|
|
45075
45075
|
}
|
|
@@ -45210,11 +45210,11 @@ var require_types = __commonJS({
|
|
|
45210
45210
|
function typesPlugin(_fork) {
|
|
45211
45211
|
var Type = {
|
|
45212
45212
|
or: function() {
|
|
45213
|
-
var
|
|
45213
|
+
var types18 = [];
|
|
45214
45214
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
45215
|
-
|
|
45215
|
+
types18[_i] = arguments[_i];
|
|
45216
45216
|
}
|
|
45217
|
-
return new OrType(
|
|
45217
|
+
return new OrType(types18.map(function(type) {
|
|
45218
45218
|
return Type.from(type);
|
|
45219
45219
|
}));
|
|
45220
45220
|
},
|
|
@@ -45659,9 +45659,9 @@ var require_path2 = __commonJS({
|
|
|
45659
45659
|
var Op = Object.prototype;
|
|
45660
45660
|
var hasOwn = Op.hasOwnProperty;
|
|
45661
45661
|
function pathPlugin(fork) {
|
|
45662
|
-
var
|
|
45663
|
-
var isArray =
|
|
45664
|
-
var isNumber =
|
|
45662
|
+
var types18 = fork.use(types_1.default);
|
|
45663
|
+
var isArray = types18.builtInTypes.array;
|
|
45664
|
+
var isNumber = types18.builtInTypes.number;
|
|
45665
45665
|
var Path = function Path2(value, parentPath, name) {
|
|
45666
45666
|
if (!(this instanceof Path2)) {
|
|
45667
45667
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -45963,13 +45963,13 @@ var require_scope = __commonJS({
|
|
|
45963
45963
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45964
45964
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45965
45965
|
function scopePlugin(fork) {
|
|
45966
|
-
var
|
|
45967
|
-
var Type =
|
|
45968
|
-
var namedTypes =
|
|
45966
|
+
var types18 = fork.use(types_1.default);
|
|
45967
|
+
var Type = types18.Type;
|
|
45968
|
+
var namedTypes = types18.namedTypes;
|
|
45969
45969
|
var Node = namedTypes.Node;
|
|
45970
45970
|
var Expression = namedTypes.Expression;
|
|
45971
|
-
var isArray =
|
|
45972
|
-
var b =
|
|
45971
|
+
var isArray = types18.builtInTypes.array;
|
|
45972
|
+
var b = types18.builders;
|
|
45973
45973
|
var Scope = function Scope2(path3, parentScope) {
|
|
45974
45974
|
if (!(this instanceof Scope2)) {
|
|
45975
45975
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -46032,7 +46032,7 @@ var require_scope = __commonJS({
|
|
|
46032
46032
|
++index;
|
|
46033
46033
|
}
|
|
46034
46034
|
var name = prefix + index;
|
|
46035
|
-
return this.bindings[name] =
|
|
46035
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
46036
46036
|
};
|
|
46037
46037
|
Sp.injectTemporary = function(identifier, init) {
|
|
46038
46038
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -46108,7 +46108,7 @@ var require_scope = __commonJS({
|
|
|
46108
46108
|
bindings
|
|
46109
46109
|
);
|
|
46110
46110
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
46111
|
-
|
|
46111
|
+
types18.eachField(node, function(name, child) {
|
|
46112
46112
|
var childPath = path3.get(name);
|
|
46113
46113
|
if (!pathHasValue(childPath, child)) {
|
|
46114
46114
|
throw new Error("");
|
|
@@ -46186,24 +46186,24 @@ var require_scope = __commonJS({
|
|
|
46186
46186
|
addPattern(patternPath.get("argument"), bindings);
|
|
46187
46187
|
}
|
|
46188
46188
|
}
|
|
46189
|
-
function addTypePattern(patternPath,
|
|
46189
|
+
function addTypePattern(patternPath, types19) {
|
|
46190
46190
|
var pattern = patternPath.value;
|
|
46191
46191
|
namedTypes.Pattern.assert(pattern);
|
|
46192
46192
|
if (namedTypes.Identifier.check(pattern)) {
|
|
46193
|
-
if (hasOwn.call(
|
|
46194
|
-
|
|
46193
|
+
if (hasOwn.call(types19, pattern.name)) {
|
|
46194
|
+
types19[pattern.name].push(patternPath);
|
|
46195
46195
|
} else {
|
|
46196
|
-
|
|
46196
|
+
types19[pattern.name] = [patternPath];
|
|
46197
46197
|
}
|
|
46198
46198
|
}
|
|
46199
46199
|
}
|
|
46200
|
-
function addTypeParameter(parameterPath,
|
|
46200
|
+
function addTypeParameter(parameterPath, types19) {
|
|
46201
46201
|
var parameter = parameterPath.value;
|
|
46202
46202
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
46203
|
-
if (hasOwn.call(
|
|
46204
|
-
|
|
46203
|
+
if (hasOwn.call(types19, parameter.name)) {
|
|
46204
|
+
types19[parameter.name].push(parameterPath);
|
|
46205
46205
|
} else {
|
|
46206
|
-
|
|
46206
|
+
types19[parameter.name] = [parameterPath];
|
|
46207
46207
|
}
|
|
46208
46208
|
}
|
|
46209
46209
|
Sp.lookup = function(name) {
|
|
@@ -46244,11 +46244,11 @@ var require_node_path = __commonJS({
|
|
|
46244
46244
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
46245
46245
|
var shared_1 = require_shared();
|
|
46246
46246
|
function nodePathPlugin(fork) {
|
|
46247
|
-
var
|
|
46248
|
-
var n =
|
|
46249
|
-
var b =
|
|
46250
|
-
var isNumber =
|
|
46251
|
-
var isArray =
|
|
46247
|
+
var types18 = fork.use(types_1.default);
|
|
46248
|
+
var n = types18.namedTypes;
|
|
46249
|
+
var b = types18.builders;
|
|
46250
|
+
var isNumber = types18.builtInTypes.number;
|
|
46251
|
+
var isArray = types18.builtInTypes.array;
|
|
46252
46252
|
var Path = fork.use(path_1.default);
|
|
46253
46253
|
var Scope = fork.use(scope_1.default);
|
|
46254
46254
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -46339,7 +46339,7 @@ var require_node_path = __commonJS({
|
|
|
46339
46339
|
return scope || null;
|
|
46340
46340
|
};
|
|
46341
46341
|
NPp.getValueProperty = function(name) {
|
|
46342
|
-
return
|
|
46342
|
+
return types18.getFieldValue(this.value, name);
|
|
46343
46343
|
};
|
|
46344
46344
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
46345
46345
|
var pp = this.parentPath;
|
|
@@ -46481,7 +46481,7 @@ var require_node_path = __commonJS({
|
|
|
46481
46481
|
return node.some(containsCallExpression);
|
|
46482
46482
|
}
|
|
46483
46483
|
if (n.Node.check(node)) {
|
|
46484
|
-
return
|
|
46484
|
+
return types18.someField(node, function(_name, child) {
|
|
46485
46485
|
return containsCallExpression(child);
|
|
46486
46486
|
});
|
|
46487
46487
|
}
|
|
@@ -46602,11 +46602,11 @@ var require_path_visitor = __commonJS({
|
|
|
46602
46602
|
var shared_1 = require_shared();
|
|
46603
46603
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
46604
46604
|
function pathVisitorPlugin(fork) {
|
|
46605
|
-
var
|
|
46605
|
+
var types18 = fork.use(types_1.default);
|
|
46606
46606
|
var NodePath = fork.use(node_path_1.default);
|
|
46607
|
-
var isArray =
|
|
46608
|
-
var isObject2 =
|
|
46609
|
-
var isFunction =
|
|
46607
|
+
var isArray = types18.builtInTypes.array;
|
|
46608
|
+
var isObject2 = types18.builtInTypes.object;
|
|
46609
|
+
var isFunction = types18.builtInTypes.function;
|
|
46610
46610
|
var undefined2;
|
|
46611
46611
|
var PathVisitor = function PathVisitor2() {
|
|
46612
46612
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -46626,7 +46626,7 @@ var require_path_visitor = __commonJS({
|
|
|
46626
46626
|
typeNames[methodName.slice("visit".length)] = true;
|
|
46627
46627
|
}
|
|
46628
46628
|
}
|
|
46629
|
-
var supertypeTable =
|
|
46629
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
46630
46630
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
46631
46631
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
46632
46632
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -46745,7 +46745,7 @@ var require_path_visitor = __commonJS({
|
|
|
46745
46745
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
46746
46746
|
} else if (!isObject2.check(value)) {
|
|
46747
46747
|
} else {
|
|
46748
|
-
var childNames =
|
|
46748
|
+
var childNames = types18.getFieldNames(value);
|
|
46749
46749
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
46750
46750
|
childNames.push("comments");
|
|
46751
46751
|
}
|
|
@@ -46754,7 +46754,7 @@ var require_path_visitor = __commonJS({
|
|
|
46754
46754
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
46755
46755
|
var childName = childNames[i2];
|
|
46756
46756
|
if (!hasOwn.call(value, childName)) {
|
|
46757
|
-
value[childName] =
|
|
46757
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
46758
46758
|
}
|
|
46759
46759
|
childPaths.push(path3.get(childName));
|
|
46760
46760
|
}
|
|
@@ -46897,13 +46897,13 @@ var require_equiv = __commonJS({
|
|
|
46897
46897
|
var shared_1 = require_shared();
|
|
46898
46898
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46899
46899
|
function default_1(fork) {
|
|
46900
|
-
var
|
|
46901
|
-
var getFieldNames =
|
|
46902
|
-
var getFieldValue =
|
|
46903
|
-
var isArray =
|
|
46904
|
-
var isObject2 =
|
|
46905
|
-
var isDate =
|
|
46906
|
-
var isRegExp =
|
|
46900
|
+
var types18 = fork.use(types_1.default);
|
|
46901
|
+
var getFieldNames = types18.getFieldNames;
|
|
46902
|
+
var getFieldValue = types18.getFieldValue;
|
|
46903
|
+
var isArray = types18.builtInTypes.array;
|
|
46904
|
+
var isObject2 = types18.builtInTypes.object;
|
|
46905
|
+
var isDate = types18.builtInTypes.Date;
|
|
46906
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
46907
46907
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
46908
46908
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
46909
46909
|
if (isArray.check(problemPath)) {
|
|
@@ -47056,24 +47056,24 @@ var require_fork = __commonJS({
|
|
|
47056
47056
|
var shared_1 = require_shared();
|
|
47057
47057
|
function default_1(plugins) {
|
|
47058
47058
|
var fork = createFork();
|
|
47059
|
-
var
|
|
47059
|
+
var types18 = fork.use(types_1.default);
|
|
47060
47060
|
plugins.forEach(fork.use);
|
|
47061
|
-
|
|
47061
|
+
types18.finalize();
|
|
47062
47062
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
47063
47063
|
return {
|
|
47064
|
-
Type:
|
|
47065
|
-
builtInTypes:
|
|
47066
|
-
namedTypes:
|
|
47067
|
-
builders:
|
|
47068
|
-
defineMethod:
|
|
47069
|
-
getFieldNames:
|
|
47070
|
-
getFieldValue:
|
|
47071
|
-
eachField:
|
|
47072
|
-
someField:
|
|
47073
|
-
getSupertypeNames:
|
|
47074
|
-
getBuilderName:
|
|
47064
|
+
Type: types18.Type,
|
|
47065
|
+
builtInTypes: types18.builtInTypes,
|
|
47066
|
+
namedTypes: types18.namedTypes,
|
|
47067
|
+
builders: types18.builders,
|
|
47068
|
+
defineMethod: types18.defineMethod,
|
|
47069
|
+
getFieldNames: types18.getFieldNames,
|
|
47070
|
+
getFieldValue: types18.getFieldValue,
|
|
47071
|
+
eachField: types18.eachField,
|
|
47072
|
+
someField: types18.someField,
|
|
47073
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
47074
|
+
getBuilderName: types18.getBuilderName,
|
|
47075
47075
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
47076
|
-
finalize:
|
|
47076
|
+
finalize: types18.finalize,
|
|
47077
47077
|
Path: fork.use(path_1.default),
|
|
47078
47078
|
NodePath: fork.use(node_path_1.default),
|
|
47079
47079
|
PathVisitor,
|
|
@@ -47243,8 +47243,8 @@ var require_core3 = __commonJS({
|
|
|
47243
47243
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
47244
47244
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47245
47245
|
function default_1(fork) {
|
|
47246
|
-
var
|
|
47247
|
-
var Type =
|
|
47246
|
+
var types18 = fork.use(types_1.default);
|
|
47247
|
+
var Type = types18.Type;
|
|
47248
47248
|
var def = Type.def;
|
|
47249
47249
|
var or = Type.or;
|
|
47250
47250
|
var shared = fork.use(shared_1.default);
|
|
@@ -47336,9 +47336,9 @@ var require_es6 = __commonJS({
|
|
|
47336
47336
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47337
47337
|
function default_1(fork) {
|
|
47338
47338
|
fork.use(core_1.default);
|
|
47339
|
-
var
|
|
47340
|
-
var def =
|
|
47341
|
-
var or =
|
|
47339
|
+
var types18 = fork.use(types_1.default);
|
|
47340
|
+
var def = types18.Type.def;
|
|
47341
|
+
var or = types18.Type.or;
|
|
47342
47342
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47343
47343
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
47344
47344
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -47428,8 +47428,8 @@ var require_es2017 = __commonJS({
|
|
|
47428
47428
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47429
47429
|
function default_1(fork) {
|
|
47430
47430
|
fork.use(es2016_1.default);
|
|
47431
|
-
var
|
|
47432
|
-
var def =
|
|
47431
|
+
var types18 = fork.use(types_1.default);
|
|
47432
|
+
var def = types18.Type.def;
|
|
47433
47433
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47434
47434
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
47435
47435
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -47452,9 +47452,9 @@ var require_es2018 = __commonJS({
|
|
|
47452
47452
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47453
47453
|
function default_1(fork) {
|
|
47454
47454
|
fork.use(es2017_1.default);
|
|
47455
|
-
var
|
|
47456
|
-
var def =
|
|
47457
|
-
var or =
|
|
47455
|
+
var types18 = fork.use(types_1.default);
|
|
47456
|
+
var def = types18.Type.def;
|
|
47457
|
+
var or = types18.Type.or;
|
|
47458
47458
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47459
47459
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
47460
47460
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -47485,9 +47485,9 @@ var require_es2019 = __commonJS({
|
|
|
47485
47485
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47486
47486
|
function default_1(fork) {
|
|
47487
47487
|
fork.use(es2018_1.default);
|
|
47488
|
-
var
|
|
47489
|
-
var def =
|
|
47490
|
-
var or =
|
|
47488
|
+
var types18 = fork.use(types_1.default);
|
|
47489
|
+
var def = types18.Type.def;
|
|
47490
|
+
var or = types18.Type.or;
|
|
47491
47491
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47492
47492
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
47493
47493
|
}
|
|
@@ -47511,9 +47511,9 @@ var require_es20202 = __commonJS({
|
|
|
47511
47511
|
function default_1(fork) {
|
|
47512
47512
|
fork.use(es2020_1.default);
|
|
47513
47513
|
fork.use(es2019_1.default);
|
|
47514
|
-
var
|
|
47515
|
-
var def =
|
|
47516
|
-
var or =
|
|
47514
|
+
var types18 = fork.use(types_1.default);
|
|
47515
|
+
var def = types18.Type.def;
|
|
47516
|
+
var or = types18.Type.or;
|
|
47517
47517
|
var shared = fork.use(shared_1.default);
|
|
47518
47518
|
var defaults = shared.defaults;
|
|
47519
47519
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -47563,8 +47563,8 @@ var require_es2022 = __commonJS({
|
|
|
47563
47563
|
var shared_1 = require_shared();
|
|
47564
47564
|
function default_1(fork) {
|
|
47565
47565
|
fork.use(es2021_1.default);
|
|
47566
|
-
var
|
|
47567
|
-
var def =
|
|
47566
|
+
var types18 = fork.use(types_1.default);
|
|
47567
|
+
var def = types18.Type.def;
|
|
47568
47568
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
47569
47569
|
}
|
|
47570
47570
|
exports.default = default_1;
|
|
@@ -47585,9 +47585,9 @@ var require_es_proposals = __commonJS({
|
|
|
47585
47585
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
47586
47586
|
function default_1(fork) {
|
|
47587
47587
|
fork.use(es2022_1.default);
|
|
47588
|
-
var
|
|
47589
|
-
var Type =
|
|
47590
|
-
var def =
|
|
47588
|
+
var types18 = fork.use(types_1.default);
|
|
47589
|
+
var Type = types18.Type;
|
|
47590
|
+
var def = types18.Type.def;
|
|
47591
47591
|
var or = Type.or;
|
|
47592
47592
|
var shared = fork.use(shared_1.default);
|
|
47593
47593
|
var defaults = shared.defaults;
|
|
@@ -47627,9 +47627,9 @@ var require_jsx2 = __commonJS({
|
|
|
47627
47627
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47628
47628
|
function default_1(fork) {
|
|
47629
47629
|
fork.use(es_proposals_1.default);
|
|
47630
|
-
var
|
|
47631
|
-
var def =
|
|
47632
|
-
var or =
|
|
47630
|
+
var types18 = fork.use(types_1.default);
|
|
47631
|
+
var def = types18.Type.def;
|
|
47632
|
+
var or = types18.Type.or;
|
|
47633
47633
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47634
47634
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
47635
47635
|
def("Literal"),
|
|
@@ -47687,9 +47687,9 @@ var require_type_annotations = __commonJS({
|
|
|
47687
47687
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
47688
47688
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47689
47689
|
function default_1(fork) {
|
|
47690
|
-
var
|
|
47691
|
-
var def =
|
|
47692
|
-
var or =
|
|
47690
|
+
var types18 = fork.use(types_1.default);
|
|
47691
|
+
var def = types18.Type.def;
|
|
47692
|
+
var or = types18.Type.or;
|
|
47693
47693
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47694
47694
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
47695
47695
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -47724,9 +47724,9 @@ var require_flow2 = __commonJS({
|
|
|
47724
47724
|
function default_1(fork) {
|
|
47725
47725
|
fork.use(es_proposals_1.default);
|
|
47726
47726
|
fork.use(type_annotations_1.default);
|
|
47727
|
-
var
|
|
47728
|
-
var def =
|
|
47729
|
-
var or =
|
|
47727
|
+
var types18 = fork.use(types_1.default);
|
|
47728
|
+
var def = types18.Type.def;
|
|
47729
|
+
var or = types18.Type.or;
|
|
47730
47730
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47731
47731
|
def("Flow").bases("Node");
|
|
47732
47732
|
def("FlowType").bases("Flow");
|
|
@@ -47840,10 +47840,10 @@ var require_esprima = __commonJS({
|
|
|
47840
47840
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47841
47841
|
function default_1(fork) {
|
|
47842
47842
|
fork.use(es_proposals_1.default);
|
|
47843
|
-
var
|
|
47843
|
+
var types18 = fork.use(types_1.default);
|
|
47844
47844
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47845
|
-
var def =
|
|
47846
|
-
var or =
|
|
47845
|
+
var def = types18.Type.def;
|
|
47846
|
+
var or = types18.Type.or;
|
|
47847
47847
|
def("VariableDeclaration").field("declarations", [or(
|
|
47848
47848
|
def("VariableDeclarator"),
|
|
47849
47849
|
def("Identifier")
|
|
@@ -47888,11 +47888,11 @@ var require_babel_core = __commonJS({
|
|
|
47888
47888
|
function default_1(fork) {
|
|
47889
47889
|
var _a, _b, _c, _d, _e;
|
|
47890
47890
|
fork.use(es_proposals_1.default);
|
|
47891
|
-
var
|
|
47891
|
+
var types18 = fork.use(types_1.default);
|
|
47892
47892
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47893
|
-
var def =
|
|
47894
|
-
var or =
|
|
47895
|
-
var isUndefined =
|
|
47893
|
+
var def = types18.Type.def;
|
|
47894
|
+
var or = types18.Type.or;
|
|
47895
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
47896
47896
|
def("Noop").bases("Statement").build();
|
|
47897
47897
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
47898
47898
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -47917,7 +47917,7 @@ var require_babel_core = __commonJS({
|
|
|
47917
47917
|
raw: String
|
|
47918
47918
|
},
|
|
47919
47919
|
function getDefault() {
|
|
47920
|
-
var value =
|
|
47920
|
+
var value = types18.getFieldValue(this, "value");
|
|
47921
47921
|
return {
|
|
47922
47922
|
rawValue: value,
|
|
47923
47923
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -48020,8 +48020,8 @@ var require_babel = __commonJS({
|
|
|
48020
48020
|
var flow_1 = tslib_1.__importDefault(require_flow2());
|
|
48021
48021
|
var shared_1 = require_shared();
|
|
48022
48022
|
function default_1(fork) {
|
|
48023
|
-
var
|
|
48024
|
-
var def =
|
|
48023
|
+
var types18 = fork.use(types_1.default);
|
|
48024
|
+
var def = types18.Type.def;
|
|
48025
48025
|
fork.use(babel_core_1.default);
|
|
48026
48026
|
fork.use(flow_1.default);
|
|
48027
48027
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -48047,12 +48047,12 @@ var require_typescript2 = __commonJS({
|
|
|
48047
48047
|
function default_1(fork) {
|
|
48048
48048
|
fork.use(babel_core_1.default);
|
|
48049
48049
|
fork.use(type_annotations_1.default);
|
|
48050
|
-
var
|
|
48051
|
-
var n =
|
|
48052
|
-
var def =
|
|
48053
|
-
var or =
|
|
48050
|
+
var types18 = fork.use(types_1.default);
|
|
48051
|
+
var n = types18.namedTypes;
|
|
48052
|
+
var def = types18.Type.def;
|
|
48053
|
+
var or = types18.Type.or;
|
|
48054
48054
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48055
|
-
var StringLiteral =
|
|
48055
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
48056
48056
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
48057
48057
|
return true;
|
|
48058
48058
|
}
|
|
@@ -50028,8 +50028,8 @@ var require_util2 = __commonJS({
|
|
|
50028
50028
|
exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0;
|
|
50029
50029
|
var tslib_1 = require_tslib();
|
|
50030
50030
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
50031
|
-
var
|
|
50032
|
-
var n =
|
|
50031
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
50032
|
+
var n = types18.namedTypes;
|
|
50033
50033
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
50034
50034
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
50035
50035
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -57347,10 +57347,10 @@ var require_comments = __commonJS({
|
|
|
57347
57347
|
exports.printComments = exports.attach = void 0;
|
|
57348
57348
|
var tslib_1 = require_tslib();
|
|
57349
57349
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
57350
|
-
var
|
|
57351
|
-
var n =
|
|
57352
|
-
var isArray =
|
|
57353
|
-
var isObject2 =
|
|
57350
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
57351
|
+
var n = types18.namedTypes;
|
|
57352
|
+
var isArray = types18.builtInTypes.array;
|
|
57353
|
+
var isObject2 = types18.builtInTypes.object;
|
|
57354
57354
|
var lines_1 = require_lines();
|
|
57355
57355
|
var util_1 = require_util2();
|
|
57356
57356
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -57381,7 +57381,7 @@ var require_comments = __commonJS({
|
|
|
57381
57381
|
if (isArray.check(node)) {
|
|
57382
57382
|
names = Object.keys(node);
|
|
57383
57383
|
} else if (isObject2.check(node)) {
|
|
57384
|
-
names =
|
|
57384
|
+
names = types18.getFieldNames(node);
|
|
57385
57385
|
} else {
|
|
57386
57386
|
return resultArray;
|
|
57387
57387
|
}
|
|
@@ -57559,7 +57559,7 @@ var require_comments = __commonJS({
|
|
|
57559
57559
|
function printComments(path3, print13) {
|
|
57560
57560
|
var value = path3.getValue();
|
|
57561
57561
|
var innerLines = print13(path3);
|
|
57562
|
-
var comments = n.Node.check(value) &&
|
|
57562
|
+
var comments = n.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
57563
57563
|
if (!comments || comments.length === 0) {
|
|
57564
57564
|
return innerLines;
|
|
57565
57565
|
}
|
|
@@ -57567,8 +57567,8 @@ var require_comments = __commonJS({
|
|
|
57567
57567
|
var trailingParts = [innerLines];
|
|
57568
57568
|
path3.each(function(commentPath) {
|
|
57569
57569
|
var comment = commentPath.getValue();
|
|
57570
|
-
var leading =
|
|
57571
|
-
var trailing =
|
|
57570
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
57571
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
57572
57572
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
57573
57573
|
leadingParts.push(printLeadingComment(commentPath, print13));
|
|
57574
57574
|
} else if (trailing) {
|
|
@@ -57590,10 +57590,10 @@ var require_parser = __commonJS({
|
|
|
57590
57590
|
exports.parse = void 0;
|
|
57591
57591
|
var tslib_1 = require_tslib();
|
|
57592
57592
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
57593
|
-
var
|
|
57594
|
-
var b =
|
|
57595
|
-
var isObject2 =
|
|
57596
|
-
var isArray =
|
|
57593
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
57594
|
+
var b = types18.builders;
|
|
57595
|
+
var isObject2 = types18.builtInTypes.object;
|
|
57596
|
+
var isArray = types18.builtInTypes.array;
|
|
57597
57597
|
var options_1 = require_options();
|
|
57598
57598
|
var lines_1 = require_lines();
|
|
57599
57599
|
var comments_1 = require_comments();
|
|
@@ -57779,11 +57779,11 @@ var require_fast_path = __commonJS({
|
|
|
57779
57779
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57780
57780
|
var tslib_1 = require_tslib();
|
|
57781
57781
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
57782
|
-
var
|
|
57782
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
57783
57783
|
var util = tslib_1.__importStar(require_util2());
|
|
57784
|
-
var n =
|
|
57785
|
-
var isArray =
|
|
57786
|
-
var isNumber =
|
|
57784
|
+
var n = types18.namedTypes;
|
|
57785
|
+
var isArray = types18.builtInTypes.array;
|
|
57786
|
+
var isNumber = types18.builtInTypes.number;
|
|
57787
57787
|
var PRECEDENCE = {};
|
|
57788
57788
|
[
|
|
57789
57789
|
["??"],
|
|
@@ -57812,7 +57812,7 @@ var require_fast_path = __commonJS({
|
|
|
57812
57812
|
if (obj instanceof FastPath) {
|
|
57813
57813
|
return obj.copy();
|
|
57814
57814
|
}
|
|
57815
|
-
if (obj instanceof
|
|
57815
|
+
if (obj instanceof types18.NodePath) {
|
|
57816
57816
|
var copy = Object.create(FastPath.prototype);
|
|
57817
57817
|
var stack = [obj.value];
|
|
57818
57818
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -58123,7 +58123,7 @@ var require_fast_path = __commonJS({
|
|
|
58123
58123
|
return node.some(containsCallExpression);
|
|
58124
58124
|
}
|
|
58125
58125
|
if (n.Node.check(node)) {
|
|
58126
|
-
return
|
|
58126
|
+
return types18.someField(node, function(_name, child) {
|
|
58127
58127
|
return containsCallExpression(child);
|
|
58128
58128
|
});
|
|
58129
58129
|
}
|
|
@@ -58213,16 +58213,16 @@ var require_patcher = __commonJS({
|
|
|
58213
58213
|
var tslib_1 = require_tslib();
|
|
58214
58214
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
58215
58215
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
58216
|
-
var
|
|
58217
|
-
var Printable =
|
|
58218
|
-
var Expression =
|
|
58219
|
-
var ReturnStatement =
|
|
58220
|
-
var SourceLocation =
|
|
58216
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58217
|
+
var Printable = types18.namedTypes.Printable;
|
|
58218
|
+
var Expression = types18.namedTypes.Expression;
|
|
58219
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
58220
|
+
var SourceLocation = types18.namedTypes.SourceLocation;
|
|
58221
58221
|
var util_1 = require_util2();
|
|
58222
58222
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
58223
|
-
var isObject2 =
|
|
58224
|
-
var isArray =
|
|
58225
|
-
var isString =
|
|
58223
|
+
var isObject2 = types18.builtInTypes.object;
|
|
58224
|
+
var isArray = types18.builtInTypes.array;
|
|
58225
|
+
var isString = types18.builtInTypes.string;
|
|
58226
58226
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
58227
58227
|
var Patcher = function Patcher2(lines) {
|
|
58228
58228
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -58492,8 +58492,8 @@ var require_patcher = __commonJS({
|
|
|
58492
58492
|
if (k.charAt(0) === "_") {
|
|
58493
58493
|
continue;
|
|
58494
58494
|
}
|
|
58495
|
-
newPath.stack.push(k,
|
|
58496
|
-
oldPath.stack.push(k,
|
|
58495
|
+
newPath.stack.push(k, types18.getFieldValue(newNode, k));
|
|
58496
|
+
oldPath.stack.push(k, types18.getFieldValue(oldNode, k));
|
|
58497
58497
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
58498
58498
|
newPath.stack.length -= 2;
|
|
58499
58499
|
oldPath.stack.length -= 2;
|
|
@@ -58517,16 +58517,16 @@ var require_printer = __commonJS({
|
|
|
58517
58517
|
exports.Printer = void 0;
|
|
58518
58518
|
var tslib_1 = require_tslib();
|
|
58519
58519
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
58520
|
-
var
|
|
58520
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58521
58521
|
var comments_1 = require_comments();
|
|
58522
58522
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
58523
58523
|
var lines_1 = require_lines();
|
|
58524
58524
|
var options_1 = require_options();
|
|
58525
58525
|
var patcher_1 = require_patcher();
|
|
58526
58526
|
var util = tslib_1.__importStar(require_util2());
|
|
58527
|
-
var namedTypes =
|
|
58528
|
-
var isString =
|
|
58529
|
-
var isObject2 =
|
|
58527
|
+
var namedTypes = types18.namedTypes;
|
|
58528
|
+
var isString = types18.builtInTypes.string;
|
|
58529
|
+
var isObject2 = types18.builtInTypes.object;
|
|
58530
58530
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
58531
58531
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
58532
58532
|
isString.assert(code);
|
|
@@ -58688,7 +58688,7 @@ var require_printer = __commonJS({
|
|
|
58688
58688
|
case "OptionalMemberExpression": {
|
|
58689
58689
|
parts.push(path3.call(print13, "object"));
|
|
58690
58690
|
var property = path3.call(print13, "property");
|
|
58691
|
-
var optional =
|
|
58691
|
+
var optional = types18.getFieldValue(n, "optional");
|
|
58692
58692
|
if (n.computed) {
|
|
58693
58693
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
58694
58694
|
} else {
|
|
@@ -58959,7 +58959,7 @@ var require_printer = __commonJS({
|
|
|
58959
58959
|
if (n.typeArguments) {
|
|
58960
58960
|
parts.push(path3.call(print13, "typeArguments"));
|
|
58961
58961
|
}
|
|
58962
|
-
if (
|
|
58962
|
+
if (types18.getFieldValue(n, "optional")) {
|
|
58963
58963
|
parts.push("?.");
|
|
58964
58964
|
}
|
|
58965
58965
|
parts.push(printArgumentsList(path3, options, print13));
|
|
@@ -60638,8 +60638,8 @@ var require_printer = __commonJS({
|
|
|
60638
60638
|
});
|
|
60639
60639
|
}
|
|
60640
60640
|
function getPossibleRaw(node) {
|
|
60641
|
-
var value =
|
|
60642
|
-
var extra =
|
|
60641
|
+
var value = types18.getFieldValue(node, "value");
|
|
60642
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
60643
60643
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
60644
60644
|
return extra.raw;
|
|
60645
60645
|
}
|
|
@@ -60687,8 +60687,8 @@ var require_main2 = __commonJS({
|
|
|
60687
60687
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
60688
60688
|
var tslib_1 = require_tslib();
|
|
60689
60689
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
60690
|
-
var
|
|
60691
|
-
exports.types =
|
|
60690
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
60691
|
+
exports.types = types18;
|
|
60692
60692
|
var parser_1 = require_parser();
|
|
60693
60693
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
60694
60694
|
return parser_1.parse;
|
|
@@ -62230,7 +62230,7 @@ var printDocASTReducer = {
|
|
|
62230
62230
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62231
62231
|
},
|
|
62232
62232
|
UnionTypeDefinition: {
|
|
62233
|
-
leave: ({ name, directives, types:
|
|
62233
|
+
leave: ({ name, directives, types: types18 }) => join(["union", name, join(directives, " "), wrap("= ", join(types18, " | "))], " ")
|
|
62234
62234
|
},
|
|
62235
62235
|
EnumTypeDefinition: {
|
|
62236
62236
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -62257,7 +62257,7 @@ var printDocASTReducer = {
|
|
|
62257
62257
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62258
62258
|
},
|
|
62259
62259
|
UnionTypeExtension: {
|
|
62260
|
-
leave: ({ name, directives, types:
|
|
62260
|
+
leave: ({ name, directives, types: types18 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types18, " | "))], " ")
|
|
62261
62261
|
},
|
|
62262
62262
|
EnumTypeExtension: {
|
|
62263
62263
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -63137,8 +63137,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
63137
63137
|
}
|
|
63138
63138
|
}
|
|
63139
63139
|
function healUnderlyingTypes(type) {
|
|
63140
|
-
const
|
|
63141
|
-
|
|
63140
|
+
const types18 = type.getTypes();
|
|
63141
|
+
types18.push(...types18.splice(0).map((t3) => healType(t3)).filter(Boolean));
|
|
63142
63142
|
}
|
|
63143
63143
|
function healType(type) {
|
|
63144
63144
|
if ((0, import_graphql12.isListType)(type)) {
|
|
@@ -63922,11 +63922,11 @@ function mergeEnum(e1, e2, config2) {
|
|
|
63922
63922
|
|
|
63923
63923
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
63924
63924
|
var import_graphql21 = require("graphql");
|
|
63925
|
-
function isStringTypes(
|
|
63926
|
-
return typeof
|
|
63925
|
+
function isStringTypes(types18) {
|
|
63926
|
+
return typeof types18 === "string";
|
|
63927
63927
|
}
|
|
63928
|
-
function isSourceTypes(
|
|
63929
|
-
return
|
|
63928
|
+
function isSourceTypes(types18) {
|
|
63929
|
+
return types18 instanceof import_graphql21.Source;
|
|
63930
63930
|
}
|
|
63931
63931
|
function extractType(type) {
|
|
63932
63932
|
let visitedType = type;
|
|
@@ -64623,6 +64623,11 @@ var CachePolicy = {
|
|
|
64623
64623
|
CacheAndNetwork: "CacheAndNetwork",
|
|
64624
64624
|
NoCache: "NoCache"
|
|
64625
64625
|
};
|
|
64626
|
+
var DedupeMatchMode = {
|
|
64627
|
+
Variables: "Variables",
|
|
64628
|
+
Operation: "Operation",
|
|
64629
|
+
None: "None"
|
|
64630
|
+
};
|
|
64626
64631
|
var PaginateMode = {
|
|
64627
64632
|
Infinite: "Infinite",
|
|
64628
64633
|
SinglePage: "SinglePage"
|
|
@@ -66882,7 +66887,18 @@ var ListManager = class {
|
|
|
66882
66887
|
}
|
|
66883
66888
|
lists = /* @__PURE__ */ new Map();
|
|
66884
66889
|
listsByField = /* @__PURE__ */ new Map();
|
|
66885
|
-
get(listName, id, allLists) {
|
|
66890
|
+
get(listName, id, allLists, skipMatches) {
|
|
66891
|
+
const lists = this.getLists(listName, id, allLists);
|
|
66892
|
+
if (!lists) {
|
|
66893
|
+
return null;
|
|
66894
|
+
}
|
|
66895
|
+
if (skipMatches) {
|
|
66896
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
66897
|
+
} else {
|
|
66898
|
+
return lists;
|
|
66899
|
+
}
|
|
66900
|
+
}
|
|
66901
|
+
getLists(listName, id, allLists) {
|
|
66886
66902
|
const matches = this.lists.get(listName);
|
|
66887
66903
|
if (!matches || matches.size === 0) {
|
|
66888
66904
|
return null;
|
|
@@ -67004,6 +67020,9 @@ var List = class {
|
|
|
67004
67020
|
this.manager = manager;
|
|
67005
67021
|
this.abstract = abstract;
|
|
67006
67022
|
}
|
|
67023
|
+
get fieldRef() {
|
|
67024
|
+
return `${this.recordID}.${this.key}`;
|
|
67025
|
+
}
|
|
67007
67026
|
when(when) {
|
|
67008
67027
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
67009
67028
|
}
|
|
@@ -68156,8 +68175,8 @@ var Cache = class {
|
|
|
68156
68175
|
variables
|
|
68157
68176
|
);
|
|
68158
68177
|
}
|
|
68159
|
-
list(name, parentID, allLists) {
|
|
68160
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
68178
|
+
list(name, parentID, allLists, skipMatches) {
|
|
68179
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
68161
68180
|
if (!handler) {
|
|
68162
68181
|
throw new Error(
|
|
68163
68182
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -68572,6 +68591,7 @@ var CacheInternal = class {
|
|
|
68572
68591
|
});
|
|
68573
68592
|
}
|
|
68574
68593
|
}
|
|
68594
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
68575
68595
|
for (const operation of operations || []) {
|
|
68576
68596
|
let parentID;
|
|
68577
68597
|
if (operation.parentID) {
|
|
@@ -68591,7 +68611,12 @@ var CacheInternal = class {
|
|
|
68591
68611
|
const targets = Array.isArray(value) ? value : [value];
|
|
68592
68612
|
for (const target of targets) {
|
|
68593
68613
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
68594
|
-
this.cache.list(
|
|
68614
|
+
this.cache.list(
|
|
68615
|
+
operation.list,
|
|
68616
|
+
parentID,
|
|
68617
|
+
operation.target === "all",
|
|
68618
|
+
processedOperations
|
|
68619
|
+
).when(operation.when).addToList(
|
|
68595
68620
|
fieldSelection,
|
|
68596
68621
|
target,
|
|
68597
68622
|
variables,
|
|
@@ -68599,7 +68624,12 @@ var CacheInternal = class {
|
|
|
68599
68624
|
layer
|
|
68600
68625
|
);
|
|
68601
68626
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
68602
|
-
this.cache.list(
|
|
68627
|
+
this.cache.list(
|
|
68628
|
+
operation.list,
|
|
68629
|
+
parentID,
|
|
68630
|
+
operation.target === "all",
|
|
68631
|
+
processedOperations
|
|
68632
|
+
).when(operation.when).toggleElement({
|
|
68603
68633
|
selection: fieldSelection,
|
|
68604
68634
|
data: target,
|
|
68605
68635
|
variables,
|
|
@@ -68607,7 +68637,12 @@ var CacheInternal = class {
|
|
|
68607
68637
|
layer
|
|
68608
68638
|
});
|
|
68609
68639
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
68610
|
-
this.cache.list(
|
|
68640
|
+
this.cache.list(
|
|
68641
|
+
operation.list,
|
|
68642
|
+
parentID,
|
|
68643
|
+
operation.target === "all",
|
|
68644
|
+
processedOperations
|
|
68645
|
+
).when(operation.when).remove(target, variables, layer);
|
|
68611
68646
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
68612
68647
|
const targetID = this.id(operation.type, target);
|
|
68613
68648
|
if (!targetID) {
|
|
@@ -68619,6 +68654,16 @@ var CacheInternal = class {
|
|
|
68619
68654
|
this.cache.delete(targetID, layer);
|
|
68620
68655
|
}
|
|
68621
68656
|
}
|
|
68657
|
+
if (operation.list) {
|
|
68658
|
+
const matchingLists = this.cache.list(
|
|
68659
|
+
operation.list,
|
|
68660
|
+
parentID,
|
|
68661
|
+
operation.target === "all"
|
|
68662
|
+
);
|
|
68663
|
+
for (const list of matchingLists.lists) {
|
|
68664
|
+
processedOperations.add(list.fieldRef);
|
|
68665
|
+
}
|
|
68666
|
+
}
|
|
68622
68667
|
}
|
|
68623
68668
|
}
|
|
68624
68669
|
return toNotify;
|
|
@@ -69138,8 +69183,9 @@ var Config = class {
|
|
|
69138
69183
|
localSchema;
|
|
69139
69184
|
projectRoot;
|
|
69140
69185
|
schema;
|
|
69186
|
+
runtimeDir;
|
|
69141
69187
|
schemaPath;
|
|
69142
|
-
persistedQueriesPath
|
|
69188
|
+
persistedQueriesPath;
|
|
69143
69189
|
exclude;
|
|
69144
69190
|
scalars;
|
|
69145
69191
|
module = "esm";
|
|
@@ -69180,6 +69226,7 @@ var Config = class {
|
|
|
69180
69226
|
let {
|
|
69181
69227
|
schema,
|
|
69182
69228
|
schemaPath = "./schema.graphql",
|
|
69229
|
+
runtimeDir = "$houdini",
|
|
69183
69230
|
exclude = [],
|
|
69184
69231
|
module: module2 = "esm",
|
|
69185
69232
|
scalars,
|
|
@@ -69191,7 +69238,7 @@ var Config = class {
|
|
|
69191
69238
|
defaultListTarget = null,
|
|
69192
69239
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
69193
69240
|
defaultKeys,
|
|
69194
|
-
types:
|
|
69241
|
+
types: types18 = {},
|
|
69195
69242
|
logLevel,
|
|
69196
69243
|
defaultFragmentMasking = "enable",
|
|
69197
69244
|
watchSchema,
|
|
@@ -69218,6 +69265,7 @@ var Config = class {
|
|
|
69218
69265
|
this.projectRoot = dirname(
|
|
69219
69266
|
projectDir ? join2(process.cwd(), projectDir) : filepath
|
|
69220
69267
|
);
|
|
69268
|
+
this.runtimeDir = runtimeDir;
|
|
69221
69269
|
this.scalars = scalars;
|
|
69222
69270
|
this.cacheBufferSize = cacheBufferSize;
|
|
69223
69271
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -69232,18 +69280,16 @@ var Config = class {
|
|
|
69232
69280
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
69233
69281
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
69234
69282
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
69235
|
-
this.rootDir = join2(this.projectRoot,
|
|
69283
|
+
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
69284
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
69236
69285
|
this.#fragmentVariableMaps = {};
|
|
69237
|
-
if (persistedQueriesPath) {
|
|
69238
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
69239
|
-
}
|
|
69240
69286
|
if (defaultKeys) {
|
|
69241
69287
|
this.defaultKeys = defaultKeys;
|
|
69242
69288
|
}
|
|
69243
|
-
if (
|
|
69289
|
+
if (types18) {
|
|
69244
69290
|
this.typeConfig = {
|
|
69245
69291
|
...this.typeConfig,
|
|
69246
|
-
...
|
|
69292
|
+
...types18
|
|
69247
69293
|
};
|
|
69248
69294
|
}
|
|
69249
69295
|
}
|
|
@@ -72282,14 +72328,27 @@ async function paginate(config2, documents) {
|
|
|
72282
72328
|
return {
|
|
72283
72329
|
...node,
|
|
72284
72330
|
variableDefinitions: finalVariables,
|
|
72285
|
-
directives: [
|
|
72331
|
+
directives: config2.configFile.supressPaginationDeduplication ? node.directives : [
|
|
72286
72332
|
...node.directives || [],
|
|
72287
72333
|
{
|
|
72288
72334
|
kind: graphql13.Kind.DIRECTIVE,
|
|
72289
72335
|
name: {
|
|
72290
72336
|
kind: graphql13.Kind.NAME,
|
|
72291
72337
|
value: config2.dedupeDirective
|
|
72292
|
-
}
|
|
72338
|
+
},
|
|
72339
|
+
arguments: [
|
|
72340
|
+
{
|
|
72341
|
+
kind: "Argument",
|
|
72342
|
+
name: {
|
|
72343
|
+
kind: "Name",
|
|
72344
|
+
value: "match"
|
|
72345
|
+
},
|
|
72346
|
+
value: {
|
|
72347
|
+
kind: "EnumValue",
|
|
72348
|
+
value: DedupeMatchMode.Variables
|
|
72349
|
+
}
|
|
72350
|
+
}
|
|
72351
|
+
]
|
|
72293
72352
|
}
|
|
72294
72353
|
]
|
|
72295
72354
|
};
|
|
@@ -72657,6 +72716,46 @@ function objectNode([type, defaultValue]) {
|
|
|
72657
72716
|
return node;
|
|
72658
72717
|
}
|
|
72659
72718
|
var pageInfoSelection = [
|
|
72719
|
+
{
|
|
72720
|
+
kind: graphql13.Kind.FIELD,
|
|
72721
|
+
name: {
|
|
72722
|
+
kind: graphql13.Kind.NAME,
|
|
72723
|
+
value: "pageInfo"
|
|
72724
|
+
},
|
|
72725
|
+
selectionSet: {
|
|
72726
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
72727
|
+
selections: [
|
|
72728
|
+
{
|
|
72729
|
+
kind: graphql13.Kind.FIELD,
|
|
72730
|
+
name: {
|
|
72731
|
+
kind: graphql13.Kind.NAME,
|
|
72732
|
+
value: "hasPreviousPage"
|
|
72733
|
+
}
|
|
72734
|
+
},
|
|
72735
|
+
{
|
|
72736
|
+
kind: graphql13.Kind.FIELD,
|
|
72737
|
+
name: {
|
|
72738
|
+
kind: graphql13.Kind.NAME,
|
|
72739
|
+
value: "hasNextPage"
|
|
72740
|
+
}
|
|
72741
|
+
},
|
|
72742
|
+
{
|
|
72743
|
+
kind: graphql13.Kind.FIELD,
|
|
72744
|
+
name: {
|
|
72745
|
+
kind: graphql13.Kind.NAME,
|
|
72746
|
+
value: "startCursor"
|
|
72747
|
+
}
|
|
72748
|
+
},
|
|
72749
|
+
{
|
|
72750
|
+
kind: graphql13.Kind.FIELD,
|
|
72751
|
+
name: {
|
|
72752
|
+
kind: graphql13.Kind.NAME,
|
|
72753
|
+
value: "endCursor"
|
|
72754
|
+
}
|
|
72755
|
+
}
|
|
72756
|
+
]
|
|
72757
|
+
}
|
|
72758
|
+
},
|
|
72660
72759
|
{
|
|
72661
72760
|
kind: graphql13.Kind.FIELD,
|
|
72662
72761
|
name: {
|
|
@@ -73646,7 +73745,13 @@ function artifactGenerator(stats) {
|
|
|
73646
73745
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
73647
73746
|
(arg) => arg.name.value === "cancelFirst"
|
|
73648
73747
|
);
|
|
73649
|
-
|
|
73748
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
73749
|
+
(arg) => arg.name.value === "match"
|
|
73750
|
+
);
|
|
73751
|
+
dedupe = {
|
|
73752
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
73753
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
73754
|
+
};
|
|
73650
73755
|
}
|
|
73651
73756
|
selectionSet = operation.selectionSet;
|
|
73652
73757
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -75107,18 +75212,18 @@ async function imperativeCacheTypef(config2, docs) {
|
|
|
75107
75212
|
function typeDefinitions(config2, filepath, body, docs, returnType) {
|
|
75108
75213
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
75109
75214
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
75110
|
-
const
|
|
75215
|
+
const types18 = Object.values(config2.schema.getTypeMap()).filter(
|
|
75111
75216
|
(type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
75112
75217
|
);
|
|
75113
75218
|
const fragmentMap = fragmentListMap(
|
|
75114
75219
|
config2,
|
|
75115
|
-
|
|
75220
|
+
types18.map((type) => type.name),
|
|
75116
75221
|
body,
|
|
75117
75222
|
docs,
|
|
75118
75223
|
returnType
|
|
75119
75224
|
);
|
|
75120
75225
|
return AST12.tsTypeLiteral(
|
|
75121
|
-
|
|
75226
|
+
types18.map((type) => {
|
|
75122
75227
|
let typeName = type.name;
|
|
75123
75228
|
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
75124
75229
|
typeName = "__ROOT__";
|
|
@@ -76526,7 +76631,7 @@ var printDocASTReducer2 = {
|
|
|
76526
76631
|
], " ")
|
|
76527
76632
|
},
|
|
76528
76633
|
UnionTypeDefinition: {
|
|
76529
|
-
leave: ({ name, directives, types:
|
|
76634
|
+
leave: ({ name, directives, types: types18 }) => join3(["union", name, join3(directives, " "), wrap2("= ", join3(types18, " | "))], " ")
|
|
76530
76635
|
},
|
|
76531
76636
|
EnumTypeDefinition: {
|
|
76532
76637
|
leave: ({ name, directives, values }) => join3(["enum", name, join3(directives, " "), block2(values)], " ")
|
|
@@ -76565,7 +76670,7 @@ var printDocASTReducer2 = {
|
|
|
76565
76670
|
], " ")
|
|
76566
76671
|
},
|
|
76567
76672
|
UnionTypeExtension: {
|
|
76568
|
-
leave: ({ name, directives, types:
|
|
76673
|
+
leave: ({ name, directives, types: types18 }) => join3(["extend union", name, join3(directives, " "), wrap2("= ", join3(types18, " | "))], " ")
|
|
76569
76674
|
},
|
|
76570
76675
|
EnumTypeExtension: {
|
|
76571
76676
|
leave: ({ name, directives, values }) => join3(["extend enum", name, join3(directives, " "), block2(values)], " ")
|
|
@@ -76829,11 +76934,11 @@ function mergeEnum2(e1, e2, config2, directives) {
|
|
|
76829
76934
|
|
|
76830
76935
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
76831
76936
|
var import_graphql43 = require("graphql");
|
|
76832
|
-
function isStringTypes2(
|
|
76833
|
-
return typeof
|
|
76937
|
+
function isStringTypes2(types18) {
|
|
76938
|
+
return typeof types18 === "string";
|
|
76834
76939
|
}
|
|
76835
|
-
function isSourceTypes2(
|
|
76836
|
-
return
|
|
76940
|
+
function isSourceTypes2(types18) {
|
|
76941
|
+
return types18 instanceof import_graphql43.Source;
|
|
76837
76942
|
}
|
|
76838
76943
|
function extractType2(type) {
|
|
76839
76944
|
let visitedType = type;
|
|
@@ -77313,11 +77418,20 @@ directive @${config2.paginateDirective}(${config2.listOrPaginateNameArg}: String
|
|
|
77313
77418
|
"""
|
|
77314
77419
|
directive @${config2.listPrependDirective} on FRAGMENT_SPREAD
|
|
77315
77420
|
|
|
77421
|
+
enum DedupeMatchMode {
|
|
77422
|
+
${DedupeMatchMode.Variables}
|
|
77423
|
+
${DedupeMatchMode.Operation}
|
|
77424
|
+
${DedupeMatchMode.None}
|
|
77425
|
+
}
|
|
77426
|
+
|
|
77316
77427
|
"""
|
|
77317
77428
|
@${config2.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
77318
77429
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
77430
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
77431
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
77432
|
+
then the request will never be deduplicated.
|
|
77319
77433
|
"""
|
|
77320
|
-
directive @${config2.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
77434
|
+
directive @${config2.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
77321
77435
|
|
|
77322
77436
|
"""
|
|
77323
77437
|
@${config2.optimisticKeyDirective} is used to identify a field as an optimistic key
|
|
@@ -79326,6 +79440,8 @@ function watch_local_schema(ref) {
|
|
|
79326
79440
|
}
|
|
79327
79441
|
|
|
79328
79442
|
// src/vite/ast.ts
|
|
79443
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
79444
|
+
var AST14 = recast14.types.builders;
|
|
79329
79445
|
function find_insert_index(script) {
|
|
79330
79446
|
let insert_index = script.body.findIndex((statement) => {
|
|
79331
79447
|
return statement.type !== "ImportDeclaration";
|
|
@@ -79344,7 +79460,7 @@ function find_exported_fn(body, name) {
|
|
|
79344
79460
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
79345
79461
|
const value = exportDeclaration.declaration;
|
|
79346
79462
|
if (value.id?.name === name) {
|
|
79347
|
-
return exportDeclaration.declaration;
|
|
79463
|
+
return { declaration: exportDeclaration.declaration, export: exportDeclaration };
|
|
79348
79464
|
}
|
|
79349
79465
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
79350
79466
|
const value = exportDeclaration.declaration;
|
|
@@ -79363,7 +79479,10 @@ function find_exported_fn(body, name) {
|
|
|
79363
79479
|
init = init.arguments[0];
|
|
79364
79480
|
}
|
|
79365
79481
|
if (init.type === "FunctionExpression" || init.type === "ArrowFunctionExpression") {
|
|
79366
|
-
return init;
|
|
79482
|
+
return { declaration: init, export: exportDeclaration };
|
|
79483
|
+
}
|
|
79484
|
+
if (init.type === "Identifier" || init.type === "CallExpression") {
|
|
79485
|
+
return { declaration: init, export: exportDeclaration };
|
|
79367
79486
|
}
|
|
79368
79487
|
} else {
|
|
79369
79488
|
continue;
|
|
@@ -79375,7 +79494,7 @@ function find_exported_fn(body, name) {
|
|
|
79375
79494
|
if (!exported) {
|
|
79376
79495
|
return null;
|
|
79377
79496
|
}
|
|
79378
|
-
return exported.declaration;
|
|
79497
|
+
return { declaration: exported.declaration, export: exported };
|
|
79379
79498
|
}
|
|
79380
79499
|
function find_exported_id(program, name) {
|
|
79381
79500
|
return program.body.find(
|
|
@@ -79384,8 +79503,8 @@ function find_exported_id(program, name) {
|
|
|
79384
79503
|
}
|
|
79385
79504
|
|
|
79386
79505
|
// src/vite/imports.ts
|
|
79387
|
-
var
|
|
79388
|
-
var
|
|
79506
|
+
var recast15 = __toESM(require_main2(), 1);
|
|
79507
|
+
var AST15 = recast15.types.builders;
|
|
79389
79508
|
function ensure_imports({
|
|
79390
79509
|
config: config2,
|
|
79391
79510
|
script,
|
|
@@ -79401,13 +79520,13 @@ function ensure_imports({
|
|
|
79401
79520
|
if (!has_import) {
|
|
79402
79521
|
script.body.unshift({
|
|
79403
79522
|
type: "ImportDeclaration",
|
|
79404
|
-
source:
|
|
79523
|
+
source: AST15.stringLiteral(sourceModule),
|
|
79405
79524
|
importKind
|
|
79406
79525
|
});
|
|
79407
79526
|
}
|
|
79408
79527
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
79409
79528
|
}
|
|
79410
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id) =>
|
|
79529
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id) => AST15.identifier(id));
|
|
79411
79530
|
const toImport = idList.filter(
|
|
79412
79531
|
(identifier) => !script.body.find(
|
|
79413
79532
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -79418,16 +79537,16 @@ function ensure_imports({
|
|
|
79418
79537
|
if (toImport.length > 0) {
|
|
79419
79538
|
script.body.unshift({
|
|
79420
79539
|
type: "ImportDeclaration",
|
|
79421
|
-
source:
|
|
79540
|
+
source: AST15.stringLiteral(sourceModule),
|
|
79422
79541
|
specifiers: toImport.map(
|
|
79423
|
-
(identifier, i2) => !Array.isArray(importID) ?
|
|
79542
|
+
(identifier, i2) => !Array.isArray(importID) ? AST15.importDefaultSpecifier(identifier) : AST15.importSpecifier(identifier, as?.[i2] ? AST15.identifier(as[i2]) : identifier)
|
|
79424
79543
|
),
|
|
79425
79544
|
importKind
|
|
79426
79545
|
});
|
|
79427
79546
|
}
|
|
79428
79547
|
for (const [i2, target] of (as ?? []).entries()) {
|
|
79429
79548
|
if (target) {
|
|
79430
|
-
idList[i2] =
|
|
79549
|
+
idList[i2] = AST15.identifier(target);
|
|
79431
79550
|
}
|
|
79432
79551
|
}
|
|
79433
79552
|
return {
|