houdini 1.2.44 → 1.2.45
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 +651 -844
- package/build/cmd-esm/index.js +501 -694
- package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
- package/build/codegen-cjs/index.js +649 -842
- package/build/codegen-esm/index.js +499 -692
- package/build/lib/graphql.d.ts +1 -1
- package/build/lib/index.d.ts +1 -0
- package/build/lib/typescript.d.ts +19 -0
- package/build/lib-cjs/index.js +667 -464
- package/build/lib-esm/index.js +661 -464
- package/build/runtime/client/index.d.ts +7 -1
- package/build/runtime/client/plugins/fragment.d.ts +2 -2
- package/build/runtime/client/plugins/mutation.d.ts +2 -1
- package/build/runtime/client/plugins/query.d.ts +2 -2
- package/build/runtime/lib/scalars.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +13 -2
- package/build/runtime/router/types.d.ts +3 -1
- package/build/runtime-cjs/client/index.d.ts +7 -1
- package/build/runtime-cjs/client/index.js +26 -11
- package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/fragment.js +4 -11
- package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-cjs/client/plugins/mutation.js +8 -15
- package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/query.js +4 -11
- package/build/runtime-cjs/lib/scalars.d.ts +1 -1
- package/build/runtime-cjs/lib/scalars.js +4 -0
- package/build/runtime-cjs/lib/types.d.ts +13 -2
- package/build/runtime-cjs/router/types.d.ts +3 -1
- package/build/runtime-esm/client/index.d.ts +7 -1
- package/build/runtime-esm/client/index.js +26 -11
- package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-esm/client/plugins/fragment.js +1 -2
- package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-esm/client/plugins/mutation.js +1 -2
- package/build/runtime-esm/client/plugins/query.d.ts +2 -2
- package/build/runtime-esm/client/plugins/query.js +1 -2
- package/build/runtime-esm/lib/scalars.d.ts +1 -1
- package/build/runtime-esm/lib/scalars.js +6 -0
- package/build/runtime-esm/lib/types.d.ts +13 -2
- package/build/runtime-esm/router/types.d.ts +3 -1
- package/build/test-cjs/index.js +664 -840
- package/build/test-esm/index.js +514 -690
- package/build/vite-cjs/index.js +761 -852
- package/build/vite-esm/index.js +611 -702
- package/package.json +1 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
- package/build/codegen/generators/typescript/types.d.ts +0 -10
package/build/lib-esm/index.js
CHANGED
|
@@ -13566,14 +13566,14 @@ var require_lib3 = __commonJS({
|
|
|
13566
13566
|
this.preserveSpace = !!preserveSpace;
|
|
13567
13567
|
}
|
|
13568
13568
|
};
|
|
13569
|
-
var
|
|
13569
|
+
var types5 = {
|
|
13570
13570
|
brace: new TokContext("{"),
|
|
13571
13571
|
j_oTag: new TokContext("<tag"),
|
|
13572
13572
|
j_cTag: new TokContext("</tag"),
|
|
13573
13573
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
13574
13574
|
};
|
|
13575
13575
|
{
|
|
13576
|
-
|
|
13576
|
+
types5.template = new TokContext("`", true);
|
|
13577
13577
|
}
|
|
13578
13578
|
var beforeExpr = true;
|
|
13579
13579
|
var startsExpr = true;
|
|
@@ -14111,17 +14111,17 @@ var require_lib3 = __commonJS({
|
|
|
14111
14111
|
context.pop();
|
|
14112
14112
|
};
|
|
14113
14113
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
14114
|
-
context.push(
|
|
14114
|
+
context.push(types5.brace);
|
|
14115
14115
|
};
|
|
14116
14116
|
tokenTypes[22].updateContext = (context) => {
|
|
14117
|
-
if (context[context.length - 1] ===
|
|
14117
|
+
if (context[context.length - 1] === types5.template) {
|
|
14118
14118
|
context.pop();
|
|
14119
14119
|
} else {
|
|
14120
|
-
context.push(
|
|
14120
|
+
context.push(types5.template);
|
|
14121
14121
|
}
|
|
14122
14122
|
};
|
|
14123
14123
|
tokenTypes[142].updateContext = (context) => {
|
|
14124
|
-
context.push(
|
|
14124
|
+
context.push(types5.j_expr, types5.j_oTag);
|
|
14125
14125
|
};
|
|
14126
14126
|
}
|
|
14127
14127
|
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";
|
|
@@ -14681,7 +14681,7 @@ var require_lib3 = __commonJS({
|
|
|
14681
14681
|
this.end = 0;
|
|
14682
14682
|
this.lastTokEndLoc = null;
|
|
14683
14683
|
this.lastTokStartLoc = null;
|
|
14684
|
-
this.context = [
|
|
14684
|
+
this.context = [types5.brace];
|
|
14685
14685
|
this.firstInvalidTemplateEscapePos = null;
|
|
14686
14686
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
14687
14687
|
this.tokensLength = 0;
|
|
@@ -18508,7 +18508,7 @@ var require_lib3 = __commonJS({
|
|
|
18508
18508
|
context
|
|
18509
18509
|
} = this.state;
|
|
18510
18510
|
const currentContext = context[context.length - 1];
|
|
18511
|
-
if (currentContext ===
|
|
18511
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
18512
18512
|
context.pop();
|
|
18513
18513
|
}
|
|
18514
18514
|
}
|
|
@@ -19530,9 +19530,9 @@ var require_lib3 = __commonJS({
|
|
|
19530
19530
|
switch (this.state.type) {
|
|
19531
19531
|
case 5:
|
|
19532
19532
|
node = this.startNode();
|
|
19533
|
-
this.setContext(
|
|
19533
|
+
this.setContext(types5.brace);
|
|
19534
19534
|
this.next();
|
|
19535
|
-
node = this.jsxParseExpressionContainer(node,
|
|
19535
|
+
node = this.jsxParseExpressionContainer(node, types5.j_oTag);
|
|
19536
19536
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
19537
19537
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
19538
19538
|
}
|
|
@@ -19551,7 +19551,7 @@ var require_lib3 = __commonJS({
|
|
|
19551
19551
|
jsxParseSpreadChild(node) {
|
|
19552
19552
|
this.next();
|
|
19553
19553
|
node.expression = this.parseExpression();
|
|
19554
|
-
this.setContext(
|
|
19554
|
+
this.setContext(types5.j_expr);
|
|
19555
19555
|
this.state.canStartJSXElement = true;
|
|
19556
19556
|
this.expect(8);
|
|
19557
19557
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -19571,11 +19571,11 @@ var require_lib3 = __commonJS({
|
|
|
19571
19571
|
jsxParseAttribute() {
|
|
19572
19572
|
const node = this.startNode();
|
|
19573
19573
|
if (this.match(5)) {
|
|
19574
|
-
this.setContext(
|
|
19574
|
+
this.setContext(types5.brace);
|
|
19575
19575
|
this.next();
|
|
19576
19576
|
this.expect(21);
|
|
19577
19577
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
19578
|
-
this.setContext(
|
|
19578
|
+
this.setContext(types5.j_oTag);
|
|
19579
19579
|
this.state.canStartJSXElement = true;
|
|
19580
19580
|
this.expect(8);
|
|
19581
19581
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -19634,12 +19634,12 @@ var require_lib3 = __commonJS({
|
|
|
19634
19634
|
break;
|
|
19635
19635
|
case 5: {
|
|
19636
19636
|
const node2 = this.startNode();
|
|
19637
|
-
this.setContext(
|
|
19637
|
+
this.setContext(types5.brace);
|
|
19638
19638
|
this.next();
|
|
19639
19639
|
if (this.match(21)) {
|
|
19640
19640
|
children.push(this.jsxParseSpreadChild(node2));
|
|
19641
19641
|
} else {
|
|
19642
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
19642
|
+
children.push(this.jsxParseExpressionContainer(node2, types5.j_expr));
|
|
19643
19643
|
}
|
|
19644
19644
|
break;
|
|
19645
19645
|
}
|
|
@@ -19704,11 +19704,11 @@ var require_lib3 = __commonJS({
|
|
|
19704
19704
|
}
|
|
19705
19705
|
getTokenFromCode(code2) {
|
|
19706
19706
|
const context = this.curContext();
|
|
19707
|
-
if (context ===
|
|
19707
|
+
if (context === types5.j_expr) {
|
|
19708
19708
|
this.jsxReadToken();
|
|
19709
19709
|
return;
|
|
19710
19710
|
}
|
|
19711
|
-
if (context ===
|
|
19711
|
+
if (context === types5.j_oTag || context === types5.j_cTag) {
|
|
19712
19712
|
if (isIdentifierStart(code2)) {
|
|
19713
19713
|
this.jsxReadWord();
|
|
19714
19714
|
return;
|
|
@@ -19718,7 +19718,7 @@ var require_lib3 = __commonJS({
|
|
|
19718
19718
|
this.finishToken(143);
|
|
19719
19719
|
return;
|
|
19720
19720
|
}
|
|
19721
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
19721
|
+
if ((code2 === 34 || code2 === 39) && context === types5.j_oTag) {
|
|
19722
19722
|
this.jsxReadString(code2);
|
|
19723
19723
|
return;
|
|
19724
19724
|
}
|
|
@@ -19736,17 +19736,17 @@ var require_lib3 = __commonJS({
|
|
|
19736
19736
|
type
|
|
19737
19737
|
} = this.state;
|
|
19738
19738
|
if (type === 56 && prevType === 142) {
|
|
19739
|
-
context.splice(-2, 2,
|
|
19739
|
+
context.splice(-2, 2, types5.j_cTag);
|
|
19740
19740
|
this.state.canStartJSXElement = false;
|
|
19741
19741
|
} else if (type === 142) {
|
|
19742
|
-
context.push(
|
|
19742
|
+
context.push(types5.j_oTag);
|
|
19743
19743
|
} else if (type === 143) {
|
|
19744
19744
|
const out = context[context.length - 1];
|
|
19745
|
-
if (out ===
|
|
19745
|
+
if (out === types5.j_oTag && prevType === 56 || out === types5.j_cTag) {
|
|
19746
19746
|
context.pop();
|
|
19747
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
19747
|
+
this.state.canStartJSXElement = context[context.length - 1] === types5.j_expr;
|
|
19748
19748
|
} else {
|
|
19749
|
-
this.setContext(
|
|
19749
|
+
this.setContext(types5.j_expr);
|
|
19750
19750
|
this.state.canStartJSXElement = true;
|
|
19751
19751
|
}
|
|
19752
19752
|
} else {
|
|
@@ -21121,14 +21121,14 @@ var require_lib3 = __commonJS({
|
|
|
21121
21121
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
21122
21122
|
const node = this.startNode();
|
|
21123
21123
|
const hasLeadingOperator = this.eat(operator);
|
|
21124
|
-
const
|
|
21124
|
+
const types6 = [];
|
|
21125
21125
|
do {
|
|
21126
|
-
|
|
21126
|
+
types6.push(parseConstituentType());
|
|
21127
21127
|
} while (this.eat(operator));
|
|
21128
|
-
if (
|
|
21129
|
-
return
|
|
21128
|
+
if (types6.length === 1 && !hasLeadingOperator) {
|
|
21129
|
+
return types6[0];
|
|
21130
21130
|
}
|
|
21131
|
-
node.types =
|
|
21131
|
+
node.types = types6;
|
|
21132
21132
|
return this.finishNode(node, kind);
|
|
21133
21133
|
}
|
|
21134
21134
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -21692,7 +21692,7 @@ var require_lib3 = __commonJS({
|
|
|
21692
21692
|
}));
|
|
21693
21693
|
if (node.params.length === 0) {
|
|
21694
21694
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
21695
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
21695
|
+
} else if (!this.state.inType && this.curContext() === types5.brace) {
|
|
21696
21696
|
this.reScan_lt_gt();
|
|
21697
21697
|
}
|
|
21698
21698
|
this.expect(48);
|
|
@@ -22318,7 +22318,7 @@ var require_lib3 = __commonJS({
|
|
|
22318
22318
|
context
|
|
22319
22319
|
} = this.state;
|
|
22320
22320
|
const currentContext = context[context.length - 1];
|
|
22321
|
-
if (currentContext ===
|
|
22321
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
22322
22322
|
context.pop();
|
|
22323
22323
|
}
|
|
22324
22324
|
}
|
|
@@ -27450,9 +27450,9 @@ var require_shared = __commonJS({
|
|
|
27450
27450
|
var tslib_1 = require_tslib();
|
|
27451
27451
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
27452
27452
|
function default_1(fork) {
|
|
27453
|
-
var
|
|
27454
|
-
var Type =
|
|
27455
|
-
var builtin =
|
|
27453
|
+
var types5 = fork.use(types_1.default);
|
|
27454
|
+
var Type = types5.Type;
|
|
27455
|
+
var builtin = types5.builtInTypes;
|
|
27456
27456
|
var isNumber = builtin.number;
|
|
27457
27457
|
function geq(than) {
|
|
27458
27458
|
return Type.from(function(value) {
|
|
@@ -27602,9 +27602,9 @@ var require_types = __commonJS({
|
|
|
27602
27602
|
}(BaseType);
|
|
27603
27603
|
var OrType = function(_super) {
|
|
27604
27604
|
tslib_1.__extends(OrType2, _super);
|
|
27605
|
-
function OrType2(
|
|
27605
|
+
function OrType2(types5) {
|
|
27606
27606
|
var _this = _super.call(this) || this;
|
|
27607
|
-
_this.types =
|
|
27607
|
+
_this.types = types5;
|
|
27608
27608
|
_this.kind = "OrType";
|
|
27609
27609
|
return _this;
|
|
27610
27610
|
}
|
|
@@ -27745,11 +27745,11 @@ var require_types = __commonJS({
|
|
|
27745
27745
|
function typesPlugin(_fork) {
|
|
27746
27746
|
var Type = {
|
|
27747
27747
|
or: function() {
|
|
27748
|
-
var
|
|
27748
|
+
var types5 = [];
|
|
27749
27749
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27750
|
-
|
|
27750
|
+
types5[_i] = arguments[_i];
|
|
27751
27751
|
}
|
|
27752
|
-
return new OrType(
|
|
27752
|
+
return new OrType(types5.map(function(type) {
|
|
27753
27753
|
return Type.from(type);
|
|
27754
27754
|
}));
|
|
27755
27755
|
},
|
|
@@ -28194,9 +28194,9 @@ var require_path2 = __commonJS({
|
|
|
28194
28194
|
var Op = Object.prototype;
|
|
28195
28195
|
var hasOwn = Op.hasOwnProperty;
|
|
28196
28196
|
function pathPlugin(fork) {
|
|
28197
|
-
var
|
|
28198
|
-
var isArray =
|
|
28199
|
-
var isNumber =
|
|
28197
|
+
var types5 = fork.use(types_1.default);
|
|
28198
|
+
var isArray = types5.builtInTypes.array;
|
|
28199
|
+
var isNumber = types5.builtInTypes.number;
|
|
28200
28200
|
var Path = function Path2(value, parentPath, name) {
|
|
28201
28201
|
if (!(this instanceof Path2)) {
|
|
28202
28202
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -28498,13 +28498,13 @@ var require_scope = __commonJS({
|
|
|
28498
28498
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
28499
28499
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
28500
28500
|
function scopePlugin(fork) {
|
|
28501
|
-
var
|
|
28502
|
-
var Type =
|
|
28503
|
-
var namedTypes =
|
|
28501
|
+
var types5 = fork.use(types_1.default);
|
|
28502
|
+
var Type = types5.Type;
|
|
28503
|
+
var namedTypes = types5.namedTypes;
|
|
28504
28504
|
var Node = namedTypes.Node;
|
|
28505
28505
|
var Expression = namedTypes.Expression;
|
|
28506
|
-
var isArray =
|
|
28507
|
-
var b =
|
|
28506
|
+
var isArray = types5.builtInTypes.array;
|
|
28507
|
+
var b = types5.builders;
|
|
28508
28508
|
var Scope = function Scope2(path3, parentScope) {
|
|
28509
28509
|
if (!(this instanceof Scope2)) {
|
|
28510
28510
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -28567,7 +28567,7 @@ var require_scope = __commonJS({
|
|
|
28567
28567
|
++index;
|
|
28568
28568
|
}
|
|
28569
28569
|
var name = prefix + index;
|
|
28570
|
-
return this.bindings[name] =
|
|
28570
|
+
return this.bindings[name] = types5.builders.identifier(name);
|
|
28571
28571
|
};
|
|
28572
28572
|
Sp.injectTemporary = function(identifier, init) {
|
|
28573
28573
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -28643,7 +28643,7 @@ var require_scope = __commonJS({
|
|
|
28643
28643
|
bindings
|
|
28644
28644
|
);
|
|
28645
28645
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
28646
|
-
|
|
28646
|
+
types5.eachField(node, function(name, child) {
|
|
28647
28647
|
var childPath = path3.get(name);
|
|
28648
28648
|
if (!pathHasValue(childPath, child)) {
|
|
28649
28649
|
throw new Error("");
|
|
@@ -28721,24 +28721,24 @@ var require_scope = __commonJS({
|
|
|
28721
28721
|
addPattern(patternPath.get("argument"), bindings);
|
|
28722
28722
|
}
|
|
28723
28723
|
}
|
|
28724
|
-
function addTypePattern(patternPath,
|
|
28724
|
+
function addTypePattern(patternPath, types6) {
|
|
28725
28725
|
var pattern = patternPath.value;
|
|
28726
28726
|
namedTypes.Pattern.assert(pattern);
|
|
28727
28727
|
if (namedTypes.Identifier.check(pattern)) {
|
|
28728
|
-
if (hasOwn.call(
|
|
28729
|
-
|
|
28728
|
+
if (hasOwn.call(types6, pattern.name)) {
|
|
28729
|
+
types6[pattern.name].push(patternPath);
|
|
28730
28730
|
} else {
|
|
28731
|
-
|
|
28731
|
+
types6[pattern.name] = [patternPath];
|
|
28732
28732
|
}
|
|
28733
28733
|
}
|
|
28734
28734
|
}
|
|
28735
|
-
function addTypeParameter(parameterPath,
|
|
28735
|
+
function addTypeParameter(parameterPath, types6) {
|
|
28736
28736
|
var parameter = parameterPath.value;
|
|
28737
28737
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
28738
|
-
if (hasOwn.call(
|
|
28739
|
-
|
|
28738
|
+
if (hasOwn.call(types6, parameter.name)) {
|
|
28739
|
+
types6[parameter.name].push(parameterPath);
|
|
28740
28740
|
} else {
|
|
28741
|
-
|
|
28741
|
+
types6[parameter.name] = [parameterPath];
|
|
28742
28742
|
}
|
|
28743
28743
|
}
|
|
28744
28744
|
Sp.lookup = function(name) {
|
|
@@ -28779,11 +28779,11 @@ var require_node_path = __commonJS({
|
|
|
28779
28779
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
28780
28780
|
var shared_1 = require_shared();
|
|
28781
28781
|
function nodePathPlugin(fork) {
|
|
28782
|
-
var
|
|
28783
|
-
var n =
|
|
28784
|
-
var b =
|
|
28785
|
-
var isNumber =
|
|
28786
|
-
var isArray =
|
|
28782
|
+
var types5 = fork.use(types_1.default);
|
|
28783
|
+
var n = types5.namedTypes;
|
|
28784
|
+
var b = types5.builders;
|
|
28785
|
+
var isNumber = types5.builtInTypes.number;
|
|
28786
|
+
var isArray = types5.builtInTypes.array;
|
|
28787
28787
|
var Path = fork.use(path_1.default);
|
|
28788
28788
|
var Scope = fork.use(scope_1.default);
|
|
28789
28789
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -28874,7 +28874,7 @@ var require_node_path = __commonJS({
|
|
|
28874
28874
|
return scope || null;
|
|
28875
28875
|
};
|
|
28876
28876
|
NPp.getValueProperty = function(name) {
|
|
28877
|
-
return
|
|
28877
|
+
return types5.getFieldValue(this.value, name);
|
|
28878
28878
|
};
|
|
28879
28879
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
28880
28880
|
var pp = this.parentPath;
|
|
@@ -29016,7 +29016,7 @@ var require_node_path = __commonJS({
|
|
|
29016
29016
|
return node.some(containsCallExpression);
|
|
29017
29017
|
}
|
|
29018
29018
|
if (n.Node.check(node)) {
|
|
29019
|
-
return
|
|
29019
|
+
return types5.someField(node, function(_name, child) {
|
|
29020
29020
|
return containsCallExpression(child);
|
|
29021
29021
|
});
|
|
29022
29022
|
}
|
|
@@ -29137,11 +29137,11 @@ var require_path_visitor = __commonJS({
|
|
|
29137
29137
|
var shared_1 = require_shared();
|
|
29138
29138
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
29139
29139
|
function pathVisitorPlugin(fork) {
|
|
29140
|
-
var
|
|
29140
|
+
var types5 = fork.use(types_1.default);
|
|
29141
29141
|
var NodePath = fork.use(node_path_1.default);
|
|
29142
|
-
var isArray =
|
|
29143
|
-
var isObject2 =
|
|
29144
|
-
var isFunction =
|
|
29142
|
+
var isArray = types5.builtInTypes.array;
|
|
29143
|
+
var isObject2 = types5.builtInTypes.object;
|
|
29144
|
+
var isFunction = types5.builtInTypes.function;
|
|
29145
29145
|
var undefined2;
|
|
29146
29146
|
var PathVisitor = function PathVisitor2() {
|
|
29147
29147
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -29161,7 +29161,7 @@ var require_path_visitor = __commonJS({
|
|
|
29161
29161
|
typeNames[methodName.slice("visit".length)] = true;
|
|
29162
29162
|
}
|
|
29163
29163
|
}
|
|
29164
|
-
var supertypeTable =
|
|
29164
|
+
var supertypeTable = types5.computeSupertypeLookupTable(typeNames);
|
|
29165
29165
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
29166
29166
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
29167
29167
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -29280,7 +29280,7 @@ var require_path_visitor = __commonJS({
|
|
|
29280
29280
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
29281
29281
|
} else if (!isObject2.check(value)) {
|
|
29282
29282
|
} else {
|
|
29283
|
-
var childNames =
|
|
29283
|
+
var childNames = types5.getFieldNames(value);
|
|
29284
29284
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
29285
29285
|
childNames.push("comments");
|
|
29286
29286
|
}
|
|
@@ -29289,7 +29289,7 @@ var require_path_visitor = __commonJS({
|
|
|
29289
29289
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
29290
29290
|
var childName = childNames[i2];
|
|
29291
29291
|
if (!hasOwn.call(value, childName)) {
|
|
29292
|
-
value[childName] =
|
|
29292
|
+
value[childName] = types5.getFieldValue(value, childName);
|
|
29293
29293
|
}
|
|
29294
29294
|
childPaths.push(path3.get(childName));
|
|
29295
29295
|
}
|
|
@@ -29432,13 +29432,13 @@ var require_equiv = __commonJS({
|
|
|
29432
29432
|
var shared_1 = require_shared();
|
|
29433
29433
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
29434
29434
|
function default_1(fork) {
|
|
29435
|
-
var
|
|
29436
|
-
var getFieldNames =
|
|
29437
|
-
var getFieldValue =
|
|
29438
|
-
var isArray =
|
|
29439
|
-
var isObject2 =
|
|
29440
|
-
var isDate =
|
|
29441
|
-
var isRegExp =
|
|
29435
|
+
var types5 = fork.use(types_1.default);
|
|
29436
|
+
var getFieldNames = types5.getFieldNames;
|
|
29437
|
+
var getFieldValue = types5.getFieldValue;
|
|
29438
|
+
var isArray = types5.builtInTypes.array;
|
|
29439
|
+
var isObject2 = types5.builtInTypes.object;
|
|
29440
|
+
var isDate = types5.builtInTypes.Date;
|
|
29441
|
+
var isRegExp = types5.builtInTypes.RegExp;
|
|
29442
29442
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
29443
29443
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
29444
29444
|
if (isArray.check(problemPath)) {
|
|
@@ -29591,24 +29591,24 @@ var require_fork = __commonJS({
|
|
|
29591
29591
|
var shared_1 = require_shared();
|
|
29592
29592
|
function default_1(plugins2) {
|
|
29593
29593
|
var fork = createFork();
|
|
29594
|
-
var
|
|
29594
|
+
var types5 = fork.use(types_1.default);
|
|
29595
29595
|
plugins2.forEach(fork.use);
|
|
29596
|
-
|
|
29596
|
+
types5.finalize();
|
|
29597
29597
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
29598
29598
|
return {
|
|
29599
|
-
Type:
|
|
29600
|
-
builtInTypes:
|
|
29601
|
-
namedTypes:
|
|
29602
|
-
builders:
|
|
29603
|
-
defineMethod:
|
|
29604
|
-
getFieldNames:
|
|
29605
|
-
getFieldValue:
|
|
29606
|
-
eachField:
|
|
29607
|
-
someField:
|
|
29608
|
-
getSupertypeNames:
|
|
29609
|
-
getBuilderName:
|
|
29599
|
+
Type: types5.Type,
|
|
29600
|
+
builtInTypes: types5.builtInTypes,
|
|
29601
|
+
namedTypes: types5.namedTypes,
|
|
29602
|
+
builders: types5.builders,
|
|
29603
|
+
defineMethod: types5.defineMethod,
|
|
29604
|
+
getFieldNames: types5.getFieldNames,
|
|
29605
|
+
getFieldValue: types5.getFieldValue,
|
|
29606
|
+
eachField: types5.eachField,
|
|
29607
|
+
someField: types5.someField,
|
|
29608
|
+
getSupertypeNames: types5.getSupertypeNames,
|
|
29609
|
+
getBuilderName: types5.getBuilderName,
|
|
29610
29610
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
29611
|
-
finalize:
|
|
29611
|
+
finalize: types5.finalize,
|
|
29612
29612
|
Path: fork.use(path_1.default),
|
|
29613
29613
|
NodePath: fork.use(node_path_1.default),
|
|
29614
29614
|
PathVisitor,
|
|
@@ -29778,8 +29778,8 @@ var require_core2 = __commonJS({
|
|
|
29778
29778
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
29779
29779
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29780
29780
|
function default_1(fork) {
|
|
29781
|
-
var
|
|
29782
|
-
var Type =
|
|
29781
|
+
var types5 = fork.use(types_1.default);
|
|
29782
|
+
var Type = types5.Type;
|
|
29783
29783
|
var def = Type.def;
|
|
29784
29784
|
var or = Type.or;
|
|
29785
29785
|
var shared = fork.use(shared_1.default);
|
|
@@ -29871,9 +29871,9 @@ var require_es6 = __commonJS({
|
|
|
29871
29871
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29872
29872
|
function default_1(fork) {
|
|
29873
29873
|
fork.use(core_1.default);
|
|
29874
|
-
var
|
|
29875
|
-
var def =
|
|
29876
|
-
var or =
|
|
29874
|
+
var types5 = fork.use(types_1.default);
|
|
29875
|
+
var def = types5.Type.def;
|
|
29876
|
+
var or = types5.Type.or;
|
|
29877
29877
|
var defaults = fork.use(shared_1.default).defaults;
|
|
29878
29878
|
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"]);
|
|
29879
29879
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -29963,8 +29963,8 @@ var require_es2017 = __commonJS({
|
|
|
29963
29963
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29964
29964
|
function default_1(fork) {
|
|
29965
29965
|
fork.use(es2016_1.default);
|
|
29966
|
-
var
|
|
29967
|
-
var def =
|
|
29966
|
+
var types5 = fork.use(types_1.default);
|
|
29967
|
+
var def = types5.Type.def;
|
|
29968
29968
|
var defaults = fork.use(shared_1.default).defaults;
|
|
29969
29969
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
29970
29970
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -29987,9 +29987,9 @@ var require_es2018 = __commonJS({
|
|
|
29987
29987
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29988
29988
|
function default_1(fork) {
|
|
29989
29989
|
fork.use(es2017_1.default);
|
|
29990
|
-
var
|
|
29991
|
-
var def =
|
|
29992
|
-
var or =
|
|
29990
|
+
var types5 = fork.use(types_1.default);
|
|
29991
|
+
var def = types5.Type.def;
|
|
29992
|
+
var or = types5.Type.or;
|
|
29993
29993
|
var defaults = fork.use(shared_1.default).defaults;
|
|
29994
29994
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
29995
29995
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -30020,9 +30020,9 @@ var require_es2019 = __commonJS({
|
|
|
30020
30020
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30021
30021
|
function default_1(fork) {
|
|
30022
30022
|
fork.use(es2018_1.default);
|
|
30023
|
-
var
|
|
30024
|
-
var def =
|
|
30025
|
-
var or =
|
|
30023
|
+
var types5 = fork.use(types_1.default);
|
|
30024
|
+
var def = types5.Type.def;
|
|
30025
|
+
var or = types5.Type.or;
|
|
30026
30026
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30027
30027
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
30028
30028
|
}
|
|
@@ -30046,9 +30046,9 @@ var require_es20202 = __commonJS({
|
|
|
30046
30046
|
function default_1(fork) {
|
|
30047
30047
|
fork.use(es2020_1.default);
|
|
30048
30048
|
fork.use(es2019_1.default);
|
|
30049
|
-
var
|
|
30050
|
-
var def =
|
|
30051
|
-
var or =
|
|
30049
|
+
var types5 = fork.use(types_1.default);
|
|
30050
|
+
var def = types5.Type.def;
|
|
30051
|
+
var or = types5.Type.or;
|
|
30052
30052
|
var shared = fork.use(shared_1.default);
|
|
30053
30053
|
var defaults = shared.defaults;
|
|
30054
30054
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -30098,8 +30098,8 @@ var require_es2022 = __commonJS({
|
|
|
30098
30098
|
var shared_1 = require_shared();
|
|
30099
30099
|
function default_1(fork) {
|
|
30100
30100
|
fork.use(es2021_1.default);
|
|
30101
|
-
var
|
|
30102
|
-
var def =
|
|
30101
|
+
var types5 = fork.use(types_1.default);
|
|
30102
|
+
var def = types5.Type.def;
|
|
30103
30103
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
30104
30104
|
}
|
|
30105
30105
|
exports.default = default_1;
|
|
@@ -30120,9 +30120,9 @@ var require_es_proposals = __commonJS({
|
|
|
30120
30120
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
30121
30121
|
function default_1(fork) {
|
|
30122
30122
|
fork.use(es2022_1.default);
|
|
30123
|
-
var
|
|
30124
|
-
var Type =
|
|
30125
|
-
var def =
|
|
30123
|
+
var types5 = fork.use(types_1.default);
|
|
30124
|
+
var Type = types5.Type;
|
|
30125
|
+
var def = types5.Type.def;
|
|
30126
30126
|
var or = Type.or;
|
|
30127
30127
|
var shared = fork.use(shared_1.default);
|
|
30128
30128
|
var defaults = shared.defaults;
|
|
@@ -30162,9 +30162,9 @@ var require_jsx = __commonJS({
|
|
|
30162
30162
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30163
30163
|
function default_1(fork) {
|
|
30164
30164
|
fork.use(es_proposals_1.default);
|
|
30165
|
-
var
|
|
30166
|
-
var def =
|
|
30167
|
-
var or =
|
|
30165
|
+
var types5 = fork.use(types_1.default);
|
|
30166
|
+
var def = types5.Type.def;
|
|
30167
|
+
var or = types5.Type.or;
|
|
30168
30168
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30169
30169
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
30170
30170
|
def("Literal"),
|
|
@@ -30222,9 +30222,9 @@ var require_type_annotations = __commonJS({
|
|
|
30222
30222
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
30223
30223
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30224
30224
|
function default_1(fork) {
|
|
30225
|
-
var
|
|
30226
|
-
var def =
|
|
30227
|
-
var or =
|
|
30225
|
+
var types5 = fork.use(types_1.default);
|
|
30226
|
+
var def = types5.Type.def;
|
|
30227
|
+
var or = types5.Type.or;
|
|
30228
30228
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30229
30229
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
30230
30230
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -30259,9 +30259,9 @@ var require_flow = __commonJS({
|
|
|
30259
30259
|
function default_1(fork) {
|
|
30260
30260
|
fork.use(es_proposals_1.default);
|
|
30261
30261
|
fork.use(type_annotations_1.default);
|
|
30262
|
-
var
|
|
30263
|
-
var def =
|
|
30264
|
-
var or =
|
|
30262
|
+
var types5 = fork.use(types_1.default);
|
|
30263
|
+
var def = types5.Type.def;
|
|
30264
|
+
var or = types5.Type.or;
|
|
30265
30265
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30266
30266
|
def("Flow").bases("Node");
|
|
30267
30267
|
def("FlowType").bases("Flow");
|
|
@@ -30375,10 +30375,10 @@ var require_esprima = __commonJS({
|
|
|
30375
30375
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30376
30376
|
function default_1(fork) {
|
|
30377
30377
|
fork.use(es_proposals_1.default);
|
|
30378
|
-
var
|
|
30378
|
+
var types5 = fork.use(types_1.default);
|
|
30379
30379
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30380
|
-
var def =
|
|
30381
|
-
var or =
|
|
30380
|
+
var def = types5.Type.def;
|
|
30381
|
+
var or = types5.Type.or;
|
|
30382
30382
|
def("VariableDeclaration").field("declarations", [or(
|
|
30383
30383
|
def("VariableDeclarator"),
|
|
30384
30384
|
def("Identifier")
|
|
@@ -30423,11 +30423,11 @@ var require_babel_core = __commonJS({
|
|
|
30423
30423
|
function default_1(fork) {
|
|
30424
30424
|
var _a, _b, _c, _d, _e;
|
|
30425
30425
|
fork.use(es_proposals_1.default);
|
|
30426
|
-
var
|
|
30426
|
+
var types5 = fork.use(types_1.default);
|
|
30427
30427
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30428
|
-
var def =
|
|
30429
|
-
var or =
|
|
30430
|
-
var isUndefined =
|
|
30428
|
+
var def = types5.Type.def;
|
|
30429
|
+
var or = types5.Type.or;
|
|
30430
|
+
var isUndefined = types5.builtInTypes.undefined;
|
|
30431
30431
|
def("Noop").bases("Statement").build();
|
|
30432
30432
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
30433
30433
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -30452,7 +30452,7 @@ var require_babel_core = __commonJS({
|
|
|
30452
30452
|
raw: String
|
|
30453
30453
|
},
|
|
30454
30454
|
function getDefault() {
|
|
30455
|
-
var value =
|
|
30455
|
+
var value = types5.getFieldValue(this, "value");
|
|
30456
30456
|
return {
|
|
30457
30457
|
rawValue: value,
|
|
30458
30458
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -30555,8 +30555,8 @@ var require_babel = __commonJS({
|
|
|
30555
30555
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
30556
30556
|
var shared_1 = require_shared();
|
|
30557
30557
|
function default_1(fork) {
|
|
30558
|
-
var
|
|
30559
|
-
var def =
|
|
30558
|
+
var types5 = fork.use(types_1.default);
|
|
30559
|
+
var def = types5.Type.def;
|
|
30560
30560
|
fork.use(babel_core_1.default);
|
|
30561
30561
|
fork.use(flow_1.default);
|
|
30562
30562
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -30582,12 +30582,12 @@ var require_typescript = __commonJS({
|
|
|
30582
30582
|
function default_1(fork) {
|
|
30583
30583
|
fork.use(babel_core_1.default);
|
|
30584
30584
|
fork.use(type_annotations_1.default);
|
|
30585
|
-
var
|
|
30586
|
-
var n =
|
|
30587
|
-
var def =
|
|
30588
|
-
var or =
|
|
30585
|
+
var types5 = fork.use(types_1.default);
|
|
30586
|
+
var n = types5.namedTypes;
|
|
30587
|
+
var def = types5.Type.def;
|
|
30588
|
+
var or = types5.Type.or;
|
|
30589
30589
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30590
|
-
var StringLiteral =
|
|
30590
|
+
var StringLiteral = types5.Type.from(function(value, deep) {
|
|
30591
30591
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
30592
30592
|
return true;
|
|
30593
30593
|
}
|
|
@@ -32563,8 +32563,8 @@ var require_util2 = __commonJS({
|
|
|
32563
32563
|
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;
|
|
32564
32564
|
var tslib_1 = require_tslib();
|
|
32565
32565
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
32566
|
-
var
|
|
32567
|
-
var n =
|
|
32566
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
32567
|
+
var n = types5.namedTypes;
|
|
32568
32568
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
32569
32569
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
32570
32570
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -39882,10 +39882,10 @@ var require_comments = __commonJS({
|
|
|
39882
39882
|
exports.printComments = exports.attach = void 0;
|
|
39883
39883
|
var tslib_1 = require_tslib();
|
|
39884
39884
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
39885
|
-
var
|
|
39886
|
-
var n =
|
|
39887
|
-
var isArray =
|
|
39888
|
-
var isObject2 =
|
|
39885
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
39886
|
+
var n = types5.namedTypes;
|
|
39887
|
+
var isArray = types5.builtInTypes.array;
|
|
39888
|
+
var isObject2 = types5.builtInTypes.object;
|
|
39889
39889
|
var lines_1 = require_lines();
|
|
39890
39890
|
var util_1 = require_util2();
|
|
39891
39891
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -39916,7 +39916,7 @@ var require_comments = __commonJS({
|
|
|
39916
39916
|
if (isArray.check(node)) {
|
|
39917
39917
|
names = Object.keys(node);
|
|
39918
39918
|
} else if (isObject2.check(node)) {
|
|
39919
|
-
names =
|
|
39919
|
+
names = types5.getFieldNames(node);
|
|
39920
39920
|
} else {
|
|
39921
39921
|
return resultArray;
|
|
39922
39922
|
}
|
|
@@ -40094,7 +40094,7 @@ var require_comments = __commonJS({
|
|
|
40094
40094
|
function printComments(path3, print6) {
|
|
40095
40095
|
var value = path3.getValue();
|
|
40096
40096
|
var innerLines = print6(path3);
|
|
40097
|
-
var comments = n.Node.check(value) &&
|
|
40097
|
+
var comments = n.Node.check(value) && types5.getFieldValue(value, "comments");
|
|
40098
40098
|
if (!comments || comments.length === 0) {
|
|
40099
40099
|
return innerLines;
|
|
40100
40100
|
}
|
|
@@ -40102,8 +40102,8 @@ var require_comments = __commonJS({
|
|
|
40102
40102
|
var trailingParts = [innerLines];
|
|
40103
40103
|
path3.each(function(commentPath) {
|
|
40104
40104
|
var comment = commentPath.getValue();
|
|
40105
|
-
var leading =
|
|
40106
|
-
var trailing =
|
|
40105
|
+
var leading = types5.getFieldValue(comment, "leading");
|
|
40106
|
+
var trailing = types5.getFieldValue(comment, "trailing");
|
|
40107
40107
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
40108
40108
|
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
40109
40109
|
} else if (trailing) {
|
|
@@ -40125,10 +40125,10 @@ var require_parser = __commonJS({
|
|
|
40125
40125
|
exports.parse = void 0;
|
|
40126
40126
|
var tslib_1 = require_tslib();
|
|
40127
40127
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
40128
|
-
var
|
|
40129
|
-
var b =
|
|
40130
|
-
var isObject2 =
|
|
40131
|
-
var isArray =
|
|
40128
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
40129
|
+
var b = types5.builders;
|
|
40130
|
+
var isObject2 = types5.builtInTypes.object;
|
|
40131
|
+
var isArray = types5.builtInTypes.array;
|
|
40132
40132
|
var options_1 = require_options();
|
|
40133
40133
|
var lines_1 = require_lines();
|
|
40134
40134
|
var comments_1 = require_comments();
|
|
@@ -40314,11 +40314,11 @@ var require_fast_path = __commonJS({
|
|
|
40314
40314
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40315
40315
|
var tslib_1 = require_tslib();
|
|
40316
40316
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
40317
|
-
var
|
|
40317
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
40318
40318
|
var util = tslib_1.__importStar(require_util2());
|
|
40319
|
-
var n =
|
|
40320
|
-
var isArray =
|
|
40321
|
-
var isNumber =
|
|
40319
|
+
var n = types5.namedTypes;
|
|
40320
|
+
var isArray = types5.builtInTypes.array;
|
|
40321
|
+
var isNumber = types5.builtInTypes.number;
|
|
40322
40322
|
var PRECEDENCE = {};
|
|
40323
40323
|
[
|
|
40324
40324
|
["??"],
|
|
@@ -40347,7 +40347,7 @@ var require_fast_path = __commonJS({
|
|
|
40347
40347
|
if (obj instanceof FastPath) {
|
|
40348
40348
|
return obj.copy();
|
|
40349
40349
|
}
|
|
40350
|
-
if (obj instanceof
|
|
40350
|
+
if (obj instanceof types5.NodePath) {
|
|
40351
40351
|
var copy = Object.create(FastPath.prototype);
|
|
40352
40352
|
var stack = [obj.value];
|
|
40353
40353
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -40658,7 +40658,7 @@ var require_fast_path = __commonJS({
|
|
|
40658
40658
|
return node.some(containsCallExpression);
|
|
40659
40659
|
}
|
|
40660
40660
|
if (n.Node.check(node)) {
|
|
40661
|
-
return
|
|
40661
|
+
return types5.someField(node, function(_name, child) {
|
|
40662
40662
|
return containsCallExpression(child);
|
|
40663
40663
|
});
|
|
40664
40664
|
}
|
|
@@ -40748,16 +40748,16 @@ var require_patcher = __commonJS({
|
|
|
40748
40748
|
var tslib_1 = require_tslib();
|
|
40749
40749
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
40750
40750
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
40751
|
-
var
|
|
40752
|
-
var Printable =
|
|
40753
|
-
var Expression =
|
|
40754
|
-
var ReturnStatement =
|
|
40755
|
-
var SourceLocation =
|
|
40751
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
40752
|
+
var Printable = types5.namedTypes.Printable;
|
|
40753
|
+
var Expression = types5.namedTypes.Expression;
|
|
40754
|
+
var ReturnStatement = types5.namedTypes.ReturnStatement;
|
|
40755
|
+
var SourceLocation = types5.namedTypes.SourceLocation;
|
|
40756
40756
|
var util_1 = require_util2();
|
|
40757
40757
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
40758
|
-
var isObject2 =
|
|
40759
|
-
var isArray =
|
|
40760
|
-
var isString =
|
|
40758
|
+
var isObject2 = types5.builtInTypes.object;
|
|
40759
|
+
var isArray = types5.builtInTypes.array;
|
|
40760
|
+
var isString = types5.builtInTypes.string;
|
|
40761
40761
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
40762
40762
|
var Patcher = function Patcher2(lines) {
|
|
40763
40763
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -41027,8 +41027,8 @@ var require_patcher = __commonJS({
|
|
|
41027
41027
|
if (k.charAt(0) === "_") {
|
|
41028
41028
|
continue;
|
|
41029
41029
|
}
|
|
41030
|
-
newPath.stack.push(k,
|
|
41031
|
-
oldPath.stack.push(k,
|
|
41030
|
+
newPath.stack.push(k, types5.getFieldValue(newNode, k));
|
|
41031
|
+
oldPath.stack.push(k, types5.getFieldValue(oldNode, k));
|
|
41032
41032
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
41033
41033
|
newPath.stack.length -= 2;
|
|
41034
41034
|
oldPath.stack.length -= 2;
|
|
@@ -41052,16 +41052,16 @@ var require_printer = __commonJS({
|
|
|
41052
41052
|
exports.Printer = void 0;
|
|
41053
41053
|
var tslib_1 = require_tslib();
|
|
41054
41054
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
41055
|
-
var
|
|
41055
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
41056
41056
|
var comments_1 = require_comments();
|
|
41057
41057
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
41058
41058
|
var lines_1 = require_lines();
|
|
41059
41059
|
var options_1 = require_options();
|
|
41060
41060
|
var patcher_1 = require_patcher();
|
|
41061
41061
|
var util = tslib_1.__importStar(require_util2());
|
|
41062
|
-
var namedTypes =
|
|
41063
|
-
var isString =
|
|
41064
|
-
var isObject2 =
|
|
41062
|
+
var namedTypes = types5.namedTypes;
|
|
41063
|
+
var isString = types5.builtInTypes.string;
|
|
41064
|
+
var isObject2 = types5.builtInTypes.object;
|
|
41065
41065
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
41066
41066
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
41067
41067
|
isString.assert(code);
|
|
@@ -41223,7 +41223,7 @@ var require_printer = __commonJS({
|
|
|
41223
41223
|
case "OptionalMemberExpression": {
|
|
41224
41224
|
parts.push(path3.call(print6, "object"));
|
|
41225
41225
|
var property = path3.call(print6, "property");
|
|
41226
|
-
var optional =
|
|
41226
|
+
var optional = types5.getFieldValue(n, "optional");
|
|
41227
41227
|
if (n.computed) {
|
|
41228
41228
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
41229
41229
|
} else {
|
|
@@ -41494,7 +41494,7 @@ var require_printer = __commonJS({
|
|
|
41494
41494
|
if (n.typeArguments) {
|
|
41495
41495
|
parts.push(path3.call(print6, "typeArguments"));
|
|
41496
41496
|
}
|
|
41497
|
-
if (
|
|
41497
|
+
if (types5.getFieldValue(n, "optional")) {
|
|
41498
41498
|
parts.push("?.");
|
|
41499
41499
|
}
|
|
41500
41500
|
parts.push(printArgumentsList(path3, options, print6));
|
|
@@ -43173,8 +43173,8 @@ var require_printer = __commonJS({
|
|
|
43173
43173
|
});
|
|
43174
43174
|
}
|
|
43175
43175
|
function getPossibleRaw(node) {
|
|
43176
|
-
var value =
|
|
43177
|
-
var extra =
|
|
43176
|
+
var value = types5.getFieldValue(node, "value");
|
|
43177
|
+
var extra = types5.getFieldValue(node, "extra");
|
|
43178
43178
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
43179
43179
|
return extra.raw;
|
|
43180
43180
|
}
|
|
@@ -43222,8 +43222,8 @@ var require_main2 = __commonJS({
|
|
|
43222
43222
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
43223
43223
|
var tslib_1 = require_tslib();
|
|
43224
43224
|
var fs_1 = tslib_1.__importDefault(__require("fs"));
|
|
43225
|
-
var
|
|
43226
|
-
exports.types =
|
|
43225
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
43226
|
+
exports.types = types5;
|
|
43227
43227
|
var parser_1 = require_parser();
|
|
43228
43228
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
43229
43229
|
return parser_1.parse;
|
|
@@ -47651,30 +47651,30 @@ var require_utils3 = __commonJS({
|
|
|
47651
47651
|
validate2.oneOf = values;
|
|
47652
47652
|
return validate2;
|
|
47653
47653
|
}
|
|
47654
|
-
function assertNodeType(...
|
|
47654
|
+
function assertNodeType(...types5) {
|
|
47655
47655
|
function validate2(node, key, val) {
|
|
47656
|
-
for (const type of
|
|
47656
|
+
for (const type of types5) {
|
|
47657
47657
|
if ((0, _is.default)(type, val)) {
|
|
47658
47658
|
(0, _validate.validateChild)(node, key, val);
|
|
47659
47659
|
return;
|
|
47660
47660
|
}
|
|
47661
47661
|
}
|
|
47662
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
47662
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types5)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
47663
47663
|
}
|
|
47664
|
-
validate2.oneOfNodeTypes =
|
|
47664
|
+
validate2.oneOfNodeTypes = types5;
|
|
47665
47665
|
return validate2;
|
|
47666
47666
|
}
|
|
47667
|
-
function assertNodeOrValueType(...
|
|
47667
|
+
function assertNodeOrValueType(...types5) {
|
|
47668
47668
|
function validate2(node, key, val) {
|
|
47669
|
-
for (const type of
|
|
47669
|
+
for (const type of types5) {
|
|
47670
47670
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
47671
47671
|
(0, _validate.validateChild)(node, key, val);
|
|
47672
47672
|
return;
|
|
47673
47673
|
}
|
|
47674
47674
|
}
|
|
47675
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
47675
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types5)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
47676
47676
|
}
|
|
47677
|
-
validate2.oneOfNodeOrValueTypes =
|
|
47677
|
+
validate2.oneOfNodeOrValueTypes = types5;
|
|
47678
47678
|
return validate2;
|
|
47679
47679
|
}
|
|
47680
47680
|
function assertValueType(type) {
|
|
@@ -51276,7 +51276,7 @@ var require_generated2 = __commonJS({
|
|
|
51276
51276
|
exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
|
|
51277
51277
|
exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate;
|
|
51278
51278
|
exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery;
|
|
51279
|
-
exports.tSTypeReference = exports.tsTypeReference =
|
|
51279
|
+
exports.tSTypeReference = exports.tsTypeReference = tsTypeReference2;
|
|
51280
51280
|
exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword;
|
|
51281
51281
|
exports.tSUnionType = exports.tsUnionType = tsUnionType;
|
|
51282
51282
|
exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword;
|
|
@@ -52102,10 +52102,10 @@ var require_generated2 = __commonJS({
|
|
|
52102
52102
|
body
|
|
52103
52103
|
});
|
|
52104
52104
|
}
|
|
52105
|
-
function intersectionTypeAnnotation(
|
|
52105
|
+
function intersectionTypeAnnotation(types5) {
|
|
52106
52106
|
return (0, _validateNode.default)({
|
|
52107
52107
|
type: "IntersectionTypeAnnotation",
|
|
52108
|
-
types:
|
|
52108
|
+
types: types5
|
|
52109
52109
|
});
|
|
52110
52110
|
}
|
|
52111
52111
|
function mixedTypeAnnotation() {
|
|
@@ -52228,10 +52228,10 @@ var require_generated2 = __commonJS({
|
|
|
52228
52228
|
type: "ThisTypeAnnotation"
|
|
52229
52229
|
};
|
|
52230
52230
|
}
|
|
52231
|
-
function tupleTypeAnnotation(
|
|
52231
|
+
function tupleTypeAnnotation(types5) {
|
|
52232
52232
|
return (0, _validateNode.default)({
|
|
52233
52233
|
type: "TupleTypeAnnotation",
|
|
52234
|
-
types:
|
|
52234
|
+
types: types5
|
|
52235
52235
|
});
|
|
52236
52236
|
}
|
|
52237
52237
|
function typeofTypeAnnotation(argument) {
|
|
@@ -52282,10 +52282,10 @@ var require_generated2 = __commonJS({
|
|
|
52282
52282
|
params
|
|
52283
52283
|
});
|
|
52284
52284
|
}
|
|
52285
|
-
function unionTypeAnnotation(
|
|
52285
|
+
function unionTypeAnnotation(types5) {
|
|
52286
52286
|
return (0, _validateNode.default)({
|
|
52287
52287
|
type: "UnionTypeAnnotation",
|
|
52288
|
-
types:
|
|
52288
|
+
types: types5
|
|
52289
52289
|
});
|
|
52290
52290
|
}
|
|
52291
52291
|
function variance(kind) {
|
|
@@ -52738,7 +52738,7 @@ var require_generated2 = __commonJS({
|
|
|
52738
52738
|
typeAnnotation: typeAnnotation2
|
|
52739
52739
|
});
|
|
52740
52740
|
}
|
|
52741
|
-
function
|
|
52741
|
+
function tsTypeReference2(typeName, typeParameters = null) {
|
|
52742
52742
|
return (0, _validateNode.default)({
|
|
52743
52743
|
type: "TSTypeReference",
|
|
52744
52744
|
typeName,
|
|
@@ -52798,16 +52798,16 @@ var require_generated2 = __commonJS({
|
|
|
52798
52798
|
optional
|
|
52799
52799
|
});
|
|
52800
52800
|
}
|
|
52801
|
-
function tsUnionType(
|
|
52801
|
+
function tsUnionType(types5) {
|
|
52802
52802
|
return (0, _validateNode.default)({
|
|
52803
52803
|
type: "TSUnionType",
|
|
52804
|
-
types:
|
|
52804
|
+
types: types5
|
|
52805
52805
|
});
|
|
52806
52806
|
}
|
|
52807
|
-
function tsIntersectionType(
|
|
52807
|
+
function tsIntersectionType(types5) {
|
|
52808
52808
|
return (0, _validateNode.default)({
|
|
52809
52809
|
type: "TSIntersectionType",
|
|
52810
|
-
types:
|
|
52810
|
+
types: types5
|
|
52811
52811
|
});
|
|
52812
52812
|
}
|
|
52813
52813
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -54422,12 +54422,12 @@ var require_removeTypeDuplicates = __commonJS({
|
|
|
54422
54422
|
const generics = /* @__PURE__ */ new Map();
|
|
54423
54423
|
const bases = /* @__PURE__ */ new Map();
|
|
54424
54424
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
54425
|
-
const
|
|
54425
|
+
const types5 = [];
|
|
54426
54426
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
54427
54427
|
const node = nodes[i2];
|
|
54428
54428
|
if (!node)
|
|
54429
54429
|
continue;
|
|
54430
|
-
if (
|
|
54430
|
+
if (types5.indexOf(node) >= 0) {
|
|
54431
54431
|
continue;
|
|
54432
54432
|
}
|
|
54433
54433
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -54461,15 +54461,15 @@ var require_removeTypeDuplicates = __commonJS({
|
|
|
54461
54461
|
}
|
|
54462
54462
|
continue;
|
|
54463
54463
|
}
|
|
54464
|
-
|
|
54464
|
+
types5.push(node);
|
|
54465
54465
|
}
|
|
54466
54466
|
for (const [, baseType] of bases) {
|
|
54467
|
-
|
|
54467
|
+
types5.push(baseType);
|
|
54468
54468
|
}
|
|
54469
54469
|
for (const [, genericName] of generics) {
|
|
54470
|
-
|
|
54470
|
+
types5.push(genericName);
|
|
54471
54471
|
}
|
|
54472
|
-
return
|
|
54472
|
+
return types5;
|
|
54473
54473
|
}
|
|
54474
54474
|
}
|
|
54475
54475
|
});
|
|
@@ -54484,8 +54484,8 @@ var require_createFlowUnionType = __commonJS({
|
|
|
54484
54484
|
exports.default = createFlowUnionType;
|
|
54485
54485
|
var _generated = require_generated2();
|
|
54486
54486
|
var _removeTypeDuplicates = require_removeTypeDuplicates();
|
|
54487
|
-
function createFlowUnionType(
|
|
54488
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
54487
|
+
function createFlowUnionType(types5) {
|
|
54488
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
54489
54489
|
if (flattened.length === 1) {
|
|
54490
54490
|
return flattened[0];
|
|
54491
54491
|
} else {
|
|
@@ -54512,12 +54512,12 @@ var require_removeTypeDuplicates2 = __commonJS({
|
|
|
54512
54512
|
const generics = /* @__PURE__ */ new Map();
|
|
54513
54513
|
const bases = /* @__PURE__ */ new Map();
|
|
54514
54514
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
54515
|
-
const
|
|
54515
|
+
const types5 = [];
|
|
54516
54516
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
54517
54517
|
const node = nodes[i2];
|
|
54518
54518
|
if (!node)
|
|
54519
54519
|
continue;
|
|
54520
|
-
if (
|
|
54520
|
+
if (types5.indexOf(node) >= 0) {
|
|
54521
54521
|
continue;
|
|
54522
54522
|
}
|
|
54523
54523
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -54551,15 +54551,15 @@ var require_removeTypeDuplicates2 = __commonJS({
|
|
|
54551
54551
|
}
|
|
54552
54552
|
continue;
|
|
54553
54553
|
}
|
|
54554
|
-
|
|
54554
|
+
types5.push(node);
|
|
54555
54555
|
}
|
|
54556
54556
|
for (const [, baseType] of bases) {
|
|
54557
|
-
|
|
54557
|
+
types5.push(baseType);
|
|
54558
54558
|
}
|
|
54559
54559
|
for (const [, genericName] of generics) {
|
|
54560
|
-
|
|
54560
|
+
types5.push(genericName);
|
|
54561
54561
|
}
|
|
54562
|
-
return
|
|
54562
|
+
return types5;
|
|
54563
54563
|
}
|
|
54564
54564
|
}
|
|
54565
54565
|
});
|
|
@@ -54576,10 +54576,10 @@ var require_createTSUnionType = __commonJS({
|
|
|
54576
54576
|
var _removeTypeDuplicates = require_removeTypeDuplicates2();
|
|
54577
54577
|
var _index = require_generated();
|
|
54578
54578
|
function createTSUnionType(typeAnnotations) {
|
|
54579
|
-
const
|
|
54579
|
+
const types5 = typeAnnotations.map((type) => {
|
|
54580
54580
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
54581
54581
|
});
|
|
54582
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
54582
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
54583
54583
|
if (flattened.length === 1) {
|
|
54584
54584
|
return flattened[0];
|
|
54585
54585
|
} else {
|
|
@@ -59049,7 +59049,7 @@ var printDocASTReducer = {
|
|
|
59049
59049
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
59050
59050
|
},
|
|
59051
59051
|
UnionTypeDefinition: {
|
|
59052
|
-
leave: ({ name, directives, types:
|
|
59052
|
+
leave: ({ name, directives, types: types5 }) => join(["union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
59053
59053
|
},
|
|
59054
59054
|
EnumTypeDefinition: {
|
|
59055
59055
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -59076,7 +59076,7 @@ var printDocASTReducer = {
|
|
|
59076
59076
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
59077
59077
|
},
|
|
59078
59078
|
UnionTypeExtension: {
|
|
59079
|
-
leave: ({ name, directives, types:
|
|
59079
|
+
leave: ({ name, directives, types: types5 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
59080
59080
|
},
|
|
59081
59081
|
EnumTypeExtension: {
|
|
59082
59082
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -59956,8 +59956,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
59956
59956
|
}
|
|
59957
59957
|
}
|
|
59958
59958
|
function healUnderlyingTypes(type) {
|
|
59959
|
-
const
|
|
59960
|
-
|
|
59959
|
+
const types5 = type.getTypes();
|
|
59960
|
+
types5.push(...types5.splice(0).map((t3) => healType(t3)).filter(Boolean));
|
|
59961
59961
|
}
|
|
59962
59962
|
function healType(type) {
|
|
59963
59963
|
if (isListType5(type)) {
|
|
@@ -60741,11 +60741,11 @@ function mergeEnum(e1, e2, config) {
|
|
|
60741
60741
|
|
|
60742
60742
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
60743
60743
|
import { Source, Kind as Kind8 } from "graphql";
|
|
60744
|
-
function isStringTypes(
|
|
60745
|
-
return typeof
|
|
60744
|
+
function isStringTypes(types5) {
|
|
60745
|
+
return typeof types5 === "string";
|
|
60746
60746
|
}
|
|
60747
|
-
function isSourceTypes(
|
|
60748
|
-
return
|
|
60747
|
+
function isSourceTypes(types5) {
|
|
60748
|
+
return types5 instanceof Source;
|
|
60749
60749
|
}
|
|
60750
60750
|
function extractType(type) {
|
|
60751
60751
|
let visitedType = type;
|
|
@@ -61440,6 +61440,44 @@ function deepMerge(...objects) {
|
|
|
61440
61440
|
return mergedObj;
|
|
61441
61441
|
}
|
|
61442
61442
|
|
|
61443
|
+
// src/runtime/lib/types.ts
|
|
61444
|
+
var CachePolicy = {
|
|
61445
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
61446
|
+
CacheOnly: "CacheOnly",
|
|
61447
|
+
NetworkOnly: "NetworkOnly",
|
|
61448
|
+
CacheAndNetwork: "CacheAndNetwork",
|
|
61449
|
+
NoCache: "NoCache"
|
|
61450
|
+
};
|
|
61451
|
+
var PaginateMode = {
|
|
61452
|
+
Infinite: "Infinite",
|
|
61453
|
+
SinglePage: "SinglePage"
|
|
61454
|
+
};
|
|
61455
|
+
var ArtifactKind = {
|
|
61456
|
+
Query: "HoudiniQuery",
|
|
61457
|
+
Subscription: "HoudiniSubscription",
|
|
61458
|
+
Mutation: "HoudiniMutation",
|
|
61459
|
+
Fragment: "HoudiniFragment"
|
|
61460
|
+
};
|
|
61461
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
61462
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
61463
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
61464
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
61465
|
+
var RefetchUpdateMode = {
|
|
61466
|
+
append: "append",
|
|
61467
|
+
prepend: "prepend",
|
|
61468
|
+
replace: "replace"
|
|
61469
|
+
};
|
|
61470
|
+
var DataSource = {
|
|
61471
|
+
Cache: "cache",
|
|
61472
|
+
Network: "network",
|
|
61473
|
+
Ssr: "ssr"
|
|
61474
|
+
};
|
|
61475
|
+
var fragmentKey = " $fragments";
|
|
61476
|
+
var PendingValue = Symbol("houdini_loading");
|
|
61477
|
+
function isPending(value) {
|
|
61478
|
+
return typeof value === "symbol";
|
|
61479
|
+
}
|
|
61480
|
+
|
|
61443
61481
|
// src/runtime/lib/scalars.ts
|
|
61444
61482
|
async function marshalSelection({
|
|
61445
61483
|
selection,
|
|
@@ -61456,6 +61494,9 @@ async function marshalSelection({
|
|
|
61456
61494
|
return Object.fromEntries(
|
|
61457
61495
|
await Promise.all(
|
|
61458
61496
|
Object.entries(data).map(async ([fieldName, value]) => {
|
|
61497
|
+
if (fieldName === fragmentKey) {
|
|
61498
|
+
return [fieldName, value];
|
|
61499
|
+
}
|
|
61459
61500
|
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
61460
61501
|
if (!type) {
|
|
61461
61502
|
return [fieldName, value];
|
|
@@ -61520,44 +61561,6 @@ function isScalar(config, type) {
|
|
|
61520
61561
|
return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
|
|
61521
61562
|
}
|
|
61522
61563
|
|
|
61523
|
-
// src/runtime/lib/types.ts
|
|
61524
|
-
var CachePolicy = {
|
|
61525
|
-
CacheOrNetwork: "CacheOrNetwork",
|
|
61526
|
-
CacheOnly: "CacheOnly",
|
|
61527
|
-
NetworkOnly: "NetworkOnly",
|
|
61528
|
-
CacheAndNetwork: "CacheAndNetwork",
|
|
61529
|
-
NoCache: "NoCache"
|
|
61530
|
-
};
|
|
61531
|
-
var PaginateMode = {
|
|
61532
|
-
Infinite: "Infinite",
|
|
61533
|
-
SinglePage: "SinglePage"
|
|
61534
|
-
};
|
|
61535
|
-
var ArtifactKind = {
|
|
61536
|
-
Query: "HoudiniQuery",
|
|
61537
|
-
Subscription: "HoudiniSubscription",
|
|
61538
|
-
Mutation: "HoudiniMutation",
|
|
61539
|
-
Fragment: "HoudiniFragment"
|
|
61540
|
-
};
|
|
61541
|
-
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
61542
|
-
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
61543
|
-
var CompiledQueryKind = ArtifactKind.Query;
|
|
61544
|
-
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
61545
|
-
var RefetchUpdateMode = {
|
|
61546
|
-
append: "append",
|
|
61547
|
-
prepend: "prepend",
|
|
61548
|
-
replace: "replace"
|
|
61549
|
-
};
|
|
61550
|
-
var DataSource = {
|
|
61551
|
-
Cache: "cache",
|
|
61552
|
-
Network: "network",
|
|
61553
|
-
Ssr: "ssr"
|
|
61554
|
-
};
|
|
61555
|
-
var fragmentKey = " $fragments";
|
|
61556
|
-
var PendingValue = Symbol("houdini_loading");
|
|
61557
|
-
function isPending(value) {
|
|
61558
|
-
return typeof value === "symbol";
|
|
61559
|
-
}
|
|
61560
|
-
|
|
61561
61564
|
// src/runtime/lib/store.ts
|
|
61562
61565
|
var subscriber_queue = [];
|
|
61563
61566
|
var noop = () => {
|
|
@@ -63360,167 +63363,6 @@ function flatten(source) {
|
|
|
63360
63363
|
}, []);
|
|
63361
63364
|
}
|
|
63362
63365
|
|
|
63363
|
-
// src/runtime/client/plugins/fetch.ts
|
|
63364
|
-
var fetch2 = (target) => {
|
|
63365
|
-
return () => {
|
|
63366
|
-
return {
|
|
63367
|
-
async network(ctx, { client: client2, initialValue, resolve: resolve2, marshalVariables: marshalVariables2 }) {
|
|
63368
|
-
if (ctx.artifact.kind === ArtifactKind.Fragment) {
|
|
63369
|
-
return resolve2(ctx, initialValue);
|
|
63370
|
-
}
|
|
63371
|
-
const fetch3 = ctx.fetch ?? globalThis.fetch;
|
|
63372
|
-
const fetchParams2 = {
|
|
63373
|
-
name: ctx.name,
|
|
63374
|
-
text: ctx.text,
|
|
63375
|
-
hash: ctx.hash,
|
|
63376
|
-
variables: marshalVariables2(ctx)
|
|
63377
|
-
};
|
|
63378
|
-
let fetchFn = defaultFetch(client2.url, ctx.fetchParams);
|
|
63379
|
-
if (target) {
|
|
63380
|
-
if (typeof target === "string") {
|
|
63381
|
-
fetchFn = defaultFetch(target, ctx.fetchParams);
|
|
63382
|
-
} else {
|
|
63383
|
-
fetchFn = target;
|
|
63384
|
-
}
|
|
63385
|
-
}
|
|
63386
|
-
const result = await fetchFn({
|
|
63387
|
-
fetch: (url, args) => {
|
|
63388
|
-
const newArgs = handleMultipart(fetchParams2, args) ?? args;
|
|
63389
|
-
return fetch3(url, newArgs);
|
|
63390
|
-
},
|
|
63391
|
-
metadata: ctx.metadata,
|
|
63392
|
-
session: ctx.session || {},
|
|
63393
|
-
...fetchParams2
|
|
63394
|
-
});
|
|
63395
|
-
resolve2(ctx, {
|
|
63396
|
-
fetching: false,
|
|
63397
|
-
variables: ctx.variables ?? {},
|
|
63398
|
-
data: result.data,
|
|
63399
|
-
errors: !result.errors || result.errors.length === 0 ? null : result.errors,
|
|
63400
|
-
partial: false,
|
|
63401
|
-
stale: false,
|
|
63402
|
-
source: DataSource.Network
|
|
63403
|
-
});
|
|
63404
|
-
}
|
|
63405
|
-
};
|
|
63406
|
-
};
|
|
63407
|
-
};
|
|
63408
|
-
var defaultFetch = (url, params) => {
|
|
63409
|
-
if (!url) {
|
|
63410
|
-
throw new Error(
|
|
63411
|
-
"Could not find configured client url. Please specify one in your HoudiniClient constructor."
|
|
63412
|
-
);
|
|
63413
|
-
}
|
|
63414
|
-
return async ({ fetch: fetch3, name, text, variables }) => {
|
|
63415
|
-
const result = await fetch3(url, {
|
|
63416
|
-
method: "POST",
|
|
63417
|
-
body: JSON.stringify({ operationName: name, query: text, variables }),
|
|
63418
|
-
...params,
|
|
63419
|
-
headers: {
|
|
63420
|
-
Accept: "application/graphql+json, application/json",
|
|
63421
|
-
"Content-Type": "application/json",
|
|
63422
|
-
...params?.headers
|
|
63423
|
-
}
|
|
63424
|
-
});
|
|
63425
|
-
return await result.json();
|
|
63426
|
-
};
|
|
63427
|
-
};
|
|
63428
|
-
function handleMultipart(params, args) {
|
|
63429
|
-
const { files } = extractFiles({
|
|
63430
|
-
variables: params.variables
|
|
63431
|
-
});
|
|
63432
|
-
if (files.size) {
|
|
63433
|
-
const req = args;
|
|
63434
|
-
let headers = {};
|
|
63435
|
-
if (req?.headers) {
|
|
63436
|
-
const filtered = Object.entries(req?.headers).filter(([key, value]) => {
|
|
63437
|
-
return !(key.toLowerCase() == "content-type" && value.toLowerCase() == "application/json");
|
|
63438
|
-
});
|
|
63439
|
-
headers = Object.fromEntries(filtered);
|
|
63440
|
-
}
|
|
63441
|
-
const form = new FormData();
|
|
63442
|
-
if (args && args?.body) {
|
|
63443
|
-
form.set("operations", args?.body);
|
|
63444
|
-
} else {
|
|
63445
|
-
form.set(
|
|
63446
|
-
"operations",
|
|
63447
|
-
JSON.stringify({
|
|
63448
|
-
operationName: params.name,
|
|
63449
|
-
query: params.text,
|
|
63450
|
-
variables: params.variables
|
|
63451
|
-
})
|
|
63452
|
-
);
|
|
63453
|
-
}
|
|
63454
|
-
const map = {};
|
|
63455
|
-
let i2 = 0;
|
|
63456
|
-
files.forEach((paths) => {
|
|
63457
|
-
map[++i2] = paths;
|
|
63458
|
-
});
|
|
63459
|
-
form.set("map", JSON.stringify(map));
|
|
63460
|
-
i2 = 0;
|
|
63461
|
-
files.forEach((paths, file) => {
|
|
63462
|
-
form.set(`${++i2}`, file, file.name);
|
|
63463
|
-
});
|
|
63464
|
-
return { ...req, headers, body: form };
|
|
63465
|
-
}
|
|
63466
|
-
}
|
|
63467
|
-
function isExtractableFile(value) {
|
|
63468
|
-
return typeof File !== "undefined" && value instanceof File || typeof Blob !== "undefined" && value instanceof Blob;
|
|
63469
|
-
}
|
|
63470
|
-
function extractFiles(value) {
|
|
63471
|
-
if (!arguments.length)
|
|
63472
|
-
throw new TypeError("Argument 1 `value` is required.");
|
|
63473
|
-
const clones = /* @__PURE__ */ new Map();
|
|
63474
|
-
const files = /* @__PURE__ */ new Map();
|
|
63475
|
-
function recurse(value2, path3, recursed) {
|
|
63476
|
-
if (isExtractableFile(value2)) {
|
|
63477
|
-
const filePaths = files.get(value2);
|
|
63478
|
-
filePaths ? filePaths.push(path3) : files.set(value2, [path3]);
|
|
63479
|
-
return null;
|
|
63480
|
-
}
|
|
63481
|
-
const valueIsList = Array.isArray(value2) || typeof FileList !== "undefined" && value2 instanceof FileList;
|
|
63482
|
-
const valueIsPlainObject = isPlainObject(value2);
|
|
63483
|
-
if (valueIsList || valueIsPlainObject) {
|
|
63484
|
-
let clone2 = clones.get(value2);
|
|
63485
|
-
const uncloned = !clone2;
|
|
63486
|
-
if (uncloned) {
|
|
63487
|
-
clone2 = valueIsList ? [] : value2 instanceof Object ? {} : /* @__PURE__ */ Object.create(null);
|
|
63488
|
-
clones.set(value2, clone2);
|
|
63489
|
-
}
|
|
63490
|
-
if (!recursed.has(value2)) {
|
|
63491
|
-
const pathPrefix = path3 ? `${path3}.` : "";
|
|
63492
|
-
const recursedDeeper = new Set(recursed).add(value2);
|
|
63493
|
-
if (valueIsList) {
|
|
63494
|
-
let index = 0;
|
|
63495
|
-
for (const item of value2) {
|
|
63496
|
-
const itemClone = recurse(item, pathPrefix + index++, recursedDeeper);
|
|
63497
|
-
if (uncloned)
|
|
63498
|
-
clone2.push(itemClone);
|
|
63499
|
-
}
|
|
63500
|
-
} else
|
|
63501
|
-
for (const key in value2) {
|
|
63502
|
-
const propertyClone = recurse(value2[key], pathPrefix + key, recursedDeeper);
|
|
63503
|
-
if (uncloned)
|
|
63504
|
-
clone2[key] = propertyClone;
|
|
63505
|
-
}
|
|
63506
|
-
}
|
|
63507
|
-
return clone2;
|
|
63508
|
-
}
|
|
63509
|
-
return value2;
|
|
63510
|
-
}
|
|
63511
|
-
return {
|
|
63512
|
-
clone: recurse(value, "", /* @__PURE__ */ new Set()),
|
|
63513
|
-
files
|
|
63514
|
-
};
|
|
63515
|
-
}
|
|
63516
|
-
function isPlainObject(value) {
|
|
63517
|
-
if (typeof value !== "object" || value === null) {
|
|
63518
|
-
return false;
|
|
63519
|
-
}
|
|
63520
|
-
const prototype = Object.getPrototypeOf(value);
|
|
63521
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
63522
|
-
}
|
|
63523
|
-
|
|
63524
63366
|
// src/runtime/cache/gc.ts
|
|
63525
63367
|
var GarbageCollector = class {
|
|
63526
63368
|
cache;
|
|
@@ -65670,6 +65512,167 @@ function defaultComponentField({
|
|
|
65670
65512
|
// src/runtime/cache/index.ts
|
|
65671
65513
|
var cache_default = new Cache();
|
|
65672
65514
|
|
|
65515
|
+
// src/runtime/client/plugins/fetch.ts
|
|
65516
|
+
var fetch2 = (target) => {
|
|
65517
|
+
return () => {
|
|
65518
|
+
return {
|
|
65519
|
+
async network(ctx, { client: client2, initialValue, resolve: resolve2, marshalVariables: marshalVariables2 }) {
|
|
65520
|
+
if (ctx.artifact.kind === ArtifactKind.Fragment) {
|
|
65521
|
+
return resolve2(ctx, initialValue);
|
|
65522
|
+
}
|
|
65523
|
+
const fetch3 = ctx.fetch ?? globalThis.fetch;
|
|
65524
|
+
const fetchParams2 = {
|
|
65525
|
+
name: ctx.name,
|
|
65526
|
+
text: ctx.text,
|
|
65527
|
+
hash: ctx.hash,
|
|
65528
|
+
variables: marshalVariables2(ctx)
|
|
65529
|
+
};
|
|
65530
|
+
let fetchFn = defaultFetch(client2.url, ctx.fetchParams);
|
|
65531
|
+
if (target) {
|
|
65532
|
+
if (typeof target === "string") {
|
|
65533
|
+
fetchFn = defaultFetch(target, ctx.fetchParams);
|
|
65534
|
+
} else {
|
|
65535
|
+
fetchFn = target;
|
|
65536
|
+
}
|
|
65537
|
+
}
|
|
65538
|
+
const result = await fetchFn({
|
|
65539
|
+
fetch: (url, args) => {
|
|
65540
|
+
const newArgs = handleMultipart(fetchParams2, args) ?? args;
|
|
65541
|
+
return fetch3(url, newArgs);
|
|
65542
|
+
},
|
|
65543
|
+
metadata: ctx.metadata,
|
|
65544
|
+
session: ctx.session || {},
|
|
65545
|
+
...fetchParams2
|
|
65546
|
+
});
|
|
65547
|
+
resolve2(ctx, {
|
|
65548
|
+
fetching: false,
|
|
65549
|
+
variables: ctx.variables ?? {},
|
|
65550
|
+
data: result.data,
|
|
65551
|
+
errors: !result.errors || result.errors.length === 0 ? null : result.errors,
|
|
65552
|
+
partial: false,
|
|
65553
|
+
stale: false,
|
|
65554
|
+
source: DataSource.Network
|
|
65555
|
+
});
|
|
65556
|
+
}
|
|
65557
|
+
};
|
|
65558
|
+
};
|
|
65559
|
+
};
|
|
65560
|
+
var defaultFetch = (url, params) => {
|
|
65561
|
+
if (!url) {
|
|
65562
|
+
throw new Error(
|
|
65563
|
+
"Could not find configured client url. Please specify one in your HoudiniClient constructor."
|
|
65564
|
+
);
|
|
65565
|
+
}
|
|
65566
|
+
return async ({ fetch: fetch3, name, text, variables }) => {
|
|
65567
|
+
const result = await fetch3(url, {
|
|
65568
|
+
method: "POST",
|
|
65569
|
+
body: JSON.stringify({ operationName: name, query: text, variables }),
|
|
65570
|
+
...params,
|
|
65571
|
+
headers: {
|
|
65572
|
+
Accept: "application/graphql+json, application/json",
|
|
65573
|
+
"Content-Type": "application/json",
|
|
65574
|
+
...params?.headers
|
|
65575
|
+
}
|
|
65576
|
+
});
|
|
65577
|
+
return await result.json();
|
|
65578
|
+
};
|
|
65579
|
+
};
|
|
65580
|
+
function handleMultipart(params, args) {
|
|
65581
|
+
const { files } = extractFiles({
|
|
65582
|
+
variables: params.variables
|
|
65583
|
+
});
|
|
65584
|
+
if (files.size) {
|
|
65585
|
+
const req = args;
|
|
65586
|
+
let headers = {};
|
|
65587
|
+
if (req?.headers) {
|
|
65588
|
+
const filtered = Object.entries(req?.headers).filter(([key, value]) => {
|
|
65589
|
+
return !(key.toLowerCase() == "content-type" && value.toLowerCase() == "application/json");
|
|
65590
|
+
});
|
|
65591
|
+
headers = Object.fromEntries(filtered);
|
|
65592
|
+
}
|
|
65593
|
+
const form = new FormData();
|
|
65594
|
+
if (args && args?.body) {
|
|
65595
|
+
form.set("operations", args?.body);
|
|
65596
|
+
} else {
|
|
65597
|
+
form.set(
|
|
65598
|
+
"operations",
|
|
65599
|
+
JSON.stringify({
|
|
65600
|
+
operationName: params.name,
|
|
65601
|
+
query: params.text,
|
|
65602
|
+
variables: params.variables
|
|
65603
|
+
})
|
|
65604
|
+
);
|
|
65605
|
+
}
|
|
65606
|
+
const map = {};
|
|
65607
|
+
let i2 = 0;
|
|
65608
|
+
files.forEach((paths) => {
|
|
65609
|
+
map[++i2] = paths;
|
|
65610
|
+
});
|
|
65611
|
+
form.set("map", JSON.stringify(map));
|
|
65612
|
+
i2 = 0;
|
|
65613
|
+
files.forEach((paths, file) => {
|
|
65614
|
+
form.set(`${++i2}`, file, file.name);
|
|
65615
|
+
});
|
|
65616
|
+
return { ...req, headers, body: form };
|
|
65617
|
+
}
|
|
65618
|
+
}
|
|
65619
|
+
function isExtractableFile(value) {
|
|
65620
|
+
return typeof File !== "undefined" && value instanceof File || typeof Blob !== "undefined" && value instanceof Blob;
|
|
65621
|
+
}
|
|
65622
|
+
function extractFiles(value) {
|
|
65623
|
+
if (!arguments.length)
|
|
65624
|
+
throw new TypeError("Argument 1 `value` is required.");
|
|
65625
|
+
const clones = /* @__PURE__ */ new Map();
|
|
65626
|
+
const files = /* @__PURE__ */ new Map();
|
|
65627
|
+
function recurse(value2, path3, recursed) {
|
|
65628
|
+
if (isExtractableFile(value2)) {
|
|
65629
|
+
const filePaths = files.get(value2);
|
|
65630
|
+
filePaths ? filePaths.push(path3) : files.set(value2, [path3]);
|
|
65631
|
+
return null;
|
|
65632
|
+
}
|
|
65633
|
+
const valueIsList = Array.isArray(value2) || typeof FileList !== "undefined" && value2 instanceof FileList;
|
|
65634
|
+
const valueIsPlainObject = isPlainObject(value2);
|
|
65635
|
+
if (valueIsList || valueIsPlainObject) {
|
|
65636
|
+
let clone2 = clones.get(value2);
|
|
65637
|
+
const uncloned = !clone2;
|
|
65638
|
+
if (uncloned) {
|
|
65639
|
+
clone2 = valueIsList ? [] : value2 instanceof Object ? {} : /* @__PURE__ */ Object.create(null);
|
|
65640
|
+
clones.set(value2, clone2);
|
|
65641
|
+
}
|
|
65642
|
+
if (!recursed.has(value2)) {
|
|
65643
|
+
const pathPrefix = path3 ? `${path3}.` : "";
|
|
65644
|
+
const recursedDeeper = new Set(recursed).add(value2);
|
|
65645
|
+
if (valueIsList) {
|
|
65646
|
+
let index = 0;
|
|
65647
|
+
for (const item of value2) {
|
|
65648
|
+
const itemClone = recurse(item, pathPrefix + index++, recursedDeeper);
|
|
65649
|
+
if (uncloned)
|
|
65650
|
+
clone2.push(itemClone);
|
|
65651
|
+
}
|
|
65652
|
+
} else
|
|
65653
|
+
for (const key in value2) {
|
|
65654
|
+
const propertyClone = recurse(value2[key], pathPrefix + key, recursedDeeper);
|
|
65655
|
+
if (uncloned)
|
|
65656
|
+
clone2[key] = propertyClone;
|
|
65657
|
+
}
|
|
65658
|
+
}
|
|
65659
|
+
return clone2;
|
|
65660
|
+
}
|
|
65661
|
+
return value2;
|
|
65662
|
+
}
|
|
65663
|
+
return {
|
|
65664
|
+
clone: recurse(value, "", /* @__PURE__ */ new Set()),
|
|
65665
|
+
files
|
|
65666
|
+
};
|
|
65667
|
+
}
|
|
65668
|
+
function isPlainObject(value) {
|
|
65669
|
+
if (typeof value !== "object" || value === null) {
|
|
65670
|
+
return false;
|
|
65671
|
+
}
|
|
65672
|
+
const prototype = Object.getPrototypeOf(value);
|
|
65673
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
65674
|
+
}
|
|
65675
|
+
|
|
65673
65676
|
// src/runtime/client/plugins/cache.ts
|
|
65674
65677
|
var serverSide = typeof globalThis.window === "undefined";
|
|
65675
65678
|
var cachePolicy = ({
|
|
@@ -65800,7 +65803,7 @@ var documentPlugin = (kind, source) => {
|
|
|
65800
65803
|
};
|
|
65801
65804
|
|
|
65802
65805
|
// src/runtime/client/plugins/query.ts
|
|
65803
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
65806
|
+
var query = (cache) => documentPlugin(ArtifactKind.Query, function() {
|
|
65804
65807
|
let subscriptionSpec = null;
|
|
65805
65808
|
let lastVariables = null;
|
|
65806
65809
|
return {
|
|
@@ -65828,7 +65831,7 @@ var query = documentPlugin(ArtifactKind.Query, function() {
|
|
|
65828
65831
|
end(ctx, { resolve: resolve2, marshalVariables: marshalVariables2, variablesChanged: variablesChanged2 }) {
|
|
65829
65832
|
if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
65830
65833
|
if (subscriptionSpec) {
|
|
65831
|
-
|
|
65834
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
65832
65835
|
}
|
|
65833
65836
|
lastVariables = { ...marshalVariables2(ctx) };
|
|
65834
65837
|
const variables = lastVariables;
|
|
@@ -65848,13 +65851,13 @@ var query = documentPlugin(ArtifactKind.Query, function() {
|
|
|
65848
65851
|
});
|
|
65849
65852
|
}
|
|
65850
65853
|
};
|
|
65851
|
-
|
|
65854
|
+
cache.subscribe(subscriptionSpec, lastVariables);
|
|
65852
65855
|
}
|
|
65853
65856
|
resolve2(ctx);
|
|
65854
65857
|
},
|
|
65855
65858
|
cleanup() {
|
|
65856
65859
|
if (subscriptionSpec) {
|
|
65857
|
-
|
|
65860
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
65858
65861
|
lastVariables = null;
|
|
65859
65862
|
}
|
|
65860
65863
|
}
|
|
@@ -65862,7 +65865,7 @@ var query = documentPlugin(ArtifactKind.Query, function() {
|
|
|
65862
65865
|
});
|
|
65863
65866
|
|
|
65864
65867
|
// src/runtime/client/plugins/fragment.ts
|
|
65865
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
65868
|
+
var fragment = (cache) => documentPlugin(ArtifactKind.Fragment, function() {
|
|
65866
65869
|
let subscriptionSpec = null;
|
|
65867
65870
|
let lastReference = null;
|
|
65868
65871
|
return {
|
|
@@ -65876,7 +65879,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
65876
65879
|
};
|
|
65877
65880
|
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
|
|
65878
65881
|
if (subscriptionSpec) {
|
|
65879
|
-
|
|
65882
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
65880
65883
|
}
|
|
65881
65884
|
const variables = marshalVariables2(ctx);
|
|
65882
65885
|
subscriptionSpec = {
|
|
@@ -65896,28 +65899,28 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
65896
65899
|
});
|
|
65897
65900
|
}
|
|
65898
65901
|
};
|
|
65899
|
-
|
|
65902
|
+
cache.subscribe(subscriptionSpec, variables);
|
|
65900
65903
|
lastReference = currentReference;
|
|
65901
65904
|
}
|
|
65902
65905
|
next(ctx);
|
|
65903
65906
|
},
|
|
65904
65907
|
cleanup() {
|
|
65905
65908
|
if (subscriptionSpec) {
|
|
65906
|
-
|
|
65909
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
65907
65910
|
}
|
|
65908
65911
|
}
|
|
65909
65912
|
};
|
|
65910
65913
|
});
|
|
65911
65914
|
|
|
65912
65915
|
// src/runtime/client/plugins/mutation.ts
|
|
65913
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
65916
|
+
var mutation = (cache) => documentPlugin(ArtifactKind.Mutation, () => {
|
|
65914
65917
|
return {
|
|
65915
65918
|
async start(ctx, { next, marshalVariables: marshalVariables2 }) {
|
|
65916
|
-
const layerOptimistic =
|
|
65919
|
+
const layerOptimistic = cache._internal_unstable.storage.createLayer(true);
|
|
65917
65920
|
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
65918
65921
|
let toNotify = [];
|
|
65919
65922
|
if (optimisticResponse) {
|
|
65920
|
-
toNotify =
|
|
65923
|
+
toNotify = cache.write({
|
|
65921
65924
|
selection: ctx.artifact.selection,
|
|
65922
65925
|
data: await marshalSelection({
|
|
65923
65926
|
selection: ctx.artifact.selection,
|
|
@@ -65937,7 +65940,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
65937
65940
|
},
|
|
65938
65941
|
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
65939
65942
|
if (ctx.cacheParams?.layer) {
|
|
65940
|
-
|
|
65943
|
+
cache.clearLayer(ctx.cacheParams.layer.id);
|
|
65941
65944
|
}
|
|
65942
65945
|
resolve2(ctx);
|
|
65943
65946
|
},
|
|
@@ -65945,19 +65948,19 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
65945
65948
|
const hasErrors = value.errors && value.errors.length > 0;
|
|
65946
65949
|
if (hasErrors) {
|
|
65947
65950
|
if (ctx.cacheParams?.layer) {
|
|
65948
|
-
|
|
65951
|
+
cache.clearLayer(ctx.cacheParams.layer.id);
|
|
65949
65952
|
}
|
|
65950
65953
|
}
|
|
65951
65954
|
if (ctx.cacheParams?.layer) {
|
|
65952
|
-
|
|
65955
|
+
cache._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
65953
65956
|
}
|
|
65954
65957
|
resolve2(ctx);
|
|
65955
65958
|
},
|
|
65956
65959
|
catch(ctx, { error }) {
|
|
65957
65960
|
if (ctx.cacheParams?.layer) {
|
|
65958
65961
|
const { layer } = ctx.cacheParams;
|
|
65959
|
-
|
|
65960
|
-
|
|
65962
|
+
cache.clearLayer(layer.id);
|
|
65963
|
+
cache._internal_unstable.storage.resolveLayer(layer.id);
|
|
65961
65964
|
}
|
|
65962
65965
|
throw error;
|
|
65963
65966
|
}
|
|
@@ -66483,10 +66486,17 @@ var injectedPlugins_default = plugins;
|
|
|
66483
66486
|
// src/runtime/client/index.ts
|
|
66484
66487
|
var HoudiniClient = class {
|
|
66485
66488
|
url;
|
|
66486
|
-
plugins;
|
|
66487
66489
|
throwOnError_operations;
|
|
66490
|
+
cache = null;
|
|
66491
|
+
throwOnError;
|
|
66492
|
+
fetchParams;
|
|
66493
|
+
pipeline;
|
|
66494
|
+
extraPlugins;
|
|
66488
66495
|
proxies = {};
|
|
66489
66496
|
componentCache = {};
|
|
66497
|
+
setCache(cache) {
|
|
66498
|
+
this.cache = cache;
|
|
66499
|
+
}
|
|
66490
66500
|
constructor({
|
|
66491
66501
|
url,
|
|
66492
66502
|
fetchParams: fetchParams2,
|
|
@@ -66500,23 +66510,29 @@ var HoudiniClient = class {
|
|
|
66500
66510
|
);
|
|
66501
66511
|
}
|
|
66502
66512
|
this.throwOnError_operations = throwOnError2?.operations ?? [];
|
|
66503
|
-
|
|
66513
|
+
let serverPort = globalThis.process?.env?.HOUDINI_PORT ?? "5173";
|
|
66514
|
+
this.url = url ?? (globalThis.window ? "" : `https://localhost:${serverPort}`) + localApiEndpoint(getCurrentConfig());
|
|
66515
|
+
this.throwOnError = throwOnError2;
|
|
66516
|
+
this.fetchParams = fetchParams2;
|
|
66517
|
+
this.pipeline = pipeline2;
|
|
66518
|
+
this.extraPlugins = plugins2;
|
|
66519
|
+
}
|
|
66520
|
+
get plugins() {
|
|
66521
|
+
return flatten(
|
|
66504
66522
|
[].concat(
|
|
66505
|
-
|
|
66506
|
-
fetchParams(
|
|
66507
|
-
|
|
66508
|
-
query,
|
|
66509
|
-
mutation,
|
|
66510
|
-
fragment
|
|
66523
|
+
this.throwOnError ? [throwOnError(this.throwOnError)] : [],
|
|
66524
|
+
fetchParams(this.fetchParams),
|
|
66525
|
+
this.pipeline ?? [
|
|
66526
|
+
query(this.cache ?? cache_default),
|
|
66527
|
+
mutation(this.cache ?? cache_default),
|
|
66528
|
+
fragment(this.cache ?? cache_default)
|
|
66511
66529
|
].concat(
|
|
66512
|
-
|
|
66530
|
+
this.extraPlugins ?? [],
|
|
66513
66531
|
injectedPlugins_default,
|
|
66514
66532
|
fetch2()
|
|
66515
66533
|
)
|
|
66516
66534
|
)
|
|
66517
66535
|
);
|
|
66518
|
-
let serverPort = globalThis.process?.env?.HOUDINI_PORT ?? "5173";
|
|
66519
|
-
this.url = url ?? (globalThis.window ? "" : `https://localhost:${serverPort}`) + localApiEndpoint(getCurrentConfig());
|
|
66520
66536
|
}
|
|
66521
66537
|
observe({
|
|
66522
66538
|
enableCache = true,
|
|
@@ -66528,6 +66544,7 @@ var HoudiniClient = class {
|
|
|
66528
66544
|
plugins: createPluginHooks(this.plugins),
|
|
66529
66545
|
fetching,
|
|
66530
66546
|
enableCache,
|
|
66547
|
+
cache: this.cache ?? void 0,
|
|
66531
66548
|
...rest
|
|
66532
66549
|
});
|
|
66533
66550
|
}
|
|
@@ -66627,7 +66644,7 @@ var Config = class {
|
|
|
66627
66644
|
defaultListTarget = null,
|
|
66628
66645
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
66629
66646
|
defaultKeys,
|
|
66630
|
-
types:
|
|
66647
|
+
types: types5 = {},
|
|
66631
66648
|
logLevel,
|
|
66632
66649
|
defaultFragmentMasking = "enable",
|
|
66633
66650
|
watchSchema,
|
|
@@ -66675,10 +66692,10 @@ var Config = class {
|
|
|
66675
66692
|
if (defaultKeys) {
|
|
66676
66693
|
this.defaultKeys = defaultKeys;
|
|
66677
66694
|
}
|
|
66678
|
-
if (
|
|
66695
|
+
if (types5) {
|
|
66679
66696
|
this.typeConfig = {
|
|
66680
66697
|
...this.typeConfig,
|
|
66681
|
-
...
|
|
66698
|
+
...types5
|
|
66682
66699
|
};
|
|
66683
66700
|
}
|
|
66684
66701
|
}
|
|
@@ -67612,7 +67629,7 @@ function operation_requires_variables(operation) {
|
|
|
67612
67629
|
)
|
|
67613
67630
|
);
|
|
67614
67631
|
}
|
|
67615
|
-
function unwrapType(config, type, wrappers = []) {
|
|
67632
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
67616
67633
|
if (type.kind === "NonNullType") {
|
|
67617
67634
|
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
67618
67635
|
}
|
|
@@ -67628,6 +67645,11 @@ function unwrapType(config, type, wrappers = []) {
|
|
|
67628
67645
|
if (type instanceof graphql3.GraphQLList) {
|
|
67629
67646
|
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
67630
67647
|
}
|
|
67648
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
67649
|
+
type = config.schema.getType(
|
|
67650
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
67651
|
+
);
|
|
67652
|
+
}
|
|
67631
67653
|
const namedType = config.schema.getType(type.name.value || type.name);
|
|
67632
67654
|
if (!namedType) {
|
|
67633
67655
|
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
@@ -67954,6 +67976,152 @@ function escape2(str) {
|
|
|
67954
67976
|
return str.normalize().replace(/[[\]]/g, "\\$&").replace(/%/g, "%25").replace(/\//g, "%2[Ff]").replace(/\?/g, "%3[Ff]").replace(/#/g, "%23").replace(/[.*+?^${}()|\\]/g, "\\$&");
|
|
67955
67977
|
}
|
|
67956
67978
|
|
|
67979
|
+
// src/lib/typescript.ts
|
|
67980
|
+
var recast2 = __toESM(require_main2(), 1);
|
|
67981
|
+
import * as graphql4 from "graphql";
|
|
67982
|
+
var AST2 = recast2.types.builders;
|
|
67983
|
+
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
67984
|
+
type,
|
|
67985
|
+
wrappers
|
|
67986
|
+
}, body) {
|
|
67987
|
+
let result;
|
|
67988
|
+
if (graphql4.isScalarType(type)) {
|
|
67989
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
67990
|
+
} else if (graphql4.isEnumType(type)) {
|
|
67991
|
+
result = enumReference(config, body, type.name);
|
|
67992
|
+
} else {
|
|
67993
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
67994
|
+
}
|
|
67995
|
+
for (const toWrap of wrappers) {
|
|
67996
|
+
if (toWrap === "NonNull" /* NonNull */) {
|
|
67997
|
+
continue;
|
|
67998
|
+
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
67999
|
+
result = nullableField(result, true);
|
|
68000
|
+
} else if (toWrap === "List" /* List */) {
|
|
68001
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
68002
|
+
}
|
|
68003
|
+
}
|
|
68004
|
+
return result;
|
|
68005
|
+
}
|
|
68006
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
68007
|
+
const { type, wrappers } = unwrapType(config, definition.type);
|
|
68008
|
+
return unwrappedTsTypeReference(
|
|
68009
|
+
config,
|
|
68010
|
+
filepath,
|
|
68011
|
+
missingScalars,
|
|
68012
|
+
{ type, wrappers },
|
|
68013
|
+
body
|
|
68014
|
+
);
|
|
68015
|
+
}
|
|
68016
|
+
function enumReference(config, body, name) {
|
|
68017
|
+
ensureImports({
|
|
68018
|
+
config,
|
|
68019
|
+
body,
|
|
68020
|
+
import: ["ValueOf"],
|
|
68021
|
+
importKind: "type",
|
|
68022
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
68023
|
+
});
|
|
68024
|
+
return AST2.tsTypeReference(
|
|
68025
|
+
AST2.identifier("ValueOf"),
|
|
68026
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
68027
|
+
);
|
|
68028
|
+
}
|
|
68029
|
+
function readonlyProperty(prop, enable = true) {
|
|
68030
|
+
if (enable) {
|
|
68031
|
+
prop.readonly = true;
|
|
68032
|
+
}
|
|
68033
|
+
return prop;
|
|
68034
|
+
}
|
|
68035
|
+
function nullableField(inner, input = false) {
|
|
68036
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
68037
|
+
if (input) {
|
|
68038
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
68039
|
+
}
|
|
68040
|
+
return AST2.tsUnionType(members);
|
|
68041
|
+
}
|
|
68042
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
68043
|
+
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
68044
|
+
if (!field) {
|
|
68045
|
+
return AST2.tsNeverKeyword();
|
|
68046
|
+
}
|
|
68047
|
+
const component = config.componentFields[field.parent][field.field];
|
|
68048
|
+
const sourcePathRelative = path_exports.relative(
|
|
68049
|
+
path_exports.join(config.projectRoot, "src"),
|
|
68050
|
+
component.filepath
|
|
68051
|
+
);
|
|
68052
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
68053
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
68054
|
+
const localImport = ensureImports({
|
|
68055
|
+
config,
|
|
68056
|
+
body,
|
|
68057
|
+
import: "__component__" + component.fragment,
|
|
68058
|
+
sourceModule: path_exports.join(
|
|
68059
|
+
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
68060
|
+
"src",
|
|
68061
|
+
sourcePath
|
|
68062
|
+
)
|
|
68063
|
+
}) ?? "__component__" + component.fragment;
|
|
68064
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
68065
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68066
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
68067
|
+
]);
|
|
68068
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
68069
|
+
parameters,
|
|
68070
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
68071
|
+
);
|
|
68072
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
68073
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68074
|
+
indexed,
|
|
68075
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
68076
|
+
]);
|
|
68077
|
+
const arg = AST2.identifier("props");
|
|
68078
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
68079
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
68080
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68081
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
68082
|
+
]);
|
|
68083
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
68084
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
68085
|
+
return fnType;
|
|
68086
|
+
}
|
|
68087
|
+
switch (target.name) {
|
|
68088
|
+
case "String": {
|
|
68089
|
+
return AST2.tsStringKeyword();
|
|
68090
|
+
}
|
|
68091
|
+
case "Int": {
|
|
68092
|
+
return AST2.tsNumberKeyword();
|
|
68093
|
+
}
|
|
68094
|
+
case "Float": {
|
|
68095
|
+
return AST2.tsNumberKeyword();
|
|
68096
|
+
}
|
|
68097
|
+
case "Boolean": {
|
|
68098
|
+
return AST2.tsBooleanKeyword();
|
|
68099
|
+
}
|
|
68100
|
+
case "ID": {
|
|
68101
|
+
return AST2.tsStringKeyword();
|
|
68102
|
+
}
|
|
68103
|
+
default: {
|
|
68104
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
68105
|
+
return scalarPropertyValue(
|
|
68106
|
+
config,
|
|
68107
|
+
filepath,
|
|
68108
|
+
missingScalars,
|
|
68109
|
+
target.ofType,
|
|
68110
|
+
body,
|
|
68111
|
+
field
|
|
68112
|
+
);
|
|
68113
|
+
}
|
|
68114
|
+
if (config.scalars?.[target.name]) {
|
|
68115
|
+
return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
|
|
68116
|
+
}
|
|
68117
|
+
if (target.name !== config.componentScalar) {
|
|
68118
|
+
missingScalars.add(target.name);
|
|
68119
|
+
}
|
|
68120
|
+
return AST2.tsAnyKeyword();
|
|
68121
|
+
}
|
|
68122
|
+
}
|
|
68123
|
+
}
|
|
68124
|
+
|
|
67957
68125
|
// ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
|
|
67958
68126
|
var WalkerBase = class {
|
|
67959
68127
|
constructor() {
|
|
@@ -68067,7 +68235,7 @@ async function asyncWalk(ast, { enter, leave }) {
|
|
|
68067
68235
|
}
|
|
68068
68236
|
|
|
68069
68237
|
// src/lib/walk.ts
|
|
68070
|
-
import * as
|
|
68238
|
+
import * as graphql5 from "graphql";
|
|
68071
68239
|
async function find_graphql(config, parsedScript, walker) {
|
|
68072
68240
|
await asyncWalk(parsedScript, {
|
|
68073
68241
|
async enter(node, parent) {
|
|
@@ -68122,7 +68290,7 @@ async function find_graphql(config, parsedScript, walker) {
|
|
|
68122
68290
|
} else if (!documentString) {
|
|
68123
68291
|
return;
|
|
68124
68292
|
}
|
|
68125
|
-
const parsedTag =
|
|
68293
|
+
const parsedTag = graphql5.parse(documentString);
|
|
68126
68294
|
if (walker.where && !walker.where(parsedTag, { node, parent })) {
|
|
68127
68295
|
return;
|
|
68128
68296
|
}
|
|
@@ -68254,7 +68422,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
68254
68422
|
};
|
|
68255
68423
|
return defs.concat([
|
|
68256
68424
|
{
|
|
68257
|
-
raw:
|
|
68425
|
+
raw: graphql5.print(parsed),
|
|
68258
68426
|
parsed
|
|
68259
68427
|
}
|
|
68260
68428
|
]);
|
|
@@ -68395,7 +68563,7 @@ function serialized_manifest_path(config, base = base_dir(config)) {
|
|
|
68395
68563
|
|
|
68396
68564
|
// src/lib/router/manifest.ts
|
|
68397
68565
|
var t2 = __toESM(require_lib6(), 1);
|
|
68398
|
-
import * as
|
|
68566
|
+
import * as graphql6 from "graphql";
|
|
68399
68567
|
async function load_manifest(args) {
|
|
68400
68568
|
const manifest = await walk_routes({
|
|
68401
68569
|
config: args.config,
|
|
@@ -68412,7 +68580,8 @@ async function load_manifest(args) {
|
|
|
68412
68580
|
local_yoga: false
|
|
68413
68581
|
},
|
|
68414
68582
|
queries: [],
|
|
68415
|
-
layouts: []
|
|
68583
|
+
layouts: [],
|
|
68584
|
+
variables: {}
|
|
68416
68585
|
});
|
|
68417
68586
|
if (args.includeArtifacts) {
|
|
68418
68587
|
try {
|
|
@@ -68443,6 +68612,7 @@ async function walk_routes(args) {
|
|
|
68443
68612
|
const directory_contents = await fs_exports.readdir(args.filepath, {
|
|
68444
68613
|
withFileTypes: true
|
|
68445
68614
|
});
|
|
68615
|
+
const variables = { ...args.variables };
|
|
68446
68616
|
let newLayouts = args.layouts;
|
|
68447
68617
|
let newLayoutQueries = args.queries;
|
|
68448
68618
|
let layout = null;
|
|
@@ -68466,7 +68636,8 @@ async function walk_routes(args) {
|
|
|
68466
68636
|
url: args.url,
|
|
68467
68637
|
project: args.project,
|
|
68468
68638
|
type: "layout",
|
|
68469
|
-
contents: layoutQueryContents
|
|
68639
|
+
contents: layoutQueryContents,
|
|
68640
|
+
variables
|
|
68470
68641
|
});
|
|
68471
68642
|
newLayoutQueries = [...args.queries, layoutQuery.name];
|
|
68472
68643
|
}
|
|
@@ -68479,7 +68650,8 @@ async function walk_routes(args) {
|
|
|
68479
68650
|
contents: layoutViewContents,
|
|
68480
68651
|
layouts: args.layouts,
|
|
68481
68652
|
queries: newLayoutQueries,
|
|
68482
|
-
config: args.config
|
|
68653
|
+
config: args.config,
|
|
68654
|
+
variables
|
|
68483
68655
|
});
|
|
68484
68656
|
newLayouts = [...args.layouts, page_id(layout.url)];
|
|
68485
68657
|
}
|
|
@@ -68490,7 +68662,8 @@ async function walk_routes(args) {
|
|
|
68490
68662
|
url: args.url,
|
|
68491
68663
|
project: args.project,
|
|
68492
68664
|
type: "page",
|
|
68493
|
-
contents: pageQueryContents
|
|
68665
|
+
contents: pageQueryContents,
|
|
68666
|
+
variables
|
|
68494
68667
|
});
|
|
68495
68668
|
}
|
|
68496
68669
|
if (pageViewContents) {
|
|
@@ -68502,7 +68675,8 @@ async function walk_routes(args) {
|
|
|
68502
68675
|
contents: pageViewContents,
|
|
68503
68676
|
layouts: newLayouts,
|
|
68504
68677
|
queries: pageQuery ? [...newLayoutQueries, pageQuery.name] : newLayoutQueries,
|
|
68505
|
-
config: args.config
|
|
68678
|
+
config: args.config,
|
|
68679
|
+
variables
|
|
68506
68680
|
});
|
|
68507
68681
|
}
|
|
68508
68682
|
await Promise.all(
|
|
@@ -68515,7 +68689,8 @@ async function walk_routes(args) {
|
|
|
68515
68689
|
filepath: path_exports.join(args.filepath, dir.name),
|
|
68516
68690
|
url: `${args.url}${dir.name}/`,
|
|
68517
68691
|
queries: newLayoutQueries,
|
|
68518
|
-
layouts: newLayouts
|
|
68692
|
+
layouts: newLayouts,
|
|
68693
|
+
variables
|
|
68519
68694
|
});
|
|
68520
68695
|
})
|
|
68521
68696
|
);
|
|
@@ -68537,12 +68712,18 @@ async function add_view(args) {
|
|
|
68537
68712
|
url: args.url,
|
|
68538
68713
|
layouts: args.layouts,
|
|
68539
68714
|
path: path_exports.relative(args.config.projectRoot, args.path),
|
|
68540
|
-
query_options: args.queries
|
|
68715
|
+
query_options: args.queries,
|
|
68716
|
+
params: Object.fromEntries(
|
|
68717
|
+
parse_page_pattern(args.url).params.map((param) => [
|
|
68718
|
+
param.name,
|
|
68719
|
+
args.variables[param.name] ?? null
|
|
68720
|
+
])
|
|
68721
|
+
)
|
|
68541
68722
|
};
|
|
68542
68723
|
return target[id];
|
|
68543
68724
|
}
|
|
68544
68725
|
async function add_query(args) {
|
|
68545
|
-
const parsed =
|
|
68726
|
+
const parsed = graphql6.parse(args.contents);
|
|
68546
68727
|
const query2 = parsed.definitions.find(
|
|
68547
68728
|
(def) => def.kind === "OperationDefinition" && def.operation === "query"
|
|
68548
68729
|
);
|
|
@@ -68550,20 +68731,30 @@ async function add_query(args) {
|
|
|
68550
68731
|
throw new Error("No query found");
|
|
68551
68732
|
}
|
|
68552
68733
|
let loading = false;
|
|
68553
|
-
await
|
|
68734
|
+
await graphql6.visit(parsed, {
|
|
68554
68735
|
Directive(node) {
|
|
68555
68736
|
if (node.name.value === args.config.loadingDirective) {
|
|
68556
68737
|
loading = true;
|
|
68557
68738
|
}
|
|
68558
68739
|
}
|
|
68559
68740
|
});
|
|
68741
|
+
const queryVariables = Object.fromEntries(
|
|
68742
|
+
query2.variableDefinitions?.map((variable) => {
|
|
68743
|
+
const { type, wrappers } = unwrapType(args.config, variable.type, [], true);
|
|
68744
|
+
return [
|
|
68745
|
+
variable.variable.name.value,
|
|
68746
|
+
{ wrappers, type: type.name }
|
|
68747
|
+
];
|
|
68748
|
+
}) ?? []
|
|
68749
|
+
);
|
|
68750
|
+
Object.assign(args.variables, queryVariables);
|
|
68560
68751
|
const target = args.type === "page" ? args.project.page_queries : args.project.layout_queries;
|
|
68561
68752
|
target[page_id(args.url)] = {
|
|
68562
68753
|
path: path_exports.relative(args.config.routesDir, args.path),
|
|
68563
68754
|
name: query2.name.value,
|
|
68564
68755
|
url: args.url,
|
|
68565
68756
|
loading,
|
|
68566
|
-
variables:
|
|
68757
|
+
variables: queryVariables
|
|
68567
68758
|
};
|
|
68568
68759
|
return target[page_id(args.url)];
|
|
68569
68760
|
}
|
|
@@ -68955,6 +69146,7 @@ export {
|
|
|
68955
69146
|
detectTools,
|
|
68956
69147
|
ensureArtifactImport,
|
|
68957
69148
|
ensureImports,
|
|
69149
|
+
enumReference,
|
|
68958
69150
|
exec,
|
|
68959
69151
|
extractHeaders,
|
|
68960
69152
|
extractHeadersStr,
|
|
@@ -68984,6 +69176,7 @@ export {
|
|
|
68984
69176
|
localApiEndpoint,
|
|
68985
69177
|
localApiSessionKeys,
|
|
68986
69178
|
mutation,
|
|
69179
|
+
nullableField,
|
|
68987
69180
|
operation_requires_variables,
|
|
68988
69181
|
orderedPlugins,
|
|
68989
69182
|
parentField,
|
|
@@ -68998,12 +69191,16 @@ export {
|
|
|
68998
69191
|
pullSchema,
|
|
68999
69192
|
query,
|
|
69000
69193
|
readConfigFile,
|
|
69194
|
+
readonlyProperty,
|
|
69001
69195
|
conventions_exports as routerConventions,
|
|
69002
69196
|
runPipeline,
|
|
69197
|
+
scalarPropertyValue,
|
|
69003
69198
|
setMockConfig,
|
|
69004
69199
|
siteURL,
|
|
69005
69200
|
subscription,
|
|
69201
|
+
tsTypeReference,
|
|
69006
69202
|
unwrapType,
|
|
69203
|
+
unwrappedTsTypeReference,
|
|
69007
69204
|
wrapType
|
|
69008
69205
|
};
|
|
69009
69206
|
/*!
|