houdini-svelte 0.18.2 → 0.19.0
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/codegen/fragmentTypedefs/index.d.ts +2 -0
- package/build/plugin/codegen/stores/custom.d.ts +2 -2
- package/build/plugin/extract.d.ts +2 -2
- package/build/plugin/index.d.ts +5 -9
- package/build/plugin/kit.d.ts +2 -6
- package/build/plugin/transforms/query.d.ts +0 -4
- package/build/plugin-cjs/index.js +1211 -911
- package/build/plugin-esm/index.js +1211 -911
- package/build/preprocess-cjs/index.js +990 -780
- package/build/preprocess-esm/index.js +990 -780
- package/build/test-cjs/index.js +2634 -1891
- package/build/test-esm/index.js +2634 -1891
- package/package.json +8 -8
|
@@ -476,9 +476,9 @@ var require_shared2 = __commonJS({
|
|
|
476
476
|
var tslib_1 = require_tslib2();
|
|
477
477
|
var types_110 = tslib_1.__importDefault(require_types2());
|
|
478
478
|
function default_1(fork) {
|
|
479
|
-
var
|
|
480
|
-
var Type =
|
|
481
|
-
var builtin =
|
|
479
|
+
var types12 = fork.use(types_110.default);
|
|
480
|
+
var Type = types12.Type;
|
|
481
|
+
var builtin = types12.builtInTypes;
|
|
482
482
|
var isNumber2 = builtin.number;
|
|
483
483
|
function geq(than) {
|
|
484
484
|
return Type.from(function(value2) {
|
|
@@ -628,9 +628,9 @@ var require_types2 = __commonJS({
|
|
|
628
628
|
}(BaseType);
|
|
629
629
|
var OrType = function(_super) {
|
|
630
630
|
tslib_1.__extends(OrType2, _super);
|
|
631
|
-
function OrType2(
|
|
631
|
+
function OrType2(types12) {
|
|
632
632
|
var _this = _super.call(this) || this;
|
|
633
|
-
_this.types =
|
|
633
|
+
_this.types = types12;
|
|
634
634
|
_this.kind = "OrType";
|
|
635
635
|
return _this;
|
|
636
636
|
}
|
|
@@ -771,11 +771,11 @@ var require_types2 = __commonJS({
|
|
|
771
771
|
function typesPlugin(_fork) {
|
|
772
772
|
var Type = {
|
|
773
773
|
or: function() {
|
|
774
|
-
var
|
|
774
|
+
var types12 = [];
|
|
775
775
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
776
|
-
|
|
776
|
+
types12[_i] = arguments[_i];
|
|
777
777
|
}
|
|
778
|
-
return new OrType(
|
|
778
|
+
return new OrType(types12.map(function(type) {
|
|
779
779
|
return Type.from(type);
|
|
780
780
|
}));
|
|
781
781
|
},
|
|
@@ -1220,9 +1220,9 @@ var require_path3 = __commonJS({
|
|
|
1220
1220
|
var Op = Object.prototype;
|
|
1221
1221
|
var hasOwn2 = Op.hasOwnProperty;
|
|
1222
1222
|
function pathPlugin(fork) {
|
|
1223
|
-
var
|
|
1224
|
-
var isArray2 =
|
|
1225
|
-
var isNumber2 =
|
|
1223
|
+
var types12 = fork.use(types_110.default);
|
|
1224
|
+
var isArray2 = types12.builtInTypes.array;
|
|
1225
|
+
var isNumber2 = types12.builtInTypes.number;
|
|
1226
1226
|
var Path = function Path2(value2, parentPath, name2) {
|
|
1227
1227
|
if (!(this instanceof Path2)) {
|
|
1228
1228
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -1524,13 +1524,13 @@ var require_scope2 = __commonJS({
|
|
|
1524
1524
|
var types_110 = tslib_1.__importDefault(require_types2());
|
|
1525
1525
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
1526
1526
|
function scopePlugin(fork) {
|
|
1527
|
-
var
|
|
1528
|
-
var Type =
|
|
1529
|
-
var namedTypes =
|
|
1527
|
+
var types12 = fork.use(types_110.default);
|
|
1528
|
+
var Type = types12.Type;
|
|
1529
|
+
var namedTypes = types12.namedTypes;
|
|
1530
1530
|
var Node3 = namedTypes.Node;
|
|
1531
1531
|
var Expression = namedTypes.Expression;
|
|
1532
|
-
var isArray2 =
|
|
1533
|
-
var b =
|
|
1532
|
+
var isArray2 = types12.builtInTypes.array;
|
|
1533
|
+
var b = types12.builders;
|
|
1534
1534
|
var Scope3 = function Scope4(path3, parentScope) {
|
|
1535
1535
|
if (!(this instanceof Scope4)) {
|
|
1536
1536
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -1593,7 +1593,7 @@ var require_scope2 = __commonJS({
|
|
|
1593
1593
|
++index;
|
|
1594
1594
|
}
|
|
1595
1595
|
var name2 = prefix + index;
|
|
1596
|
-
return this.bindings[name2] =
|
|
1596
|
+
return this.bindings[name2] = types12.builders.identifier(name2);
|
|
1597
1597
|
};
|
|
1598
1598
|
Sp.injectTemporary = function(identifier, init) {
|
|
1599
1599
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -1669,7 +1669,7 @@ var require_scope2 = __commonJS({
|
|
|
1669
1669
|
bindings
|
|
1670
1670
|
);
|
|
1671
1671
|
} else if (Node3.check(node2) && !Expression.check(node2)) {
|
|
1672
|
-
|
|
1672
|
+
types12.eachField(node2, function(name2, child) {
|
|
1673
1673
|
var childPath = path3.get(name2);
|
|
1674
1674
|
if (!pathHasValue(childPath, child)) {
|
|
1675
1675
|
throw new Error("");
|
|
@@ -1747,24 +1747,24 @@ var require_scope2 = __commonJS({
|
|
|
1747
1747
|
addPattern(patternPath.get("argument"), bindings);
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
function addTypePattern(patternPath,
|
|
1750
|
+
function addTypePattern(patternPath, types13) {
|
|
1751
1751
|
var pattern = patternPath.value;
|
|
1752
1752
|
namedTypes.Pattern.assert(pattern);
|
|
1753
1753
|
if (namedTypes.Identifier.check(pattern)) {
|
|
1754
|
-
if (hasOwn2.call(
|
|
1755
|
-
|
|
1754
|
+
if (hasOwn2.call(types13, pattern.name)) {
|
|
1755
|
+
types13[pattern.name].push(patternPath);
|
|
1756
1756
|
} else {
|
|
1757
|
-
|
|
1757
|
+
types13[pattern.name] = [patternPath];
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
|
1760
1760
|
}
|
|
1761
|
-
function addTypeParameter(parameterPath,
|
|
1761
|
+
function addTypeParameter(parameterPath, types13) {
|
|
1762
1762
|
var parameter = parameterPath.value;
|
|
1763
1763
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
1764
|
-
if (hasOwn2.call(
|
|
1765
|
-
|
|
1764
|
+
if (hasOwn2.call(types13, parameter.name)) {
|
|
1765
|
+
types13[parameter.name].push(parameterPath);
|
|
1766
1766
|
} else {
|
|
1767
|
-
|
|
1767
|
+
types13[parameter.name] = [parameterPath];
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
1770
|
Sp.lookup = function(name2) {
|
|
@@ -1805,11 +1805,11 @@ var require_node_path2 = __commonJS({
|
|
|
1805
1805
|
var scope_1 = tslib_1.__importDefault(require_scope2());
|
|
1806
1806
|
var shared_1 = require_shared2();
|
|
1807
1807
|
function nodePathPlugin(fork) {
|
|
1808
|
-
var
|
|
1809
|
-
var n2 =
|
|
1810
|
-
var b =
|
|
1811
|
-
var isNumber2 =
|
|
1812
|
-
var isArray2 =
|
|
1808
|
+
var types12 = fork.use(types_110.default);
|
|
1809
|
+
var n2 = types12.namedTypes;
|
|
1810
|
+
var b = types12.builders;
|
|
1811
|
+
var isNumber2 = types12.builtInTypes.number;
|
|
1812
|
+
var isArray2 = types12.builtInTypes.array;
|
|
1813
1813
|
var Path = fork.use(path_1.default);
|
|
1814
1814
|
var Scope3 = fork.use(scope_1.default);
|
|
1815
1815
|
var NodePath = function NodePath2(value2, parentPath, name2) {
|
|
@@ -1900,7 +1900,7 @@ var require_node_path2 = __commonJS({
|
|
|
1900
1900
|
return scope2 || null;
|
|
1901
1901
|
};
|
|
1902
1902
|
NPp.getValueProperty = function(name2) {
|
|
1903
|
-
return
|
|
1903
|
+
return types12.getFieldValue(this.value, name2);
|
|
1904
1904
|
};
|
|
1905
1905
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
1906
1906
|
var pp2 = this.parentPath;
|
|
@@ -2042,7 +2042,7 @@ var require_node_path2 = __commonJS({
|
|
|
2042
2042
|
return node2.some(containsCallExpression);
|
|
2043
2043
|
}
|
|
2044
2044
|
if (n2.Node.check(node2)) {
|
|
2045
|
-
return
|
|
2045
|
+
return types12.someField(node2, function(_name, child) {
|
|
2046
2046
|
return containsCallExpression(child);
|
|
2047
2047
|
});
|
|
2048
2048
|
}
|
|
@@ -2163,11 +2163,11 @@ var require_path_visitor2 = __commonJS({
|
|
|
2163
2163
|
var shared_1 = require_shared2();
|
|
2164
2164
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
2165
2165
|
function pathVisitorPlugin(fork) {
|
|
2166
|
-
var
|
|
2166
|
+
var types12 = fork.use(types_110.default);
|
|
2167
2167
|
var NodePath = fork.use(node_path_1.default);
|
|
2168
|
-
var isArray2 =
|
|
2169
|
-
var isObject3 =
|
|
2170
|
-
var isFunction2 =
|
|
2168
|
+
var isArray2 = types12.builtInTypes.array;
|
|
2169
|
+
var isObject3 = types12.builtInTypes.object;
|
|
2170
|
+
var isFunction2 = types12.builtInTypes.function;
|
|
2171
2171
|
var undefined2;
|
|
2172
2172
|
var PathVisitor = function PathVisitor2() {
|
|
2173
2173
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -2187,7 +2187,7 @@ var require_path_visitor2 = __commonJS({
|
|
|
2187
2187
|
typeNames[methodName.slice("visit".length)] = true;
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
2190
|
-
var supertypeTable =
|
|
2190
|
+
var supertypeTable = types12.computeSupertypeLookupTable(typeNames);
|
|
2191
2191
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
2192
2192
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
2193
2193
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -2306,7 +2306,7 @@ var require_path_visitor2 = __commonJS({
|
|
|
2306
2306
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
2307
2307
|
} else if (!isObject3.check(value2)) {
|
|
2308
2308
|
} else {
|
|
2309
|
-
var childNames =
|
|
2309
|
+
var childNames = types12.getFieldNames(value2);
|
|
2310
2310
|
if (visitor._shouldVisitComments && value2.comments && childNames.indexOf("comments") < 0) {
|
|
2311
2311
|
childNames.push("comments");
|
|
2312
2312
|
}
|
|
@@ -2315,7 +2315,7 @@ var require_path_visitor2 = __commonJS({
|
|
|
2315
2315
|
for (var i3 = 0; i3 < childCount; ++i3) {
|
|
2316
2316
|
var childName = childNames[i3];
|
|
2317
2317
|
if (!hasOwn2.call(value2, childName)) {
|
|
2318
|
-
value2[childName] =
|
|
2318
|
+
value2[childName] = types12.getFieldValue(value2, childName);
|
|
2319
2319
|
}
|
|
2320
2320
|
childPaths.push(path3.get(childName));
|
|
2321
2321
|
}
|
|
@@ -2458,13 +2458,13 @@ var require_equiv2 = __commonJS({
|
|
|
2458
2458
|
var shared_1 = require_shared2();
|
|
2459
2459
|
var types_110 = tslib_1.__importDefault(require_types2());
|
|
2460
2460
|
function default_1(fork) {
|
|
2461
|
-
var
|
|
2462
|
-
var getFieldNames =
|
|
2463
|
-
var getFieldValue =
|
|
2464
|
-
var isArray2 =
|
|
2465
|
-
var isObject3 =
|
|
2466
|
-
var isDate2 =
|
|
2467
|
-
var isRegExp2 =
|
|
2461
|
+
var types12 = fork.use(types_110.default);
|
|
2462
|
+
var getFieldNames = types12.getFieldNames;
|
|
2463
|
+
var getFieldValue = types12.getFieldValue;
|
|
2464
|
+
var isArray2 = types12.builtInTypes.array;
|
|
2465
|
+
var isObject3 = types12.builtInTypes.object;
|
|
2466
|
+
var isDate2 = types12.builtInTypes.Date;
|
|
2467
|
+
var isRegExp2 = types12.builtInTypes.RegExp;
|
|
2468
2468
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
2469
2469
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
2470
2470
|
if (isArray2.check(problemPath)) {
|
|
@@ -2617,24 +2617,24 @@ var require_fork2 = __commonJS({
|
|
|
2617
2617
|
var shared_1 = require_shared2();
|
|
2618
2618
|
function default_1(plugins) {
|
|
2619
2619
|
var fork = createFork();
|
|
2620
|
-
var
|
|
2620
|
+
var types12 = fork.use(types_110.default);
|
|
2621
2621
|
plugins.forEach(fork.use);
|
|
2622
|
-
|
|
2622
|
+
types12.finalize();
|
|
2623
2623
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
2624
2624
|
return {
|
|
2625
|
-
Type:
|
|
2626
|
-
builtInTypes:
|
|
2627
|
-
namedTypes:
|
|
2628
|
-
builders:
|
|
2629
|
-
defineMethod:
|
|
2630
|
-
getFieldNames:
|
|
2631
|
-
getFieldValue:
|
|
2632
|
-
eachField:
|
|
2633
|
-
someField:
|
|
2634
|
-
getSupertypeNames:
|
|
2635
|
-
getBuilderName:
|
|
2625
|
+
Type: types12.Type,
|
|
2626
|
+
builtInTypes: types12.builtInTypes,
|
|
2627
|
+
namedTypes: types12.namedTypes,
|
|
2628
|
+
builders: types12.builders,
|
|
2629
|
+
defineMethod: types12.defineMethod,
|
|
2630
|
+
getFieldNames: types12.getFieldNames,
|
|
2631
|
+
getFieldValue: types12.getFieldValue,
|
|
2632
|
+
eachField: types12.eachField,
|
|
2633
|
+
someField: types12.someField,
|
|
2634
|
+
getSupertypeNames: types12.getSupertypeNames,
|
|
2635
|
+
getBuilderName: types12.getBuilderName,
|
|
2636
2636
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
2637
|
-
finalize:
|
|
2637
|
+
finalize: types12.finalize,
|
|
2638
2638
|
Path: fork.use(path_1.default),
|
|
2639
2639
|
NodePath: fork.use(node_path_1.default),
|
|
2640
2640
|
PathVisitor,
|
|
@@ -2804,8 +2804,8 @@ var require_core4 = __commonJS({
|
|
|
2804
2804
|
var types_110 = tslib_1.__importDefault(require_types2());
|
|
2805
2805
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
2806
2806
|
function default_1(fork) {
|
|
2807
|
-
var
|
|
2808
|
-
var Type =
|
|
2807
|
+
var types12 = fork.use(types_110.default);
|
|
2808
|
+
var Type = types12.Type;
|
|
2809
2809
|
var def = Type.def;
|
|
2810
2810
|
var or = Type.or;
|
|
2811
2811
|
var shared = fork.use(shared_1.default);
|
|
@@ -2897,9 +2897,9 @@ var require_es62 = __commonJS({
|
|
|
2897
2897
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
2898
2898
|
function default_1(fork) {
|
|
2899
2899
|
fork.use(core_1.default);
|
|
2900
|
-
var
|
|
2901
|
-
var def =
|
|
2902
|
-
var or =
|
|
2900
|
+
var types12 = fork.use(types_110.default);
|
|
2901
|
+
var def = types12.Type.def;
|
|
2902
|
+
var or = types12.Type.or;
|
|
2903
2903
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
2904
2904
|
def("Function").field("generator", Boolean, defaults2["false"]).field("expression", Boolean, defaults2["false"]).field("defaults", [or(def("Expression"), null)], defaults2.emptyArray).field("rest", or(def("Identifier"), null), defaults2["null"]);
|
|
2905
2905
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -2989,8 +2989,8 @@ var require_es20172 = __commonJS({
|
|
|
2989
2989
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
2990
2990
|
function default_1(fork) {
|
|
2991
2991
|
fork.use(es2016_1.default);
|
|
2992
|
-
var
|
|
2993
|
-
var def =
|
|
2992
|
+
var types12 = fork.use(types_110.default);
|
|
2993
|
+
var def = types12.Type.def;
|
|
2994
2994
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
2995
2995
|
def("Function").field("async", Boolean, defaults2["false"]);
|
|
2996
2996
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -3013,9 +3013,9 @@ var require_es20182 = __commonJS({
|
|
|
3013
3013
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
3014
3014
|
function default_1(fork) {
|
|
3015
3015
|
fork.use(es2017_1.default);
|
|
3016
|
-
var
|
|
3017
|
-
var def =
|
|
3018
|
-
var or =
|
|
3016
|
+
var types12 = fork.use(types_110.default);
|
|
3017
|
+
var def = types12.Type.def;
|
|
3018
|
+
var or = types12.Type.or;
|
|
3019
3019
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3020
3020
|
def("ForOfStatement").field("await", Boolean, defaults2["false"]);
|
|
3021
3021
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -3046,9 +3046,9 @@ var require_es20192 = __commonJS({
|
|
|
3046
3046
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
3047
3047
|
function default_1(fork) {
|
|
3048
3048
|
fork.use(es2018_1.default);
|
|
3049
|
-
var
|
|
3050
|
-
var def =
|
|
3051
|
-
var or =
|
|
3049
|
+
var types12 = fork.use(types_110.default);
|
|
3050
|
+
var def = types12.Type.def;
|
|
3051
|
+
var or = types12.Type.or;
|
|
3052
3052
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3053
3053
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults2["null"]);
|
|
3054
3054
|
}
|
|
@@ -3072,9 +3072,9 @@ var require_es20204 = __commonJS({
|
|
|
3072
3072
|
function default_1(fork) {
|
|
3073
3073
|
fork.use(es2020_1.default);
|
|
3074
3074
|
fork.use(es2019_1.default);
|
|
3075
|
-
var
|
|
3076
|
-
var def =
|
|
3077
|
-
var or =
|
|
3075
|
+
var types12 = fork.use(types_110.default);
|
|
3076
|
+
var def = types12.Type.def;
|
|
3077
|
+
var or = types12.Type.or;
|
|
3078
3078
|
var shared = fork.use(shared_1.default);
|
|
3079
3079
|
var defaults2 = shared.defaults;
|
|
3080
3080
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -3124,8 +3124,8 @@ var require_es20222 = __commonJS({
|
|
|
3124
3124
|
var shared_1 = require_shared2();
|
|
3125
3125
|
function default_1(fork) {
|
|
3126
3126
|
fork.use(es2021_1.default);
|
|
3127
|
-
var
|
|
3128
|
-
var def =
|
|
3127
|
+
var types12 = fork.use(types_110.default);
|
|
3128
|
+
var def = types12.Type.def;
|
|
3129
3129
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
3130
3130
|
}
|
|
3131
3131
|
exports.default = default_1;
|
|
@@ -3146,9 +3146,9 @@ var require_es_proposals2 = __commonJS({
|
|
|
3146
3146
|
var es2022_1 = tslib_1.__importDefault(require_es20222());
|
|
3147
3147
|
function default_1(fork) {
|
|
3148
3148
|
fork.use(es2022_1.default);
|
|
3149
|
-
var
|
|
3150
|
-
var Type =
|
|
3151
|
-
var def =
|
|
3149
|
+
var types12 = fork.use(types_110.default);
|
|
3150
|
+
var Type = types12.Type;
|
|
3151
|
+
var def = types12.Type.def;
|
|
3152
3152
|
var or = Type.or;
|
|
3153
3153
|
var shared = fork.use(shared_1.default);
|
|
3154
3154
|
var defaults2 = shared.defaults;
|
|
@@ -3188,9 +3188,9 @@ var require_jsx2 = __commonJS({
|
|
|
3188
3188
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
3189
3189
|
function default_1(fork) {
|
|
3190
3190
|
fork.use(es_proposals_1.default);
|
|
3191
|
-
var
|
|
3192
|
-
var def =
|
|
3193
|
-
var or =
|
|
3191
|
+
var types12 = fork.use(types_110.default);
|
|
3192
|
+
var def = types12.Type.def;
|
|
3193
|
+
var or = types12.Type.or;
|
|
3194
3194
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3195
3195
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
3196
3196
|
def("Literal"),
|
|
@@ -3248,9 +3248,9 @@ var require_type_annotations2 = __commonJS({
|
|
|
3248
3248
|
var types_110 = tslib_1.__importDefault(require_types2());
|
|
3249
3249
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
3250
3250
|
function default_1(fork) {
|
|
3251
|
-
var
|
|
3252
|
-
var def =
|
|
3253
|
-
var or =
|
|
3251
|
+
var types12 = fork.use(types_110.default);
|
|
3252
|
+
var def = types12.Type.def;
|
|
3253
|
+
var or = types12.Type.or;
|
|
3254
3254
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3255
3255
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
3256
3256
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -3285,9 +3285,9 @@ var require_flow2 = __commonJS({
|
|
|
3285
3285
|
function default_1(fork) {
|
|
3286
3286
|
fork.use(es_proposals_1.default);
|
|
3287
3287
|
fork.use(type_annotations_1.default);
|
|
3288
|
-
var
|
|
3289
|
-
var def =
|
|
3290
|
-
var or =
|
|
3288
|
+
var types12 = fork.use(types_110.default);
|
|
3289
|
+
var def = types12.Type.def;
|
|
3290
|
+
var or = types12.Type.or;
|
|
3291
3291
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3292
3292
|
def("Flow").bases("Node");
|
|
3293
3293
|
def("FlowType").bases("Flow");
|
|
@@ -3401,10 +3401,10 @@ var require_esprima4 = __commonJS({
|
|
|
3401
3401
|
var shared_1 = tslib_1.__importStar(require_shared2());
|
|
3402
3402
|
function default_1(fork) {
|
|
3403
3403
|
fork.use(es_proposals_1.default);
|
|
3404
|
-
var
|
|
3404
|
+
var types12 = fork.use(types_110.default);
|
|
3405
3405
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3406
|
-
var def =
|
|
3407
|
-
var or =
|
|
3406
|
+
var def = types12.Type.def;
|
|
3407
|
+
var or = types12.Type.or;
|
|
3408
3408
|
def("VariableDeclaration").field("declarations", [or(
|
|
3409
3409
|
def("VariableDeclarator"),
|
|
3410
3410
|
def("Identifier")
|
|
@@ -3449,11 +3449,11 @@ var require_babel_core2 = __commonJS({
|
|
|
3449
3449
|
function default_1(fork) {
|
|
3450
3450
|
var _a, _b, _c, _d, _e;
|
|
3451
3451
|
fork.use(es_proposals_1.default);
|
|
3452
|
-
var
|
|
3452
|
+
var types12 = fork.use(types_110.default);
|
|
3453
3453
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3454
|
-
var def =
|
|
3455
|
-
var or =
|
|
3456
|
-
var isUndefined =
|
|
3454
|
+
var def = types12.Type.def;
|
|
3455
|
+
var or = types12.Type.or;
|
|
3456
|
+
var isUndefined = types12.builtInTypes.undefined;
|
|
3457
3457
|
def("Noop").bases("Statement").build();
|
|
3458
3458
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
3459
3459
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -3478,7 +3478,7 @@ var require_babel_core2 = __commonJS({
|
|
|
3478
3478
|
raw: String
|
|
3479
3479
|
},
|
|
3480
3480
|
function getDefault() {
|
|
3481
|
-
var value2 =
|
|
3481
|
+
var value2 = types12.getFieldValue(this, "value");
|
|
3482
3482
|
return {
|
|
3483
3483
|
rawValue: value2,
|
|
3484
3484
|
raw: toRaw ? toRaw(value2) : String(value2)
|
|
@@ -3581,8 +3581,8 @@ var require_babel2 = __commonJS({
|
|
|
3581
3581
|
var flow_1 = tslib_1.__importDefault(require_flow2());
|
|
3582
3582
|
var shared_1 = require_shared2();
|
|
3583
3583
|
function default_1(fork) {
|
|
3584
|
-
var
|
|
3585
|
-
var def =
|
|
3584
|
+
var types12 = fork.use(types_110.default);
|
|
3585
|
+
var def = types12.Type.def;
|
|
3586
3586
|
fork.use(babel_core_1.default);
|
|
3587
3587
|
fork.use(flow_1.default);
|
|
3588
3588
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -3608,12 +3608,12 @@ var require_typescript2 = __commonJS({
|
|
|
3608
3608
|
function default_1(fork) {
|
|
3609
3609
|
fork.use(babel_core_1.default);
|
|
3610
3610
|
fork.use(type_annotations_1.default);
|
|
3611
|
-
var
|
|
3612
|
-
var n2 =
|
|
3613
|
-
var def =
|
|
3614
|
-
var or =
|
|
3611
|
+
var types12 = fork.use(types_110.default);
|
|
3612
|
+
var n2 = types12.namedTypes;
|
|
3613
|
+
var def = types12.Type.def;
|
|
3614
|
+
var or = types12.Type.or;
|
|
3615
3615
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
3616
|
-
var StringLiteral =
|
|
3616
|
+
var StringLiteral = types12.Type.from(function(value2, deep) {
|
|
3617
3617
|
if (n2.StringLiteral && n2.StringLiteral.check(value2, deep)) {
|
|
3618
3618
|
return true;
|
|
3619
3619
|
}
|
|
@@ -5589,8 +5589,8 @@ var require_util4 = __commonJS({
|
|
|
5589
5589
|
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;
|
|
5590
5590
|
var tslib_1 = require_tslib2();
|
|
5591
5591
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
5592
|
-
var
|
|
5593
|
-
var n2 =
|
|
5592
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
5593
|
+
var n2 = types12.namedTypes;
|
|
5594
5594
|
var source_map_1 = tslib_1.__importDefault(require_source_map2());
|
|
5595
5595
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
5596
5596
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -12908,10 +12908,10 @@ var require_comments2 = __commonJS({
|
|
|
12908
12908
|
exports.printComments = exports.attach = void 0;
|
|
12909
12909
|
var tslib_1 = require_tslib2();
|
|
12910
12910
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
12911
|
-
var
|
|
12912
|
-
var n2 =
|
|
12913
|
-
var isArray2 =
|
|
12914
|
-
var isObject3 =
|
|
12911
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
12912
|
+
var n2 = types12.namedTypes;
|
|
12913
|
+
var isArray2 = types12.builtInTypes.array;
|
|
12914
|
+
var isObject3 = types12.builtInTypes.object;
|
|
12915
12915
|
var lines_1 = require_lines2();
|
|
12916
12916
|
var util_110 = require_util4();
|
|
12917
12917
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -12942,7 +12942,7 @@ var require_comments2 = __commonJS({
|
|
|
12942
12942
|
if (isArray2.check(node2)) {
|
|
12943
12943
|
names = Object.keys(node2);
|
|
12944
12944
|
} else if (isObject3.check(node2)) {
|
|
12945
|
-
names =
|
|
12945
|
+
names = types12.getFieldNames(node2);
|
|
12946
12946
|
} else {
|
|
12947
12947
|
return resultArray;
|
|
12948
12948
|
}
|
|
@@ -13120,7 +13120,7 @@ var require_comments2 = __commonJS({
|
|
|
13120
13120
|
function printComments(path3, print2) {
|
|
13121
13121
|
var value2 = path3.getValue();
|
|
13122
13122
|
var innerLines = print2(path3);
|
|
13123
|
-
var comments = n2.Node.check(value2) &&
|
|
13123
|
+
var comments = n2.Node.check(value2) && types12.getFieldValue(value2, "comments");
|
|
13124
13124
|
if (!comments || comments.length === 0) {
|
|
13125
13125
|
return innerLines;
|
|
13126
13126
|
}
|
|
@@ -13128,8 +13128,8 @@ var require_comments2 = __commonJS({
|
|
|
13128
13128
|
var trailingParts = [innerLines];
|
|
13129
13129
|
path3.each(function(commentPath) {
|
|
13130
13130
|
var comment = commentPath.getValue();
|
|
13131
|
-
var leading =
|
|
13132
|
-
var trailing =
|
|
13131
|
+
var leading = types12.getFieldValue(comment, "leading");
|
|
13132
|
+
var trailing = types12.getFieldValue(comment, "trailing");
|
|
13133
13133
|
if (leading || trailing && !(n2.Statement.check(value2) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
13134
13134
|
leadingParts.push(printLeadingComment(commentPath, print2));
|
|
13135
13135
|
} else if (trailing) {
|
|
@@ -13151,10 +13151,10 @@ var require_parser3 = __commonJS({
|
|
|
13151
13151
|
exports.parse = void 0;
|
|
13152
13152
|
var tslib_1 = require_tslib2();
|
|
13153
13153
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
13154
|
-
var
|
|
13155
|
-
var b =
|
|
13156
|
-
var isObject3 =
|
|
13157
|
-
var isArray2 =
|
|
13154
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
13155
|
+
var b = types12.builders;
|
|
13156
|
+
var isObject3 = types12.builtInTypes.object;
|
|
13157
|
+
var isArray2 = types12.builtInTypes.array;
|
|
13158
13158
|
var options_1 = require_options2();
|
|
13159
13159
|
var lines_1 = require_lines2();
|
|
13160
13160
|
var comments_1 = require_comments2();
|
|
@@ -13340,11 +13340,11 @@ var require_fast_path2 = __commonJS({
|
|
|
13340
13340
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13341
13341
|
var tslib_1 = require_tslib2();
|
|
13342
13342
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
13343
|
-
var
|
|
13343
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
13344
13344
|
var util2 = tslib_1.__importStar(require_util4());
|
|
13345
|
-
var n2 =
|
|
13346
|
-
var isArray2 =
|
|
13347
|
-
var isNumber2 =
|
|
13345
|
+
var n2 = types12.namedTypes;
|
|
13346
|
+
var isArray2 = types12.builtInTypes.array;
|
|
13347
|
+
var isNumber2 = types12.builtInTypes.number;
|
|
13348
13348
|
var PRECEDENCE = {};
|
|
13349
13349
|
[
|
|
13350
13350
|
["??"],
|
|
@@ -13373,7 +13373,7 @@ var require_fast_path2 = __commonJS({
|
|
|
13373
13373
|
if (obj instanceof FastPath) {
|
|
13374
13374
|
return obj.copy();
|
|
13375
13375
|
}
|
|
13376
|
-
if (obj instanceof
|
|
13376
|
+
if (obj instanceof types12.NodePath) {
|
|
13377
13377
|
var copy = Object.create(FastPath.prototype);
|
|
13378
13378
|
var stack = [obj.value];
|
|
13379
13379
|
for (var pp2 = void 0; pp2 = obj.parentPath; obj = pp2)
|
|
@@ -13684,7 +13684,7 @@ var require_fast_path2 = __commonJS({
|
|
|
13684
13684
|
return node2.some(containsCallExpression);
|
|
13685
13685
|
}
|
|
13686
13686
|
if (n2.Node.check(node2)) {
|
|
13687
|
-
return
|
|
13687
|
+
return types12.someField(node2, function(_name, child) {
|
|
13688
13688
|
return containsCallExpression(child);
|
|
13689
13689
|
});
|
|
13690
13690
|
}
|
|
@@ -13774,16 +13774,16 @@ var require_patcher2 = __commonJS({
|
|
|
13774
13774
|
var tslib_1 = require_tslib2();
|
|
13775
13775
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
13776
13776
|
var linesModule = tslib_1.__importStar(require_lines2());
|
|
13777
|
-
var
|
|
13778
|
-
var Printable =
|
|
13779
|
-
var Expression =
|
|
13780
|
-
var ReturnStatement =
|
|
13781
|
-
var SourceLocation3 =
|
|
13777
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
13778
|
+
var Printable = types12.namedTypes.Printable;
|
|
13779
|
+
var Expression = types12.namedTypes.Expression;
|
|
13780
|
+
var ReturnStatement = types12.namedTypes.ReturnStatement;
|
|
13781
|
+
var SourceLocation3 = types12.namedTypes.SourceLocation;
|
|
13782
13782
|
var util_110 = require_util4();
|
|
13783
13783
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path2());
|
|
13784
|
-
var isObject3 =
|
|
13785
|
-
var isArray2 =
|
|
13786
|
-
var isString3 =
|
|
13784
|
+
var isObject3 = types12.builtInTypes.object;
|
|
13785
|
+
var isArray2 = types12.builtInTypes.array;
|
|
13786
|
+
var isString3 = types12.builtInTypes.string;
|
|
13787
13787
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
13788
13788
|
var Patcher = function Patcher2(lines) {
|
|
13789
13789
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -14053,8 +14053,8 @@ var require_patcher2 = __commonJS({
|
|
|
14053
14053
|
if (k.charAt(0) === "_") {
|
|
14054
14054
|
continue;
|
|
14055
14055
|
}
|
|
14056
|
-
newPath.stack.push(k,
|
|
14057
|
-
oldPath.stack.push(k,
|
|
14056
|
+
newPath.stack.push(k, types12.getFieldValue(newNode, k));
|
|
14057
|
+
oldPath.stack.push(k, types12.getFieldValue(oldNode, k));
|
|
14058
14058
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
14059
14059
|
newPath.stack.length -= 2;
|
|
14060
14060
|
oldPath.stack.length -= 2;
|
|
@@ -14078,16 +14078,16 @@ var require_printer3 = __commonJS({
|
|
|
14078
14078
|
exports.Printer = void 0;
|
|
14079
14079
|
var tslib_1 = require_tslib2();
|
|
14080
14080
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
14081
|
-
var
|
|
14081
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
14082
14082
|
var comments_1 = require_comments2();
|
|
14083
14083
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path2());
|
|
14084
14084
|
var lines_1 = require_lines2();
|
|
14085
14085
|
var options_1 = require_options2();
|
|
14086
14086
|
var patcher_1 = require_patcher2();
|
|
14087
14087
|
var util2 = tslib_1.__importStar(require_util4());
|
|
14088
|
-
var namedTypes =
|
|
14089
|
-
var isString3 =
|
|
14090
|
-
var isObject3 =
|
|
14088
|
+
var namedTypes = types12.namedTypes;
|
|
14089
|
+
var isString3 = types12.builtInTypes.string;
|
|
14090
|
+
var isObject3 = types12.builtInTypes.object;
|
|
14091
14091
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
14092
14092
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
14093
14093
|
isString3.assert(code);
|
|
@@ -14249,7 +14249,7 @@ var require_printer3 = __commonJS({
|
|
|
14249
14249
|
case "OptionalMemberExpression": {
|
|
14250
14250
|
parts.push(path3.call(print2, "object"));
|
|
14251
14251
|
var property = path3.call(print2, "property");
|
|
14252
|
-
var optional =
|
|
14252
|
+
var optional = types12.getFieldValue(n2, "optional");
|
|
14253
14253
|
if (n2.computed) {
|
|
14254
14254
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
14255
14255
|
} else {
|
|
@@ -14520,7 +14520,7 @@ var require_printer3 = __commonJS({
|
|
|
14520
14520
|
if (n2.typeArguments) {
|
|
14521
14521
|
parts.push(path3.call(print2, "typeArguments"));
|
|
14522
14522
|
}
|
|
14523
|
-
if (
|
|
14523
|
+
if (types12.getFieldValue(n2, "optional")) {
|
|
14524
14524
|
parts.push("?.");
|
|
14525
14525
|
}
|
|
14526
14526
|
parts.push(printArgumentsList(path3, options, print2));
|
|
@@ -16199,8 +16199,8 @@ var require_printer3 = __commonJS({
|
|
|
16199
16199
|
});
|
|
16200
16200
|
}
|
|
16201
16201
|
function getPossibleRaw(node2) {
|
|
16202
|
-
var value2 =
|
|
16203
|
-
var extra =
|
|
16202
|
+
var value2 = types12.getFieldValue(node2, "value");
|
|
16203
|
+
var extra = types12.getFieldValue(node2, "extra");
|
|
16204
16204
|
if (extra && typeof extra.raw === "string" && value2 == extra.rawValue) {
|
|
16205
16205
|
return extra.raw;
|
|
16206
16206
|
}
|
|
@@ -16248,8 +16248,8 @@ var require_main4 = __commonJS({
|
|
|
16248
16248
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
16249
16249
|
var tslib_1 = require_tslib2();
|
|
16250
16250
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
16251
|
-
var
|
|
16252
|
-
exports.types =
|
|
16251
|
+
var types12 = tslib_1.__importStar(require_main3());
|
|
16252
|
+
exports.types = types12;
|
|
16253
16253
|
var parser_1 = require_parser3();
|
|
16254
16254
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
16255
16255
|
return parser_1.parse;
|
|
@@ -18237,12 +18237,12 @@ var require_parser5 = __commonJS({
|
|
|
18237
18237
|
return [];
|
|
18238
18238
|
}
|
|
18239
18239
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
18240
|
-
var
|
|
18240
|
+
var types12 = [];
|
|
18241
18241
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
18242
18242
|
do {
|
|
18243
|
-
|
|
18243
|
+
types12.push(this.parseNamedType());
|
|
18244
18244
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
18245
|
-
return
|
|
18245
|
+
return types12;
|
|
18246
18246
|
}
|
|
18247
18247
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
18248
18248
|
};
|
|
@@ -18321,13 +18321,13 @@ var require_parser5 = __commonJS({
|
|
|
18321
18321
|
this.expectKeyword("union");
|
|
18322
18322
|
var name2 = this.parseName();
|
|
18323
18323
|
var directives = this.parseDirectives(true);
|
|
18324
|
-
var
|
|
18324
|
+
var types12 = this.parseUnionMemberTypes();
|
|
18325
18325
|
return {
|
|
18326
18326
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
18327
18327
|
description,
|
|
18328
18328
|
name: name2,
|
|
18329
18329
|
directives,
|
|
18330
|
-
types:
|
|
18330
|
+
types: types12,
|
|
18331
18331
|
loc: this.loc(start)
|
|
18332
18332
|
};
|
|
18333
18333
|
};
|
|
@@ -18485,15 +18485,15 @@ var require_parser5 = __commonJS({
|
|
|
18485
18485
|
this.expectKeyword("union");
|
|
18486
18486
|
var name2 = this.parseName();
|
|
18487
18487
|
var directives = this.parseDirectives(true);
|
|
18488
|
-
var
|
|
18489
|
-
if (directives.length === 0 &&
|
|
18488
|
+
var types12 = this.parseUnionMemberTypes();
|
|
18489
|
+
if (directives.length === 0 && types12.length === 0) {
|
|
18490
18490
|
throw this.unexpected();
|
|
18491
18491
|
}
|
|
18492
18492
|
return {
|
|
18493
18493
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
18494
18494
|
name: name2,
|
|
18495
18495
|
directives,
|
|
18496
|
-
types:
|
|
18496
|
+
types: types12,
|
|
18497
18497
|
loc: this.loc(start)
|
|
18498
18498
|
};
|
|
18499
18499
|
};
|
|
@@ -19471,8 +19471,8 @@ var require_printer5 = __commonJS({
|
|
|
19471
19471
|
return join5(["interface", name2, wrap3("implements ", join5(interfaces, " & ")), join5(directives, " "), block3(fields)], " ");
|
|
19472
19472
|
}),
|
|
19473
19473
|
UnionTypeDefinition: addDescription3(function(_ref27) {
|
|
19474
|
-
var name2 = _ref27.name, directives = _ref27.directives,
|
|
19475
|
-
return join5(["union", name2, join5(directives, " "),
|
|
19474
|
+
var name2 = _ref27.name, directives = _ref27.directives, types12 = _ref27.types;
|
|
19475
|
+
return join5(["union", name2, join5(directives, " "), types12 && types12.length !== 0 ? "= " + join5(types12, " | ") : ""], " ");
|
|
19476
19476
|
}),
|
|
19477
19477
|
EnumTypeDefinition: addDescription3(function(_ref28) {
|
|
19478
19478
|
var name2 = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -19507,8 +19507,8 @@ var require_printer5 = __commonJS({
|
|
|
19507
19507
|
return join5(["extend interface", name2, wrap3("implements ", join5(interfaces, " & ")), join5(directives, " "), block3(fields)], " ");
|
|
19508
19508
|
},
|
|
19509
19509
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
19510
|
-
var name2 = _ref36.name, directives = _ref36.directives,
|
|
19511
|
-
return join5(["extend union", name2, join5(directives, " "),
|
|
19510
|
+
var name2 = _ref36.name, directives = _ref36.directives, types12 = _ref36.types;
|
|
19511
|
+
return join5(["extend union", name2, join5(directives, " "), types12 && types12.length !== 0 ? "= " + join5(types12, " | ") : ""], " ");
|
|
19512
19512
|
},
|
|
19513
19513
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
19514
19514
|
var name2 = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -20179,9 +20179,9 @@ var require_definition3 = __commonJS({
|
|
|
20179
20179
|
exports.GraphQLUnionType = GraphQLUnionType;
|
|
20180
20180
|
(0, _defineInspect.default)(GraphQLUnionType);
|
|
20181
20181
|
function defineTypes(config4) {
|
|
20182
|
-
var
|
|
20183
|
-
Array.isArray(
|
|
20184
|
-
return
|
|
20182
|
+
var types12 = resolveThunk(config4.types);
|
|
20183
|
+
Array.isArray(types12) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config4.name, "."));
|
|
20184
|
+
return types12;
|
|
20185
20185
|
}
|
|
20186
20186
|
var GraphQLEnumType = /* @__PURE__ */ function() {
|
|
20187
20187
|
function GraphQLEnumType2(config4) {
|
|
@@ -26019,7 +26019,7 @@ var require_graphql4 = __commonJS({
|
|
|
26019
26019
|
Object.defineProperty(exports, "__esModule", {
|
|
26020
26020
|
value: true
|
|
26021
26021
|
});
|
|
26022
|
-
exports.graphql =
|
|
26022
|
+
exports.graphql = graphql33;
|
|
26023
26023
|
exports.graphqlSync = graphqlSync;
|
|
26024
26024
|
var _isPromise = _interopRequireDefault(require_isPromise3());
|
|
26025
26025
|
var _parser = require_parser5();
|
|
@@ -26029,7 +26029,7 @@ var require_graphql4 = __commonJS({
|
|
|
26029
26029
|
function _interopRequireDefault(obj) {
|
|
26030
26030
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
26031
26031
|
}
|
|
26032
|
-
function
|
|
26032
|
+
function graphql33(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
26033
26033
|
var _arguments = arguments;
|
|
26034
26034
|
return new Promise(function(resolve4) {
|
|
26035
26035
|
return resolve4(
|
|
@@ -27818,7 +27818,7 @@ var require_buildClientSchema3 = __commonJS({
|
|
|
27818
27818
|
return new _definition.GraphQLUnionType({
|
|
27819
27819
|
name: unionIntrospection.name,
|
|
27820
27820
|
description: unionIntrospection.description,
|
|
27821
|
-
types: function
|
|
27821
|
+
types: function types12() {
|
|
27822
27822
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
27823
27823
|
}
|
|
27824
27824
|
});
|
|
@@ -28163,7 +28163,7 @@ var require_extendSchema3 = __commonJS({
|
|
|
28163
28163
|
var config4 = type.toConfig();
|
|
28164
28164
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config4.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
28165
28165
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config4), {}, {
|
|
28166
|
-
types: function
|
|
28166
|
+
types: function types12() {
|
|
28167
28167
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
28168
28168
|
},
|
|
28169
28169
|
extensionASTNodes: config4.extensionASTNodes.concat(extensions)
|
|
@@ -28311,17 +28311,17 @@ var require_extendSchema3 = __commonJS({
|
|
|
28311
28311
|
return interfaces;
|
|
28312
28312
|
}
|
|
28313
28313
|
function buildUnionTypes(nodes) {
|
|
28314
|
-
var
|
|
28314
|
+
var types12 = [];
|
|
28315
28315
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
28316
28316
|
var _node$types;
|
|
28317
28317
|
var node2 = nodes[_i32];
|
|
28318
28318
|
var typeNodes = (_node$types = node2.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
28319
28319
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
28320
28320
|
var type = typeNodes[_i34];
|
|
28321
|
-
|
|
28321
|
+
types12.push(getNamedType(type));
|
|
28322
28322
|
}
|
|
28323
28323
|
}
|
|
28324
|
-
return
|
|
28324
|
+
return types12;
|
|
28325
28325
|
}
|
|
28326
28326
|
function buildType(astNode) {
|
|
28327
28327
|
var _typeExtensionsMap$na;
|
|
@@ -28378,7 +28378,7 @@ var require_extendSchema3 = __commonJS({
|
|
|
28378
28378
|
return new _definition.GraphQLUnionType({
|
|
28379
28379
|
name: name3,
|
|
28380
28380
|
description,
|
|
28381
|
-
types: function
|
|
28381
|
+
types: function types12() {
|
|
28382
28382
|
return buildUnionTypes(_allNodes3);
|
|
28383
28383
|
},
|
|
28384
28384
|
astNode,
|
|
@@ -28676,7 +28676,7 @@ var require_lexicographicSortSchema3 = __commonJS({
|
|
|
28676
28676
|
if ((0, _definition.isUnionType)(type)) {
|
|
28677
28677
|
var _config22 = type.toConfig();
|
|
28678
28678
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
|
|
28679
|
-
types: function
|
|
28679
|
+
types: function types12() {
|
|
28680
28680
|
return sortTypes(_config22.types);
|
|
28681
28681
|
}
|
|
28682
28682
|
}));
|
|
@@ -28761,10 +28761,10 @@ var require_printSchema3 = __commonJS({
|
|
|
28761
28761
|
}
|
|
28762
28762
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
28763
28763
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
28764
|
-
var
|
|
28764
|
+
var types12 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
28765
28765
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
28766
28766
|
return printDirective(directive, options);
|
|
28767
|
-
}),
|
|
28767
|
+
}), types12.map(function(type) {
|
|
28768
28768
|
return printType(type, options);
|
|
28769
28769
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
28770
28770
|
}
|
|
@@ -28839,8 +28839,8 @@ var require_printSchema3 = __commonJS({
|
|
|
28839
28839
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
28840
28840
|
}
|
|
28841
28841
|
function printUnion(type, options) {
|
|
28842
|
-
var
|
|
28843
|
-
var possibleTypes =
|
|
28842
|
+
var types12 = type.getTypes();
|
|
28843
|
+
var possibleTypes = types12.length ? " = " + types12.join(" | ") : "";
|
|
28844
28844
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
28845
28845
|
}
|
|
28846
28846
|
function printEnum(type, options) {
|
|
@@ -92313,6 +92313,44 @@ var ListCollection = class {
|
|
|
92313
92313
|
}
|
|
92314
92314
|
}
|
|
92315
92315
|
};
|
|
92316
|
+
var SchemaManager = class {
|
|
92317
|
+
cache;
|
|
92318
|
+
fieldTypes = {};
|
|
92319
|
+
constructor(cache) {
|
|
92320
|
+
this.cache = cache;
|
|
92321
|
+
}
|
|
92322
|
+
setFieldType({
|
|
92323
|
+
parent,
|
|
92324
|
+
key,
|
|
92325
|
+
type,
|
|
92326
|
+
nullable = false,
|
|
92327
|
+
link
|
|
92328
|
+
}) {
|
|
92329
|
+
let parensIndex = key.indexOf("(");
|
|
92330
|
+
if (parensIndex !== -1) {
|
|
92331
|
+
key = key.substring(0, parensIndex);
|
|
92332
|
+
}
|
|
92333
|
+
if (parent === rootID) {
|
|
92334
|
+
parent = "Query";
|
|
92335
|
+
} else if (parent.includes(":")) {
|
|
92336
|
+
parent = parent.substring(0, parent.indexOf(":"));
|
|
92337
|
+
}
|
|
92338
|
+
if (!this.fieldTypes[parent]) {
|
|
92339
|
+
this.fieldTypes[parent] = {};
|
|
92340
|
+
}
|
|
92341
|
+
this.fieldTypes[parent][key] = {
|
|
92342
|
+
type,
|
|
92343
|
+
nullable,
|
|
92344
|
+
link: !!link
|
|
92345
|
+
};
|
|
92346
|
+
}
|
|
92347
|
+
fieldType(type, field) {
|
|
92348
|
+
return this.fieldTypes[type]?.[field] || null;
|
|
92349
|
+
}
|
|
92350
|
+
get config() {
|
|
92351
|
+
return this.cache._internal_unstable.config;
|
|
92352
|
+
}
|
|
92353
|
+
};
|
|
92316
92354
|
var InMemoryStorage = class {
|
|
92317
92355
|
data;
|
|
92318
92356
|
idCount = 0;
|
|
@@ -92875,7 +92913,7 @@ var InMemorySubscriptions = class {
|
|
|
92875
92913
|
}
|
|
92876
92914
|
}
|
|
92877
92915
|
};
|
|
92878
|
-
var
|
|
92916
|
+
var Cache3 = class {
|
|
92879
92917
|
_internal_unstable;
|
|
92880
92918
|
constructor(config4) {
|
|
92881
92919
|
this._internal_unstable = new CacheInternal({
|
|
@@ -92883,7 +92921,8 @@ var Cache2 = class {
|
|
|
92883
92921
|
storage: new InMemoryStorage(),
|
|
92884
92922
|
subscriptions: new InMemorySubscriptions(this),
|
|
92885
92923
|
lists: new ListManager(this, rootID),
|
|
92886
|
-
lifetimes: new GarbageCollector(this)
|
|
92924
|
+
lifetimes: new GarbageCollector(this),
|
|
92925
|
+
schema: new SchemaManager(this)
|
|
92887
92926
|
});
|
|
92888
92927
|
if (config4) {
|
|
92889
92928
|
this.setConfig(defaultConfigValues(config4));
|
|
@@ -92969,18 +93008,21 @@ var CacheInternal = class {
|
|
|
92969
93008
|
lists;
|
|
92970
93009
|
cache;
|
|
92971
93010
|
lifetimes;
|
|
93011
|
+
schema;
|
|
92972
93012
|
constructor({
|
|
92973
93013
|
storage,
|
|
92974
93014
|
subscriptions,
|
|
92975
93015
|
lists,
|
|
92976
93016
|
cache,
|
|
92977
|
-
lifetimes
|
|
93017
|
+
lifetimes,
|
|
93018
|
+
schema
|
|
92978
93019
|
}) {
|
|
92979
93020
|
this.storage = storage;
|
|
92980
93021
|
this.subscriptions = subscriptions;
|
|
92981
93022
|
this.lists = lists;
|
|
92982
93023
|
this.cache = cache;
|
|
92983
93024
|
this.lifetimes = lifetimes;
|
|
93025
|
+
this.schema = schema;
|
|
92984
93026
|
this._disabled = typeof globalThis.window === "undefined";
|
|
92985
93027
|
try {
|
|
92986
93028
|
if (process.env.HOUDINI_TEST === "true") {
|
|
@@ -92996,7 +93038,6 @@ var CacheInternal = class {
|
|
|
92996
93038
|
data: data2,
|
|
92997
93039
|
selection,
|
|
92998
93040
|
variables = {},
|
|
92999
|
-
root = rootID,
|
|
93000
93041
|
parent = rootID,
|
|
93001
93042
|
applyUpdates = false,
|
|
93002
93043
|
layer,
|
|
@@ -93019,9 +93060,17 @@ var CacheInternal = class {
|
|
|
93019
93060
|
selection: fieldSelection,
|
|
93020
93061
|
operations,
|
|
93021
93062
|
abstract: isAbstract,
|
|
93022
|
-
update
|
|
93063
|
+
update,
|
|
93064
|
+
nullable
|
|
93023
93065
|
} = targetSelection[field];
|
|
93024
93066
|
const key = evaluateKey(keyRaw, variables);
|
|
93067
|
+
this.schema.setFieldType({
|
|
93068
|
+
parent,
|
|
93069
|
+
key: keyRaw,
|
|
93070
|
+
type: linkedType,
|
|
93071
|
+
nullable,
|
|
93072
|
+
link: !!fieldSelection
|
|
93073
|
+
});
|
|
93025
93074
|
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
93026
93075
|
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
93027
93076
|
const displayLayer = layer.isDisplayLayer(displayLayers);
|
|
@@ -93090,7 +93139,6 @@ var CacheInternal = class {
|
|
|
93090
93139
|
}
|
|
93091
93140
|
if (linkedID) {
|
|
93092
93141
|
this.writeSelection({
|
|
93093
|
-
root,
|
|
93094
93142
|
selection: fieldSelection,
|
|
93095
93143
|
parent: linkedID,
|
|
93096
93144
|
data: value2,
|
|
@@ -93479,7 +93527,7 @@ var CacheInternal = class {
|
|
|
93479
93527
|
}
|
|
93480
93528
|
};
|
|
93481
93529
|
var rootID = "_ROOT_";
|
|
93482
|
-
var cache_default = new
|
|
93530
|
+
var cache_default = new Cache3();
|
|
93483
93531
|
var CompiledFragmentKind = "HoudiniFragment";
|
|
93484
93532
|
var CompiledMutationKind = "HoudiniMutation";
|
|
93485
93533
|
var CompiledQueryKind = "HoudiniQuery";
|
|
@@ -93654,6 +93702,7 @@ async function writeFile(filepath, data2) {
|
|
|
93654
93702
|
return;
|
|
93655
93703
|
}
|
|
93656
93704
|
if (houdini_mode.is_testing) {
|
|
93705
|
+
import_memfs.fs.mkdirpSync(dirname(filepath));
|
|
93657
93706
|
return import_memfs.fs.writeFileSync(filepath, data2);
|
|
93658
93707
|
}
|
|
93659
93708
|
return await import_promises.default.writeFile(filepath, data2, "utf8");
|
|
@@ -94969,7 +95018,6 @@ var Config = class {
|
|
|
94969
95018
|
rootDir;
|
|
94970
95019
|
projectRoot;
|
|
94971
95020
|
schema;
|
|
94972
|
-
apiUrl;
|
|
94973
95021
|
schemaPath;
|
|
94974
95022
|
persistedQueryPath;
|
|
94975
95023
|
exclude;
|
|
@@ -95009,7 +95057,6 @@ var Config = class {
|
|
|
95009
95057
|
schema,
|
|
95010
95058
|
schemaPath = "./schema.graphql",
|
|
95011
95059
|
exclude = [],
|
|
95012
|
-
apiUrl,
|
|
95013
95060
|
module: module2 = "esm",
|
|
95014
95061
|
scalars,
|
|
95015
95062
|
cacheBufferSize,
|
|
@@ -95040,11 +95087,6 @@ var Config = class {
|
|
|
95040
95087
|
logLevel = LogLevel.Summary;
|
|
95041
95088
|
}
|
|
95042
95089
|
this.schemaPath = schemaPath;
|
|
95043
|
-
if (apiUrl && apiUrl.startsWith("env:")) {
|
|
95044
|
-
this.apiUrl = process.env[apiUrl.slice("env:".length)];
|
|
95045
|
-
} else {
|
|
95046
|
-
this.apiUrl = apiUrl;
|
|
95047
|
-
}
|
|
95048
95090
|
this.filepath = filepath;
|
|
95049
95091
|
this.exclude = Array.isArray(exclude) ? exclude : [exclude];
|
|
95050
95092
|
this.module = module2;
|
|
@@ -95074,6 +95116,13 @@ var Config = class {
|
|
|
95074
95116
|
};
|
|
95075
95117
|
}
|
|
95076
95118
|
}
|
|
95119
|
+
async apiURL() {
|
|
95120
|
+
if (!this.configFile.apiUrl) {
|
|
95121
|
+
return "";
|
|
95122
|
+
}
|
|
95123
|
+
const env = await this.getEnv();
|
|
95124
|
+
return this.processEnvValues(env, this.configFile.apiUrl);
|
|
95125
|
+
}
|
|
95077
95126
|
get include() {
|
|
95078
95127
|
if (this.configFile.include) {
|
|
95079
95128
|
return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
|
|
@@ -95086,23 +95135,43 @@ var Config = class {
|
|
|
95086
95135
|
pluginConfig(name2) {
|
|
95087
95136
|
return this.configFile.plugins?.[name2] ?? {};
|
|
95088
95137
|
}
|
|
95089
|
-
|
|
95090
|
-
|
|
95138
|
+
async getEnv() {
|
|
95139
|
+
let env = process.env;
|
|
95140
|
+
for (const plugin of this.plugins) {
|
|
95141
|
+
if (plugin.env) {
|
|
95142
|
+
env = {
|
|
95143
|
+
...await plugin.env({ config: this, env })
|
|
95144
|
+
};
|
|
95145
|
+
}
|
|
95146
|
+
}
|
|
95147
|
+
return env;
|
|
95148
|
+
}
|
|
95149
|
+
processEnvValues(env, value2) {
|
|
95150
|
+
let headerValue;
|
|
95151
|
+
if (typeof value2 === "function") {
|
|
95152
|
+
headerValue = value2(env);
|
|
95153
|
+
} else if (value2.startsWith("env:")) {
|
|
95154
|
+
headerValue = env[value2.slice("env:".length)];
|
|
95155
|
+
} else {
|
|
95156
|
+
headerValue = value2;
|
|
95157
|
+
}
|
|
95158
|
+
return headerValue;
|
|
95159
|
+
}
|
|
95160
|
+
async pullHeaders() {
|
|
95161
|
+
const env = await this.getEnv();
|
|
95162
|
+
if (typeof this.schemaPollHeaders === "function") {
|
|
95163
|
+
return this.schemaPollHeaders(env);
|
|
95164
|
+
}
|
|
95165
|
+
const headers = Object.fromEntries(
|
|
95091
95166
|
Object.entries(this.schemaPollHeaders || {}).map(([key, value2]) => {
|
|
95092
|
-
|
|
95093
|
-
if (typeof value2 === "function") {
|
|
95094
|
-
headerValue = value2(process.env);
|
|
95095
|
-
} else if (value2.startsWith("env:")) {
|
|
95096
|
-
headerValue = process.env[value2.slice("env:".length)];
|
|
95097
|
-
} else {
|
|
95098
|
-
headerValue = value2;
|
|
95099
|
-
}
|
|
95167
|
+
const headerValue = this.processEnvValues(env, value2);
|
|
95100
95168
|
if (!headerValue) {
|
|
95101
95169
|
return [];
|
|
95102
95170
|
}
|
|
95103
95171
|
return [key, headerValue];
|
|
95104
|
-
})
|
|
95172
|
+
}).filter(([key]) => key)
|
|
95105
95173
|
);
|
|
95174
|
+
return headers;
|
|
95106
95175
|
}
|
|
95107
95176
|
async sourceFiles() {
|
|
95108
95177
|
return [
|
|
@@ -95508,9 +95577,10 @@ async function getConfig({
|
|
|
95508
95577
|
...extraConfig,
|
|
95509
95578
|
filepath: configPath
|
|
95510
95579
|
});
|
|
95580
|
+
const apiURL = await _config.apiURL();
|
|
95511
95581
|
if (_config.schemaPath && !_config.schema) {
|
|
95512
95582
|
let schemaOk = true;
|
|
95513
|
-
if (
|
|
95583
|
+
if (apiURL) {
|
|
95514
95584
|
if (glob.hasMagic(_config.schemaPath)) {
|
|
95515
95585
|
console.log(
|
|
95516
95586
|
`\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
|
|
@@ -95518,7 +95588,7 @@ This will prevent your schema from being pulled.`
|
|
|
95518
95588
|
);
|
|
95519
95589
|
} else if (!await readFile(_config.schemaPath)) {
|
|
95520
95590
|
console.log("\u231B Pulling schema from api");
|
|
95521
|
-
schemaOk = await pullSchema(
|
|
95591
|
+
schemaOk = await pullSchema(apiURL, _config.schemaPath);
|
|
95522
95592
|
}
|
|
95523
95593
|
}
|
|
95524
95594
|
if (schemaOk && !noSchema) {
|
|
@@ -95529,10 +95599,11 @@ This will prevent your schema from being pulled.`
|
|
|
95529
95599
|
reject(e22);
|
|
95530
95600
|
throw e22;
|
|
95531
95601
|
}
|
|
95602
|
+
const plugins = [];
|
|
95532
95603
|
for (const [pluginName, plugin_config2] of Object.entries(_config.configFile.plugins ?? {})) {
|
|
95533
95604
|
try {
|
|
95534
95605
|
const pluginDirectory = _config.findModule(pluginName);
|
|
95535
|
-
const { default:
|
|
95606
|
+
const { default: pluginFactory } = await import((0, import_url.pathToFileURL)(pluginDirectory).toString() + "/build/plugin-esm/index.js");
|
|
95536
95607
|
let include_runtime = false;
|
|
95537
95608
|
try {
|
|
95538
95609
|
await stat(join2(pluginDirectory, "build", "runtime-esm"));
|
|
@@ -95549,8 +95620,8 @@ This will prevent your schema from being pulled.`
|
|
|
95549
95620
|
version2 = packageJSON.version;
|
|
95550
95621
|
} catch {
|
|
95551
95622
|
}
|
|
95552
|
-
|
|
95553
|
-
...await
|
|
95623
|
+
plugins.push({
|
|
95624
|
+
...await pluginFactory(plugin_config2),
|
|
95554
95625
|
name: pluginName,
|
|
95555
95626
|
include_runtime,
|
|
95556
95627
|
version: version2,
|
|
@@ -95562,6 +95633,7 @@ This will prevent your schema from being pulled.`
|
|
|
95562
95633
|
);
|
|
95563
95634
|
}
|
|
95564
95635
|
}
|
|
95636
|
+
_config.plugins = orderedPlugins(plugins);
|
|
95565
95637
|
await Promise.all(_config.plugins.map((plugin) => plugin.after_load?.(_config)));
|
|
95566
95638
|
resolve22(_config);
|
|
95567
95639
|
return _config;
|
|
@@ -95573,6 +95645,16 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
95573
95645
|
LogLevel2["Quiet"] = "quiet";
|
|
95574
95646
|
return LogLevel2;
|
|
95575
95647
|
})(LogLevel || {});
|
|
95648
|
+
var orderedPlugins = (plugins) => {
|
|
95649
|
+
const ordered = plugins.filter(
|
|
95650
|
+
(plugin) => plugin.order === "before" || plugin.order === void 0
|
|
95651
|
+
);
|
|
95652
|
+
ordered.push(
|
|
95653
|
+
...plugins.filter((plugin) => plugin.order === "core"),
|
|
95654
|
+
...plugins.filter((plugin) => plugin.order === "after")
|
|
95655
|
+
);
|
|
95656
|
+
return ordered;
|
|
95657
|
+
};
|
|
95576
95658
|
var graphql3 = __toESM2(require_graphql2(), 1);
|
|
95577
95659
|
function formatErrors(e22, afterError) {
|
|
95578
95660
|
const errors = Array.isArray(e22) ? e22 : [e22];
|
|
@@ -95722,53 +95804,75 @@ var graphql4 = __toESM2(require_graphql2(), 1);
|
|
|
95722
95804
|
async function find_graphql(config4, parsedScript, walker) {
|
|
95723
95805
|
await asyncWalk(parsedScript, {
|
|
95724
95806
|
async enter(node2, parent) {
|
|
95725
|
-
if (node2.type
|
|
95807
|
+
if (node2.type !== "TaggedTemplateExpression" && node2.type !== "CallExpression") {
|
|
95808
|
+
return;
|
|
95809
|
+
}
|
|
95810
|
+
let documentString;
|
|
95811
|
+
if (node2.type === "TaggedTemplateExpression") {
|
|
95726
95812
|
const expr = node2;
|
|
95727
|
-
|
|
95728
|
-
const parsedTag = graphql4.parse(tagContent);
|
|
95729
|
-
if (walker.where && !walker.where(parsedTag)) {
|
|
95813
|
+
if (expr.tag.type !== "Identifier" || expr.tag.name !== "graphql") {
|
|
95730
95814
|
return;
|
|
95731
95815
|
}
|
|
95732
|
-
|
|
95733
|
-
|
|
95734
|
-
|
|
95735
|
-
|
|
95816
|
+
documentString = expr.quasi.quasis[0].value.raw;
|
|
95817
|
+
} else if (node2.type === "CallExpression") {
|
|
95818
|
+
const expr = node2;
|
|
95819
|
+
if (expr.callee.type !== "Identifier" || expr.callee.name !== "graphql" || expr.arguments.length !== 1) {
|
|
95820
|
+
return;
|
|
95736
95821
|
}
|
|
95737
|
-
|
|
95738
|
-
if (
|
|
95739
|
-
|
|
95822
|
+
const argument = expr.arguments[0];
|
|
95823
|
+
if (argument.type === "TemplateLiteral") {
|
|
95824
|
+
documentString = argument.quasis[0].value.raw;
|
|
95825
|
+
} else if (argument.type === "StringLiteral") {
|
|
95826
|
+
documentString = argument.value;
|
|
95740
95827
|
} else {
|
|
95741
|
-
|
|
95742
|
-
|
|
95743
|
-
|
|
95744
|
-
|
|
95745
|
-
|
|
95746
|
-
|
|
95747
|
-
|
|
95828
|
+
return;
|
|
95829
|
+
}
|
|
95830
|
+
} else {
|
|
95831
|
+
return;
|
|
95832
|
+
}
|
|
95833
|
+
const parsedTag = graphql4.parse(documentString);
|
|
95834
|
+
if (walker.where && !walker.where(parsedTag)) {
|
|
95835
|
+
return;
|
|
95836
|
+
}
|
|
95837
|
+
const definition = config4.extractDefinition(parsedTag);
|
|
95838
|
+
const name2 = definition.name?.value;
|
|
95839
|
+
if (!name2) {
|
|
95840
|
+
throw new Error("Could not find definition name");
|
|
95841
|
+
}
|
|
95842
|
+
let kind;
|
|
95843
|
+
if (definition.kind === "FragmentDefinition") {
|
|
95844
|
+
kind = CompiledFragmentKind;
|
|
95845
|
+
} else {
|
|
95846
|
+
if (definition.operation === "query") {
|
|
95847
|
+
kind = CompiledQueryKind;
|
|
95848
|
+
} else if (definition.operation === "mutation") {
|
|
95849
|
+
kind = CompiledMutationKind;
|
|
95850
|
+
} else {
|
|
95851
|
+
kind = CompiledSubscriptionKind;
|
|
95748
95852
|
}
|
|
95749
|
-
walker.dependency?.(config4.artifactPath(parsedTag));
|
|
95750
|
-
await walker.tag({
|
|
95751
|
-
parsedDocument: parsedTag,
|
|
95752
|
-
node: {
|
|
95753
|
-
...node2,
|
|
95754
|
-
...this,
|
|
95755
|
-
remove: this.remove,
|
|
95756
|
-
replaceWith: this.replace
|
|
95757
|
-
},
|
|
95758
|
-
artifact: {
|
|
95759
|
-
name: name2,
|
|
95760
|
-
kind
|
|
95761
|
-
},
|
|
95762
|
-
parent,
|
|
95763
|
-
tagContent
|
|
95764
|
-
});
|
|
95765
95853
|
}
|
|
95854
|
+
walker.dependency?.(config4.artifactPath(parsedTag));
|
|
95855
|
+
await walker.tag({
|
|
95856
|
+
parsedDocument: parsedTag,
|
|
95857
|
+
node: {
|
|
95858
|
+
...node2,
|
|
95859
|
+
...this,
|
|
95860
|
+
remove: this.remove,
|
|
95861
|
+
replaceWith: this.replace
|
|
95862
|
+
},
|
|
95863
|
+
artifact: {
|
|
95864
|
+
name: name2,
|
|
95865
|
+
kind
|
|
95866
|
+
},
|
|
95867
|
+
parent,
|
|
95868
|
+
tagContent: documentString
|
|
95869
|
+
});
|
|
95766
95870
|
}
|
|
95767
95871
|
});
|
|
95768
95872
|
}
|
|
95769
95873
|
|
|
95770
95874
|
// src/plugin/transforms/index.ts
|
|
95771
|
-
var
|
|
95875
|
+
var recast21 = __toESM(require_main4(), 1);
|
|
95772
95876
|
|
|
95773
95877
|
// ../../node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/compiler.mjs
|
|
95774
95878
|
var now = typeof process !== "undefined" && process.hrtime ? () => {
|
|
@@ -128402,7 +128506,7 @@ var require_kinds2 = __commonJS3({
|
|
|
128402
128506
|
value: true
|
|
128403
128507
|
});
|
|
128404
128508
|
exports.Kind = void 0;
|
|
128405
|
-
var
|
|
128509
|
+
var Kind30 = Object.freeze({
|
|
128406
128510
|
NAME: "Name",
|
|
128407
128511
|
DOCUMENT: "Document",
|
|
128408
128512
|
OPERATION_DEFINITION: "OperationDefinition",
|
|
@@ -128447,7 +128551,7 @@ var require_kinds2 = __commonJS3({
|
|
|
128447
128551
|
ENUM_TYPE_EXTENSION: "EnumTypeExtension",
|
|
128448
128552
|
INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"
|
|
128449
128553
|
});
|
|
128450
|
-
exports.Kind =
|
|
128554
|
+
exports.Kind = Kind30;
|
|
128451
128555
|
}
|
|
128452
128556
|
});
|
|
128453
128557
|
var require_invariant2 = __commonJS3({
|
|
@@ -129819,12 +129923,12 @@ var require_parser4 = __commonJS3({
|
|
|
129819
129923
|
return [];
|
|
129820
129924
|
}
|
|
129821
129925
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
129822
|
-
var
|
|
129926
|
+
var types17 = [];
|
|
129823
129927
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
129824
129928
|
do {
|
|
129825
|
-
|
|
129929
|
+
types17.push(this.parseNamedType());
|
|
129826
129930
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
129827
|
-
return
|
|
129931
|
+
return types17;
|
|
129828
129932
|
}
|
|
129829
129933
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
129830
129934
|
};
|
|
@@ -129903,13 +130007,13 @@ var require_parser4 = __commonJS3({
|
|
|
129903
130007
|
this.expectKeyword("union");
|
|
129904
130008
|
var name2 = this.parseName();
|
|
129905
130009
|
var directives = this.parseDirectives(true);
|
|
129906
|
-
var
|
|
130010
|
+
var types17 = this.parseUnionMemberTypes();
|
|
129907
130011
|
return {
|
|
129908
130012
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
129909
130013
|
description,
|
|
129910
130014
|
name: name2,
|
|
129911
130015
|
directives,
|
|
129912
|
-
types:
|
|
130016
|
+
types: types17,
|
|
129913
130017
|
loc: this.loc(start)
|
|
129914
130018
|
};
|
|
129915
130019
|
};
|
|
@@ -130067,15 +130171,15 @@ var require_parser4 = __commonJS3({
|
|
|
130067
130171
|
this.expectKeyword("union");
|
|
130068
130172
|
var name2 = this.parseName();
|
|
130069
130173
|
var directives = this.parseDirectives(true);
|
|
130070
|
-
var
|
|
130071
|
-
if (directives.length === 0 &&
|
|
130174
|
+
var types17 = this.parseUnionMemberTypes();
|
|
130175
|
+
if (directives.length === 0 && types17.length === 0) {
|
|
130072
130176
|
throw this.unexpected();
|
|
130073
130177
|
}
|
|
130074
130178
|
return {
|
|
130075
130179
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
130076
130180
|
name: name2,
|
|
130077
130181
|
directives,
|
|
130078
|
-
types:
|
|
130182
|
+
types: types17,
|
|
130079
130183
|
loc: this.loc(start)
|
|
130080
130184
|
};
|
|
130081
130185
|
};
|
|
@@ -130243,7 +130347,7 @@ var require_visitor2 = __commonJS3({
|
|
|
130243
130347
|
Object.defineProperty(exports, "__esModule", {
|
|
130244
130348
|
value: true
|
|
130245
130349
|
});
|
|
130246
|
-
exports.visit =
|
|
130350
|
+
exports.visit = visit13;
|
|
130247
130351
|
exports.visitInParallel = visitInParallel;
|
|
130248
130352
|
exports.getVisitFn = getVisitFn;
|
|
130249
130353
|
exports.BREAK = exports.QueryDocumentKeys = void 0;
|
|
@@ -130306,7 +130410,7 @@ var require_visitor2 = __commonJS3({
|
|
|
130306
130410
|
exports.QueryDocumentKeys = QueryDocumentKeys;
|
|
130307
130411
|
var BREAK = Object.freeze({});
|
|
130308
130412
|
exports.BREAK = BREAK;
|
|
130309
|
-
function
|
|
130413
|
+
function visit13(root, visitor) {
|
|
130310
130414
|
var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
|
|
130311
130415
|
var stack = void 0;
|
|
130312
130416
|
var inArray = Array.isArray(root);
|
|
@@ -131023,8 +131127,8 @@ var require_printer4 = __commonJS3({
|
|
|
131023
131127
|
return join32(["interface", name2, wrap22("implements ", join32(interfaces, " & ")), join32(directives, " "), block22(fields)], " ");
|
|
131024
131128
|
}),
|
|
131025
131129
|
UnionTypeDefinition: addDescription22(function(_ref27) {
|
|
131026
|
-
var name2 = _ref27.name, directives = _ref27.directives,
|
|
131027
|
-
return join32(["union", name2, join32(directives, " "),
|
|
131130
|
+
var name2 = _ref27.name, directives = _ref27.directives, types17 = _ref27.types;
|
|
131131
|
+
return join32(["union", name2, join32(directives, " "), types17 && types17.length !== 0 ? "= " + join32(types17, " | ") : ""], " ");
|
|
131028
131132
|
}),
|
|
131029
131133
|
EnumTypeDefinition: addDescription22(function(_ref28) {
|
|
131030
131134
|
var name2 = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -131059,8 +131163,8 @@ var require_printer4 = __commonJS3({
|
|
|
131059
131163
|
return join32(["extend interface", name2, wrap22("implements ", join32(interfaces, " & ")), join32(directives, " "), block22(fields)], " ");
|
|
131060
131164
|
},
|
|
131061
131165
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
131062
|
-
var name2 = _ref36.name, directives = _ref36.directives,
|
|
131063
|
-
return join32(["extend union", name2, join32(directives, " "),
|
|
131166
|
+
var name2 = _ref36.name, directives = _ref36.directives, types17 = _ref36.types;
|
|
131167
|
+
return join32(["extend union", name2, join32(directives, " "), types17 && types17.length !== 0 ? "= " + join32(types17, " | ") : ""], " ");
|
|
131064
131168
|
},
|
|
131065
131169
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
131066
131170
|
var name2 = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -131152,17 +131256,17 @@ var require_definition2 = __commonJS3({
|
|
|
131152
131256
|
});
|
|
131153
131257
|
exports.isType = isType;
|
|
131154
131258
|
exports.assertType = assertType;
|
|
131155
|
-
exports.isScalarType =
|
|
131259
|
+
exports.isScalarType = isScalarType13;
|
|
131156
131260
|
exports.assertScalarType = assertScalarType;
|
|
131157
|
-
exports.isObjectType =
|
|
131261
|
+
exports.isObjectType = isObjectType12;
|
|
131158
131262
|
exports.assertObjectType = assertObjectType;
|
|
131159
131263
|
exports.isInterfaceType = isInterfaceType12;
|
|
131160
131264
|
exports.assertInterfaceType = assertInterfaceType;
|
|
131161
131265
|
exports.isUnionType = isUnionType13;
|
|
131162
131266
|
exports.assertUnionType = assertUnionType;
|
|
131163
|
-
exports.isEnumType =
|
|
131267
|
+
exports.isEnumType = isEnumType10;
|
|
131164
131268
|
exports.assertEnumType = assertEnumType;
|
|
131165
|
-
exports.isInputObjectType =
|
|
131269
|
+
exports.isInputObjectType = isInputObjectType8;
|
|
131166
131270
|
exports.assertInputObjectType = assertInputObjectType;
|
|
131167
131271
|
exports.isListType = isListType8;
|
|
131168
131272
|
exports.assertListType = assertListType;
|
|
@@ -131176,7 +131280,7 @@ var require_definition2 = __commonJS3({
|
|
|
131176
131280
|
exports.assertLeafType = assertLeafType;
|
|
131177
131281
|
exports.isCompositeType = isCompositeType;
|
|
131178
131282
|
exports.assertCompositeType = assertCompositeType;
|
|
131179
|
-
exports.isAbstractType =
|
|
131283
|
+
exports.isAbstractType = isAbstractType3;
|
|
131180
131284
|
exports.assertAbstractType = assertAbstractType;
|
|
131181
131285
|
exports.GraphQLList = GraphQLList6;
|
|
131182
131286
|
exports.GraphQLNonNull = GraphQLNonNull6;
|
|
@@ -131231,7 +131335,7 @@ var require_definition2 = __commonJS3({
|
|
|
131231
131335
|
return Constructor;
|
|
131232
131336
|
}
|
|
131233
131337
|
function isType(type) {
|
|
131234
|
-
return
|
|
131338
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
131235
131339
|
}
|
|
131236
131340
|
function assertType(type) {
|
|
131237
131341
|
if (!isType(type)) {
|
|
@@ -131239,20 +131343,20 @@ var require_definition2 = __commonJS3({
|
|
|
131239
131343
|
}
|
|
131240
131344
|
return type;
|
|
131241
131345
|
}
|
|
131242
|
-
function
|
|
131346
|
+
function isScalarType13(type) {
|
|
131243
131347
|
return (0, _instanceOf.default)(type, GraphQLScalarType4);
|
|
131244
131348
|
}
|
|
131245
131349
|
function assertScalarType(type) {
|
|
131246
|
-
if (!
|
|
131350
|
+
if (!isScalarType13(type)) {
|
|
131247
131351
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type."));
|
|
131248
131352
|
}
|
|
131249
131353
|
return type;
|
|
131250
131354
|
}
|
|
131251
|
-
function
|
|
131355
|
+
function isObjectType12(type) {
|
|
131252
131356
|
return (0, _instanceOf.default)(type, GraphQLObjectType6);
|
|
131253
131357
|
}
|
|
131254
131358
|
function assertObjectType(type) {
|
|
131255
|
-
if (!
|
|
131359
|
+
if (!isObjectType12(type)) {
|
|
131256
131360
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type."));
|
|
131257
131361
|
}
|
|
131258
131362
|
return type;
|
|
@@ -131275,20 +131379,20 @@ var require_definition2 = __commonJS3({
|
|
|
131275
131379
|
}
|
|
131276
131380
|
return type;
|
|
131277
131381
|
}
|
|
131278
|
-
function
|
|
131382
|
+
function isEnumType10(type) {
|
|
131279
131383
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
131280
131384
|
}
|
|
131281
131385
|
function assertEnumType(type) {
|
|
131282
|
-
if (!
|
|
131386
|
+
if (!isEnumType10(type)) {
|
|
131283
131387
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
131284
131388
|
}
|
|
131285
131389
|
return type;
|
|
131286
131390
|
}
|
|
131287
|
-
function
|
|
131391
|
+
function isInputObjectType8(type) {
|
|
131288
131392
|
return (0, _instanceOf.default)(type, GraphQLInputObjectType4);
|
|
131289
131393
|
}
|
|
131290
131394
|
function assertInputObjectType(type) {
|
|
131291
|
-
if (!
|
|
131395
|
+
if (!isInputObjectType8(type)) {
|
|
131292
131396
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type."));
|
|
131293
131397
|
}
|
|
131294
131398
|
return type;
|
|
@@ -131312,7 +131416,7 @@ var require_definition2 = __commonJS3({
|
|
|
131312
131416
|
return type;
|
|
131313
131417
|
}
|
|
131314
131418
|
function isInputType(type) {
|
|
131315
|
-
return
|
|
131419
|
+
return isScalarType13(type) || isEnumType10(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
131316
131420
|
}
|
|
131317
131421
|
function assertInputType(type) {
|
|
131318
131422
|
if (!isInputType(type)) {
|
|
@@ -131321,7 +131425,7 @@ var require_definition2 = __commonJS3({
|
|
|
131321
131425
|
return type;
|
|
131322
131426
|
}
|
|
131323
131427
|
function isOutputType(type) {
|
|
131324
|
-
return
|
|
131428
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
131325
131429
|
}
|
|
131326
131430
|
function assertOutputType(type) {
|
|
131327
131431
|
if (!isOutputType(type)) {
|
|
@@ -131330,7 +131434,7 @@ var require_definition2 = __commonJS3({
|
|
|
131330
131434
|
return type;
|
|
131331
131435
|
}
|
|
131332
131436
|
function isLeafType4(type) {
|
|
131333
|
-
return
|
|
131437
|
+
return isScalarType13(type) || isEnumType10(type);
|
|
131334
131438
|
}
|
|
131335
131439
|
function assertLeafType(type) {
|
|
131336
131440
|
if (!isLeafType4(type)) {
|
|
@@ -131339,7 +131443,7 @@ var require_definition2 = __commonJS3({
|
|
|
131339
131443
|
return type;
|
|
131340
131444
|
}
|
|
131341
131445
|
function isCompositeType(type) {
|
|
131342
|
-
return
|
|
131446
|
+
return isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type);
|
|
131343
131447
|
}
|
|
131344
131448
|
function assertCompositeType(type) {
|
|
131345
131449
|
if (!isCompositeType(type)) {
|
|
@@ -131347,11 +131451,11 @@ var require_definition2 = __commonJS3({
|
|
|
131347
131451
|
}
|
|
131348
131452
|
return type;
|
|
131349
131453
|
}
|
|
131350
|
-
function
|
|
131454
|
+
function isAbstractType3(type) {
|
|
131351
131455
|
return isInterfaceType12(type) || isUnionType13(type);
|
|
131352
131456
|
}
|
|
131353
131457
|
function assertAbstractType(type) {
|
|
131354
|
-
if (!
|
|
131458
|
+
if (!isAbstractType3(type)) {
|
|
131355
131459
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
|
|
131356
131460
|
}
|
|
131357
131461
|
return type;
|
|
@@ -131418,7 +131522,7 @@ var require_definition2 = __commonJS3({
|
|
|
131418
131522
|
}
|
|
131419
131523
|
}
|
|
131420
131524
|
function isNamedType4(type) {
|
|
131421
|
-
return
|
|
131525
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type);
|
|
131422
131526
|
}
|
|
131423
131527
|
function assertNamedType(type) {
|
|
131424
131528
|
if (!isNamedType4(type)) {
|
|
@@ -131727,9 +131831,9 @@ var require_definition2 = __commonJS3({
|
|
|
131727
131831
|
exports.GraphQLUnionType = GraphQLUnionType3;
|
|
131728
131832
|
(0, _defineInspect.default)(GraphQLUnionType3);
|
|
131729
131833
|
function defineTypes(config4) {
|
|
131730
|
-
var
|
|
131731
|
-
Array.isArray(
|
|
131732
|
-
return
|
|
131834
|
+
var types17 = resolveThunk(config4.types);
|
|
131835
|
+
Array.isArray(types17) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config4.name, "."));
|
|
131836
|
+
return types17;
|
|
131733
131837
|
}
|
|
131734
131838
|
var GraphQLEnumType4 = /* @__PURE__ */ function() {
|
|
131735
131839
|
function GraphQLEnumType5(config4) {
|
|
@@ -137445,7 +137549,7 @@ var require_graphql3 = __commonJS3({
|
|
|
137445
137549
|
Object.defineProperty(exports, "__esModule", {
|
|
137446
137550
|
value: true
|
|
137447
137551
|
});
|
|
137448
|
-
exports.graphql =
|
|
137552
|
+
exports.graphql = graphql302;
|
|
137449
137553
|
exports.graphqlSync = graphqlSync;
|
|
137450
137554
|
var _isPromise = _interopRequireDefault(require_isPromise2());
|
|
137451
137555
|
var _parser = require_parser4();
|
|
@@ -137455,7 +137559,7 @@ var require_graphql3 = __commonJS3({
|
|
|
137455
137559
|
function _interopRequireDefault(obj) {
|
|
137456
137560
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
137457
137561
|
}
|
|
137458
|
-
function
|
|
137562
|
+
function graphql302(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
137459
137563
|
var _arguments = arguments;
|
|
137460
137564
|
return new Promise(function(resolve22) {
|
|
137461
137565
|
return resolve22(
|
|
@@ -139212,7 +139316,7 @@ var require_buildClientSchema2 = __commonJS3({
|
|
|
139212
139316
|
return new _definition.GraphQLUnionType({
|
|
139213
139317
|
name: unionIntrospection.name,
|
|
139214
139318
|
description: unionIntrospection.description,
|
|
139215
|
-
types: function
|
|
139319
|
+
types: function types17() {
|
|
139216
139320
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
139217
139321
|
}
|
|
139218
139322
|
});
|
|
@@ -139555,7 +139659,7 @@ var require_extendSchema2 = __commonJS3({
|
|
|
139555
139659
|
var config4 = type.toConfig();
|
|
139556
139660
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config4.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
139557
139661
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config4), {}, {
|
|
139558
|
-
types: function
|
|
139662
|
+
types: function types17() {
|
|
139559
139663
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
139560
139664
|
},
|
|
139561
139665
|
extensionASTNodes: config4.extensionASTNodes.concat(extensions)
|
|
@@ -139703,17 +139807,17 @@ var require_extendSchema2 = __commonJS3({
|
|
|
139703
139807
|
return interfaces;
|
|
139704
139808
|
}
|
|
139705
139809
|
function buildUnionTypes(nodes) {
|
|
139706
|
-
var
|
|
139810
|
+
var types17 = [];
|
|
139707
139811
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
139708
139812
|
var _node$types;
|
|
139709
139813
|
var node2 = nodes[_i32];
|
|
139710
139814
|
var typeNodes = (_node$types = node2.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
139711
139815
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
139712
139816
|
var type = typeNodes[_i34];
|
|
139713
|
-
|
|
139817
|
+
types17.push(getNamedType5(type));
|
|
139714
139818
|
}
|
|
139715
139819
|
}
|
|
139716
|
-
return
|
|
139820
|
+
return types17;
|
|
139717
139821
|
}
|
|
139718
139822
|
function buildType(astNode) {
|
|
139719
139823
|
var _typeExtensionsMap$na;
|
|
@@ -139770,7 +139874,7 @@ var require_extendSchema2 = __commonJS3({
|
|
|
139770
139874
|
return new _definition.GraphQLUnionType({
|
|
139771
139875
|
name: name3,
|
|
139772
139876
|
description,
|
|
139773
|
-
types: function
|
|
139877
|
+
types: function types17() {
|
|
139774
139878
|
return buildUnionTypes(_allNodes3);
|
|
139775
139879
|
},
|
|
139776
139880
|
astNode,
|
|
@@ -140064,7 +140168,7 @@ var require_lexicographicSortSchema2 = __commonJS3({
|
|
|
140064
140168
|
if ((0, _definition.isUnionType)(type)) {
|
|
140065
140169
|
var _config22 = type.toConfig();
|
|
140066
140170
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
|
|
140067
|
-
types: function
|
|
140171
|
+
types: function types17() {
|
|
140068
140172
|
return sortTypes(_config22.types);
|
|
140069
140173
|
}
|
|
140070
140174
|
}));
|
|
@@ -140147,10 +140251,10 @@ var require_printSchema2 = __commonJS3({
|
|
|
140147
140251
|
}
|
|
140148
140252
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
140149
140253
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
140150
|
-
var
|
|
140254
|
+
var types17 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
140151
140255
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
140152
140256
|
return printDirective(directive, options);
|
|
140153
|
-
}),
|
|
140257
|
+
}), types17.map(function(type) {
|
|
140154
140258
|
return printType(type, options);
|
|
140155
140259
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
140156
140260
|
}
|
|
@@ -140225,8 +140329,8 @@ var require_printSchema2 = __commonJS3({
|
|
|
140225
140329
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
140226
140330
|
}
|
|
140227
140331
|
function printUnion(type, options) {
|
|
140228
|
-
var
|
|
140229
|
-
var possibleTypes =
|
|
140332
|
+
var types17 = type.getTypes();
|
|
140333
|
+
var possibleTypes = types17.length ? " = " + types17.join(" | ") : "";
|
|
140230
140334
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
140231
140335
|
}
|
|
140232
140336
|
function printEnum(type, options) {
|
|
@@ -155016,14 +155120,14 @@ var require_lib32 = __commonJS3({
|
|
|
155016
155120
|
this.preserveSpace = !!preserveSpace;
|
|
155017
155121
|
}
|
|
155018
155122
|
};
|
|
155019
|
-
var
|
|
155123
|
+
var types17 = {
|
|
155020
155124
|
brace: new TokContext3("{"),
|
|
155021
155125
|
j_oTag: new TokContext3("<tag"),
|
|
155022
155126
|
j_cTag: new TokContext3("</tag"),
|
|
155023
155127
|
j_expr: new TokContext3("<tag>...</tag>", true)
|
|
155024
155128
|
};
|
|
155025
155129
|
{
|
|
155026
|
-
|
|
155130
|
+
types17.template = new TokContext3("`", true);
|
|
155027
155131
|
}
|
|
155028
155132
|
var beforeExpr2 = true;
|
|
155029
155133
|
var startsExpr2 = true;
|
|
@@ -155555,17 +155659,17 @@ var require_lib32 = __commonJS3({
|
|
|
155555
155659
|
context.pop();
|
|
155556
155660
|
};
|
|
155557
155661
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
155558
|
-
context.push(
|
|
155662
|
+
context.push(types17.brace);
|
|
155559
155663
|
};
|
|
155560
155664
|
tokenTypes[22].updateContext = (context) => {
|
|
155561
|
-
if (context[context.length - 1] ===
|
|
155665
|
+
if (context[context.length - 1] === types17.template) {
|
|
155562
155666
|
context.pop();
|
|
155563
155667
|
} else {
|
|
155564
|
-
context.push(
|
|
155668
|
+
context.push(types17.template);
|
|
155565
155669
|
}
|
|
155566
155670
|
};
|
|
155567
155671
|
tokenTypes[140].updateContext = (context) => {
|
|
155568
|
-
context.push(
|
|
155672
|
+
context.push(types17.j_expr, types17.j_oTag);
|
|
155569
155673
|
};
|
|
155570
155674
|
}
|
|
155571
155675
|
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";
|
|
@@ -156206,7 +156310,7 @@ var require_lib32 = __commonJS3({
|
|
|
156206
156310
|
this.lastTokEndLoc = null;
|
|
156207
156311
|
this.lastTokStartLoc = null;
|
|
156208
156312
|
this.lastTokStart = 0;
|
|
156209
|
-
this.context = [
|
|
156313
|
+
this.context = [types17.brace];
|
|
156210
156314
|
this.canStartJSXElement = true;
|
|
156211
156315
|
this.containsEsc = false;
|
|
156212
156316
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -160130,7 +160234,7 @@ var require_lib32 = __commonJS3({
|
|
|
160130
160234
|
context
|
|
160131
160235
|
} = this.state;
|
|
160132
160236
|
const currentContext = context[context.length - 1];
|
|
160133
|
-
if (currentContext ===
|
|
160237
|
+
if (currentContext === types17.j_oTag || currentContext === types17.j_expr) {
|
|
160134
160238
|
context.pop();
|
|
160135
160239
|
}
|
|
160136
160240
|
}
|
|
@@ -161190,9 +161294,9 @@ var require_lib32 = __commonJS3({
|
|
|
161190
161294
|
switch (this.state.type) {
|
|
161191
161295
|
case 5:
|
|
161192
161296
|
node2 = this.startNode();
|
|
161193
|
-
this.setContext(
|
|
161297
|
+
this.setContext(types17.brace);
|
|
161194
161298
|
this.next();
|
|
161195
|
-
node2 = this.jsxParseExpressionContainer(node2,
|
|
161299
|
+
node2 = this.jsxParseExpressionContainer(node2, types17.j_oTag);
|
|
161196
161300
|
if (node2.expression.type === "JSXEmptyExpression") {
|
|
161197
161301
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
161198
161302
|
at: node2
|
|
@@ -161215,7 +161319,7 @@ var require_lib32 = __commonJS3({
|
|
|
161215
161319
|
jsxParseSpreadChild(node2) {
|
|
161216
161320
|
this.next();
|
|
161217
161321
|
node2.expression = this.parseExpression();
|
|
161218
|
-
this.setContext(
|
|
161322
|
+
this.setContext(types17.j_expr);
|
|
161219
161323
|
this.state.canStartJSXElement = true;
|
|
161220
161324
|
this.expect(8);
|
|
161221
161325
|
return this.finishNode(node2, "JSXSpreadChild");
|
|
@@ -161235,11 +161339,11 @@ var require_lib32 = __commonJS3({
|
|
|
161235
161339
|
jsxParseAttribute() {
|
|
161236
161340
|
const node2 = this.startNode();
|
|
161237
161341
|
if (this.match(5)) {
|
|
161238
|
-
this.setContext(
|
|
161342
|
+
this.setContext(types17.brace);
|
|
161239
161343
|
this.next();
|
|
161240
161344
|
this.expect(21);
|
|
161241
161345
|
node2.argument = this.parseMaybeAssignAllowIn();
|
|
161242
|
-
this.setContext(
|
|
161346
|
+
this.setContext(types17.j_oTag);
|
|
161243
161347
|
this.state.canStartJSXElement = true;
|
|
161244
161348
|
this.expect(8);
|
|
161245
161349
|
return this.finishNode(node2, "JSXSpreadAttribute");
|
|
@@ -161298,12 +161402,12 @@ var require_lib32 = __commonJS3({
|
|
|
161298
161402
|
break;
|
|
161299
161403
|
case 5: {
|
|
161300
161404
|
const node22 = this.startNode();
|
|
161301
|
-
this.setContext(
|
|
161405
|
+
this.setContext(types17.brace);
|
|
161302
161406
|
this.next();
|
|
161303
161407
|
if (this.match(21)) {
|
|
161304
161408
|
children.push(this.jsxParseSpreadChild(node22));
|
|
161305
161409
|
} else {
|
|
161306
|
-
children.push(this.jsxParseExpressionContainer(node22,
|
|
161410
|
+
children.push(this.jsxParseExpressionContainer(node22, types17.j_expr));
|
|
161307
161411
|
}
|
|
161308
161412
|
break;
|
|
161309
161413
|
}
|
|
@@ -161374,10 +161478,10 @@ var require_lib32 = __commonJS3({
|
|
|
161374
161478
|
}
|
|
161375
161479
|
getTokenFromCode(code) {
|
|
161376
161480
|
const context = this.curContext();
|
|
161377
|
-
if (context ===
|
|
161481
|
+
if (context === types17.j_expr) {
|
|
161378
161482
|
return this.jsxReadToken();
|
|
161379
161483
|
}
|
|
161380
|
-
if (context ===
|
|
161484
|
+
if (context === types17.j_oTag || context === types17.j_cTag) {
|
|
161381
161485
|
if (isIdentifierStart2(code)) {
|
|
161382
161486
|
return this.jsxReadWord();
|
|
161383
161487
|
}
|
|
@@ -161385,7 +161489,7 @@ var require_lib32 = __commonJS3({
|
|
|
161385
161489
|
++this.state.pos;
|
|
161386
161490
|
return this.finishToken(141);
|
|
161387
161491
|
}
|
|
161388
|
-
if ((code === 34 || code === 39) && context ===
|
|
161492
|
+
if ((code === 34 || code === 39) && context === types17.j_oTag) {
|
|
161389
161493
|
return this.jsxReadString(code);
|
|
161390
161494
|
}
|
|
161391
161495
|
}
|
|
@@ -161401,17 +161505,17 @@ var require_lib32 = __commonJS3({
|
|
|
161401
161505
|
type
|
|
161402
161506
|
} = this.state;
|
|
161403
161507
|
if (type === 56 && prevType === 140) {
|
|
161404
|
-
context.splice(-2, 2,
|
|
161508
|
+
context.splice(-2, 2, types17.j_cTag);
|
|
161405
161509
|
this.state.canStartJSXElement = false;
|
|
161406
161510
|
} else if (type === 140) {
|
|
161407
|
-
context.push(
|
|
161511
|
+
context.push(types17.j_oTag);
|
|
161408
161512
|
} else if (type === 141) {
|
|
161409
161513
|
const out = context[context.length - 1];
|
|
161410
|
-
if (out ===
|
|
161514
|
+
if (out === types17.j_oTag && prevType === 56 || out === types17.j_cTag) {
|
|
161411
161515
|
context.pop();
|
|
161412
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
161516
|
+
this.state.canStartJSXElement = context[context.length - 1] === types17.j_expr;
|
|
161413
161517
|
} else {
|
|
161414
|
-
this.setContext(
|
|
161518
|
+
this.setContext(types17.j_expr);
|
|
161415
161519
|
this.state.canStartJSXElement = true;
|
|
161416
161520
|
}
|
|
161417
161521
|
} else {
|
|
@@ -162418,14 +162522,14 @@ var require_lib32 = __commonJS3({
|
|
|
162418
162522
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
162419
162523
|
const node2 = this.startNode();
|
|
162420
162524
|
const hasLeadingOperator = this.eat(operator);
|
|
162421
|
-
const
|
|
162525
|
+
const types18 = [];
|
|
162422
162526
|
do {
|
|
162423
|
-
|
|
162527
|
+
types18.push(parseConstituentType());
|
|
162424
162528
|
} while (this.eat(operator));
|
|
162425
|
-
if (
|
|
162426
|
-
return
|
|
162529
|
+
if (types18.length === 1 && !hasLeadingOperator) {
|
|
162530
|
+
return types18[0];
|
|
162427
162531
|
}
|
|
162428
|
-
node2.types =
|
|
162532
|
+
node2.types = types18;
|
|
162429
162533
|
return this.finishNode(node2, kind);
|
|
162430
162534
|
}
|
|
162431
162535
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -163641,7 +163745,7 @@ var require_lib32 = __commonJS3({
|
|
|
163641
163745
|
context
|
|
163642
163746
|
} = this.state;
|
|
163643
163747
|
const currentContext = context[context.length - 1];
|
|
163644
|
-
if (currentContext ===
|
|
163748
|
+
if (currentContext === types17.j_oTag || currentContext === types17.j_expr) {
|
|
163645
163749
|
context.pop();
|
|
163646
163750
|
}
|
|
163647
163751
|
}
|
|
@@ -169209,9 +169313,9 @@ var require_shared3 = __commonJS3({
|
|
|
169209
169313
|
var tslib_1 = require_tslib3();
|
|
169210
169314
|
var types_110 = tslib_1.__importDefault(require_types3());
|
|
169211
169315
|
function default_1(fork) {
|
|
169212
|
-
var
|
|
169213
|
-
var Type =
|
|
169214
|
-
var builtin =
|
|
169316
|
+
var types17 = fork.use(types_110.default);
|
|
169317
|
+
var Type = types17.Type;
|
|
169318
|
+
var builtin = types17.builtInTypes;
|
|
169215
169319
|
var isNumber2 = builtin.number;
|
|
169216
169320
|
function geq(than) {
|
|
169217
169321
|
return Type.from(function(value2) {
|
|
@@ -169359,9 +169463,9 @@ var require_types3 = __commonJS3({
|
|
|
169359
169463
|
}(BaseType);
|
|
169360
169464
|
var OrType = function(_super) {
|
|
169361
169465
|
tslib_1.__extends(OrType2, _super);
|
|
169362
|
-
function OrType2(
|
|
169466
|
+
function OrType2(types17) {
|
|
169363
169467
|
var _this = _super.call(this) || this;
|
|
169364
|
-
_this.types =
|
|
169468
|
+
_this.types = types17;
|
|
169365
169469
|
_this.kind = "OrType";
|
|
169366
169470
|
return _this;
|
|
169367
169471
|
}
|
|
@@ -169502,11 +169606,11 @@ var require_types3 = __commonJS3({
|
|
|
169502
169606
|
function typesPlugin(_fork) {
|
|
169503
169607
|
var Type = {
|
|
169504
169608
|
or: function() {
|
|
169505
|
-
var
|
|
169609
|
+
var types17 = [];
|
|
169506
169610
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
169507
|
-
|
|
169611
|
+
types17[_i] = arguments[_i];
|
|
169508
169612
|
}
|
|
169509
|
-
return new OrType(
|
|
169613
|
+
return new OrType(types17.map(function(type) {
|
|
169510
169614
|
return Type.from(type);
|
|
169511
169615
|
}));
|
|
169512
169616
|
},
|
|
@@ -169949,9 +170053,9 @@ var require_path22 = __commonJS3({
|
|
|
169949
170053
|
var Op = Object.prototype;
|
|
169950
170054
|
var hasOwn2 = Op.hasOwnProperty;
|
|
169951
170055
|
function pathPlugin(fork) {
|
|
169952
|
-
var
|
|
169953
|
-
var isArray2 =
|
|
169954
|
-
var isNumber2 =
|
|
170056
|
+
var types17 = fork.use(types_110.default);
|
|
170057
|
+
var isArray2 = types17.builtInTypes.array;
|
|
170058
|
+
var isNumber2 = types17.builtInTypes.number;
|
|
169955
170059
|
var Path = function Path2(value2, parentPath, name2) {
|
|
169956
170060
|
if (!(this instanceof Path2)) {
|
|
169957
170061
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -170251,13 +170355,13 @@ var require_scope3 = __commonJS3({
|
|
|
170251
170355
|
var types_110 = tslib_1.__importDefault(require_types3());
|
|
170252
170356
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
170253
170357
|
function scopePlugin(fork) {
|
|
170254
|
-
var
|
|
170255
|
-
var Type =
|
|
170256
|
-
var namedTypes =
|
|
170358
|
+
var types17 = fork.use(types_110.default);
|
|
170359
|
+
var Type = types17.Type;
|
|
170360
|
+
var namedTypes = types17.namedTypes;
|
|
170257
170361
|
var Node3 = namedTypes.Node;
|
|
170258
170362
|
var Expression = namedTypes.Expression;
|
|
170259
|
-
var isArray2 =
|
|
170260
|
-
var b =
|
|
170363
|
+
var isArray2 = types17.builtInTypes.array;
|
|
170364
|
+
var b = types17.builders;
|
|
170261
170365
|
var Scope3 = function Scope22(path22, parentScope) {
|
|
170262
170366
|
if (!(this instanceof Scope22)) {
|
|
170263
170367
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -170320,7 +170424,7 @@ var require_scope3 = __commonJS3({
|
|
|
170320
170424
|
++index;
|
|
170321
170425
|
}
|
|
170322
170426
|
var name2 = prefix + index;
|
|
170323
|
-
return this.bindings[name2] =
|
|
170427
|
+
return this.bindings[name2] = types17.builders.identifier(name2);
|
|
170324
170428
|
};
|
|
170325
170429
|
Sp.injectTemporary = function(identifier, init) {
|
|
170326
170430
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -170396,7 +170500,7 @@ var require_scope3 = __commonJS3({
|
|
|
170396
170500
|
bindings
|
|
170397
170501
|
);
|
|
170398
170502
|
} else if (Node3.check(node2) && !Expression.check(node2)) {
|
|
170399
|
-
|
|
170503
|
+
types17.eachField(node2, function(name2, child) {
|
|
170400
170504
|
var childPath = path22.get(name2);
|
|
170401
170505
|
if (!pathHasValue(childPath, child)) {
|
|
170402
170506
|
throw new Error("");
|
|
@@ -170474,24 +170578,24 @@ var require_scope3 = __commonJS3({
|
|
|
170474
170578
|
addPattern(patternPath.get("argument"), bindings);
|
|
170475
170579
|
}
|
|
170476
170580
|
}
|
|
170477
|
-
function addTypePattern(patternPath,
|
|
170581
|
+
function addTypePattern(patternPath, types18) {
|
|
170478
170582
|
var pattern = patternPath.value;
|
|
170479
170583
|
namedTypes.Pattern.assert(pattern);
|
|
170480
170584
|
if (namedTypes.Identifier.check(pattern)) {
|
|
170481
|
-
if (hasOwn2.call(
|
|
170482
|
-
|
|
170585
|
+
if (hasOwn2.call(types18, pattern.name)) {
|
|
170586
|
+
types18[pattern.name].push(patternPath);
|
|
170483
170587
|
} else {
|
|
170484
|
-
|
|
170588
|
+
types18[pattern.name] = [patternPath];
|
|
170485
170589
|
}
|
|
170486
170590
|
}
|
|
170487
170591
|
}
|
|
170488
|
-
function addTypeParameter(parameterPath,
|
|
170592
|
+
function addTypeParameter(parameterPath, types18) {
|
|
170489
170593
|
var parameter = parameterPath.value;
|
|
170490
170594
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
170491
|
-
if (hasOwn2.call(
|
|
170492
|
-
|
|
170595
|
+
if (hasOwn2.call(types18, parameter.name)) {
|
|
170596
|
+
types18[parameter.name].push(parameterPath);
|
|
170493
170597
|
} else {
|
|
170494
|
-
|
|
170598
|
+
types18[parameter.name] = [parameterPath];
|
|
170495
170599
|
}
|
|
170496
170600
|
}
|
|
170497
170601
|
Sp.lookup = function(name2) {
|
|
@@ -170530,11 +170634,11 @@ var require_node_path3 = __commonJS3({
|
|
|
170530
170634
|
var scope_1 = tslib_1.__importDefault(require_scope3());
|
|
170531
170635
|
var shared_1 = require_shared3();
|
|
170532
170636
|
function nodePathPlugin(fork) {
|
|
170533
|
-
var
|
|
170534
|
-
var n2 =
|
|
170535
|
-
var b =
|
|
170536
|
-
var isNumber2 =
|
|
170537
|
-
var isArray2 =
|
|
170637
|
+
var types17 = fork.use(types_110.default);
|
|
170638
|
+
var n2 = types17.namedTypes;
|
|
170639
|
+
var b = types17.builders;
|
|
170640
|
+
var isNumber2 = types17.builtInTypes.number;
|
|
170641
|
+
var isArray2 = types17.builtInTypes.array;
|
|
170538
170642
|
var Path = fork.use(path_1.default);
|
|
170539
170643
|
var Scope3 = fork.use(scope_1.default);
|
|
170540
170644
|
var NodePath = function NodePath2(value2, parentPath, name2) {
|
|
@@ -170625,7 +170729,7 @@ var require_node_path3 = __commonJS3({
|
|
|
170625
170729
|
return scope2 || null;
|
|
170626
170730
|
};
|
|
170627
170731
|
NPp.getValueProperty = function(name2) {
|
|
170628
|
-
return
|
|
170732
|
+
return types17.getFieldValue(this.value, name2);
|
|
170629
170733
|
};
|
|
170630
170734
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
170631
170735
|
var pp2 = this.parentPath;
|
|
@@ -170767,7 +170871,7 @@ var require_node_path3 = __commonJS3({
|
|
|
170767
170871
|
return node2.some(containsCallExpression);
|
|
170768
170872
|
}
|
|
170769
170873
|
if (n2.Node.check(node2)) {
|
|
170770
|
-
return
|
|
170874
|
+
return types17.someField(node2, function(_name, child) {
|
|
170771
170875
|
return containsCallExpression(child);
|
|
170772
170876
|
});
|
|
170773
170877
|
}
|
|
@@ -170886,11 +170990,11 @@ var require_path_visitor3 = __commonJS3({
|
|
|
170886
170990
|
var shared_1 = require_shared3();
|
|
170887
170991
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
170888
170992
|
function pathVisitorPlugin(fork) {
|
|
170889
|
-
var
|
|
170993
|
+
var types17 = fork.use(types_110.default);
|
|
170890
170994
|
var NodePath = fork.use(node_path_1.default);
|
|
170891
|
-
var isArray2 =
|
|
170892
|
-
var isObject22 =
|
|
170893
|
-
var isFunction2 =
|
|
170995
|
+
var isArray2 = types17.builtInTypes.array;
|
|
170996
|
+
var isObject22 = types17.builtInTypes.object;
|
|
170997
|
+
var isFunction2 = types17.builtInTypes.function;
|
|
170894
170998
|
var undefined2;
|
|
170895
170999
|
var PathVisitor = function PathVisitor2() {
|
|
170896
171000
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -170910,7 +171014,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
170910
171014
|
typeNames[methodName.slice("visit".length)] = true;
|
|
170911
171015
|
}
|
|
170912
171016
|
}
|
|
170913
|
-
var supertypeTable =
|
|
171017
|
+
var supertypeTable = types17.computeSupertypeLookupTable(typeNames);
|
|
170914
171018
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
170915
171019
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
170916
171020
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -170952,7 +171056,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
170952
171056
|
}
|
|
170953
171057
|
return target;
|
|
170954
171058
|
}
|
|
170955
|
-
PathVisitor.visit = function
|
|
171059
|
+
PathVisitor.visit = function visit13(node2, methods) {
|
|
170956
171060
|
return PathVisitor.fromMethodsObject(methods).visit(node2);
|
|
170957
171061
|
};
|
|
170958
171062
|
var PVp = PathVisitor.prototype;
|
|
@@ -171029,7 +171133,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
171029
171133
|
path22.each(visitor.visitWithoutReset, visitor);
|
|
171030
171134
|
} else if (!isObject22.check(value2)) {
|
|
171031
171135
|
} else {
|
|
171032
|
-
var childNames =
|
|
171136
|
+
var childNames = types17.getFieldNames(value2);
|
|
171033
171137
|
if (visitor._shouldVisitComments && value2.comments && childNames.indexOf("comments") < 0) {
|
|
171034
171138
|
childNames.push("comments");
|
|
171035
171139
|
}
|
|
@@ -171038,7 +171142,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
171038
171142
|
for (var i22 = 0; i22 < childCount; ++i22) {
|
|
171039
171143
|
var childName = childNames[i22];
|
|
171040
171144
|
if (!hasOwn2.call(value2, childName)) {
|
|
171041
|
-
value2[childName] =
|
|
171145
|
+
value2[childName] = types17.getFieldValue(value2, childName);
|
|
171042
171146
|
}
|
|
171043
171147
|
childPaths.push(path22.get(childName));
|
|
171044
171148
|
}
|
|
@@ -171143,7 +171247,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
171143
171247
|
this.needToCallTraverse = false;
|
|
171144
171248
|
return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
|
|
171145
171249
|
};
|
|
171146
|
-
sharedContextProtoMethods.visit = function
|
|
171250
|
+
sharedContextProtoMethods.visit = function visit13(path22, newVisitor) {
|
|
171147
171251
|
if (!(this instanceof this.Context)) {
|
|
171148
171252
|
throw new Error("");
|
|
171149
171253
|
}
|
|
@@ -171179,13 +171283,13 @@ var require_equiv3 = __commonJS3({
|
|
|
171179
171283
|
var shared_1 = require_shared3();
|
|
171180
171284
|
var types_110 = tslib_1.__importDefault(require_types3());
|
|
171181
171285
|
function default_1(fork) {
|
|
171182
|
-
var
|
|
171183
|
-
var getFieldNames =
|
|
171184
|
-
var getFieldValue =
|
|
171185
|
-
var isArray2 =
|
|
171186
|
-
var isObject22 =
|
|
171187
|
-
var isDate2 =
|
|
171188
|
-
var isRegExp2 =
|
|
171286
|
+
var types17 = fork.use(types_110.default);
|
|
171287
|
+
var getFieldNames = types17.getFieldNames;
|
|
171288
|
+
var getFieldValue = types17.getFieldValue;
|
|
171289
|
+
var isArray2 = types17.builtInTypes.array;
|
|
171290
|
+
var isObject22 = types17.builtInTypes.object;
|
|
171291
|
+
var isDate2 = types17.builtInTypes.Date;
|
|
171292
|
+
var isRegExp2 = types17.builtInTypes.RegExp;
|
|
171189
171293
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
171190
171294
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
171191
171295
|
if (isArray2.check(problemPath)) {
|
|
@@ -171336,24 +171440,24 @@ var require_fork3 = __commonJS3({
|
|
|
171336
171440
|
var shared_1 = require_shared3();
|
|
171337
171441
|
function default_1(plugins) {
|
|
171338
171442
|
var fork = createFork();
|
|
171339
|
-
var
|
|
171443
|
+
var types17 = fork.use(types_110.default);
|
|
171340
171444
|
plugins.forEach(fork.use);
|
|
171341
|
-
|
|
171445
|
+
types17.finalize();
|
|
171342
171446
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
171343
171447
|
return {
|
|
171344
|
-
Type:
|
|
171345
|
-
builtInTypes:
|
|
171346
|
-
namedTypes:
|
|
171347
|
-
builders:
|
|
171348
|
-
defineMethod:
|
|
171349
|
-
getFieldNames:
|
|
171350
|
-
getFieldValue:
|
|
171351
|
-
eachField:
|
|
171352
|
-
someField:
|
|
171353
|
-
getSupertypeNames:
|
|
171354
|
-
getBuilderName:
|
|
171448
|
+
Type: types17.Type,
|
|
171449
|
+
builtInTypes: types17.builtInTypes,
|
|
171450
|
+
namedTypes: types17.namedTypes,
|
|
171451
|
+
builders: types17.builders,
|
|
171452
|
+
defineMethod: types17.defineMethod,
|
|
171453
|
+
getFieldNames: types17.getFieldNames,
|
|
171454
|
+
getFieldValue: types17.getFieldValue,
|
|
171455
|
+
eachField: types17.eachField,
|
|
171456
|
+
someField: types17.someField,
|
|
171457
|
+
getSupertypeNames: types17.getSupertypeNames,
|
|
171458
|
+
getBuilderName: types17.getBuilderName,
|
|
171355
171459
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
171356
|
-
finalize:
|
|
171460
|
+
finalize: types17.finalize,
|
|
171357
171461
|
Path: fork.use(path_1.default),
|
|
171358
171462
|
NodePath: fork.use(node_path_1.default),
|
|
171359
171463
|
PathVisitor,
|
|
@@ -171513,8 +171617,8 @@ var require_core22 = __commonJS3({
|
|
|
171513
171617
|
var types_110 = tslib_1.__importDefault(require_types3());
|
|
171514
171618
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171515
171619
|
function default_1(fork) {
|
|
171516
|
-
var
|
|
171517
|
-
var Type =
|
|
171620
|
+
var types17 = fork.use(types_110.default);
|
|
171621
|
+
var Type = types17.Type;
|
|
171518
171622
|
var def = Type.def;
|
|
171519
171623
|
var or = Type.or;
|
|
171520
171624
|
var shared = fork.use(shared_1.default);
|
|
@@ -171604,9 +171708,9 @@ var require_es63 = __commonJS3({
|
|
|
171604
171708
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171605
171709
|
function default_1(fork) {
|
|
171606
171710
|
fork.use(core_1.default);
|
|
171607
|
-
var
|
|
171608
|
-
var def =
|
|
171609
|
-
var or =
|
|
171711
|
+
var types17 = fork.use(types_110.default);
|
|
171712
|
+
var def = types17.Type.def;
|
|
171713
|
+
var or = types17.Type.or;
|
|
171610
171714
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171611
171715
|
def("Function").field("generator", Boolean, defaults2["false"]).field("expression", Boolean, defaults2["false"]).field("defaults", [or(def("Expression"), null)], defaults2.emptyArray).field("rest", or(def("Identifier"), null), defaults2["null"]);
|
|
171612
171716
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -171692,8 +171796,8 @@ var require_es20173 = __commonJS3({
|
|
|
171692
171796
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171693
171797
|
function default_1(fork) {
|
|
171694
171798
|
fork.use(es2016_1.default);
|
|
171695
|
-
var
|
|
171696
|
-
var def =
|
|
171799
|
+
var types17 = fork.use(types_110.default);
|
|
171800
|
+
var def = types17.Type.def;
|
|
171697
171801
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171698
171802
|
def("Function").field("async", Boolean, defaults2["false"]);
|
|
171699
171803
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -171714,9 +171818,9 @@ var require_es20183 = __commonJS3({
|
|
|
171714
171818
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171715
171819
|
function default_1(fork) {
|
|
171716
171820
|
fork.use(es2017_1.default);
|
|
171717
|
-
var
|
|
171718
|
-
var def =
|
|
171719
|
-
var or =
|
|
171821
|
+
var types17 = fork.use(types_110.default);
|
|
171822
|
+
var def = types17.Type.def;
|
|
171823
|
+
var or = types17.Type.or;
|
|
171720
171824
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171721
171825
|
def("ForOfStatement").field("await", Boolean, defaults2["false"]);
|
|
171722
171826
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -171745,9 +171849,9 @@ var require_es20193 = __commonJS3({
|
|
|
171745
171849
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171746
171850
|
function default_1(fork) {
|
|
171747
171851
|
fork.use(es2018_1.default);
|
|
171748
|
-
var
|
|
171749
|
-
var def =
|
|
171750
|
-
var or =
|
|
171852
|
+
var types17 = fork.use(types_110.default);
|
|
171853
|
+
var def = types17.Type.def;
|
|
171854
|
+
var or = types17.Type.or;
|
|
171751
171855
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171752
171856
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults2["null"]);
|
|
171753
171857
|
}
|
|
@@ -171769,9 +171873,9 @@ var require_es202022 = __commonJS3({
|
|
|
171769
171873
|
function default_1(fork) {
|
|
171770
171874
|
fork.use(es2020_1.default);
|
|
171771
171875
|
fork.use(es2019_1.default);
|
|
171772
|
-
var
|
|
171773
|
-
var def =
|
|
171774
|
-
var or =
|
|
171876
|
+
var types17 = fork.use(types_110.default);
|
|
171877
|
+
var def = types17.Type.def;
|
|
171878
|
+
var or = types17.Type.or;
|
|
171775
171879
|
var shared = fork.use(shared_1.default);
|
|
171776
171880
|
var defaults2 = shared.defaults;
|
|
171777
171881
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -171817,8 +171921,8 @@ var require_es20223 = __commonJS3({
|
|
|
171817
171921
|
var shared_1 = require_shared3();
|
|
171818
171922
|
function default_1(fork) {
|
|
171819
171923
|
fork.use(es2021_1.default);
|
|
171820
|
-
var
|
|
171821
|
-
var def =
|
|
171924
|
+
var types17 = fork.use(types_110.default);
|
|
171925
|
+
var def = types17.Type.def;
|
|
171822
171926
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
171823
171927
|
}
|
|
171824
171928
|
exports.default = default_1;
|
|
@@ -171837,9 +171941,9 @@ var require_es_proposals3 = __commonJS3({
|
|
|
171837
171941
|
var es2022_1 = tslib_1.__importDefault(require_es20223());
|
|
171838
171942
|
function default_1(fork) {
|
|
171839
171943
|
fork.use(es2022_1.default);
|
|
171840
|
-
var
|
|
171841
|
-
var Type =
|
|
171842
|
-
var def =
|
|
171944
|
+
var types17 = fork.use(types_110.default);
|
|
171945
|
+
var Type = types17.Type;
|
|
171946
|
+
var def = types17.Type.def;
|
|
171843
171947
|
var or = Type.or;
|
|
171844
171948
|
var shared = fork.use(shared_1.default);
|
|
171845
171949
|
var defaults2 = shared.defaults;
|
|
@@ -171877,9 +171981,9 @@ var require_jsx3 = __commonJS3({
|
|
|
171877
171981
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171878
171982
|
function default_1(fork) {
|
|
171879
171983
|
fork.use(es_proposals_1.default);
|
|
171880
|
-
var
|
|
171881
|
-
var def =
|
|
171882
|
-
var or =
|
|
171984
|
+
var types17 = fork.use(types_110.default);
|
|
171985
|
+
var def = types17.Type.def;
|
|
171986
|
+
var or = types17.Type.or;
|
|
171883
171987
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171884
171988
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
171885
171989
|
def("Literal"),
|
|
@@ -171935,9 +172039,9 @@ var require_type_annotations3 = __commonJS3({
|
|
|
171935
172039
|
var types_110 = tslib_1.__importDefault(require_types3());
|
|
171936
172040
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
171937
172041
|
function default_1(fork) {
|
|
171938
|
-
var
|
|
171939
|
-
var def =
|
|
171940
|
-
var or =
|
|
172042
|
+
var types17 = fork.use(types_110.default);
|
|
172043
|
+
var def = types17.Type.def;
|
|
172044
|
+
var or = types17.Type.or;
|
|
171941
172045
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171942
172046
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
171943
172047
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -171970,9 +172074,9 @@ var require_flow3 = __commonJS3({
|
|
|
171970
172074
|
function default_1(fork) {
|
|
171971
172075
|
fork.use(es_proposals_1.default);
|
|
171972
172076
|
fork.use(type_annotations_1.default);
|
|
171973
|
-
var
|
|
171974
|
-
var def =
|
|
171975
|
-
var or =
|
|
172077
|
+
var types17 = fork.use(types_110.default);
|
|
172078
|
+
var def = types17.Type.def;
|
|
172079
|
+
var or = types17.Type.or;
|
|
171976
172080
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
171977
172081
|
def("Flow").bases("Node");
|
|
171978
172082
|
def("FlowType").bases("Flow");
|
|
@@ -172084,10 +172188,10 @@ var require_esprima7 = __commonJS3({
|
|
|
172084
172188
|
var shared_1 = tslib_1.__importStar(require_shared3());
|
|
172085
172189
|
function default_1(fork) {
|
|
172086
172190
|
fork.use(es_proposals_1.default);
|
|
172087
|
-
var
|
|
172191
|
+
var types17 = fork.use(types_110.default);
|
|
172088
172192
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
172089
|
-
var def =
|
|
172090
|
-
var or =
|
|
172193
|
+
var def = types17.Type.def;
|
|
172194
|
+
var or = types17.Type.or;
|
|
172091
172195
|
def("VariableDeclaration").field("declarations", [or(
|
|
172092
172196
|
def("VariableDeclarator"),
|
|
172093
172197
|
def("Identifier")
|
|
@@ -172130,11 +172234,11 @@ var require_babel_core3 = __commonJS3({
|
|
|
172130
172234
|
function default_1(fork) {
|
|
172131
172235
|
var _a, _b, _c, _d, _e;
|
|
172132
172236
|
fork.use(es_proposals_1.default);
|
|
172133
|
-
var
|
|
172237
|
+
var types17 = fork.use(types_110.default);
|
|
172134
172238
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
172135
|
-
var def =
|
|
172136
|
-
var or =
|
|
172137
|
-
var isUndefined =
|
|
172239
|
+
var def = types17.Type.def;
|
|
172240
|
+
var or = types17.Type.or;
|
|
172241
|
+
var isUndefined = types17.builtInTypes.undefined;
|
|
172138
172242
|
def("Noop").bases("Statement").build();
|
|
172139
172243
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
172140
172244
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -172159,7 +172263,7 @@ var require_babel_core3 = __commonJS3({
|
|
|
172159
172263
|
raw: String
|
|
172160
172264
|
},
|
|
172161
172265
|
function getDefault() {
|
|
172162
|
-
var value2 =
|
|
172266
|
+
var value2 = types17.getFieldValue(this, "value");
|
|
172163
172267
|
return {
|
|
172164
172268
|
rawValue: value2,
|
|
172165
172269
|
raw: toRaw ? toRaw(value2) : String(value2)
|
|
@@ -172260,8 +172364,8 @@ var require_babel3 = __commonJS3({
|
|
|
172260
172364
|
var flow_1 = tslib_1.__importDefault(require_flow3());
|
|
172261
172365
|
var shared_1 = require_shared3();
|
|
172262
172366
|
function default_1(fork) {
|
|
172263
|
-
var
|
|
172264
|
-
var def =
|
|
172367
|
+
var types17 = fork.use(types_110.default);
|
|
172368
|
+
var def = types17.Type.def;
|
|
172265
172369
|
fork.use(babel_core_1.default);
|
|
172266
172370
|
fork.use(flow_1.default);
|
|
172267
172371
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -172285,12 +172389,12 @@ var require_typescript3 = __commonJS3({
|
|
|
172285
172389
|
function default_1(fork) {
|
|
172286
172390
|
fork.use(babel_core_1.default);
|
|
172287
172391
|
fork.use(type_annotations_1.default);
|
|
172288
|
-
var
|
|
172289
|
-
var n2 =
|
|
172290
|
-
var def =
|
|
172291
|
-
var or =
|
|
172392
|
+
var types17 = fork.use(types_110.default);
|
|
172393
|
+
var n2 = types17.namedTypes;
|
|
172394
|
+
var def = types17.Type.def;
|
|
172395
|
+
var or = types17.Type.or;
|
|
172292
172396
|
var defaults2 = fork.use(shared_1.default).defaults;
|
|
172293
|
-
var StringLiteral =
|
|
172397
|
+
var StringLiteral = types17.Type.from(function(value2, deep) {
|
|
172294
172398
|
if (n2.StringLiteral && n2.StringLiteral.check(value2, deep)) {
|
|
172295
172399
|
return true;
|
|
172296
172400
|
}
|
|
@@ -172486,7 +172590,7 @@ var require_main5 = __commonJS3({
|
|
|
172486
172590
|
var someField = _a.someField;
|
|
172487
172591
|
var Type = _a.Type;
|
|
172488
172592
|
var use = _a.use;
|
|
172489
|
-
var
|
|
172593
|
+
var visit13 = _a.visit;
|
|
172490
172594
|
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
172491
172595
|
exports.builders = builders;
|
|
172492
172596
|
exports.builtInTypes = builtInTypes;
|
|
@@ -172503,7 +172607,7 @@ var require_main5 = __commonJS3({
|
|
|
172503
172607
|
exports.someField = someField;
|
|
172504
172608
|
exports.Type = Type;
|
|
172505
172609
|
exports.use = use;
|
|
172506
|
-
exports.visit =
|
|
172610
|
+
exports.visit = visit13;
|
|
172507
172611
|
Object.assign(namedTypes_1.namedTypes, n2);
|
|
172508
172612
|
}
|
|
172509
172613
|
});
|
|
@@ -174238,8 +174342,8 @@ var require_util22 = __commonJS3({
|
|
|
174238
174342
|
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;
|
|
174239
174343
|
var tslib_1 = require_tslib3();
|
|
174240
174344
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
174241
|
-
var
|
|
174242
|
-
var n2 =
|
|
174345
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
174346
|
+
var n2 = types17.namedTypes;
|
|
174243
174347
|
var source_map_1 = tslib_1.__importDefault(require_source_map3());
|
|
174244
174348
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
174245
174349
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -181545,10 +181649,10 @@ var require_comments3 = __commonJS3({
|
|
|
181545
181649
|
exports.printComments = exports.attach = void 0;
|
|
181546
181650
|
var tslib_1 = require_tslib3();
|
|
181547
181651
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
181548
|
-
var
|
|
181549
|
-
var n2 =
|
|
181550
|
-
var isArray2 =
|
|
181551
|
-
var isObject22 =
|
|
181652
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
181653
|
+
var n2 = types17.namedTypes;
|
|
181654
|
+
var isArray2 = types17.builtInTypes.array;
|
|
181655
|
+
var isObject22 = types17.builtInTypes.object;
|
|
181552
181656
|
var lines_1 = require_lines3();
|
|
181553
181657
|
var util_110 = require_util22();
|
|
181554
181658
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -181579,7 +181683,7 @@ var require_comments3 = __commonJS3({
|
|
|
181579
181683
|
if (isArray2.check(node2)) {
|
|
181580
181684
|
names = Object.keys(node2);
|
|
181581
181685
|
} else if (isObject22.check(node2)) {
|
|
181582
|
-
names =
|
|
181686
|
+
names = types17.getFieldNames(node2);
|
|
181583
181687
|
} else {
|
|
181584
181688
|
return resultArray;
|
|
181585
181689
|
}
|
|
@@ -181757,7 +181861,7 @@ var require_comments3 = __commonJS3({
|
|
|
181757
181861
|
function printComments(path22, print12) {
|
|
181758
181862
|
var value2 = path22.getValue();
|
|
181759
181863
|
var innerLines = print12(path22);
|
|
181760
|
-
var comments = n2.Node.check(value2) &&
|
|
181864
|
+
var comments = n2.Node.check(value2) && types17.getFieldValue(value2, "comments");
|
|
181761
181865
|
if (!comments || comments.length === 0) {
|
|
181762
181866
|
return innerLines;
|
|
181763
181867
|
}
|
|
@@ -181765,8 +181869,8 @@ var require_comments3 = __commonJS3({
|
|
|
181765
181869
|
var trailingParts = [innerLines];
|
|
181766
181870
|
path22.each(function(commentPath) {
|
|
181767
181871
|
var comment = commentPath.getValue();
|
|
181768
|
-
var leading =
|
|
181769
|
-
var trailing =
|
|
181872
|
+
var leading = types17.getFieldValue(comment, "leading");
|
|
181873
|
+
var trailing = types17.getFieldValue(comment, "trailing");
|
|
181770
181874
|
if (leading || trailing && !(n2.Statement.check(value2) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
181771
181875
|
leadingParts.push(printLeadingComment(commentPath, print12));
|
|
181772
181876
|
} else if (trailing) {
|
|
@@ -181786,10 +181890,10 @@ var require_parser22 = __commonJS3({
|
|
|
181786
181890
|
exports.parse = void 0;
|
|
181787
181891
|
var tslib_1 = require_tslib3();
|
|
181788
181892
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
181789
|
-
var
|
|
181790
|
-
var b =
|
|
181791
|
-
var isObject22 =
|
|
181792
|
-
var isArray2 =
|
|
181893
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
181894
|
+
var b = types17.builders;
|
|
181895
|
+
var isObject22 = types17.builtInTypes.object;
|
|
181896
|
+
var isArray2 = types17.builtInTypes.array;
|
|
181793
181897
|
var options_1 = require_options3();
|
|
181794
181898
|
var lines_1 = require_lines3();
|
|
181795
181899
|
var comments_1 = require_comments3();
|
|
@@ -181973,11 +182077,11 @@ var require_fast_path3 = __commonJS3({
|
|
|
181973
182077
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
181974
182078
|
var tslib_1 = require_tslib3();
|
|
181975
182079
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
181976
|
-
var
|
|
182080
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
181977
182081
|
var util2 = tslib_1.__importStar(require_util22());
|
|
181978
|
-
var n2 =
|
|
181979
|
-
var isArray2 =
|
|
181980
|
-
var isNumber2 =
|
|
182082
|
+
var n2 = types17.namedTypes;
|
|
182083
|
+
var isArray2 = types17.builtInTypes.array;
|
|
182084
|
+
var isNumber2 = types17.builtInTypes.number;
|
|
181981
182085
|
var PRECEDENCE = {};
|
|
181982
182086
|
[
|
|
181983
182087
|
["??"],
|
|
@@ -182006,7 +182110,7 @@ var require_fast_path3 = __commonJS3({
|
|
|
182006
182110
|
if (obj instanceof FastPath) {
|
|
182007
182111
|
return obj.copy();
|
|
182008
182112
|
}
|
|
182009
|
-
if (obj instanceof
|
|
182113
|
+
if (obj instanceof types17.NodePath) {
|
|
182010
182114
|
var copy = Object.create(FastPath.prototype);
|
|
182011
182115
|
var stack = [obj.value];
|
|
182012
182116
|
for (var pp2 = void 0; pp2 = obj.parentPath; obj = pp2)
|
|
@@ -182317,7 +182421,7 @@ var require_fast_path3 = __commonJS3({
|
|
|
182317
182421
|
return node2.some(containsCallExpression);
|
|
182318
182422
|
}
|
|
182319
182423
|
if (n2.Node.check(node2)) {
|
|
182320
|
-
return
|
|
182424
|
+
return types17.someField(node2, function(_name, child) {
|
|
182321
182425
|
return containsCallExpression(child);
|
|
182322
182426
|
});
|
|
182323
182427
|
}
|
|
@@ -182405,16 +182509,16 @@ var require_patcher3 = __commonJS3({
|
|
|
182405
182509
|
var tslib_1 = require_tslib3();
|
|
182406
182510
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
182407
182511
|
var linesModule = tslib_1.__importStar(require_lines3());
|
|
182408
|
-
var
|
|
182409
|
-
var Printable =
|
|
182410
|
-
var Expression =
|
|
182411
|
-
var ReturnStatement =
|
|
182412
|
-
var SourceLocation3 =
|
|
182512
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
182513
|
+
var Printable = types17.namedTypes.Printable;
|
|
182514
|
+
var Expression = types17.namedTypes.Expression;
|
|
182515
|
+
var ReturnStatement = types17.namedTypes.ReturnStatement;
|
|
182516
|
+
var SourceLocation3 = types17.namedTypes.SourceLocation;
|
|
182413
182517
|
var util_110 = require_util22();
|
|
182414
182518
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path3());
|
|
182415
|
-
var isObject22 =
|
|
182416
|
-
var isArray2 =
|
|
182417
|
-
var isString3 =
|
|
182519
|
+
var isObject22 = types17.builtInTypes.object;
|
|
182520
|
+
var isArray2 = types17.builtInTypes.array;
|
|
182521
|
+
var isString3 = types17.builtInTypes.string;
|
|
182418
182522
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
182419
182523
|
var Patcher = function Patcher2(lines) {
|
|
182420
182524
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -182684,8 +182788,8 @@ var require_patcher3 = __commonJS3({
|
|
|
182684
182788
|
if (k.charAt(0) === "_") {
|
|
182685
182789
|
continue;
|
|
182686
182790
|
}
|
|
182687
|
-
newPath.stack.push(k,
|
|
182688
|
-
oldPath.stack.push(k,
|
|
182791
|
+
newPath.stack.push(k, types17.getFieldValue(newNode, k));
|
|
182792
|
+
oldPath.stack.push(k, types17.getFieldValue(oldNode, k));
|
|
182689
182793
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
182690
182794
|
newPath.stack.length -= 2;
|
|
182691
182795
|
oldPath.stack.length -= 2;
|
|
@@ -182707,16 +182811,16 @@ var require_printer22 = __commonJS3({
|
|
|
182707
182811
|
exports.Printer = void 0;
|
|
182708
182812
|
var tslib_1 = require_tslib3();
|
|
182709
182813
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
182710
|
-
var
|
|
182814
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
182711
182815
|
var comments_1 = require_comments3();
|
|
182712
182816
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path3());
|
|
182713
182817
|
var lines_1 = require_lines3();
|
|
182714
182818
|
var options_1 = require_options3();
|
|
182715
182819
|
var patcher_1 = require_patcher3();
|
|
182716
182820
|
var util2 = tslib_1.__importStar(require_util22());
|
|
182717
|
-
var namedTypes =
|
|
182718
|
-
var isString3 =
|
|
182719
|
-
var isObject22 =
|
|
182821
|
+
var namedTypes = types17.namedTypes;
|
|
182822
|
+
var isString3 = types17.builtInTypes.string;
|
|
182823
|
+
var isObject22 = types17.builtInTypes.object;
|
|
182720
182824
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
182721
182825
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
182722
182826
|
isString3.assert(code);
|
|
@@ -182878,7 +182982,7 @@ var require_printer22 = __commonJS3({
|
|
|
182878
182982
|
case "OptionalMemberExpression": {
|
|
182879
182983
|
parts.push(path22.call(print12, "object"));
|
|
182880
182984
|
var property = path22.call(print12, "property");
|
|
182881
|
-
var optional =
|
|
182985
|
+
var optional = types17.getFieldValue(n2, "optional");
|
|
182882
182986
|
if (n2.computed) {
|
|
182883
182987
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
182884
182988
|
} else {
|
|
@@ -183149,7 +183253,7 @@ var require_printer22 = __commonJS3({
|
|
|
183149
183253
|
if (n2.typeArguments) {
|
|
183150
183254
|
parts.push(path22.call(print12, "typeArguments"));
|
|
183151
183255
|
}
|
|
183152
|
-
if (
|
|
183256
|
+
if (types17.getFieldValue(n2, "optional")) {
|
|
183153
183257
|
parts.push("?.");
|
|
183154
183258
|
}
|
|
183155
183259
|
parts.push(printArgumentsList(path22, options, print12));
|
|
@@ -184828,8 +184932,8 @@ var require_printer22 = __commonJS3({
|
|
|
184828
184932
|
});
|
|
184829
184933
|
}
|
|
184830
184934
|
function getPossibleRaw(node2) {
|
|
184831
|
-
var value2 =
|
|
184832
|
-
var extra =
|
|
184935
|
+
var value2 = types17.getFieldValue(node2, "value");
|
|
184936
|
+
var extra = types17.getFieldValue(node2, "extra");
|
|
184833
184937
|
if (extra && typeof extra.raw === "string" && value2 == extra.rawValue) {
|
|
184834
184938
|
return extra.raw;
|
|
184835
184939
|
}
|
|
@@ -184875,8 +184979,8 @@ var require_main22 = __commonJS3({
|
|
|
184875
184979
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
184876
184980
|
var tslib_1 = require_tslib3();
|
|
184877
184981
|
var fs_1 = tslib_1.__importDefault(__require2("fs"));
|
|
184878
|
-
var
|
|
184879
|
-
exports.types =
|
|
184982
|
+
var types17 = tslib_1.__importStar(require_main5());
|
|
184983
|
+
exports.types = types17;
|
|
184880
184984
|
var parser_1 = require_parser22();
|
|
184881
184985
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
184882
184986
|
return parser_1.parse;
|
|
@@ -184890,10 +184994,10 @@ var require_main22 = __commonJS3({
|
|
|
184890
184994
|
return new printer_1.Printer(options).print(node2);
|
|
184891
184995
|
}
|
|
184892
184996
|
exports.print = print12;
|
|
184893
|
-
function
|
|
184997
|
+
function prettyPrint3(node2, options) {
|
|
184894
184998
|
return new printer_1.Printer(options).printGenerically(node2);
|
|
184895
184999
|
}
|
|
184896
|
-
exports.prettyPrint =
|
|
185000
|
+
exports.prettyPrint = prettyPrint3;
|
|
184897
185001
|
function run(transformer, options) {
|
|
184898
185002
|
return runFile(process.argv[2], transformer, options);
|
|
184899
185003
|
}
|
|
@@ -185046,7 +185150,7 @@ var import__ = __toESM3(require_safe_stable_stringify(), 1);
|
|
|
185046
185150
|
var configure = import__.default.configure;
|
|
185047
185151
|
var import_micromatch = __toESM3(require_micromatch(), 1);
|
|
185048
185152
|
var log = new Log("Watch-and-Run");
|
|
185049
|
-
var
|
|
185153
|
+
var graphql29 = __toESM3(require_graphql22(), 1);
|
|
185050
185154
|
var import_graphql162 = __toESM3(require_graphql22(), 1);
|
|
185051
185155
|
var import_graphql30 = __toESM3(require_graphql22(), 1);
|
|
185052
185156
|
var AggregateErrorImpl2;
|
|
@@ -185233,7 +185337,7 @@ var printDocASTReducer2 = {
|
|
|
185233
185337
|
leave: ({ name: name2, interfaces, directives, fields }) => join4(["interface", name2, wrap2("implements ", join4(interfaces, " & ")), join4(directives, " "), block2(fields)], " ")
|
|
185234
185338
|
},
|
|
185235
185339
|
UnionTypeDefinition: {
|
|
185236
|
-
leave: ({ name: name2, directives, types:
|
|
185340
|
+
leave: ({ name: name2, directives, types: types17 }) => join4(["union", name2, join4(directives, " "), wrap2("= ", join4(types17, " | "))], " ")
|
|
185237
185341
|
},
|
|
185238
185342
|
EnumTypeDefinition: {
|
|
185239
185343
|
leave: ({ name: name2, directives, values }) => join4(["enum", name2, join4(directives, " "), block2(values)], " ")
|
|
@@ -185260,7 +185364,7 @@ var printDocASTReducer2 = {
|
|
|
185260
185364
|
leave: ({ name: name2, interfaces, directives, fields }) => join4(["extend interface", name2, wrap2("implements ", join4(interfaces, " & ")), join4(directives, " "), block2(fields)], " ")
|
|
185261
185365
|
},
|
|
185262
185366
|
UnionTypeExtension: {
|
|
185263
|
-
leave: ({ name: name2, directives, types:
|
|
185367
|
+
leave: ({ name: name2, directives, types: types17 }) => join4(["extend union", name2, join4(directives, " "), wrap2("= ", join4(types17, " | "))], " ")
|
|
185264
185368
|
},
|
|
185265
185369
|
EnumTypeExtension: {
|
|
185266
185370
|
leave: ({ name: name2, directives, values }) => join4(["extend enum", name2, join4(directives, " "), block2(values)], " ")
|
|
@@ -185790,8 +185894,8 @@ var List3 = class {
|
|
|
185790
185894
|
} else {
|
|
185791
185895
|
entries = this.cache._internal_unstable.storage.get(value2, "edges").value;
|
|
185792
185896
|
}
|
|
185793
|
-
for (let
|
|
185794
|
-
yield
|
|
185897
|
+
for (let record2 of entries) {
|
|
185898
|
+
yield record2;
|
|
185795
185899
|
}
|
|
185796
185900
|
}
|
|
185797
185901
|
};
|
|
@@ -185839,6 +185943,44 @@ var ListCollection2 = class {
|
|
|
185839
185943
|
}
|
|
185840
185944
|
}
|
|
185841
185945
|
};
|
|
185946
|
+
var SchemaManager2 = class {
|
|
185947
|
+
cache;
|
|
185948
|
+
fieldTypes = {};
|
|
185949
|
+
constructor(cache) {
|
|
185950
|
+
this.cache = cache;
|
|
185951
|
+
}
|
|
185952
|
+
setFieldType({
|
|
185953
|
+
parent,
|
|
185954
|
+
key,
|
|
185955
|
+
type,
|
|
185956
|
+
nullable = false,
|
|
185957
|
+
link
|
|
185958
|
+
}) {
|
|
185959
|
+
let parensIndex = key.indexOf("(");
|
|
185960
|
+
if (parensIndex !== -1) {
|
|
185961
|
+
key = key.substring(0, parensIndex);
|
|
185962
|
+
}
|
|
185963
|
+
if (parent === rootID2) {
|
|
185964
|
+
parent = "Query";
|
|
185965
|
+
} else if (parent.includes(":")) {
|
|
185966
|
+
parent = parent.substring(0, parent.indexOf(":"));
|
|
185967
|
+
}
|
|
185968
|
+
if (!this.fieldTypes[parent]) {
|
|
185969
|
+
this.fieldTypes[parent] = {};
|
|
185970
|
+
}
|
|
185971
|
+
this.fieldTypes[parent][key] = {
|
|
185972
|
+
type,
|
|
185973
|
+
nullable,
|
|
185974
|
+
link: !!link
|
|
185975
|
+
};
|
|
185976
|
+
}
|
|
185977
|
+
fieldType(type, field) {
|
|
185978
|
+
return this.fieldTypes[type]?.[field] || null;
|
|
185979
|
+
}
|
|
185980
|
+
get config() {
|
|
185981
|
+
return this.cache._internal_unstable.config;
|
|
185982
|
+
}
|
|
185983
|
+
};
|
|
185842
185984
|
var InMemoryStorage2 = class {
|
|
185843
185985
|
data;
|
|
185844
185986
|
idCount = 0;
|
|
@@ -186401,7 +186543,7 @@ var InMemorySubscriptions2 = class {
|
|
|
186401
186543
|
}
|
|
186402
186544
|
}
|
|
186403
186545
|
};
|
|
186404
|
-
var
|
|
186546
|
+
var Cache32 = class {
|
|
186405
186547
|
_internal_unstable;
|
|
186406
186548
|
constructor(config4) {
|
|
186407
186549
|
this._internal_unstable = new CacheInternal2({
|
|
@@ -186409,7 +186551,8 @@ var Cache22 = class {
|
|
|
186409
186551
|
storage: new InMemoryStorage2(),
|
|
186410
186552
|
subscriptions: new InMemorySubscriptions2(this),
|
|
186411
186553
|
lists: new ListManager2(this, rootID2),
|
|
186412
|
-
lifetimes: new GarbageCollector2(this)
|
|
186554
|
+
lifetimes: new GarbageCollector2(this),
|
|
186555
|
+
schema: new SchemaManager2(this)
|
|
186413
186556
|
});
|
|
186414
186557
|
if (config4) {
|
|
186415
186558
|
this.setConfig(defaultConfigValues2(config4));
|
|
@@ -186495,18 +186638,21 @@ var CacheInternal2 = class {
|
|
|
186495
186638
|
lists;
|
|
186496
186639
|
cache;
|
|
186497
186640
|
lifetimes;
|
|
186641
|
+
schema;
|
|
186498
186642
|
constructor({
|
|
186499
186643
|
storage,
|
|
186500
186644
|
subscriptions,
|
|
186501
186645
|
lists,
|
|
186502
186646
|
cache,
|
|
186503
|
-
lifetimes
|
|
186647
|
+
lifetimes,
|
|
186648
|
+
schema
|
|
186504
186649
|
}) {
|
|
186505
186650
|
this.storage = storage;
|
|
186506
186651
|
this.subscriptions = subscriptions;
|
|
186507
186652
|
this.lists = lists;
|
|
186508
186653
|
this.cache = cache;
|
|
186509
186654
|
this.lifetimes = lifetimes;
|
|
186655
|
+
this.schema = schema;
|
|
186510
186656
|
this._disabled = typeof globalThis.window === "undefined";
|
|
186511
186657
|
try {
|
|
186512
186658
|
if (process.env.HOUDINI_TEST === "true") {
|
|
@@ -186522,7 +186668,6 @@ var CacheInternal2 = class {
|
|
|
186522
186668
|
data: data2,
|
|
186523
186669
|
selection: selection2,
|
|
186524
186670
|
variables = {},
|
|
186525
|
-
root = rootID2,
|
|
186526
186671
|
parent = rootID2,
|
|
186527
186672
|
applyUpdates = false,
|
|
186528
186673
|
layer,
|
|
@@ -186545,9 +186690,17 @@ var CacheInternal2 = class {
|
|
|
186545
186690
|
selection: fieldSelection,
|
|
186546
186691
|
operations,
|
|
186547
186692
|
abstract: isAbstract,
|
|
186548
|
-
update
|
|
186693
|
+
update,
|
|
186694
|
+
nullable
|
|
186549
186695
|
} = targetSelection[field];
|
|
186550
186696
|
const key = evaluateKey2(keyRaw, variables);
|
|
186697
|
+
this.schema.setFieldType({
|
|
186698
|
+
parent,
|
|
186699
|
+
key: keyRaw,
|
|
186700
|
+
type: linkedType,
|
|
186701
|
+
nullable,
|
|
186702
|
+
link: !!fieldSelection
|
|
186703
|
+
});
|
|
186551
186704
|
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
186552
186705
|
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
186553
186706
|
const displayLayer = layer.isDisplayLayer(displayLayers);
|
|
@@ -186616,7 +186769,6 @@ var CacheInternal2 = class {
|
|
|
186616
186769
|
}
|
|
186617
186770
|
if (linkedID) {
|
|
186618
186771
|
this.writeSelection({
|
|
186619
|
-
root,
|
|
186620
186772
|
selection: fieldSelection,
|
|
186621
186773
|
parent: linkedID,
|
|
186622
186774
|
data: value2,
|
|
@@ -187005,7 +187157,7 @@ var CacheInternal2 = class {
|
|
|
187005
187157
|
}
|
|
187006
187158
|
};
|
|
187007
187159
|
var rootID2 = "_ROOT_";
|
|
187008
|
-
var cache_default2 = new
|
|
187160
|
+
var cache_default2 = new Cache32();
|
|
187009
187161
|
var siteURL = "https://houdinigraphql.com";
|
|
187010
187162
|
var houdini_mode2 = {
|
|
187011
187163
|
get is_testing() {
|
|
@@ -187160,6 +187312,7 @@ async function writeFile2(filepath, data2) {
|
|
|
187160
187312
|
return;
|
|
187161
187313
|
}
|
|
187162
187314
|
if (houdini_mode2.is_testing) {
|
|
187315
|
+
import_memfs2.fs.mkdirpSync(dirname2(filepath));
|
|
187163
187316
|
return import_memfs2.fs.writeFileSync(filepath, data2);
|
|
187164
187317
|
}
|
|
187165
187318
|
return await import_promises2.default.writeFile(filepath, data2, "utf8");
|
|
@@ -187913,7 +188066,7 @@ var import_parser2 = __toESM3(require_lib32(), 1);
|
|
|
187913
188066
|
var recast2 = __toESM3(require_main22(), 1);
|
|
187914
188067
|
var AST2 = recast2.types.builders;
|
|
187915
188068
|
var graphql42 = __toESM3(require_graphql22(), 1);
|
|
187916
|
-
var
|
|
188069
|
+
var graphql14 = __toESM3(require_graphql22(), 1);
|
|
187917
188070
|
var recast5 = __toESM3(require_main22(), 1);
|
|
187918
188071
|
var graphql52 = __toESM3(require_graphql22(), 1);
|
|
187919
188072
|
var recast22 = __toESM3(require_main22(), 1);
|
|
@@ -187925,39 +188078,40 @@ var graphql8 = __toESM3(require_graphql22(), 1);
|
|
|
187925
188078
|
var graphql7 = __toESM3(require_graphql22(), 1);
|
|
187926
188079
|
var recast4 = __toESM3(require_main22(), 1);
|
|
187927
188080
|
var AST4 = recast4.types.builders;
|
|
187928
|
-
var
|
|
187929
|
-
var
|
|
188081
|
+
var graphql13 = __toESM3(require_graphql22(), 1);
|
|
188082
|
+
var graphql11 = __toESM3(require_graphql22(), 1);
|
|
187930
188083
|
var graphql9 = __toESM3(require_graphql22(), 1);
|
|
188084
|
+
var graphql10 = __toESM3(require_graphql22(), 1);
|
|
187931
188085
|
var pageInfoSelection = [
|
|
187932
188086
|
{
|
|
187933
|
-
kind:
|
|
188087
|
+
kind: graphql10.Kind.FIELD,
|
|
187934
188088
|
name: {
|
|
187935
|
-
kind:
|
|
188089
|
+
kind: graphql10.Kind.NAME,
|
|
187936
188090
|
value: "edges"
|
|
187937
188091
|
},
|
|
187938
188092
|
selectionSet: {
|
|
187939
|
-
kind:
|
|
188093
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
187940
188094
|
selections: [
|
|
187941
188095
|
{
|
|
187942
|
-
kind:
|
|
188096
|
+
kind: graphql10.Kind.FIELD,
|
|
187943
188097
|
name: {
|
|
187944
|
-
kind:
|
|
188098
|
+
kind: graphql10.Kind.NAME,
|
|
187945
188099
|
value: "cursor"
|
|
187946
188100
|
}
|
|
187947
188101
|
},
|
|
187948
188102
|
{
|
|
187949
|
-
kind:
|
|
188103
|
+
kind: graphql10.Kind.FIELD,
|
|
187950
188104
|
name: {
|
|
187951
|
-
kind:
|
|
188105
|
+
kind: graphql10.Kind.NAME,
|
|
187952
188106
|
value: "node"
|
|
187953
188107
|
},
|
|
187954
188108
|
selectionSet: {
|
|
187955
|
-
kind:
|
|
188109
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
187956
188110
|
selections: [
|
|
187957
188111
|
{
|
|
187958
|
-
kind:
|
|
188112
|
+
kind: graphql10.Kind.FIELD,
|
|
187959
188113
|
name: {
|
|
187960
|
-
kind:
|
|
188114
|
+
kind: graphql10.Kind.NAME,
|
|
187961
188115
|
value: "__typename"
|
|
187962
188116
|
}
|
|
187963
188117
|
}
|
|
@@ -187968,39 +188122,39 @@ var pageInfoSelection = [
|
|
|
187968
188122
|
}
|
|
187969
188123
|
},
|
|
187970
188124
|
{
|
|
187971
|
-
kind:
|
|
188125
|
+
kind: graphql10.Kind.FIELD,
|
|
187972
188126
|
name: {
|
|
187973
|
-
kind:
|
|
188127
|
+
kind: graphql10.Kind.NAME,
|
|
187974
188128
|
value: "pageInfo"
|
|
187975
188129
|
},
|
|
187976
188130
|
selectionSet: {
|
|
187977
|
-
kind:
|
|
188131
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
187978
188132
|
selections: [
|
|
187979
188133
|
{
|
|
187980
|
-
kind:
|
|
188134
|
+
kind: graphql10.Kind.FIELD,
|
|
187981
188135
|
name: {
|
|
187982
|
-
kind:
|
|
188136
|
+
kind: graphql10.Kind.NAME,
|
|
187983
188137
|
value: "hasPreviousPage"
|
|
187984
188138
|
}
|
|
187985
188139
|
},
|
|
187986
188140
|
{
|
|
187987
|
-
kind:
|
|
188141
|
+
kind: graphql10.Kind.FIELD,
|
|
187988
188142
|
name: {
|
|
187989
|
-
kind:
|
|
188143
|
+
kind: graphql10.Kind.NAME,
|
|
187990
188144
|
value: "hasNextPage"
|
|
187991
188145
|
}
|
|
187992
188146
|
},
|
|
187993
188147
|
{
|
|
187994
|
-
kind:
|
|
188148
|
+
kind: graphql10.Kind.FIELD,
|
|
187995
188149
|
name: {
|
|
187996
|
-
kind:
|
|
188150
|
+
kind: graphql10.Kind.NAME,
|
|
187997
188151
|
value: "startCursor"
|
|
187998
188152
|
}
|
|
187999
188153
|
},
|
|
188000
188154
|
{
|
|
188001
|
-
kind:
|
|
188155
|
+
kind: graphql10.Kind.FIELD,
|
|
188002
188156
|
name: {
|
|
188003
|
-
kind:
|
|
188157
|
+
kind: graphql10.Kind.NAME,
|
|
188004
188158
|
value: "endCursor"
|
|
188005
188159
|
}
|
|
188006
188160
|
}
|
|
@@ -188008,33 +188162,38 @@ var pageInfoSelection = [
|
|
|
188008
188162
|
}
|
|
188009
188163
|
}
|
|
188010
188164
|
];
|
|
188011
|
-
var
|
|
188165
|
+
var graphql12 = __toESM3(require_graphql22(), 1);
|
|
188012
188166
|
var AST5 = recast5.types.builders;
|
|
188013
|
-
var
|
|
188167
|
+
var recast6 = __toESM3(require_main22(), 1);
|
|
188168
|
+
var AST6 = recast6.types.builders;
|
|
188169
|
+
var recast12 = __toESM3(require_main22(), 1);
|
|
188170
|
+
var graphql17 = __toESM3(require_graphql22(), 1);
|
|
188171
|
+
var recast9 = __toESM3(require_main22(), 1);
|
|
188014
188172
|
var graphql16 = __toESM3(require_graphql22(), 1);
|
|
188015
188173
|
var recast8 = __toESM3(require_main22(), 1);
|
|
188016
188174
|
var graphql15 = __toESM3(require_graphql22(), 1);
|
|
188017
188175
|
var recast7 = __toESM3(require_main22(), 1);
|
|
188018
|
-
var graphql14 = __toESM3(require_graphql22(), 1);
|
|
188019
|
-
var recast6 = __toESM3(require_main22(), 1);
|
|
188020
|
-
var AST6 = recast6.types.builders;
|
|
188021
188176
|
var AST7 = recast7.types.builders;
|
|
188022
188177
|
var AST8 = recast8.types.builders;
|
|
188023
|
-
var graphql17 = __toESM3(require_graphql22(), 1);
|
|
188024
|
-
var recast9 = __toESM3(require_main22(), 1);
|
|
188025
188178
|
var AST9 = recast9.types.builders;
|
|
188026
|
-
var AST10 = recast10.types.builders;
|
|
188027
188179
|
var graphql18 = __toESM3(require_graphql22(), 1);
|
|
188180
|
+
var recast10 = __toESM3(require_main22(), 1);
|
|
188181
|
+
var AST10 = recast10.types.builders;
|
|
188028
188182
|
var graphql19 = __toESM3(require_graphql22(), 1);
|
|
188029
188183
|
var recast11 = __toESM3(require_main22(), 1);
|
|
188030
188184
|
var AST11 = recast11.types.builders;
|
|
188031
|
-
var
|
|
188185
|
+
var AST12 = recast12.types.builders;
|
|
188186
|
+
var graphql20 = __toESM3(require_graphql22(), 1);
|
|
188032
188187
|
var graphql21 = __toESM3(require_graphql22(), 1);
|
|
188033
|
-
var
|
|
188188
|
+
var recast13 = __toESM3(require_main22(), 1);
|
|
188189
|
+
var AST13 = recast13.types.builders;
|
|
188190
|
+
var import_graphql302 = __toESM3(require_graphql22(), 1);
|
|
188034
188191
|
var graphql23 = __toESM3(require_graphql22(), 1);
|
|
188035
188192
|
var graphql24 = __toESM3(require_graphql22(), 1);
|
|
188036
|
-
var GraphqlKinds2 = graphql24.Kind;
|
|
188037
188193
|
var graphql25 = __toESM3(require_graphql22(), 1);
|
|
188194
|
+
var graphql26 = __toESM3(require_graphql22(), 1);
|
|
188195
|
+
var GraphqlKinds2 = graphql26.Kind;
|
|
188196
|
+
var graphql27 = __toESM3(require_graphql22(), 1);
|
|
188038
188197
|
var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interface but it does not conform to the Global Identification Spec.
|
|
188039
188198
|
|
|
188040
188199
|
If you are trying to provide the Node interface and its field, they must look like the following:
|
|
@@ -188051,7 +188210,7 @@ For more information, please visit these links:
|
|
|
188051
188210
|
- https://graphql.org/learn/global-object-identification/
|
|
188052
188211
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
188053
188212
|
`;
|
|
188054
|
-
var
|
|
188213
|
+
var graphql28 = __toESM3(require_graphql22(), 1);
|
|
188055
188214
|
function find_insert_index(script) {
|
|
188056
188215
|
let insert_index = script.body.findIndex((statement) => {
|
|
188057
188216
|
return statement.type !== "ImportDeclaration";
|
|
@@ -188093,8 +188252,8 @@ function find_exported_fn(body, name2) {
|
|
|
188093
188252
|
}
|
|
188094
188253
|
return exported2.declaration;
|
|
188095
188254
|
}
|
|
188096
|
-
var
|
|
188097
|
-
var
|
|
188255
|
+
var recast14 = __toESM3(require_main22(), 1);
|
|
188256
|
+
var AST14 = recast14.types.builders;
|
|
188098
188257
|
function ensure_imports({
|
|
188099
188258
|
config: config4,
|
|
188100
188259
|
script,
|
|
@@ -188110,13 +188269,13 @@ function ensure_imports({
|
|
|
188110
188269
|
if (!has_import) {
|
|
188111
188270
|
script.body.unshift({
|
|
188112
188271
|
type: "ImportDeclaration",
|
|
188113
|
-
source:
|
|
188272
|
+
source: AST14.stringLiteral(sourceModule),
|
|
188114
188273
|
importKind
|
|
188115
188274
|
});
|
|
188116
188275
|
}
|
|
188117
188276
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
188118
188277
|
}
|
|
188119
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) =>
|
|
188278
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) => AST14.identifier(id2));
|
|
188120
188279
|
const toImport = idList.filter(
|
|
188121
188280
|
(identifier) => !script.body.find(
|
|
188122
188281
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -188127,16 +188286,16 @@ function ensure_imports({
|
|
|
188127
188286
|
if (toImport.length > 0) {
|
|
188128
188287
|
script.body.unshift({
|
|
188129
188288
|
type: "ImportDeclaration",
|
|
188130
|
-
source:
|
|
188289
|
+
source: AST14.stringLiteral(sourceModule),
|
|
188131
188290
|
specifiers: toImport.map(
|
|
188132
|
-
(identifier, i22) => !Array.isArray(importID) ?
|
|
188291
|
+
(identifier, i22) => !Array.isArray(importID) ? AST14.importDefaultSpecifier(identifier) : AST14.importSpecifier(identifier, as?.[i22] ? AST14.identifier(as[i22]) : identifier)
|
|
188133
188292
|
),
|
|
188134
188293
|
importKind
|
|
188135
188294
|
});
|
|
188136
188295
|
}
|
|
188137
188296
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
188138
188297
|
if (target) {
|
|
188139
|
-
idList[i22] =
|
|
188298
|
+
idList[i22] = AST14.identifier(target);
|
|
188140
188299
|
}
|
|
188141
188300
|
}
|
|
188142
188301
|
return {
|
|
@@ -188144,12 +188303,57 @@ function ensure_imports({
|
|
|
188144
188303
|
added: toImport.length
|
|
188145
188304
|
};
|
|
188146
188305
|
}
|
|
188306
|
+
function artifact_import({
|
|
188307
|
+
config: config4,
|
|
188308
|
+
script,
|
|
188309
|
+
artifact,
|
|
188310
|
+
local
|
|
188311
|
+
}) {
|
|
188312
|
+
const { ids, added } = ensure_imports({
|
|
188313
|
+
config: config4,
|
|
188314
|
+
script,
|
|
188315
|
+
sourceModule: config4.artifactImportPath(artifact.name),
|
|
188316
|
+
import: local || `_${artifact.name}Artifact`
|
|
188317
|
+
});
|
|
188318
|
+
return { id: ids, added };
|
|
188319
|
+
}
|
|
188147
188320
|
|
|
188148
188321
|
// src/plugin/transforms/kit/init.ts
|
|
188149
|
-
var
|
|
188322
|
+
var recast15 = __toESM(require_main4(), 1);
|
|
188323
|
+
|
|
188324
|
+
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
188325
|
+
var config3 = {
|
|
188326
|
+
reset: {
|
|
188327
|
+
node: `\x1B[37m\x1B[0m`,
|
|
188328
|
+
browser: ""
|
|
188329
|
+
},
|
|
188330
|
+
green: {
|
|
188331
|
+
node: `\x1B[32m`,
|
|
188332
|
+
browser: "color: green"
|
|
188333
|
+
},
|
|
188334
|
+
magneta: {
|
|
188335
|
+
node: `\x1B[35m`,
|
|
188336
|
+
browser: "color: #ff00ff"
|
|
188337
|
+
},
|
|
188338
|
+
red: {
|
|
188339
|
+
node: `\x1B[31m`,
|
|
188340
|
+
browser: "color: red"
|
|
188341
|
+
},
|
|
188342
|
+
cyan: {
|
|
188343
|
+
node: `\x1B[36m`,
|
|
188344
|
+
browser: "color: cyan"
|
|
188345
|
+
},
|
|
188346
|
+
yellow: {
|
|
188347
|
+
node: `\x1B[33m`,
|
|
188348
|
+
browser: "color: yellow"
|
|
188349
|
+
}
|
|
188350
|
+
};
|
|
188351
|
+
function logYellow(str) {
|
|
188352
|
+
return `${config3.yellow.node}${str}${config3.reset.node}`;
|
|
188353
|
+
}
|
|
188150
188354
|
|
|
188151
188355
|
// src/plugin/extractLoadFunction.ts
|
|
188152
|
-
var
|
|
188356
|
+
var graphql30 = __toESM(require_graphql5(), 1);
|
|
188153
188357
|
var import_vite = require("vite");
|
|
188154
188358
|
|
|
188155
188359
|
// src/plugin/naming.ts
|
|
@@ -188186,7 +188390,7 @@ async function extract_load_function(config4, filepath, mockArtifacts) {
|
|
|
188186
188390
|
return {
|
|
188187
188391
|
exports,
|
|
188188
188392
|
houdini_load: load.map(
|
|
188189
|
-
(query) =>
|
|
188393
|
+
(query) => graphql30.parse(query).definitions[0]
|
|
188190
188394
|
)
|
|
188191
188395
|
};
|
|
188192
188396
|
}
|
|
@@ -188203,10 +188407,7 @@ async function processScript(config4, filepath, program, mockArtifacts) {
|
|
|
188203
188407
|
for (const specifier of statement.specifiers ?? []) {
|
|
188204
188408
|
let name2 = specifier.local?.name || "";
|
|
188205
188409
|
let query = "";
|
|
188206
|
-
|
|
188207
|
-
if (store_prefix && name2.startsWith(store_prefix)) {
|
|
188208
|
-
query = name2.substring(store_prefix.length);
|
|
188209
|
-
} else if (name2.endsWith(store_suffix(config4))) {
|
|
188410
|
+
if (name2.endsWith(store_suffix(config4))) {
|
|
188210
188411
|
query = name2.substring(0, name2.length - store_suffix(config4).length);
|
|
188211
188412
|
} else if (source.startsWith("$houdini/" + stores_directory_name()) && specifier.type === "ImportDefaultSpecifier") {
|
|
188212
188413
|
query = source.substring(`$houdini/${stores_directory_name()}`.length - 1);
|
|
@@ -188253,7 +188454,8 @@ async function processScript(config4, filepath, program, mockArtifacts) {
|
|
|
188253
188454
|
load.push(result);
|
|
188254
188455
|
if (!result) {
|
|
188255
188456
|
throw new Error(
|
|
188256
|
-
`Could not find
|
|
188457
|
+
`Could not find ${logYellow(element.name)} for computing ${logYellow(houdini_load_fn)}. (if it was a global store, you need to instantiate the store manually.)
|
|
188458
|
+
filepath: ${filepath}`
|
|
188257
188459
|
);
|
|
188258
188460
|
}
|
|
188259
188461
|
} else if (element.type === "TaggedTemplateExpression") {
|
|
@@ -188263,6 +188465,27 @@ async function processScript(config4, filepath, program, mockArtifacts) {
|
|
|
188263
188465
|
);
|
|
188264
188466
|
}
|
|
188265
188467
|
load.push(element.quasi.quasis[0].value.raw);
|
|
188468
|
+
} else if (element.type === "CallExpression") {
|
|
188469
|
+
if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
|
|
188470
|
+
throw new Error(`only graphql function can be passed to ${houdini_load_fn}`);
|
|
188471
|
+
}
|
|
188472
|
+
let documentString;
|
|
188473
|
+
const argument = element.arguments[0];
|
|
188474
|
+
if (argument.type === "TemplateLiteral") {
|
|
188475
|
+
documentString = argument.quasis[0].value.raw;
|
|
188476
|
+
} else if (argument.type === "StringLiteral") {
|
|
188477
|
+
documentString = argument.value;
|
|
188478
|
+
} else {
|
|
188479
|
+
throw new Error("only strings can be passed to the graphql function");
|
|
188480
|
+
}
|
|
188481
|
+
load.push(documentString);
|
|
188482
|
+
} else if (element.type === "NewExpression") {
|
|
188483
|
+
const suffix = store_suffix(config4);
|
|
188484
|
+
if (element && element.callee.type === "Identifier" && element.callee.name.endsWith(suffix)) {
|
|
188485
|
+
load.push(globalImports[element.callee.name]);
|
|
188486
|
+
} else {
|
|
188487
|
+
throw new Error(`only query store classes can be passed to ${houdini_load_fn}`);
|
|
188488
|
+
}
|
|
188266
188489
|
}
|
|
188267
188490
|
}
|
|
188268
188491
|
}
|
|
@@ -188287,7 +188510,17 @@ function identifyQueryReference(imports, statement) {
|
|
|
188287
188510
|
if (value2.type === "Identifier" && value2.name in imports) {
|
|
188288
188511
|
return { local, query: imports[value2.name] };
|
|
188289
188512
|
}
|
|
188290
|
-
if (value2.type === "CallExpression" && value2.callee.type
|
|
188513
|
+
if (value2.type === "CallExpression" && value2.callee.type === "Identifier" && value2.callee.name in imports) {
|
|
188514
|
+
return { local, query: imports[value2.callee.name] };
|
|
188515
|
+
}
|
|
188516
|
+
if (value2.type === "CallExpression" && value2.callee.type === "Identifier" && value2.callee.name === "graphql" && value2.arguments.length === 1) {
|
|
188517
|
+
if (value2.arguments[0].type === "StringLiteral") {
|
|
188518
|
+
return { local, query: value2.arguments[0].value };
|
|
188519
|
+
} else if (value2.arguments[0].type === "TemplateLiteral") {
|
|
188520
|
+
return { local, query: value2.arguments[0].quasis[0].value.raw };
|
|
188521
|
+
}
|
|
188522
|
+
}
|
|
188523
|
+
if (value2.type === "NewExpression" && value2.callee.type == "Identifier") {
|
|
188291
188524
|
return { local, query: imports[value2.callee.name] };
|
|
188292
188525
|
}
|
|
188293
188526
|
if (value2.type === "TaggedTemplateExpression") {
|
|
@@ -188370,11 +188603,13 @@ function store_import_path({ config: config4, name: name2 }) {
|
|
|
188370
188603
|
function store_suffix(config4) {
|
|
188371
188604
|
return "Store";
|
|
188372
188605
|
}
|
|
188606
|
+
function store_name({ config: config4, name: name2 }) {
|
|
188607
|
+
return name2 + store_suffix(config4);
|
|
188608
|
+
}
|
|
188373
188609
|
function plugin_config(config4) {
|
|
188374
188610
|
const cfg = config4.pluginConfig("houdini-svelte");
|
|
188375
188611
|
return {
|
|
188376
188612
|
client: "./src/client",
|
|
188377
|
-
globalStorePrefix: "GQL_",
|
|
188378
188613
|
pageQueryFilename: "+page.gql",
|
|
188379
188614
|
layoutQueryFilename: "+layout.gql",
|
|
188380
188615
|
quietQueryErrors: false,
|
|
@@ -188404,13 +188639,18 @@ function store_import({
|
|
|
188404
188639
|
config: page2.config,
|
|
188405
188640
|
script: page2.script,
|
|
188406
188641
|
sourceModule: store_import_path({ config: page2.config, name: artifact.name }),
|
|
188407
|
-
import:
|
|
188642
|
+
import: [
|
|
188643
|
+
store_name({
|
|
188644
|
+
config: page2.config,
|
|
188645
|
+
name: artifact.name
|
|
188646
|
+
})
|
|
188647
|
+
]
|
|
188408
188648
|
});
|
|
188409
|
-
return { id: ids, added };
|
|
188649
|
+
return { id: ids[0], added };
|
|
188410
188650
|
}
|
|
188411
188651
|
|
|
188412
188652
|
// src/plugin/transforms/kit/init.ts
|
|
188413
|
-
var
|
|
188653
|
+
var AST15 = recast15.types.builders;
|
|
188414
188654
|
async function kit_init(page2) {
|
|
188415
188655
|
if (!is_root_layout(page2.config, page2.filepath)) {
|
|
188416
188656
|
return;
|
|
@@ -188434,9 +188674,9 @@ async function kit_init(page2) {
|
|
|
188434
188674
|
import: ["extractSession", "setClientSession"]
|
|
188435
188675
|
}).ids;
|
|
188436
188676
|
page2.script.body.push(
|
|
188437
|
-
|
|
188438
|
-
|
|
188439
|
-
|
|
188677
|
+
AST15.expressionStatement(
|
|
188678
|
+
AST15.callExpression(on_mount, [
|
|
188679
|
+
AST15.arrowFunctionExpression([], AST15.callExpression(set_client_started, []))
|
|
188440
188680
|
])
|
|
188441
188681
|
)
|
|
188442
188682
|
);
|
|
@@ -188447,17 +188687,17 @@ async function kit_init(page2) {
|
|
|
188447
188687
|
import: ["page"]
|
|
188448
188688
|
}).ids[0];
|
|
188449
188689
|
page2.script.body.push(
|
|
188450
|
-
|
|
188451
|
-
|
|
188452
|
-
|
|
188453
|
-
[
|
|
188454
|
-
|
|
188455
|
-
|
|
188456
|
-
|
|
188457
|
-
|
|
188458
|
-
|
|
188459
|
-
|
|
188460
|
-
|
|
188690
|
+
AST15.expressionStatement(
|
|
188691
|
+
AST15.callExpression(AST15.memberExpression(store_id, AST15.identifier("subscribe")), [
|
|
188692
|
+
AST15.arrowFunctionExpression(
|
|
188693
|
+
[AST15.identifier("val")],
|
|
188694
|
+
AST15.blockStatement([
|
|
188695
|
+
AST15.expressionStatement(
|
|
188696
|
+
AST15.callExpression(set_session, [
|
|
188697
|
+
AST15.callExpression(extract_session, [
|
|
188698
|
+
AST15.memberExpression(
|
|
188699
|
+
AST15.identifier("val"),
|
|
188700
|
+
AST15.identifier("data")
|
|
188461
188701
|
)
|
|
188462
188702
|
])
|
|
188463
188703
|
])
|
|
@@ -188469,50 +188709,19 @@ async function kit_init(page2) {
|
|
|
188469
188709
|
);
|
|
188470
188710
|
}
|
|
188471
188711
|
|
|
188472
|
-
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
188473
|
-
var config3 = {
|
|
188474
|
-
reset: {
|
|
188475
|
-
node: `\x1B[37m\x1B[0m`,
|
|
188476
|
-
browser: ""
|
|
188477
|
-
},
|
|
188478
|
-
green: {
|
|
188479
|
-
node: `\x1B[32m`,
|
|
188480
|
-
browser: "color: green"
|
|
188481
|
-
},
|
|
188482
|
-
magneta: {
|
|
188483
|
-
node: `\x1B[35m`,
|
|
188484
|
-
browser: "color: #ff00ff"
|
|
188485
|
-
},
|
|
188486
|
-
red: {
|
|
188487
|
-
node: `\x1B[31m`,
|
|
188488
|
-
browser: "color: red"
|
|
188489
|
-
},
|
|
188490
|
-
cyan: {
|
|
188491
|
-
node: `\x1B[36m`,
|
|
188492
|
-
browser: "color: cyan"
|
|
188493
|
-
},
|
|
188494
|
-
yellow: {
|
|
188495
|
-
node: `\x1B[33m`,
|
|
188496
|
-
browser: "color: yellow"
|
|
188497
|
-
}
|
|
188498
|
-
};
|
|
188499
|
-
function logYellow(str) {
|
|
188500
|
-
return `${config3.yellow.node}${str}${config3.reset.node}`;
|
|
188501
|
-
}
|
|
188502
|
-
|
|
188503
188712
|
// src/plugin/transforms/kit/load.ts
|
|
188504
|
-
var
|
|
188505
|
-
var
|
|
188713
|
+
var graphql31 = __toESM(require_graphql5(), 1);
|
|
188714
|
+
var recast17 = __toESM(require_main4(), 1);
|
|
188506
188715
|
|
|
188507
188716
|
// src/plugin/transforms/query.ts
|
|
188508
|
-
var
|
|
188509
|
-
var
|
|
188717
|
+
var recast16 = __toESM(require_main4(), 1);
|
|
188718
|
+
var AST16 = recast16.types.builders;
|
|
188510
188719
|
async function QueryProcessor(config4, page2) {
|
|
188511
188720
|
if (!is_component(config4, page2.framework, page2.filepath)) {
|
|
188512
188721
|
return;
|
|
188513
188722
|
}
|
|
188514
188723
|
const store_id = (name2) => {
|
|
188515
|
-
return
|
|
188724
|
+
return AST16.identifier(`_houdini_` + name2);
|
|
188516
188725
|
};
|
|
188517
188726
|
const queries = await find_inline_queries(page2, page2.script, store_id);
|
|
188518
188727
|
if (queries.length === 0) {
|
|
@@ -188556,8 +188765,8 @@ async function QueryProcessor(config4, page2) {
|
|
|
188556
188765
|
page2.script.body.splice(
|
|
188557
188766
|
find_insert_index(page2.script),
|
|
188558
188767
|
0,
|
|
188559
|
-
|
|
188560
|
-
|
|
188768
|
+
AST16.variableDeclaration("const", [
|
|
188769
|
+
AST16.variableDeclarator(store_id(query.name), AST16.newExpression(factory, []))
|
|
188561
188770
|
])
|
|
188562
188771
|
);
|
|
188563
188772
|
}
|
|
@@ -188574,42 +188783,42 @@ async function QueryProcessor(config4, page2) {
|
|
|
188574
188783
|
});
|
|
188575
188784
|
}
|
|
188576
188785
|
return [
|
|
188577
|
-
|
|
188578
|
-
|
|
188579
|
-
|
|
188580
|
-
|
|
188581
|
-
|
|
188582
|
-
|
|
188583
|
-
|
|
188584
|
-
|
|
188585
|
-
|
|
188586
|
-
|
|
188786
|
+
AST16.labeledStatement(
|
|
188787
|
+
AST16.identifier("$"),
|
|
188788
|
+
AST16.expressionStatement(
|
|
188789
|
+
AST16.callExpression(
|
|
188790
|
+
AST16.memberExpression(
|
|
188791
|
+
AST16.callExpression(AST16.identifier("marshalInputs"), [
|
|
188792
|
+
AST16.objectExpression([
|
|
188793
|
+
AST16.objectProperty(
|
|
188794
|
+
AST16.identifier("artifact"),
|
|
188795
|
+
AST16.memberExpression(
|
|
188587
188796
|
store_id(query.name),
|
|
188588
|
-
|
|
188797
|
+
AST16.identifier("artifact")
|
|
188589
188798
|
)
|
|
188590
188799
|
),
|
|
188591
|
-
|
|
188592
|
-
|
|
188593
|
-
has_variables ?
|
|
188594
|
-
|
|
188595
|
-
|
|
188596
|
-
|
|
188800
|
+
AST16.objectProperty(
|
|
188801
|
+
AST16.identifier("input"),
|
|
188802
|
+
has_variables ? AST16.callExpression(
|
|
188803
|
+
AST16.memberExpression(
|
|
188804
|
+
AST16.identifier(variable_fn),
|
|
188805
|
+
AST16.identifier("call")
|
|
188597
188806
|
),
|
|
188598
188807
|
[
|
|
188599
|
-
|
|
188600
|
-
|
|
188808
|
+
AST16.newExpression(
|
|
188809
|
+
AST16.identifier("RequestContext"),
|
|
188601
188810
|
[]
|
|
188602
188811
|
),
|
|
188603
|
-
|
|
188604
|
-
|
|
188605
|
-
|
|
188606
|
-
|
|
188812
|
+
AST16.objectExpression([
|
|
188813
|
+
AST16.objectProperty(
|
|
188814
|
+
AST16.identifier("props"),
|
|
188815
|
+
AST16.objectExpression(
|
|
188607
188816
|
props.map(
|
|
188608
|
-
(prop) =>
|
|
188609
|
-
|
|
188817
|
+
(prop) => AST16.objectProperty(
|
|
188818
|
+
AST16.identifier(
|
|
188610
188819
|
prop
|
|
188611
188820
|
),
|
|
188612
|
-
|
|
188821
|
+
AST16.identifier(
|
|
188613
188822
|
prop
|
|
188614
188823
|
)
|
|
188615
188824
|
)
|
|
@@ -188618,27 +188827,27 @@ async function QueryProcessor(config4, page2) {
|
|
|
188618
188827
|
)
|
|
188619
188828
|
])
|
|
188620
188829
|
]
|
|
188621
|
-
) :
|
|
188830
|
+
) : AST16.objectExpression([])
|
|
188622
188831
|
)
|
|
188623
188832
|
])
|
|
188624
188833
|
]),
|
|
188625
|
-
|
|
188834
|
+
AST16.identifier("then")
|
|
188626
188835
|
),
|
|
188627
188836
|
[
|
|
188628
|
-
|
|
188837
|
+
AST16.arrowFunctionExpression(
|
|
188629
188838
|
[local_input_id(query.name)],
|
|
188630
|
-
|
|
188839
|
+
AST16.logicalExpression(
|
|
188631
188840
|
"&&",
|
|
188632
|
-
|
|
188633
|
-
|
|
188634
|
-
|
|
188841
|
+
AST16.identifier("isBrowser"),
|
|
188842
|
+
AST16.callExpression(
|
|
188843
|
+
AST16.memberExpression(
|
|
188635
188844
|
store_id(query.name),
|
|
188636
|
-
|
|
188845
|
+
AST16.identifier("fetch")
|
|
188637
188846
|
),
|
|
188638
188847
|
[
|
|
188639
|
-
|
|
188640
|
-
|
|
188641
|
-
|
|
188848
|
+
AST16.objectExpression([
|
|
188849
|
+
AST16.objectProperty(
|
|
188850
|
+
AST16.identifier("variables"),
|
|
188642
188851
|
local_input_id(query.name)
|
|
188643
188852
|
)
|
|
188644
188853
|
])
|
|
@@ -188686,23 +188895,25 @@ async function find_inline_queries(page2, parsed, store_id) {
|
|
|
188686
188895
|
});
|
|
188687
188896
|
return queries.map((query) => {
|
|
188688
188897
|
return {
|
|
188689
|
-
store_id:
|
|
188898
|
+
store_id: AST16.identifier(""),
|
|
188690
188899
|
name: query.name,
|
|
188691
188900
|
variables: query.variables
|
|
188692
188901
|
};
|
|
188693
188902
|
});
|
|
188694
188903
|
}
|
|
188695
|
-
var local_input_id = (name2) =>
|
|
188904
|
+
var local_input_id = (name2) => AST16.identifier(`_${name2}_Input`);
|
|
188696
188905
|
|
|
188697
188906
|
// src/plugin/transforms/kit/load.ts
|
|
188698
|
-
var
|
|
188907
|
+
var AST17 = recast17.types.builders;
|
|
188699
188908
|
async function kit_load_generator(page2) {
|
|
188700
188909
|
const route = is_route(page2.config, page2.framework, page2.filepath);
|
|
188701
188910
|
const script = is_route_script(page2.framework, page2.filepath);
|
|
188702
188911
|
if (!route && !script) {
|
|
188703
188912
|
return;
|
|
188704
188913
|
}
|
|
188705
|
-
const inline_query_store = (name2) => route ?
|
|
188914
|
+
const inline_query_store = (name2) => route ? AST17.memberExpression(AST17.identifier("data"), AST17.identifier(name2)) : artifact_import({
|
|
188915
|
+
config: page2.config,
|
|
188916
|
+
script: page2.script,
|
|
188706
188917
|
page: page2,
|
|
188707
188918
|
artifact: { name: name2 }
|
|
188708
188919
|
}).id;
|
|
@@ -188723,7 +188934,7 @@ async function kit_load_generator(page2) {
|
|
|
188723
188934
|
houdini_load_queries.push({
|
|
188724
188935
|
name: target.name.value,
|
|
188725
188936
|
variables: operation_requires_variables(target),
|
|
188726
|
-
store_id:
|
|
188937
|
+
store_id: AST17.memberExpression(AST17.identifier(houdini_load_fn), AST17.literal(i3))
|
|
188727
188938
|
});
|
|
188728
188939
|
}
|
|
188729
188940
|
if (script) {
|
|
@@ -188755,8 +188966,8 @@ async function kit_load_generator(page2) {
|
|
|
188755
188966
|
find_insert_index(page2.script),
|
|
188756
188967
|
0,
|
|
188757
188968
|
...!has_data ? [
|
|
188758
|
-
|
|
188759
|
-
|
|
188969
|
+
AST17.exportNamedDeclaration(
|
|
188970
|
+
AST17.variableDeclaration("let", [AST17.identifier("data")])
|
|
188760
188971
|
)
|
|
188761
188972
|
] : []
|
|
188762
188973
|
);
|
|
@@ -188801,43 +189012,43 @@ function add_load({
|
|
|
188801
189012
|
let before_load = page_info.exports.includes(houdini_before_load_fn);
|
|
188802
189013
|
let after_load = page_info.exports.includes(houdini_after_load_fn);
|
|
188803
189014
|
let on_error = page_info.exports.includes(houdini_on_error_fn);
|
|
188804
|
-
const request_context =
|
|
188805
|
-
const promise_list =
|
|
188806
|
-
const return_value =
|
|
188807
|
-
const result_obj =
|
|
188808
|
-
const input_obj =
|
|
188809
|
-
const preload_fn =
|
|
188810
|
-
|
|
188811
|
-
[
|
|
188812
|
-
|
|
188813
|
-
|
|
188814
|
-
|
|
189015
|
+
const request_context = AST17.identifier("houdini_context");
|
|
189016
|
+
const promise_list = AST17.identifier("promises");
|
|
189017
|
+
const return_value = AST17.memberExpression(request_context, AST17.identifier("returnValue"));
|
|
189018
|
+
const result_obj = AST17.identifier("result");
|
|
189019
|
+
const input_obj = AST17.identifier("inputs");
|
|
189020
|
+
const preload_fn = AST17.functionDeclaration(
|
|
189021
|
+
AST17.identifier("load"),
|
|
189022
|
+
[AST17.identifier("context")],
|
|
189023
|
+
AST17.blockStatement([
|
|
189024
|
+
AST17.variableDeclaration("const", [
|
|
189025
|
+
AST17.variableDeclarator(
|
|
188815
189026
|
request_context,
|
|
188816
|
-
|
|
189027
|
+
AST17.newExpression(AST17.identifier("RequestContext"), [AST17.identifier("context")])
|
|
188817
189028
|
)
|
|
188818
189029
|
]),
|
|
188819
|
-
|
|
188820
|
-
|
|
188821
|
-
|
|
188822
|
-
|
|
189030
|
+
AST17.variableDeclaration("const", [
|
|
189031
|
+
AST17.variableDeclarator(
|
|
189032
|
+
AST17.identifier("houdiniConfig"),
|
|
189033
|
+
AST17.awaitExpression(AST17.callExpression(AST17.identifier("getCurrentConfig"), []))
|
|
188823
189034
|
)
|
|
188824
189035
|
]),
|
|
188825
|
-
|
|
188826
|
-
|
|
189036
|
+
AST17.variableDeclaration("const", [
|
|
189037
|
+
AST17.variableDeclarator(promise_list, AST17.arrayExpression([]))
|
|
188827
189038
|
]),
|
|
188828
|
-
|
|
188829
|
-
|
|
189039
|
+
AST17.variableDeclaration("const", [
|
|
189040
|
+
AST17.variableDeclarator(input_obj, AST17.objectExpression([]))
|
|
188830
189041
|
]),
|
|
188831
|
-
|
|
188832
|
-
|
|
188833
|
-
|
|
188834
|
-
|
|
189042
|
+
AST17.returnStatement(
|
|
189043
|
+
AST17.objectExpression([
|
|
189044
|
+
AST17.spreadElement(return_value),
|
|
189045
|
+
AST17.spreadElement(result_obj)
|
|
188835
189046
|
])
|
|
188836
189047
|
)
|
|
188837
189048
|
])
|
|
188838
189049
|
);
|
|
188839
189050
|
preload_fn.async = true;
|
|
188840
|
-
page2.script.body.push(
|
|
189051
|
+
page2.script.body.push(AST17.exportNamedDeclaration(preload_fn));
|
|
188841
189052
|
let insert_index = 4;
|
|
188842
189053
|
for (const query of queries) {
|
|
188843
189054
|
const { ids } = ensure_imports({
|
|
@@ -188847,40 +189058,39 @@ function add_load({
|
|
|
188847
189058
|
sourceModule: store_import_path({ config: page2.config, name: query.name })
|
|
188848
189059
|
});
|
|
188849
189060
|
const load_fn = ids[0];
|
|
188850
|
-
const variables = page_info.exports.includes(query_variable_fn(query.name)) ?
|
|
188851
|
-
|
|
188852
|
-
|
|
189061
|
+
const variables = page_info.exports.includes(query_variable_fn(query.name)) ? AST17.awaitExpression(
|
|
189062
|
+
AST17.callExpression(
|
|
189063
|
+
AST17.memberExpression(request_context, AST17.identifier("computeInput")),
|
|
188853
189064
|
[
|
|
188854
|
-
|
|
188855
|
-
|
|
188856
|
-
|
|
188857
|
-
|
|
189065
|
+
AST17.objectExpression([
|
|
189066
|
+
AST17.objectProperty(
|
|
189067
|
+
AST17.literal("config"),
|
|
189068
|
+
AST17.identifier("houdiniConfig")
|
|
188858
189069
|
),
|
|
188859
|
-
|
|
188860
|
-
|
|
188861
|
-
|
|
189070
|
+
AST17.objectProperty(
|
|
189071
|
+
AST17.literal("variableFunction"),
|
|
189072
|
+
AST17.identifier(query_variable_fn(query.name))
|
|
188862
189073
|
),
|
|
188863
|
-
|
|
188864
|
-
|
|
188865
|
-
|
|
188866
|
-
|
|
188867
|
-
|
|
188868
|
-
|
|
188869
|
-
}
|
|
188870
|
-
|
|
188871
|
-
)
|
|
189074
|
+
AST17.objectProperty(
|
|
189075
|
+
AST17.literal("artifact"),
|
|
189076
|
+
artifact_import({
|
|
189077
|
+
config: page2.config,
|
|
189078
|
+
script: page2.script,
|
|
189079
|
+
page: page2,
|
|
189080
|
+
artifact: { name: query.name }
|
|
189081
|
+
}).id
|
|
188872
189082
|
)
|
|
188873
189083
|
])
|
|
188874
189084
|
]
|
|
188875
189085
|
)
|
|
188876
|
-
) :
|
|
189086
|
+
) : AST17.objectExpression([]);
|
|
188877
189087
|
preload_fn.body.body.splice(
|
|
188878
189088
|
insert_index++,
|
|
188879
189089
|
0,
|
|
188880
|
-
|
|
188881
|
-
|
|
189090
|
+
AST17.expressionStatement(
|
|
189091
|
+
AST17.assignmentExpression(
|
|
188882
189092
|
"=",
|
|
188883
|
-
|
|
189093
|
+
AST17.memberExpression(input_obj, AST17.literal(query.name)),
|
|
188884
189094
|
variables
|
|
188885
189095
|
)
|
|
188886
189096
|
)
|
|
@@ -188888,18 +189098,18 @@ function add_load({
|
|
|
188888
189098
|
preload_fn.body.body.splice(
|
|
188889
189099
|
insert_index++,
|
|
188890
189100
|
0,
|
|
188891
|
-
|
|
188892
|
-
|
|
188893
|
-
|
|
188894
|
-
|
|
188895
|
-
|
|
188896
|
-
|
|
188897
|
-
|
|
189101
|
+
AST17.expressionStatement(
|
|
189102
|
+
AST17.callExpression(AST17.memberExpression(promise_list, AST17.identifier("push")), [
|
|
189103
|
+
AST17.callExpression(load_fn, [
|
|
189104
|
+
AST17.objectExpression([
|
|
189105
|
+
AST17.objectProperty(
|
|
189106
|
+
AST17.literal("variables"),
|
|
189107
|
+
AST17.memberExpression(input_obj, AST17.literal(query.name))
|
|
188898
189108
|
),
|
|
188899
|
-
|
|
188900
|
-
|
|
188901
|
-
|
|
188902
|
-
|
|
189109
|
+
AST17.objectProperty(AST17.literal("event"), AST17.identifier("context")),
|
|
189110
|
+
AST17.objectProperty(
|
|
189111
|
+
AST17.literal("blocking"),
|
|
189112
|
+
AST17.booleanLiteral(after_load || on_error)
|
|
188903
189113
|
)
|
|
188904
189114
|
])
|
|
188905
189115
|
])
|
|
@@ -188911,28 +189121,28 @@ function add_load({
|
|
|
188911
189121
|
preload_fn.body.body.splice(
|
|
188912
189122
|
insert_index++,
|
|
188913
189123
|
0,
|
|
188914
|
-
|
|
188915
|
-
|
|
189124
|
+
AST17.variableDeclaration("let", [
|
|
189125
|
+
AST17.variableDeclarator(result_obj, AST17.objectExpression([]))
|
|
188916
189126
|
]),
|
|
188917
|
-
|
|
188918
|
-
|
|
188919
|
-
|
|
188920
|
-
|
|
189127
|
+
AST17.tryStatement(
|
|
189128
|
+
AST17.blockStatement([
|
|
189129
|
+
AST17.expressionStatement(
|
|
189130
|
+
AST17.assignmentExpression(
|
|
188921
189131
|
"=",
|
|
188922
189132
|
result_obj,
|
|
188923
|
-
|
|
188924
|
-
|
|
188925
|
-
|
|
188926
|
-
|
|
189133
|
+
AST17.callExpression(
|
|
189134
|
+
AST17.memberExpression(
|
|
189135
|
+
AST17.identifier("Object"),
|
|
189136
|
+
AST17.identifier("assign")
|
|
188927
189137
|
),
|
|
188928
189138
|
[
|
|
188929
|
-
|
|
188930
|
-
|
|
188931
|
-
|
|
188932
|
-
|
|
188933
|
-
|
|
188934
|
-
|
|
188935
|
-
|
|
189139
|
+
AST17.objectExpression([]),
|
|
189140
|
+
AST17.spreadElement(
|
|
189141
|
+
AST17.awaitExpression(
|
|
189142
|
+
AST17.callExpression(
|
|
189143
|
+
AST17.memberExpression(
|
|
189144
|
+
AST17.identifier("Promise"),
|
|
189145
|
+
AST17.identifier("all")
|
|
188936
189146
|
),
|
|
188937
189147
|
[promise_list]
|
|
188938
189148
|
)
|
|
@@ -188943,37 +189153,37 @@ function add_load({
|
|
|
188943
189153
|
)
|
|
188944
189154
|
)
|
|
188945
189155
|
]),
|
|
188946
|
-
|
|
188947
|
-
|
|
189156
|
+
AST17.catchClause(
|
|
189157
|
+
AST17.identifier("err"),
|
|
188948
189158
|
null,
|
|
188949
|
-
|
|
188950
|
-
on_error ?
|
|
188951
|
-
|
|
188952
|
-
|
|
188953
|
-
|
|
189159
|
+
AST17.blockStatement([
|
|
189160
|
+
on_error ? AST17.expressionStatement(
|
|
189161
|
+
AST17.awaitExpression(
|
|
189162
|
+
AST17.callExpression(
|
|
189163
|
+
AST17.memberExpression(
|
|
188954
189164
|
request_context,
|
|
188955
|
-
|
|
189165
|
+
AST17.identifier("invokeLoadHook")
|
|
188956
189166
|
),
|
|
188957
189167
|
[
|
|
188958
|
-
|
|
188959
|
-
|
|
188960
|
-
|
|
188961
|
-
|
|
189168
|
+
AST17.objectExpression([
|
|
189169
|
+
AST17.objectProperty(
|
|
189170
|
+
AST17.literal("variant"),
|
|
189171
|
+
AST17.stringLiteral("error")
|
|
188962
189172
|
),
|
|
188963
|
-
|
|
188964
|
-
|
|
188965
|
-
|
|
189173
|
+
AST17.objectProperty(
|
|
189174
|
+
AST17.literal("hookFn"),
|
|
189175
|
+
AST17.identifier(houdini_on_error_fn)
|
|
188966
189176
|
),
|
|
188967
|
-
|
|
188968
|
-
|
|
188969
|
-
|
|
189177
|
+
AST17.objectProperty(
|
|
189178
|
+
AST17.literal("error"),
|
|
189179
|
+
AST17.identifier("err")
|
|
188970
189180
|
),
|
|
188971
|
-
|
|
189181
|
+
AST17.objectProperty(AST17.literal("input"), input_obj)
|
|
188972
189182
|
])
|
|
188973
189183
|
]
|
|
188974
189184
|
)
|
|
188975
189185
|
)
|
|
188976
|
-
) :
|
|
189186
|
+
) : AST17.throwStatement(AST17.identifier("err"))
|
|
188977
189187
|
])
|
|
188978
189188
|
)
|
|
188979
189189
|
)
|
|
@@ -188997,7 +189207,7 @@ async function find_special_query(type, page2) {
|
|
|
188997
189207
|
if (!contents) {
|
|
188998
189208
|
return null;
|
|
188999
189209
|
}
|
|
189000
|
-
const parsed =
|
|
189210
|
+
const parsed = graphql31.parse(contents);
|
|
189001
189211
|
const definition = parsed.definitions.find(
|
|
189002
189212
|
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
189003
189213
|
);
|
|
@@ -189005,33 +189215,28 @@ async function find_special_query(type, page2) {
|
|
|
189005
189215
|
formatErrors({ message: "gql file must contain a query.", filepath: query_path });
|
|
189006
189216
|
return null;
|
|
189007
189217
|
}
|
|
189008
|
-
const { id: id2 } = store_import({
|
|
189009
|
-
page: page2,
|
|
189010
|
-
artifact: { name: definition.name.value }
|
|
189011
|
-
});
|
|
189012
189218
|
return {
|
|
189013
|
-
store_id: id2,
|
|
189014
189219
|
name: definition.name.value,
|
|
189015
189220
|
variables: operation_requires_variables(definition)
|
|
189016
189221
|
};
|
|
189017
189222
|
}
|
|
189018
189223
|
function load_hook_statements(name2, request_context, input_id, result_id) {
|
|
189019
|
-
return
|
|
189020
|
-
|
|
189021
|
-
|
|
189022
|
-
|
|
189224
|
+
return AST17.expressionStatement(
|
|
189225
|
+
AST17.awaitExpression(
|
|
189226
|
+
AST17.callExpression(
|
|
189227
|
+
AST17.memberExpression(request_context, AST17.identifier("invokeLoadHook")),
|
|
189023
189228
|
[
|
|
189024
|
-
|
|
189025
|
-
|
|
189026
|
-
|
|
189027
|
-
|
|
189028
|
-
|
|
189229
|
+
AST17.objectExpression([
|
|
189230
|
+
AST17.objectProperty(AST17.literal("variant"), AST17.stringLiteral(name2)),
|
|
189231
|
+
AST17.objectProperty(
|
|
189232
|
+
AST17.literal("hookFn"),
|
|
189233
|
+
AST17.identifier(
|
|
189029
189234
|
name2 === "before" ? houdini_before_load_fn : houdini_after_load_fn
|
|
189030
189235
|
)
|
|
189031
189236
|
),
|
|
189032
189237
|
...name2 === "after" ? [
|
|
189033
|
-
|
|
189034
|
-
|
|
189238
|
+
AST17.objectProperty(AST17.literal("input"), input_id),
|
|
189239
|
+
AST17.objectProperty(AST17.literal("data"), result_id)
|
|
189035
189240
|
] : []
|
|
189036
189241
|
])
|
|
189037
189242
|
]
|
|
@@ -189060,8 +189265,8 @@ function unexported_data_error(filepath) {
|
|
|
189060
189265
|
}
|
|
189061
189266
|
|
|
189062
189267
|
// src/plugin/transforms/kit/session.ts
|
|
189063
|
-
var
|
|
189064
|
-
var
|
|
189268
|
+
var recast18 = __toESM(require_main4(), 1);
|
|
189269
|
+
var AST18 = recast18.types.builders;
|
|
189065
189270
|
function session_default(page2) {
|
|
189066
189271
|
if (is_root_layout_server(page2.config, page2.filepath)) {
|
|
189067
189272
|
process_root_layout_server(page2);
|
|
@@ -189077,12 +189282,12 @@ function process_root_layout_server(page2) {
|
|
|
189077
189282
|
sourceModule: "$houdini/plugins/houdini-svelte/runtime/session"
|
|
189078
189283
|
}).ids[0];
|
|
189079
189284
|
add_load_return(page2, (event_id) => [
|
|
189080
|
-
|
|
189285
|
+
AST18.spreadElement(AST18.callExpression(build_session_object, [event_id]))
|
|
189081
189286
|
]);
|
|
189082
189287
|
}
|
|
189083
189288
|
function process_root_layout_script(page2) {
|
|
189084
189289
|
add_load_return(page2, (event_id) => [
|
|
189085
|
-
|
|
189290
|
+
AST18.spreadElement(AST18.memberExpression(event_id, AST18.identifier("data")))
|
|
189086
189291
|
]);
|
|
189087
189292
|
}
|
|
189088
189293
|
function add_load_return(page2, properties) {
|
|
@@ -189094,48 +189299,48 @@ function add_load_return(page2, properties) {
|
|
|
189094
189299
|
if (return_statement_index !== -1) {
|
|
189095
189300
|
return_statement = body.body[return_statement_index];
|
|
189096
189301
|
} else {
|
|
189097
|
-
return_statement =
|
|
189302
|
+
return_statement = AST18.returnStatement(AST18.objectExpression([]));
|
|
189098
189303
|
body.body.push(return_statement);
|
|
189099
189304
|
return_statement_index = body.body.length - 1;
|
|
189100
189305
|
}
|
|
189101
|
-
const local_return_var =
|
|
189102
|
-
body.body[return_statement_index] =
|
|
189103
|
-
|
|
189306
|
+
const local_return_var = AST18.identifier("__houdini__vite__plugin__return__value__");
|
|
189307
|
+
body.body[return_statement_index] = AST18.variableDeclaration("const", [
|
|
189308
|
+
AST18.variableDeclarator(local_return_var, return_statement.argument)
|
|
189104
189309
|
]);
|
|
189105
189310
|
body.body.splice(
|
|
189106
189311
|
return_statement_index + 1,
|
|
189107
189312
|
0,
|
|
189108
|
-
|
|
189109
|
-
|
|
189313
|
+
AST18.returnStatement(
|
|
189314
|
+
AST18.objectExpression([...properties(event_id), AST18.spreadElement(local_return_var)])
|
|
189110
189315
|
)
|
|
189111
189316
|
);
|
|
189112
189317
|
});
|
|
189113
189318
|
}
|
|
189114
189319
|
function modify_load(page2, cb) {
|
|
189115
189320
|
let load_fn = find_exported_fn(page2.script.body, "load");
|
|
189116
|
-
let event_id =
|
|
189117
|
-
let body =
|
|
189321
|
+
let event_id = AST18.identifier("event");
|
|
189322
|
+
let body = AST18.blockStatement([]);
|
|
189118
189323
|
if (load_fn?.type === "ArrowFunctionExpression") {
|
|
189119
189324
|
if (load_fn.body.type === "BlockStatement") {
|
|
189120
189325
|
body = load_fn.body;
|
|
189121
189326
|
} else {
|
|
189122
|
-
body =
|
|
189327
|
+
body = AST18.blockStatement([AST18.returnStatement(load_fn.body)]);
|
|
189123
189328
|
load_fn.body = body;
|
|
189124
189329
|
}
|
|
189125
189330
|
} else if (load_fn) {
|
|
189126
189331
|
body = load_fn.body;
|
|
189127
189332
|
}
|
|
189128
189333
|
if (!load_fn) {
|
|
189129
|
-
load_fn =
|
|
189130
|
-
|
|
189334
|
+
load_fn = AST18.functionDeclaration(
|
|
189335
|
+
AST18.identifier("load"),
|
|
189131
189336
|
[event_id],
|
|
189132
|
-
|
|
189337
|
+
AST18.blockStatement([])
|
|
189133
189338
|
);
|
|
189134
189339
|
load_fn.async = true;
|
|
189135
189340
|
page2.script.body.splice(
|
|
189136
189341
|
find_insert_index(page2.script),
|
|
189137
189342
|
0,
|
|
189138
|
-
|
|
189343
|
+
AST18.exportNamedDeclaration(load_fn)
|
|
189139
189344
|
);
|
|
189140
189345
|
body = load_fn.body;
|
|
189141
189346
|
} else {
|
|
@@ -189147,7 +189352,7 @@ function modify_load(page2, cb) {
|
|
|
189147
189352
|
const pattern = load_fn.params[0];
|
|
189148
189353
|
load_fn.params[0] = event_id;
|
|
189149
189354
|
body.body.unshift(
|
|
189150
|
-
|
|
189355
|
+
AST18.variableDeclaration("let", [AST18.variableDeclarator(pattern, event_id)])
|
|
189151
189356
|
);
|
|
189152
189357
|
} else {
|
|
189153
189358
|
throw new Error(
|
|
@@ -189280,13 +189485,13 @@ function walk2(ast, { enter, leave }) {
|
|
|
189280
189485
|
}
|
|
189281
189486
|
|
|
189282
189487
|
// src/plugin/transforms/reactive.ts
|
|
189283
|
-
var
|
|
189284
|
-
var
|
|
189488
|
+
var recast19 = __toESM(require_main4(), 1);
|
|
189489
|
+
var AST19 = recast19.types.builders;
|
|
189285
189490
|
async function ReactiveProcessor(config4, page2) {
|
|
189286
189491
|
if (!is_component(config4, page2.framework, page2.filepath) && !is_route(config4, page2.framework, page2.filepath)) {
|
|
189287
189492
|
return;
|
|
189288
189493
|
}
|
|
189289
|
-
const magicFunctions = ["
|
|
189494
|
+
const magicFunctions = ["graphql", "fragment", "paginatedFragment"];
|
|
189290
189495
|
if (!magicFunctions.includes("graphql") || magicFunctions.length === 1) {
|
|
189291
189496
|
return;
|
|
189292
189497
|
}
|
|
@@ -189319,9 +189524,9 @@ async function ReactiveProcessor(config4, page2) {
|
|
|
189319
189524
|
declaration.id.typeAnnotation = null;
|
|
189320
189525
|
}
|
|
189321
189526
|
this.replace(
|
|
189322
|
-
|
|
189323
|
-
|
|
189324
|
-
|
|
189527
|
+
AST19.labeledStatement(
|
|
189528
|
+
AST19.identifier("$"),
|
|
189529
|
+
AST19.expressionStatement(AST19.assignmentExpression("=", declaration.id, value2))
|
|
189325
189530
|
)
|
|
189326
189531
|
);
|
|
189327
189532
|
}
|
|
@@ -189331,9 +189536,11 @@ function filterCallExpr(expr) {
|
|
|
189331
189536
|
if (expr.type !== "CallExpression" || expr.callee.type !== "Identifier") {
|
|
189332
189537
|
return;
|
|
189333
189538
|
}
|
|
189334
|
-
|
|
189335
|
-
|
|
189336
|
-
|
|
189539
|
+
if (expr.callee.type === "Identifier" && expr.callee.name === "graphql" && expr.arguments.length === 1 && (expr.arguments[0].type === "StringLiteral" || expr.arguments[0].type === "TemplateLiteral")) {
|
|
189540
|
+
return true;
|
|
189541
|
+
}
|
|
189542
|
+
const tag2 = expr.arguments.find(
|
|
189543
|
+
(arg) => arg.type === "TaggedTemplateExpression" && arg.tag.type === "Identifier" && arg.tag.name === "graphql" || arg.type === "CallExpression" && arg.callee.type === "Identifier" && arg.callee.name === "graphql" && arg.arguments.length === 1 && (arg.arguments[0].type === "StringLiteral" || arg.arguments[0].type === "TemplateLiteral")
|
|
189337
189544
|
);
|
|
189338
189545
|
if (!tag2) {
|
|
189339
189546
|
return;
|
|
@@ -189345,13 +189552,16 @@ function filterTaggedTemplate(expr) {
|
|
|
189345
189552
|
}
|
|
189346
189553
|
|
|
189347
189554
|
// src/plugin/transforms/tags.ts
|
|
189555
|
+
var recast20 = __toESM(require_main4(), 1);
|
|
189556
|
+
var AST20 = recast20.types.builders;
|
|
189348
189557
|
async function GraphQLTagProcessor(config4, page2) {
|
|
189349
189558
|
await find_graphql(config4, page2.script, {
|
|
189350
189559
|
dependency: page2.watch_file,
|
|
189351
189560
|
tag(tag2) {
|
|
189352
189561
|
const { node: node2, parsedDocument } = tag2;
|
|
189353
189562
|
const operation = config4.extractDefinition(parsedDocument);
|
|
189354
|
-
|
|
189563
|
+
const { id: id2 } = store_import({ page: page2, artifact: { name: operation.name.value } });
|
|
189564
|
+
node2.replaceWith(AST20.newExpression(id2, []));
|
|
189355
189565
|
}
|
|
189356
189566
|
});
|
|
189357
189567
|
}
|
|
@@ -189373,7 +189583,7 @@ async function apply_transforms(framework, page2) {
|
|
|
189373
189583
|
script = {
|
|
189374
189584
|
start: 0,
|
|
189375
189585
|
end: 0,
|
|
189376
|
-
script:
|
|
189586
|
+
script: recast21.types.builders.program([])
|
|
189377
189587
|
};
|
|
189378
189588
|
}
|
|
189379
189589
|
if (!script) {
|
|
@@ -189390,7 +189600,7 @@ async function apply_transforms(framework, page2) {
|
|
|
189390
189600
|
formatErrors({ message: e3.message, filepath: page2.filepath });
|
|
189391
189601
|
return { code: page2.content };
|
|
189392
189602
|
}
|
|
189393
|
-
const printedScript =
|
|
189603
|
+
const printedScript = recast21.print(result.script).code;
|
|
189394
189604
|
return {
|
|
189395
189605
|
code: !page2.filepath.endsWith(".svelte") ? printedScript : replace_tag_content(page2.content, script.start, script.end, printedScript)
|
|
189396
189606
|
};
|