houdini-svelte 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/plugin/fsPatch.d.ts +13 -1
- package/build/plugin-cjs/index.js +661 -508
- package/build/plugin-esm/index.js +661 -508
- package/build/preprocess-cjs/index.js +621 -467
- package/build/preprocess-esm/index.js +621 -467
- package/build/test-cjs/index.js +620 -273
- package/build/test-esm/index.js +620 -273
- package/package.json +5 -5
|
@@ -86460,7 +86460,18 @@ var ListManager = class {
|
|
|
86460
86460
|
}
|
|
86461
86461
|
lists = /* @__PURE__ */ new Map();
|
|
86462
86462
|
listsByField = /* @__PURE__ */ new Map();
|
|
86463
|
-
get(listName, id2, allLists) {
|
|
86463
|
+
get(listName, id2, allLists, skipMatches) {
|
|
86464
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
86465
|
+
if (!lists) {
|
|
86466
|
+
return null;
|
|
86467
|
+
}
|
|
86468
|
+
if (skipMatches) {
|
|
86469
|
+
return new ListCollection(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
86470
|
+
} else {
|
|
86471
|
+
return lists;
|
|
86472
|
+
}
|
|
86473
|
+
}
|
|
86474
|
+
getLists(listName, id2, allLists) {
|
|
86464
86475
|
const matches = this.lists.get(listName);
|
|
86465
86476
|
if (!matches || matches.size === 0) {
|
|
86466
86477
|
return null;
|
|
@@ -86582,6 +86593,9 @@ var List = class {
|
|
|
86582
86593
|
this.manager = manager;
|
|
86583
86594
|
this.abstract = abstract;
|
|
86584
86595
|
}
|
|
86596
|
+
get fieldRef() {
|
|
86597
|
+
return `${this.recordID}.${this.key}`;
|
|
86598
|
+
}
|
|
86585
86599
|
when(when) {
|
|
86586
86600
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
86587
86601
|
}
|
|
@@ -87726,8 +87740,8 @@ var Cache = class {
|
|
|
87726
87740
|
variables
|
|
87727
87741
|
);
|
|
87728
87742
|
}
|
|
87729
|
-
list(name, parentID, allLists) {
|
|
87730
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
87743
|
+
list(name, parentID, allLists, skipMatches) {
|
|
87744
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
87731
87745
|
if (!handler) {
|
|
87732
87746
|
throw new Error(
|
|
87733
87747
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -88142,6 +88156,7 @@ var CacheInternal = class {
|
|
|
88142
88156
|
});
|
|
88143
88157
|
}
|
|
88144
88158
|
}
|
|
88159
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
88145
88160
|
for (const operation of operations || []) {
|
|
88146
88161
|
let parentID;
|
|
88147
88162
|
if (operation.parentID) {
|
|
@@ -88161,7 +88176,12 @@ var CacheInternal = class {
|
|
|
88161
88176
|
const targets = Array.isArray(value) ? value : [value];
|
|
88162
88177
|
for (const target of targets) {
|
|
88163
88178
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
88164
|
-
this.cache.list(
|
|
88179
|
+
this.cache.list(
|
|
88180
|
+
operation.list,
|
|
88181
|
+
parentID,
|
|
88182
|
+
operation.target === "all",
|
|
88183
|
+
processedOperations
|
|
88184
|
+
).when(operation.when).addToList(
|
|
88165
88185
|
fieldSelection,
|
|
88166
88186
|
target,
|
|
88167
88187
|
variables,
|
|
@@ -88169,7 +88189,12 @@ var CacheInternal = class {
|
|
|
88169
88189
|
layer
|
|
88170
88190
|
);
|
|
88171
88191
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
88172
|
-
this.cache.list(
|
|
88192
|
+
this.cache.list(
|
|
88193
|
+
operation.list,
|
|
88194
|
+
parentID,
|
|
88195
|
+
operation.target === "all",
|
|
88196
|
+
processedOperations
|
|
88197
|
+
).when(operation.when).toggleElement({
|
|
88173
88198
|
selection: fieldSelection,
|
|
88174
88199
|
data: target,
|
|
88175
88200
|
variables,
|
|
@@ -88177,7 +88202,12 @@ var CacheInternal = class {
|
|
|
88177
88202
|
layer
|
|
88178
88203
|
});
|
|
88179
88204
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
88180
|
-
this.cache.list(
|
|
88205
|
+
this.cache.list(
|
|
88206
|
+
operation.list,
|
|
88207
|
+
parentID,
|
|
88208
|
+
operation.target === "all",
|
|
88209
|
+
processedOperations
|
|
88210
|
+
).when(operation.when).remove(target, variables, layer);
|
|
88181
88211
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
88182
88212
|
const targetID = this.id(operation.type, target);
|
|
88183
88213
|
if (!targetID) {
|
|
@@ -88189,6 +88219,16 @@ var CacheInternal = class {
|
|
|
88189
88219
|
this.cache.delete(targetID, layer);
|
|
88190
88220
|
}
|
|
88191
88221
|
}
|
|
88222
|
+
if (operation.list) {
|
|
88223
|
+
const matchingLists = this.cache.list(
|
|
88224
|
+
operation.list,
|
|
88225
|
+
parentID,
|
|
88226
|
+
operation.target === "all"
|
|
88227
|
+
);
|
|
88228
|
+
for (const list3 of matchingLists.lists) {
|
|
88229
|
+
processedOperations.add(list3.fieldRef);
|
|
88230
|
+
}
|
|
88231
|
+
}
|
|
88192
88232
|
}
|
|
88193
88233
|
}
|
|
88194
88234
|
return toNotify;
|
|
@@ -108838,30 +108878,30 @@ var require_utils5 = __commonJS3({
|
|
|
108838
108878
|
validate3.oneOf = values;
|
|
108839
108879
|
return validate3;
|
|
108840
108880
|
}
|
|
108841
|
-
function assertNodeType(...
|
|
108881
|
+
function assertNodeType(...types18) {
|
|
108842
108882
|
function validate3(node, key2, val) {
|
|
108843
|
-
for (const type of
|
|
108883
|
+
for (const type of types18) {
|
|
108844
108884
|
if ((0, _is.default)(type, val)) {
|
|
108845
108885
|
(0, _validate.validateChild)(node, key2, val);
|
|
108846
108886
|
return;
|
|
108847
108887
|
}
|
|
108848
108888
|
}
|
|
108849
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
108889
|
+
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(types18)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
108850
108890
|
}
|
|
108851
|
-
validate3.oneOfNodeTypes =
|
|
108891
|
+
validate3.oneOfNodeTypes = types18;
|
|
108852
108892
|
return validate3;
|
|
108853
108893
|
}
|
|
108854
|
-
function assertNodeOrValueType(...
|
|
108894
|
+
function assertNodeOrValueType(...types18) {
|
|
108855
108895
|
function validate3(node, key2, val) {
|
|
108856
|
-
for (const type of
|
|
108896
|
+
for (const type of types18) {
|
|
108857
108897
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
108858
108898
|
(0, _validate.validateChild)(node, key2, val);
|
|
108859
108899
|
return;
|
|
108860
108900
|
}
|
|
108861
108901
|
}
|
|
108862
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
108902
|
+
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(types18)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
108863
108903
|
}
|
|
108864
|
-
validate3.oneOfNodeOrValueTypes =
|
|
108904
|
+
validate3.oneOfNodeOrValueTypes = types18;
|
|
108865
108905
|
return validate3;
|
|
108866
108906
|
}
|
|
108867
108907
|
function assertValueType(type) {
|
|
@@ -113265,10 +113305,10 @@ var require_generated22 = __commonJS3({
|
|
|
113265
113305
|
body
|
|
113266
113306
|
});
|
|
113267
113307
|
}
|
|
113268
|
-
function intersectionTypeAnnotation(
|
|
113308
|
+
function intersectionTypeAnnotation(types18) {
|
|
113269
113309
|
return (0, _validateNode.default)({
|
|
113270
113310
|
type: "IntersectionTypeAnnotation",
|
|
113271
|
-
types:
|
|
113311
|
+
types: types18
|
|
113272
113312
|
});
|
|
113273
113313
|
}
|
|
113274
113314
|
function mixedTypeAnnotation() {
|
|
@@ -113391,10 +113431,10 @@ var require_generated22 = __commonJS3({
|
|
|
113391
113431
|
type: "ThisTypeAnnotation"
|
|
113392
113432
|
};
|
|
113393
113433
|
}
|
|
113394
|
-
function tupleTypeAnnotation(
|
|
113434
|
+
function tupleTypeAnnotation(types18) {
|
|
113395
113435
|
return (0, _validateNode.default)({
|
|
113396
113436
|
type: "TupleTypeAnnotation",
|
|
113397
|
-
types:
|
|
113437
|
+
types: types18
|
|
113398
113438
|
});
|
|
113399
113439
|
}
|
|
113400
113440
|
function typeofTypeAnnotation(argument) {
|
|
@@ -113445,10 +113485,10 @@ var require_generated22 = __commonJS3({
|
|
|
113445
113485
|
params
|
|
113446
113486
|
});
|
|
113447
113487
|
}
|
|
113448
|
-
function unionTypeAnnotation(
|
|
113488
|
+
function unionTypeAnnotation(types18) {
|
|
113449
113489
|
return (0, _validateNode.default)({
|
|
113450
113490
|
type: "UnionTypeAnnotation",
|
|
113451
|
-
types:
|
|
113491
|
+
types: types18
|
|
113452
113492
|
});
|
|
113453
113493
|
}
|
|
113454
113494
|
function variance(kind) {
|
|
@@ -113961,16 +114001,16 @@ var require_generated22 = __commonJS3({
|
|
|
113961
114001
|
optional
|
|
113962
114002
|
});
|
|
113963
114003
|
}
|
|
113964
|
-
function tsUnionType(
|
|
114004
|
+
function tsUnionType(types18) {
|
|
113965
114005
|
return (0, _validateNode.default)({
|
|
113966
114006
|
type: "TSUnionType",
|
|
113967
|
-
types:
|
|
114007
|
+
types: types18
|
|
113968
114008
|
});
|
|
113969
114009
|
}
|
|
113970
|
-
function tsIntersectionType(
|
|
114010
|
+
function tsIntersectionType(types18) {
|
|
113971
114011
|
return (0, _validateNode.default)({
|
|
113972
114012
|
type: "TSIntersectionType",
|
|
113973
|
-
types:
|
|
114013
|
+
types: types18
|
|
113974
114014
|
});
|
|
113975
114015
|
}
|
|
113976
114016
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -115571,12 +115611,12 @@ var require_removeTypeDuplicates3 = __commonJS3({
|
|
|
115571
115611
|
const generics = /* @__PURE__ */ new Map();
|
|
115572
115612
|
const bases = /* @__PURE__ */ new Map();
|
|
115573
115613
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
115574
|
-
const
|
|
115614
|
+
const types18 = [];
|
|
115575
115615
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
115576
115616
|
const node = nodes[i22];
|
|
115577
115617
|
if (!node)
|
|
115578
115618
|
continue;
|
|
115579
|
-
if (
|
|
115619
|
+
if (types18.indexOf(node) >= 0) {
|
|
115580
115620
|
continue;
|
|
115581
115621
|
}
|
|
115582
115622
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -115610,15 +115650,15 @@ var require_removeTypeDuplicates3 = __commonJS3({
|
|
|
115610
115650
|
}
|
|
115611
115651
|
continue;
|
|
115612
115652
|
}
|
|
115613
|
-
|
|
115653
|
+
types18.push(node);
|
|
115614
115654
|
}
|
|
115615
115655
|
for (const [, baseType] of bases) {
|
|
115616
|
-
|
|
115656
|
+
types18.push(baseType);
|
|
115617
115657
|
}
|
|
115618
115658
|
for (const [, genericName] of generics) {
|
|
115619
|
-
|
|
115659
|
+
types18.push(genericName);
|
|
115620
115660
|
}
|
|
115621
|
-
return
|
|
115661
|
+
return types18;
|
|
115622
115662
|
}
|
|
115623
115663
|
}
|
|
115624
115664
|
});
|
|
@@ -115631,8 +115671,8 @@ var require_createFlowUnionType2 = __commonJS3({
|
|
|
115631
115671
|
exports.default = createFlowUnionType;
|
|
115632
115672
|
var _generated = require_generated22();
|
|
115633
115673
|
var _removeTypeDuplicates = require_removeTypeDuplicates3();
|
|
115634
|
-
function createFlowUnionType(
|
|
115635
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
115674
|
+
function createFlowUnionType(types18) {
|
|
115675
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
115636
115676
|
if (flattened.length === 1) {
|
|
115637
115677
|
return flattened[0];
|
|
115638
115678
|
} else {
|
|
@@ -115657,12 +115697,12 @@ var require_removeTypeDuplicates22 = __commonJS3({
|
|
|
115657
115697
|
const generics = /* @__PURE__ */ new Map();
|
|
115658
115698
|
const bases = /* @__PURE__ */ new Map();
|
|
115659
115699
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
115660
|
-
const
|
|
115700
|
+
const types18 = [];
|
|
115661
115701
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
115662
115702
|
const node = nodes[i22];
|
|
115663
115703
|
if (!node)
|
|
115664
115704
|
continue;
|
|
115665
|
-
if (
|
|
115705
|
+
if (types18.indexOf(node) >= 0) {
|
|
115666
115706
|
continue;
|
|
115667
115707
|
}
|
|
115668
115708
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -115696,15 +115736,15 @@ var require_removeTypeDuplicates22 = __commonJS3({
|
|
|
115696
115736
|
}
|
|
115697
115737
|
continue;
|
|
115698
115738
|
}
|
|
115699
|
-
|
|
115739
|
+
types18.push(node);
|
|
115700
115740
|
}
|
|
115701
115741
|
for (const [, baseType] of bases) {
|
|
115702
|
-
|
|
115742
|
+
types18.push(baseType);
|
|
115703
115743
|
}
|
|
115704
115744
|
for (const [, genericName] of generics) {
|
|
115705
|
-
|
|
115745
|
+
types18.push(genericName);
|
|
115706
115746
|
}
|
|
115707
|
-
return
|
|
115747
|
+
return types18;
|
|
115708
115748
|
}
|
|
115709
115749
|
}
|
|
115710
115750
|
});
|
|
@@ -115719,10 +115759,10 @@ var require_createTSUnionType2 = __commonJS3({
|
|
|
115719
115759
|
var _removeTypeDuplicates = require_removeTypeDuplicates22();
|
|
115720
115760
|
var _index = require_generated5();
|
|
115721
115761
|
function createTSUnionType(typeAnnotations) {
|
|
115722
|
-
const
|
|
115762
|
+
const types18 = typeAnnotations.map((type) => {
|
|
115723
115763
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
115724
115764
|
});
|
|
115725
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
115765
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
115726
115766
|
if (flattened.length === 1) {
|
|
115727
115767
|
return flattened[0];
|
|
115728
115768
|
} else {
|
|
@@ -119986,14 +120026,14 @@ var require_lib62 = __commonJS3({
|
|
|
119986
120026
|
this.preserveSpace = !!preserveSpace;
|
|
119987
120027
|
}
|
|
119988
120028
|
};
|
|
119989
|
-
var
|
|
120029
|
+
var types18 = {
|
|
119990
120030
|
brace: new TokContext3("{"),
|
|
119991
120031
|
j_oTag: new TokContext3("<tag"),
|
|
119992
120032
|
j_cTag: new TokContext3("</tag"),
|
|
119993
120033
|
j_expr: new TokContext3("<tag>...</tag>", true)
|
|
119994
120034
|
};
|
|
119995
120035
|
{
|
|
119996
|
-
|
|
120036
|
+
types18.template = new TokContext3("`", true);
|
|
119997
120037
|
}
|
|
119998
120038
|
var beforeExpr2 = true;
|
|
119999
120039
|
var startsExpr2 = true;
|
|
@@ -120531,17 +120571,17 @@ var require_lib62 = __commonJS3({
|
|
|
120531
120571
|
context.pop();
|
|
120532
120572
|
};
|
|
120533
120573
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
120534
|
-
context.push(
|
|
120574
|
+
context.push(types18.brace);
|
|
120535
120575
|
};
|
|
120536
120576
|
tokenTypes[22].updateContext = (context) => {
|
|
120537
|
-
if (context[context.length - 1] ===
|
|
120577
|
+
if (context[context.length - 1] === types18.template) {
|
|
120538
120578
|
context.pop();
|
|
120539
120579
|
} else {
|
|
120540
|
-
context.push(
|
|
120580
|
+
context.push(types18.template);
|
|
120541
120581
|
}
|
|
120542
120582
|
};
|
|
120543
120583
|
tokenTypes[142].updateContext = (context) => {
|
|
120544
|
-
context.push(
|
|
120584
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
120545
120585
|
};
|
|
120546
120586
|
}
|
|
120547
120587
|
var nonASCIIidentifierStartChars2 = "\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";
|
|
@@ -121101,7 +121141,7 @@ var require_lib62 = __commonJS3({
|
|
|
121101
121141
|
this.end = 0;
|
|
121102
121142
|
this.lastTokEndLoc = null;
|
|
121103
121143
|
this.lastTokStartLoc = null;
|
|
121104
|
-
this.context = [
|
|
121144
|
+
this.context = [types18.brace];
|
|
121105
121145
|
this.firstInvalidTemplateEscapePos = null;
|
|
121106
121146
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
121107
121147
|
this.tokensLength = 0;
|
|
@@ -124928,7 +124968,7 @@ var require_lib62 = __commonJS3({
|
|
|
124928
124968
|
context
|
|
124929
124969
|
} = this.state;
|
|
124930
124970
|
const currentContext = context[context.length - 1];
|
|
124931
|
-
if (currentContext ===
|
|
124971
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
124932
124972
|
context.pop();
|
|
124933
124973
|
}
|
|
124934
124974
|
}
|
|
@@ -125950,9 +125990,9 @@ var require_lib62 = __commonJS3({
|
|
|
125950
125990
|
switch (this.state.type) {
|
|
125951
125991
|
case 5:
|
|
125952
125992
|
node = this.startNode();
|
|
125953
|
-
this.setContext(
|
|
125993
|
+
this.setContext(types18.brace);
|
|
125954
125994
|
this.next();
|
|
125955
|
-
node = this.jsxParseExpressionContainer(node,
|
|
125995
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
125956
125996
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
125957
125997
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
125958
125998
|
}
|
|
@@ -125971,7 +126011,7 @@ var require_lib62 = __commonJS3({
|
|
|
125971
126011
|
jsxParseSpreadChild(node) {
|
|
125972
126012
|
this.next();
|
|
125973
126013
|
node.expression = this.parseExpression();
|
|
125974
|
-
this.setContext(
|
|
126014
|
+
this.setContext(types18.j_expr);
|
|
125975
126015
|
this.state.canStartJSXElement = true;
|
|
125976
126016
|
this.expect(8);
|
|
125977
126017
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -125991,11 +126031,11 @@ var require_lib62 = __commonJS3({
|
|
|
125991
126031
|
jsxParseAttribute() {
|
|
125992
126032
|
const node = this.startNode();
|
|
125993
126033
|
if (this.match(5)) {
|
|
125994
|
-
this.setContext(
|
|
126034
|
+
this.setContext(types18.brace);
|
|
125995
126035
|
this.next();
|
|
125996
126036
|
this.expect(21);
|
|
125997
126037
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
125998
|
-
this.setContext(
|
|
126038
|
+
this.setContext(types18.j_oTag);
|
|
125999
126039
|
this.state.canStartJSXElement = true;
|
|
126000
126040
|
this.expect(8);
|
|
126001
126041
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -126054,12 +126094,12 @@ var require_lib62 = __commonJS3({
|
|
|
126054
126094
|
break;
|
|
126055
126095
|
case 5: {
|
|
126056
126096
|
const node2 = this.startNode();
|
|
126057
|
-
this.setContext(
|
|
126097
|
+
this.setContext(types18.brace);
|
|
126058
126098
|
this.next();
|
|
126059
126099
|
if (this.match(21)) {
|
|
126060
126100
|
children.push(this.jsxParseSpreadChild(node2));
|
|
126061
126101
|
} else {
|
|
126062
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
126102
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
126063
126103
|
}
|
|
126064
126104
|
break;
|
|
126065
126105
|
}
|
|
@@ -126124,11 +126164,11 @@ var require_lib62 = __commonJS3({
|
|
|
126124
126164
|
}
|
|
126125
126165
|
getTokenFromCode(code2) {
|
|
126126
126166
|
const context = this.curContext();
|
|
126127
|
-
if (context ===
|
|
126167
|
+
if (context === types18.j_expr) {
|
|
126128
126168
|
this.jsxReadToken();
|
|
126129
126169
|
return;
|
|
126130
126170
|
}
|
|
126131
|
-
if (context ===
|
|
126171
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
126132
126172
|
if (isIdentifierStart2(code2)) {
|
|
126133
126173
|
this.jsxReadWord();
|
|
126134
126174
|
return;
|
|
@@ -126138,7 +126178,7 @@ var require_lib62 = __commonJS3({
|
|
|
126138
126178
|
this.finishToken(143);
|
|
126139
126179
|
return;
|
|
126140
126180
|
}
|
|
126141
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
126181
|
+
if ((code2 === 34 || code2 === 39) && context === types18.j_oTag) {
|
|
126142
126182
|
this.jsxReadString(code2);
|
|
126143
126183
|
return;
|
|
126144
126184
|
}
|
|
@@ -126156,17 +126196,17 @@ var require_lib62 = __commonJS3({
|
|
|
126156
126196
|
type
|
|
126157
126197
|
} = this.state;
|
|
126158
126198
|
if (type === 56 && prevType === 142) {
|
|
126159
|
-
context.splice(-2, 2,
|
|
126199
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
126160
126200
|
this.state.canStartJSXElement = false;
|
|
126161
126201
|
} else if (type === 142) {
|
|
126162
|
-
context.push(
|
|
126202
|
+
context.push(types18.j_oTag);
|
|
126163
126203
|
} else if (type === 143) {
|
|
126164
126204
|
const out = context[context.length - 1];
|
|
126165
|
-
if (out ===
|
|
126205
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
126166
126206
|
context.pop();
|
|
126167
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
126207
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
126168
126208
|
} else {
|
|
126169
|
-
this.setContext(
|
|
126209
|
+
this.setContext(types18.j_expr);
|
|
126170
126210
|
this.state.canStartJSXElement = true;
|
|
126171
126211
|
}
|
|
126172
126212
|
} else {
|
|
@@ -127541,14 +127581,14 @@ var require_lib62 = __commonJS3({
|
|
|
127541
127581
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
127542
127582
|
const node = this.startNode();
|
|
127543
127583
|
const hasLeadingOperator = this.eat(operator);
|
|
127544
|
-
const
|
|
127584
|
+
const types19 = [];
|
|
127545
127585
|
do {
|
|
127546
|
-
|
|
127586
|
+
types19.push(parseConstituentType());
|
|
127547
127587
|
} while (this.eat(operator));
|
|
127548
|
-
if (
|
|
127549
|
-
return
|
|
127588
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
127589
|
+
return types19[0];
|
|
127550
127590
|
}
|
|
127551
|
-
node.types =
|
|
127591
|
+
node.types = types19;
|
|
127552
127592
|
return this.finishNode(node, kind);
|
|
127553
127593
|
}
|
|
127554
127594
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -128112,7 +128152,7 @@ var require_lib62 = __commonJS3({
|
|
|
128112
128152
|
}));
|
|
128113
128153
|
if (node.params.length === 0) {
|
|
128114
128154
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
128115
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
128155
|
+
} else if (!this.state.inType && this.curContext() === types18.brace) {
|
|
128116
128156
|
this.reScan_lt_gt();
|
|
128117
128157
|
}
|
|
128118
128158
|
this.expect(48);
|
|
@@ -128738,7 +128778,7 @@ var require_lib62 = __commonJS3({
|
|
|
128738
128778
|
context
|
|
128739
128779
|
} = this.state;
|
|
128740
128780
|
const currentContext = context[context.length - 1];
|
|
128741
|
-
if (currentContext ===
|
|
128781
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
128742
128782
|
context.pop();
|
|
128743
128783
|
}
|
|
128744
128784
|
}
|
|
@@ -133866,9 +133906,9 @@ var require_shared2 = __commonJS3({
|
|
|
133866
133906
|
var tslib_1 = require_tslib2();
|
|
133867
133907
|
var types_1 = tslib_1.__importDefault(require_types2());
|
|
133868
133908
|
function default_1(fork) {
|
|
133869
|
-
var
|
|
133870
|
-
var Type =
|
|
133871
|
-
var builtin =
|
|
133909
|
+
var types18 = fork.use(types_1.default);
|
|
133910
|
+
var Type = types18.Type;
|
|
133911
|
+
var builtin = types18.builtInTypes;
|
|
133872
133912
|
var isNumber = builtin.number;
|
|
133873
133913
|
function geq(than) {
|
|
133874
133914
|
return Type.from(function(value) {
|
|
@@ -134016,9 +134056,9 @@ var require_types2 = __commonJS3({
|
|
|
134016
134056
|
}(BaseType);
|
|
134017
134057
|
var OrType = function(_super) {
|
|
134018
134058
|
tslib_1.__extends(OrType2, _super);
|
|
134019
|
-
function OrType2(
|
|
134059
|
+
function OrType2(types18) {
|
|
134020
134060
|
var _this = _super.call(this) || this;
|
|
134021
|
-
_this.types =
|
|
134061
|
+
_this.types = types18;
|
|
134022
134062
|
_this.kind = "OrType";
|
|
134023
134063
|
return _this;
|
|
134024
134064
|
}
|
|
@@ -134159,11 +134199,11 @@ var require_types2 = __commonJS3({
|
|
|
134159
134199
|
function typesPlugin(_fork) {
|
|
134160
134200
|
var Type = {
|
|
134161
134201
|
or: function() {
|
|
134162
|
-
var
|
|
134202
|
+
var types18 = [];
|
|
134163
134203
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
134164
|
-
|
|
134204
|
+
types18[_i] = arguments[_i];
|
|
134165
134205
|
}
|
|
134166
|
-
return new OrType(
|
|
134206
|
+
return new OrType(types18.map(function(type) {
|
|
134167
134207
|
return Type.from(type);
|
|
134168
134208
|
}));
|
|
134169
134209
|
},
|
|
@@ -134606,9 +134646,9 @@ var require_path22 = __commonJS3({
|
|
|
134606
134646
|
var Op = Object.prototype;
|
|
134607
134647
|
var hasOwn2 = Op.hasOwnProperty;
|
|
134608
134648
|
function pathPlugin(fork) {
|
|
134609
|
-
var
|
|
134610
|
-
var isArray2 =
|
|
134611
|
-
var isNumber =
|
|
134649
|
+
var types18 = fork.use(types_1.default);
|
|
134650
|
+
var isArray2 = types18.builtInTypes.array;
|
|
134651
|
+
var isNumber = types18.builtInTypes.number;
|
|
134612
134652
|
var Path = function Path2(value, parentPath, name) {
|
|
134613
134653
|
if (!(this instanceof Path2)) {
|
|
134614
134654
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -134908,13 +134948,13 @@ var require_scope2 = __commonJS3({
|
|
|
134908
134948
|
var types_1 = tslib_1.__importDefault(require_types2());
|
|
134909
134949
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
134910
134950
|
function scopePlugin(fork) {
|
|
134911
|
-
var
|
|
134912
|
-
var Type =
|
|
134913
|
-
var namedTypes =
|
|
134951
|
+
var types18 = fork.use(types_1.default);
|
|
134952
|
+
var Type = types18.Type;
|
|
134953
|
+
var namedTypes = types18.namedTypes;
|
|
134914
134954
|
var Node3 = namedTypes.Node;
|
|
134915
134955
|
var Expression = namedTypes.Expression;
|
|
134916
|
-
var isArray2 =
|
|
134917
|
-
var b2 =
|
|
134956
|
+
var isArray2 = types18.builtInTypes.array;
|
|
134957
|
+
var b2 = types18.builders;
|
|
134918
134958
|
var Scope4 = function Scope22(path3, parentScope) {
|
|
134919
134959
|
if (!(this instanceof Scope22)) {
|
|
134920
134960
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -134977,7 +135017,7 @@ var require_scope2 = __commonJS3({
|
|
|
134977
135017
|
++index;
|
|
134978
135018
|
}
|
|
134979
135019
|
var name = prefix + index;
|
|
134980
|
-
return this.bindings[name] =
|
|
135020
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
134981
135021
|
};
|
|
134982
135022
|
Sp.injectTemporary = function(identifier, init2) {
|
|
134983
135023
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -135053,7 +135093,7 @@ var require_scope2 = __commonJS3({
|
|
|
135053
135093
|
bindings
|
|
135054
135094
|
);
|
|
135055
135095
|
} else if (Node3.check(node) && !Expression.check(node)) {
|
|
135056
|
-
|
|
135096
|
+
types18.eachField(node, function(name, child) {
|
|
135057
135097
|
var childPath = path3.get(name);
|
|
135058
135098
|
if (!pathHasValue(childPath, child)) {
|
|
135059
135099
|
throw new Error("");
|
|
@@ -135131,24 +135171,24 @@ var require_scope2 = __commonJS3({
|
|
|
135131
135171
|
addPattern(patternPath.get("argument"), bindings);
|
|
135132
135172
|
}
|
|
135133
135173
|
}
|
|
135134
|
-
function addTypePattern(patternPath,
|
|
135174
|
+
function addTypePattern(patternPath, types19) {
|
|
135135
135175
|
var pattern = patternPath.value;
|
|
135136
135176
|
namedTypes.Pattern.assert(pattern);
|
|
135137
135177
|
if (namedTypes.Identifier.check(pattern)) {
|
|
135138
|
-
if (hasOwn2.call(
|
|
135139
|
-
|
|
135178
|
+
if (hasOwn2.call(types19, pattern.name)) {
|
|
135179
|
+
types19[pattern.name].push(patternPath);
|
|
135140
135180
|
} else {
|
|
135141
|
-
|
|
135181
|
+
types19[pattern.name] = [patternPath];
|
|
135142
135182
|
}
|
|
135143
135183
|
}
|
|
135144
135184
|
}
|
|
135145
|
-
function addTypeParameter(parameterPath,
|
|
135185
|
+
function addTypeParameter(parameterPath, types19) {
|
|
135146
135186
|
var parameter = parameterPath.value;
|
|
135147
135187
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
135148
|
-
if (hasOwn2.call(
|
|
135149
|
-
|
|
135188
|
+
if (hasOwn2.call(types19, parameter.name)) {
|
|
135189
|
+
types19[parameter.name].push(parameterPath);
|
|
135150
135190
|
} else {
|
|
135151
|
-
|
|
135191
|
+
types19[parameter.name] = [parameterPath];
|
|
135152
135192
|
}
|
|
135153
135193
|
}
|
|
135154
135194
|
Sp.lookup = function(name) {
|
|
@@ -135187,11 +135227,11 @@ var require_node_path2 = __commonJS3({
|
|
|
135187
135227
|
var scope_1 = tslib_1.__importDefault(require_scope2());
|
|
135188
135228
|
var shared_1 = require_shared2();
|
|
135189
135229
|
function nodePathPlugin(fork) {
|
|
135190
|
-
var
|
|
135191
|
-
var n2 =
|
|
135192
|
-
var b2 =
|
|
135193
|
-
var isNumber =
|
|
135194
|
-
var isArray2 =
|
|
135230
|
+
var types18 = fork.use(types_1.default);
|
|
135231
|
+
var n2 = types18.namedTypes;
|
|
135232
|
+
var b2 = types18.builders;
|
|
135233
|
+
var isNumber = types18.builtInTypes.number;
|
|
135234
|
+
var isArray2 = types18.builtInTypes.array;
|
|
135195
135235
|
var Path = fork.use(path_1.default);
|
|
135196
135236
|
var Scope4 = fork.use(scope_1.default);
|
|
135197
135237
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -135282,7 +135322,7 @@ var require_node_path2 = __commonJS3({
|
|
|
135282
135322
|
return scope || null;
|
|
135283
135323
|
};
|
|
135284
135324
|
NPp.getValueProperty = function(name) {
|
|
135285
|
-
return
|
|
135325
|
+
return types18.getFieldValue(this.value, name);
|
|
135286
135326
|
};
|
|
135287
135327
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
135288
135328
|
var pp2 = this.parentPath;
|
|
@@ -135424,7 +135464,7 @@ var require_node_path2 = __commonJS3({
|
|
|
135424
135464
|
return node.some(containsCallExpression);
|
|
135425
135465
|
}
|
|
135426
135466
|
if (n2.Node.check(node)) {
|
|
135427
|
-
return
|
|
135467
|
+
return types18.someField(node, function(_name, child) {
|
|
135428
135468
|
return containsCallExpression(child);
|
|
135429
135469
|
});
|
|
135430
135470
|
}
|
|
@@ -135543,11 +135583,11 @@ var require_path_visitor2 = __commonJS3({
|
|
|
135543
135583
|
var shared_1 = require_shared2();
|
|
135544
135584
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
135545
135585
|
function pathVisitorPlugin(fork) {
|
|
135546
|
-
var
|
|
135586
|
+
var types18 = fork.use(types_1.default);
|
|
135547
135587
|
var NodePath = fork.use(node_path_1.default);
|
|
135548
|
-
var isArray2 =
|
|
135549
|
-
var isObject2 =
|
|
135550
|
-
var isFunction =
|
|
135588
|
+
var isArray2 = types18.builtInTypes.array;
|
|
135589
|
+
var isObject2 = types18.builtInTypes.object;
|
|
135590
|
+
var isFunction = types18.builtInTypes.function;
|
|
135551
135591
|
var undefined2;
|
|
135552
135592
|
var PathVisitor = function PathVisitor2() {
|
|
135553
135593
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -135567,7 +135607,7 @@ var require_path_visitor2 = __commonJS3({
|
|
|
135567
135607
|
typeNames[methodName.slice("visit".length)] = true;
|
|
135568
135608
|
}
|
|
135569
135609
|
}
|
|
135570
|
-
var supertypeTable =
|
|
135610
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
135571
135611
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
135572
135612
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
135573
135613
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -135686,7 +135726,7 @@ var require_path_visitor2 = __commonJS3({
|
|
|
135686
135726
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
135687
135727
|
} else if (!isObject2.check(value)) {
|
|
135688
135728
|
} else {
|
|
135689
|
-
var childNames =
|
|
135729
|
+
var childNames = types18.getFieldNames(value);
|
|
135690
135730
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
135691
135731
|
childNames.push("comments");
|
|
135692
135732
|
}
|
|
@@ -135695,7 +135735,7 @@ var require_path_visitor2 = __commonJS3({
|
|
|
135695
135735
|
for (var i22 = 0; i22 < childCount; ++i22) {
|
|
135696
135736
|
var childName = childNames[i22];
|
|
135697
135737
|
if (!hasOwn2.call(value, childName)) {
|
|
135698
|
-
value[childName] =
|
|
135738
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
135699
135739
|
}
|
|
135700
135740
|
childPaths.push(path3.get(childName));
|
|
135701
135741
|
}
|
|
@@ -135836,13 +135876,13 @@ var require_equiv2 = __commonJS3({
|
|
|
135836
135876
|
var shared_1 = require_shared2();
|
|
135837
135877
|
var types_1 = tslib_1.__importDefault(require_types2());
|
|
135838
135878
|
function default_1(fork) {
|
|
135839
|
-
var
|
|
135840
|
-
var getFieldNames =
|
|
135841
|
-
var getFieldValue =
|
|
135842
|
-
var isArray2 =
|
|
135843
|
-
var isObject2 =
|
|
135844
|
-
var isDate =
|
|
135845
|
-
var isRegExp =
|
|
135879
|
+
var types18 = fork.use(types_1.default);
|
|
135880
|
+
var getFieldNames = types18.getFieldNames;
|
|
135881
|
+
var getFieldValue = types18.getFieldValue;
|
|
135882
|
+
var isArray2 = types18.builtInTypes.array;
|
|
135883
|
+
var isObject2 = types18.builtInTypes.object;
|
|
135884
|
+
var isDate = types18.builtInTypes.Date;
|
|
135885
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
135846
135886
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
135847
135887
|
function astNodesAreEquivalent(a2, b2, problemPath) {
|
|
135848
135888
|
if (isArray2.check(problemPath)) {
|
|
@@ -135993,24 +136033,24 @@ var require_fork2 = __commonJS3({
|
|
|
135993
136033
|
var shared_1 = require_shared2();
|
|
135994
136034
|
function default_1(plugins) {
|
|
135995
136035
|
var fork = createFork();
|
|
135996
|
-
var
|
|
136036
|
+
var types18 = fork.use(types_1.default);
|
|
135997
136037
|
plugins.forEach(fork.use);
|
|
135998
|
-
|
|
136038
|
+
types18.finalize();
|
|
135999
136039
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
136000
136040
|
return {
|
|
136001
|
-
Type:
|
|
136002
|
-
builtInTypes:
|
|
136003
|
-
namedTypes:
|
|
136004
|
-
builders:
|
|
136005
|
-
defineMethod:
|
|
136006
|
-
getFieldNames:
|
|
136007
|
-
getFieldValue:
|
|
136008
|
-
eachField:
|
|
136009
|
-
someField:
|
|
136010
|
-
getSupertypeNames:
|
|
136011
|
-
getBuilderName:
|
|
136041
|
+
Type: types18.Type,
|
|
136042
|
+
builtInTypes: types18.builtInTypes,
|
|
136043
|
+
namedTypes: types18.namedTypes,
|
|
136044
|
+
builders: types18.builders,
|
|
136045
|
+
defineMethod: types18.defineMethod,
|
|
136046
|
+
getFieldNames: types18.getFieldNames,
|
|
136047
|
+
getFieldValue: types18.getFieldValue,
|
|
136048
|
+
eachField: types18.eachField,
|
|
136049
|
+
someField: types18.someField,
|
|
136050
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
136051
|
+
getBuilderName: types18.getBuilderName,
|
|
136012
136052
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
136013
|
-
finalize:
|
|
136053
|
+
finalize: types18.finalize,
|
|
136014
136054
|
Path: fork.use(path_1.default),
|
|
136015
136055
|
NodePath: fork.use(node_path_1.default),
|
|
136016
136056
|
PathVisitor,
|
|
@@ -136170,8 +136210,8 @@ var require_core32 = __commonJS3({
|
|
|
136170
136210
|
var types_1 = tslib_1.__importDefault(require_types2());
|
|
136171
136211
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136172
136212
|
function default_1(fork) {
|
|
136173
|
-
var
|
|
136174
|
-
var Type =
|
|
136213
|
+
var types18 = fork.use(types_1.default);
|
|
136214
|
+
var Type = types18.Type;
|
|
136175
136215
|
var def = Type.def;
|
|
136176
136216
|
var or = Type.or;
|
|
136177
136217
|
var shared2 = fork.use(shared_1.default);
|
|
@@ -136261,9 +136301,9 @@ var require_es62 = __commonJS3({
|
|
|
136261
136301
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136262
136302
|
function default_1(fork) {
|
|
136263
136303
|
fork.use(core_1.default);
|
|
136264
|
-
var
|
|
136265
|
-
var def =
|
|
136266
|
-
var or =
|
|
136304
|
+
var types18 = fork.use(types_1.default);
|
|
136305
|
+
var def = types18.Type.def;
|
|
136306
|
+
var or = types18.Type.or;
|
|
136267
136307
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136268
136308
|
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"]);
|
|
136269
136309
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -136349,8 +136389,8 @@ var require_es20172 = __commonJS3({
|
|
|
136349
136389
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136350
136390
|
function default_1(fork) {
|
|
136351
136391
|
fork.use(es2016_1.default);
|
|
136352
|
-
var
|
|
136353
|
-
var def =
|
|
136392
|
+
var types18 = fork.use(types_1.default);
|
|
136393
|
+
var def = types18.Type.def;
|
|
136354
136394
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136355
136395
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
136356
136396
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -136371,9 +136411,9 @@ var require_es20182 = __commonJS3({
|
|
|
136371
136411
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136372
136412
|
function default_1(fork) {
|
|
136373
136413
|
fork.use(es2017_1.default);
|
|
136374
|
-
var
|
|
136375
|
-
var def =
|
|
136376
|
-
var or =
|
|
136414
|
+
var types18 = fork.use(types_1.default);
|
|
136415
|
+
var def = types18.Type.def;
|
|
136416
|
+
var or = types18.Type.or;
|
|
136377
136417
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136378
136418
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
136379
136419
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -136402,9 +136442,9 @@ var require_es20192 = __commonJS3({
|
|
|
136402
136442
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136403
136443
|
function default_1(fork) {
|
|
136404
136444
|
fork.use(es2018_1.default);
|
|
136405
|
-
var
|
|
136406
|
-
var def =
|
|
136407
|
-
var or =
|
|
136445
|
+
var types18 = fork.use(types_1.default);
|
|
136446
|
+
var def = types18.Type.def;
|
|
136447
|
+
var or = types18.Type.or;
|
|
136408
136448
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136409
136449
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
136410
136450
|
}
|
|
@@ -136426,9 +136466,9 @@ var require_es202022 = __commonJS3({
|
|
|
136426
136466
|
function default_1(fork) {
|
|
136427
136467
|
fork.use(es2020_1.default);
|
|
136428
136468
|
fork.use(es2019_1.default);
|
|
136429
|
-
var
|
|
136430
|
-
var def =
|
|
136431
|
-
var or =
|
|
136469
|
+
var types18 = fork.use(types_1.default);
|
|
136470
|
+
var def = types18.Type.def;
|
|
136471
|
+
var or = types18.Type.or;
|
|
136432
136472
|
var shared2 = fork.use(shared_1.default);
|
|
136433
136473
|
var defaults = shared2.defaults;
|
|
136434
136474
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -136474,8 +136514,8 @@ var require_es20222 = __commonJS3({
|
|
|
136474
136514
|
var shared_1 = require_shared2();
|
|
136475
136515
|
function default_1(fork) {
|
|
136476
136516
|
fork.use(es2021_1.default);
|
|
136477
|
-
var
|
|
136478
|
-
var def =
|
|
136517
|
+
var types18 = fork.use(types_1.default);
|
|
136518
|
+
var def = types18.Type.def;
|
|
136479
136519
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
136480
136520
|
}
|
|
136481
136521
|
exports.default = default_1;
|
|
@@ -136494,9 +136534,9 @@ var require_es_proposals2 = __commonJS3({
|
|
|
136494
136534
|
var es2022_1 = tslib_1.__importDefault(require_es20222());
|
|
136495
136535
|
function default_1(fork) {
|
|
136496
136536
|
fork.use(es2022_1.default);
|
|
136497
|
-
var
|
|
136498
|
-
var Type =
|
|
136499
|
-
var def =
|
|
136537
|
+
var types18 = fork.use(types_1.default);
|
|
136538
|
+
var Type = types18.Type;
|
|
136539
|
+
var def = types18.Type.def;
|
|
136500
136540
|
var or = Type.or;
|
|
136501
136541
|
var shared2 = fork.use(shared_1.default);
|
|
136502
136542
|
var defaults = shared2.defaults;
|
|
@@ -136534,9 +136574,9 @@ var require_jsx22 = __commonJS3({
|
|
|
136534
136574
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136535
136575
|
function default_1(fork) {
|
|
136536
136576
|
fork.use(es_proposals_1.default);
|
|
136537
|
-
var
|
|
136538
|
-
var def =
|
|
136539
|
-
var or =
|
|
136577
|
+
var types18 = fork.use(types_1.default);
|
|
136578
|
+
var def = types18.Type.def;
|
|
136579
|
+
var or = types18.Type.or;
|
|
136540
136580
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136541
136581
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
136542
136582
|
def("Literal"),
|
|
@@ -136592,9 +136632,9 @@ var require_type_annotations2 = __commonJS3({
|
|
|
136592
136632
|
var types_1 = tslib_1.__importDefault(require_types2());
|
|
136593
136633
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136594
136634
|
function default_1(fork) {
|
|
136595
|
-
var
|
|
136596
|
-
var def =
|
|
136597
|
-
var or =
|
|
136635
|
+
var types18 = fork.use(types_1.default);
|
|
136636
|
+
var def = types18.Type.def;
|
|
136637
|
+
var or = types18.Type.or;
|
|
136598
136638
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136599
136639
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
136600
136640
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -136627,9 +136667,9 @@ var require_flow22 = __commonJS3({
|
|
|
136627
136667
|
function default_1(fork) {
|
|
136628
136668
|
fork.use(es_proposals_1.default);
|
|
136629
136669
|
fork.use(type_annotations_1.default);
|
|
136630
|
-
var
|
|
136631
|
-
var def =
|
|
136632
|
-
var or =
|
|
136670
|
+
var types18 = fork.use(types_1.default);
|
|
136671
|
+
var def = types18.Type.def;
|
|
136672
|
+
var or = types18.Type.or;
|
|
136633
136673
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136634
136674
|
def("Flow").bases("Node");
|
|
136635
136675
|
def("FlowType").bases("Flow");
|
|
@@ -136741,10 +136781,10 @@ var require_esprima4 = __commonJS3({
|
|
|
136741
136781
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
136742
136782
|
function default_1(fork) {
|
|
136743
136783
|
fork.use(es_proposals_1.default);
|
|
136744
|
-
var
|
|
136784
|
+
var types18 = fork.use(types_1.default);
|
|
136745
136785
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136746
|
-
var def =
|
|
136747
|
-
var or =
|
|
136786
|
+
var def = types18.Type.def;
|
|
136787
|
+
var or = types18.Type.or;
|
|
136748
136788
|
def("VariableDeclaration").field("declarations", [or(
|
|
136749
136789
|
def("VariableDeclarator"),
|
|
136750
136790
|
def("Identifier")
|
|
@@ -136787,11 +136827,11 @@ var require_babel_core2 = __commonJS3({
|
|
|
136787
136827
|
function default_1(fork) {
|
|
136788
136828
|
var _a, _b, _c, _d, _e;
|
|
136789
136829
|
fork.use(es_proposals_1.default);
|
|
136790
|
-
var
|
|
136830
|
+
var types18 = fork.use(types_1.default);
|
|
136791
136831
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136792
|
-
var def =
|
|
136793
|
-
var or =
|
|
136794
|
-
var isUndefined =
|
|
136832
|
+
var def = types18.Type.def;
|
|
136833
|
+
var or = types18.Type.or;
|
|
136834
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
136795
136835
|
def("Noop").bases("Statement").build();
|
|
136796
136836
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
136797
136837
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -136816,7 +136856,7 @@ var require_babel_core2 = __commonJS3({
|
|
|
136816
136856
|
raw: String
|
|
136817
136857
|
},
|
|
136818
136858
|
function getDefault() {
|
|
136819
|
-
var value =
|
|
136859
|
+
var value = types18.getFieldValue(this, "value");
|
|
136820
136860
|
return {
|
|
136821
136861
|
rawValue: value,
|
|
136822
136862
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -136917,8 +136957,8 @@ var require_babel2 = __commonJS3({
|
|
|
136917
136957
|
var flow_1 = tslib_1.__importDefault(require_flow22());
|
|
136918
136958
|
var shared_1 = require_shared2();
|
|
136919
136959
|
function default_1(fork) {
|
|
136920
|
-
var
|
|
136921
|
-
var def =
|
|
136960
|
+
var types18 = fork.use(types_1.default);
|
|
136961
|
+
var def = types18.Type.def;
|
|
136922
136962
|
fork.use(babel_core_1.default);
|
|
136923
136963
|
fork.use(flow_1.default);
|
|
136924
136964
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -136942,12 +136982,12 @@ var require_typescript22 = __commonJS3({
|
|
|
136942
136982
|
function default_1(fork) {
|
|
136943
136983
|
fork.use(babel_core_1.default);
|
|
136944
136984
|
fork.use(type_annotations_1.default);
|
|
136945
|
-
var
|
|
136946
|
-
var n2 =
|
|
136947
|
-
var def =
|
|
136948
|
-
var or =
|
|
136985
|
+
var types18 = fork.use(types_1.default);
|
|
136986
|
+
var n2 = types18.namedTypes;
|
|
136987
|
+
var def = types18.Type.def;
|
|
136988
|
+
var or = types18.Type.or;
|
|
136949
136989
|
var defaults = fork.use(shared_1.default).defaults;
|
|
136950
|
-
var StringLiteral =
|
|
136990
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
136951
136991
|
if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
|
|
136952
136992
|
return true;
|
|
136953
136993
|
}
|
|
@@ -138895,8 +138935,8 @@ var require_util22 = __commonJS3({
|
|
|
138895
138935
|
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;
|
|
138896
138936
|
var tslib_1 = require_tslib2();
|
|
138897
138937
|
var assert_1 = tslib_1.__importDefault(__require3("assert"));
|
|
138898
|
-
var
|
|
138899
|
-
var n2 =
|
|
138938
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
138939
|
+
var n2 = types18.namedTypes;
|
|
138900
138940
|
var source_map_1 = tslib_1.__importDefault(require_source_map2());
|
|
138901
138941
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
138902
138942
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -146202,10 +146242,10 @@ var require_comments2 = __commonJS3({
|
|
|
146202
146242
|
exports.printComments = exports.attach = void 0;
|
|
146203
146243
|
var tslib_1 = require_tslib2();
|
|
146204
146244
|
var assert_1 = tslib_1.__importDefault(__require3("assert"));
|
|
146205
|
-
var
|
|
146206
|
-
var n2 =
|
|
146207
|
-
var isArray2 =
|
|
146208
|
-
var isObject2 =
|
|
146245
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
146246
|
+
var n2 = types18.namedTypes;
|
|
146247
|
+
var isArray2 = types18.builtInTypes.array;
|
|
146248
|
+
var isObject2 = types18.builtInTypes.object;
|
|
146209
146249
|
var lines_1 = require_lines2();
|
|
146210
146250
|
var util_1 = require_util22();
|
|
146211
146251
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -146236,7 +146276,7 @@ var require_comments2 = __commonJS3({
|
|
|
146236
146276
|
if (isArray2.check(node)) {
|
|
146237
146277
|
names = Object.keys(node);
|
|
146238
146278
|
} else if (isObject2.check(node)) {
|
|
146239
|
-
names =
|
|
146279
|
+
names = types18.getFieldNames(node);
|
|
146240
146280
|
} else {
|
|
146241
146281
|
return resultArray;
|
|
146242
146282
|
}
|
|
@@ -146414,7 +146454,7 @@ var require_comments2 = __commonJS3({
|
|
|
146414
146454
|
function printComments(path3, print132) {
|
|
146415
146455
|
var value = path3.getValue();
|
|
146416
146456
|
var innerLines = print132(path3);
|
|
146417
|
-
var comments = n2.Node.check(value) &&
|
|
146457
|
+
var comments = n2.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
146418
146458
|
if (!comments || comments.length === 0) {
|
|
146419
146459
|
return innerLines;
|
|
146420
146460
|
}
|
|
@@ -146422,8 +146462,8 @@ var require_comments2 = __commonJS3({
|
|
|
146422
146462
|
var trailingParts = [innerLines];
|
|
146423
146463
|
path3.each(function(commentPath) {
|
|
146424
146464
|
var comment = commentPath.getValue();
|
|
146425
|
-
var leading =
|
|
146426
|
-
var trailing =
|
|
146465
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
146466
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
146427
146467
|
if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
146428
146468
|
leadingParts.push(printLeadingComment(commentPath, print132));
|
|
146429
146469
|
} else if (trailing) {
|
|
@@ -146443,10 +146483,10 @@ var require_parser2 = __commonJS3({
|
|
|
146443
146483
|
exports.parse = void 0;
|
|
146444
146484
|
var tslib_1 = require_tslib2();
|
|
146445
146485
|
var assert_1 = tslib_1.__importDefault(__require3("assert"));
|
|
146446
|
-
var
|
|
146447
|
-
var b2 =
|
|
146448
|
-
var isObject2 =
|
|
146449
|
-
var isArray2 =
|
|
146486
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
146487
|
+
var b2 = types18.builders;
|
|
146488
|
+
var isObject2 = types18.builtInTypes.object;
|
|
146489
|
+
var isArray2 = types18.builtInTypes.array;
|
|
146450
146490
|
var options_1 = require_options2();
|
|
146451
146491
|
var lines_1 = require_lines2();
|
|
146452
146492
|
var comments_1 = require_comments2();
|
|
@@ -146630,11 +146670,11 @@ var require_fast_path2 = __commonJS3({
|
|
|
146630
146670
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
146631
146671
|
var tslib_1 = require_tslib2();
|
|
146632
146672
|
var assert_1 = tslib_1.__importDefault(__require3("assert"));
|
|
146633
|
-
var
|
|
146673
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
146634
146674
|
var util = tslib_1.__importStar(require_util22());
|
|
146635
|
-
var n2 =
|
|
146636
|
-
var isArray2 =
|
|
146637
|
-
var isNumber =
|
|
146675
|
+
var n2 = types18.namedTypes;
|
|
146676
|
+
var isArray2 = types18.builtInTypes.array;
|
|
146677
|
+
var isNumber = types18.builtInTypes.number;
|
|
146638
146678
|
var PRECEDENCE = {};
|
|
146639
146679
|
[
|
|
146640
146680
|
["??"],
|
|
@@ -146663,7 +146703,7 @@ var require_fast_path2 = __commonJS3({
|
|
|
146663
146703
|
if (obj instanceof FastPath) {
|
|
146664
146704
|
return obj.copy();
|
|
146665
146705
|
}
|
|
146666
|
-
if (obj instanceof
|
|
146706
|
+
if (obj instanceof types18.NodePath) {
|
|
146667
146707
|
var copy = Object.create(FastPath.prototype);
|
|
146668
146708
|
var stack = [obj.value];
|
|
146669
146709
|
for (var pp2 = void 0; pp2 = obj.parentPath; obj = pp2)
|
|
@@ -146974,7 +147014,7 @@ var require_fast_path2 = __commonJS3({
|
|
|
146974
147014
|
return node.some(containsCallExpression);
|
|
146975
147015
|
}
|
|
146976
147016
|
if (n2.Node.check(node)) {
|
|
146977
|
-
return
|
|
147017
|
+
return types18.someField(node, function(_name, child) {
|
|
146978
147018
|
return containsCallExpression(child);
|
|
146979
147019
|
});
|
|
146980
147020
|
}
|
|
@@ -147062,16 +147102,16 @@ var require_patcher2 = __commonJS3({
|
|
|
147062
147102
|
var tslib_1 = require_tslib2();
|
|
147063
147103
|
var assert_1 = tslib_1.__importDefault(__require3("assert"));
|
|
147064
147104
|
var linesModule = tslib_1.__importStar(require_lines2());
|
|
147065
|
-
var
|
|
147066
|
-
var Printable =
|
|
147067
|
-
var Expression =
|
|
147068
|
-
var ReturnStatement =
|
|
147069
|
-
var SourceLocation3 =
|
|
147105
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
147106
|
+
var Printable = types18.namedTypes.Printable;
|
|
147107
|
+
var Expression = types18.namedTypes.Expression;
|
|
147108
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
147109
|
+
var SourceLocation3 = types18.namedTypes.SourceLocation;
|
|
147070
147110
|
var util_1 = require_util22();
|
|
147071
147111
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path2());
|
|
147072
|
-
var isObject2 =
|
|
147073
|
-
var isArray2 =
|
|
147074
|
-
var isString =
|
|
147112
|
+
var isObject2 = types18.builtInTypes.object;
|
|
147113
|
+
var isArray2 = types18.builtInTypes.array;
|
|
147114
|
+
var isString = types18.builtInTypes.string;
|
|
147075
147115
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
147076
147116
|
var Patcher = function Patcher2(lines) {
|
|
147077
147117
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -147341,8 +147381,8 @@ var require_patcher2 = __commonJS3({
|
|
|
147341
147381
|
if (k2.charAt(0) === "_") {
|
|
147342
147382
|
continue;
|
|
147343
147383
|
}
|
|
147344
|
-
newPath.stack.push(k2,
|
|
147345
|
-
oldPath.stack.push(k2,
|
|
147384
|
+
newPath.stack.push(k2, types18.getFieldValue(newNode, k2));
|
|
147385
|
+
oldPath.stack.push(k2, types18.getFieldValue(oldNode, k2));
|
|
147346
147386
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
147347
147387
|
newPath.stack.length -= 2;
|
|
147348
147388
|
oldPath.stack.length -= 2;
|
|
@@ -147364,16 +147404,16 @@ var require_printer2 = __commonJS3({
|
|
|
147364
147404
|
exports.Printer = void 0;
|
|
147365
147405
|
var tslib_1 = require_tslib2();
|
|
147366
147406
|
var assert_1 = tslib_1.__importDefault(__require3("assert"));
|
|
147367
|
-
var
|
|
147407
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
147368
147408
|
var comments_1 = require_comments2();
|
|
147369
147409
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path2());
|
|
147370
147410
|
var lines_1 = require_lines2();
|
|
147371
147411
|
var options_1 = require_options2();
|
|
147372
147412
|
var patcher_1 = require_patcher2();
|
|
147373
147413
|
var util = tslib_1.__importStar(require_util22());
|
|
147374
|
-
var namedTypes =
|
|
147375
|
-
var isString =
|
|
147376
|
-
var isObject2 =
|
|
147414
|
+
var namedTypes = types18.namedTypes;
|
|
147415
|
+
var isString = types18.builtInTypes.string;
|
|
147416
|
+
var isObject2 = types18.builtInTypes.object;
|
|
147377
147417
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
147378
147418
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
147379
147419
|
isString.assert(code);
|
|
@@ -147535,7 +147575,7 @@ var require_printer2 = __commonJS3({
|
|
|
147535
147575
|
case "OptionalMemberExpression": {
|
|
147536
147576
|
parts.push(path3.call(print132, "object"));
|
|
147537
147577
|
var property = path3.call(print132, "property");
|
|
147538
|
-
var optional =
|
|
147578
|
+
var optional = types18.getFieldValue(n2, "optional");
|
|
147539
147579
|
if (n2.computed) {
|
|
147540
147580
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
147541
147581
|
} else {
|
|
@@ -147806,7 +147846,7 @@ var require_printer2 = __commonJS3({
|
|
|
147806
147846
|
if (n2.typeArguments) {
|
|
147807
147847
|
parts.push(path3.call(print132, "typeArguments"));
|
|
147808
147848
|
}
|
|
147809
|
-
if (
|
|
147849
|
+
if (types18.getFieldValue(n2, "optional")) {
|
|
147810
147850
|
parts.push("?.");
|
|
147811
147851
|
}
|
|
147812
147852
|
parts.push(printArgumentsList(path3, options, print132));
|
|
@@ -149485,8 +149525,8 @@ var require_printer2 = __commonJS3({
|
|
|
149485
149525
|
});
|
|
149486
149526
|
}
|
|
149487
149527
|
function getPossibleRaw(node) {
|
|
149488
|
-
var value =
|
|
149489
|
-
var extra =
|
|
149528
|
+
var value = types18.getFieldValue(node, "value");
|
|
149529
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
149490
149530
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
149491
149531
|
return extra.raw;
|
|
149492
149532
|
}
|
|
@@ -149532,8 +149572,8 @@ var require_main22 = __commonJS3({
|
|
|
149532
149572
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
149533
149573
|
var tslib_1 = require_tslib2();
|
|
149534
149574
|
var fs_1 = tslib_1.__importDefault(__require3("fs"));
|
|
149535
|
-
var
|
|
149536
|
-
exports.types =
|
|
149575
|
+
var types18 = tslib_1.__importStar(require_main3());
|
|
149576
|
+
exports.types = types18;
|
|
149537
149577
|
var parser_1 = require_parser2();
|
|
149538
149578
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
149539
149579
|
return parser_1.parse;
|
|
@@ -150193,7 +150233,7 @@ var printDocASTReducer2 = {
|
|
|
150193
150233
|
leave: ({ name, interfaces, directives, fields }) => join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ")
|
|
150194
150234
|
},
|
|
150195
150235
|
UnionTypeDefinition: {
|
|
150196
|
-
leave: ({ name, directives, types:
|
|
150236
|
+
leave: ({ name, directives, types: types18 }) => join3(["union", name, join3(directives, " "), wrap2("= ", join3(types18, " | "))], " ")
|
|
150197
150237
|
},
|
|
150198
150238
|
EnumTypeDefinition: {
|
|
150199
150239
|
leave: ({ name, directives, values }) => join3(["enum", name, join3(directives, " "), block2(values)], " ")
|
|
@@ -150220,7 +150260,7 @@ var printDocASTReducer2 = {
|
|
|
150220
150260
|
leave: ({ name, interfaces, directives, fields }) => join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ")
|
|
150221
150261
|
},
|
|
150222
150262
|
UnionTypeExtension: {
|
|
150223
|
-
leave: ({ name, directives, types:
|
|
150263
|
+
leave: ({ name, directives, types: types18 }) => join3(["extend union", name, join3(directives, " "), wrap2("= ", join3(types18, " | "))], " ")
|
|
150224
150264
|
},
|
|
150225
150265
|
EnumTypeExtension: {
|
|
150226
150266
|
leave: ({ name, directives, values }) => join3(["extend enum", name, join3(directives, " "), block2(values)], " ")
|
|
@@ -151635,7 +151675,18 @@ var ListManager2 = class {
|
|
|
151635
151675
|
}
|
|
151636
151676
|
lists = /* @__PURE__ */ new Map();
|
|
151637
151677
|
listsByField = /* @__PURE__ */ new Map();
|
|
151638
|
-
get(listName, id2, allLists) {
|
|
151678
|
+
get(listName, id2, allLists, skipMatches) {
|
|
151679
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
151680
|
+
if (!lists) {
|
|
151681
|
+
return null;
|
|
151682
|
+
}
|
|
151683
|
+
if (skipMatches) {
|
|
151684
|
+
return new ListCollection2(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
151685
|
+
} else {
|
|
151686
|
+
return lists;
|
|
151687
|
+
}
|
|
151688
|
+
}
|
|
151689
|
+
getLists(listName, id2, allLists) {
|
|
151639
151690
|
const matches = this.lists.get(listName);
|
|
151640
151691
|
if (!matches || matches.size === 0) {
|
|
151641
151692
|
return null;
|
|
@@ -151757,6 +151808,9 @@ var List2 = class {
|
|
|
151757
151808
|
this.manager = manager;
|
|
151758
151809
|
this.abstract = abstract;
|
|
151759
151810
|
}
|
|
151811
|
+
get fieldRef() {
|
|
151812
|
+
return `${this.recordID}.${this.key}`;
|
|
151813
|
+
}
|
|
151760
151814
|
when(when) {
|
|
151761
151815
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
151762
151816
|
}
|
|
@@ -152901,8 +152955,8 @@ var Cache2 = class {
|
|
|
152901
152955
|
variables
|
|
152902
152956
|
);
|
|
152903
152957
|
}
|
|
152904
|
-
list(name, parentID, allLists) {
|
|
152905
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
152958
|
+
list(name, parentID, allLists, skipMatches) {
|
|
152959
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
152906
152960
|
if (!handler) {
|
|
152907
152961
|
throw new Error(
|
|
152908
152962
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -153317,6 +153371,7 @@ var CacheInternal2 = class {
|
|
|
153317
153371
|
});
|
|
153318
153372
|
}
|
|
153319
153373
|
}
|
|
153374
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
153320
153375
|
for (const operation of operations || []) {
|
|
153321
153376
|
let parentID;
|
|
153322
153377
|
if (operation.parentID) {
|
|
@@ -153336,7 +153391,12 @@ var CacheInternal2 = class {
|
|
|
153336
153391
|
const targets = Array.isArray(value) ? value : [value];
|
|
153337
153392
|
for (const target of targets) {
|
|
153338
153393
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
153339
|
-
this.cache.list(
|
|
153394
|
+
this.cache.list(
|
|
153395
|
+
operation.list,
|
|
153396
|
+
parentID,
|
|
153397
|
+
operation.target === "all",
|
|
153398
|
+
processedOperations
|
|
153399
|
+
).when(operation.when).addToList(
|
|
153340
153400
|
fieldSelection,
|
|
153341
153401
|
target,
|
|
153342
153402
|
variables,
|
|
@@ -153344,7 +153404,12 @@ var CacheInternal2 = class {
|
|
|
153344
153404
|
layer
|
|
153345
153405
|
);
|
|
153346
153406
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
153347
|
-
this.cache.list(
|
|
153407
|
+
this.cache.list(
|
|
153408
|
+
operation.list,
|
|
153409
|
+
parentID,
|
|
153410
|
+
operation.target === "all",
|
|
153411
|
+
processedOperations
|
|
153412
|
+
).when(operation.when).toggleElement({
|
|
153348
153413
|
selection: fieldSelection,
|
|
153349
153414
|
data: target,
|
|
153350
153415
|
variables,
|
|
@@ -153352,7 +153417,12 @@ var CacheInternal2 = class {
|
|
|
153352
153417
|
layer
|
|
153353
153418
|
});
|
|
153354
153419
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
153355
|
-
this.cache.list(
|
|
153420
|
+
this.cache.list(
|
|
153421
|
+
operation.list,
|
|
153422
|
+
parentID,
|
|
153423
|
+
operation.target === "all",
|
|
153424
|
+
processedOperations
|
|
153425
|
+
).when(operation.when).remove(target, variables, layer);
|
|
153356
153426
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
153357
153427
|
const targetID = this.id(operation.type, target);
|
|
153358
153428
|
if (!targetID) {
|
|
@@ -153364,6 +153434,16 @@ var CacheInternal2 = class {
|
|
|
153364
153434
|
this.cache.delete(targetID, layer);
|
|
153365
153435
|
}
|
|
153366
153436
|
}
|
|
153437
|
+
if (operation.list) {
|
|
153438
|
+
const matchingLists = this.cache.list(
|
|
153439
|
+
operation.list,
|
|
153440
|
+
parentID,
|
|
153441
|
+
operation.target === "all"
|
|
153442
|
+
);
|
|
153443
|
+
for (const list3 of matchingLists.lists) {
|
|
153444
|
+
processedOperations.add(list3.fieldRef);
|
|
153445
|
+
}
|
|
153446
|
+
}
|
|
153367
153447
|
}
|
|
153368
153448
|
}
|
|
153369
153449
|
return toNotify;
|
|
@@ -153829,6 +153909,46 @@ var { keys } = Object;
|
|
|
153829
153909
|
var recast4 = __toESM3(require_main22(), 1);
|
|
153830
153910
|
var AST4 = recast4.types.builders;
|
|
153831
153911
|
var pageInfoSelection = [
|
|
153912
|
+
{
|
|
153913
|
+
kind: graphql13.Kind.FIELD,
|
|
153914
|
+
name: {
|
|
153915
|
+
kind: graphql13.Kind.NAME,
|
|
153916
|
+
value: "pageInfo"
|
|
153917
|
+
},
|
|
153918
|
+
selectionSet: {
|
|
153919
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
153920
|
+
selections: [
|
|
153921
|
+
{
|
|
153922
|
+
kind: graphql13.Kind.FIELD,
|
|
153923
|
+
name: {
|
|
153924
|
+
kind: graphql13.Kind.NAME,
|
|
153925
|
+
value: "hasPreviousPage"
|
|
153926
|
+
}
|
|
153927
|
+
},
|
|
153928
|
+
{
|
|
153929
|
+
kind: graphql13.Kind.FIELD,
|
|
153930
|
+
name: {
|
|
153931
|
+
kind: graphql13.Kind.NAME,
|
|
153932
|
+
value: "hasNextPage"
|
|
153933
|
+
}
|
|
153934
|
+
},
|
|
153935
|
+
{
|
|
153936
|
+
kind: graphql13.Kind.FIELD,
|
|
153937
|
+
name: {
|
|
153938
|
+
kind: graphql13.Kind.NAME,
|
|
153939
|
+
value: "startCursor"
|
|
153940
|
+
}
|
|
153941
|
+
},
|
|
153942
|
+
{
|
|
153943
|
+
kind: graphql13.Kind.FIELD,
|
|
153944
|
+
name: {
|
|
153945
|
+
kind: graphql13.Kind.NAME,
|
|
153946
|
+
value: "endCursor"
|
|
153947
|
+
}
|
|
153948
|
+
}
|
|
153949
|
+
]
|
|
153950
|
+
}
|
|
153951
|
+
},
|
|
153832
153952
|
{
|
|
153833
153953
|
kind: graphql13.Kind.FIELD,
|
|
153834
153954
|
name: {
|
|
@@ -154099,7 +154219,7 @@ var printDocASTReducer22 = {
|
|
|
154099
154219
|
], " ")
|
|
154100
154220
|
},
|
|
154101
154221
|
UnionTypeDefinition: {
|
|
154102
|
-
leave: ({ name, directives, types:
|
|
154222
|
+
leave: ({ name, directives, types: types18 }) => join32(["union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
154103
154223
|
},
|
|
154104
154224
|
EnumTypeDefinition: {
|
|
154105
154225
|
leave: ({ name, directives, values }) => join32(["enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -154138,7 +154258,7 @@ var printDocASTReducer22 = {
|
|
|
154138
154258
|
], " ")
|
|
154139
154259
|
},
|
|
154140
154260
|
UnionTypeExtension: {
|
|
154141
|
-
leave: ({ name, directives, types:
|
|
154261
|
+
leave: ({ name, directives, types: types18 }) => join32(["extend union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
154142
154262
|
},
|
|
154143
154263
|
EnumTypeExtension: {
|
|
154144
154264
|
leave: ({ name, directives, values }) => join32(["extend enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -154175,6 +154295,8 @@ For more information, please visit these links:
|
|
|
154175
154295
|
- https://graphql.org/learn/global-object-identification/
|
|
154176
154296
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
154177
154297
|
`;
|
|
154298
|
+
var recast14 = __toESM3(require_main22(), 1);
|
|
154299
|
+
var AST14 = recast14.types.builders;
|
|
154178
154300
|
function find_insert_index(script) {
|
|
154179
154301
|
let insert_index = script.body.findIndex((statement) => {
|
|
154180
154302
|
return statement.type !== "ImportDeclaration";
|
|
@@ -154193,7 +154315,7 @@ function find_exported_fn(body, name) {
|
|
|
154193
154315
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
154194
154316
|
const value = exportDeclaration.declaration;
|
|
154195
154317
|
if (value.id?.name === name) {
|
|
154196
|
-
return exportDeclaration.declaration;
|
|
154318
|
+
return { declaration: exportDeclaration.declaration, export: exportDeclaration };
|
|
154197
154319
|
}
|
|
154198
154320
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
154199
154321
|
const value = exportDeclaration.declaration;
|
|
@@ -154212,7 +154334,10 @@ function find_exported_fn(body, name) {
|
|
|
154212
154334
|
init2 = init2.arguments[0];
|
|
154213
154335
|
}
|
|
154214
154336
|
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
154215
|
-
return init2;
|
|
154337
|
+
return { declaration: init2, export: exportDeclaration };
|
|
154338
|
+
}
|
|
154339
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
154340
|
+
return { declaration: init2, export: exportDeclaration };
|
|
154216
154341
|
}
|
|
154217
154342
|
} else {
|
|
154218
154343
|
continue;
|
|
@@ -154224,10 +154349,10 @@ function find_exported_fn(body, name) {
|
|
|
154224
154349
|
if (!exported) {
|
|
154225
154350
|
return null;
|
|
154226
154351
|
}
|
|
154227
|
-
return exported.declaration;
|
|
154352
|
+
return { declaration: exported.declaration, export: exported };
|
|
154228
154353
|
}
|
|
154229
|
-
var
|
|
154230
|
-
var
|
|
154354
|
+
var recast15 = __toESM3(require_main22(), 1);
|
|
154355
|
+
var AST15 = recast15.types.builders;
|
|
154231
154356
|
function ensure_imports({
|
|
154232
154357
|
config: config2,
|
|
154233
154358
|
script,
|
|
@@ -154243,13 +154368,13 @@ function ensure_imports({
|
|
|
154243
154368
|
if (!has_import) {
|
|
154244
154369
|
script.body.unshift({
|
|
154245
154370
|
type: "ImportDeclaration",
|
|
154246
|
-
source:
|
|
154371
|
+
source: AST15.stringLiteral(sourceModule),
|
|
154247
154372
|
importKind
|
|
154248
154373
|
});
|
|
154249
154374
|
}
|
|
154250
154375
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
154251
154376
|
}
|
|
154252
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) =>
|
|
154377
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) => AST15.identifier(id2));
|
|
154253
154378
|
const toImport = idList.filter(
|
|
154254
154379
|
(identifier) => !script.body.find(
|
|
154255
154380
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -154260,16 +154385,16 @@ function ensure_imports({
|
|
|
154260
154385
|
if (toImport.length > 0) {
|
|
154261
154386
|
script.body.unshift({
|
|
154262
154387
|
type: "ImportDeclaration",
|
|
154263
|
-
source:
|
|
154388
|
+
source: AST15.stringLiteral(sourceModule),
|
|
154264
154389
|
specifiers: toImport.map(
|
|
154265
|
-
(identifier, i22) => !Array.isArray(importID) ?
|
|
154390
|
+
(identifier, i22) => !Array.isArray(importID) ? AST15.importDefaultSpecifier(identifier) : AST15.importSpecifier(identifier, as?.[i22] ? AST15.identifier(as[i22]) : identifier)
|
|
154266
154391
|
),
|
|
154267
154392
|
importKind
|
|
154268
154393
|
});
|
|
154269
154394
|
}
|
|
154270
154395
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
154271
154396
|
if (target) {
|
|
154272
|
-
idList[i22] =
|
|
154397
|
+
idList[i22] = AST15.identifier(target);
|
|
154273
154398
|
}
|
|
154274
154399
|
}
|
|
154275
154400
|
return {
|
|
@@ -171126,8 +171251,8 @@ export type ${config.variableFunctionName(
|
|
|
171126
171251
|
}
|
|
171127
171252
|
|
|
171128
171253
|
// src/plugin/codegen/fragmentTypedefs/index.ts
|
|
171129
|
-
var
|
|
171130
|
-
var
|
|
171254
|
+
var recast16 = __toESM(require_main5(), 1);
|
|
171255
|
+
var AST16 = recast16.types.builders;
|
|
171131
171256
|
async function fragmentTypedefs(input) {
|
|
171132
171257
|
let fragments = {};
|
|
171133
171258
|
for (const doc of input.documents) {
|
|
@@ -171173,43 +171298,43 @@ async function fragmentTypedefs(input) {
|
|
|
171173
171298
|
}
|
|
171174
171299
|
const store = store_name({ config: input.config, name: doc.name });
|
|
171175
171300
|
const import_path = path_exports.join("..", stores_directory_name(), doc.name);
|
|
171176
|
-
const fragment_map =
|
|
171177
|
-
|
|
171178
|
-
|
|
171179
|
-
|
|
171180
|
-
|
|
171181
|
-
|
|
171182
|
-
|
|
171183
|
-
|
|
171301
|
+
const fragment_map = AST16.tsTypeLiteral([
|
|
171302
|
+
AST16.tsPropertySignature(
|
|
171303
|
+
AST16.stringLiteral(fragmentKey),
|
|
171304
|
+
AST16.tsTypeAnnotation(
|
|
171305
|
+
AST16.tsTypeLiteral([
|
|
171306
|
+
AST16.tsPropertySignature(
|
|
171307
|
+
AST16.identifier(doc.name),
|
|
171308
|
+
AST16.tsTypeAnnotation(AST16.tsAnyKeyword())
|
|
171184
171309
|
)
|
|
171185
171310
|
])
|
|
171186
171311
|
)
|
|
171187
171312
|
)
|
|
171188
171313
|
]);
|
|
171189
|
-
const non_exhaustive =
|
|
171190
|
-
|
|
171191
|
-
|
|
171192
|
-
|
|
171193
|
-
|
|
171314
|
+
const non_exhaustive = AST16.tsTypeLiteral([
|
|
171315
|
+
AST16.tsPropertySignature(
|
|
171316
|
+
AST16.literal("__typename"),
|
|
171317
|
+
AST16.tsTypeAnnotation(
|
|
171318
|
+
AST16.tsLiteralType(AST16.stringLiteral("non-exhaustive; don't match this"))
|
|
171194
171319
|
)
|
|
171195
171320
|
)
|
|
171196
171321
|
]);
|
|
171197
|
-
const initial_value_input =
|
|
171198
|
-
initial_value_input.typeAnnotation =
|
|
171199
|
-
|
|
171322
|
+
const initial_value_input = AST16.identifier("initialValue");
|
|
171323
|
+
initial_value_input.typeAnnotation = AST16.tsTypeAnnotation(
|
|
171324
|
+
AST16.tsUnionType([fragment_map, non_exhaustive])
|
|
171200
171325
|
);
|
|
171201
|
-
const initial_value_or_null_input =
|
|
171202
|
-
initial_value_or_null_input.typeAnnotation =
|
|
171203
|
-
|
|
171326
|
+
const initial_value_or_null_input = AST16.identifier("initialValue");
|
|
171327
|
+
initial_value_or_null_input.typeAnnotation = AST16.tsTypeAnnotation(
|
|
171328
|
+
AST16.tsUnionType([
|
|
171204
171329
|
fragment_map,
|
|
171205
|
-
|
|
171206
|
-
|
|
171330
|
+
AST16.tsNullKeyword(),
|
|
171331
|
+
AST16.tsUndefinedKeyword(),
|
|
171207
171332
|
non_exhaustive
|
|
171208
171333
|
])
|
|
171209
171334
|
);
|
|
171210
|
-
const document_input =
|
|
171211
|
-
document_input.typeAnnotation =
|
|
171212
|
-
|
|
171335
|
+
const document_input = AST16.identifier("document");
|
|
171336
|
+
document_input.typeAnnotation = AST16.tsTypeAnnotation(
|
|
171337
|
+
AST16.tsTypeReference(AST16.identifier(store))
|
|
171213
171338
|
);
|
|
171214
171339
|
let store_type = "FragmentStoreInstance";
|
|
171215
171340
|
if (doc.refetch?.paginated) {
|
|
@@ -171240,37 +171365,37 @@ async function fragmentTypedefs(input) {
|
|
|
171240
171365
|
sourceModule: "../../../artifacts/" + doc.name,
|
|
171241
171366
|
import: [inputID, shapeID]
|
|
171242
171367
|
});
|
|
171243
|
-
const typeParams = [
|
|
171244
|
-
const return_value =
|
|
171245
|
-
|
|
171246
|
-
|
|
171247
|
-
|
|
171368
|
+
const typeParams = [AST16.tsTypeReference(AST16.identifier(inputID))];
|
|
171369
|
+
const return_value = AST16.tsTypeReference(
|
|
171370
|
+
AST16.identifier(store_type),
|
|
171371
|
+
AST16.tsTypeParameterInstantiation([
|
|
171372
|
+
AST16.tsTypeReference(AST16.identifier(shapeID)),
|
|
171248
171373
|
...typeParams
|
|
171249
171374
|
])
|
|
171250
171375
|
);
|
|
171251
|
-
const null_return_value =
|
|
171252
|
-
|
|
171253
|
-
|
|
171254
|
-
|
|
171255
|
-
|
|
171256
|
-
|
|
171376
|
+
const null_return_value = AST16.tsTypeReference(
|
|
171377
|
+
AST16.identifier(store_type),
|
|
171378
|
+
AST16.tsTypeParameterInstantiation([
|
|
171379
|
+
AST16.tsUnionType([
|
|
171380
|
+
AST16.tsTypeReference(AST16.identifier(shapeID)),
|
|
171381
|
+
AST16.tsNullKeyword()
|
|
171257
171382
|
]),
|
|
171258
171383
|
...typeParams
|
|
171259
171384
|
])
|
|
171260
171385
|
);
|
|
171261
171386
|
return [
|
|
171262
|
-
|
|
171263
|
-
|
|
171264
|
-
|
|
171387
|
+
AST16.exportNamedDeclaration(
|
|
171388
|
+
AST16.tsDeclareFunction(
|
|
171389
|
+
AST16.identifier(which),
|
|
171265
171390
|
[initial_value_input, document_input],
|
|
171266
|
-
|
|
171391
|
+
AST16.tsTypeAnnotation(return_value)
|
|
171267
171392
|
)
|
|
171268
171393
|
),
|
|
171269
|
-
|
|
171270
|
-
|
|
171271
|
-
|
|
171394
|
+
AST16.exportNamedDeclaration(
|
|
171395
|
+
AST16.tsDeclareFunction(
|
|
171396
|
+
AST16.identifier(which),
|
|
171272
171397
|
[initial_value_or_null_input, document_input],
|
|
171273
|
-
|
|
171398
|
+
AST16.tsTypeAnnotation(null_return_value)
|
|
171274
171399
|
)
|
|
171275
171400
|
)
|
|
171276
171401
|
];
|
|
@@ -172101,22 +172226,22 @@ function is_root_route(filepath) {
|
|
|
172101
172226
|
if (filepath.toString().endsWith("/")) {
|
|
172102
172227
|
filepath = filepath.slice(0, -1);
|
|
172103
172228
|
}
|
|
172104
|
-
return filepath.endsWith(path_exports.join("src", "routes")) && !filepath.includes(".svelte-kit") && !filepath.includes("$houdini");
|
|
172229
|
+
return filepath.endsWith(path_exports.join("src", "routes")) && !filepath.includes(".svelte-kit") && !filepath.includes(_config.runtimeDir ?? "$houdini");
|
|
172105
172230
|
}
|
|
172106
172231
|
var empty_layout = "<slot />";
|
|
172107
172232
|
|
|
172108
172233
|
// src/plugin/transforms/index.ts
|
|
172109
|
-
var
|
|
172234
|
+
var recast23 = __toESM(require_main5(), 1);
|
|
172110
172235
|
|
|
172111
172236
|
// src/plugin/transforms/componentQuery.ts
|
|
172112
|
-
var
|
|
172113
|
-
var
|
|
172237
|
+
var recast17 = __toESM(require_main5(), 1);
|
|
172238
|
+
var AST17 = recast17.types.builders;
|
|
172114
172239
|
async function QueryProcessor(config, page) {
|
|
172115
172240
|
if (!is_component(config, page.framework, page.filepath)) {
|
|
172116
172241
|
return;
|
|
172117
172242
|
}
|
|
172118
172243
|
const store_id = (name) => {
|
|
172119
|
-
return
|
|
172244
|
+
return AST17.identifier(`_houdini_` + name);
|
|
172120
172245
|
};
|
|
172121
172246
|
const queries = await find_inline_queries(page, page.script, store_id);
|
|
172122
172247
|
if (queries.length === 0) {
|
|
@@ -172186,8 +172311,8 @@ async function QueryProcessor(config, page) {
|
|
|
172186
172311
|
page.script.body.splice(
|
|
172187
172312
|
find_insert_index(page.script),
|
|
172188
172313
|
0,
|
|
172189
|
-
|
|
172190
|
-
|
|
172314
|
+
AST17.variableDeclaration("const", [
|
|
172315
|
+
AST17.variableDeclarator(store_id(query.name.value), AST17.newExpression(factory, []))
|
|
172191
172316
|
])
|
|
172192
172317
|
);
|
|
172193
172318
|
}
|
|
@@ -172203,47 +172328,47 @@ async function QueryProcessor(config, page) {
|
|
|
172203
172328
|
)}. maybe its not exported? `
|
|
172204
172329
|
});
|
|
172205
172330
|
}
|
|
172206
|
-
const queryLoadExpression =
|
|
172207
|
-
|
|
172331
|
+
const queryLoadExpression = AST17.callExpression(
|
|
172332
|
+
AST17.memberExpression(store_id(query.name.value), AST17.identifier("fetch")),
|
|
172208
172333
|
[
|
|
172209
|
-
|
|
172210
|
-
|
|
172211
|
-
|
|
172212
|
-
|
|
172213
|
-
|
|
172214
|
-
|
|
172215
|
-
|
|
172216
|
-
|
|
172334
|
+
AST17.objectExpression([
|
|
172335
|
+
AST17.objectProperty(
|
|
172336
|
+
AST17.identifier("variables"),
|
|
172337
|
+
AST17.callExpression(AST17.identifier("marshalInputs"), [
|
|
172338
|
+
AST17.objectExpression([
|
|
172339
|
+
AST17.objectProperty(
|
|
172340
|
+
AST17.identifier("config"),
|
|
172341
|
+
AST17.callExpression(AST17.identifier("getCurrentConfig"), [])
|
|
172217
172342
|
),
|
|
172218
|
-
|
|
172219
|
-
|
|
172220
|
-
|
|
172343
|
+
AST17.objectProperty(
|
|
172344
|
+
AST17.identifier("artifact"),
|
|
172345
|
+
AST17.memberExpression(
|
|
172221
172346
|
store_id(query.name.value),
|
|
172222
|
-
|
|
172347
|
+
AST17.identifier("artifact")
|
|
172223
172348
|
)
|
|
172224
172349
|
),
|
|
172225
|
-
|
|
172226
|
-
|
|
172227
|
-
has_variables ?
|
|
172228
|
-
|
|
172229
|
-
|
|
172230
|
-
|
|
172350
|
+
AST17.objectProperty(
|
|
172351
|
+
AST17.identifier("input"),
|
|
172352
|
+
has_variables ? AST17.callExpression(
|
|
172353
|
+
AST17.memberExpression(
|
|
172354
|
+
AST17.identifier(variable_fn),
|
|
172355
|
+
AST17.identifier("call")
|
|
172231
172356
|
),
|
|
172232
172357
|
[
|
|
172233
|
-
|
|
172234
|
-
|
|
172358
|
+
AST17.newExpression(
|
|
172359
|
+
AST17.identifier("RequestContext"),
|
|
172235
172360
|
[]
|
|
172236
172361
|
),
|
|
172237
|
-
|
|
172238
|
-
|
|
172239
|
-
|
|
172240
|
-
|
|
172362
|
+
AST17.objectExpression([
|
|
172363
|
+
AST17.objectProperty(
|
|
172364
|
+
AST17.identifier("props"),
|
|
172365
|
+
AST17.objectExpression(
|
|
172241
172366
|
props.map(
|
|
172242
|
-
(prop2) =>
|
|
172243
|
-
|
|
172367
|
+
(prop2) => AST17.objectProperty(
|
|
172368
|
+
AST17.identifier(
|
|
172244
172369
|
prop2
|
|
172245
172370
|
),
|
|
172246
|
-
|
|
172371
|
+
AST17.identifier(
|
|
172247
172372
|
prop2
|
|
172248
172373
|
)
|
|
172249
172374
|
)
|
|
@@ -172252,7 +172377,7 @@ async function QueryProcessor(config, page) {
|
|
|
172252
172377
|
)
|
|
172253
172378
|
])
|
|
172254
172379
|
]
|
|
172255
|
-
) :
|
|
172380
|
+
) : AST17.objectExpression([])
|
|
172256
172381
|
)
|
|
172257
172382
|
])
|
|
172258
172383
|
])
|
|
@@ -172263,23 +172388,23 @@ async function QueryProcessor(config, page) {
|
|
|
172263
172388
|
let finalExpression = [];
|
|
172264
172389
|
if (page.svelte5Runes) {
|
|
172265
172390
|
finalExpression = [
|
|
172266
|
-
|
|
172267
|
-
|
|
172268
|
-
|
|
172391
|
+
AST17.expressionStatement(
|
|
172392
|
+
AST17.callExpression(AST17.identifier("$effect"), [
|
|
172393
|
+
AST17.arrowFunctionExpression(
|
|
172269
172394
|
[],
|
|
172270
|
-
|
|
172395
|
+
AST17.blockStatement([AST17.expressionStatement(queryLoadExpression)])
|
|
172271
172396
|
)
|
|
172272
172397
|
])
|
|
172273
172398
|
)
|
|
172274
172399
|
];
|
|
172275
172400
|
} else {
|
|
172276
172401
|
finalExpression = [
|
|
172277
|
-
|
|
172278
|
-
|
|
172279
|
-
|
|
172280
|
-
|
|
172402
|
+
AST17.labeledStatement(
|
|
172403
|
+
AST17.identifier("$"),
|
|
172404
|
+
AST17.expressionStatement(
|
|
172405
|
+
AST17.logicalExpression(
|
|
172281
172406
|
"&&",
|
|
172282
|
-
|
|
172407
|
+
AST17.identifier("isBrowser"),
|
|
172283
172408
|
queryLoadExpression
|
|
172284
172409
|
)
|
|
172285
172410
|
)
|
|
@@ -172321,8 +172446,8 @@ async function find_inline_queries(page, parsed, store_id) {
|
|
|
172321
172446
|
}
|
|
172322
172447
|
|
|
172323
172448
|
// src/plugin/transforms/kit/init.ts
|
|
172324
|
-
var
|
|
172325
|
-
var
|
|
172449
|
+
var recast18 = __toESM(require_main5(), 1);
|
|
172450
|
+
var AST18 = recast18.types.builders;
|
|
172326
172451
|
async function kit_init(page) {
|
|
172327
172452
|
if (!is_root_layout(page.config, page.filepath)) {
|
|
172328
172453
|
return;
|
|
@@ -172346,9 +172471,9 @@ async function kit_init(page) {
|
|
|
172346
172471
|
import: ["extractSession", "setClientSession"]
|
|
172347
172472
|
}).ids;
|
|
172348
172473
|
page.script.body.push(
|
|
172349
|
-
|
|
172350
|
-
|
|
172351
|
-
|
|
172474
|
+
AST18.expressionStatement(
|
|
172475
|
+
AST18.callExpression(on_mount, [
|
|
172476
|
+
AST18.arrowFunctionExpression([], AST18.callExpression(set_client_started, []))
|
|
172352
172477
|
])
|
|
172353
172478
|
)
|
|
172354
172479
|
);
|
|
@@ -172359,17 +172484,17 @@ async function kit_init(page) {
|
|
|
172359
172484
|
import: ["page"]
|
|
172360
172485
|
}).ids[0];
|
|
172361
172486
|
page.script.body.push(
|
|
172362
|
-
|
|
172363
|
-
|
|
172364
|
-
|
|
172365
|
-
[
|
|
172366
|
-
|
|
172367
|
-
|
|
172368
|
-
|
|
172369
|
-
|
|
172370
|
-
|
|
172371
|
-
|
|
172372
|
-
|
|
172487
|
+
AST18.expressionStatement(
|
|
172488
|
+
AST18.callExpression(AST18.memberExpression(store_id, AST18.identifier("subscribe")), [
|
|
172489
|
+
AST18.arrowFunctionExpression(
|
|
172490
|
+
[AST18.identifier("val")],
|
|
172491
|
+
AST18.blockStatement([
|
|
172492
|
+
AST18.expressionStatement(
|
|
172493
|
+
AST18.callExpression(set_session, [
|
|
172494
|
+
AST18.callExpression(extract_session, [
|
|
172495
|
+
AST18.memberExpression(
|
|
172496
|
+
AST18.identifier("val"),
|
|
172497
|
+
AST18.identifier("data")
|
|
172373
172498
|
)
|
|
172374
172499
|
])
|
|
172375
172500
|
])
|
|
@@ -172383,15 +172508,15 @@ async function kit_init(page) {
|
|
|
172383
172508
|
|
|
172384
172509
|
// src/plugin/transforms/kit/load.ts
|
|
172385
172510
|
import * as graphql36 from "graphql";
|
|
172386
|
-
var
|
|
172387
|
-
var
|
|
172511
|
+
var recast19 = __toESM(require_main5(), 1);
|
|
172512
|
+
var AST19 = recast19.types.builders;
|
|
172388
172513
|
async function kit_load_generator(page) {
|
|
172389
172514
|
const route = is_route(page.config, page.framework, page.filepath);
|
|
172390
172515
|
const script = is_route_script(page.framework, page.filepath);
|
|
172391
172516
|
if (!route && !script) {
|
|
172392
172517
|
return;
|
|
172393
172518
|
}
|
|
172394
|
-
const inline_query_store = (name) => route ?
|
|
172519
|
+
const inline_query_store = (name) => route ? AST19.memberExpression(AST19.identifier("data"), AST19.identifier(name)) : artifact_import({
|
|
172395
172520
|
config: page.config,
|
|
172396
172521
|
script: page.script,
|
|
172397
172522
|
page,
|
|
@@ -172443,8 +172568,8 @@ async function kit_load_generator(page) {
|
|
|
172443
172568
|
find_insert_index(page.script),
|
|
172444
172569
|
0,
|
|
172445
172570
|
...!has_data ? [
|
|
172446
|
-
|
|
172447
|
-
|
|
172571
|
+
AST19.exportNamedDeclaration(
|
|
172572
|
+
AST19.variableDeclaration("let", [AST19.identifier("data")])
|
|
172448
172573
|
)
|
|
172449
172574
|
] : []
|
|
172450
172575
|
);
|
|
@@ -172491,43 +172616,43 @@ function add_load({
|
|
|
172491
172616
|
let before_load = page_info.exports.includes(houdini_before_load_fn);
|
|
172492
172617
|
let afterLoad = page_info.exports.includes(houdini_afterLoad_fn);
|
|
172493
172618
|
let on_error = page_info.exports.includes(houdini_on_error_fn);
|
|
172494
|
-
const request_context =
|
|
172495
|
-
const promise_list =
|
|
172496
|
-
const return_value =
|
|
172497
|
-
const result_obj =
|
|
172498
|
-
const input_obj =
|
|
172499
|
-
const preload_fn =
|
|
172500
|
-
|
|
172501
|
-
[
|
|
172502
|
-
|
|
172503
|
-
|
|
172504
|
-
|
|
172619
|
+
const request_context = AST19.identifier("houdini_context");
|
|
172620
|
+
const promise_list = AST19.identifier("promises");
|
|
172621
|
+
const return_value = AST19.memberExpression(request_context, AST19.identifier("returnValue"));
|
|
172622
|
+
const result_obj = AST19.identifier("result");
|
|
172623
|
+
const input_obj = AST19.identifier("inputs");
|
|
172624
|
+
const preload_fn = AST19.functionDeclaration(
|
|
172625
|
+
AST19.identifier("load"),
|
|
172626
|
+
[AST19.identifier("context")],
|
|
172627
|
+
AST19.blockStatement([
|
|
172628
|
+
AST19.variableDeclaration("const", [
|
|
172629
|
+
AST19.variableDeclarator(
|
|
172505
172630
|
request_context,
|
|
172506
|
-
|
|
172631
|
+
AST19.newExpression(AST19.identifier("RequestContext"), [AST19.identifier("context")])
|
|
172507
172632
|
)
|
|
172508
172633
|
]),
|
|
172509
|
-
|
|
172510
|
-
|
|
172511
|
-
|
|
172512
|
-
|
|
172634
|
+
AST19.variableDeclaration("const", [
|
|
172635
|
+
AST19.variableDeclarator(
|
|
172636
|
+
AST19.identifier("houdiniConfig"),
|
|
172637
|
+
AST19.callExpression(AST19.identifier("getCurrentConfig"), [])
|
|
172513
172638
|
)
|
|
172514
172639
|
]),
|
|
172515
|
-
|
|
172516
|
-
|
|
172640
|
+
AST19.variableDeclaration("const", [
|
|
172641
|
+
AST19.variableDeclarator(promise_list, AST19.arrayExpression([]))
|
|
172517
172642
|
]),
|
|
172518
|
-
|
|
172519
|
-
|
|
172643
|
+
AST19.variableDeclaration("const", [
|
|
172644
|
+
AST19.variableDeclarator(input_obj, AST19.objectExpression([]))
|
|
172520
172645
|
]),
|
|
172521
|
-
|
|
172522
|
-
|
|
172523
|
-
|
|
172524
|
-
|
|
172646
|
+
AST19.returnStatement(
|
|
172647
|
+
AST19.objectExpression([
|
|
172648
|
+
AST19.spreadElement(return_value),
|
|
172649
|
+
AST19.spreadElement(result_obj)
|
|
172525
172650
|
])
|
|
172526
172651
|
)
|
|
172527
172652
|
])
|
|
172528
172653
|
);
|
|
172529
172654
|
preload_fn.async = true;
|
|
172530
|
-
page.script.body.push(
|
|
172655
|
+
page.script.body.push(AST19.exportNamedDeclaration(preload_fn));
|
|
172531
172656
|
let insert_index = 4;
|
|
172532
172657
|
for (const query of queries) {
|
|
172533
172658
|
const { ids } = ensure_imports({
|
|
@@ -172537,19 +172662,19 @@ function add_load({
|
|
|
172537
172662
|
sourceModule: store_import_path({ config: page.config, name: query.name.value })
|
|
172538
172663
|
});
|
|
172539
172664
|
const load_fn = ids[0];
|
|
172540
|
-
const variables = (query.variableDefinitions?.length ?? 0) > 0 ?
|
|
172541
|
-
|
|
172542
|
-
|
|
172543
|
-
|
|
172665
|
+
const variables = (query.variableDefinitions?.length ?? 0) > 0 ? AST19.awaitExpression(
|
|
172666
|
+
AST19.callExpression(AST19.identifier(__variable_fn_name(query.name.value)), [
|
|
172667
|
+
AST19.identifier("houdiniConfig"),
|
|
172668
|
+
AST19.identifier("context")
|
|
172544
172669
|
])
|
|
172545
|
-
) :
|
|
172670
|
+
) : AST19.objectExpression([]);
|
|
172546
172671
|
preload_fn.body.body.splice(
|
|
172547
172672
|
insert_index++,
|
|
172548
172673
|
0,
|
|
172549
|
-
|
|
172550
|
-
|
|
172674
|
+
AST19.expressionStatement(
|
|
172675
|
+
AST19.assignmentExpression(
|
|
172551
172676
|
"=",
|
|
172552
|
-
|
|
172677
|
+
AST19.memberExpression(input_obj, AST19.literal(query.name.value)),
|
|
172553
172678
|
variables
|
|
172554
172679
|
)
|
|
172555
172680
|
)
|
|
@@ -172557,18 +172682,18 @@ function add_load({
|
|
|
172557
172682
|
preload_fn.body.body.splice(
|
|
172558
172683
|
insert_index++,
|
|
172559
172684
|
0,
|
|
172560
|
-
|
|
172561
|
-
|
|
172562
|
-
|
|
172563
|
-
|
|
172564
|
-
|
|
172565
|
-
|
|
172566
|
-
|
|
172685
|
+
AST19.expressionStatement(
|
|
172686
|
+
AST19.callExpression(AST19.memberExpression(promise_list, AST19.identifier("push")), [
|
|
172687
|
+
AST19.callExpression(load_fn, [
|
|
172688
|
+
AST19.objectExpression([
|
|
172689
|
+
AST19.objectProperty(
|
|
172690
|
+
AST19.literal("variables"),
|
|
172691
|
+
AST19.memberExpression(input_obj, AST19.literal(query.name.value))
|
|
172567
172692
|
),
|
|
172568
|
-
|
|
172569
|
-
|
|
172570
|
-
|
|
172571
|
-
afterLoad || on_error ?
|
|
172693
|
+
AST19.objectProperty(AST19.literal("event"), AST19.identifier("context")),
|
|
172694
|
+
AST19.objectProperty(
|
|
172695
|
+
AST19.literal("blocking"),
|
|
172696
|
+
afterLoad || on_error ? AST19.booleanLiteral(true) : AST19.identifier("undefined")
|
|
172572
172697
|
)
|
|
172573
172698
|
])
|
|
172574
172699
|
])
|
|
@@ -172580,28 +172705,28 @@ function add_load({
|
|
|
172580
172705
|
preload_fn.body.body.splice(
|
|
172581
172706
|
insert_index++,
|
|
172582
172707
|
0,
|
|
172583
|
-
|
|
172584
|
-
|
|
172708
|
+
AST19.variableDeclaration("let", [
|
|
172709
|
+
AST19.variableDeclarator(result_obj, AST19.objectExpression([]))
|
|
172585
172710
|
]),
|
|
172586
|
-
|
|
172587
|
-
|
|
172588
|
-
|
|
172589
|
-
|
|
172711
|
+
AST19.tryStatement(
|
|
172712
|
+
AST19.blockStatement([
|
|
172713
|
+
AST19.expressionStatement(
|
|
172714
|
+
AST19.assignmentExpression(
|
|
172590
172715
|
"=",
|
|
172591
172716
|
result_obj,
|
|
172592
|
-
|
|
172593
|
-
|
|
172594
|
-
|
|
172595
|
-
|
|
172717
|
+
AST19.callExpression(
|
|
172718
|
+
AST19.memberExpression(
|
|
172719
|
+
AST19.identifier("Object"),
|
|
172720
|
+
AST19.identifier("assign")
|
|
172596
172721
|
),
|
|
172597
172722
|
[
|
|
172598
|
-
|
|
172599
|
-
|
|
172600
|
-
|
|
172601
|
-
|
|
172602
|
-
|
|
172603
|
-
|
|
172604
|
-
|
|
172723
|
+
AST19.objectExpression([]),
|
|
172724
|
+
AST19.spreadElement(
|
|
172725
|
+
AST19.awaitExpression(
|
|
172726
|
+
AST19.callExpression(
|
|
172727
|
+
AST19.memberExpression(
|
|
172728
|
+
AST19.identifier("Promise"),
|
|
172729
|
+
AST19.identifier("all")
|
|
172605
172730
|
),
|
|
172606
172731
|
[promise_list]
|
|
172607
172732
|
)
|
|
@@ -172612,37 +172737,37 @@ function add_load({
|
|
|
172612
172737
|
)
|
|
172613
172738
|
)
|
|
172614
172739
|
]),
|
|
172615
|
-
|
|
172616
|
-
|
|
172740
|
+
AST19.catchClause(
|
|
172741
|
+
AST19.identifier("err"),
|
|
172617
172742
|
null,
|
|
172618
|
-
|
|
172619
|
-
on_error ?
|
|
172620
|
-
|
|
172621
|
-
|
|
172622
|
-
|
|
172743
|
+
AST19.blockStatement([
|
|
172744
|
+
on_error ? AST19.expressionStatement(
|
|
172745
|
+
AST19.awaitExpression(
|
|
172746
|
+
AST19.callExpression(
|
|
172747
|
+
AST19.memberExpression(
|
|
172623
172748
|
request_context,
|
|
172624
|
-
|
|
172749
|
+
AST19.identifier("invokeLoadHook")
|
|
172625
172750
|
),
|
|
172626
172751
|
[
|
|
172627
|
-
|
|
172628
|
-
|
|
172629
|
-
|
|
172630
|
-
|
|
172752
|
+
AST19.objectExpression([
|
|
172753
|
+
AST19.objectProperty(
|
|
172754
|
+
AST19.literal("variant"),
|
|
172755
|
+
AST19.stringLiteral("error")
|
|
172631
172756
|
),
|
|
172632
|
-
|
|
172633
|
-
|
|
172634
|
-
|
|
172757
|
+
AST19.objectProperty(
|
|
172758
|
+
AST19.literal("hookFn"),
|
|
172759
|
+
AST19.identifier(houdini_on_error_fn)
|
|
172635
172760
|
),
|
|
172636
|
-
|
|
172637
|
-
|
|
172638
|
-
|
|
172761
|
+
AST19.objectProperty(
|
|
172762
|
+
AST19.literal("error"),
|
|
172763
|
+
AST19.identifier("err")
|
|
172639
172764
|
),
|
|
172640
|
-
|
|
172765
|
+
AST19.objectProperty(AST19.literal("input"), input_obj)
|
|
172641
172766
|
])
|
|
172642
172767
|
]
|
|
172643
172768
|
)
|
|
172644
172769
|
)
|
|
172645
|
-
) :
|
|
172770
|
+
) : AST19.throwStatement(AST19.identifier("err"))
|
|
172646
172771
|
])
|
|
172647
172772
|
)
|
|
172648
172773
|
)
|
|
@@ -172677,22 +172802,22 @@ async function find_special_query(type, page) {
|
|
|
172677
172802
|
return definition;
|
|
172678
172803
|
}
|
|
172679
172804
|
function load_hook_statements(name, request_context, input_id, result_id) {
|
|
172680
|
-
return
|
|
172681
|
-
|
|
172682
|
-
|
|
172683
|
-
|
|
172805
|
+
return AST19.expressionStatement(
|
|
172806
|
+
AST19.awaitExpression(
|
|
172807
|
+
AST19.callExpression(
|
|
172808
|
+
AST19.memberExpression(request_context, AST19.identifier("invokeLoadHook")),
|
|
172684
172809
|
[
|
|
172685
|
-
|
|
172686
|
-
|
|
172687
|
-
|
|
172688
|
-
|
|
172689
|
-
|
|
172810
|
+
AST19.objectExpression([
|
|
172811
|
+
AST19.objectProperty(AST19.literal("variant"), AST19.stringLiteral(name)),
|
|
172812
|
+
AST19.objectProperty(
|
|
172813
|
+
AST19.literal("hookFn"),
|
|
172814
|
+
AST19.identifier(
|
|
172690
172815
|
name === "before" ? houdini_before_load_fn : houdini_afterLoad_fn
|
|
172691
172816
|
)
|
|
172692
172817
|
),
|
|
172693
172818
|
...name === "after" ? [
|
|
172694
|
-
|
|
172695
|
-
|
|
172819
|
+
AST19.objectProperty(AST19.literal("input"), input_id),
|
|
172820
|
+
AST19.objectProperty(AST19.literal("data"), result_id)
|
|
172696
172821
|
] : []
|
|
172697
172822
|
])
|
|
172698
172823
|
]
|
|
@@ -172754,22 +172879,22 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
172754
172879
|
};
|
|
172755
172880
|
}
|
|
172756
172881
|
const fn_body = [
|
|
172757
|
-
|
|
172758
|
-
|
|
172759
|
-
|
|
172760
|
-
|
|
172882
|
+
AST19.variableDeclaration("const", [
|
|
172883
|
+
AST19.variableDeclarator(
|
|
172884
|
+
AST19.identifier("result"),
|
|
172885
|
+
AST19.objectExpression(
|
|
172761
172886
|
Object.entries(has_args).map(([arg, type]) => {
|
|
172762
|
-
return
|
|
172763
|
-
|
|
172764
|
-
|
|
172765
|
-
|
|
172766
|
-
|
|
172767
|
-
|
|
172768
|
-
|
|
172769
|
-
|
|
172770
|
-
|
|
172887
|
+
return AST19.objectProperty(
|
|
172888
|
+
AST19.identifier(arg),
|
|
172889
|
+
AST19.callExpression(AST19.identifier("parseScalar"), [
|
|
172890
|
+
AST19.identifier("config"),
|
|
172891
|
+
AST19.stringLiteral(type),
|
|
172892
|
+
AST19.memberExpression(
|
|
172893
|
+
AST19.memberExpression(
|
|
172894
|
+
AST19.identifier("event"),
|
|
172895
|
+
AST19.identifier("params")
|
|
172771
172896
|
),
|
|
172772
|
-
|
|
172897
|
+
AST19.identifier(arg)
|
|
172773
172898
|
)
|
|
172774
172899
|
])
|
|
172775
172900
|
);
|
|
@@ -172780,28 +172905,28 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
172780
172905
|
];
|
|
172781
172906
|
if (has_local) {
|
|
172782
172907
|
fn_body.push(
|
|
172783
|
-
|
|
172784
|
-
|
|
172785
|
-
|
|
172908
|
+
AST19.expressionStatement(
|
|
172909
|
+
AST19.callExpression(
|
|
172910
|
+
AST19.memberExpression(AST19.identifier("Object"), AST19.identifier("assign")),
|
|
172786
172911
|
[
|
|
172787
|
-
|
|
172788
|
-
|
|
172789
|
-
|
|
172790
|
-
|
|
172791
|
-
|
|
172792
|
-
|
|
172912
|
+
AST19.identifier("result"),
|
|
172913
|
+
AST19.callExpression(AST19.identifier("marshalInputs"), [
|
|
172914
|
+
AST19.objectExpression([
|
|
172915
|
+
AST19.objectProperty(
|
|
172916
|
+
AST19.identifier("config"),
|
|
172917
|
+
AST19.identifier("config")
|
|
172793
172918
|
),
|
|
172794
|
-
|
|
172795
|
-
|
|
172796
|
-
|
|
172797
|
-
|
|
172798
|
-
|
|
172799
|
-
[
|
|
172919
|
+
AST19.objectProperty(
|
|
172920
|
+
AST19.identifier("input"),
|
|
172921
|
+
AST19.awaitExpression(
|
|
172922
|
+
AST19.callExpression(
|
|
172923
|
+
AST19.identifier(query_variable_fn(query.name.value)),
|
|
172924
|
+
[AST19.identifier("event")]
|
|
172800
172925
|
)
|
|
172801
172926
|
)
|
|
172802
172927
|
),
|
|
172803
|
-
|
|
172804
|
-
|
|
172928
|
+
AST19.objectProperty(
|
|
172929
|
+
AST19.identifier("artifact"),
|
|
172805
172930
|
artifact_import({
|
|
172806
172931
|
config: page.config,
|
|
172807
172932
|
script: page.script,
|
|
@@ -172816,11 +172941,11 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
172816
172941
|
)
|
|
172817
172942
|
);
|
|
172818
172943
|
}
|
|
172819
|
-
fn_body.push(
|
|
172820
|
-
const declaration2 =
|
|
172821
|
-
|
|
172822
|
-
[
|
|
172823
|
-
|
|
172944
|
+
fn_body.push(AST19.returnStatement(AST19.identifier("result")));
|
|
172945
|
+
const declaration2 = AST19.functionDeclaration(
|
|
172946
|
+
AST19.identifier(__variable_fn_name(query.name.value)),
|
|
172947
|
+
[AST19.identifier("config"), AST19.identifier("event")],
|
|
172948
|
+
AST19.blockStatement(fn_body)
|
|
172824
172949
|
);
|
|
172825
172950
|
declaration2.async = true;
|
|
172826
172951
|
return declaration2;
|
|
@@ -172830,8 +172955,8 @@ function __variable_fn_name(name) {
|
|
|
172830
172955
|
}
|
|
172831
172956
|
|
|
172832
172957
|
// src/plugin/transforms/kit/session.ts
|
|
172833
|
-
var
|
|
172834
|
-
var
|
|
172958
|
+
var recast20 = __toESM(require_main5(), 1);
|
|
172959
|
+
var AST20 = recast20.types.builders;
|
|
172835
172960
|
function session_default(page) {
|
|
172836
172961
|
if (is_root_layout_server(page.config, page.filepath)) {
|
|
172837
172962
|
process_root_layout_server(page);
|
|
@@ -172847,12 +172972,12 @@ function process_root_layout_server(page) {
|
|
|
172847
172972
|
sourceModule: "$houdini/plugins/houdini-svelte/runtime/session"
|
|
172848
172973
|
}).ids[0];
|
|
172849
172974
|
add_load_return(page, (event_id) => [
|
|
172850
|
-
|
|
172975
|
+
AST20.spreadElement(AST20.callExpression(build_session_object, [event_id]))
|
|
172851
172976
|
]);
|
|
172852
172977
|
}
|
|
172853
172978
|
function process_root_layout_script(page) {
|
|
172854
172979
|
add_load_return(page, (event_id) => [
|
|
172855
|
-
|
|
172980
|
+
AST20.spreadElement(AST20.memberExpression(event_id, AST20.identifier("data")))
|
|
172856
172981
|
]);
|
|
172857
172982
|
}
|
|
172858
172983
|
function add_load_return(page, properties) {
|
|
@@ -172864,50 +172989,78 @@ function add_load_return(page, properties) {
|
|
|
172864
172989
|
if (return_statement_index !== -1) {
|
|
172865
172990
|
return_statement = body.body[return_statement_index];
|
|
172866
172991
|
} else {
|
|
172867
|
-
return_statement =
|
|
172992
|
+
return_statement = AST20.returnStatement(AST20.objectExpression([]));
|
|
172868
172993
|
body.body.push(return_statement);
|
|
172869
|
-
return_statement_index = body.body.length - 1;
|
|
172870
172994
|
}
|
|
172871
|
-
|
|
172872
|
-
|
|
172873
|
-
|
|
172874
|
-
|
|
172875
|
-
|
|
172876
|
-
|
|
172877
|
-
|
|
172878
|
-
|
|
172879
|
-
|
|
172880
|
-
|
|
172881
|
-
|
|
172995
|
+
return walk(body, {
|
|
172996
|
+
enter(node) {
|
|
172997
|
+
if (node.type === "ReturnStatement") {
|
|
172998
|
+
const returnedValue = node.argument;
|
|
172999
|
+
this.replace(
|
|
173000
|
+
AST20.returnStatement(
|
|
173001
|
+
AST20.objectExpression([
|
|
173002
|
+
...properties(event_id),
|
|
173003
|
+
AST20.spreadElement(returnedValue ?? AST20.objectExpression([]))
|
|
173004
|
+
])
|
|
173005
|
+
)
|
|
173006
|
+
);
|
|
173007
|
+
}
|
|
173008
|
+
}
|
|
173009
|
+
});
|
|
172882
173010
|
});
|
|
172883
173011
|
}
|
|
172884
173012
|
function modify_load(page, cb) {
|
|
172885
|
-
let
|
|
172886
|
-
let event_id =
|
|
172887
|
-
let
|
|
173013
|
+
let exported = find_exported_fn(page.script.body, "load");
|
|
173014
|
+
let event_id = AST20.identifier("event");
|
|
173015
|
+
let load_fn = exported?.declaration || null;
|
|
173016
|
+
let body = AST20.blockStatement([]);
|
|
172888
173017
|
if (load_fn?.type === "ArrowFunctionExpression") {
|
|
172889
173018
|
if (load_fn.body.type === "BlockStatement") {
|
|
172890
173019
|
body = load_fn.body;
|
|
172891
173020
|
} else {
|
|
172892
|
-
body =
|
|
173021
|
+
body = AST20.blockStatement([AST20.returnStatement(load_fn.body)]);
|
|
172893
173022
|
load_fn.body = body;
|
|
172894
173023
|
}
|
|
172895
|
-
} else if (load_fn) {
|
|
173024
|
+
} else if (load_fn && "body" in load_fn) {
|
|
172896
173025
|
body = load_fn.body;
|
|
172897
173026
|
}
|
|
172898
173027
|
if (!load_fn) {
|
|
172899
|
-
load_fn =
|
|
172900
|
-
|
|
173028
|
+
load_fn = AST20.functionDeclaration(
|
|
173029
|
+
AST20.identifier("load"),
|
|
172901
173030
|
[event_id],
|
|
172902
|
-
|
|
173031
|
+
AST20.blockStatement([])
|
|
172903
173032
|
);
|
|
172904
173033
|
load_fn.async = true;
|
|
172905
173034
|
page.script.body.splice(
|
|
172906
173035
|
find_insert_index(page.script),
|
|
172907
173036
|
0,
|
|
172908
|
-
|
|
173037
|
+
AST20.exportNamedDeclaration(load_fn)
|
|
172909
173038
|
);
|
|
172910
173039
|
body = load_fn.body;
|
|
173040
|
+
} else if (load_fn.type === "CallExpression" || load_fn.type === "Identifier") {
|
|
173041
|
+
const exportStatement = exported?.export;
|
|
173042
|
+
if (!exportStatement) {
|
|
173043
|
+
return;
|
|
173044
|
+
}
|
|
173045
|
+
const intermediateID = AST20.identifier("houdini__intermediate__load__");
|
|
173046
|
+
page.script.body.push(
|
|
173047
|
+
AST20.variableDeclaration("const", [AST20.variableDeclarator(intermediateID, load_fn)])
|
|
173048
|
+
);
|
|
173049
|
+
const newLoad = AST20.arrowFunctionExpression(
|
|
173050
|
+
[AST20.identifier("event")],
|
|
173051
|
+
AST20.blockStatement([
|
|
173052
|
+
AST20.variableDeclaration("const", [
|
|
173053
|
+
AST20.variableDeclarator(
|
|
173054
|
+
AST20.identifier("result"),
|
|
173055
|
+
AST20.callExpression(intermediateID, [AST20.identifier("event")])
|
|
173056
|
+
)
|
|
173057
|
+
]),
|
|
173058
|
+
AST20.returnStatement(AST20.identifier("result"))
|
|
173059
|
+
])
|
|
173060
|
+
);
|
|
173061
|
+
exportStatement.declaration.declarations[0].init = newLoad;
|
|
173062
|
+
load_fn = newLoad;
|
|
173063
|
+
body = newLoad.body;
|
|
172911
173064
|
} else {
|
|
172912
173065
|
if (load_fn.params.length === 0) {
|
|
172913
173066
|
load_fn.params.push(event_id);
|
|
@@ -172917,7 +173070,7 @@ function modify_load(page, cb) {
|
|
|
172917
173070
|
const pattern = load_fn.params[0];
|
|
172918
173071
|
load_fn.params[0] = event_id;
|
|
172919
173072
|
body.body.unshift(
|
|
172920
|
-
|
|
173073
|
+
AST20.variableDeclaration("let", [AST20.variableDeclarator(pattern, event_id)])
|
|
172921
173074
|
);
|
|
172922
173075
|
} else {
|
|
172923
173076
|
throw new Error(
|
|
@@ -172925,7 +173078,7 @@ function modify_load(page, cb) {
|
|
|
172925
173078
|
);
|
|
172926
173079
|
}
|
|
172927
173080
|
}
|
|
172928
|
-
cb(body, event_id);
|
|
173081
|
+
load_fn.body = cb(body, event_id);
|
|
172929
173082
|
}
|
|
172930
173083
|
|
|
172931
173084
|
// src/plugin/transforms/kit/index.ts
|
|
@@ -172938,8 +173091,8 @@ async function SvelteKitProcessor(config, page) {
|
|
|
172938
173091
|
}
|
|
172939
173092
|
|
|
172940
173093
|
// src/plugin/transforms/tags.ts
|
|
172941
|
-
var
|
|
172942
|
-
var
|
|
173094
|
+
var recast21 = __toESM(require_main5(), 1);
|
|
173095
|
+
var AST21 = recast21.types.builders;
|
|
172943
173096
|
async function GraphQLTagProcessor(config, page) {
|
|
172944
173097
|
await find_graphql(config, page.script, {
|
|
172945
173098
|
dependency: page.watch_file,
|
|
@@ -172947,7 +173100,7 @@ async function GraphQLTagProcessor(config, page) {
|
|
|
172947
173100
|
const { node, parsedDocument } = tag2;
|
|
172948
173101
|
const operation = config.extractDefinition(parsedDocument);
|
|
172949
173102
|
const { id: id2 } = store_import({ page, artifact: { name: operation.name.value } });
|
|
172950
|
-
node.replaceWith(
|
|
173103
|
+
node.replaceWith(AST21.newExpression(id2, []));
|
|
172951
173104
|
}
|
|
172952
173105
|
});
|
|
172953
173106
|
}
|
|
@@ -172966,7 +173119,7 @@ async function apply_transforms(framework2, page) {
|
|
|
172966
173119
|
position = res.position;
|
|
172967
173120
|
useRunes = res.useRunes;
|
|
172968
173121
|
} else {
|
|
172969
|
-
script =
|
|
173122
|
+
script = recast23.types.builders.program([]);
|
|
172970
173123
|
position = { start: 0, end: 0 };
|
|
172971
173124
|
}
|
|
172972
173125
|
} else {
|