houdini 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +613 -562
- package/build/cmd-esm/index.js +613 -562
- package/build/codegen/generators/artifacts/selection.d.ts +1 -3
- package/build/codegen-cjs/index.js +600 -549
- package/build/codegen-esm/index.js +600 -549
- package/build/lib-cjs/index.js +41 -10
- package/build/lib-esm/index.js +41 -10
- package/build/runtime/cache/cache.d.ts +2 -0
- package/build/runtime/cache/gc.d.ts +1 -0
- package/build/runtime/cache/lists.d.ts +1 -0
- package/build/runtime/cache/staleManager.d.ts +1 -0
- package/build/runtime/cache/storage.d.ts +1 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/public/cache.d.ts +4 -0
- package/build/runtime-cjs/cache/cache.d.ts +2 -0
- package/build/runtime-cjs/cache/cache.js +16 -10
- package/build/runtime-cjs/cache/gc.d.ts +1 -0
- package/build/runtime-cjs/cache/gc.js +3 -0
- package/build/runtime-cjs/cache/lists.d.ts +1 -0
- package/build/runtime-cjs/cache/lists.js +4 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +1 -0
- package/build/runtime-cjs/cache/staleManager.js +3 -0
- package/build/runtime-cjs/cache/storage.d.ts +1 -0
- package/build/runtime-cjs/cache/storage.js +3 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +13 -0
- package/build/runtime-cjs/public/cache.d.ts +4 -0
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-esm/cache/cache.d.ts +2 -0
- package/build/runtime-esm/cache/cache.js +16 -10
- package/build/runtime-esm/cache/gc.d.ts +1 -0
- package/build/runtime-esm/cache/gc.js +3 -0
- package/build/runtime-esm/cache/lists.d.ts +1 -0
- package/build/runtime-esm/cache/lists.js +4 -0
- package/build/runtime-esm/cache/staleManager.d.ts +1 -0
- package/build/runtime-esm/cache/staleManager.js +3 -0
- package/build/runtime-esm/cache/storage.d.ts +1 -0
- package/build/runtime-esm/cache/storage.js +3 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +13 -0
- package/build/runtime-esm/public/cache.d.ts +4 -0
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/test-cjs/index.js +603 -552
- package/build/test-esm/index.js +603 -552
- package/build/vite-cjs/index.js +618 -567
- package/build/vite-esm/index.js +618 -567
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -3725,12 +3725,12 @@ var require_parser = __commonJS({
|
|
|
3725
3725
|
return [];
|
|
3726
3726
|
}
|
|
3727
3727
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
3728
|
-
var
|
|
3728
|
+
var types17 = [];
|
|
3729
3729
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
3730
3730
|
do {
|
|
3731
|
-
|
|
3731
|
+
types17.push(this.parseNamedType());
|
|
3732
3732
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
3733
|
-
return
|
|
3733
|
+
return types17;
|
|
3734
3734
|
}
|
|
3735
3735
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
3736
3736
|
};
|
|
@@ -3809,13 +3809,13 @@ var require_parser = __commonJS({
|
|
|
3809
3809
|
this.expectKeyword("union");
|
|
3810
3810
|
var name = this.parseName();
|
|
3811
3811
|
var directives = this.parseDirectives(true);
|
|
3812
|
-
var
|
|
3812
|
+
var types17 = this.parseUnionMemberTypes();
|
|
3813
3813
|
return {
|
|
3814
3814
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
3815
3815
|
description,
|
|
3816
3816
|
name,
|
|
3817
3817
|
directives,
|
|
3818
|
-
types:
|
|
3818
|
+
types: types17,
|
|
3819
3819
|
loc: this.loc(start)
|
|
3820
3820
|
};
|
|
3821
3821
|
};
|
|
@@ -3973,15 +3973,15 @@ var require_parser = __commonJS({
|
|
|
3973
3973
|
this.expectKeyword("union");
|
|
3974
3974
|
var name = this.parseName();
|
|
3975
3975
|
var directives = this.parseDirectives(true);
|
|
3976
|
-
var
|
|
3977
|
-
if (directives.length === 0 &&
|
|
3976
|
+
var types17 = this.parseUnionMemberTypes();
|
|
3977
|
+
if (directives.length === 0 && types17.length === 0) {
|
|
3978
3978
|
throw this.unexpected();
|
|
3979
3979
|
}
|
|
3980
3980
|
return {
|
|
3981
3981
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
3982
3982
|
name,
|
|
3983
3983
|
directives,
|
|
3984
|
-
types:
|
|
3984
|
+
types: types17,
|
|
3985
3985
|
loc: this.loc(start)
|
|
3986
3986
|
};
|
|
3987
3987
|
};
|
|
@@ -4959,8 +4959,8 @@ var require_printer = __commonJS({
|
|
|
4959
4959
|
return join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
4960
4960
|
}),
|
|
4961
4961
|
UnionTypeDefinition: addDescription2(function(_ref27) {
|
|
4962
|
-
var name = _ref27.name, directives = _ref27.directives,
|
|
4963
|
-
return join3(["union", name, join3(directives, " "),
|
|
4962
|
+
var name = _ref27.name, directives = _ref27.directives, types17 = _ref27.types;
|
|
4963
|
+
return join3(["union", name, join3(directives, " "), types17 && types17.length !== 0 ? "= " + join3(types17, " | ") : ""], " ");
|
|
4964
4964
|
}),
|
|
4965
4965
|
EnumTypeDefinition: addDescription2(function(_ref28) {
|
|
4966
4966
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -4995,8 +4995,8 @@ var require_printer = __commonJS({
|
|
|
4995
4995
|
return join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
4996
4996
|
},
|
|
4997
4997
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
4998
|
-
var name = _ref36.name, directives = _ref36.directives,
|
|
4999
|
-
return join3(["extend union", name, join3(directives, " "),
|
|
4998
|
+
var name = _ref36.name, directives = _ref36.directives, types17 = _ref36.types;
|
|
4999
|
+
return join3(["extend union", name, join3(directives, " "), types17 && types17.length !== 0 ? "= " + join3(types17, " | ") : ""], " ");
|
|
5000
5000
|
},
|
|
5001
5001
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
5002
5002
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -5667,9 +5667,9 @@ var require_definition = __commonJS({
|
|
|
5667
5667
|
exports.GraphQLUnionType = GraphQLUnionType3;
|
|
5668
5668
|
(0, _defineInspect.default)(GraphQLUnionType3);
|
|
5669
5669
|
function defineTypes(config2) {
|
|
5670
|
-
var
|
|
5671
|
-
Array.isArray(
|
|
5672
|
-
return
|
|
5670
|
+
var types17 = resolveThunk(config2.types);
|
|
5671
|
+
Array.isArray(types17) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
|
|
5672
|
+
return types17;
|
|
5673
5673
|
}
|
|
5674
5674
|
var GraphQLEnumType4 = /* @__PURE__ */ function() {
|
|
5675
5675
|
function GraphQLEnumType5(config2) {
|
|
@@ -13306,7 +13306,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
13306
13306
|
return new _definition.GraphQLUnionType({
|
|
13307
13307
|
name: unionIntrospection.name,
|
|
13308
13308
|
description: unionIntrospection.description,
|
|
13309
|
-
types: function
|
|
13309
|
+
types: function types17() {
|
|
13310
13310
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
13311
13311
|
}
|
|
13312
13312
|
});
|
|
@@ -13651,7 +13651,7 @@ var require_extendSchema = __commonJS({
|
|
|
13651
13651
|
var config2 = type.toConfig();
|
|
13652
13652
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
13653
13653
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
|
|
13654
|
-
types: function
|
|
13654
|
+
types: function types17() {
|
|
13655
13655
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
13656
13656
|
},
|
|
13657
13657
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -13799,17 +13799,17 @@ var require_extendSchema = __commonJS({
|
|
|
13799
13799
|
return interfaces;
|
|
13800
13800
|
}
|
|
13801
13801
|
function buildUnionTypes(nodes) {
|
|
13802
|
-
var
|
|
13802
|
+
var types17 = [];
|
|
13803
13803
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
13804
13804
|
var _node$types;
|
|
13805
13805
|
var node = nodes[_i32];
|
|
13806
13806
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
13807
13807
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
13808
13808
|
var type = typeNodes[_i34];
|
|
13809
|
-
|
|
13809
|
+
types17.push(getNamedType5(type));
|
|
13810
13810
|
}
|
|
13811
13811
|
}
|
|
13812
|
-
return
|
|
13812
|
+
return types17;
|
|
13813
13813
|
}
|
|
13814
13814
|
function buildType(astNode) {
|
|
13815
13815
|
var _typeExtensionsMap$na;
|
|
@@ -13866,7 +13866,7 @@ var require_extendSchema = __commonJS({
|
|
|
13866
13866
|
return new _definition.GraphQLUnionType({
|
|
13867
13867
|
name: name2,
|
|
13868
13868
|
description,
|
|
13869
|
-
types: function
|
|
13869
|
+
types: function types17() {
|
|
13870
13870
|
return buildUnionTypes(_allNodes3);
|
|
13871
13871
|
},
|
|
13872
13872
|
astNode,
|
|
@@ -14164,7 +14164,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
14164
14164
|
if ((0, _definition.isUnionType)(type)) {
|
|
14165
14165
|
var _config22 = type.toConfig();
|
|
14166
14166
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
|
|
14167
|
-
types: function
|
|
14167
|
+
types: function types17() {
|
|
14168
14168
|
return sortTypes(_config22.types);
|
|
14169
14169
|
}
|
|
14170
14170
|
}));
|
|
@@ -14249,10 +14249,10 @@ var require_printSchema = __commonJS({
|
|
|
14249
14249
|
}
|
|
14250
14250
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
14251
14251
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
14252
|
-
var
|
|
14252
|
+
var types17 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
14253
14253
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
14254
14254
|
return printDirective(directive, options);
|
|
14255
|
-
}),
|
|
14255
|
+
}), types17.map(function(type) {
|
|
14256
14256
|
return printType(type, options);
|
|
14257
14257
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
14258
14258
|
}
|
|
@@ -14327,8 +14327,8 @@ var require_printSchema = __commonJS({
|
|
|
14327
14327
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
14328
14328
|
}
|
|
14329
14329
|
function printUnion(type, options) {
|
|
14330
|
-
var
|
|
14331
|
-
var possibleTypes =
|
|
14330
|
+
var types17 = type.getTypes();
|
|
14331
|
+
var possibleTypes = types17.length ? " = " + types17.join(" | ") : "";
|
|
14332
14332
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
14333
14333
|
}
|
|
14334
14334
|
function printEnum(type, options) {
|
|
@@ -30007,14 +30007,14 @@ var require_lib3 = __commonJS({
|
|
|
30007
30007
|
this.preserveSpace = !!preserveSpace;
|
|
30008
30008
|
}
|
|
30009
30009
|
};
|
|
30010
|
-
var
|
|
30010
|
+
var types17 = {
|
|
30011
30011
|
brace: new TokContext("{"),
|
|
30012
30012
|
j_oTag: new TokContext("<tag"),
|
|
30013
30013
|
j_cTag: new TokContext("</tag"),
|
|
30014
30014
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
30015
30015
|
};
|
|
30016
30016
|
{
|
|
30017
|
-
|
|
30017
|
+
types17.template = new TokContext("`", true);
|
|
30018
30018
|
}
|
|
30019
30019
|
var beforeExpr = true;
|
|
30020
30020
|
var startsExpr = true;
|
|
@@ -30546,17 +30546,17 @@ var require_lib3 = __commonJS({
|
|
|
30546
30546
|
context.pop();
|
|
30547
30547
|
};
|
|
30548
30548
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
30549
|
-
context.push(
|
|
30549
|
+
context.push(types17.brace);
|
|
30550
30550
|
};
|
|
30551
30551
|
tokenTypes[22].updateContext = (context) => {
|
|
30552
|
-
if (context[context.length - 1] ===
|
|
30552
|
+
if (context[context.length - 1] === types17.template) {
|
|
30553
30553
|
context.pop();
|
|
30554
30554
|
} else {
|
|
30555
|
-
context.push(
|
|
30555
|
+
context.push(types17.template);
|
|
30556
30556
|
}
|
|
30557
30557
|
};
|
|
30558
30558
|
tokenTypes[140].updateContext = (context) => {
|
|
30559
|
-
context.push(
|
|
30559
|
+
context.push(types17.j_expr, types17.j_oTag);
|
|
30560
30560
|
};
|
|
30561
30561
|
}
|
|
30562
30562
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -31197,7 +31197,7 @@ var require_lib3 = __commonJS({
|
|
|
31197
31197
|
this.lastTokEndLoc = null;
|
|
31198
31198
|
this.lastTokStartLoc = null;
|
|
31199
31199
|
this.lastTokStart = 0;
|
|
31200
|
-
this.context = [
|
|
31200
|
+
this.context = [types17.brace];
|
|
31201
31201
|
this.canStartJSXElement = true;
|
|
31202
31202
|
this.containsEsc = false;
|
|
31203
31203
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -35121,7 +35121,7 @@ var require_lib3 = __commonJS({
|
|
|
35121
35121
|
context
|
|
35122
35122
|
} = this.state;
|
|
35123
35123
|
const currentContext = context[context.length - 1];
|
|
35124
|
-
if (currentContext ===
|
|
35124
|
+
if (currentContext === types17.j_oTag || currentContext === types17.j_expr) {
|
|
35125
35125
|
context.pop();
|
|
35126
35126
|
}
|
|
35127
35127
|
}
|
|
@@ -36181,9 +36181,9 @@ var require_lib3 = __commonJS({
|
|
|
36181
36181
|
switch (this.state.type) {
|
|
36182
36182
|
case 5:
|
|
36183
36183
|
node = this.startNode();
|
|
36184
|
-
this.setContext(
|
|
36184
|
+
this.setContext(types17.brace);
|
|
36185
36185
|
this.next();
|
|
36186
|
-
node = this.jsxParseExpressionContainer(node,
|
|
36186
|
+
node = this.jsxParseExpressionContainer(node, types17.j_oTag);
|
|
36187
36187
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
36188
36188
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
36189
36189
|
at: node
|
|
@@ -36206,7 +36206,7 @@ var require_lib3 = __commonJS({
|
|
|
36206
36206
|
jsxParseSpreadChild(node) {
|
|
36207
36207
|
this.next();
|
|
36208
36208
|
node.expression = this.parseExpression();
|
|
36209
|
-
this.setContext(
|
|
36209
|
+
this.setContext(types17.j_expr);
|
|
36210
36210
|
this.state.canStartJSXElement = true;
|
|
36211
36211
|
this.expect(8);
|
|
36212
36212
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -36226,11 +36226,11 @@ var require_lib3 = __commonJS({
|
|
|
36226
36226
|
jsxParseAttribute() {
|
|
36227
36227
|
const node = this.startNode();
|
|
36228
36228
|
if (this.match(5)) {
|
|
36229
|
-
this.setContext(
|
|
36229
|
+
this.setContext(types17.brace);
|
|
36230
36230
|
this.next();
|
|
36231
36231
|
this.expect(21);
|
|
36232
36232
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
36233
|
-
this.setContext(
|
|
36233
|
+
this.setContext(types17.j_oTag);
|
|
36234
36234
|
this.state.canStartJSXElement = true;
|
|
36235
36235
|
this.expect(8);
|
|
36236
36236
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -36289,12 +36289,12 @@ var require_lib3 = __commonJS({
|
|
|
36289
36289
|
break;
|
|
36290
36290
|
case 5: {
|
|
36291
36291
|
const node2 = this.startNode();
|
|
36292
|
-
this.setContext(
|
|
36292
|
+
this.setContext(types17.brace);
|
|
36293
36293
|
this.next();
|
|
36294
36294
|
if (this.match(21)) {
|
|
36295
36295
|
children.push(this.jsxParseSpreadChild(node2));
|
|
36296
36296
|
} else {
|
|
36297
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
36297
|
+
children.push(this.jsxParseExpressionContainer(node2, types17.j_expr));
|
|
36298
36298
|
}
|
|
36299
36299
|
break;
|
|
36300
36300
|
}
|
|
@@ -36365,10 +36365,10 @@ var require_lib3 = __commonJS({
|
|
|
36365
36365
|
}
|
|
36366
36366
|
getTokenFromCode(code) {
|
|
36367
36367
|
const context = this.curContext();
|
|
36368
|
-
if (context ===
|
|
36368
|
+
if (context === types17.j_expr) {
|
|
36369
36369
|
return this.jsxReadToken();
|
|
36370
36370
|
}
|
|
36371
|
-
if (context ===
|
|
36371
|
+
if (context === types17.j_oTag || context === types17.j_cTag) {
|
|
36372
36372
|
if (isIdentifierStart(code)) {
|
|
36373
36373
|
return this.jsxReadWord();
|
|
36374
36374
|
}
|
|
@@ -36376,7 +36376,7 @@ var require_lib3 = __commonJS({
|
|
|
36376
36376
|
++this.state.pos;
|
|
36377
36377
|
return this.finishToken(141);
|
|
36378
36378
|
}
|
|
36379
|
-
if ((code === 34 || code === 39) && context ===
|
|
36379
|
+
if ((code === 34 || code === 39) && context === types17.j_oTag) {
|
|
36380
36380
|
return this.jsxReadString(code);
|
|
36381
36381
|
}
|
|
36382
36382
|
}
|
|
@@ -36392,17 +36392,17 @@ var require_lib3 = __commonJS({
|
|
|
36392
36392
|
type
|
|
36393
36393
|
} = this.state;
|
|
36394
36394
|
if (type === 56 && prevType === 140) {
|
|
36395
|
-
context.splice(-2, 2,
|
|
36395
|
+
context.splice(-2, 2, types17.j_cTag);
|
|
36396
36396
|
this.state.canStartJSXElement = false;
|
|
36397
36397
|
} else if (type === 140) {
|
|
36398
|
-
context.push(
|
|
36398
|
+
context.push(types17.j_oTag);
|
|
36399
36399
|
} else if (type === 141) {
|
|
36400
36400
|
const out = context[context.length - 1];
|
|
36401
|
-
if (out ===
|
|
36401
|
+
if (out === types17.j_oTag && prevType === 56 || out === types17.j_cTag) {
|
|
36402
36402
|
context.pop();
|
|
36403
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
36403
|
+
this.state.canStartJSXElement = context[context.length - 1] === types17.j_expr;
|
|
36404
36404
|
} else {
|
|
36405
|
-
this.setContext(
|
|
36405
|
+
this.setContext(types17.j_expr);
|
|
36406
36406
|
this.state.canStartJSXElement = true;
|
|
36407
36407
|
}
|
|
36408
36408
|
} else {
|
|
@@ -37410,14 +37410,14 @@ var require_lib3 = __commonJS({
|
|
|
37410
37410
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
37411
37411
|
const node = this.startNode();
|
|
37412
37412
|
const hasLeadingOperator = this.eat(operator);
|
|
37413
|
-
const
|
|
37413
|
+
const types18 = [];
|
|
37414
37414
|
do {
|
|
37415
|
-
|
|
37415
|
+
types18.push(parseConstituentType());
|
|
37416
37416
|
} while (this.eat(operator));
|
|
37417
|
-
if (
|
|
37418
|
-
return
|
|
37417
|
+
if (types18.length === 1 && !hasLeadingOperator) {
|
|
37418
|
+
return types18[0];
|
|
37419
37419
|
}
|
|
37420
|
-
node.types =
|
|
37420
|
+
node.types = types18;
|
|
37421
37421
|
return this.finishNode(node, kind);
|
|
37422
37422
|
}
|
|
37423
37423
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -38646,7 +38646,7 @@ var require_lib3 = __commonJS({
|
|
|
38646
38646
|
context
|
|
38647
38647
|
} = this.state;
|
|
38648
38648
|
const currentContext = context[context.length - 1];
|
|
38649
|
-
if (currentContext ===
|
|
38649
|
+
if (currentContext === types17.j_oTag || currentContext === types17.j_expr) {
|
|
38650
38650
|
context.pop();
|
|
38651
38651
|
}
|
|
38652
38652
|
}
|
|
@@ -44285,9 +44285,9 @@ var require_shared = __commonJS({
|
|
|
44285
44285
|
var tslib_1 = require_tslib();
|
|
44286
44286
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
44287
44287
|
function default_1(fork) {
|
|
44288
|
-
var
|
|
44289
|
-
var Type =
|
|
44290
|
-
var builtin =
|
|
44288
|
+
var types17 = fork.use(types_1.default);
|
|
44289
|
+
var Type = types17.Type;
|
|
44290
|
+
var builtin = types17.builtInTypes;
|
|
44291
44291
|
var isNumber = builtin.number;
|
|
44292
44292
|
function geq(than) {
|
|
44293
44293
|
return Type.from(function(value) {
|
|
@@ -44437,9 +44437,9 @@ var require_types = __commonJS({
|
|
|
44437
44437
|
}(BaseType);
|
|
44438
44438
|
var OrType = function(_super) {
|
|
44439
44439
|
tslib_1.__extends(OrType2, _super);
|
|
44440
|
-
function OrType2(
|
|
44440
|
+
function OrType2(types17) {
|
|
44441
44441
|
var _this = _super.call(this) || this;
|
|
44442
|
-
_this.types =
|
|
44442
|
+
_this.types = types17;
|
|
44443
44443
|
_this.kind = "OrType";
|
|
44444
44444
|
return _this;
|
|
44445
44445
|
}
|
|
@@ -44580,11 +44580,11 @@ var require_types = __commonJS({
|
|
|
44580
44580
|
function typesPlugin(_fork) {
|
|
44581
44581
|
var Type = {
|
|
44582
44582
|
or: function() {
|
|
44583
|
-
var
|
|
44583
|
+
var types17 = [];
|
|
44584
44584
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44585
|
-
|
|
44585
|
+
types17[_i] = arguments[_i];
|
|
44586
44586
|
}
|
|
44587
|
-
return new OrType(
|
|
44587
|
+
return new OrType(types17.map(function(type) {
|
|
44588
44588
|
return Type.from(type);
|
|
44589
44589
|
}));
|
|
44590
44590
|
},
|
|
@@ -45029,9 +45029,9 @@ var require_path2 = __commonJS({
|
|
|
45029
45029
|
var Op = Object.prototype;
|
|
45030
45030
|
var hasOwn = Op.hasOwnProperty;
|
|
45031
45031
|
function pathPlugin(fork) {
|
|
45032
|
-
var
|
|
45033
|
-
var isArray =
|
|
45034
|
-
var isNumber =
|
|
45032
|
+
var types17 = fork.use(types_1.default);
|
|
45033
|
+
var isArray = types17.builtInTypes.array;
|
|
45034
|
+
var isNumber = types17.builtInTypes.number;
|
|
45035
45035
|
var Path = function Path2(value, parentPath, name) {
|
|
45036
45036
|
if (!(this instanceof Path2)) {
|
|
45037
45037
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -45333,13 +45333,13 @@ var require_scope = __commonJS({
|
|
|
45333
45333
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45334
45334
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45335
45335
|
function scopePlugin(fork) {
|
|
45336
|
-
var
|
|
45337
|
-
var Type =
|
|
45338
|
-
var namedTypes =
|
|
45336
|
+
var types17 = fork.use(types_1.default);
|
|
45337
|
+
var Type = types17.Type;
|
|
45338
|
+
var namedTypes = types17.namedTypes;
|
|
45339
45339
|
var Node = namedTypes.Node;
|
|
45340
45340
|
var Expression = namedTypes.Expression;
|
|
45341
|
-
var isArray =
|
|
45342
|
-
var b =
|
|
45341
|
+
var isArray = types17.builtInTypes.array;
|
|
45342
|
+
var b = types17.builders;
|
|
45343
45343
|
var Scope = function Scope2(path2, parentScope) {
|
|
45344
45344
|
if (!(this instanceof Scope2)) {
|
|
45345
45345
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -45402,7 +45402,7 @@ var require_scope = __commonJS({
|
|
|
45402
45402
|
++index;
|
|
45403
45403
|
}
|
|
45404
45404
|
var name = prefix + index;
|
|
45405
|
-
return this.bindings[name] =
|
|
45405
|
+
return this.bindings[name] = types17.builders.identifier(name);
|
|
45406
45406
|
};
|
|
45407
45407
|
Sp.injectTemporary = function(identifier, init2) {
|
|
45408
45408
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -45478,7 +45478,7 @@ var require_scope = __commonJS({
|
|
|
45478
45478
|
bindings
|
|
45479
45479
|
);
|
|
45480
45480
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
45481
|
-
|
|
45481
|
+
types17.eachField(node, function(name, child) {
|
|
45482
45482
|
var childPath = path2.get(name);
|
|
45483
45483
|
if (!pathHasValue(childPath, child)) {
|
|
45484
45484
|
throw new Error("");
|
|
@@ -45556,24 +45556,24 @@ var require_scope = __commonJS({
|
|
|
45556
45556
|
addPattern(patternPath.get("argument"), bindings);
|
|
45557
45557
|
}
|
|
45558
45558
|
}
|
|
45559
|
-
function addTypePattern(patternPath,
|
|
45559
|
+
function addTypePattern(patternPath, types18) {
|
|
45560
45560
|
var pattern = patternPath.value;
|
|
45561
45561
|
namedTypes.Pattern.assert(pattern);
|
|
45562
45562
|
if (namedTypes.Identifier.check(pattern)) {
|
|
45563
|
-
if (hasOwn.call(
|
|
45564
|
-
|
|
45563
|
+
if (hasOwn.call(types18, pattern.name)) {
|
|
45564
|
+
types18[pattern.name].push(patternPath);
|
|
45565
45565
|
} else {
|
|
45566
|
-
|
|
45566
|
+
types18[pattern.name] = [patternPath];
|
|
45567
45567
|
}
|
|
45568
45568
|
}
|
|
45569
45569
|
}
|
|
45570
|
-
function addTypeParameter(parameterPath,
|
|
45570
|
+
function addTypeParameter(parameterPath, types18) {
|
|
45571
45571
|
var parameter = parameterPath.value;
|
|
45572
45572
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
45573
|
-
if (hasOwn.call(
|
|
45574
|
-
|
|
45573
|
+
if (hasOwn.call(types18, parameter.name)) {
|
|
45574
|
+
types18[parameter.name].push(parameterPath);
|
|
45575
45575
|
} else {
|
|
45576
|
-
|
|
45576
|
+
types18[parameter.name] = [parameterPath];
|
|
45577
45577
|
}
|
|
45578
45578
|
}
|
|
45579
45579
|
Sp.lookup = function(name) {
|
|
@@ -45614,11 +45614,11 @@ var require_node_path = __commonJS({
|
|
|
45614
45614
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
45615
45615
|
var shared_1 = require_shared();
|
|
45616
45616
|
function nodePathPlugin(fork) {
|
|
45617
|
-
var
|
|
45618
|
-
var n =
|
|
45619
|
-
var b =
|
|
45620
|
-
var isNumber =
|
|
45621
|
-
var isArray =
|
|
45617
|
+
var types17 = fork.use(types_1.default);
|
|
45618
|
+
var n = types17.namedTypes;
|
|
45619
|
+
var b = types17.builders;
|
|
45620
|
+
var isNumber = types17.builtInTypes.number;
|
|
45621
|
+
var isArray = types17.builtInTypes.array;
|
|
45622
45622
|
var Path = fork.use(path_1.default);
|
|
45623
45623
|
var Scope = fork.use(scope_1.default);
|
|
45624
45624
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -45709,7 +45709,7 @@ var require_node_path = __commonJS({
|
|
|
45709
45709
|
return scope || null;
|
|
45710
45710
|
};
|
|
45711
45711
|
NPp.getValueProperty = function(name) {
|
|
45712
|
-
return
|
|
45712
|
+
return types17.getFieldValue(this.value, name);
|
|
45713
45713
|
};
|
|
45714
45714
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
45715
45715
|
var pp = this.parentPath;
|
|
@@ -45851,7 +45851,7 @@ var require_node_path = __commonJS({
|
|
|
45851
45851
|
return node.some(containsCallExpression);
|
|
45852
45852
|
}
|
|
45853
45853
|
if (n.Node.check(node)) {
|
|
45854
|
-
return
|
|
45854
|
+
return types17.someField(node, function(_name, child) {
|
|
45855
45855
|
return containsCallExpression(child);
|
|
45856
45856
|
});
|
|
45857
45857
|
}
|
|
@@ -45972,11 +45972,11 @@ var require_path_visitor = __commonJS({
|
|
|
45972
45972
|
var shared_1 = require_shared();
|
|
45973
45973
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45974
45974
|
function pathVisitorPlugin(fork) {
|
|
45975
|
-
var
|
|
45975
|
+
var types17 = fork.use(types_1.default);
|
|
45976
45976
|
var NodePath = fork.use(node_path_1.default);
|
|
45977
|
-
var isArray =
|
|
45978
|
-
var isObject2 =
|
|
45979
|
-
var isFunction =
|
|
45977
|
+
var isArray = types17.builtInTypes.array;
|
|
45978
|
+
var isObject2 = types17.builtInTypes.object;
|
|
45979
|
+
var isFunction = types17.builtInTypes.function;
|
|
45980
45980
|
var undefined2;
|
|
45981
45981
|
var PathVisitor = function PathVisitor2() {
|
|
45982
45982
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -45996,7 +45996,7 @@ var require_path_visitor = __commonJS({
|
|
|
45996
45996
|
typeNames[methodName.slice("visit".length)] = true;
|
|
45997
45997
|
}
|
|
45998
45998
|
}
|
|
45999
|
-
var supertypeTable =
|
|
45999
|
+
var supertypeTable = types17.computeSupertypeLookupTable(typeNames);
|
|
46000
46000
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
46001
46001
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
46002
46002
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -46115,7 +46115,7 @@ var require_path_visitor = __commonJS({
|
|
|
46115
46115
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
46116
46116
|
} else if (!isObject2.check(value)) {
|
|
46117
46117
|
} else {
|
|
46118
|
-
var childNames =
|
|
46118
|
+
var childNames = types17.getFieldNames(value);
|
|
46119
46119
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
46120
46120
|
childNames.push("comments");
|
|
46121
46121
|
}
|
|
@@ -46124,7 +46124,7 @@ var require_path_visitor = __commonJS({
|
|
|
46124
46124
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
46125
46125
|
var childName = childNames[i2];
|
|
46126
46126
|
if (!hasOwn.call(value, childName)) {
|
|
46127
|
-
value[childName] =
|
|
46127
|
+
value[childName] = types17.getFieldValue(value, childName);
|
|
46128
46128
|
}
|
|
46129
46129
|
childPaths.push(path2.get(childName));
|
|
46130
46130
|
}
|
|
@@ -46267,13 +46267,13 @@ var require_equiv = __commonJS({
|
|
|
46267
46267
|
var shared_1 = require_shared();
|
|
46268
46268
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46269
46269
|
function default_1(fork) {
|
|
46270
|
-
var
|
|
46271
|
-
var getFieldNames =
|
|
46272
|
-
var getFieldValue =
|
|
46273
|
-
var isArray =
|
|
46274
|
-
var isObject2 =
|
|
46275
|
-
var isDate =
|
|
46276
|
-
var isRegExp =
|
|
46270
|
+
var types17 = fork.use(types_1.default);
|
|
46271
|
+
var getFieldNames = types17.getFieldNames;
|
|
46272
|
+
var getFieldValue = types17.getFieldValue;
|
|
46273
|
+
var isArray = types17.builtInTypes.array;
|
|
46274
|
+
var isObject2 = types17.builtInTypes.object;
|
|
46275
|
+
var isDate = types17.builtInTypes.Date;
|
|
46276
|
+
var isRegExp = types17.builtInTypes.RegExp;
|
|
46277
46277
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
46278
46278
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
46279
46279
|
if (isArray.check(problemPath)) {
|
|
@@ -46426,24 +46426,24 @@ var require_fork = __commonJS({
|
|
|
46426
46426
|
var shared_1 = require_shared();
|
|
46427
46427
|
function default_1(plugins) {
|
|
46428
46428
|
var fork = createFork();
|
|
46429
|
-
var
|
|
46429
|
+
var types17 = fork.use(types_1.default);
|
|
46430
46430
|
plugins.forEach(fork.use);
|
|
46431
|
-
|
|
46431
|
+
types17.finalize();
|
|
46432
46432
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
46433
46433
|
return {
|
|
46434
|
-
Type:
|
|
46435
|
-
builtInTypes:
|
|
46436
|
-
namedTypes:
|
|
46437
|
-
builders:
|
|
46438
|
-
defineMethod:
|
|
46439
|
-
getFieldNames:
|
|
46440
|
-
getFieldValue:
|
|
46441
|
-
eachField:
|
|
46442
|
-
someField:
|
|
46443
|
-
getSupertypeNames:
|
|
46444
|
-
getBuilderName:
|
|
46434
|
+
Type: types17.Type,
|
|
46435
|
+
builtInTypes: types17.builtInTypes,
|
|
46436
|
+
namedTypes: types17.namedTypes,
|
|
46437
|
+
builders: types17.builders,
|
|
46438
|
+
defineMethod: types17.defineMethod,
|
|
46439
|
+
getFieldNames: types17.getFieldNames,
|
|
46440
|
+
getFieldValue: types17.getFieldValue,
|
|
46441
|
+
eachField: types17.eachField,
|
|
46442
|
+
someField: types17.someField,
|
|
46443
|
+
getSupertypeNames: types17.getSupertypeNames,
|
|
46444
|
+
getBuilderName: types17.getBuilderName,
|
|
46445
46445
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
46446
|
-
finalize:
|
|
46446
|
+
finalize: types17.finalize,
|
|
46447
46447
|
Path: fork.use(path_1.default),
|
|
46448
46448
|
NodePath: fork.use(node_path_1.default),
|
|
46449
46449
|
PathVisitor,
|
|
@@ -46613,8 +46613,8 @@ var require_core2 = __commonJS({
|
|
|
46613
46613
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46614
46614
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46615
46615
|
function default_1(fork) {
|
|
46616
|
-
var
|
|
46617
|
-
var Type =
|
|
46616
|
+
var types17 = fork.use(types_1.default);
|
|
46617
|
+
var Type = types17.Type;
|
|
46618
46618
|
var def = Type.def;
|
|
46619
46619
|
var or = Type.or;
|
|
46620
46620
|
var shared = fork.use(shared_1.default);
|
|
@@ -46706,9 +46706,9 @@ var require_es6 = __commonJS({
|
|
|
46706
46706
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46707
46707
|
function default_1(fork) {
|
|
46708
46708
|
fork.use(core_1.default);
|
|
46709
|
-
var
|
|
46710
|
-
var def =
|
|
46711
|
-
var or =
|
|
46709
|
+
var types17 = fork.use(types_1.default);
|
|
46710
|
+
var def = types17.Type.def;
|
|
46711
|
+
var or = types17.Type.or;
|
|
46712
46712
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46713
46713
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
46714
46714
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -46798,8 +46798,8 @@ var require_es2017 = __commonJS({
|
|
|
46798
46798
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46799
46799
|
function default_1(fork) {
|
|
46800
46800
|
fork.use(es2016_1.default);
|
|
46801
|
-
var
|
|
46802
|
-
var def =
|
|
46801
|
+
var types17 = fork.use(types_1.default);
|
|
46802
|
+
var def = types17.Type.def;
|
|
46803
46803
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46804
46804
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
46805
46805
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -46822,9 +46822,9 @@ var require_es2018 = __commonJS({
|
|
|
46822
46822
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46823
46823
|
function default_1(fork) {
|
|
46824
46824
|
fork.use(es2017_1.default);
|
|
46825
|
-
var
|
|
46826
|
-
var def =
|
|
46827
|
-
var or =
|
|
46825
|
+
var types17 = fork.use(types_1.default);
|
|
46826
|
+
var def = types17.Type.def;
|
|
46827
|
+
var or = types17.Type.or;
|
|
46828
46828
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46829
46829
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
46830
46830
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -46855,9 +46855,9 @@ var require_es2019 = __commonJS({
|
|
|
46855
46855
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46856
46856
|
function default_1(fork) {
|
|
46857
46857
|
fork.use(es2018_1.default);
|
|
46858
|
-
var
|
|
46859
|
-
var def =
|
|
46860
|
-
var or =
|
|
46858
|
+
var types17 = fork.use(types_1.default);
|
|
46859
|
+
var def = types17.Type.def;
|
|
46860
|
+
var or = types17.Type.or;
|
|
46861
46861
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46862
46862
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
46863
46863
|
}
|
|
@@ -46881,9 +46881,9 @@ var require_es20202 = __commonJS({
|
|
|
46881
46881
|
function default_1(fork) {
|
|
46882
46882
|
fork.use(es2020_1.default);
|
|
46883
46883
|
fork.use(es2019_1.default);
|
|
46884
|
-
var
|
|
46885
|
-
var def =
|
|
46886
|
-
var or =
|
|
46884
|
+
var types17 = fork.use(types_1.default);
|
|
46885
|
+
var def = types17.Type.def;
|
|
46886
|
+
var or = types17.Type.or;
|
|
46887
46887
|
var shared = fork.use(shared_1.default);
|
|
46888
46888
|
var defaults = shared.defaults;
|
|
46889
46889
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -46933,8 +46933,8 @@ var require_es2022 = __commonJS({
|
|
|
46933
46933
|
var shared_1 = require_shared();
|
|
46934
46934
|
function default_1(fork) {
|
|
46935
46935
|
fork.use(es2021_1.default);
|
|
46936
|
-
var
|
|
46937
|
-
var def =
|
|
46936
|
+
var types17 = fork.use(types_1.default);
|
|
46937
|
+
var def = types17.Type.def;
|
|
46938
46938
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
46939
46939
|
}
|
|
46940
46940
|
exports.default = default_1;
|
|
@@ -46955,9 +46955,9 @@ var require_es_proposals = __commonJS({
|
|
|
46955
46955
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
46956
46956
|
function default_1(fork) {
|
|
46957
46957
|
fork.use(es2022_1.default);
|
|
46958
|
-
var
|
|
46959
|
-
var Type =
|
|
46960
|
-
var def =
|
|
46958
|
+
var types17 = fork.use(types_1.default);
|
|
46959
|
+
var Type = types17.Type;
|
|
46960
|
+
var def = types17.Type.def;
|
|
46961
46961
|
var or = Type.or;
|
|
46962
46962
|
var shared = fork.use(shared_1.default);
|
|
46963
46963
|
var defaults = shared.defaults;
|
|
@@ -46997,9 +46997,9 @@ var require_jsx = __commonJS({
|
|
|
46997
46997
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46998
46998
|
function default_1(fork) {
|
|
46999
46999
|
fork.use(es_proposals_1.default);
|
|
47000
|
-
var
|
|
47001
|
-
var def =
|
|
47002
|
-
var or =
|
|
47000
|
+
var types17 = fork.use(types_1.default);
|
|
47001
|
+
var def = types17.Type.def;
|
|
47002
|
+
var or = types17.Type.or;
|
|
47003
47003
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47004
47004
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
47005
47005
|
def("Literal"),
|
|
@@ -47057,9 +47057,9 @@ var require_type_annotations = __commonJS({
|
|
|
47057
47057
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
47058
47058
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47059
47059
|
function default_1(fork) {
|
|
47060
|
-
var
|
|
47061
|
-
var def =
|
|
47062
|
-
var or =
|
|
47060
|
+
var types17 = fork.use(types_1.default);
|
|
47061
|
+
var def = types17.Type.def;
|
|
47062
|
+
var or = types17.Type.or;
|
|
47063
47063
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47064
47064
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
47065
47065
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -47094,9 +47094,9 @@ var require_flow = __commonJS({
|
|
|
47094
47094
|
function default_1(fork) {
|
|
47095
47095
|
fork.use(es_proposals_1.default);
|
|
47096
47096
|
fork.use(type_annotations_1.default);
|
|
47097
|
-
var
|
|
47098
|
-
var def =
|
|
47099
|
-
var or =
|
|
47097
|
+
var types17 = fork.use(types_1.default);
|
|
47098
|
+
var def = types17.Type.def;
|
|
47099
|
+
var or = types17.Type.or;
|
|
47100
47100
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47101
47101
|
def("Flow").bases("Node");
|
|
47102
47102
|
def("FlowType").bases("Flow");
|
|
@@ -47210,10 +47210,10 @@ var require_esprima = __commonJS({
|
|
|
47210
47210
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47211
47211
|
function default_1(fork) {
|
|
47212
47212
|
fork.use(es_proposals_1.default);
|
|
47213
|
-
var
|
|
47213
|
+
var types17 = fork.use(types_1.default);
|
|
47214
47214
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47215
|
-
var def =
|
|
47216
|
-
var or =
|
|
47215
|
+
var def = types17.Type.def;
|
|
47216
|
+
var or = types17.Type.or;
|
|
47217
47217
|
def("VariableDeclaration").field("declarations", [or(
|
|
47218
47218
|
def("VariableDeclarator"),
|
|
47219
47219
|
def("Identifier")
|
|
@@ -47258,11 +47258,11 @@ var require_babel_core = __commonJS({
|
|
|
47258
47258
|
function default_1(fork) {
|
|
47259
47259
|
var _a, _b, _c, _d, _e;
|
|
47260
47260
|
fork.use(es_proposals_1.default);
|
|
47261
|
-
var
|
|
47261
|
+
var types17 = fork.use(types_1.default);
|
|
47262
47262
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47263
|
-
var def =
|
|
47264
|
-
var or =
|
|
47265
|
-
var isUndefined =
|
|
47263
|
+
var def = types17.Type.def;
|
|
47264
|
+
var or = types17.Type.or;
|
|
47265
|
+
var isUndefined = types17.builtInTypes.undefined;
|
|
47266
47266
|
def("Noop").bases("Statement").build();
|
|
47267
47267
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
47268
47268
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -47287,7 +47287,7 @@ var require_babel_core = __commonJS({
|
|
|
47287
47287
|
raw: String
|
|
47288
47288
|
},
|
|
47289
47289
|
function getDefault() {
|
|
47290
|
-
var value =
|
|
47290
|
+
var value = types17.getFieldValue(this, "value");
|
|
47291
47291
|
return {
|
|
47292
47292
|
rawValue: value,
|
|
47293
47293
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -47390,8 +47390,8 @@ var require_babel = __commonJS({
|
|
|
47390
47390
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
47391
47391
|
var shared_1 = require_shared();
|
|
47392
47392
|
function default_1(fork) {
|
|
47393
|
-
var
|
|
47394
|
-
var def =
|
|
47393
|
+
var types17 = fork.use(types_1.default);
|
|
47394
|
+
var def = types17.Type.def;
|
|
47395
47395
|
fork.use(babel_core_1.default);
|
|
47396
47396
|
fork.use(flow_1.default);
|
|
47397
47397
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -47417,12 +47417,12 @@ var require_typescript = __commonJS({
|
|
|
47417
47417
|
function default_1(fork) {
|
|
47418
47418
|
fork.use(babel_core_1.default);
|
|
47419
47419
|
fork.use(type_annotations_1.default);
|
|
47420
|
-
var
|
|
47421
|
-
var n =
|
|
47422
|
-
var def =
|
|
47423
|
-
var or =
|
|
47420
|
+
var types17 = fork.use(types_1.default);
|
|
47421
|
+
var n = types17.namedTypes;
|
|
47422
|
+
var def = types17.Type.def;
|
|
47423
|
+
var or = types17.Type.or;
|
|
47424
47424
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47425
|
-
var StringLiteral =
|
|
47425
|
+
var StringLiteral = types17.Type.from(function(value, deep) {
|
|
47426
47426
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
47427
47427
|
return true;
|
|
47428
47428
|
}
|
|
@@ -49398,8 +49398,8 @@ var require_util2 = __commonJS({
|
|
|
49398
49398
|
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;
|
|
49399
49399
|
var tslib_1 = require_tslib();
|
|
49400
49400
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
49401
|
-
var
|
|
49402
|
-
var n =
|
|
49401
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
49402
|
+
var n = types17.namedTypes;
|
|
49403
49403
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
49404
49404
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
49405
49405
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -56717,10 +56717,10 @@ var require_comments = __commonJS({
|
|
|
56717
56717
|
exports.printComments = exports.attach = void 0;
|
|
56718
56718
|
var tslib_1 = require_tslib();
|
|
56719
56719
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
56720
|
-
var
|
|
56721
|
-
var n =
|
|
56722
|
-
var isArray =
|
|
56723
|
-
var isObject2 =
|
|
56720
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
56721
|
+
var n = types17.namedTypes;
|
|
56722
|
+
var isArray = types17.builtInTypes.array;
|
|
56723
|
+
var isObject2 = types17.builtInTypes.object;
|
|
56724
56724
|
var lines_1 = require_lines();
|
|
56725
56725
|
var util_1 = require_util2();
|
|
56726
56726
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -56751,7 +56751,7 @@ var require_comments = __commonJS({
|
|
|
56751
56751
|
if (isArray.check(node)) {
|
|
56752
56752
|
names = Object.keys(node);
|
|
56753
56753
|
} else if (isObject2.check(node)) {
|
|
56754
|
-
names =
|
|
56754
|
+
names = types17.getFieldNames(node);
|
|
56755
56755
|
} else {
|
|
56756
56756
|
return resultArray;
|
|
56757
56757
|
}
|
|
@@ -56929,7 +56929,7 @@ var require_comments = __commonJS({
|
|
|
56929
56929
|
function printComments(path2, print9) {
|
|
56930
56930
|
var value = path2.getValue();
|
|
56931
56931
|
var innerLines = print9(path2);
|
|
56932
|
-
var comments = n.Node.check(value) &&
|
|
56932
|
+
var comments = n.Node.check(value) && types17.getFieldValue(value, "comments");
|
|
56933
56933
|
if (!comments || comments.length === 0) {
|
|
56934
56934
|
return innerLines;
|
|
56935
56935
|
}
|
|
@@ -56937,8 +56937,8 @@ var require_comments = __commonJS({
|
|
|
56937
56937
|
var trailingParts = [innerLines];
|
|
56938
56938
|
path2.each(function(commentPath) {
|
|
56939
56939
|
var comment = commentPath.getValue();
|
|
56940
|
-
var leading =
|
|
56941
|
-
var trailing =
|
|
56940
|
+
var leading = types17.getFieldValue(comment, "leading");
|
|
56941
|
+
var trailing = types17.getFieldValue(comment, "trailing");
|
|
56942
56942
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
56943
56943
|
leadingParts.push(printLeadingComment(commentPath, print9));
|
|
56944
56944
|
} else if (trailing) {
|
|
@@ -56960,10 +56960,10 @@ var require_parser2 = __commonJS({
|
|
|
56960
56960
|
exports.parse = void 0;
|
|
56961
56961
|
var tslib_1 = require_tslib();
|
|
56962
56962
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
56963
|
-
var
|
|
56964
|
-
var b =
|
|
56965
|
-
var isObject2 =
|
|
56966
|
-
var isArray =
|
|
56963
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
56964
|
+
var b = types17.builders;
|
|
56965
|
+
var isObject2 = types17.builtInTypes.object;
|
|
56966
|
+
var isArray = types17.builtInTypes.array;
|
|
56967
56967
|
var options_1 = require_options();
|
|
56968
56968
|
var lines_1 = require_lines();
|
|
56969
56969
|
var comments_1 = require_comments();
|
|
@@ -57149,11 +57149,11 @@ var require_fast_path = __commonJS({
|
|
|
57149
57149
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57150
57150
|
var tslib_1 = require_tslib();
|
|
57151
57151
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
57152
|
-
var
|
|
57152
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
57153
57153
|
var util = tslib_1.__importStar(require_util2());
|
|
57154
|
-
var n =
|
|
57155
|
-
var isArray =
|
|
57156
|
-
var isNumber =
|
|
57154
|
+
var n = types17.namedTypes;
|
|
57155
|
+
var isArray = types17.builtInTypes.array;
|
|
57156
|
+
var isNumber = types17.builtInTypes.number;
|
|
57157
57157
|
var PRECEDENCE = {};
|
|
57158
57158
|
[
|
|
57159
57159
|
["??"],
|
|
@@ -57182,7 +57182,7 @@ var require_fast_path = __commonJS({
|
|
|
57182
57182
|
if (obj instanceof FastPath) {
|
|
57183
57183
|
return obj.copy();
|
|
57184
57184
|
}
|
|
57185
|
-
if (obj instanceof
|
|
57185
|
+
if (obj instanceof types17.NodePath) {
|
|
57186
57186
|
var copy = Object.create(FastPath.prototype);
|
|
57187
57187
|
var stack = [obj.value];
|
|
57188
57188
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -57493,7 +57493,7 @@ var require_fast_path = __commonJS({
|
|
|
57493
57493
|
return node.some(containsCallExpression);
|
|
57494
57494
|
}
|
|
57495
57495
|
if (n.Node.check(node)) {
|
|
57496
|
-
return
|
|
57496
|
+
return types17.someField(node, function(_name, child) {
|
|
57497
57497
|
return containsCallExpression(child);
|
|
57498
57498
|
});
|
|
57499
57499
|
}
|
|
@@ -57583,16 +57583,16 @@ var require_patcher = __commonJS({
|
|
|
57583
57583
|
var tslib_1 = require_tslib();
|
|
57584
57584
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
57585
57585
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
57586
|
-
var
|
|
57587
|
-
var Printable =
|
|
57588
|
-
var Expression =
|
|
57589
|
-
var ReturnStatement =
|
|
57590
|
-
var SourceLocation =
|
|
57586
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
57587
|
+
var Printable = types17.namedTypes.Printable;
|
|
57588
|
+
var Expression = types17.namedTypes.Expression;
|
|
57589
|
+
var ReturnStatement = types17.namedTypes.ReturnStatement;
|
|
57590
|
+
var SourceLocation = types17.namedTypes.SourceLocation;
|
|
57591
57591
|
var util_1 = require_util2();
|
|
57592
57592
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
57593
|
-
var isObject2 =
|
|
57594
|
-
var isArray =
|
|
57595
|
-
var isString =
|
|
57593
|
+
var isObject2 = types17.builtInTypes.object;
|
|
57594
|
+
var isArray = types17.builtInTypes.array;
|
|
57595
|
+
var isString = types17.builtInTypes.string;
|
|
57596
57596
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
57597
57597
|
var Patcher = function Patcher2(lines) {
|
|
57598
57598
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -57862,8 +57862,8 @@ var require_patcher = __commonJS({
|
|
|
57862
57862
|
if (k.charAt(0) === "_") {
|
|
57863
57863
|
continue;
|
|
57864
57864
|
}
|
|
57865
|
-
newPath.stack.push(k,
|
|
57866
|
-
oldPath.stack.push(k,
|
|
57865
|
+
newPath.stack.push(k, types17.getFieldValue(newNode, k));
|
|
57866
|
+
oldPath.stack.push(k, types17.getFieldValue(oldNode, k));
|
|
57867
57867
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
57868
57868
|
newPath.stack.length -= 2;
|
|
57869
57869
|
oldPath.stack.length -= 2;
|
|
@@ -57887,16 +57887,16 @@ var require_printer2 = __commonJS({
|
|
|
57887
57887
|
exports.Printer = void 0;
|
|
57888
57888
|
var tslib_1 = require_tslib();
|
|
57889
57889
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
57890
|
-
var
|
|
57890
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
57891
57891
|
var comments_1 = require_comments();
|
|
57892
57892
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
57893
57893
|
var lines_1 = require_lines();
|
|
57894
57894
|
var options_1 = require_options();
|
|
57895
57895
|
var patcher_1 = require_patcher();
|
|
57896
57896
|
var util = tslib_1.__importStar(require_util2());
|
|
57897
|
-
var namedTypes =
|
|
57898
|
-
var isString =
|
|
57899
|
-
var isObject2 =
|
|
57897
|
+
var namedTypes = types17.namedTypes;
|
|
57898
|
+
var isString = types17.builtInTypes.string;
|
|
57899
|
+
var isObject2 = types17.builtInTypes.object;
|
|
57900
57900
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
57901
57901
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
57902
57902
|
isString.assert(code);
|
|
@@ -58058,7 +58058,7 @@ var require_printer2 = __commonJS({
|
|
|
58058
58058
|
case "OptionalMemberExpression": {
|
|
58059
58059
|
parts.push(path2.call(print9, "object"));
|
|
58060
58060
|
var property = path2.call(print9, "property");
|
|
58061
|
-
var optional =
|
|
58061
|
+
var optional = types17.getFieldValue(n, "optional");
|
|
58062
58062
|
if (n.computed) {
|
|
58063
58063
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
58064
58064
|
} else {
|
|
@@ -58329,7 +58329,7 @@ var require_printer2 = __commonJS({
|
|
|
58329
58329
|
if (n.typeArguments) {
|
|
58330
58330
|
parts.push(path2.call(print9, "typeArguments"));
|
|
58331
58331
|
}
|
|
58332
|
-
if (
|
|
58332
|
+
if (types17.getFieldValue(n, "optional")) {
|
|
58333
58333
|
parts.push("?.");
|
|
58334
58334
|
}
|
|
58335
58335
|
parts.push(printArgumentsList(path2, options, print9));
|
|
@@ -60008,8 +60008,8 @@ var require_printer2 = __commonJS({
|
|
|
60008
60008
|
});
|
|
60009
60009
|
}
|
|
60010
60010
|
function getPossibleRaw(node) {
|
|
60011
|
-
var value =
|
|
60012
|
-
var extra =
|
|
60011
|
+
var value = types17.getFieldValue(node, "value");
|
|
60012
|
+
var extra = types17.getFieldValue(node, "extra");
|
|
60013
60013
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
60014
60014
|
return extra.raw;
|
|
60015
60015
|
}
|
|
@@ -60057,8 +60057,8 @@ var require_main2 = __commonJS({
|
|
|
60057
60057
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
60058
60058
|
var tslib_1 = require_tslib();
|
|
60059
60059
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
60060
|
-
var
|
|
60061
|
-
exports.types =
|
|
60060
|
+
var types17 = tslib_1.__importStar(require_main());
|
|
60061
|
+
exports.types = types17;
|
|
60062
60062
|
var parser_1 = require_parser2();
|
|
60063
60063
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
60064
60064
|
return parser_1.parse;
|
|
@@ -66134,7 +66134,7 @@ var printDocASTReducer = {
|
|
|
66134
66134
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
66135
66135
|
},
|
|
66136
66136
|
UnionTypeDefinition: {
|
|
66137
|
-
leave: ({ name, directives, types:
|
|
66137
|
+
leave: ({ name, directives, types: types17 }) => join(["union", name, join(directives, " "), wrap("= ", join(types17, " | "))], " ")
|
|
66138
66138
|
},
|
|
66139
66139
|
EnumTypeDefinition: {
|
|
66140
66140
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -66161,7 +66161,7 @@ var printDocASTReducer = {
|
|
|
66161
66161
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
66162
66162
|
},
|
|
66163
66163
|
UnionTypeExtension: {
|
|
66164
|
-
leave: ({ name, directives, types:
|
|
66164
|
+
leave: ({ name, directives, types: types17 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types17, " | "))], " ")
|
|
66165
66165
|
},
|
|
66166
66166
|
EnumTypeExtension: {
|
|
66167
66167
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -67041,8 +67041,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
67041
67041
|
}
|
|
67042
67042
|
}
|
|
67043
67043
|
function healUnderlyingTypes(type) {
|
|
67044
|
-
const
|
|
67045
|
-
|
|
67044
|
+
const types17 = type.getTypes();
|
|
67045
|
+
types17.push(...types17.splice(0).map((t2) => healType(t2)).filter(Boolean));
|
|
67046
67046
|
}
|
|
67047
67047
|
function healType(type) {
|
|
67048
67048
|
if ((0, import_graphql11.isListType)(type)) {
|
|
@@ -67826,11 +67826,11 @@ function mergeEnum(e1, e2, config2) {
|
|
|
67826
67826
|
|
|
67827
67827
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.8.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
67828
67828
|
var import_graphql20 = __toESM(require_graphql2(), 1);
|
|
67829
|
-
function isStringTypes(
|
|
67830
|
-
return typeof
|
|
67829
|
+
function isStringTypes(types17) {
|
|
67830
|
+
return typeof types17 === "string";
|
|
67831
67831
|
}
|
|
67832
|
-
function isSourceTypes(
|
|
67833
|
-
return
|
|
67832
|
+
function isSourceTypes(types17) {
|
|
67833
|
+
return types17 instanceof import_graphql20.Source;
|
|
67834
67834
|
}
|
|
67835
67835
|
function extractType(type) {
|
|
67836
67836
|
let visitedType = type;
|
|
@@ -70200,6 +70200,9 @@ var GarbageCollector = class {
|
|
|
70200
70200
|
constructor(cache) {
|
|
70201
70201
|
this.cache = cache;
|
|
70202
70202
|
}
|
|
70203
|
+
reset() {
|
|
70204
|
+
this.lifetimes.clear();
|
|
70205
|
+
}
|
|
70203
70206
|
resetLifetime(id, field) {
|
|
70204
70207
|
if (!this.lifetimes.get(id)) {
|
|
70205
70208
|
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
@@ -70319,6 +70322,10 @@ var ListManager = class {
|
|
|
70319
70322
|
}
|
|
70320
70323
|
this.listsByField.get(parentID).delete(field);
|
|
70321
70324
|
}
|
|
70325
|
+
reset() {
|
|
70326
|
+
this.lists.clear();
|
|
70327
|
+
this.listsByField.clear();
|
|
70328
|
+
}
|
|
70322
70329
|
};
|
|
70323
70330
|
var List = class {
|
|
70324
70331
|
recordID;
|
|
@@ -70701,6 +70708,9 @@ var StaleManager = class {
|
|
|
70701
70708
|
}
|
|
70702
70709
|
}
|
|
70703
70710
|
}
|
|
70711
|
+
reset() {
|
|
70712
|
+
this.fieldsTime.clear();
|
|
70713
|
+
}
|
|
70704
70714
|
};
|
|
70705
70715
|
|
|
70706
70716
|
// src/runtime/cache/storage.ts
|
|
@@ -70881,6 +70891,9 @@ var InMemoryStorage = class {
|
|
|
70881
70891
|
layer.fields = fields;
|
|
70882
70892
|
layer.links = links;
|
|
70883
70893
|
}
|
|
70894
|
+
reset() {
|
|
70895
|
+
this.data = [];
|
|
70896
|
+
}
|
|
70884
70897
|
};
|
|
70885
70898
|
var Layer = class {
|
|
70886
70899
|
id;
|
|
@@ -71326,6 +71339,18 @@ var InMemorySubscriptions = class {
|
|
|
71326
71339
|
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
71327
71340
|
}
|
|
71328
71341
|
}
|
|
71342
|
+
reset() {
|
|
71343
|
+
const subscribers = Object.entries(this.subscribers).filter(
|
|
71344
|
+
([id]) => !id.startsWith(rootID)
|
|
71345
|
+
);
|
|
71346
|
+
for (const [id, _fields] of subscribers) {
|
|
71347
|
+
delete this.subscribers[id];
|
|
71348
|
+
}
|
|
71349
|
+
const subscriptionSpecs = subscribers.flatMap(
|
|
71350
|
+
([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
|
|
71351
|
+
);
|
|
71352
|
+
return subscriptionSpecs;
|
|
71353
|
+
}
|
|
71329
71354
|
removeSubscribers(id, fieldName, specs) {
|
|
71330
71355
|
let targets = [];
|
|
71331
71356
|
for (const spec of specs) {
|
|
@@ -71515,6 +71540,14 @@ var Cache = class {
|
|
|
71515
71540
|
}
|
|
71516
71541
|
this.#notifySubscribers(toNotify);
|
|
71517
71542
|
}
|
|
71543
|
+
reset() {
|
|
71544
|
+
const subSpecs = this._internal_unstable.subscriptions.reset();
|
|
71545
|
+
this._internal_unstable.staleManager.reset();
|
|
71546
|
+
this._internal_unstable.lifetimes.reset();
|
|
71547
|
+
this._internal_unstable.lists.reset();
|
|
71548
|
+
this._internal_unstable.storage.reset();
|
|
71549
|
+
this.#notifySubscribers(subSpecs);
|
|
71550
|
+
}
|
|
71518
71551
|
#notifySubscribers(subs) {
|
|
71519
71552
|
if (subs.length === 0) {
|
|
71520
71553
|
return;
|
|
@@ -71664,12 +71697,9 @@ var CacheInternal = class {
|
|
|
71664
71697
|
);
|
|
71665
71698
|
}
|
|
71666
71699
|
}
|
|
71667
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
71668
|
-
(field2) => typeof value[field2] === "undefined"
|
|
71669
|
-
).length > 0;
|
|
71670
71700
|
let linkedID = null;
|
|
71671
71701
|
if (value !== null) {
|
|
71672
|
-
linkedID = !
|
|
71702
|
+
linkedID = !this.isEmbedded(linkedType, value) ? this.id(linkedType, value) : `${parent2}.${key}`;
|
|
71673
71703
|
}
|
|
71674
71704
|
let linkChange = linkedID !== previousValue;
|
|
71675
71705
|
layer.writeLink(parent2, key, linkedID);
|
|
@@ -71697,7 +71727,7 @@ var CacheInternal = class {
|
|
|
71697
71727
|
forceNotify
|
|
71698
71728
|
});
|
|
71699
71729
|
}
|
|
71700
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
71730
|
+
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
71701
71731
|
let oldIDs = [...previousValue || []];
|
|
71702
71732
|
const emptyEdges = !updates ? [] : oldIDs.map((id) => {
|
|
71703
71733
|
if (!id) {
|
|
@@ -71770,7 +71800,7 @@ var CacheInternal = class {
|
|
|
71770
71800
|
} else {
|
|
71771
71801
|
linkedIDs = nestedIDs;
|
|
71772
71802
|
}
|
|
71773
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
71803
|
+
const contentChanged = !deepEquals(linkedIDs, oldIDs) || previousValue === null;
|
|
71774
71804
|
if (contentChanged || forceNotify) {
|
|
71775
71805
|
toNotify.push(...currentSubscribers);
|
|
71776
71806
|
}
|
|
@@ -72041,6 +72071,10 @@ var CacheInternal = class {
|
|
|
72041
72071
|
computeID(type, data) {
|
|
72042
72072
|
return computeID(this.config, type, data);
|
|
72043
72073
|
}
|
|
72074
|
+
isEmbedded(linkedType, value) {
|
|
72075
|
+
const idFields = this.idFields(linkedType);
|
|
72076
|
+
return idFields.length === 0 || idFields.filter((field) => typeof value[field] === "undefined").length > 0;
|
|
72077
|
+
}
|
|
72044
72078
|
hydrateNestedList({
|
|
72045
72079
|
fields,
|
|
72046
72080
|
variables,
|
|
@@ -72148,9 +72182,6 @@ var CacheInternal = class {
|
|
|
72148
72182
|
}
|
|
72149
72183
|
const entryObj = entry;
|
|
72150
72184
|
let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
|
|
72151
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
72152
|
-
(field) => typeof entry[field] === "undefined"
|
|
72153
|
-
).length > 0;
|
|
72154
72185
|
let innerType = linkedType;
|
|
72155
72186
|
const typename = entryObj.__typename;
|
|
72156
72187
|
if (typename) {
|
|
@@ -72158,7 +72189,7 @@ var CacheInternal = class {
|
|
|
72158
72189
|
} else if (abstract) {
|
|
72159
72190
|
throw new Error("Encountered interface type without __typename in the payload");
|
|
72160
72191
|
}
|
|
72161
|
-
if (!
|
|
72192
|
+
if (!this.isEmbedded(linkedType, entry)) {
|
|
72162
72193
|
const id = this.id(innerType, entry);
|
|
72163
72194
|
if (id) {
|
|
72164
72195
|
linkedID = id;
|
|
@@ -72490,7 +72521,7 @@ var Config = class {
|
|
|
72490
72521
|
defaultListTarget = null,
|
|
72491
72522
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
72492
72523
|
defaultKeys,
|
|
72493
|
-
types:
|
|
72524
|
+
types: types17 = {},
|
|
72494
72525
|
logLevel,
|
|
72495
72526
|
defaultFragmentMasking = "enable",
|
|
72496
72527
|
watchSchema,
|
|
@@ -72534,10 +72565,10 @@ var Config = class {
|
|
|
72534
72565
|
if (defaultKeys) {
|
|
72535
72566
|
this.defaultKeys = defaultKeys;
|
|
72536
72567
|
}
|
|
72537
|
-
if (
|
|
72568
|
+
if (types17) {
|
|
72538
72569
|
this.typeConfig = {
|
|
72539
72570
|
...this.typeConfig,
|
|
72540
|
-
...
|
|
72571
|
+
...types17
|
|
72541
72572
|
};
|
|
72542
72573
|
}
|
|
72543
72574
|
}
|
|
@@ -73736,7 +73767,7 @@ var graphql27 = __toESM(require_graphql2(), 1);
|
|
|
73736
73767
|
|
|
73737
73768
|
// src/codegen/generators/artifacts/index.ts
|
|
73738
73769
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
73739
|
-
var
|
|
73770
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
73740
73771
|
|
|
73741
73772
|
// src/codegen/utils/commonjs.ts
|
|
73742
73773
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -74923,7 +74954,6 @@ function ancestorKey(ancestors) {
|
|
|
74923
74954
|
|
|
74924
74955
|
// src/codegen/generators/artifacts/selection.ts
|
|
74925
74956
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
74926
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
74927
74957
|
|
|
74928
74958
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
74929
74959
|
var config = {
|
|
@@ -75870,15 +75900,12 @@ function fieldKey(config2, field) {
|
|
|
75870
75900
|
}
|
|
75871
75901
|
|
|
75872
75902
|
// src/codegen/generators/artifacts/selection.ts
|
|
75873
|
-
var AST5 = recast5.types.builders;
|
|
75874
75903
|
function selection_default(args) {
|
|
75875
|
-
const typeMap = {};
|
|
75876
|
-
const abstractTypes = [];
|
|
75877
75904
|
return mergeSelection({
|
|
75878
|
-
|
|
75879
|
-
|
|
75880
|
-
|
|
75881
|
-
|
|
75905
|
+
config: args.config,
|
|
75906
|
+
rootType: args.rootType,
|
|
75907
|
+
object: prepareSelection(args),
|
|
75908
|
+
filepath: args.filepath
|
|
75882
75909
|
});
|
|
75883
75910
|
}
|
|
75884
75911
|
function prepareSelection({
|
|
@@ -75890,8 +75917,6 @@ function prepareSelection({
|
|
|
75890
75917
|
path: path2 = [],
|
|
75891
75918
|
document,
|
|
75892
75919
|
inConnection,
|
|
75893
|
-
typeMap,
|
|
75894
|
-
abstractTypes,
|
|
75895
75920
|
globalLoading,
|
|
75896
75921
|
includeFragments
|
|
75897
75922
|
}) {
|
|
@@ -75911,8 +75936,6 @@ function prepareSelection({
|
|
|
75911
75936
|
selections: field.selectionSet.selections,
|
|
75912
75937
|
path: path2,
|
|
75913
75938
|
document,
|
|
75914
|
-
typeMap,
|
|
75915
|
-
abstractTypes,
|
|
75916
75939
|
globalLoading,
|
|
75917
75940
|
includeFragments
|
|
75918
75941
|
}).fields || {}
|
|
@@ -75924,32 +75947,7 @@ function prepareSelection({
|
|
|
75924
75947
|
typeMap: {}
|
|
75925
75948
|
};
|
|
75926
75949
|
}
|
|
75927
|
-
const parentType = config2.schema.getType(rootType);
|
|
75928
75950
|
const typeConditionName = field.typeCondition.name.value;
|
|
75929
|
-
const typeCondition = config2.schema.getType(typeConditionName);
|
|
75930
|
-
const possibleTypes = [];
|
|
75931
|
-
if (!graphql13.isAbstractType(typeCondition)) {
|
|
75932
|
-
} else if (graphql13.isAbstractType(parentType)) {
|
|
75933
|
-
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
75934
|
-
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
75935
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
75936
|
-
possibleTypes.push(possible.name);
|
|
75937
|
-
}
|
|
75938
|
-
}
|
|
75939
|
-
} else {
|
|
75940
|
-
possibleTypes.push(rootType);
|
|
75941
|
-
}
|
|
75942
|
-
if (possibleTypes.length > 0) {
|
|
75943
|
-
for (const type of possibleTypes) {
|
|
75944
|
-
const existing = typeMap[type];
|
|
75945
|
-
if (!existing || !existing.includes(type)) {
|
|
75946
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
75947
|
-
}
|
|
75948
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
75949
|
-
abstractTypes.push(typeConditionName);
|
|
75950
|
-
}
|
|
75951
|
-
}
|
|
75952
|
-
}
|
|
75953
75951
|
object.abstractFields.fields = {
|
|
75954
75952
|
...object.abstractFields.fields,
|
|
75955
75953
|
[typeConditionName]: prepareSelection({
|
|
@@ -75960,8 +75958,6 @@ function prepareSelection({
|
|
|
75960
75958
|
selections: field.selectionSet.selections,
|
|
75961
75959
|
path: path2,
|
|
75962
75960
|
document,
|
|
75963
|
-
typeMap,
|
|
75964
|
-
abstractTypes,
|
|
75965
75961
|
globalLoading,
|
|
75966
75962
|
includeFragments
|
|
75967
75963
|
}).fields
|
|
@@ -75973,19 +75969,38 @@ function prepareSelection({
|
|
|
75973
75969
|
} else if (field.kind === "Field") {
|
|
75974
75970
|
const type = config2.schema.getType(rootType);
|
|
75975
75971
|
if (!type) {
|
|
75976
|
-
throw new HoudiniError({
|
|
75972
|
+
throw new HoudiniError({
|
|
75973
|
+
filepath,
|
|
75974
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
75975
|
+
});
|
|
75977
75976
|
}
|
|
75978
75977
|
const attributeName = field.alias?.value || field.name.value;
|
|
75979
|
-
let fieldType;
|
|
75978
|
+
let fieldType = null;
|
|
75980
75979
|
let nullable = false;
|
|
75981
75980
|
if (field.name.value === "__typename") {
|
|
75982
75981
|
fieldType = config2.schema.getType("String");
|
|
75983
|
-
} else {
|
|
75982
|
+
} else if ("getFields" in type) {
|
|
75984
75983
|
let typeRef = type.getFields()[field.name.value].type;
|
|
75985
75984
|
fieldType = getRootType(typeRef);
|
|
75986
75985
|
nullable = !graphql13.isNonNullType(typeRef);
|
|
75986
|
+
} else if (graphql13.isAbstractType(type)) {
|
|
75987
|
+
for (const possible of config2.schema.getPossibleTypes(type)) {
|
|
75988
|
+
if (graphql13.isObjectType(possible)) {
|
|
75989
|
+
if (possible.getFields()[field.name.value]) {
|
|
75990
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
75991
|
+
nullable = !graphql13.isNonNullType(fieldType);
|
|
75992
|
+
break;
|
|
75993
|
+
}
|
|
75994
|
+
}
|
|
75995
|
+
}
|
|
75996
|
+
}
|
|
75997
|
+
if (!fieldType) {
|
|
75998
|
+
throw {
|
|
75999
|
+
message: "Could not identify field's type",
|
|
76000
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
76001
|
+
};
|
|
75987
76002
|
}
|
|
75988
|
-
const typeName = fieldType.
|
|
76003
|
+
const typeName = getRootType(fieldType).name;
|
|
75989
76004
|
const pathSoFar = path2.concat(attributeName);
|
|
75990
76005
|
const keys2 = config2.keyFieldsForType(rootType);
|
|
75991
76006
|
let fieldObj = {
|
|
@@ -76079,8 +76094,6 @@ function prepareSelection({
|
|
|
76079
76094
|
path: pathSoFar,
|
|
76080
76095
|
document,
|
|
76081
76096
|
inConnection: connectionState,
|
|
76082
|
-
typeMap,
|
|
76083
|
-
abstractTypes,
|
|
76084
76097
|
globalLoading: forceLoading,
|
|
76085
76098
|
includeFragments
|
|
76086
76099
|
});
|
|
@@ -76166,69 +76179,107 @@ function prepareSelection({
|
|
|
76166
76179
|
return object;
|
|
76167
76180
|
}
|
|
76168
76181
|
function mergeSelection({
|
|
76182
|
+
config: config2,
|
|
76169
76183
|
filepath,
|
|
76170
76184
|
object,
|
|
76171
|
-
|
|
76172
|
-
abstractTypes
|
|
76185
|
+
rootType
|
|
76173
76186
|
}) {
|
|
76174
76187
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
76175
|
-
|
|
76176
|
-
|
|
76188
|
+
const abstractSelection = {
|
|
76189
|
+
fields: {},
|
|
76190
|
+
typeMap: {}
|
|
76191
|
+
};
|
|
76192
|
+
const possibleSelectionTypes = {};
|
|
76193
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
76194
|
+
const gqlType = config2.schema.getType(typeName);
|
|
76195
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
76196
|
+
filepath,
|
|
76197
|
+
typeSelection,
|
|
76198
|
+
abstractSelection.fields[typeName] ?? {}
|
|
76199
|
+
);
|
|
76200
|
+
if (graphql13.isAbstractType(gqlType)) {
|
|
76201
|
+
for (const possible of config2.schema.getPossibleTypes(gqlType)) {
|
|
76202
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
76203
|
+
possibleSelectionTypes[typeName] = [];
|
|
76204
|
+
}
|
|
76205
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
76206
|
+
}
|
|
76207
|
+
}
|
|
76208
|
+
}
|
|
76209
|
+
const concreteSelectionImplements = {};
|
|
76210
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
76211
|
+
for (const possible of possibles) {
|
|
76212
|
+
if (!concreteSelectionImplements[possible]) {
|
|
76213
|
+
concreteSelectionImplements[possible] = [];
|
|
76214
|
+
}
|
|
76215
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
76216
|
+
}
|
|
76217
|
+
}
|
|
76218
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
76219
|
+
if (implementations.length > 1) {
|
|
76220
|
+
abstractSelection.fields[concrete] = {};
|
|
76221
|
+
}
|
|
76222
|
+
}
|
|
76223
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
76177
76224
|
for (const possible of possibles) {
|
|
76178
|
-
if (
|
|
76179
|
-
|
|
76225
|
+
if (abstractSelection.fields[possible]) {
|
|
76226
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
76180
76227
|
filepath,
|
|
76181
|
-
|
|
76182
|
-
|
|
76228
|
+
abstractSelection.fields[typeName] ?? {},
|
|
76229
|
+
abstractSelection.fields[possible] ?? {}
|
|
76183
76230
|
);
|
|
76184
|
-
overlap = true;
|
|
76185
76231
|
}
|
|
76186
76232
|
}
|
|
76187
|
-
if (overlap) {
|
|
76188
|
-
delete typeMap[typeName];
|
|
76189
|
-
}
|
|
76190
76233
|
}
|
|
76191
|
-
|
|
76192
|
-
|
|
76193
|
-
|
|
76194
|
-
|
|
76195
|
-
|
|
76196
|
-
);
|
|
76197
|
-
delete typeMap[type];
|
|
76234
|
+
const parentType = config2.schema.getType(rootType);
|
|
76235
|
+
const possibleParents = graphql13.isAbstractType(parentType) ? config2.schema.getPossibleTypes(parentType)?.map((t2) => t2.name) : [parentType.name];
|
|
76236
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
76237
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
76238
|
+
delete abstractSelection.typeMap[key];
|
|
76198
76239
|
}
|
|
76199
76240
|
}
|
|
76200
|
-
for (const [type, sel] of Object.entries(
|
|
76201
|
-
|
|
76241
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
76242
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
76202
76243
|
}
|
|
76203
|
-
for (const [
|
|
76204
|
-
|
|
76244
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
76245
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
76246
|
+
delete abstractSelection.fields[typename];
|
|
76247
|
+
}
|
|
76205
76248
|
}
|
|
76206
|
-
const
|
|
76207
|
-
|
|
76208
|
-
|
|
76209
|
-
|
|
76249
|
+
for (const possible of possibleParents) {
|
|
76250
|
+
if (abstractSelection.fields[possible]) {
|
|
76251
|
+
continue;
|
|
76252
|
+
}
|
|
76253
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
76254
|
+
possibleSelectionTypes
|
|
76255
|
+
)) {
|
|
76256
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
76257
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
76258
|
+
break;
|
|
76259
|
+
}
|
|
76210
76260
|
}
|
|
76211
76261
|
}
|
|
76262
|
+
object.abstractFields = abstractSelection;
|
|
76212
76263
|
}
|
|
76213
|
-
for (const
|
|
76264
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
76214
76265
|
const selection = value.selection;
|
|
76215
76266
|
if (selection) {
|
|
76216
76267
|
mergeSelection({
|
|
76268
|
+
config: config2,
|
|
76269
|
+
rootType: value.type,
|
|
76217
76270
|
filepath,
|
|
76218
|
-
typeMap,
|
|
76219
|
-
abstractTypes,
|
|
76220
76271
|
object: selection
|
|
76221
76272
|
});
|
|
76222
76273
|
}
|
|
76223
76274
|
}
|
|
76224
76275
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
76225
|
-
for (const
|
|
76276
|
+
for (const value of Object.values(selection ?? {})) {
|
|
76226
76277
|
const selection2 = value.selection;
|
|
76227
76278
|
if (selection2) {
|
|
76228
76279
|
mergeSelection({
|
|
76280
|
+
config: config2,
|
|
76281
|
+
rootType: value.type,
|
|
76229
76282
|
filepath,
|
|
76230
|
-
typeMap,
|
|
76231
|
-
abstractTypes,
|
|
76232
76283
|
object: selection2
|
|
76233
76284
|
});
|
|
76234
76285
|
}
|
|
@@ -76238,7 +76289,7 @@ function mergeSelection({
|
|
|
76238
76289
|
}
|
|
76239
76290
|
|
|
76240
76291
|
// src/codegen/generators/artifacts/index.ts
|
|
76241
|
-
var
|
|
76292
|
+
var AST5 = recast5.types.builders;
|
|
76242
76293
|
function artifactGenerator(stats) {
|
|
76243
76294
|
return async function(config2, docs) {
|
|
76244
76295
|
const filterTypes = {};
|
|
@@ -76506,10 +76557,10 @@ function artifactGenerator(stats) {
|
|
|
76506
76557
|
}
|
|
76507
76558
|
plugin2.artifactEnd({ config: config2, document: doc });
|
|
76508
76559
|
}
|
|
76509
|
-
const file =
|
|
76560
|
+
const file = AST5.program([
|
|
76510
76561
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
76511
|
-
|
|
76512
|
-
|
|
76562
|
+
AST5.expressionStatement(
|
|
76563
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
76513
76564
|
)
|
|
76514
76565
|
]);
|
|
76515
76566
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -76589,8 +76640,8 @@ function applyMask(config2, target, mask) {
|
|
|
76589
76640
|
}
|
|
76590
76641
|
|
|
76591
76642
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
76592
|
-
var
|
|
76593
|
-
var
|
|
76643
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
76644
|
+
var AST6 = recast6.types.builders;
|
|
76594
76645
|
async function generateGraphqlReturnTypes(config2, docs) {
|
|
76595
76646
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
76596
76647
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -76625,18 +76676,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
76625
76676
|
continue;
|
|
76626
76677
|
}
|
|
76627
76678
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
76628
|
-
const input =
|
|
76629
|
-
input.typeAnnotation =
|
|
76630
|
-
|
|
76679
|
+
const input = AST6.identifier("str");
|
|
76680
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
76681
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
76631
76682
|
);
|
|
76632
76683
|
script.body.splice(
|
|
76633
76684
|
i2,
|
|
76634
76685
|
0,
|
|
76635
|
-
|
|
76636
|
-
|
|
76637
|
-
|
|
76686
|
+
AST6.exportNamedDeclaration(
|
|
76687
|
+
AST6.tsDeclareFunction(
|
|
76688
|
+
AST6.identifier("graphql"),
|
|
76638
76689
|
[input],
|
|
76639
|
-
|
|
76690
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
76640
76691
|
)
|
|
76641
76692
|
)
|
|
76642
76693
|
);
|
|
@@ -76799,20 +76850,20 @@ async function generatePluginRuntime({
|
|
|
76799
76850
|
}
|
|
76800
76851
|
|
|
76801
76852
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
76802
|
-
var
|
|
76853
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
76803
76854
|
|
|
76804
76855
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
76805
76856
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
76806
|
-
var
|
|
76857
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
76807
76858
|
|
|
76808
76859
|
// src/codegen/generators/typescript/typeReference.ts
|
|
76809
76860
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
76810
|
-
var
|
|
76861
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
76811
76862
|
|
|
76812
76863
|
// src/codegen/generators/typescript/types.ts
|
|
76813
76864
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
76814
|
-
var
|
|
76815
|
-
var
|
|
76865
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
76866
|
+
var AST7 = recast7.types.builders;
|
|
76816
76867
|
function readonlyProperty(prop, enable = true) {
|
|
76817
76868
|
if (enable) {
|
|
76818
76869
|
prop.readonly = true;
|
|
@@ -76820,28 +76871,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
76820
76871
|
return prop;
|
|
76821
76872
|
}
|
|
76822
76873
|
function nullableField(inner, input = false) {
|
|
76823
|
-
const members = [inner,
|
|
76874
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
76824
76875
|
if (input) {
|
|
76825
|
-
members.push(
|
|
76876
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
76826
76877
|
}
|
|
76827
|
-
return
|
|
76878
|
+
return AST7.tsUnionType(members);
|
|
76828
76879
|
}
|
|
76829
76880
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
76830
76881
|
switch (target.name) {
|
|
76831
76882
|
case "String": {
|
|
76832
|
-
return
|
|
76883
|
+
return AST7.tsStringKeyword();
|
|
76833
76884
|
}
|
|
76834
76885
|
case "Int": {
|
|
76835
|
-
return
|
|
76886
|
+
return AST7.tsNumberKeyword();
|
|
76836
76887
|
}
|
|
76837
76888
|
case "Float": {
|
|
76838
|
-
return
|
|
76889
|
+
return AST7.tsNumberKeyword();
|
|
76839
76890
|
}
|
|
76840
76891
|
case "Boolean": {
|
|
76841
|
-
return
|
|
76892
|
+
return AST7.tsBooleanKeyword();
|
|
76842
76893
|
}
|
|
76843
76894
|
case "ID": {
|
|
76844
|
-
return
|
|
76895
|
+
return AST7.tsStringKeyword();
|
|
76845
76896
|
}
|
|
76846
76897
|
default: {
|
|
76847
76898
|
if (graphql15.isNonNullType(target) && "ofType" in target) {
|
|
@@ -76852,16 +76903,16 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
76852
76903
|
);
|
|
76853
76904
|
}
|
|
76854
76905
|
if (config2.scalars?.[target.name]) {
|
|
76855
|
-
return
|
|
76906
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
76856
76907
|
}
|
|
76857
76908
|
missingScalars.add(target.name);
|
|
76858
|
-
return
|
|
76909
|
+
return AST7.tsAnyKeyword();
|
|
76859
76910
|
}
|
|
76860
76911
|
}
|
|
76861
76912
|
}
|
|
76862
76913
|
|
|
76863
76914
|
// src/codegen/generators/typescript/typeReference.ts
|
|
76864
|
-
var
|
|
76915
|
+
var AST8 = recast8.types.builders;
|
|
76865
76916
|
function tsTypeReference(config2, missingScalars, definition, body) {
|
|
76866
76917
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
76867
76918
|
let result;
|
|
@@ -76870,7 +76921,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
76870
76921
|
} else if (graphql16.isEnumType(type)) {
|
|
76871
76922
|
result = enumReference(config2, body, type.name);
|
|
76872
76923
|
} else {
|
|
76873
|
-
result =
|
|
76924
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
76874
76925
|
}
|
|
76875
76926
|
for (const toWrap of wrappers) {
|
|
76876
76927
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -76878,7 +76929,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
76878
76929
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
76879
76930
|
result = nullableField(result, true);
|
|
76880
76931
|
} else if (toWrap === "List" /* List */) {
|
|
76881
|
-
result =
|
|
76932
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
76882
76933
|
}
|
|
76883
76934
|
}
|
|
76884
76935
|
return result;
|
|
@@ -76891,14 +76942,14 @@ function enumReference(config2, body, name) {
|
|
|
76891
76942
|
importKind: "type",
|
|
76892
76943
|
sourceModule: "$houdini/runtime/lib/types"
|
|
76893
76944
|
});
|
|
76894
|
-
return
|
|
76895
|
-
|
|
76896
|
-
|
|
76945
|
+
return AST8.tsTypeReference(
|
|
76946
|
+
AST8.identifier("ValueOf"),
|
|
76947
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
76897
76948
|
);
|
|
76898
76949
|
}
|
|
76899
76950
|
|
|
76900
76951
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
76901
|
-
var
|
|
76952
|
+
var AST9 = recast9.types.builders;
|
|
76902
76953
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
76903
76954
|
const { type } = unwrapType(config2, rootType);
|
|
76904
76955
|
if (graphql17.isScalarType(type)) {
|
|
@@ -76925,20 +76976,20 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
76925
76976
|
for (const field of Object.values(type.getFields())) {
|
|
76926
76977
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
76927
76978
|
members.push(
|
|
76928
|
-
|
|
76929
|
-
|
|
76930
|
-
|
|
76979
|
+
AST9.tsPropertySignature(
|
|
76980
|
+
AST9.identifier(field.name),
|
|
76981
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field, body)),
|
|
76931
76982
|
graphql17.isNullableType(field.type)
|
|
76932
76983
|
)
|
|
76933
76984
|
);
|
|
76934
76985
|
}
|
|
76935
|
-
body.push(
|
|
76986
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
76936
76987
|
}
|
|
76937
76988
|
|
|
76938
76989
|
// src/codegen/generators/typescript/inlineType.ts
|
|
76939
76990
|
var graphql18 = __toESM(require_graphql2(), 1);
|
|
76940
|
-
var
|
|
76941
|
-
var
|
|
76991
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
76992
|
+
var AST10 = recast10.types.builders;
|
|
76942
76993
|
var fragmentKey2 = " $fragments";
|
|
76943
76994
|
function inlineType({
|
|
76944
76995
|
config: config2,
|
|
@@ -77036,7 +77087,7 @@ function inlineType({
|
|
|
77036
77087
|
{}
|
|
77037
77088
|
)
|
|
77038
77089
|
);
|
|
77039
|
-
result =
|
|
77090
|
+
result = AST10.tsTypeLiteral([
|
|
77040
77091
|
...fields.map((selection) => {
|
|
77041
77092
|
const { field } = selectionTypeInfo(config2.schema, filepath, rootObj, selection);
|
|
77042
77093
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -77064,12 +77115,12 @@ function inlineType({
|
|
|
77064
77115
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
77065
77116
|
).length > 0;
|
|
77066
77117
|
if (hasIncludeOrSkipDirective) {
|
|
77067
|
-
attributeType =
|
|
77118
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
77068
77119
|
}
|
|
77069
77120
|
const prop = readonlyProperty(
|
|
77070
|
-
|
|
77071
|
-
|
|
77072
|
-
|
|
77121
|
+
AST10.tsPropertySignature(
|
|
77122
|
+
AST10.identifier(attributeName),
|
|
77123
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
77073
77124
|
),
|
|
77074
77125
|
allowReadonly
|
|
77075
77126
|
);
|
|
@@ -77083,14 +77134,14 @@ function inlineType({
|
|
|
77083
77134
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
77084
77135
|
result.members.push(
|
|
77085
77136
|
readonlyProperty(
|
|
77086
|
-
|
|
77087
|
-
|
|
77088
|
-
|
|
77089
|
-
|
|
77137
|
+
AST10.tsPropertySignature(
|
|
77138
|
+
AST10.stringLiteral(fragmentKey2),
|
|
77139
|
+
AST10.tsTypeAnnotation(
|
|
77140
|
+
AST10.tsTypeLiteral(
|
|
77090
77141
|
(fragmentSpreads || []).map(
|
|
77091
|
-
(fragmentSpread) =>
|
|
77092
|
-
|
|
77093
|
-
|
|
77142
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
77143
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
77144
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
77094
77145
|
)
|
|
77095
77146
|
)
|
|
77096
77147
|
)
|
|
@@ -77135,9 +77186,9 @@ function inlineType({
|
|
|
77135
77186
|
}
|
|
77136
77187
|
objectType.members.push(
|
|
77137
77188
|
readonlyProperty(
|
|
77138
|
-
|
|
77139
|
-
|
|
77140
|
-
|
|
77189
|
+
AST10.tsPropertySignature(
|
|
77190
|
+
AST10.identifier("__typename"),
|
|
77191
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
77141
77192
|
),
|
|
77142
77193
|
allowReadonly
|
|
77143
77194
|
)
|
|
@@ -77177,8 +77228,8 @@ function inlineType({
|
|
|
77177
77228
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
77178
77229
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
77179
77230
|
([typeName, { type: type2, tsType }]) => {
|
|
77180
|
-
return
|
|
77181
|
-
|
|
77231
|
+
return AST10.tsParenthesizedType(
|
|
77232
|
+
AST10.tsIntersectionType(
|
|
77182
77233
|
[tsType].flatMap((type3) => {
|
|
77183
77234
|
if (type3.type === "TSUnionType") {
|
|
77184
77235
|
return type3.types.filter(
|
|
@@ -77204,14 +77255,14 @@ function inlineType({
|
|
|
77204
77255
|
);
|
|
77205
77256
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
77206
77257
|
selectionTypes.push(
|
|
77207
|
-
|
|
77208
|
-
|
|
77258
|
+
AST10.tsParenthesizedType(
|
|
77259
|
+
AST10.tsTypeLiteral([
|
|
77209
77260
|
readonlyProperty(
|
|
77210
|
-
|
|
77211
|
-
|
|
77212
|
-
|
|
77213
|
-
|
|
77214
|
-
|
|
77261
|
+
AST10.tsPropertySignature(
|
|
77262
|
+
AST10.identifier("__typename"),
|
|
77263
|
+
AST10.tsTypeAnnotation(
|
|
77264
|
+
AST10.tsLiteralType(
|
|
77265
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
77215
77266
|
)
|
|
77216
77267
|
)
|
|
77217
77268
|
),
|
|
@@ -77221,9 +77272,9 @@ function inlineType({
|
|
|
77221
77272
|
)
|
|
77222
77273
|
);
|
|
77223
77274
|
}
|
|
77224
|
-
result =
|
|
77275
|
+
result = AST10.tsIntersectionType([
|
|
77225
77276
|
result,
|
|
77226
|
-
|
|
77277
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
77227
77278
|
]);
|
|
77228
77279
|
}
|
|
77229
77280
|
} else {
|
|
@@ -77241,7 +77292,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
77241
77292
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
77242
77293
|
continue;
|
|
77243
77294
|
} else if (toWrap === "List" /* List */) {
|
|
77244
|
-
result =
|
|
77295
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
77245
77296
|
}
|
|
77246
77297
|
}
|
|
77247
77298
|
return result;
|
|
@@ -77286,13 +77337,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
77286
77337
|
}
|
|
77287
77338
|
|
|
77288
77339
|
// src/codegen/generators/typescript/loadingState.ts
|
|
77289
|
-
var
|
|
77290
|
-
var
|
|
77340
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
77341
|
+
var AST11 = recast11.types.builders;
|
|
77291
77342
|
function withLoadingState(args) {
|
|
77292
77343
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
77293
77344
|
return args.base;
|
|
77294
77345
|
}
|
|
77295
|
-
return
|
|
77346
|
+
return AST11.tsUnionType([
|
|
77296
77347
|
args.base,
|
|
77297
77348
|
loadingState({
|
|
77298
77349
|
parentType: args.document.artifact.rootType,
|
|
@@ -77311,7 +77362,7 @@ function loadingState(args) {
|
|
|
77311
77362
|
import: ["LoadingType"],
|
|
77312
77363
|
sourceModule: "$houdini/runtime/lib/types"
|
|
77313
77364
|
});
|
|
77314
|
-
const result =
|
|
77365
|
+
const result = AST11.tsTypeLiteral(
|
|
77315
77366
|
Object.entries(selection).reduce(
|
|
77316
77367
|
(rest, [attributeName, value]) => {
|
|
77317
77368
|
if (!value.loading) {
|
|
@@ -77319,7 +77370,7 @@ function loadingState(args) {
|
|
|
77319
77370
|
}
|
|
77320
77371
|
let keyType = null;
|
|
77321
77372
|
if (value.loading.kind === "value") {
|
|
77322
|
-
keyType =
|
|
77373
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
77323
77374
|
}
|
|
77324
77375
|
if (value.loading.kind === "continue" && value.selection) {
|
|
77325
77376
|
keyType = loadingState({
|
|
@@ -77335,15 +77386,15 @@ function loadingState(args) {
|
|
|
77335
77386
|
}
|
|
77336
77387
|
if (value.loading.list) {
|
|
77337
77388
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
77338
|
-
keyType =
|
|
77389
|
+
keyType = AST11.tsArrayType(keyType);
|
|
77339
77390
|
}
|
|
77340
77391
|
}
|
|
77341
77392
|
return [
|
|
77342
77393
|
...rest,
|
|
77343
77394
|
readonlyProperty(
|
|
77344
|
-
|
|
77345
|
-
|
|
77346
|
-
|
|
77395
|
+
AST11.tsPropertySignature(
|
|
77396
|
+
AST11.identifier(attributeName),
|
|
77397
|
+
AST11.tsTypeAnnotation(keyType)
|
|
77347
77398
|
)
|
|
77348
77399
|
)
|
|
77349
77400
|
];
|
|
@@ -77354,14 +77405,14 @@ function loadingState(args) {
|
|
|
77354
77405
|
if (args.selection.fragments) {
|
|
77355
77406
|
result.members.push(
|
|
77356
77407
|
readonlyProperty(
|
|
77357
|
-
|
|
77358
|
-
|
|
77359
|
-
|
|
77360
|
-
|
|
77408
|
+
AST11.tsPropertySignature(
|
|
77409
|
+
AST11.stringLiteral(fragmentKey),
|
|
77410
|
+
AST11.tsTypeAnnotation(
|
|
77411
|
+
AST11.tsTypeLiteral(
|
|
77361
77412
|
Object.keys(args.selection.fragments).map((name) => {
|
|
77362
|
-
return
|
|
77363
|
-
|
|
77364
|
-
|
|
77413
|
+
return AST11.tsPropertySignature(
|
|
77414
|
+
AST11.identifier(name),
|
|
77415
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
77365
77416
|
);
|
|
77366
77417
|
})
|
|
77367
77418
|
)
|
|
@@ -77374,7 +77425,7 @@ function loadingState(args) {
|
|
|
77374
77425
|
}
|
|
77375
77426
|
|
|
77376
77427
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
77377
|
-
var
|
|
77428
|
+
var AST12 = recast12.types.builders;
|
|
77378
77429
|
async function generateDocumentTypes(config2, docs) {
|
|
77379
77430
|
const typePaths = [];
|
|
77380
77431
|
const fragmentDefinitions = {};
|
|
@@ -77399,7 +77450,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
77399
77450
|
return;
|
|
77400
77451
|
}
|
|
77401
77452
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
77402
|
-
const program3 =
|
|
77453
|
+
const program3 = AST12.program([]);
|
|
77403
77454
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
77404
77455
|
let definition = originalDocument.definitions.find(
|
|
77405
77456
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -77435,9 +77486,9 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
77435
77486
|
);
|
|
77436
77487
|
}
|
|
77437
77488
|
program3.body.push(
|
|
77438
|
-
|
|
77439
|
-
|
|
77440
|
-
|
|
77489
|
+
AST12.exportNamedDeclaration(
|
|
77490
|
+
AST12.tsTypeAliasDeclaration(
|
|
77491
|
+
AST12.identifier(`${name}$artifact`),
|
|
77441
77492
|
convertToTs(serializeValue(artifact))
|
|
77442
77493
|
)
|
|
77443
77494
|
)
|
|
@@ -77447,17 +77498,17 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
77447
77498
|
typePaths.push(typeDefPath);
|
|
77448
77499
|
})
|
|
77449
77500
|
);
|
|
77450
|
-
const typeIndex =
|
|
77501
|
+
const typeIndex = AST12.program(
|
|
77451
77502
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
77452
|
-
return
|
|
77453
|
-
|
|
77503
|
+
return AST12.exportAllDeclaration(
|
|
77504
|
+
AST12.literal(
|
|
77454
77505
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
77455
77506
|
),
|
|
77456
77507
|
null
|
|
77457
77508
|
);
|
|
77458
77509
|
}).concat([
|
|
77459
|
-
|
|
77460
|
-
|
|
77510
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
77511
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
77461
77512
|
])
|
|
77462
77513
|
);
|
|
77463
77514
|
const exportDefaultAs = ({ module: module2, as }) => `
|
|
@@ -77512,7 +77563,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
77512
77563
|
}
|
|
77513
77564
|
function convertToTs(source) {
|
|
77514
77565
|
if (source.type === "ObjectExpression") {
|
|
77515
|
-
return
|
|
77566
|
+
return AST12.tsTypeLiteral(
|
|
77516
77567
|
source.properties.reduce(
|
|
77517
77568
|
(props, prop) => {
|
|
77518
77569
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -77520,9 +77571,9 @@ function convertToTs(source) {
|
|
|
77520
77571
|
}
|
|
77521
77572
|
return [
|
|
77522
77573
|
...props,
|
|
77523
|
-
|
|
77574
|
+
AST12.tsPropertySignature(
|
|
77524
77575
|
prop.key,
|
|
77525
|
-
|
|
77576
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
77526
77577
|
)
|
|
77527
77578
|
];
|
|
77528
77579
|
},
|
|
@@ -77531,20 +77582,20 @@ function convertToTs(source) {
|
|
|
77531
77582
|
);
|
|
77532
77583
|
}
|
|
77533
77584
|
if (source.type === "ArrayExpression") {
|
|
77534
|
-
return
|
|
77585
|
+
return AST12.tsTupleType(
|
|
77535
77586
|
source.elements.map((element) => convertToTs(element))
|
|
77536
77587
|
);
|
|
77537
77588
|
}
|
|
77538
77589
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
77539
|
-
return
|
|
77590
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
77540
77591
|
}
|
|
77541
77592
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
77542
|
-
return
|
|
77593
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
77543
77594
|
}
|
|
77544
77595
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
77545
|
-
return
|
|
77596
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
77546
77597
|
}
|
|
77547
|
-
return
|
|
77598
|
+
return AST12.tsLiteralType(source);
|
|
77548
77599
|
}
|
|
77549
77600
|
async function generateOperationTypeDefs(config2, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
77550
77601
|
let parentType = null;
|
|
@@ -77583,23 +77634,23 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
77583
77634
|
});
|
|
77584
77635
|
}
|
|
77585
77636
|
body.push(
|
|
77586
|
-
|
|
77587
|
-
|
|
77588
|
-
|
|
77589
|
-
|
|
77637
|
+
AST12.exportNamedDeclaration(
|
|
77638
|
+
AST12.tsTypeAliasDeclaration(
|
|
77639
|
+
AST12.identifier(definition.name.value),
|
|
77640
|
+
AST12.tsTypeLiteral([
|
|
77590
77641
|
readonlyProperty(
|
|
77591
|
-
|
|
77592
|
-
|
|
77593
|
-
|
|
77642
|
+
AST12.tsPropertySignature(
|
|
77643
|
+
AST12.stringLiteral("input"),
|
|
77644
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
77594
77645
|
)
|
|
77595
77646
|
),
|
|
77596
77647
|
readonlyProperty(
|
|
77597
|
-
|
|
77598
|
-
|
|
77599
|
-
|
|
77600
|
-
definition.operation === "mutation" ?
|
|
77601
|
-
|
|
77602
|
-
|
|
77648
|
+
AST12.tsPropertySignature(
|
|
77649
|
+
AST12.stringLiteral("result"),
|
|
77650
|
+
AST12.tsTypeAnnotation(
|
|
77651
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
77652
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
77653
|
+
AST12.tsUndefinedKeyword()
|
|
77603
77654
|
])
|
|
77604
77655
|
)
|
|
77605
77656
|
)
|
|
@@ -77607,8 +77658,8 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
77607
77658
|
])
|
|
77608
77659
|
)
|
|
77609
77660
|
),
|
|
77610
|
-
|
|
77611
|
-
|
|
77661
|
+
AST12.exportNamedDeclaration(
|
|
77662
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
77612
77663
|
)
|
|
77613
77664
|
);
|
|
77614
77665
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -77623,15 +77674,15 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
77623
77674
|
);
|
|
77624
77675
|
}
|
|
77625
77676
|
body.push(
|
|
77626
|
-
|
|
77627
|
-
|
|
77628
|
-
|
|
77629
|
-
|
|
77677
|
+
AST12.exportNamedDeclaration(
|
|
77678
|
+
AST12.tsTypeAliasDeclaration(
|
|
77679
|
+
AST12.identifier(inputTypeName),
|
|
77680
|
+
AST12.tsTypeLiteral(
|
|
77630
77681
|
(definition.variableDefinitions || []).map(
|
|
77631
77682
|
(definition2) => {
|
|
77632
|
-
return
|
|
77633
|
-
|
|
77634
|
-
|
|
77683
|
+
return AST12.tsPropertySignature(
|
|
77684
|
+
AST12.identifier(definition2.variable.name.value),
|
|
77685
|
+
AST12.tsTypeAnnotation(
|
|
77635
77686
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
77636
77687
|
),
|
|
77637
77688
|
definition2.type.kind !== "NonNullType"
|
|
@@ -77644,16 +77695,16 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
77644
77695
|
);
|
|
77645
77696
|
} else {
|
|
77646
77697
|
body.push(
|
|
77647
|
-
|
|
77648
|
-
|
|
77698
|
+
AST12.exportNamedDeclaration(
|
|
77699
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
77649
77700
|
)
|
|
77650
77701
|
);
|
|
77651
77702
|
}
|
|
77652
77703
|
if (definition.operation === "mutation") {
|
|
77653
77704
|
body.push(
|
|
77654
|
-
|
|
77655
|
-
|
|
77656
|
-
|
|
77705
|
+
AST12.exportNamedDeclaration(
|
|
77706
|
+
AST12.tsTypeAliasDeclaration(
|
|
77707
|
+
AST12.identifier(optimisticTypeName),
|
|
77657
77708
|
inlineType({
|
|
77658
77709
|
config: config2,
|
|
77659
77710
|
filepath,
|
|
@@ -77687,12 +77738,12 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
77687
77738
|
let directive = definition.directives?.find(
|
|
77688
77739
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
77689
77740
|
);
|
|
77690
|
-
let inputValue = !directive ?
|
|
77741
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
77691
77742
|
(fragmentArgumentsDefinitions(config2, filepath, definition) || []).map(
|
|
77692
77743
|
(definition2) => {
|
|
77693
|
-
return
|
|
77694
|
-
|
|
77695
|
-
|
|
77744
|
+
return AST12.tsPropertySignature(
|
|
77745
|
+
AST12.identifier(definition2.variable.name.value),
|
|
77746
|
+
AST12.tsTypeAnnotation(
|
|
77696
77747
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
77697
77748
|
),
|
|
77698
77749
|
definition2.type.kind !== "NonNullType"
|
|
@@ -77701,30 +77752,30 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
77701
77752
|
)
|
|
77702
77753
|
);
|
|
77703
77754
|
body.push(
|
|
77704
|
-
|
|
77705
|
-
|
|
77755
|
+
AST12.exportNamedDeclaration(
|
|
77756
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
77706
77757
|
),
|
|
77707
|
-
|
|
77708
|
-
|
|
77709
|
-
|
|
77710
|
-
|
|
77758
|
+
AST12.exportNamedDeclaration(
|
|
77759
|
+
AST12.tsTypeAliasDeclaration(
|
|
77760
|
+
AST12.identifier(propTypeName),
|
|
77761
|
+
AST12.tsTypeLiteral([
|
|
77711
77762
|
readonlyProperty(
|
|
77712
|
-
|
|
77713
|
-
|
|
77714
|
-
|
|
77715
|
-
|
|
77763
|
+
AST12.tsPropertySignature(
|
|
77764
|
+
AST12.stringLiteral("shape"),
|
|
77765
|
+
AST12.tsTypeAnnotation(
|
|
77766
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
77716
77767
|
),
|
|
77717
77768
|
true
|
|
77718
77769
|
)
|
|
77719
77770
|
),
|
|
77720
77771
|
readonlyProperty(
|
|
77721
|
-
|
|
77722
|
-
|
|
77723
|
-
|
|
77724
|
-
|
|
77725
|
-
|
|
77726
|
-
|
|
77727
|
-
|
|
77772
|
+
AST12.tsPropertySignature(
|
|
77773
|
+
AST12.stringLiteral(fragmentKey2),
|
|
77774
|
+
AST12.tsTypeAnnotation(
|
|
77775
|
+
AST12.tsTypeLiteral([
|
|
77776
|
+
AST12.tsPropertySignature(
|
|
77777
|
+
AST12.stringLiteral(propTypeName),
|
|
77778
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
77728
77779
|
)
|
|
77729
77780
|
])
|
|
77730
77781
|
)
|
|
@@ -77733,9 +77784,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
77733
77784
|
])
|
|
77734
77785
|
)
|
|
77735
77786
|
),
|
|
77736
|
-
|
|
77737
|
-
|
|
77738
|
-
|
|
77787
|
+
AST12.exportNamedDeclaration(
|
|
77788
|
+
AST12.tsTypeAliasDeclaration(
|
|
77789
|
+
AST12.identifier(shapeTypeName),
|
|
77739
77790
|
withLoadingState({
|
|
77740
77791
|
config: config2,
|
|
77741
77792
|
document,
|
|
@@ -77761,8 +77812,8 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
77761
77812
|
|
|
77762
77813
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
77763
77814
|
var graphql19 = __toESM(require_graphql2(), 1);
|
|
77764
|
-
var
|
|
77765
|
-
var
|
|
77815
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
77816
|
+
var AST13 = recast13.types.builders;
|
|
77766
77817
|
async function imperativeCacheTypef(config2, docs) {
|
|
77767
77818
|
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
77768
77819
|
config: config2,
|
|
@@ -77778,87 +77829,87 @@ async function imperativeCacheTypef(config2, docs) {
|
|
|
77778
77829
|
}) ?? "any";
|
|
77779
77830
|
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
77780
77831
|
const body = [];
|
|
77781
|
-
const declaration =
|
|
77782
|
-
|
|
77783
|
-
|
|
77784
|
-
|
|
77785
|
-
|
|
77786
|
-
|
|
77832
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
77833
|
+
AST13.identifier(CacheTypeDefName),
|
|
77834
|
+
AST13.tsTypeLiteral([
|
|
77835
|
+
AST13.tsPropertySignature(
|
|
77836
|
+
AST13.identifier("types"),
|
|
77837
|
+
AST13.tsTypeAnnotation(typeDefinitions(config2, body, docs, returnType))
|
|
77787
77838
|
),
|
|
77788
|
-
|
|
77789
|
-
|
|
77790
|
-
|
|
77839
|
+
AST13.tsPropertySignature(
|
|
77840
|
+
AST13.identifier("lists"),
|
|
77841
|
+
AST13.tsTypeAnnotation(listDefinitions(config2, body, docs))
|
|
77791
77842
|
),
|
|
77792
|
-
|
|
77793
|
-
|
|
77794
|
-
|
|
77843
|
+
AST13.tsPropertySignature(
|
|
77844
|
+
AST13.identifier("queries"),
|
|
77845
|
+
AST13.tsTypeAnnotation(queryDefinitions(config2, body, docs, returnType))
|
|
77795
77846
|
)
|
|
77796
77847
|
])
|
|
77797
77848
|
);
|
|
77798
77849
|
declaration.declare = true;
|
|
77799
|
-
const importRecord =
|
|
77800
|
-
[
|
|
77801
|
-
|
|
77850
|
+
const importRecord = AST13.importDeclaration(
|
|
77851
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
77852
|
+
AST13.stringLiteral("./public/record")
|
|
77802
77853
|
);
|
|
77803
77854
|
importRecord.importKind = "type";
|
|
77804
77855
|
await fs_exports.writeFile(
|
|
77805
77856
|
target,
|
|
77806
|
-
|
|
77807
|
-
|
|
77857
|
+
recast13.prettyPrint(
|
|
77858
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
77808
77859
|
).code
|
|
77809
77860
|
);
|
|
77810
77861
|
}
|
|
77811
77862
|
function typeDefinitions(config2, body, docs, returnType) {
|
|
77812
77863
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
77813
77864
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
77814
|
-
const
|
|
77865
|
+
const types17 = Object.values(config2.schema.getTypeMap()).filter(
|
|
77815
77866
|
(type) => !graphql19.isAbstractType(type) && !graphql19.isScalarType(type) && !graphql19.isEnumType(type) && !graphql19.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
77816
77867
|
);
|
|
77817
77868
|
const fragmentMap = fragmentListMap(
|
|
77818
77869
|
config2,
|
|
77819
|
-
|
|
77870
|
+
types17.map((type) => type.name),
|
|
77820
77871
|
body,
|
|
77821
77872
|
docs,
|
|
77822
77873
|
returnType
|
|
77823
77874
|
);
|
|
77824
|
-
return
|
|
77825
|
-
|
|
77875
|
+
return AST13.tsTypeLiteral(
|
|
77876
|
+
types17.map((type) => {
|
|
77826
77877
|
let typeName = type.name;
|
|
77827
77878
|
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
77828
77879
|
typeName = "__ROOT__";
|
|
77829
77880
|
}
|
|
77830
|
-
let idFields =
|
|
77881
|
+
let idFields = AST13.tsNeverKeyword();
|
|
77831
77882
|
const keys2 = keyFieldsForType(config2.configFile, type.name);
|
|
77832
77883
|
if (graphql19.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
77833
|
-
idFields =
|
|
77884
|
+
idFields = AST13.tsTypeLiteral(
|
|
77834
77885
|
keys2.map((key) => {
|
|
77835
77886
|
const fieldType = type.getFields()[key];
|
|
77836
77887
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
77837
|
-
return
|
|
77838
|
-
|
|
77839
|
-
|
|
77888
|
+
return AST13.tsPropertySignature(
|
|
77889
|
+
AST13.identifier(key),
|
|
77890
|
+
AST13.tsTypeAnnotation(
|
|
77840
77891
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
77841
77892
|
)
|
|
77842
77893
|
);
|
|
77843
77894
|
})
|
|
77844
77895
|
);
|
|
77845
77896
|
} else if (typeName === "__ROOT__") {
|
|
77846
|
-
idFields =
|
|
77897
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
77847
77898
|
}
|
|
77848
|
-
let fields =
|
|
77899
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
77849
77900
|
if (graphql19.isObjectType(type)) {
|
|
77850
|
-
fields =
|
|
77901
|
+
fields = AST13.tsTypeLiteral(
|
|
77851
77902
|
Object.entries(type.getFields()).map(
|
|
77852
77903
|
([key, fieldType]) => {
|
|
77853
77904
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
77854
|
-
let typeOptions =
|
|
77905
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
77855
77906
|
if (graphql19.isScalarType(unwrapped.type)) {
|
|
77856
77907
|
typeOptions.types.push(
|
|
77857
77908
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
77858
77909
|
);
|
|
77859
77910
|
} else if (graphql19.isEnumType(unwrapped.type)) {
|
|
77860
77911
|
typeOptions.types.push(
|
|
77861
|
-
|
|
77912
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
77862
77913
|
);
|
|
77863
77914
|
} else if (!graphql19.isAbstractType(unwrapped.type)) {
|
|
77864
77915
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -77869,21 +77920,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
77869
77920
|
}
|
|
77870
77921
|
for (const wrapper of unwrapped.wrappers) {
|
|
77871
77922
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
77872
|
-
typeOptions =
|
|
77873
|
-
|
|
77923
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
77924
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
77874
77925
|
);
|
|
77875
77926
|
} else if (wrapper === "List" /* List */) {
|
|
77876
|
-
typeOptions =
|
|
77877
|
-
|
|
77927
|
+
typeOptions = AST13.tsArrayType(
|
|
77928
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
77878
77929
|
);
|
|
77879
77930
|
}
|
|
77880
77931
|
}
|
|
77881
77932
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
77882
77933
|
typeOptions = typeOptions.typeAnnotation;
|
|
77883
77934
|
}
|
|
77884
|
-
let args =
|
|
77935
|
+
let args = AST13.tsNeverKeyword();
|
|
77885
77936
|
if (fieldType.args?.length > 0) {
|
|
77886
|
-
args =
|
|
77937
|
+
args = AST13.tsTypeLiteral(
|
|
77887
77938
|
fieldType.args.map((arg) => {
|
|
77888
77939
|
addReferencedInputTypes(
|
|
77889
77940
|
config2,
|
|
@@ -77893,9 +77944,9 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
77893
77944
|
/* @__PURE__ */ new Set(),
|
|
77894
77945
|
arg.type
|
|
77895
77946
|
);
|
|
77896
|
-
const prop =
|
|
77897
|
-
|
|
77898
|
-
|
|
77947
|
+
const prop = AST13.tsPropertySignature(
|
|
77948
|
+
AST13.identifier(arg.name),
|
|
77949
|
+
AST13.tsTypeAnnotation(
|
|
77899
77950
|
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg, body)
|
|
77900
77951
|
)
|
|
77901
77952
|
);
|
|
@@ -77905,17 +77956,17 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
77905
77956
|
})
|
|
77906
77957
|
);
|
|
77907
77958
|
}
|
|
77908
|
-
return
|
|
77909
|
-
|
|
77910
|
-
|
|
77911
|
-
|
|
77912
|
-
|
|
77913
|
-
|
|
77914
|
-
|
|
77959
|
+
return AST13.tsPropertySignature(
|
|
77960
|
+
AST13.identifier(key),
|
|
77961
|
+
AST13.tsTypeAnnotation(
|
|
77962
|
+
AST13.tsTypeLiteral([
|
|
77963
|
+
AST13.tsPropertySignature(
|
|
77964
|
+
AST13.identifier("type"),
|
|
77965
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
77915
77966
|
),
|
|
77916
|
-
|
|
77917
|
-
|
|
77918
|
-
|
|
77967
|
+
AST13.tsPropertySignature(
|
|
77968
|
+
AST13.identifier("args"),
|
|
77969
|
+
AST13.tsTypeAnnotation(args)
|
|
77919
77970
|
)
|
|
77920
77971
|
])
|
|
77921
77972
|
)
|
|
@@ -77924,21 +77975,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
77924
77975
|
)
|
|
77925
77976
|
);
|
|
77926
77977
|
}
|
|
77927
|
-
return
|
|
77928
|
-
|
|
77929
|
-
|
|
77930
|
-
|
|
77931
|
-
|
|
77932
|
-
|
|
77933
|
-
|
|
77978
|
+
return AST13.tsPropertySignature(
|
|
77979
|
+
AST13.identifier(typeName),
|
|
77980
|
+
AST13.tsTypeAnnotation(
|
|
77981
|
+
AST13.tsTypeLiteral([
|
|
77982
|
+
AST13.tsPropertySignature(
|
|
77983
|
+
AST13.identifier("idFields"),
|
|
77984
|
+
AST13.tsTypeAnnotation(idFields)
|
|
77934
77985
|
),
|
|
77935
|
-
|
|
77936
|
-
|
|
77937
|
-
|
|
77986
|
+
AST13.tsPropertySignature(
|
|
77987
|
+
AST13.identifier("fields"),
|
|
77988
|
+
AST13.tsTypeAnnotation(fields)
|
|
77938
77989
|
),
|
|
77939
|
-
|
|
77940
|
-
|
|
77941
|
-
|
|
77990
|
+
AST13.tsPropertySignature(
|
|
77991
|
+
AST13.identifier("fragments"),
|
|
77992
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
77942
77993
|
)
|
|
77943
77994
|
])
|
|
77944
77995
|
)
|
|
@@ -77980,28 +78031,28 @@ function listDefinitions(config2, body, docs) {
|
|
|
77980
78031
|
possibleTypes.push(listType.name);
|
|
77981
78032
|
}
|
|
77982
78033
|
lists.push(
|
|
77983
|
-
|
|
77984
|
-
|
|
77985
|
-
|
|
77986
|
-
|
|
77987
|
-
|
|
77988
|
-
|
|
77989
|
-
|
|
77990
|
-
|
|
78034
|
+
AST13.tsPropertySignature(
|
|
78035
|
+
AST13.identifier(nameValue),
|
|
78036
|
+
AST13.tsTypeAnnotation(
|
|
78037
|
+
AST13.tsTypeLiteral([
|
|
78038
|
+
AST13.tsPropertySignature(
|
|
78039
|
+
AST13.identifier("types"),
|
|
78040
|
+
AST13.tsTypeAnnotation(
|
|
78041
|
+
AST13.tsUnionType(
|
|
77991
78042
|
possibleTypes.map(
|
|
77992
|
-
(possible) =>
|
|
78043
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
77993
78044
|
)
|
|
77994
78045
|
)
|
|
77995
78046
|
)
|
|
77996
78047
|
),
|
|
77997
|
-
|
|
77998
|
-
|
|
77999
|
-
|
|
78000
|
-
targetFieldDefinition.args.length === 0 ?
|
|
78048
|
+
AST13.tsPropertySignature(
|
|
78049
|
+
AST13.identifier("filters"),
|
|
78050
|
+
AST13.tsTypeAnnotation(
|
|
78051
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
78001
78052
|
targetFieldDefinition.args.map((arg) => {
|
|
78002
|
-
const argDef =
|
|
78003
|
-
|
|
78004
|
-
|
|
78053
|
+
const argDef = AST13.tsPropertySignature(
|
|
78054
|
+
AST13.identifier(arg.name),
|
|
78055
|
+
AST13.tsTypeAnnotation(
|
|
78005
78056
|
tsTypeReference(
|
|
78006
78057
|
config2,
|
|
78007
78058
|
/* @__PURE__ */ new Set(),
|
|
@@ -78023,10 +78074,10 @@ function listDefinitions(config2, body, docs) {
|
|
|
78023
78074
|
}
|
|
78024
78075
|
});
|
|
78025
78076
|
}
|
|
78026
|
-
return
|
|
78077
|
+
return AST13.tsTypeLiteral(lists);
|
|
78027
78078
|
}
|
|
78028
78079
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
78029
|
-
return
|
|
78080
|
+
return AST13.tsTupleType(
|
|
78030
78081
|
docs.reduce((prev, doc) => {
|
|
78031
78082
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
78032
78083
|
return prev;
|
|
@@ -78048,10 +78099,10 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
78048
78099
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
78049
78100
|
});
|
|
78050
78101
|
return prev.concat(
|
|
78051
|
-
|
|
78052
|
-
|
|
78053
|
-
|
|
78054
|
-
|
|
78102
|
+
AST13.tsTupleType([
|
|
78103
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
78104
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
78105
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
78055
78106
|
])
|
|
78056
78107
|
);
|
|
78057
78108
|
}, [])
|
|
@@ -78080,13 +78131,13 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
78080
78131
|
),
|
|
78081
78132
|
import: [`${definition.name.value}$data`]
|
|
78082
78133
|
});
|
|
78083
|
-
let inputType =
|
|
78134
|
+
let inputType = AST13.tsNeverKeyword();
|
|
78084
78135
|
let directive = definition.directives?.find(
|
|
78085
78136
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
78086
78137
|
);
|
|
78087
78138
|
if (directive) {
|
|
78088
|
-
inputType =
|
|
78089
|
-
|
|
78139
|
+
inputType = AST13.tsTypeReference(
|
|
78140
|
+
AST13.identifier(
|
|
78090
78141
|
ensureImports({
|
|
78091
78142
|
config: config2,
|
|
78092
78143
|
body,
|
|
@@ -78101,11 +78152,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
78101
78152
|
}
|
|
78102
78153
|
return {
|
|
78103
78154
|
...prev,
|
|
78104
|
-
[typeName]:
|
|
78155
|
+
[typeName]: AST13.tsTupleType(
|
|
78105
78156
|
previousValue.concat(
|
|
78106
|
-
|
|
78107
|
-
|
|
78108
|
-
|
|
78157
|
+
AST13.tsTupleType([
|
|
78158
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
78159
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
78109
78160
|
inputType
|
|
78110
78161
|
])
|
|
78111
78162
|
)
|
|
@@ -78115,11 +78166,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
78115
78166
|
}
|
|
78116
78167
|
var CacheTypeDefName = "CacheTypeDef";
|
|
78117
78168
|
function record(name) {
|
|
78118
|
-
return
|
|
78119
|
-
|
|
78120
|
-
|
|
78121
|
-
|
|
78122
|
-
|
|
78169
|
+
return AST13.tsTypeReference(
|
|
78170
|
+
AST13.identifier("Record"),
|
|
78171
|
+
AST13.tsTypeParameterInstantiation([
|
|
78172
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
78173
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
78123
78174
|
])
|
|
78124
78175
|
);
|
|
78125
78176
|
}
|
|
@@ -78172,25 +78223,25 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
78172
78223
|
|
|
78173
78224
|
// src/codegen/generators/definitions/enums.ts
|
|
78174
78225
|
var graphql21 = __toESM(require_graphql2(), 1);
|
|
78175
|
-
var
|
|
78176
|
-
var
|
|
78226
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
78227
|
+
var AST14 = recast14.types.builders;
|
|
78177
78228
|
async function definitionsGenerator(config2) {
|
|
78178
78229
|
const enums = graphql21.parse(graphql21.printSchema(config2.schema)).definitions.filter(
|
|
78179
78230
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
78180
78231
|
).filter((def) => !config2.isInternalEnum(def));
|
|
78181
78232
|
const { code: runtimeDefinitions } = await printJS(
|
|
78182
|
-
|
|
78233
|
+
AST14.program(
|
|
78183
78234
|
enums.map((defn) => {
|
|
78184
78235
|
const name = defn.name.value;
|
|
78185
78236
|
return moduleExport(
|
|
78186
78237
|
config2,
|
|
78187
78238
|
name,
|
|
78188
|
-
|
|
78239
|
+
AST14.objectExpression(
|
|
78189
78240
|
defn.values?.map((value) => {
|
|
78190
78241
|
const str = value.name.value;
|
|
78191
|
-
return
|
|
78192
|
-
|
|
78193
|
-
|
|
78242
|
+
return AST14.objectProperty(
|
|
78243
|
+
AST14.stringLiteral(str),
|
|
78244
|
+
AST14.stringLiteral(str)
|
|
78194
78245
|
);
|
|
78195
78246
|
}) || []
|
|
78196
78247
|
)
|
|
@@ -80176,8 +80227,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
80176
80227
|
}
|
|
80177
80228
|
packageJSON.devDependencies = {
|
|
80178
80229
|
...packageJSON.devDependencies,
|
|
80179
|
-
houdini: "^1.2.
|
|
80180
|
-
"houdini-svelte": "^1.2.
|
|
80230
|
+
houdini: "^1.2.6",
|
|
80231
|
+
"houdini-svelte": "^1.2.6"
|
|
80181
80232
|
};
|
|
80182
80233
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
80183
80234
|
}
|