houdini-svelte 2.1.0 → 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-cjs/index.js +660 -507
- package/build/plugin-esm/index.js +660 -507
- package/build/preprocess-cjs/index.js +615 -462
- package/build/preprocess-esm/index.js +615 -462
- package/build/test-cjs/index.js +576 -263
- package/build/test-esm/index.js +576 -263
- package/package.json +2 -2
|
@@ -89820,7 +89820,18 @@ var ListManager = class {
|
|
|
89820
89820
|
}
|
|
89821
89821
|
lists = /* @__PURE__ */ new Map();
|
|
89822
89822
|
listsByField = /* @__PURE__ */ new Map();
|
|
89823
|
-
get(listName, id2, allLists) {
|
|
89823
|
+
get(listName, id2, allLists, skipMatches) {
|
|
89824
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
89825
|
+
if (!lists) {
|
|
89826
|
+
return null;
|
|
89827
|
+
}
|
|
89828
|
+
if (skipMatches) {
|
|
89829
|
+
return new ListCollection(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
89830
|
+
} else {
|
|
89831
|
+
return lists;
|
|
89832
|
+
}
|
|
89833
|
+
}
|
|
89834
|
+
getLists(listName, id2, allLists) {
|
|
89824
89835
|
const matches = this.lists.get(listName);
|
|
89825
89836
|
if (!matches || matches.size === 0) {
|
|
89826
89837
|
return null;
|
|
@@ -89942,6 +89953,9 @@ var List = class {
|
|
|
89942
89953
|
this.manager = manager;
|
|
89943
89954
|
this.abstract = abstract;
|
|
89944
89955
|
}
|
|
89956
|
+
get fieldRef() {
|
|
89957
|
+
return `${this.recordID}.${this.key}`;
|
|
89958
|
+
}
|
|
89945
89959
|
when(when) {
|
|
89946
89960
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
89947
89961
|
}
|
|
@@ -91086,8 +91100,8 @@ var Cache = class {
|
|
|
91086
91100
|
variables
|
|
91087
91101
|
);
|
|
91088
91102
|
}
|
|
91089
|
-
list(name, parentID, allLists) {
|
|
91090
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
91103
|
+
list(name, parentID, allLists, skipMatches) {
|
|
91104
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
91091
91105
|
if (!handler) {
|
|
91092
91106
|
throw new Error(
|
|
91093
91107
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -91502,6 +91516,7 @@ var CacheInternal = class {
|
|
|
91502
91516
|
});
|
|
91503
91517
|
}
|
|
91504
91518
|
}
|
|
91519
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
91505
91520
|
for (const operation of operations || []) {
|
|
91506
91521
|
let parentID;
|
|
91507
91522
|
if (operation.parentID) {
|
|
@@ -91521,7 +91536,12 @@ var CacheInternal = class {
|
|
|
91521
91536
|
const targets = Array.isArray(value) ? value : [value];
|
|
91522
91537
|
for (const target of targets) {
|
|
91523
91538
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
91524
|
-
this.cache.list(
|
|
91539
|
+
this.cache.list(
|
|
91540
|
+
operation.list,
|
|
91541
|
+
parentID,
|
|
91542
|
+
operation.target === "all",
|
|
91543
|
+
processedOperations
|
|
91544
|
+
).when(operation.when).addToList(
|
|
91525
91545
|
fieldSelection,
|
|
91526
91546
|
target,
|
|
91527
91547
|
variables,
|
|
@@ -91529,7 +91549,12 @@ var CacheInternal = class {
|
|
|
91529
91549
|
layer
|
|
91530
91550
|
);
|
|
91531
91551
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
91532
|
-
this.cache.list(
|
|
91552
|
+
this.cache.list(
|
|
91553
|
+
operation.list,
|
|
91554
|
+
parentID,
|
|
91555
|
+
operation.target === "all",
|
|
91556
|
+
processedOperations
|
|
91557
|
+
).when(operation.when).toggleElement({
|
|
91533
91558
|
selection: fieldSelection,
|
|
91534
91559
|
data: target,
|
|
91535
91560
|
variables,
|
|
@@ -91537,7 +91562,12 @@ var CacheInternal = class {
|
|
|
91537
91562
|
layer
|
|
91538
91563
|
});
|
|
91539
91564
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
91540
|
-
this.cache.list(
|
|
91565
|
+
this.cache.list(
|
|
91566
|
+
operation.list,
|
|
91567
|
+
parentID,
|
|
91568
|
+
operation.target === "all",
|
|
91569
|
+
processedOperations
|
|
91570
|
+
).when(operation.when).remove(target, variables, layer);
|
|
91541
91571
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
91542
91572
|
const targetID = this.id(operation.type, target);
|
|
91543
91573
|
if (!targetID) {
|
|
@@ -91549,6 +91579,16 @@ var CacheInternal = class {
|
|
|
91549
91579
|
this.cache.delete(targetID, layer);
|
|
91550
91580
|
}
|
|
91551
91581
|
}
|
|
91582
|
+
if (operation.list) {
|
|
91583
|
+
const matchingLists = this.cache.list(
|
|
91584
|
+
operation.list,
|
|
91585
|
+
parentID,
|
|
91586
|
+
operation.target === "all"
|
|
91587
|
+
);
|
|
91588
|
+
for (const list3 of matchingLists.lists) {
|
|
91589
|
+
processedOperations.add(list3.fieldRef);
|
|
91590
|
+
}
|
|
91591
|
+
}
|
|
91552
91592
|
}
|
|
91553
91593
|
}
|
|
91554
91594
|
return toNotify;
|
|
@@ -93356,7 +93396,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
93356
93396
|
}
|
|
93357
93397
|
|
|
93358
93398
|
// src/plugin/transforms/index.ts
|
|
93359
|
-
var
|
|
93399
|
+
var recast21 = __toESM(require_main4(), 1);
|
|
93360
93400
|
|
|
93361
93401
|
// ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
|
|
93362
93402
|
var WalkerBase2 = class {
|
|
@@ -129071,30 +129111,30 @@ var require_utils5 = __commonJS3({
|
|
|
129071
129111
|
validate3.oneOf = values;
|
|
129072
129112
|
return validate3;
|
|
129073
129113
|
}
|
|
129074
|
-
function assertNodeType(...
|
|
129114
|
+
function assertNodeType(...types18) {
|
|
129075
129115
|
function validate3(node, key2, val) {
|
|
129076
|
-
for (const type of
|
|
129116
|
+
for (const type of types18) {
|
|
129077
129117
|
if ((0, _is.default)(type, val)) {
|
|
129078
129118
|
(0, _validate.validateChild)(node, key2, val);
|
|
129079
129119
|
return;
|
|
129080
129120
|
}
|
|
129081
129121
|
}
|
|
129082
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
129122
|
+
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)}`);
|
|
129083
129123
|
}
|
|
129084
|
-
validate3.oneOfNodeTypes =
|
|
129124
|
+
validate3.oneOfNodeTypes = types18;
|
|
129085
129125
|
return validate3;
|
|
129086
129126
|
}
|
|
129087
|
-
function assertNodeOrValueType(...
|
|
129127
|
+
function assertNodeOrValueType(...types18) {
|
|
129088
129128
|
function validate3(node, key2, val) {
|
|
129089
|
-
for (const type of
|
|
129129
|
+
for (const type of types18) {
|
|
129090
129130
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
129091
129131
|
(0, _validate.validateChild)(node, key2, val);
|
|
129092
129132
|
return;
|
|
129093
129133
|
}
|
|
129094
129134
|
}
|
|
129095
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
129135
|
+
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)}`);
|
|
129096
129136
|
}
|
|
129097
|
-
validate3.oneOfNodeOrValueTypes =
|
|
129137
|
+
validate3.oneOfNodeOrValueTypes = types18;
|
|
129098
129138
|
return validate3;
|
|
129099
129139
|
}
|
|
129100
129140
|
function assertValueType(type) {
|
|
@@ -133498,10 +133538,10 @@ var require_generated22 = __commonJS3({
|
|
|
133498
133538
|
body
|
|
133499
133539
|
});
|
|
133500
133540
|
}
|
|
133501
|
-
function intersectionTypeAnnotation(
|
|
133541
|
+
function intersectionTypeAnnotation(types18) {
|
|
133502
133542
|
return (0, _validateNode.default)({
|
|
133503
133543
|
type: "IntersectionTypeAnnotation",
|
|
133504
|
-
types:
|
|
133544
|
+
types: types18
|
|
133505
133545
|
});
|
|
133506
133546
|
}
|
|
133507
133547
|
function mixedTypeAnnotation() {
|
|
@@ -133624,10 +133664,10 @@ var require_generated22 = __commonJS3({
|
|
|
133624
133664
|
type: "ThisTypeAnnotation"
|
|
133625
133665
|
};
|
|
133626
133666
|
}
|
|
133627
|
-
function tupleTypeAnnotation(
|
|
133667
|
+
function tupleTypeAnnotation(types18) {
|
|
133628
133668
|
return (0, _validateNode.default)({
|
|
133629
133669
|
type: "TupleTypeAnnotation",
|
|
133630
|
-
types:
|
|
133670
|
+
types: types18
|
|
133631
133671
|
});
|
|
133632
133672
|
}
|
|
133633
133673
|
function typeofTypeAnnotation(argument) {
|
|
@@ -133678,10 +133718,10 @@ var require_generated22 = __commonJS3({
|
|
|
133678
133718
|
params
|
|
133679
133719
|
});
|
|
133680
133720
|
}
|
|
133681
|
-
function unionTypeAnnotation(
|
|
133721
|
+
function unionTypeAnnotation(types18) {
|
|
133682
133722
|
return (0, _validateNode.default)({
|
|
133683
133723
|
type: "UnionTypeAnnotation",
|
|
133684
|
-
types:
|
|
133724
|
+
types: types18
|
|
133685
133725
|
});
|
|
133686
133726
|
}
|
|
133687
133727
|
function variance(kind) {
|
|
@@ -134194,16 +134234,16 @@ var require_generated22 = __commonJS3({
|
|
|
134194
134234
|
optional
|
|
134195
134235
|
});
|
|
134196
134236
|
}
|
|
134197
|
-
function tsUnionType(
|
|
134237
|
+
function tsUnionType(types18) {
|
|
134198
134238
|
return (0, _validateNode.default)({
|
|
134199
134239
|
type: "TSUnionType",
|
|
134200
|
-
types:
|
|
134240
|
+
types: types18
|
|
134201
134241
|
});
|
|
134202
134242
|
}
|
|
134203
|
-
function tsIntersectionType(
|
|
134243
|
+
function tsIntersectionType(types18) {
|
|
134204
134244
|
return (0, _validateNode.default)({
|
|
134205
134245
|
type: "TSIntersectionType",
|
|
134206
|
-
types:
|
|
134246
|
+
types: types18
|
|
134207
134247
|
});
|
|
134208
134248
|
}
|
|
134209
134249
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -135804,12 +135844,12 @@ var require_removeTypeDuplicates3 = __commonJS3({
|
|
|
135804
135844
|
const generics = /* @__PURE__ */ new Map();
|
|
135805
135845
|
const bases = /* @__PURE__ */ new Map();
|
|
135806
135846
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
135807
|
-
const
|
|
135847
|
+
const types18 = [];
|
|
135808
135848
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
135809
135849
|
const node = nodes[i22];
|
|
135810
135850
|
if (!node)
|
|
135811
135851
|
continue;
|
|
135812
|
-
if (
|
|
135852
|
+
if (types18.indexOf(node) >= 0) {
|
|
135813
135853
|
continue;
|
|
135814
135854
|
}
|
|
135815
135855
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -135843,15 +135883,15 @@ var require_removeTypeDuplicates3 = __commonJS3({
|
|
|
135843
135883
|
}
|
|
135844
135884
|
continue;
|
|
135845
135885
|
}
|
|
135846
|
-
|
|
135886
|
+
types18.push(node);
|
|
135847
135887
|
}
|
|
135848
135888
|
for (const [, baseType] of bases) {
|
|
135849
|
-
|
|
135889
|
+
types18.push(baseType);
|
|
135850
135890
|
}
|
|
135851
135891
|
for (const [, genericName] of generics) {
|
|
135852
|
-
|
|
135892
|
+
types18.push(genericName);
|
|
135853
135893
|
}
|
|
135854
|
-
return
|
|
135894
|
+
return types18;
|
|
135855
135895
|
}
|
|
135856
135896
|
}
|
|
135857
135897
|
});
|
|
@@ -135864,8 +135904,8 @@ var require_createFlowUnionType2 = __commonJS3({
|
|
|
135864
135904
|
exports.default = createFlowUnionType;
|
|
135865
135905
|
var _generated = require_generated22();
|
|
135866
135906
|
var _removeTypeDuplicates = require_removeTypeDuplicates3();
|
|
135867
|
-
function createFlowUnionType(
|
|
135868
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
135907
|
+
function createFlowUnionType(types18) {
|
|
135908
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
135869
135909
|
if (flattened.length === 1) {
|
|
135870
135910
|
return flattened[0];
|
|
135871
135911
|
} else {
|
|
@@ -135890,12 +135930,12 @@ var require_removeTypeDuplicates22 = __commonJS3({
|
|
|
135890
135930
|
const generics = /* @__PURE__ */ new Map();
|
|
135891
135931
|
const bases = /* @__PURE__ */ new Map();
|
|
135892
135932
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
135893
|
-
const
|
|
135933
|
+
const types18 = [];
|
|
135894
135934
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
135895
135935
|
const node = nodes[i22];
|
|
135896
135936
|
if (!node)
|
|
135897
135937
|
continue;
|
|
135898
|
-
if (
|
|
135938
|
+
if (types18.indexOf(node) >= 0) {
|
|
135899
135939
|
continue;
|
|
135900
135940
|
}
|
|
135901
135941
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -135929,15 +135969,15 @@ var require_removeTypeDuplicates22 = __commonJS3({
|
|
|
135929
135969
|
}
|
|
135930
135970
|
continue;
|
|
135931
135971
|
}
|
|
135932
|
-
|
|
135972
|
+
types18.push(node);
|
|
135933
135973
|
}
|
|
135934
135974
|
for (const [, baseType] of bases) {
|
|
135935
|
-
|
|
135975
|
+
types18.push(baseType);
|
|
135936
135976
|
}
|
|
135937
135977
|
for (const [, genericName] of generics) {
|
|
135938
|
-
|
|
135978
|
+
types18.push(genericName);
|
|
135939
135979
|
}
|
|
135940
|
-
return
|
|
135980
|
+
return types18;
|
|
135941
135981
|
}
|
|
135942
135982
|
}
|
|
135943
135983
|
});
|
|
@@ -135952,10 +135992,10 @@ var require_createTSUnionType2 = __commonJS3({
|
|
|
135952
135992
|
var _removeTypeDuplicates = require_removeTypeDuplicates22();
|
|
135953
135993
|
var _index = require_generated5();
|
|
135954
135994
|
function createTSUnionType(typeAnnotations) {
|
|
135955
|
-
const
|
|
135995
|
+
const types18 = typeAnnotations.map((type) => {
|
|
135956
135996
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
135957
135997
|
});
|
|
135958
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
135998
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
135959
135999
|
if (flattened.length === 1) {
|
|
135960
136000
|
return flattened[0];
|
|
135961
136001
|
} else {
|
|
@@ -140219,14 +140259,14 @@ var require_lib62 = __commonJS3({
|
|
|
140219
140259
|
this.preserveSpace = !!preserveSpace;
|
|
140220
140260
|
}
|
|
140221
140261
|
};
|
|
140222
|
-
var
|
|
140262
|
+
var types18 = {
|
|
140223
140263
|
brace: new TokContext3("{"),
|
|
140224
140264
|
j_oTag: new TokContext3("<tag"),
|
|
140225
140265
|
j_cTag: new TokContext3("</tag"),
|
|
140226
140266
|
j_expr: new TokContext3("<tag>...</tag>", true)
|
|
140227
140267
|
};
|
|
140228
140268
|
{
|
|
140229
|
-
|
|
140269
|
+
types18.template = new TokContext3("`", true);
|
|
140230
140270
|
}
|
|
140231
140271
|
var beforeExpr2 = true;
|
|
140232
140272
|
var startsExpr2 = true;
|
|
@@ -140764,17 +140804,17 @@ var require_lib62 = __commonJS3({
|
|
|
140764
140804
|
context.pop();
|
|
140765
140805
|
};
|
|
140766
140806
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
140767
|
-
context.push(
|
|
140807
|
+
context.push(types18.brace);
|
|
140768
140808
|
};
|
|
140769
140809
|
tokenTypes[22].updateContext = (context) => {
|
|
140770
|
-
if (context[context.length - 1] ===
|
|
140810
|
+
if (context[context.length - 1] === types18.template) {
|
|
140771
140811
|
context.pop();
|
|
140772
140812
|
} else {
|
|
140773
|
-
context.push(
|
|
140813
|
+
context.push(types18.template);
|
|
140774
140814
|
}
|
|
140775
140815
|
};
|
|
140776
140816
|
tokenTypes[142].updateContext = (context) => {
|
|
140777
|
-
context.push(
|
|
140817
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
140778
140818
|
};
|
|
140779
140819
|
}
|
|
140780
140820
|
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";
|
|
@@ -141334,7 +141374,7 @@ var require_lib62 = __commonJS3({
|
|
|
141334
141374
|
this.end = 0;
|
|
141335
141375
|
this.lastTokEndLoc = null;
|
|
141336
141376
|
this.lastTokStartLoc = null;
|
|
141337
|
-
this.context = [
|
|
141377
|
+
this.context = [types18.brace];
|
|
141338
141378
|
this.firstInvalidTemplateEscapePos = null;
|
|
141339
141379
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
141340
141380
|
this.tokensLength = 0;
|
|
@@ -145161,7 +145201,7 @@ var require_lib62 = __commonJS3({
|
|
|
145161
145201
|
context
|
|
145162
145202
|
} = this.state;
|
|
145163
145203
|
const currentContext = context[context.length - 1];
|
|
145164
|
-
if (currentContext ===
|
|
145204
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
145165
145205
|
context.pop();
|
|
145166
145206
|
}
|
|
145167
145207
|
}
|
|
@@ -146183,9 +146223,9 @@ var require_lib62 = __commonJS3({
|
|
|
146183
146223
|
switch (this.state.type) {
|
|
146184
146224
|
case 5:
|
|
146185
146225
|
node = this.startNode();
|
|
146186
|
-
this.setContext(
|
|
146226
|
+
this.setContext(types18.brace);
|
|
146187
146227
|
this.next();
|
|
146188
|
-
node = this.jsxParseExpressionContainer(node,
|
|
146228
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
146189
146229
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
146190
146230
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
146191
146231
|
}
|
|
@@ -146204,7 +146244,7 @@ var require_lib62 = __commonJS3({
|
|
|
146204
146244
|
jsxParseSpreadChild(node) {
|
|
146205
146245
|
this.next();
|
|
146206
146246
|
node.expression = this.parseExpression();
|
|
146207
|
-
this.setContext(
|
|
146247
|
+
this.setContext(types18.j_expr);
|
|
146208
146248
|
this.state.canStartJSXElement = true;
|
|
146209
146249
|
this.expect(8);
|
|
146210
146250
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -146224,11 +146264,11 @@ var require_lib62 = __commonJS3({
|
|
|
146224
146264
|
jsxParseAttribute() {
|
|
146225
146265
|
const node = this.startNode();
|
|
146226
146266
|
if (this.match(5)) {
|
|
146227
|
-
this.setContext(
|
|
146267
|
+
this.setContext(types18.brace);
|
|
146228
146268
|
this.next();
|
|
146229
146269
|
this.expect(21);
|
|
146230
146270
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
146231
|
-
this.setContext(
|
|
146271
|
+
this.setContext(types18.j_oTag);
|
|
146232
146272
|
this.state.canStartJSXElement = true;
|
|
146233
146273
|
this.expect(8);
|
|
146234
146274
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -146287,12 +146327,12 @@ var require_lib62 = __commonJS3({
|
|
|
146287
146327
|
break;
|
|
146288
146328
|
case 5: {
|
|
146289
146329
|
const node2 = this.startNode();
|
|
146290
|
-
this.setContext(
|
|
146330
|
+
this.setContext(types18.brace);
|
|
146291
146331
|
this.next();
|
|
146292
146332
|
if (this.match(21)) {
|
|
146293
146333
|
children.push(this.jsxParseSpreadChild(node2));
|
|
146294
146334
|
} else {
|
|
146295
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
146335
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
146296
146336
|
}
|
|
146297
146337
|
break;
|
|
146298
146338
|
}
|
|
@@ -146357,11 +146397,11 @@ var require_lib62 = __commonJS3({
|
|
|
146357
146397
|
}
|
|
146358
146398
|
getTokenFromCode(code2) {
|
|
146359
146399
|
const context = this.curContext();
|
|
146360
|
-
if (context ===
|
|
146400
|
+
if (context === types18.j_expr) {
|
|
146361
146401
|
this.jsxReadToken();
|
|
146362
146402
|
return;
|
|
146363
146403
|
}
|
|
146364
|
-
if (context ===
|
|
146404
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
146365
146405
|
if (isIdentifierStart2(code2)) {
|
|
146366
146406
|
this.jsxReadWord();
|
|
146367
146407
|
return;
|
|
@@ -146371,7 +146411,7 @@ var require_lib62 = __commonJS3({
|
|
|
146371
146411
|
this.finishToken(143);
|
|
146372
146412
|
return;
|
|
146373
146413
|
}
|
|
146374
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
146414
|
+
if ((code2 === 34 || code2 === 39) && context === types18.j_oTag) {
|
|
146375
146415
|
this.jsxReadString(code2);
|
|
146376
146416
|
return;
|
|
146377
146417
|
}
|
|
@@ -146389,17 +146429,17 @@ var require_lib62 = __commonJS3({
|
|
|
146389
146429
|
type
|
|
146390
146430
|
} = this.state;
|
|
146391
146431
|
if (type === 56 && prevType === 142) {
|
|
146392
|
-
context.splice(-2, 2,
|
|
146432
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
146393
146433
|
this.state.canStartJSXElement = false;
|
|
146394
146434
|
} else if (type === 142) {
|
|
146395
|
-
context.push(
|
|
146435
|
+
context.push(types18.j_oTag);
|
|
146396
146436
|
} else if (type === 143) {
|
|
146397
146437
|
const out = context[context.length - 1];
|
|
146398
|
-
if (out ===
|
|
146438
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
146399
146439
|
context.pop();
|
|
146400
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
146440
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
146401
146441
|
} else {
|
|
146402
|
-
this.setContext(
|
|
146442
|
+
this.setContext(types18.j_expr);
|
|
146403
146443
|
this.state.canStartJSXElement = true;
|
|
146404
146444
|
}
|
|
146405
146445
|
} else {
|
|
@@ -147774,14 +147814,14 @@ var require_lib62 = __commonJS3({
|
|
|
147774
147814
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
147775
147815
|
const node = this.startNode();
|
|
147776
147816
|
const hasLeadingOperator = this.eat(operator);
|
|
147777
|
-
const
|
|
147817
|
+
const types19 = [];
|
|
147778
147818
|
do {
|
|
147779
|
-
|
|
147819
|
+
types19.push(parseConstituentType());
|
|
147780
147820
|
} while (this.eat(operator));
|
|
147781
|
-
if (
|
|
147782
|
-
return
|
|
147821
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
147822
|
+
return types19[0];
|
|
147783
147823
|
}
|
|
147784
|
-
node.types =
|
|
147824
|
+
node.types = types19;
|
|
147785
147825
|
return this.finishNode(node, kind);
|
|
147786
147826
|
}
|
|
147787
147827
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -148345,7 +148385,7 @@ var require_lib62 = __commonJS3({
|
|
|
148345
148385
|
}));
|
|
148346
148386
|
if (node.params.length === 0) {
|
|
148347
148387
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
148348
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
148388
|
+
} else if (!this.state.inType && this.curContext() === types18.brace) {
|
|
148349
148389
|
this.reScan_lt_gt();
|
|
148350
148390
|
}
|
|
148351
148391
|
this.expect(48);
|
|
@@ -148971,7 +149011,7 @@ var require_lib62 = __commonJS3({
|
|
|
148971
149011
|
context
|
|
148972
149012
|
} = this.state;
|
|
148973
149013
|
const currentContext = context[context.length - 1];
|
|
148974
|
-
if (currentContext ===
|
|
149014
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
148975
149015
|
context.pop();
|
|
148976
149016
|
}
|
|
148977
149017
|
}
|
|
@@ -154099,9 +154139,9 @@ var require_shared3 = __commonJS3({
|
|
|
154099
154139
|
var tslib_1 = require_tslib3();
|
|
154100
154140
|
var types_1 = tslib_1.__importDefault(require_types3());
|
|
154101
154141
|
function default_1(fork) {
|
|
154102
|
-
var
|
|
154103
|
-
var Type =
|
|
154104
|
-
var builtin =
|
|
154142
|
+
var types18 = fork.use(types_1.default);
|
|
154143
|
+
var Type = types18.Type;
|
|
154144
|
+
var builtin = types18.builtInTypes;
|
|
154105
154145
|
var isNumber = builtin.number;
|
|
154106
154146
|
function geq(than) {
|
|
154107
154147
|
return Type.from(function(value) {
|
|
@@ -154249,9 +154289,9 @@ var require_types3 = __commonJS3({
|
|
|
154249
154289
|
}(BaseType);
|
|
154250
154290
|
var OrType = function(_super) {
|
|
154251
154291
|
tslib_1.__extends(OrType2, _super);
|
|
154252
|
-
function OrType2(
|
|
154292
|
+
function OrType2(types18) {
|
|
154253
154293
|
var _this = _super.call(this) || this;
|
|
154254
|
-
_this.types =
|
|
154294
|
+
_this.types = types18;
|
|
154255
154295
|
_this.kind = "OrType";
|
|
154256
154296
|
return _this;
|
|
154257
154297
|
}
|
|
@@ -154392,11 +154432,11 @@ var require_types3 = __commonJS3({
|
|
|
154392
154432
|
function typesPlugin(_fork) {
|
|
154393
154433
|
var Type = {
|
|
154394
154434
|
or: function() {
|
|
154395
|
-
var
|
|
154435
|
+
var types18 = [];
|
|
154396
154436
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
154397
|
-
|
|
154437
|
+
types18[_i] = arguments[_i];
|
|
154398
154438
|
}
|
|
154399
|
-
return new OrType(
|
|
154439
|
+
return new OrType(types18.map(function(type) {
|
|
154400
154440
|
return Type.from(type);
|
|
154401
154441
|
}));
|
|
154402
154442
|
},
|
|
@@ -154839,9 +154879,9 @@ var require_path22 = __commonJS3({
|
|
|
154839
154879
|
var Op = Object.prototype;
|
|
154840
154880
|
var hasOwn2 = Op.hasOwnProperty;
|
|
154841
154881
|
function pathPlugin(fork) {
|
|
154842
|
-
var
|
|
154843
|
-
var isArray2 =
|
|
154844
|
-
var isNumber =
|
|
154882
|
+
var types18 = fork.use(types_1.default);
|
|
154883
|
+
var isArray2 = types18.builtInTypes.array;
|
|
154884
|
+
var isNumber = types18.builtInTypes.number;
|
|
154845
154885
|
var Path = function Path2(value, parentPath, name) {
|
|
154846
154886
|
if (!(this instanceof Path2)) {
|
|
154847
154887
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -155141,13 +155181,13 @@ var require_scope3 = __commonJS3({
|
|
|
155141
155181
|
var types_1 = tslib_1.__importDefault(require_types3());
|
|
155142
155182
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
155143
155183
|
function scopePlugin(fork) {
|
|
155144
|
-
var
|
|
155145
|
-
var Type =
|
|
155146
|
-
var namedTypes =
|
|
155184
|
+
var types18 = fork.use(types_1.default);
|
|
155185
|
+
var Type = types18.Type;
|
|
155186
|
+
var namedTypes = types18.namedTypes;
|
|
155147
155187
|
var Node3 = namedTypes.Node;
|
|
155148
155188
|
var Expression = namedTypes.Expression;
|
|
155149
|
-
var isArray2 =
|
|
155150
|
-
var b2 =
|
|
155189
|
+
var isArray2 = types18.builtInTypes.array;
|
|
155190
|
+
var b2 = types18.builders;
|
|
155151
155191
|
var Scope4 = function Scope22(path32, parentScope) {
|
|
155152
155192
|
if (!(this instanceof Scope22)) {
|
|
155153
155193
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -155210,7 +155250,7 @@ var require_scope3 = __commonJS3({
|
|
|
155210
155250
|
++index;
|
|
155211
155251
|
}
|
|
155212
155252
|
var name = prefix + index;
|
|
155213
|
-
return this.bindings[name] =
|
|
155253
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
155214
155254
|
};
|
|
155215
155255
|
Sp.injectTemporary = function(identifier, init2) {
|
|
155216
155256
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -155286,7 +155326,7 @@ var require_scope3 = __commonJS3({
|
|
|
155286
155326
|
bindings
|
|
155287
155327
|
);
|
|
155288
155328
|
} else if (Node3.check(node) && !Expression.check(node)) {
|
|
155289
|
-
|
|
155329
|
+
types18.eachField(node, function(name, child) {
|
|
155290
155330
|
var childPath = path32.get(name);
|
|
155291
155331
|
if (!pathHasValue(childPath, child)) {
|
|
155292
155332
|
throw new Error("");
|
|
@@ -155364,24 +155404,24 @@ var require_scope3 = __commonJS3({
|
|
|
155364
155404
|
addPattern(patternPath.get("argument"), bindings);
|
|
155365
155405
|
}
|
|
155366
155406
|
}
|
|
155367
|
-
function addTypePattern(patternPath,
|
|
155407
|
+
function addTypePattern(patternPath, types19) {
|
|
155368
155408
|
var pattern = patternPath.value;
|
|
155369
155409
|
namedTypes.Pattern.assert(pattern);
|
|
155370
155410
|
if (namedTypes.Identifier.check(pattern)) {
|
|
155371
|
-
if (hasOwn2.call(
|
|
155372
|
-
|
|
155411
|
+
if (hasOwn2.call(types19, pattern.name)) {
|
|
155412
|
+
types19[pattern.name].push(patternPath);
|
|
155373
155413
|
} else {
|
|
155374
|
-
|
|
155414
|
+
types19[pattern.name] = [patternPath];
|
|
155375
155415
|
}
|
|
155376
155416
|
}
|
|
155377
155417
|
}
|
|
155378
|
-
function addTypeParameter(parameterPath,
|
|
155418
|
+
function addTypeParameter(parameterPath, types19) {
|
|
155379
155419
|
var parameter = parameterPath.value;
|
|
155380
155420
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
155381
|
-
if (hasOwn2.call(
|
|
155382
|
-
|
|
155421
|
+
if (hasOwn2.call(types19, parameter.name)) {
|
|
155422
|
+
types19[parameter.name].push(parameterPath);
|
|
155383
155423
|
} else {
|
|
155384
|
-
|
|
155424
|
+
types19[parameter.name] = [parameterPath];
|
|
155385
155425
|
}
|
|
155386
155426
|
}
|
|
155387
155427
|
Sp.lookup = function(name) {
|
|
@@ -155420,11 +155460,11 @@ var require_node_path3 = __commonJS3({
|
|
|
155420
155460
|
var scope_1 = tslib_1.__importDefault(require_scope3());
|
|
155421
155461
|
var shared_1 = require_shared3();
|
|
155422
155462
|
function nodePathPlugin(fork) {
|
|
155423
|
-
var
|
|
155424
|
-
var n2 =
|
|
155425
|
-
var b2 =
|
|
155426
|
-
var isNumber =
|
|
155427
|
-
var isArray2 =
|
|
155463
|
+
var types18 = fork.use(types_1.default);
|
|
155464
|
+
var n2 = types18.namedTypes;
|
|
155465
|
+
var b2 = types18.builders;
|
|
155466
|
+
var isNumber = types18.builtInTypes.number;
|
|
155467
|
+
var isArray2 = types18.builtInTypes.array;
|
|
155428
155468
|
var Path = fork.use(path_1.default);
|
|
155429
155469
|
var Scope4 = fork.use(scope_1.default);
|
|
155430
155470
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -155515,7 +155555,7 @@ var require_node_path3 = __commonJS3({
|
|
|
155515
155555
|
return scope || null;
|
|
155516
155556
|
};
|
|
155517
155557
|
NPp.getValueProperty = function(name) {
|
|
155518
|
-
return
|
|
155558
|
+
return types18.getFieldValue(this.value, name);
|
|
155519
155559
|
};
|
|
155520
155560
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
155521
155561
|
var pp2 = this.parentPath;
|
|
@@ -155657,7 +155697,7 @@ var require_node_path3 = __commonJS3({
|
|
|
155657
155697
|
return node.some(containsCallExpression);
|
|
155658
155698
|
}
|
|
155659
155699
|
if (n2.Node.check(node)) {
|
|
155660
|
-
return
|
|
155700
|
+
return types18.someField(node, function(_name, child) {
|
|
155661
155701
|
return containsCallExpression(child);
|
|
155662
155702
|
});
|
|
155663
155703
|
}
|
|
@@ -155776,11 +155816,11 @@ var require_path_visitor3 = __commonJS3({
|
|
|
155776
155816
|
var shared_1 = require_shared3();
|
|
155777
155817
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
155778
155818
|
function pathVisitorPlugin(fork) {
|
|
155779
|
-
var
|
|
155819
|
+
var types18 = fork.use(types_1.default);
|
|
155780
155820
|
var NodePath = fork.use(node_path_1.default);
|
|
155781
|
-
var isArray2 =
|
|
155782
|
-
var isObject2 =
|
|
155783
|
-
var isFunction =
|
|
155821
|
+
var isArray2 = types18.builtInTypes.array;
|
|
155822
|
+
var isObject2 = types18.builtInTypes.object;
|
|
155823
|
+
var isFunction = types18.builtInTypes.function;
|
|
155784
155824
|
var undefined2;
|
|
155785
155825
|
var PathVisitor = function PathVisitor2() {
|
|
155786
155826
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -155800,7 +155840,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
155800
155840
|
typeNames[methodName.slice("visit".length)] = true;
|
|
155801
155841
|
}
|
|
155802
155842
|
}
|
|
155803
|
-
var supertypeTable =
|
|
155843
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
155804
155844
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
155805
155845
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
155806
155846
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -155919,7 +155959,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
155919
155959
|
path32.each(visitor.visitWithoutReset, visitor);
|
|
155920
155960
|
} else if (!isObject2.check(value)) {
|
|
155921
155961
|
} else {
|
|
155922
|
-
var childNames =
|
|
155962
|
+
var childNames = types18.getFieldNames(value);
|
|
155923
155963
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
155924
155964
|
childNames.push("comments");
|
|
155925
155965
|
}
|
|
@@ -155928,7 +155968,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
155928
155968
|
for (var i22 = 0; i22 < childCount; ++i22) {
|
|
155929
155969
|
var childName = childNames[i22];
|
|
155930
155970
|
if (!hasOwn2.call(value, childName)) {
|
|
155931
|
-
value[childName] =
|
|
155971
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
155932
155972
|
}
|
|
155933
155973
|
childPaths.push(path32.get(childName));
|
|
155934
155974
|
}
|
|
@@ -156069,13 +156109,13 @@ var require_equiv3 = __commonJS3({
|
|
|
156069
156109
|
var shared_1 = require_shared3();
|
|
156070
156110
|
var types_1 = tslib_1.__importDefault(require_types3());
|
|
156071
156111
|
function default_1(fork) {
|
|
156072
|
-
var
|
|
156073
|
-
var getFieldNames =
|
|
156074
|
-
var getFieldValue =
|
|
156075
|
-
var isArray2 =
|
|
156076
|
-
var isObject2 =
|
|
156077
|
-
var isDate =
|
|
156078
|
-
var isRegExp =
|
|
156112
|
+
var types18 = fork.use(types_1.default);
|
|
156113
|
+
var getFieldNames = types18.getFieldNames;
|
|
156114
|
+
var getFieldValue = types18.getFieldValue;
|
|
156115
|
+
var isArray2 = types18.builtInTypes.array;
|
|
156116
|
+
var isObject2 = types18.builtInTypes.object;
|
|
156117
|
+
var isDate = types18.builtInTypes.Date;
|
|
156118
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
156079
156119
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
156080
156120
|
function astNodesAreEquivalent(a2, b2, problemPath) {
|
|
156081
156121
|
if (isArray2.check(problemPath)) {
|
|
@@ -156226,24 +156266,24 @@ var require_fork3 = __commonJS3({
|
|
|
156226
156266
|
var shared_1 = require_shared3();
|
|
156227
156267
|
function default_1(plugins) {
|
|
156228
156268
|
var fork = createFork();
|
|
156229
|
-
var
|
|
156269
|
+
var types18 = fork.use(types_1.default);
|
|
156230
156270
|
plugins.forEach(fork.use);
|
|
156231
|
-
|
|
156271
|
+
types18.finalize();
|
|
156232
156272
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
156233
156273
|
return {
|
|
156234
|
-
Type:
|
|
156235
|
-
builtInTypes:
|
|
156236
|
-
namedTypes:
|
|
156237
|
-
builders:
|
|
156238
|
-
defineMethod:
|
|
156239
|
-
getFieldNames:
|
|
156240
|
-
getFieldValue:
|
|
156241
|
-
eachField:
|
|
156242
|
-
someField:
|
|
156243
|
-
getSupertypeNames:
|
|
156244
|
-
getBuilderName:
|
|
156274
|
+
Type: types18.Type,
|
|
156275
|
+
builtInTypes: types18.builtInTypes,
|
|
156276
|
+
namedTypes: types18.namedTypes,
|
|
156277
|
+
builders: types18.builders,
|
|
156278
|
+
defineMethod: types18.defineMethod,
|
|
156279
|
+
getFieldNames: types18.getFieldNames,
|
|
156280
|
+
getFieldValue: types18.getFieldValue,
|
|
156281
|
+
eachField: types18.eachField,
|
|
156282
|
+
someField: types18.someField,
|
|
156283
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
156284
|
+
getBuilderName: types18.getBuilderName,
|
|
156245
156285
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
156246
|
-
finalize:
|
|
156286
|
+
finalize: types18.finalize,
|
|
156247
156287
|
Path: fork.use(path_1.default),
|
|
156248
156288
|
NodePath: fork.use(node_path_1.default),
|
|
156249
156289
|
PathVisitor,
|
|
@@ -156403,8 +156443,8 @@ var require_core32 = __commonJS3({
|
|
|
156403
156443
|
var types_1 = tslib_1.__importDefault(require_types3());
|
|
156404
156444
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156405
156445
|
function default_1(fork) {
|
|
156406
|
-
var
|
|
156407
|
-
var Type =
|
|
156446
|
+
var types18 = fork.use(types_1.default);
|
|
156447
|
+
var Type = types18.Type;
|
|
156408
156448
|
var def = Type.def;
|
|
156409
156449
|
var or = Type.or;
|
|
156410
156450
|
var shared2 = fork.use(shared_1.default);
|
|
@@ -156494,9 +156534,9 @@ var require_es63 = __commonJS3({
|
|
|
156494
156534
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156495
156535
|
function default_1(fork) {
|
|
156496
156536
|
fork.use(core_1.default);
|
|
156497
|
-
var
|
|
156498
|
-
var def =
|
|
156499
|
-
var or =
|
|
156537
|
+
var types18 = fork.use(types_1.default);
|
|
156538
|
+
var def = types18.Type.def;
|
|
156539
|
+
var or = types18.Type.or;
|
|
156500
156540
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156501
156541
|
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"]);
|
|
156502
156542
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -156582,8 +156622,8 @@ var require_es20173 = __commonJS3({
|
|
|
156582
156622
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156583
156623
|
function default_1(fork) {
|
|
156584
156624
|
fork.use(es2016_1.default);
|
|
156585
|
-
var
|
|
156586
|
-
var def =
|
|
156625
|
+
var types18 = fork.use(types_1.default);
|
|
156626
|
+
var def = types18.Type.def;
|
|
156587
156627
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156588
156628
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
156589
156629
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -156604,9 +156644,9 @@ var require_es20183 = __commonJS3({
|
|
|
156604
156644
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156605
156645
|
function default_1(fork) {
|
|
156606
156646
|
fork.use(es2017_1.default);
|
|
156607
|
-
var
|
|
156608
|
-
var def =
|
|
156609
|
-
var or =
|
|
156647
|
+
var types18 = fork.use(types_1.default);
|
|
156648
|
+
var def = types18.Type.def;
|
|
156649
|
+
var or = types18.Type.or;
|
|
156610
156650
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156611
156651
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
156612
156652
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -156635,9 +156675,9 @@ var require_es20193 = __commonJS3({
|
|
|
156635
156675
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156636
156676
|
function default_1(fork) {
|
|
156637
156677
|
fork.use(es2018_1.default);
|
|
156638
|
-
var
|
|
156639
|
-
var def =
|
|
156640
|
-
var or =
|
|
156678
|
+
var types18 = fork.use(types_1.default);
|
|
156679
|
+
var def = types18.Type.def;
|
|
156680
|
+
var or = types18.Type.or;
|
|
156641
156681
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156642
156682
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
156643
156683
|
}
|
|
@@ -156659,9 +156699,9 @@ var require_es202022 = __commonJS3({
|
|
|
156659
156699
|
function default_1(fork) {
|
|
156660
156700
|
fork.use(es2020_1.default);
|
|
156661
156701
|
fork.use(es2019_1.default);
|
|
156662
|
-
var
|
|
156663
|
-
var def =
|
|
156664
|
-
var or =
|
|
156702
|
+
var types18 = fork.use(types_1.default);
|
|
156703
|
+
var def = types18.Type.def;
|
|
156704
|
+
var or = types18.Type.or;
|
|
156665
156705
|
var shared2 = fork.use(shared_1.default);
|
|
156666
156706
|
var defaults = shared2.defaults;
|
|
156667
156707
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -156707,8 +156747,8 @@ var require_es20223 = __commonJS3({
|
|
|
156707
156747
|
var shared_1 = require_shared3();
|
|
156708
156748
|
function default_1(fork) {
|
|
156709
156749
|
fork.use(es2021_1.default);
|
|
156710
|
-
var
|
|
156711
|
-
var def =
|
|
156750
|
+
var types18 = fork.use(types_1.default);
|
|
156751
|
+
var def = types18.Type.def;
|
|
156712
156752
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
156713
156753
|
}
|
|
156714
156754
|
exports.default = default_1;
|
|
@@ -156727,9 +156767,9 @@ var require_es_proposals3 = __commonJS3({
|
|
|
156727
156767
|
var es2022_1 = tslib_1.__importDefault(require_es20223());
|
|
156728
156768
|
function default_1(fork) {
|
|
156729
156769
|
fork.use(es2022_1.default);
|
|
156730
|
-
var
|
|
156731
|
-
var Type =
|
|
156732
|
-
var def =
|
|
156770
|
+
var types18 = fork.use(types_1.default);
|
|
156771
|
+
var Type = types18.Type;
|
|
156772
|
+
var def = types18.Type.def;
|
|
156733
156773
|
var or = Type.or;
|
|
156734
156774
|
var shared2 = fork.use(shared_1.default);
|
|
156735
156775
|
var defaults = shared2.defaults;
|
|
@@ -156767,9 +156807,9 @@ var require_jsx22 = __commonJS3({
|
|
|
156767
156807
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156768
156808
|
function default_1(fork) {
|
|
156769
156809
|
fork.use(es_proposals_1.default);
|
|
156770
|
-
var
|
|
156771
|
-
var def =
|
|
156772
|
-
var or =
|
|
156810
|
+
var types18 = fork.use(types_1.default);
|
|
156811
|
+
var def = types18.Type.def;
|
|
156812
|
+
var or = types18.Type.or;
|
|
156773
156813
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156774
156814
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
156775
156815
|
def("Literal"),
|
|
@@ -156825,9 +156865,9 @@ var require_type_annotations3 = __commonJS3({
|
|
|
156825
156865
|
var types_1 = tslib_1.__importDefault(require_types3());
|
|
156826
156866
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156827
156867
|
function default_1(fork) {
|
|
156828
|
-
var
|
|
156829
|
-
var def =
|
|
156830
|
-
var or =
|
|
156868
|
+
var types18 = fork.use(types_1.default);
|
|
156869
|
+
var def = types18.Type.def;
|
|
156870
|
+
var or = types18.Type.or;
|
|
156831
156871
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156832
156872
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
156833
156873
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -156860,9 +156900,9 @@ var require_flow22 = __commonJS3({
|
|
|
156860
156900
|
function default_1(fork) {
|
|
156861
156901
|
fork.use(es_proposals_1.default);
|
|
156862
156902
|
fork.use(type_annotations_1.default);
|
|
156863
|
-
var
|
|
156864
|
-
var def =
|
|
156865
|
-
var or =
|
|
156903
|
+
var types18 = fork.use(types_1.default);
|
|
156904
|
+
var def = types18.Type.def;
|
|
156905
|
+
var or = types18.Type.or;
|
|
156866
156906
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156867
156907
|
def("Flow").bases("Node");
|
|
156868
156908
|
def("FlowType").bases("Flow");
|
|
@@ -156974,10 +157014,10 @@ var require_esprima7 = __commonJS3({
|
|
|
156974
157014
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
156975
157015
|
function default_1(fork) {
|
|
156976
157016
|
fork.use(es_proposals_1.default);
|
|
156977
|
-
var
|
|
157017
|
+
var types18 = fork.use(types_1.default);
|
|
156978
157018
|
var defaults = fork.use(shared_1.default).defaults;
|
|
156979
|
-
var def =
|
|
156980
|
-
var or =
|
|
157019
|
+
var def = types18.Type.def;
|
|
157020
|
+
var or = types18.Type.or;
|
|
156981
157021
|
def("VariableDeclaration").field("declarations", [or(
|
|
156982
157022
|
def("VariableDeclarator"),
|
|
156983
157023
|
def("Identifier")
|
|
@@ -157020,11 +157060,11 @@ var require_babel_core3 = __commonJS3({
|
|
|
157020
157060
|
function default_1(fork) {
|
|
157021
157061
|
var _a, _b, _c, _d, _e;
|
|
157022
157062
|
fork.use(es_proposals_1.default);
|
|
157023
|
-
var
|
|
157063
|
+
var types18 = fork.use(types_1.default);
|
|
157024
157064
|
var defaults = fork.use(shared_1.default).defaults;
|
|
157025
|
-
var def =
|
|
157026
|
-
var or =
|
|
157027
|
-
var isUndefined =
|
|
157065
|
+
var def = types18.Type.def;
|
|
157066
|
+
var or = types18.Type.or;
|
|
157067
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
157028
157068
|
def("Noop").bases("Statement").build();
|
|
157029
157069
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
157030
157070
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -157049,7 +157089,7 @@ var require_babel_core3 = __commonJS3({
|
|
|
157049
157089
|
raw: String
|
|
157050
157090
|
},
|
|
157051
157091
|
function getDefault() {
|
|
157052
|
-
var value =
|
|
157092
|
+
var value = types18.getFieldValue(this, "value");
|
|
157053
157093
|
return {
|
|
157054
157094
|
rawValue: value,
|
|
157055
157095
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -157150,8 +157190,8 @@ var require_babel3 = __commonJS3({
|
|
|
157150
157190
|
var flow_1 = tslib_1.__importDefault(require_flow22());
|
|
157151
157191
|
var shared_1 = require_shared3();
|
|
157152
157192
|
function default_1(fork) {
|
|
157153
|
-
var
|
|
157154
|
-
var def =
|
|
157193
|
+
var types18 = fork.use(types_1.default);
|
|
157194
|
+
var def = types18.Type.def;
|
|
157155
157195
|
fork.use(babel_core_1.default);
|
|
157156
157196
|
fork.use(flow_1.default);
|
|
157157
157197
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -157175,12 +157215,12 @@ var require_typescript22 = __commonJS3({
|
|
|
157175
157215
|
function default_1(fork) {
|
|
157176
157216
|
fork.use(babel_core_1.default);
|
|
157177
157217
|
fork.use(type_annotations_1.default);
|
|
157178
|
-
var
|
|
157179
|
-
var n2 =
|
|
157180
|
-
var def =
|
|
157181
|
-
var or =
|
|
157218
|
+
var types18 = fork.use(types_1.default);
|
|
157219
|
+
var n2 = types18.namedTypes;
|
|
157220
|
+
var def = types18.Type.def;
|
|
157221
|
+
var or = types18.Type.or;
|
|
157182
157222
|
var defaults = fork.use(shared_1.default).defaults;
|
|
157183
|
-
var StringLiteral =
|
|
157223
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
157184
157224
|
if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
|
|
157185
157225
|
return true;
|
|
157186
157226
|
}
|
|
@@ -159128,8 +159168,8 @@ var require_util22 = __commonJS3({
|
|
|
159128
159168
|
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;
|
|
159129
159169
|
var tslib_1 = require_tslib3();
|
|
159130
159170
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
159131
|
-
var
|
|
159132
|
-
var n2 =
|
|
159171
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
159172
|
+
var n2 = types18.namedTypes;
|
|
159133
159173
|
var source_map_1 = tslib_1.__importDefault(require_source_map3());
|
|
159134
159174
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
159135
159175
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -166435,10 +166475,10 @@ var require_comments3 = __commonJS3({
|
|
|
166435
166475
|
exports.printComments = exports.attach = void 0;
|
|
166436
166476
|
var tslib_1 = require_tslib3();
|
|
166437
166477
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
166438
|
-
var
|
|
166439
|
-
var n2 =
|
|
166440
|
-
var isArray2 =
|
|
166441
|
-
var isObject2 =
|
|
166478
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
166479
|
+
var n2 = types18.namedTypes;
|
|
166480
|
+
var isArray2 = types18.builtInTypes.array;
|
|
166481
|
+
var isObject2 = types18.builtInTypes.object;
|
|
166442
166482
|
var lines_1 = require_lines3();
|
|
166443
166483
|
var util_1 = require_util22();
|
|
166444
166484
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -166469,7 +166509,7 @@ var require_comments3 = __commonJS3({
|
|
|
166469
166509
|
if (isArray2.check(node)) {
|
|
166470
166510
|
names = Object.keys(node);
|
|
166471
166511
|
} else if (isObject2.check(node)) {
|
|
166472
|
-
names =
|
|
166512
|
+
names = types18.getFieldNames(node);
|
|
166473
166513
|
} else {
|
|
166474
166514
|
return resultArray;
|
|
166475
166515
|
}
|
|
@@ -166647,7 +166687,7 @@ var require_comments3 = __commonJS3({
|
|
|
166647
166687
|
function printComments(path32, print132) {
|
|
166648
166688
|
var value = path32.getValue();
|
|
166649
166689
|
var innerLines = print132(path32);
|
|
166650
|
-
var comments = n2.Node.check(value) &&
|
|
166690
|
+
var comments = n2.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
166651
166691
|
if (!comments || comments.length === 0) {
|
|
166652
166692
|
return innerLines;
|
|
166653
166693
|
}
|
|
@@ -166655,8 +166695,8 @@ var require_comments3 = __commonJS3({
|
|
|
166655
166695
|
var trailingParts = [innerLines];
|
|
166656
166696
|
path32.each(function(commentPath) {
|
|
166657
166697
|
var comment = commentPath.getValue();
|
|
166658
|
-
var leading =
|
|
166659
|
-
var trailing =
|
|
166698
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
166699
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
166660
166700
|
if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
166661
166701
|
leadingParts.push(printLeadingComment(commentPath, print132));
|
|
166662
166702
|
} else if (trailing) {
|
|
@@ -166676,10 +166716,10 @@ var require_parser3 = __commonJS3({
|
|
|
166676
166716
|
exports.parse = void 0;
|
|
166677
166717
|
var tslib_1 = require_tslib3();
|
|
166678
166718
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
166679
|
-
var
|
|
166680
|
-
var b2 =
|
|
166681
|
-
var isObject2 =
|
|
166682
|
-
var isArray2 =
|
|
166719
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
166720
|
+
var b2 = types18.builders;
|
|
166721
|
+
var isObject2 = types18.builtInTypes.object;
|
|
166722
|
+
var isArray2 = types18.builtInTypes.array;
|
|
166683
166723
|
var options_1 = require_options3();
|
|
166684
166724
|
var lines_1 = require_lines3();
|
|
166685
166725
|
var comments_1 = require_comments3();
|
|
@@ -166863,11 +166903,11 @@ var require_fast_path3 = __commonJS3({
|
|
|
166863
166903
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
166864
166904
|
var tslib_1 = require_tslib3();
|
|
166865
166905
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
166866
|
-
var
|
|
166906
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
166867
166907
|
var util = tslib_1.__importStar(require_util22());
|
|
166868
|
-
var n2 =
|
|
166869
|
-
var isArray2 =
|
|
166870
|
-
var isNumber =
|
|
166908
|
+
var n2 = types18.namedTypes;
|
|
166909
|
+
var isArray2 = types18.builtInTypes.array;
|
|
166910
|
+
var isNumber = types18.builtInTypes.number;
|
|
166871
166911
|
var PRECEDENCE = {};
|
|
166872
166912
|
[
|
|
166873
166913
|
["??"],
|
|
@@ -166896,7 +166936,7 @@ var require_fast_path3 = __commonJS3({
|
|
|
166896
166936
|
if (obj instanceof FastPath) {
|
|
166897
166937
|
return obj.copy();
|
|
166898
166938
|
}
|
|
166899
|
-
if (obj instanceof
|
|
166939
|
+
if (obj instanceof types18.NodePath) {
|
|
166900
166940
|
var copy = Object.create(FastPath.prototype);
|
|
166901
166941
|
var stack = [obj.value];
|
|
166902
166942
|
for (var pp2 = void 0; pp2 = obj.parentPath; obj = pp2)
|
|
@@ -167207,7 +167247,7 @@ var require_fast_path3 = __commonJS3({
|
|
|
167207
167247
|
return node.some(containsCallExpression);
|
|
167208
167248
|
}
|
|
167209
167249
|
if (n2.Node.check(node)) {
|
|
167210
|
-
return
|
|
167250
|
+
return types18.someField(node, function(_name, child) {
|
|
167211
167251
|
return containsCallExpression(child);
|
|
167212
167252
|
});
|
|
167213
167253
|
}
|
|
@@ -167295,16 +167335,16 @@ var require_patcher3 = __commonJS3({
|
|
|
167295
167335
|
var tslib_1 = require_tslib3();
|
|
167296
167336
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
167297
167337
|
var linesModule = tslib_1.__importStar(require_lines3());
|
|
167298
|
-
var
|
|
167299
|
-
var Printable =
|
|
167300
|
-
var Expression =
|
|
167301
|
-
var ReturnStatement =
|
|
167302
|
-
var SourceLocation3 =
|
|
167338
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
167339
|
+
var Printable = types18.namedTypes.Printable;
|
|
167340
|
+
var Expression = types18.namedTypes.Expression;
|
|
167341
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
167342
|
+
var SourceLocation3 = types18.namedTypes.SourceLocation;
|
|
167303
167343
|
var util_1 = require_util22();
|
|
167304
167344
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path3());
|
|
167305
|
-
var isObject2 =
|
|
167306
|
-
var isArray2 =
|
|
167307
|
-
var isString =
|
|
167345
|
+
var isObject2 = types18.builtInTypes.object;
|
|
167346
|
+
var isArray2 = types18.builtInTypes.array;
|
|
167347
|
+
var isString = types18.builtInTypes.string;
|
|
167308
167348
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
167309
167349
|
var Patcher = function Patcher2(lines) {
|
|
167310
167350
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -167574,8 +167614,8 @@ var require_patcher3 = __commonJS3({
|
|
|
167574
167614
|
if (k2.charAt(0) === "_") {
|
|
167575
167615
|
continue;
|
|
167576
167616
|
}
|
|
167577
|
-
newPath.stack.push(k2,
|
|
167578
|
-
oldPath.stack.push(k2,
|
|
167617
|
+
newPath.stack.push(k2, types18.getFieldValue(newNode, k2));
|
|
167618
|
+
oldPath.stack.push(k2, types18.getFieldValue(oldNode, k2));
|
|
167579
167619
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
167580
167620
|
newPath.stack.length -= 2;
|
|
167581
167621
|
oldPath.stack.length -= 2;
|
|
@@ -167597,16 +167637,16 @@ var require_printer3 = __commonJS3({
|
|
|
167597
167637
|
exports.Printer = void 0;
|
|
167598
167638
|
var tslib_1 = require_tslib3();
|
|
167599
167639
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
167600
|
-
var
|
|
167640
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
167601
167641
|
var comments_1 = require_comments3();
|
|
167602
167642
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path3());
|
|
167603
167643
|
var lines_1 = require_lines3();
|
|
167604
167644
|
var options_1 = require_options3();
|
|
167605
167645
|
var patcher_1 = require_patcher3();
|
|
167606
167646
|
var util = tslib_1.__importStar(require_util22());
|
|
167607
|
-
var namedTypes =
|
|
167608
|
-
var isString =
|
|
167609
|
-
var isObject2 =
|
|
167647
|
+
var namedTypes = types18.namedTypes;
|
|
167648
|
+
var isString = types18.builtInTypes.string;
|
|
167649
|
+
var isObject2 = types18.builtInTypes.object;
|
|
167610
167650
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
167611
167651
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
167612
167652
|
isString.assert(code);
|
|
@@ -167768,7 +167808,7 @@ var require_printer3 = __commonJS3({
|
|
|
167768
167808
|
case "OptionalMemberExpression": {
|
|
167769
167809
|
parts.push(path32.call(print132, "object"));
|
|
167770
167810
|
var property = path32.call(print132, "property");
|
|
167771
|
-
var optional =
|
|
167811
|
+
var optional = types18.getFieldValue(n2, "optional");
|
|
167772
167812
|
if (n2.computed) {
|
|
167773
167813
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
167774
167814
|
} else {
|
|
@@ -168039,7 +168079,7 @@ var require_printer3 = __commonJS3({
|
|
|
168039
168079
|
if (n2.typeArguments) {
|
|
168040
168080
|
parts.push(path32.call(print132, "typeArguments"));
|
|
168041
168081
|
}
|
|
168042
|
-
if (
|
|
168082
|
+
if (types18.getFieldValue(n2, "optional")) {
|
|
168043
168083
|
parts.push("?.");
|
|
168044
168084
|
}
|
|
168045
168085
|
parts.push(printArgumentsList(path32, options, print132));
|
|
@@ -169718,8 +169758,8 @@ var require_printer3 = __commonJS3({
|
|
|
169718
169758
|
});
|
|
169719
169759
|
}
|
|
169720
169760
|
function getPossibleRaw(node) {
|
|
169721
|
-
var value =
|
|
169722
|
-
var extra =
|
|
169761
|
+
var value = types18.getFieldValue(node, "value");
|
|
169762
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
169723
169763
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
169724
169764
|
return extra.raw;
|
|
169725
169765
|
}
|
|
@@ -169765,8 +169805,8 @@ var require_main22 = __commonJS3({
|
|
|
169765
169805
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
169766
169806
|
var tslib_1 = require_tslib3();
|
|
169767
169807
|
var fs_1 = tslib_1.__importDefault(__require2("fs"));
|
|
169768
|
-
var
|
|
169769
|
-
exports.types =
|
|
169808
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
169809
|
+
exports.types = types18;
|
|
169770
169810
|
var parser_1 = require_parser3();
|
|
169771
169811
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
169772
169812
|
return parser_1.parse;
|
|
@@ -170426,7 +170466,7 @@ var printDocASTReducer2 = {
|
|
|
170426
170466
|
leave: ({ name, interfaces, directives, fields }) => join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block3(fields)], " ")
|
|
170427
170467
|
},
|
|
170428
170468
|
UnionTypeDefinition: {
|
|
170429
|
-
leave: ({ name, directives, types:
|
|
170469
|
+
leave: ({ name, directives, types: types18 }) => join3(["union", name, join3(directives, " "), wrap2("= ", join3(types18, " | "))], " ")
|
|
170430
170470
|
},
|
|
170431
170471
|
EnumTypeDefinition: {
|
|
170432
170472
|
leave: ({ name, directives, values }) => join3(["enum", name, join3(directives, " "), block3(values)], " ")
|
|
@@ -170453,7 +170493,7 @@ var printDocASTReducer2 = {
|
|
|
170453
170493
|
leave: ({ name, interfaces, directives, fields }) => join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block3(fields)], " ")
|
|
170454
170494
|
},
|
|
170455
170495
|
UnionTypeExtension: {
|
|
170456
|
-
leave: ({ name, directives, types:
|
|
170496
|
+
leave: ({ name, directives, types: types18 }) => join3(["extend union", name, join3(directives, " "), wrap2("= ", join3(types18, " | "))], " ")
|
|
170457
170497
|
},
|
|
170458
170498
|
EnumTypeExtension: {
|
|
170459
170499
|
leave: ({ name, directives, values }) => join3(["extend enum", name, join3(directives, " "), block3(values)], " ")
|
|
@@ -171868,7 +171908,18 @@ var ListManager2 = class {
|
|
|
171868
171908
|
}
|
|
171869
171909
|
lists = /* @__PURE__ */ new Map();
|
|
171870
171910
|
listsByField = /* @__PURE__ */ new Map();
|
|
171871
|
-
get(listName, id2, allLists) {
|
|
171911
|
+
get(listName, id2, allLists, skipMatches) {
|
|
171912
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
171913
|
+
if (!lists) {
|
|
171914
|
+
return null;
|
|
171915
|
+
}
|
|
171916
|
+
if (skipMatches) {
|
|
171917
|
+
return new ListCollection2(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
171918
|
+
} else {
|
|
171919
|
+
return lists;
|
|
171920
|
+
}
|
|
171921
|
+
}
|
|
171922
|
+
getLists(listName, id2, allLists) {
|
|
171872
171923
|
const matches = this.lists.get(listName);
|
|
171873
171924
|
if (!matches || matches.size === 0) {
|
|
171874
171925
|
return null;
|
|
@@ -171990,6 +172041,9 @@ var List2 = class {
|
|
|
171990
172041
|
this.manager = manager;
|
|
171991
172042
|
this.abstract = abstract;
|
|
171992
172043
|
}
|
|
172044
|
+
get fieldRef() {
|
|
172045
|
+
return `${this.recordID}.${this.key}`;
|
|
172046
|
+
}
|
|
171993
172047
|
when(when) {
|
|
171994
172048
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
171995
172049
|
}
|
|
@@ -173134,8 +173188,8 @@ var Cache2 = class {
|
|
|
173134
173188
|
variables
|
|
173135
173189
|
);
|
|
173136
173190
|
}
|
|
173137
|
-
list(name, parentID, allLists) {
|
|
173138
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
173191
|
+
list(name, parentID, allLists, skipMatches) {
|
|
173192
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
173139
173193
|
if (!handler) {
|
|
173140
173194
|
throw new Error(
|
|
173141
173195
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -173550,6 +173604,7 @@ var CacheInternal2 = class {
|
|
|
173550
173604
|
});
|
|
173551
173605
|
}
|
|
173552
173606
|
}
|
|
173607
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
173553
173608
|
for (const operation of operations || []) {
|
|
173554
173609
|
let parentID;
|
|
173555
173610
|
if (operation.parentID) {
|
|
@@ -173569,7 +173624,12 @@ var CacheInternal2 = class {
|
|
|
173569
173624
|
const targets = Array.isArray(value) ? value : [value];
|
|
173570
173625
|
for (const target of targets) {
|
|
173571
173626
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
173572
|
-
this.cache.list(
|
|
173627
|
+
this.cache.list(
|
|
173628
|
+
operation.list,
|
|
173629
|
+
parentID,
|
|
173630
|
+
operation.target === "all",
|
|
173631
|
+
processedOperations
|
|
173632
|
+
).when(operation.when).addToList(
|
|
173573
173633
|
fieldSelection,
|
|
173574
173634
|
target,
|
|
173575
173635
|
variables,
|
|
@@ -173577,7 +173637,12 @@ var CacheInternal2 = class {
|
|
|
173577
173637
|
layer
|
|
173578
173638
|
);
|
|
173579
173639
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
173580
|
-
this.cache.list(
|
|
173640
|
+
this.cache.list(
|
|
173641
|
+
operation.list,
|
|
173642
|
+
parentID,
|
|
173643
|
+
operation.target === "all",
|
|
173644
|
+
processedOperations
|
|
173645
|
+
).when(operation.when).toggleElement({
|
|
173581
173646
|
selection: fieldSelection,
|
|
173582
173647
|
data: target,
|
|
173583
173648
|
variables,
|
|
@@ -173585,7 +173650,12 @@ var CacheInternal2 = class {
|
|
|
173585
173650
|
layer
|
|
173586
173651
|
});
|
|
173587
173652
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
173588
|
-
this.cache.list(
|
|
173653
|
+
this.cache.list(
|
|
173654
|
+
operation.list,
|
|
173655
|
+
parentID,
|
|
173656
|
+
operation.target === "all",
|
|
173657
|
+
processedOperations
|
|
173658
|
+
).when(operation.when).remove(target, variables, layer);
|
|
173589
173659
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
173590
173660
|
const targetID = this.id(operation.type, target);
|
|
173591
173661
|
if (!targetID) {
|
|
@@ -173597,6 +173667,16 @@ var CacheInternal2 = class {
|
|
|
173597
173667
|
this.cache.delete(targetID, layer);
|
|
173598
173668
|
}
|
|
173599
173669
|
}
|
|
173670
|
+
if (operation.list) {
|
|
173671
|
+
const matchingLists = this.cache.list(
|
|
173672
|
+
operation.list,
|
|
173673
|
+
parentID,
|
|
173674
|
+
operation.target === "all"
|
|
173675
|
+
);
|
|
173676
|
+
for (const list3 of matchingLists.lists) {
|
|
173677
|
+
processedOperations.add(list3.fieldRef);
|
|
173678
|
+
}
|
|
173679
|
+
}
|
|
173600
173680
|
}
|
|
173601
173681
|
}
|
|
173602
173682
|
return toNotify;
|
|
@@ -174062,6 +174142,46 @@ var { keys } = Object;
|
|
|
174062
174142
|
var recast4 = __toESM3(require_main22(), 1);
|
|
174063
174143
|
var AST4 = recast4.types.builders;
|
|
174064
174144
|
var pageInfoSelection = [
|
|
174145
|
+
{
|
|
174146
|
+
kind: graphql13.Kind.FIELD,
|
|
174147
|
+
name: {
|
|
174148
|
+
kind: graphql13.Kind.NAME,
|
|
174149
|
+
value: "pageInfo"
|
|
174150
|
+
},
|
|
174151
|
+
selectionSet: {
|
|
174152
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
174153
|
+
selections: [
|
|
174154
|
+
{
|
|
174155
|
+
kind: graphql13.Kind.FIELD,
|
|
174156
|
+
name: {
|
|
174157
|
+
kind: graphql13.Kind.NAME,
|
|
174158
|
+
value: "hasPreviousPage"
|
|
174159
|
+
}
|
|
174160
|
+
},
|
|
174161
|
+
{
|
|
174162
|
+
kind: graphql13.Kind.FIELD,
|
|
174163
|
+
name: {
|
|
174164
|
+
kind: graphql13.Kind.NAME,
|
|
174165
|
+
value: "hasNextPage"
|
|
174166
|
+
}
|
|
174167
|
+
},
|
|
174168
|
+
{
|
|
174169
|
+
kind: graphql13.Kind.FIELD,
|
|
174170
|
+
name: {
|
|
174171
|
+
kind: graphql13.Kind.NAME,
|
|
174172
|
+
value: "startCursor"
|
|
174173
|
+
}
|
|
174174
|
+
},
|
|
174175
|
+
{
|
|
174176
|
+
kind: graphql13.Kind.FIELD,
|
|
174177
|
+
name: {
|
|
174178
|
+
kind: graphql13.Kind.NAME,
|
|
174179
|
+
value: "endCursor"
|
|
174180
|
+
}
|
|
174181
|
+
}
|
|
174182
|
+
]
|
|
174183
|
+
}
|
|
174184
|
+
},
|
|
174065
174185
|
{
|
|
174066
174186
|
kind: graphql13.Kind.FIELD,
|
|
174067
174187
|
name: {
|
|
@@ -174332,7 +174452,7 @@ var printDocASTReducer22 = {
|
|
|
174332
174452
|
], " ")
|
|
174333
174453
|
},
|
|
174334
174454
|
UnionTypeDefinition: {
|
|
174335
|
-
leave: ({ name, directives, types:
|
|
174455
|
+
leave: ({ name, directives, types: types18 }) => join32(["union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
174336
174456
|
},
|
|
174337
174457
|
EnumTypeDefinition: {
|
|
174338
174458
|
leave: ({ name, directives, values }) => join32(["enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -174371,7 +174491,7 @@ var printDocASTReducer22 = {
|
|
|
174371
174491
|
], " ")
|
|
174372
174492
|
},
|
|
174373
174493
|
UnionTypeExtension: {
|
|
174374
|
-
leave: ({ name, directives, types:
|
|
174494
|
+
leave: ({ name, directives, types: types18 }) => join32(["extend union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
174375
174495
|
},
|
|
174376
174496
|
EnumTypeExtension: {
|
|
174377
174497
|
leave: ({ name, directives, values }) => join32(["extend enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -174408,6 +174528,8 @@ For more information, please visit these links:
|
|
|
174408
174528
|
- https://graphql.org/learn/global-object-identification/
|
|
174409
174529
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
174410
174530
|
`;
|
|
174531
|
+
var recast14 = __toESM3(require_main22(), 1);
|
|
174532
|
+
var AST14 = recast14.types.builders;
|
|
174411
174533
|
function find_insert_index(script) {
|
|
174412
174534
|
let insert_index = script.body.findIndex((statement) => {
|
|
174413
174535
|
return statement.type !== "ImportDeclaration";
|
|
@@ -174426,7 +174548,7 @@ function find_exported_fn(body, name) {
|
|
|
174426
174548
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
174427
174549
|
const value = exportDeclaration.declaration;
|
|
174428
174550
|
if (value.id?.name === name) {
|
|
174429
|
-
return exportDeclaration.declaration;
|
|
174551
|
+
return { declaration: exportDeclaration.declaration, export: exportDeclaration };
|
|
174430
174552
|
}
|
|
174431
174553
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
174432
174554
|
const value = exportDeclaration.declaration;
|
|
@@ -174445,7 +174567,10 @@ function find_exported_fn(body, name) {
|
|
|
174445
174567
|
init2 = init2.arguments[0];
|
|
174446
174568
|
}
|
|
174447
174569
|
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
174448
|
-
return init2;
|
|
174570
|
+
return { declaration: init2, export: exportDeclaration };
|
|
174571
|
+
}
|
|
174572
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
174573
|
+
return { declaration: init2, export: exportDeclaration };
|
|
174449
174574
|
}
|
|
174450
174575
|
} else {
|
|
174451
174576
|
continue;
|
|
@@ -174457,10 +174582,10 @@ function find_exported_fn(body, name) {
|
|
|
174457
174582
|
if (!exported) {
|
|
174458
174583
|
return null;
|
|
174459
174584
|
}
|
|
174460
|
-
return exported.declaration;
|
|
174585
|
+
return { declaration: exported.declaration, export: exported };
|
|
174461
174586
|
}
|
|
174462
|
-
var
|
|
174463
|
-
var
|
|
174587
|
+
var recast15 = __toESM3(require_main22(), 1);
|
|
174588
|
+
var AST15 = recast15.types.builders;
|
|
174464
174589
|
function ensure_imports({
|
|
174465
174590
|
config: config2,
|
|
174466
174591
|
script,
|
|
@@ -174476,13 +174601,13 @@ function ensure_imports({
|
|
|
174476
174601
|
if (!has_import) {
|
|
174477
174602
|
script.body.unshift({
|
|
174478
174603
|
type: "ImportDeclaration",
|
|
174479
|
-
source:
|
|
174604
|
+
source: AST15.stringLiteral(sourceModule),
|
|
174480
174605
|
importKind
|
|
174481
174606
|
});
|
|
174482
174607
|
}
|
|
174483
174608
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
174484
174609
|
}
|
|
174485
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) =>
|
|
174610
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) => AST15.identifier(id2));
|
|
174486
174611
|
const toImport = idList.filter(
|
|
174487
174612
|
(identifier) => !script.body.find(
|
|
174488
174613
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -174493,16 +174618,16 @@ function ensure_imports({
|
|
|
174493
174618
|
if (toImport.length > 0) {
|
|
174494
174619
|
script.body.unshift({
|
|
174495
174620
|
type: "ImportDeclaration",
|
|
174496
|
-
source:
|
|
174621
|
+
source: AST15.stringLiteral(sourceModule),
|
|
174497
174622
|
specifiers: toImport.map(
|
|
174498
|
-
(identifier, i22) => !Array.isArray(importID) ?
|
|
174623
|
+
(identifier, i22) => !Array.isArray(importID) ? AST15.importDefaultSpecifier(identifier) : AST15.importSpecifier(identifier, as?.[i22] ? AST15.identifier(as[i22]) : identifier)
|
|
174499
174624
|
),
|
|
174500
174625
|
importKind
|
|
174501
174626
|
});
|
|
174502
174627
|
}
|
|
174503
174628
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
174504
174629
|
if (target) {
|
|
174505
|
-
idList[i22] =
|
|
174630
|
+
idList[i22] = AST15.identifier(target);
|
|
174506
174631
|
}
|
|
174507
174632
|
}
|
|
174508
174633
|
return {
|
|
@@ -175045,14 +175170,14 @@ function findScriptInnerBounds({
|
|
|
175045
175170
|
}
|
|
175046
175171
|
|
|
175047
175172
|
// src/plugin/transforms/componentQuery.ts
|
|
175048
|
-
var
|
|
175049
|
-
var
|
|
175173
|
+
var recast16 = __toESM(require_main4(), 1);
|
|
175174
|
+
var AST16 = recast16.types.builders;
|
|
175050
175175
|
async function QueryProcessor(config, page) {
|
|
175051
175176
|
if (!is_component(config, page.framework, page.filepath)) {
|
|
175052
175177
|
return;
|
|
175053
175178
|
}
|
|
175054
175179
|
const store_id = (name) => {
|
|
175055
|
-
return
|
|
175180
|
+
return AST16.identifier(`_houdini_` + name);
|
|
175056
175181
|
};
|
|
175057
175182
|
const queries = await find_inline_queries(page, page.script, store_id);
|
|
175058
175183
|
if (queries.length === 0) {
|
|
@@ -175122,8 +175247,8 @@ async function QueryProcessor(config, page) {
|
|
|
175122
175247
|
page.script.body.splice(
|
|
175123
175248
|
find_insert_index(page.script),
|
|
175124
175249
|
0,
|
|
175125
|
-
|
|
175126
|
-
|
|
175250
|
+
AST16.variableDeclaration("const", [
|
|
175251
|
+
AST16.variableDeclarator(store_id(query.name.value), AST16.newExpression(factory, []))
|
|
175127
175252
|
])
|
|
175128
175253
|
);
|
|
175129
175254
|
}
|
|
@@ -175139,47 +175264,47 @@ async function QueryProcessor(config, page) {
|
|
|
175139
175264
|
)}. maybe its not exported? `
|
|
175140
175265
|
});
|
|
175141
175266
|
}
|
|
175142
|
-
const queryLoadExpression =
|
|
175143
|
-
|
|
175267
|
+
const queryLoadExpression = AST16.callExpression(
|
|
175268
|
+
AST16.memberExpression(store_id(query.name.value), AST16.identifier("fetch")),
|
|
175144
175269
|
[
|
|
175145
|
-
|
|
175146
|
-
|
|
175147
|
-
|
|
175148
|
-
|
|
175149
|
-
|
|
175150
|
-
|
|
175151
|
-
|
|
175152
|
-
|
|
175270
|
+
AST16.objectExpression([
|
|
175271
|
+
AST16.objectProperty(
|
|
175272
|
+
AST16.identifier("variables"),
|
|
175273
|
+
AST16.callExpression(AST16.identifier("marshalInputs"), [
|
|
175274
|
+
AST16.objectExpression([
|
|
175275
|
+
AST16.objectProperty(
|
|
175276
|
+
AST16.identifier("config"),
|
|
175277
|
+
AST16.callExpression(AST16.identifier("getCurrentConfig"), [])
|
|
175153
175278
|
),
|
|
175154
|
-
|
|
175155
|
-
|
|
175156
|
-
|
|
175279
|
+
AST16.objectProperty(
|
|
175280
|
+
AST16.identifier("artifact"),
|
|
175281
|
+
AST16.memberExpression(
|
|
175157
175282
|
store_id(query.name.value),
|
|
175158
|
-
|
|
175283
|
+
AST16.identifier("artifact")
|
|
175159
175284
|
)
|
|
175160
175285
|
),
|
|
175161
|
-
|
|
175162
|
-
|
|
175163
|
-
has_variables ?
|
|
175164
|
-
|
|
175165
|
-
|
|
175166
|
-
|
|
175286
|
+
AST16.objectProperty(
|
|
175287
|
+
AST16.identifier("input"),
|
|
175288
|
+
has_variables ? AST16.callExpression(
|
|
175289
|
+
AST16.memberExpression(
|
|
175290
|
+
AST16.identifier(variable_fn),
|
|
175291
|
+
AST16.identifier("call")
|
|
175167
175292
|
),
|
|
175168
175293
|
[
|
|
175169
|
-
|
|
175170
|
-
|
|
175294
|
+
AST16.newExpression(
|
|
175295
|
+
AST16.identifier("RequestContext"),
|
|
175171
175296
|
[]
|
|
175172
175297
|
),
|
|
175173
|
-
|
|
175174
|
-
|
|
175175
|
-
|
|
175176
|
-
|
|
175298
|
+
AST16.objectExpression([
|
|
175299
|
+
AST16.objectProperty(
|
|
175300
|
+
AST16.identifier("props"),
|
|
175301
|
+
AST16.objectExpression(
|
|
175177
175302
|
props.map(
|
|
175178
|
-
(prop2) =>
|
|
175179
|
-
|
|
175303
|
+
(prop2) => AST16.objectProperty(
|
|
175304
|
+
AST16.identifier(
|
|
175180
175305
|
prop2
|
|
175181
175306
|
),
|
|
175182
|
-
|
|
175307
|
+
AST16.identifier(
|
|
175183
175308
|
prop2
|
|
175184
175309
|
)
|
|
175185
175310
|
)
|
|
@@ -175188,7 +175313,7 @@ async function QueryProcessor(config, page) {
|
|
|
175188
175313
|
)
|
|
175189
175314
|
])
|
|
175190
175315
|
]
|
|
175191
|
-
) :
|
|
175316
|
+
) : AST16.objectExpression([])
|
|
175192
175317
|
)
|
|
175193
175318
|
])
|
|
175194
175319
|
])
|
|
@@ -175199,23 +175324,23 @@ async function QueryProcessor(config, page) {
|
|
|
175199
175324
|
let finalExpression = [];
|
|
175200
175325
|
if (page.svelte5Runes) {
|
|
175201
175326
|
finalExpression = [
|
|
175202
|
-
|
|
175203
|
-
|
|
175204
|
-
|
|
175327
|
+
AST16.expressionStatement(
|
|
175328
|
+
AST16.callExpression(AST16.identifier("$effect"), [
|
|
175329
|
+
AST16.arrowFunctionExpression(
|
|
175205
175330
|
[],
|
|
175206
|
-
|
|
175331
|
+
AST16.blockStatement([AST16.expressionStatement(queryLoadExpression)])
|
|
175207
175332
|
)
|
|
175208
175333
|
])
|
|
175209
175334
|
)
|
|
175210
175335
|
];
|
|
175211
175336
|
} else {
|
|
175212
175337
|
finalExpression = [
|
|
175213
|
-
|
|
175214
|
-
|
|
175215
|
-
|
|
175216
|
-
|
|
175338
|
+
AST16.labeledStatement(
|
|
175339
|
+
AST16.identifier("$"),
|
|
175340
|
+
AST16.expressionStatement(
|
|
175341
|
+
AST16.logicalExpression(
|
|
175217
175342
|
"&&",
|
|
175218
|
-
|
|
175343
|
+
AST16.identifier("isBrowser"),
|
|
175219
175344
|
queryLoadExpression
|
|
175220
175345
|
)
|
|
175221
175346
|
)
|
|
@@ -175257,8 +175382,8 @@ async function find_inline_queries(page, parsed, store_id) {
|
|
|
175257
175382
|
}
|
|
175258
175383
|
|
|
175259
175384
|
// src/plugin/transforms/kit/init.ts
|
|
175260
|
-
var
|
|
175261
|
-
var
|
|
175385
|
+
var recast17 = __toESM(require_main4(), 1);
|
|
175386
|
+
var AST17 = recast17.types.builders;
|
|
175262
175387
|
async function kit_init(page) {
|
|
175263
175388
|
if (!is_root_layout(page.config, page.filepath)) {
|
|
175264
175389
|
return;
|
|
@@ -175282,9 +175407,9 @@ async function kit_init(page) {
|
|
|
175282
175407
|
import: ["extractSession", "setClientSession"]
|
|
175283
175408
|
}).ids;
|
|
175284
175409
|
page.script.body.push(
|
|
175285
|
-
|
|
175286
|
-
|
|
175287
|
-
|
|
175410
|
+
AST17.expressionStatement(
|
|
175411
|
+
AST17.callExpression(on_mount, [
|
|
175412
|
+
AST17.arrowFunctionExpression([], AST17.callExpression(set_client_started, []))
|
|
175288
175413
|
])
|
|
175289
175414
|
)
|
|
175290
175415
|
);
|
|
@@ -175295,17 +175420,17 @@ async function kit_init(page) {
|
|
|
175295
175420
|
import: ["page"]
|
|
175296
175421
|
}).ids[0];
|
|
175297
175422
|
page.script.body.push(
|
|
175298
|
-
|
|
175299
|
-
|
|
175300
|
-
|
|
175301
|
-
[
|
|
175302
|
-
|
|
175303
|
-
|
|
175304
|
-
|
|
175305
|
-
|
|
175306
|
-
|
|
175307
|
-
|
|
175308
|
-
|
|
175423
|
+
AST17.expressionStatement(
|
|
175424
|
+
AST17.callExpression(AST17.memberExpression(store_id, AST17.identifier("subscribe")), [
|
|
175425
|
+
AST17.arrowFunctionExpression(
|
|
175426
|
+
[AST17.identifier("val")],
|
|
175427
|
+
AST17.blockStatement([
|
|
175428
|
+
AST17.expressionStatement(
|
|
175429
|
+
AST17.callExpression(set_session, [
|
|
175430
|
+
AST17.callExpression(extract_session, [
|
|
175431
|
+
AST17.memberExpression(
|
|
175432
|
+
AST17.identifier("val"),
|
|
175433
|
+
AST17.identifier("data")
|
|
175309
175434
|
)
|
|
175310
175435
|
])
|
|
175311
175436
|
])
|
|
@@ -175319,7 +175444,7 @@ async function kit_init(page) {
|
|
|
175319
175444
|
|
|
175320
175445
|
// src/plugin/transforms/kit/load.ts
|
|
175321
175446
|
var graphql36 = __toESM(require("graphql"), 1);
|
|
175322
|
-
var
|
|
175447
|
+
var recast18 = __toESM(require_main4(), 1);
|
|
175323
175448
|
|
|
175324
175449
|
// src/plugin/routing.ts
|
|
175325
175450
|
var param_pattern = /^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;
|
|
@@ -175401,14 +175526,14 @@ function escape2(str) {
|
|
|
175401
175526
|
}
|
|
175402
175527
|
|
|
175403
175528
|
// src/plugin/transforms/kit/load.ts
|
|
175404
|
-
var
|
|
175529
|
+
var AST18 = recast18.types.builders;
|
|
175405
175530
|
async function kit_load_generator(page) {
|
|
175406
175531
|
const route = is_route(page.config, page.framework, page.filepath);
|
|
175407
175532
|
const script = is_route_script(page.framework, page.filepath);
|
|
175408
175533
|
if (!route && !script) {
|
|
175409
175534
|
return;
|
|
175410
175535
|
}
|
|
175411
|
-
const inline_query_store = (name) => route ?
|
|
175536
|
+
const inline_query_store = (name) => route ? AST18.memberExpression(AST18.identifier("data"), AST18.identifier(name)) : artifact_import({
|
|
175412
175537
|
config: page.config,
|
|
175413
175538
|
script: page.script,
|
|
175414
175539
|
page,
|
|
@@ -175460,8 +175585,8 @@ async function kit_load_generator(page) {
|
|
|
175460
175585
|
find_insert_index(page.script),
|
|
175461
175586
|
0,
|
|
175462
175587
|
...!has_data ? [
|
|
175463
|
-
|
|
175464
|
-
|
|
175588
|
+
AST18.exportNamedDeclaration(
|
|
175589
|
+
AST18.variableDeclaration("let", [AST18.identifier("data")])
|
|
175465
175590
|
)
|
|
175466
175591
|
] : []
|
|
175467
175592
|
);
|
|
@@ -175508,43 +175633,43 @@ function add_load({
|
|
|
175508
175633
|
let before_load = page_info.exports.includes(houdini_before_load_fn);
|
|
175509
175634
|
let afterLoad = page_info.exports.includes(houdini_afterLoad_fn);
|
|
175510
175635
|
let on_error = page_info.exports.includes(houdini_on_error_fn);
|
|
175511
|
-
const request_context =
|
|
175512
|
-
const promise_list =
|
|
175513
|
-
const return_value =
|
|
175514
|
-
const result_obj =
|
|
175515
|
-
const input_obj =
|
|
175516
|
-
const preload_fn =
|
|
175517
|
-
|
|
175518
|
-
[
|
|
175519
|
-
|
|
175520
|
-
|
|
175521
|
-
|
|
175636
|
+
const request_context = AST18.identifier("houdini_context");
|
|
175637
|
+
const promise_list = AST18.identifier("promises");
|
|
175638
|
+
const return_value = AST18.memberExpression(request_context, AST18.identifier("returnValue"));
|
|
175639
|
+
const result_obj = AST18.identifier("result");
|
|
175640
|
+
const input_obj = AST18.identifier("inputs");
|
|
175641
|
+
const preload_fn = AST18.functionDeclaration(
|
|
175642
|
+
AST18.identifier("load"),
|
|
175643
|
+
[AST18.identifier("context")],
|
|
175644
|
+
AST18.blockStatement([
|
|
175645
|
+
AST18.variableDeclaration("const", [
|
|
175646
|
+
AST18.variableDeclarator(
|
|
175522
175647
|
request_context,
|
|
175523
|
-
|
|
175648
|
+
AST18.newExpression(AST18.identifier("RequestContext"), [AST18.identifier("context")])
|
|
175524
175649
|
)
|
|
175525
175650
|
]),
|
|
175526
|
-
|
|
175527
|
-
|
|
175528
|
-
|
|
175529
|
-
|
|
175651
|
+
AST18.variableDeclaration("const", [
|
|
175652
|
+
AST18.variableDeclarator(
|
|
175653
|
+
AST18.identifier("houdiniConfig"),
|
|
175654
|
+
AST18.callExpression(AST18.identifier("getCurrentConfig"), [])
|
|
175530
175655
|
)
|
|
175531
175656
|
]),
|
|
175532
|
-
|
|
175533
|
-
|
|
175657
|
+
AST18.variableDeclaration("const", [
|
|
175658
|
+
AST18.variableDeclarator(promise_list, AST18.arrayExpression([]))
|
|
175534
175659
|
]),
|
|
175535
|
-
|
|
175536
|
-
|
|
175660
|
+
AST18.variableDeclaration("const", [
|
|
175661
|
+
AST18.variableDeclarator(input_obj, AST18.objectExpression([]))
|
|
175537
175662
|
]),
|
|
175538
|
-
|
|
175539
|
-
|
|
175540
|
-
|
|
175541
|
-
|
|
175663
|
+
AST18.returnStatement(
|
|
175664
|
+
AST18.objectExpression([
|
|
175665
|
+
AST18.spreadElement(return_value),
|
|
175666
|
+
AST18.spreadElement(result_obj)
|
|
175542
175667
|
])
|
|
175543
175668
|
)
|
|
175544
175669
|
])
|
|
175545
175670
|
);
|
|
175546
175671
|
preload_fn.async = true;
|
|
175547
|
-
page.script.body.push(
|
|
175672
|
+
page.script.body.push(AST18.exportNamedDeclaration(preload_fn));
|
|
175548
175673
|
let insert_index = 4;
|
|
175549
175674
|
for (const query of queries) {
|
|
175550
175675
|
const { ids } = ensure_imports({
|
|
@@ -175554,19 +175679,19 @@ function add_load({
|
|
|
175554
175679
|
sourceModule: store_import_path({ config: page.config, name: query.name.value })
|
|
175555
175680
|
});
|
|
175556
175681
|
const load_fn = ids[0];
|
|
175557
|
-
const variables = (query.variableDefinitions?.length ?? 0) > 0 ?
|
|
175558
|
-
|
|
175559
|
-
|
|
175560
|
-
|
|
175682
|
+
const variables = (query.variableDefinitions?.length ?? 0) > 0 ? AST18.awaitExpression(
|
|
175683
|
+
AST18.callExpression(AST18.identifier(__variable_fn_name(query.name.value)), [
|
|
175684
|
+
AST18.identifier("houdiniConfig"),
|
|
175685
|
+
AST18.identifier("context")
|
|
175561
175686
|
])
|
|
175562
|
-
) :
|
|
175687
|
+
) : AST18.objectExpression([]);
|
|
175563
175688
|
preload_fn.body.body.splice(
|
|
175564
175689
|
insert_index++,
|
|
175565
175690
|
0,
|
|
175566
|
-
|
|
175567
|
-
|
|
175691
|
+
AST18.expressionStatement(
|
|
175692
|
+
AST18.assignmentExpression(
|
|
175568
175693
|
"=",
|
|
175569
|
-
|
|
175694
|
+
AST18.memberExpression(input_obj, AST18.literal(query.name.value)),
|
|
175570
175695
|
variables
|
|
175571
175696
|
)
|
|
175572
175697
|
)
|
|
@@ -175574,18 +175699,18 @@ function add_load({
|
|
|
175574
175699
|
preload_fn.body.body.splice(
|
|
175575
175700
|
insert_index++,
|
|
175576
175701
|
0,
|
|
175577
|
-
|
|
175578
|
-
|
|
175579
|
-
|
|
175580
|
-
|
|
175581
|
-
|
|
175582
|
-
|
|
175583
|
-
|
|
175702
|
+
AST18.expressionStatement(
|
|
175703
|
+
AST18.callExpression(AST18.memberExpression(promise_list, AST18.identifier("push")), [
|
|
175704
|
+
AST18.callExpression(load_fn, [
|
|
175705
|
+
AST18.objectExpression([
|
|
175706
|
+
AST18.objectProperty(
|
|
175707
|
+
AST18.literal("variables"),
|
|
175708
|
+
AST18.memberExpression(input_obj, AST18.literal(query.name.value))
|
|
175584
175709
|
),
|
|
175585
|
-
|
|
175586
|
-
|
|
175587
|
-
|
|
175588
|
-
afterLoad || on_error ?
|
|
175710
|
+
AST18.objectProperty(AST18.literal("event"), AST18.identifier("context")),
|
|
175711
|
+
AST18.objectProperty(
|
|
175712
|
+
AST18.literal("blocking"),
|
|
175713
|
+
afterLoad || on_error ? AST18.booleanLiteral(true) : AST18.identifier("undefined")
|
|
175589
175714
|
)
|
|
175590
175715
|
])
|
|
175591
175716
|
])
|
|
@@ -175597,28 +175722,28 @@ function add_load({
|
|
|
175597
175722
|
preload_fn.body.body.splice(
|
|
175598
175723
|
insert_index++,
|
|
175599
175724
|
0,
|
|
175600
|
-
|
|
175601
|
-
|
|
175725
|
+
AST18.variableDeclaration("let", [
|
|
175726
|
+
AST18.variableDeclarator(result_obj, AST18.objectExpression([]))
|
|
175602
175727
|
]),
|
|
175603
|
-
|
|
175604
|
-
|
|
175605
|
-
|
|
175606
|
-
|
|
175728
|
+
AST18.tryStatement(
|
|
175729
|
+
AST18.blockStatement([
|
|
175730
|
+
AST18.expressionStatement(
|
|
175731
|
+
AST18.assignmentExpression(
|
|
175607
175732
|
"=",
|
|
175608
175733
|
result_obj,
|
|
175609
|
-
|
|
175610
|
-
|
|
175611
|
-
|
|
175612
|
-
|
|
175734
|
+
AST18.callExpression(
|
|
175735
|
+
AST18.memberExpression(
|
|
175736
|
+
AST18.identifier("Object"),
|
|
175737
|
+
AST18.identifier("assign")
|
|
175613
175738
|
),
|
|
175614
175739
|
[
|
|
175615
|
-
|
|
175616
|
-
|
|
175617
|
-
|
|
175618
|
-
|
|
175619
|
-
|
|
175620
|
-
|
|
175621
|
-
|
|
175740
|
+
AST18.objectExpression([]),
|
|
175741
|
+
AST18.spreadElement(
|
|
175742
|
+
AST18.awaitExpression(
|
|
175743
|
+
AST18.callExpression(
|
|
175744
|
+
AST18.memberExpression(
|
|
175745
|
+
AST18.identifier("Promise"),
|
|
175746
|
+
AST18.identifier("all")
|
|
175622
175747
|
),
|
|
175623
175748
|
[promise_list]
|
|
175624
175749
|
)
|
|
@@ -175629,37 +175754,37 @@ function add_load({
|
|
|
175629
175754
|
)
|
|
175630
175755
|
)
|
|
175631
175756
|
]),
|
|
175632
|
-
|
|
175633
|
-
|
|
175757
|
+
AST18.catchClause(
|
|
175758
|
+
AST18.identifier("err"),
|
|
175634
175759
|
null,
|
|
175635
|
-
|
|
175636
|
-
on_error ?
|
|
175637
|
-
|
|
175638
|
-
|
|
175639
|
-
|
|
175760
|
+
AST18.blockStatement([
|
|
175761
|
+
on_error ? AST18.expressionStatement(
|
|
175762
|
+
AST18.awaitExpression(
|
|
175763
|
+
AST18.callExpression(
|
|
175764
|
+
AST18.memberExpression(
|
|
175640
175765
|
request_context,
|
|
175641
|
-
|
|
175766
|
+
AST18.identifier("invokeLoadHook")
|
|
175642
175767
|
),
|
|
175643
175768
|
[
|
|
175644
|
-
|
|
175645
|
-
|
|
175646
|
-
|
|
175647
|
-
|
|
175769
|
+
AST18.objectExpression([
|
|
175770
|
+
AST18.objectProperty(
|
|
175771
|
+
AST18.literal("variant"),
|
|
175772
|
+
AST18.stringLiteral("error")
|
|
175648
175773
|
),
|
|
175649
|
-
|
|
175650
|
-
|
|
175651
|
-
|
|
175774
|
+
AST18.objectProperty(
|
|
175775
|
+
AST18.literal("hookFn"),
|
|
175776
|
+
AST18.identifier(houdini_on_error_fn)
|
|
175652
175777
|
),
|
|
175653
|
-
|
|
175654
|
-
|
|
175655
|
-
|
|
175778
|
+
AST18.objectProperty(
|
|
175779
|
+
AST18.literal("error"),
|
|
175780
|
+
AST18.identifier("err")
|
|
175656
175781
|
),
|
|
175657
|
-
|
|
175782
|
+
AST18.objectProperty(AST18.literal("input"), input_obj)
|
|
175658
175783
|
])
|
|
175659
175784
|
]
|
|
175660
175785
|
)
|
|
175661
175786
|
)
|
|
175662
|
-
) :
|
|
175787
|
+
) : AST18.throwStatement(AST18.identifier("err"))
|
|
175663
175788
|
])
|
|
175664
175789
|
)
|
|
175665
175790
|
)
|
|
@@ -175694,22 +175819,22 @@ async function find_special_query(type, page) {
|
|
|
175694
175819
|
return definition;
|
|
175695
175820
|
}
|
|
175696
175821
|
function load_hook_statements(name, request_context, input_id, result_id) {
|
|
175697
|
-
return
|
|
175698
|
-
|
|
175699
|
-
|
|
175700
|
-
|
|
175822
|
+
return AST18.expressionStatement(
|
|
175823
|
+
AST18.awaitExpression(
|
|
175824
|
+
AST18.callExpression(
|
|
175825
|
+
AST18.memberExpression(request_context, AST18.identifier("invokeLoadHook")),
|
|
175701
175826
|
[
|
|
175702
|
-
|
|
175703
|
-
|
|
175704
|
-
|
|
175705
|
-
|
|
175706
|
-
|
|
175827
|
+
AST18.objectExpression([
|
|
175828
|
+
AST18.objectProperty(AST18.literal("variant"), AST18.stringLiteral(name)),
|
|
175829
|
+
AST18.objectProperty(
|
|
175830
|
+
AST18.literal("hookFn"),
|
|
175831
|
+
AST18.identifier(
|
|
175707
175832
|
name === "before" ? houdini_before_load_fn : houdini_afterLoad_fn
|
|
175708
175833
|
)
|
|
175709
175834
|
),
|
|
175710
175835
|
...name === "after" ? [
|
|
175711
|
-
|
|
175712
|
-
|
|
175836
|
+
AST18.objectProperty(AST18.literal("input"), input_id),
|
|
175837
|
+
AST18.objectProperty(AST18.literal("data"), result_id)
|
|
175713
175838
|
] : []
|
|
175714
175839
|
])
|
|
175715
175840
|
]
|
|
@@ -175771,22 +175896,22 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
175771
175896
|
};
|
|
175772
175897
|
}
|
|
175773
175898
|
const fn_body = [
|
|
175774
|
-
|
|
175775
|
-
|
|
175776
|
-
|
|
175777
|
-
|
|
175899
|
+
AST18.variableDeclaration("const", [
|
|
175900
|
+
AST18.variableDeclarator(
|
|
175901
|
+
AST18.identifier("result"),
|
|
175902
|
+
AST18.objectExpression(
|
|
175778
175903
|
Object.entries(has_args).map(([arg, type]) => {
|
|
175779
|
-
return
|
|
175780
|
-
|
|
175781
|
-
|
|
175782
|
-
|
|
175783
|
-
|
|
175784
|
-
|
|
175785
|
-
|
|
175786
|
-
|
|
175787
|
-
|
|
175904
|
+
return AST18.objectProperty(
|
|
175905
|
+
AST18.identifier(arg),
|
|
175906
|
+
AST18.callExpression(AST18.identifier("parseScalar"), [
|
|
175907
|
+
AST18.identifier("config"),
|
|
175908
|
+
AST18.stringLiteral(type),
|
|
175909
|
+
AST18.memberExpression(
|
|
175910
|
+
AST18.memberExpression(
|
|
175911
|
+
AST18.identifier("event"),
|
|
175912
|
+
AST18.identifier("params")
|
|
175788
175913
|
),
|
|
175789
|
-
|
|
175914
|
+
AST18.identifier(arg)
|
|
175790
175915
|
)
|
|
175791
175916
|
])
|
|
175792
175917
|
);
|
|
@@ -175797,28 +175922,28 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
175797
175922
|
];
|
|
175798
175923
|
if (has_local) {
|
|
175799
175924
|
fn_body.push(
|
|
175800
|
-
|
|
175801
|
-
|
|
175802
|
-
|
|
175925
|
+
AST18.expressionStatement(
|
|
175926
|
+
AST18.callExpression(
|
|
175927
|
+
AST18.memberExpression(AST18.identifier("Object"), AST18.identifier("assign")),
|
|
175803
175928
|
[
|
|
175804
|
-
|
|
175805
|
-
|
|
175806
|
-
|
|
175807
|
-
|
|
175808
|
-
|
|
175809
|
-
|
|
175929
|
+
AST18.identifier("result"),
|
|
175930
|
+
AST18.callExpression(AST18.identifier("marshalInputs"), [
|
|
175931
|
+
AST18.objectExpression([
|
|
175932
|
+
AST18.objectProperty(
|
|
175933
|
+
AST18.identifier("config"),
|
|
175934
|
+
AST18.identifier("config")
|
|
175810
175935
|
),
|
|
175811
|
-
|
|
175812
|
-
|
|
175813
|
-
|
|
175814
|
-
|
|
175815
|
-
|
|
175816
|
-
[
|
|
175936
|
+
AST18.objectProperty(
|
|
175937
|
+
AST18.identifier("input"),
|
|
175938
|
+
AST18.awaitExpression(
|
|
175939
|
+
AST18.callExpression(
|
|
175940
|
+
AST18.identifier(query_variable_fn(query.name.value)),
|
|
175941
|
+
[AST18.identifier("event")]
|
|
175817
175942
|
)
|
|
175818
175943
|
)
|
|
175819
175944
|
),
|
|
175820
|
-
|
|
175821
|
-
|
|
175945
|
+
AST18.objectProperty(
|
|
175946
|
+
AST18.identifier("artifact"),
|
|
175822
175947
|
artifact_import({
|
|
175823
175948
|
config: page.config,
|
|
175824
175949
|
script: page.script,
|
|
@@ -175833,11 +175958,11 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
175833
175958
|
)
|
|
175834
175959
|
);
|
|
175835
175960
|
}
|
|
175836
|
-
fn_body.push(
|
|
175837
|
-
const declaration2 =
|
|
175838
|
-
|
|
175839
|
-
[
|
|
175840
|
-
|
|
175961
|
+
fn_body.push(AST18.returnStatement(AST18.identifier("result")));
|
|
175962
|
+
const declaration2 = AST18.functionDeclaration(
|
|
175963
|
+
AST18.identifier(__variable_fn_name(query.name.value)),
|
|
175964
|
+
[AST18.identifier("config"), AST18.identifier("event")],
|
|
175965
|
+
AST18.blockStatement(fn_body)
|
|
175841
175966
|
);
|
|
175842
175967
|
declaration2.async = true;
|
|
175843
175968
|
return declaration2;
|
|
@@ -175847,8 +175972,8 @@ function __variable_fn_name(name) {
|
|
|
175847
175972
|
}
|
|
175848
175973
|
|
|
175849
175974
|
// src/plugin/transforms/kit/session.ts
|
|
175850
|
-
var
|
|
175851
|
-
var
|
|
175975
|
+
var recast19 = __toESM(require_main4(), 1);
|
|
175976
|
+
var AST19 = recast19.types.builders;
|
|
175852
175977
|
function session_default(page) {
|
|
175853
175978
|
if (is_root_layout_server(page.config, page.filepath)) {
|
|
175854
175979
|
process_root_layout_server(page);
|
|
@@ -175864,12 +175989,12 @@ function process_root_layout_server(page) {
|
|
|
175864
175989
|
sourceModule: "$houdini/plugins/houdini-svelte/runtime/session"
|
|
175865
175990
|
}).ids[0];
|
|
175866
175991
|
add_load_return(page, (event_id) => [
|
|
175867
|
-
|
|
175992
|
+
AST19.spreadElement(AST19.callExpression(build_session_object, [event_id]))
|
|
175868
175993
|
]);
|
|
175869
175994
|
}
|
|
175870
175995
|
function process_root_layout_script(page) {
|
|
175871
175996
|
add_load_return(page, (event_id) => [
|
|
175872
|
-
|
|
175997
|
+
AST19.spreadElement(AST19.memberExpression(event_id, AST19.identifier("data")))
|
|
175873
175998
|
]);
|
|
175874
175999
|
}
|
|
175875
176000
|
function add_load_return(page, properties) {
|
|
@@ -175881,50 +176006,78 @@ function add_load_return(page, properties) {
|
|
|
175881
176006
|
if (return_statement_index !== -1) {
|
|
175882
176007
|
return_statement = body.body[return_statement_index];
|
|
175883
176008
|
} else {
|
|
175884
|
-
return_statement =
|
|
176009
|
+
return_statement = AST19.returnStatement(AST19.objectExpression([]));
|
|
175885
176010
|
body.body.push(return_statement);
|
|
175886
|
-
return_statement_index = body.body.length - 1;
|
|
175887
176011
|
}
|
|
175888
|
-
|
|
175889
|
-
|
|
175890
|
-
|
|
175891
|
-
|
|
175892
|
-
|
|
175893
|
-
|
|
175894
|
-
|
|
175895
|
-
|
|
175896
|
-
|
|
175897
|
-
|
|
175898
|
-
|
|
176012
|
+
return walk(body, {
|
|
176013
|
+
enter(node) {
|
|
176014
|
+
if (node.type === "ReturnStatement") {
|
|
176015
|
+
const returnedValue = node.argument;
|
|
176016
|
+
this.replace(
|
|
176017
|
+
AST19.returnStatement(
|
|
176018
|
+
AST19.objectExpression([
|
|
176019
|
+
...properties(event_id),
|
|
176020
|
+
AST19.spreadElement(returnedValue ?? AST19.objectExpression([]))
|
|
176021
|
+
])
|
|
176022
|
+
)
|
|
176023
|
+
);
|
|
176024
|
+
}
|
|
176025
|
+
}
|
|
176026
|
+
});
|
|
175899
176027
|
});
|
|
175900
176028
|
}
|
|
175901
176029
|
function modify_load(page, cb) {
|
|
175902
|
-
let
|
|
175903
|
-
let event_id =
|
|
175904
|
-
let
|
|
176030
|
+
let exported = find_exported_fn(page.script.body, "load");
|
|
176031
|
+
let event_id = AST19.identifier("event");
|
|
176032
|
+
let load_fn = exported?.declaration || null;
|
|
176033
|
+
let body = AST19.blockStatement([]);
|
|
175905
176034
|
if (load_fn?.type === "ArrowFunctionExpression") {
|
|
175906
176035
|
if (load_fn.body.type === "BlockStatement") {
|
|
175907
176036
|
body = load_fn.body;
|
|
175908
176037
|
} else {
|
|
175909
|
-
body =
|
|
176038
|
+
body = AST19.blockStatement([AST19.returnStatement(load_fn.body)]);
|
|
175910
176039
|
load_fn.body = body;
|
|
175911
176040
|
}
|
|
175912
|
-
} else if (load_fn) {
|
|
176041
|
+
} else if (load_fn && "body" in load_fn) {
|
|
175913
176042
|
body = load_fn.body;
|
|
175914
176043
|
}
|
|
175915
176044
|
if (!load_fn) {
|
|
175916
|
-
load_fn =
|
|
175917
|
-
|
|
176045
|
+
load_fn = AST19.functionDeclaration(
|
|
176046
|
+
AST19.identifier("load"),
|
|
175918
176047
|
[event_id],
|
|
175919
|
-
|
|
176048
|
+
AST19.blockStatement([])
|
|
175920
176049
|
);
|
|
175921
176050
|
load_fn.async = true;
|
|
175922
176051
|
page.script.body.splice(
|
|
175923
176052
|
find_insert_index(page.script),
|
|
175924
176053
|
0,
|
|
175925
|
-
|
|
176054
|
+
AST19.exportNamedDeclaration(load_fn)
|
|
175926
176055
|
);
|
|
175927
176056
|
body = load_fn.body;
|
|
176057
|
+
} else if (load_fn.type === "CallExpression" || load_fn.type === "Identifier") {
|
|
176058
|
+
const exportStatement = exported?.export;
|
|
176059
|
+
if (!exportStatement) {
|
|
176060
|
+
return;
|
|
176061
|
+
}
|
|
176062
|
+
const intermediateID = AST19.identifier("houdini__intermediate__load__");
|
|
176063
|
+
page.script.body.push(
|
|
176064
|
+
AST19.variableDeclaration("const", [AST19.variableDeclarator(intermediateID, load_fn)])
|
|
176065
|
+
);
|
|
176066
|
+
const newLoad = AST19.arrowFunctionExpression(
|
|
176067
|
+
[AST19.identifier("event")],
|
|
176068
|
+
AST19.blockStatement([
|
|
176069
|
+
AST19.variableDeclaration("const", [
|
|
176070
|
+
AST19.variableDeclarator(
|
|
176071
|
+
AST19.identifier("result"),
|
|
176072
|
+
AST19.callExpression(intermediateID, [AST19.identifier("event")])
|
|
176073
|
+
)
|
|
176074
|
+
]),
|
|
176075
|
+
AST19.returnStatement(AST19.identifier("result"))
|
|
176076
|
+
])
|
|
176077
|
+
);
|
|
176078
|
+
exportStatement.declaration.declarations[0].init = newLoad;
|
|
176079
|
+
load_fn = newLoad;
|
|
176080
|
+
body = newLoad.body;
|
|
175928
176081
|
} else {
|
|
175929
176082
|
if (load_fn.params.length === 0) {
|
|
175930
176083
|
load_fn.params.push(event_id);
|
|
@@ -175934,7 +176087,7 @@ function modify_load(page, cb) {
|
|
|
175934
176087
|
const pattern = load_fn.params[0];
|
|
175935
176088
|
load_fn.params[0] = event_id;
|
|
175936
176089
|
body.body.unshift(
|
|
175937
|
-
|
|
176090
|
+
AST19.variableDeclaration("let", [AST19.variableDeclarator(pattern, event_id)])
|
|
175938
176091
|
);
|
|
175939
176092
|
} else {
|
|
175940
176093
|
throw new Error(
|
|
@@ -175942,7 +176095,7 @@ function modify_load(page, cb) {
|
|
|
175942
176095
|
);
|
|
175943
176096
|
}
|
|
175944
176097
|
}
|
|
175945
|
-
cb(body, event_id);
|
|
176098
|
+
load_fn.body = cb(body, event_id);
|
|
175946
176099
|
}
|
|
175947
176100
|
|
|
175948
176101
|
// src/plugin/transforms/kit/index.ts
|
|
@@ -175955,8 +176108,8 @@ async function SvelteKitProcessor(config, page) {
|
|
|
175955
176108
|
}
|
|
175956
176109
|
|
|
175957
176110
|
// src/plugin/transforms/tags.ts
|
|
175958
|
-
var
|
|
175959
|
-
var
|
|
176111
|
+
var recast20 = __toESM(require_main4(), 1);
|
|
176112
|
+
var AST20 = recast20.types.builders;
|
|
175960
176113
|
async function GraphQLTagProcessor(config, page) {
|
|
175961
176114
|
await find_graphql(config, page.script, {
|
|
175962
176115
|
dependency: page.watch_file,
|
|
@@ -175964,7 +176117,7 @@ async function GraphQLTagProcessor(config, page) {
|
|
|
175964
176117
|
const { node, parsedDocument } = tag2;
|
|
175965
176118
|
const operation = config.extractDefinition(parsedDocument);
|
|
175966
176119
|
const { id: id2 } = store_import({ page, artifact: { name: operation.name.value } });
|
|
175967
|
-
node.replaceWith(
|
|
176120
|
+
node.replaceWith(AST20.newExpression(id2, []));
|
|
175968
176121
|
}
|
|
175969
176122
|
});
|
|
175970
176123
|
}
|
|
@@ -175983,7 +176136,7 @@ async function apply_transforms(framework, page) {
|
|
|
175983
176136
|
position = res.position;
|
|
175984
176137
|
useRunes = res.useRunes;
|
|
175985
176138
|
} else {
|
|
175986
|
-
script =
|
|
176139
|
+
script = recast21.types.builders.program([]);
|
|
175987
176140
|
position = { start: 0, end: 0 };
|
|
175988
176141
|
}
|
|
175989
176142
|
} else {
|