houdini 1.2.5 → 1.2.6-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +607 -554
- package/build/cmd-esm/index.js +607 -554
- package/build/codegen/generators/artifacts/selection.d.ts +1 -3
- package/build/codegen-cjs/index.js +594 -541
- package/build/codegen-esm/index.js +594 -541
- package/build/lib-cjs/index.js +35 -2
- package/build/lib-esm/index.js +35 -2
- package/build/runtime/cache/cache.d.ts +1 -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 +1 -0
- package/build/runtime-cjs/cache/cache.js +10 -2
- 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 +1 -0
- package/build/runtime-esm/cache/cache.js +10 -2
- 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 +597 -544
- package/build/test-esm/index.js +597 -544
- package/build/vite-cjs/index.js +612 -559
- package/build/vite-esm/index.js +612 -559
- package/package.json +1 -1
package/build/vite-cjs/index.js
CHANGED
|
@@ -6120,12 +6120,12 @@ var require_parser = __commonJS({
|
|
|
6120
6120
|
return [];
|
|
6121
6121
|
}
|
|
6122
6122
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
6123
|
-
var
|
|
6123
|
+
var types18 = [];
|
|
6124
6124
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
6125
6125
|
do {
|
|
6126
|
-
|
|
6126
|
+
types18.push(this.parseNamedType());
|
|
6127
6127
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
6128
|
-
return
|
|
6128
|
+
return types18;
|
|
6129
6129
|
}
|
|
6130
6130
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
6131
6131
|
};
|
|
@@ -6204,13 +6204,13 @@ var require_parser = __commonJS({
|
|
|
6204
6204
|
this.expectKeyword("union");
|
|
6205
6205
|
var name = this.parseName();
|
|
6206
6206
|
var directives = this.parseDirectives(true);
|
|
6207
|
-
var
|
|
6207
|
+
var types18 = this.parseUnionMemberTypes();
|
|
6208
6208
|
return {
|
|
6209
6209
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
6210
6210
|
description,
|
|
6211
6211
|
name,
|
|
6212
6212
|
directives,
|
|
6213
|
-
types:
|
|
6213
|
+
types: types18,
|
|
6214
6214
|
loc: this.loc(start)
|
|
6215
6215
|
};
|
|
6216
6216
|
};
|
|
@@ -6368,15 +6368,15 @@ var require_parser = __commonJS({
|
|
|
6368
6368
|
this.expectKeyword("union");
|
|
6369
6369
|
var name = this.parseName();
|
|
6370
6370
|
var directives = this.parseDirectives(true);
|
|
6371
|
-
var
|
|
6372
|
-
if (directives.length === 0 &&
|
|
6371
|
+
var types18 = this.parseUnionMemberTypes();
|
|
6372
|
+
if (directives.length === 0 && types18.length === 0) {
|
|
6373
6373
|
throw this.unexpected();
|
|
6374
6374
|
}
|
|
6375
6375
|
return {
|
|
6376
6376
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
6377
6377
|
name,
|
|
6378
6378
|
directives,
|
|
6379
|
-
types:
|
|
6379
|
+
types: types18,
|
|
6380
6380
|
loc: this.loc(start)
|
|
6381
6381
|
};
|
|
6382
6382
|
};
|
|
@@ -7354,8 +7354,8 @@ var require_printer = __commonJS({
|
|
|
7354
7354
|
return join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7355
7355
|
}),
|
|
7356
7356
|
UnionTypeDefinition: addDescription2(function(_ref27) {
|
|
7357
|
-
var name = _ref27.name, directives = _ref27.directives,
|
|
7358
|
-
return join3(["union", name, join3(directives, " "),
|
|
7357
|
+
var name = _ref27.name, directives = _ref27.directives, types18 = _ref27.types;
|
|
7358
|
+
return join3(["union", name, join3(directives, " "), types18 && types18.length !== 0 ? "= " + join3(types18, " | ") : ""], " ");
|
|
7359
7359
|
}),
|
|
7360
7360
|
EnumTypeDefinition: addDescription2(function(_ref28) {
|
|
7361
7361
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -7390,8 +7390,8 @@ var require_printer = __commonJS({
|
|
|
7390
7390
|
return join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7391
7391
|
},
|
|
7392
7392
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
7393
|
-
var name = _ref36.name, directives = _ref36.directives,
|
|
7394
|
-
return join3(["extend union", name, join3(directives, " "),
|
|
7393
|
+
var name = _ref36.name, directives = _ref36.directives, types18 = _ref36.types;
|
|
7394
|
+
return join3(["extend union", name, join3(directives, " "), types18 && types18.length !== 0 ? "= " + join3(types18, " | ") : ""], " ");
|
|
7395
7395
|
},
|
|
7396
7396
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
7397
7397
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -8062,9 +8062,9 @@ var require_definition = __commonJS({
|
|
|
8062
8062
|
exports.GraphQLUnionType = GraphQLUnionType3;
|
|
8063
8063
|
(0, _defineInspect.default)(GraphQLUnionType3);
|
|
8064
8064
|
function defineTypes(config4) {
|
|
8065
|
-
var
|
|
8066
|
-
Array.isArray(
|
|
8067
|
-
return
|
|
8065
|
+
var types18 = resolveThunk(config4.types);
|
|
8066
|
+
Array.isArray(types18) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config4.name, "."));
|
|
8067
|
+
return types18;
|
|
8068
8068
|
}
|
|
8069
8069
|
var GraphQLEnumType4 = /* @__PURE__ */ function() {
|
|
8070
8070
|
function GraphQLEnumType5(config4) {
|
|
@@ -15701,7 +15701,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
15701
15701
|
return new _definition.GraphQLUnionType({
|
|
15702
15702
|
name: unionIntrospection.name,
|
|
15703
15703
|
description: unionIntrospection.description,
|
|
15704
|
-
types: function
|
|
15704
|
+
types: function types18() {
|
|
15705
15705
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
15706
15706
|
}
|
|
15707
15707
|
});
|
|
@@ -16046,7 +16046,7 @@ var require_extendSchema = __commonJS({
|
|
|
16046
16046
|
var config4 = type.toConfig();
|
|
16047
16047
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config4.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
16048
16048
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config4), {}, {
|
|
16049
|
-
types: function
|
|
16049
|
+
types: function types18() {
|
|
16050
16050
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
16051
16051
|
},
|
|
16052
16052
|
extensionASTNodes: config4.extensionASTNodes.concat(extensions)
|
|
@@ -16194,17 +16194,17 @@ var require_extendSchema = __commonJS({
|
|
|
16194
16194
|
return interfaces;
|
|
16195
16195
|
}
|
|
16196
16196
|
function buildUnionTypes(nodes) {
|
|
16197
|
-
var
|
|
16197
|
+
var types18 = [];
|
|
16198
16198
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
16199
16199
|
var _node$types;
|
|
16200
16200
|
var node = nodes[_i32];
|
|
16201
16201
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
16202
16202
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
16203
16203
|
var type = typeNodes[_i34];
|
|
16204
|
-
|
|
16204
|
+
types18.push(getNamedType5(type));
|
|
16205
16205
|
}
|
|
16206
16206
|
}
|
|
16207
|
-
return
|
|
16207
|
+
return types18;
|
|
16208
16208
|
}
|
|
16209
16209
|
function buildType(astNode) {
|
|
16210
16210
|
var _typeExtensionsMap$na;
|
|
@@ -16261,7 +16261,7 @@ var require_extendSchema = __commonJS({
|
|
|
16261
16261
|
return new _definition.GraphQLUnionType({
|
|
16262
16262
|
name: name2,
|
|
16263
16263
|
description,
|
|
16264
|
-
types: function
|
|
16264
|
+
types: function types18() {
|
|
16265
16265
|
return buildUnionTypes(_allNodes3);
|
|
16266
16266
|
},
|
|
16267
16267
|
astNode,
|
|
@@ -16559,7 +16559,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
16559
16559
|
if ((0, _definition.isUnionType)(type)) {
|
|
16560
16560
|
var _config22 = type.toConfig();
|
|
16561
16561
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
|
|
16562
|
-
types: function
|
|
16562
|
+
types: function types18() {
|
|
16563
16563
|
return sortTypes(_config22.types);
|
|
16564
16564
|
}
|
|
16565
16565
|
}));
|
|
@@ -16644,10 +16644,10 @@ var require_printSchema = __commonJS({
|
|
|
16644
16644
|
}
|
|
16645
16645
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
16646
16646
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
16647
|
-
var
|
|
16647
|
+
var types18 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
16648
16648
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
16649
16649
|
return printDirective(directive, options);
|
|
16650
|
-
}),
|
|
16650
|
+
}), types18.map(function(type) {
|
|
16651
16651
|
return printType(type, options);
|
|
16652
16652
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
16653
16653
|
}
|
|
@@ -16722,8 +16722,8 @@ var require_printSchema = __commonJS({
|
|
|
16722
16722
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
16723
16723
|
}
|
|
16724
16724
|
function printUnion(type, options) {
|
|
16725
|
-
var
|
|
16726
|
-
var possibleTypes =
|
|
16725
|
+
var types18 = type.getTypes();
|
|
16726
|
+
var possibleTypes = types18.length ? " = " + types18.join(" | ") : "";
|
|
16727
16727
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
16728
16728
|
}
|
|
16729
16729
|
function printEnum(type, options) {
|
|
@@ -31639,14 +31639,14 @@ var require_lib3 = __commonJS({
|
|
|
31639
31639
|
this.preserveSpace = !!preserveSpace;
|
|
31640
31640
|
}
|
|
31641
31641
|
};
|
|
31642
|
-
var
|
|
31642
|
+
var types18 = {
|
|
31643
31643
|
brace: new TokContext("{"),
|
|
31644
31644
|
j_oTag: new TokContext("<tag"),
|
|
31645
31645
|
j_cTag: new TokContext("</tag"),
|
|
31646
31646
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
31647
31647
|
};
|
|
31648
31648
|
{
|
|
31649
|
-
|
|
31649
|
+
types18.template = new TokContext("`", true);
|
|
31650
31650
|
}
|
|
31651
31651
|
var beforeExpr = true;
|
|
31652
31652
|
var startsExpr = true;
|
|
@@ -32178,17 +32178,17 @@ var require_lib3 = __commonJS({
|
|
|
32178
32178
|
context.pop();
|
|
32179
32179
|
};
|
|
32180
32180
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
32181
|
-
context.push(
|
|
32181
|
+
context.push(types18.brace);
|
|
32182
32182
|
};
|
|
32183
32183
|
tokenTypes[22].updateContext = (context) => {
|
|
32184
|
-
if (context[context.length - 1] ===
|
|
32184
|
+
if (context[context.length - 1] === types18.template) {
|
|
32185
32185
|
context.pop();
|
|
32186
32186
|
} else {
|
|
32187
|
-
context.push(
|
|
32187
|
+
context.push(types18.template);
|
|
32188
32188
|
}
|
|
32189
32189
|
};
|
|
32190
32190
|
tokenTypes[140].updateContext = (context) => {
|
|
32191
|
-
context.push(
|
|
32191
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
32192
32192
|
};
|
|
32193
32193
|
}
|
|
32194
32194
|
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";
|
|
@@ -32829,7 +32829,7 @@ var require_lib3 = __commonJS({
|
|
|
32829
32829
|
this.lastTokEndLoc = null;
|
|
32830
32830
|
this.lastTokStartLoc = null;
|
|
32831
32831
|
this.lastTokStart = 0;
|
|
32832
|
-
this.context = [
|
|
32832
|
+
this.context = [types18.brace];
|
|
32833
32833
|
this.canStartJSXElement = true;
|
|
32834
32834
|
this.containsEsc = false;
|
|
32835
32835
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -36753,7 +36753,7 @@ var require_lib3 = __commonJS({
|
|
|
36753
36753
|
context
|
|
36754
36754
|
} = this.state;
|
|
36755
36755
|
const currentContext = context[context.length - 1];
|
|
36756
|
-
if (currentContext ===
|
|
36756
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
36757
36757
|
context.pop();
|
|
36758
36758
|
}
|
|
36759
36759
|
}
|
|
@@ -37813,9 +37813,9 @@ var require_lib3 = __commonJS({
|
|
|
37813
37813
|
switch (this.state.type) {
|
|
37814
37814
|
case 5:
|
|
37815
37815
|
node = this.startNode();
|
|
37816
|
-
this.setContext(
|
|
37816
|
+
this.setContext(types18.brace);
|
|
37817
37817
|
this.next();
|
|
37818
|
-
node = this.jsxParseExpressionContainer(node,
|
|
37818
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
37819
37819
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
37820
37820
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
37821
37821
|
at: node
|
|
@@ -37838,7 +37838,7 @@ var require_lib3 = __commonJS({
|
|
|
37838
37838
|
jsxParseSpreadChild(node) {
|
|
37839
37839
|
this.next();
|
|
37840
37840
|
node.expression = this.parseExpression();
|
|
37841
|
-
this.setContext(
|
|
37841
|
+
this.setContext(types18.j_expr);
|
|
37842
37842
|
this.state.canStartJSXElement = true;
|
|
37843
37843
|
this.expect(8);
|
|
37844
37844
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -37858,11 +37858,11 @@ var require_lib3 = __commonJS({
|
|
|
37858
37858
|
jsxParseAttribute() {
|
|
37859
37859
|
const node = this.startNode();
|
|
37860
37860
|
if (this.match(5)) {
|
|
37861
|
-
this.setContext(
|
|
37861
|
+
this.setContext(types18.brace);
|
|
37862
37862
|
this.next();
|
|
37863
37863
|
this.expect(21);
|
|
37864
37864
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
37865
|
-
this.setContext(
|
|
37865
|
+
this.setContext(types18.j_oTag);
|
|
37866
37866
|
this.state.canStartJSXElement = true;
|
|
37867
37867
|
this.expect(8);
|
|
37868
37868
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -37921,12 +37921,12 @@ var require_lib3 = __commonJS({
|
|
|
37921
37921
|
break;
|
|
37922
37922
|
case 5: {
|
|
37923
37923
|
const node2 = this.startNode();
|
|
37924
|
-
this.setContext(
|
|
37924
|
+
this.setContext(types18.brace);
|
|
37925
37925
|
this.next();
|
|
37926
37926
|
if (this.match(21)) {
|
|
37927
37927
|
children.push(this.jsxParseSpreadChild(node2));
|
|
37928
37928
|
} else {
|
|
37929
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
37929
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
37930
37930
|
}
|
|
37931
37931
|
break;
|
|
37932
37932
|
}
|
|
@@ -37997,10 +37997,10 @@ var require_lib3 = __commonJS({
|
|
|
37997
37997
|
}
|
|
37998
37998
|
getTokenFromCode(code) {
|
|
37999
37999
|
const context = this.curContext();
|
|
38000
|
-
if (context ===
|
|
38000
|
+
if (context === types18.j_expr) {
|
|
38001
38001
|
return this.jsxReadToken();
|
|
38002
38002
|
}
|
|
38003
|
-
if (context ===
|
|
38003
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
38004
38004
|
if (isIdentifierStart(code)) {
|
|
38005
38005
|
return this.jsxReadWord();
|
|
38006
38006
|
}
|
|
@@ -38008,7 +38008,7 @@ var require_lib3 = __commonJS({
|
|
|
38008
38008
|
++this.state.pos;
|
|
38009
38009
|
return this.finishToken(141);
|
|
38010
38010
|
}
|
|
38011
|
-
if ((code === 34 || code === 39) && context ===
|
|
38011
|
+
if ((code === 34 || code === 39) && context === types18.j_oTag) {
|
|
38012
38012
|
return this.jsxReadString(code);
|
|
38013
38013
|
}
|
|
38014
38014
|
}
|
|
@@ -38024,17 +38024,17 @@ var require_lib3 = __commonJS({
|
|
|
38024
38024
|
type
|
|
38025
38025
|
} = this.state;
|
|
38026
38026
|
if (type === 56 && prevType === 140) {
|
|
38027
|
-
context.splice(-2, 2,
|
|
38027
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
38028
38028
|
this.state.canStartJSXElement = false;
|
|
38029
38029
|
} else if (type === 140) {
|
|
38030
|
-
context.push(
|
|
38030
|
+
context.push(types18.j_oTag);
|
|
38031
38031
|
} else if (type === 141) {
|
|
38032
38032
|
const out = context[context.length - 1];
|
|
38033
|
-
if (out ===
|
|
38033
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
38034
38034
|
context.pop();
|
|
38035
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
38035
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
38036
38036
|
} else {
|
|
38037
|
-
this.setContext(
|
|
38037
|
+
this.setContext(types18.j_expr);
|
|
38038
38038
|
this.state.canStartJSXElement = true;
|
|
38039
38039
|
}
|
|
38040
38040
|
} else {
|
|
@@ -39042,14 +39042,14 @@ var require_lib3 = __commonJS({
|
|
|
39042
39042
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
39043
39043
|
const node = this.startNode();
|
|
39044
39044
|
const hasLeadingOperator = this.eat(operator);
|
|
39045
|
-
const
|
|
39045
|
+
const types19 = [];
|
|
39046
39046
|
do {
|
|
39047
|
-
|
|
39047
|
+
types19.push(parseConstituentType());
|
|
39048
39048
|
} while (this.eat(operator));
|
|
39049
|
-
if (
|
|
39050
|
-
return
|
|
39049
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
39050
|
+
return types19[0];
|
|
39051
39051
|
}
|
|
39052
|
-
node.types =
|
|
39052
|
+
node.types = types19;
|
|
39053
39053
|
return this.finishNode(node, kind);
|
|
39054
39054
|
}
|
|
39055
39055
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -40278,7 +40278,7 @@ var require_lib3 = __commonJS({
|
|
|
40278
40278
|
context
|
|
40279
40279
|
} = this.state;
|
|
40280
40280
|
const currentContext = context[context.length - 1];
|
|
40281
|
-
if (currentContext ===
|
|
40281
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
40282
40282
|
context.pop();
|
|
40283
40283
|
}
|
|
40284
40284
|
}
|
|
@@ -45917,9 +45917,9 @@ var require_shared = __commonJS({
|
|
|
45917
45917
|
var tslib_1 = require_tslib();
|
|
45918
45918
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45919
45919
|
function default_1(fork) {
|
|
45920
|
-
var
|
|
45921
|
-
var Type =
|
|
45922
|
-
var builtin =
|
|
45920
|
+
var types18 = fork.use(types_1.default);
|
|
45921
|
+
var Type = types18.Type;
|
|
45922
|
+
var builtin = types18.builtInTypes;
|
|
45923
45923
|
var isNumber = builtin.number;
|
|
45924
45924
|
function geq(than) {
|
|
45925
45925
|
return Type.from(function(value) {
|
|
@@ -46069,9 +46069,9 @@ var require_types = __commonJS({
|
|
|
46069
46069
|
}(BaseType);
|
|
46070
46070
|
var OrType = function(_super) {
|
|
46071
46071
|
tslib_1.__extends(OrType2, _super);
|
|
46072
|
-
function OrType2(
|
|
46072
|
+
function OrType2(types18) {
|
|
46073
46073
|
var _this = _super.call(this) || this;
|
|
46074
|
-
_this.types =
|
|
46074
|
+
_this.types = types18;
|
|
46075
46075
|
_this.kind = "OrType";
|
|
46076
46076
|
return _this;
|
|
46077
46077
|
}
|
|
@@ -46212,11 +46212,11 @@ var require_types = __commonJS({
|
|
|
46212
46212
|
function typesPlugin(_fork) {
|
|
46213
46213
|
var Type = {
|
|
46214
46214
|
or: function() {
|
|
46215
|
-
var
|
|
46215
|
+
var types18 = [];
|
|
46216
46216
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
46217
|
-
|
|
46217
|
+
types18[_i] = arguments[_i];
|
|
46218
46218
|
}
|
|
46219
|
-
return new OrType(
|
|
46219
|
+
return new OrType(types18.map(function(type) {
|
|
46220
46220
|
return Type.from(type);
|
|
46221
46221
|
}));
|
|
46222
46222
|
},
|
|
@@ -46661,9 +46661,9 @@ var require_path2 = __commonJS({
|
|
|
46661
46661
|
var Op = Object.prototype;
|
|
46662
46662
|
var hasOwn = Op.hasOwnProperty;
|
|
46663
46663
|
function pathPlugin(fork) {
|
|
46664
|
-
var
|
|
46665
|
-
var isArray =
|
|
46666
|
-
var isNumber =
|
|
46664
|
+
var types18 = fork.use(types_1.default);
|
|
46665
|
+
var isArray = types18.builtInTypes.array;
|
|
46666
|
+
var isNumber = types18.builtInTypes.number;
|
|
46667
46667
|
var Path = function Path2(value, parentPath, name) {
|
|
46668
46668
|
if (!(this instanceof Path2)) {
|
|
46669
46669
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -46965,13 +46965,13 @@ var require_scope = __commonJS({
|
|
|
46965
46965
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46966
46966
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
46967
46967
|
function scopePlugin(fork) {
|
|
46968
|
-
var
|
|
46969
|
-
var Type =
|
|
46970
|
-
var namedTypes =
|
|
46968
|
+
var types18 = fork.use(types_1.default);
|
|
46969
|
+
var Type = types18.Type;
|
|
46970
|
+
var namedTypes = types18.namedTypes;
|
|
46971
46971
|
var Node = namedTypes.Node;
|
|
46972
46972
|
var Expression = namedTypes.Expression;
|
|
46973
|
-
var isArray =
|
|
46974
|
-
var b =
|
|
46973
|
+
var isArray = types18.builtInTypes.array;
|
|
46974
|
+
var b = types18.builders;
|
|
46975
46975
|
var Scope = function Scope2(path2, parentScope) {
|
|
46976
46976
|
if (!(this instanceof Scope2)) {
|
|
46977
46977
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -47034,7 +47034,7 @@ var require_scope = __commonJS({
|
|
|
47034
47034
|
++index;
|
|
47035
47035
|
}
|
|
47036
47036
|
var name = prefix + index;
|
|
47037
|
-
return this.bindings[name] =
|
|
47037
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
47038
47038
|
};
|
|
47039
47039
|
Sp.injectTemporary = function(identifier, init) {
|
|
47040
47040
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -47110,7 +47110,7 @@ var require_scope = __commonJS({
|
|
|
47110
47110
|
bindings
|
|
47111
47111
|
);
|
|
47112
47112
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
47113
|
-
|
|
47113
|
+
types18.eachField(node, function(name, child) {
|
|
47114
47114
|
var childPath = path2.get(name);
|
|
47115
47115
|
if (!pathHasValue(childPath, child)) {
|
|
47116
47116
|
throw new Error("");
|
|
@@ -47188,24 +47188,24 @@ var require_scope = __commonJS({
|
|
|
47188
47188
|
addPattern(patternPath.get("argument"), bindings);
|
|
47189
47189
|
}
|
|
47190
47190
|
}
|
|
47191
|
-
function addTypePattern(patternPath,
|
|
47191
|
+
function addTypePattern(patternPath, types19) {
|
|
47192
47192
|
var pattern = patternPath.value;
|
|
47193
47193
|
namedTypes.Pattern.assert(pattern);
|
|
47194
47194
|
if (namedTypes.Identifier.check(pattern)) {
|
|
47195
|
-
if (hasOwn.call(
|
|
47196
|
-
|
|
47195
|
+
if (hasOwn.call(types19, pattern.name)) {
|
|
47196
|
+
types19[pattern.name].push(patternPath);
|
|
47197
47197
|
} else {
|
|
47198
|
-
|
|
47198
|
+
types19[pattern.name] = [patternPath];
|
|
47199
47199
|
}
|
|
47200
47200
|
}
|
|
47201
47201
|
}
|
|
47202
|
-
function addTypeParameter(parameterPath,
|
|
47202
|
+
function addTypeParameter(parameterPath, types19) {
|
|
47203
47203
|
var parameter = parameterPath.value;
|
|
47204
47204
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
47205
|
-
if (hasOwn.call(
|
|
47206
|
-
|
|
47205
|
+
if (hasOwn.call(types19, parameter.name)) {
|
|
47206
|
+
types19[parameter.name].push(parameterPath);
|
|
47207
47207
|
} else {
|
|
47208
|
-
|
|
47208
|
+
types19[parameter.name] = [parameterPath];
|
|
47209
47209
|
}
|
|
47210
47210
|
}
|
|
47211
47211
|
Sp.lookup = function(name) {
|
|
@@ -47246,11 +47246,11 @@ var require_node_path = __commonJS({
|
|
|
47246
47246
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
47247
47247
|
var shared_1 = require_shared();
|
|
47248
47248
|
function nodePathPlugin(fork) {
|
|
47249
|
-
var
|
|
47250
|
-
var n =
|
|
47251
|
-
var b =
|
|
47252
|
-
var isNumber =
|
|
47253
|
-
var isArray =
|
|
47249
|
+
var types18 = fork.use(types_1.default);
|
|
47250
|
+
var n = types18.namedTypes;
|
|
47251
|
+
var b = types18.builders;
|
|
47252
|
+
var isNumber = types18.builtInTypes.number;
|
|
47253
|
+
var isArray = types18.builtInTypes.array;
|
|
47254
47254
|
var Path = fork.use(path_1.default);
|
|
47255
47255
|
var Scope = fork.use(scope_1.default);
|
|
47256
47256
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -47341,7 +47341,7 @@ var require_node_path = __commonJS({
|
|
|
47341
47341
|
return scope || null;
|
|
47342
47342
|
};
|
|
47343
47343
|
NPp.getValueProperty = function(name) {
|
|
47344
|
-
return
|
|
47344
|
+
return types18.getFieldValue(this.value, name);
|
|
47345
47345
|
};
|
|
47346
47346
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
47347
47347
|
var pp = this.parentPath;
|
|
@@ -47483,7 +47483,7 @@ var require_node_path = __commonJS({
|
|
|
47483
47483
|
return node.some(containsCallExpression);
|
|
47484
47484
|
}
|
|
47485
47485
|
if (n.Node.check(node)) {
|
|
47486
|
-
return
|
|
47486
|
+
return types18.someField(node, function(_name, child) {
|
|
47487
47487
|
return containsCallExpression(child);
|
|
47488
47488
|
});
|
|
47489
47489
|
}
|
|
@@ -47604,11 +47604,11 @@ var require_path_visitor = __commonJS({
|
|
|
47604
47604
|
var shared_1 = require_shared();
|
|
47605
47605
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
47606
47606
|
function pathVisitorPlugin(fork) {
|
|
47607
|
-
var
|
|
47607
|
+
var types18 = fork.use(types_1.default);
|
|
47608
47608
|
var NodePath = fork.use(node_path_1.default);
|
|
47609
|
-
var isArray =
|
|
47610
|
-
var isObject2 =
|
|
47611
|
-
var isFunction =
|
|
47609
|
+
var isArray = types18.builtInTypes.array;
|
|
47610
|
+
var isObject2 = types18.builtInTypes.object;
|
|
47611
|
+
var isFunction = types18.builtInTypes.function;
|
|
47612
47612
|
var undefined2;
|
|
47613
47613
|
var PathVisitor = function PathVisitor2() {
|
|
47614
47614
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -47628,7 +47628,7 @@ var require_path_visitor = __commonJS({
|
|
|
47628
47628
|
typeNames[methodName.slice("visit".length)] = true;
|
|
47629
47629
|
}
|
|
47630
47630
|
}
|
|
47631
|
-
var supertypeTable =
|
|
47631
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
47632
47632
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
47633
47633
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
47634
47634
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -47747,7 +47747,7 @@ var require_path_visitor = __commonJS({
|
|
|
47747
47747
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
47748
47748
|
} else if (!isObject2.check(value)) {
|
|
47749
47749
|
} else {
|
|
47750
|
-
var childNames =
|
|
47750
|
+
var childNames = types18.getFieldNames(value);
|
|
47751
47751
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
47752
47752
|
childNames.push("comments");
|
|
47753
47753
|
}
|
|
@@ -47756,7 +47756,7 @@ var require_path_visitor = __commonJS({
|
|
|
47756
47756
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
47757
47757
|
var childName = childNames[i2];
|
|
47758
47758
|
if (!hasOwn.call(value, childName)) {
|
|
47759
|
-
value[childName] =
|
|
47759
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
47760
47760
|
}
|
|
47761
47761
|
childPaths.push(path2.get(childName));
|
|
47762
47762
|
}
|
|
@@ -47899,13 +47899,13 @@ var require_equiv = __commonJS({
|
|
|
47899
47899
|
var shared_1 = require_shared();
|
|
47900
47900
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
47901
47901
|
function default_1(fork) {
|
|
47902
|
-
var
|
|
47903
|
-
var getFieldNames =
|
|
47904
|
-
var getFieldValue =
|
|
47905
|
-
var isArray =
|
|
47906
|
-
var isObject2 =
|
|
47907
|
-
var isDate =
|
|
47908
|
-
var isRegExp =
|
|
47902
|
+
var types18 = fork.use(types_1.default);
|
|
47903
|
+
var getFieldNames = types18.getFieldNames;
|
|
47904
|
+
var getFieldValue = types18.getFieldValue;
|
|
47905
|
+
var isArray = types18.builtInTypes.array;
|
|
47906
|
+
var isObject2 = types18.builtInTypes.object;
|
|
47907
|
+
var isDate = types18.builtInTypes.Date;
|
|
47908
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
47909
47909
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
47910
47910
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
47911
47911
|
if (isArray.check(problemPath)) {
|
|
@@ -48058,24 +48058,24 @@ var require_fork = __commonJS({
|
|
|
48058
48058
|
var shared_1 = require_shared();
|
|
48059
48059
|
function default_1(plugins) {
|
|
48060
48060
|
var fork = createFork();
|
|
48061
|
-
var
|
|
48061
|
+
var types18 = fork.use(types_1.default);
|
|
48062
48062
|
plugins.forEach(fork.use);
|
|
48063
|
-
|
|
48063
|
+
types18.finalize();
|
|
48064
48064
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
48065
48065
|
return {
|
|
48066
|
-
Type:
|
|
48067
|
-
builtInTypes:
|
|
48068
|
-
namedTypes:
|
|
48069
|
-
builders:
|
|
48070
|
-
defineMethod:
|
|
48071
|
-
getFieldNames:
|
|
48072
|
-
getFieldValue:
|
|
48073
|
-
eachField:
|
|
48074
|
-
someField:
|
|
48075
|
-
getSupertypeNames:
|
|
48076
|
-
getBuilderName:
|
|
48066
|
+
Type: types18.Type,
|
|
48067
|
+
builtInTypes: types18.builtInTypes,
|
|
48068
|
+
namedTypes: types18.namedTypes,
|
|
48069
|
+
builders: types18.builders,
|
|
48070
|
+
defineMethod: types18.defineMethod,
|
|
48071
|
+
getFieldNames: types18.getFieldNames,
|
|
48072
|
+
getFieldValue: types18.getFieldValue,
|
|
48073
|
+
eachField: types18.eachField,
|
|
48074
|
+
someField: types18.someField,
|
|
48075
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
48076
|
+
getBuilderName: types18.getBuilderName,
|
|
48077
48077
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
48078
|
-
finalize:
|
|
48078
|
+
finalize: types18.finalize,
|
|
48079
48079
|
Path: fork.use(path_1.default),
|
|
48080
48080
|
NodePath: fork.use(node_path_1.default),
|
|
48081
48081
|
PathVisitor,
|
|
@@ -48245,8 +48245,8 @@ var require_core2 = __commonJS({
|
|
|
48245
48245
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
48246
48246
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48247
48247
|
function default_1(fork) {
|
|
48248
|
-
var
|
|
48249
|
-
var Type =
|
|
48248
|
+
var types18 = fork.use(types_1.default);
|
|
48249
|
+
var Type = types18.Type;
|
|
48250
48250
|
var def = Type.def;
|
|
48251
48251
|
var or = Type.or;
|
|
48252
48252
|
var shared = fork.use(shared_1.default);
|
|
@@ -48338,9 +48338,9 @@ var require_es6 = __commonJS({
|
|
|
48338
48338
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48339
48339
|
function default_1(fork) {
|
|
48340
48340
|
fork.use(core_1.default);
|
|
48341
|
-
var
|
|
48342
|
-
var def =
|
|
48343
|
-
var or =
|
|
48341
|
+
var types18 = fork.use(types_1.default);
|
|
48342
|
+
var def = types18.Type.def;
|
|
48343
|
+
var or = types18.Type.or;
|
|
48344
48344
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48345
48345
|
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"]);
|
|
48346
48346
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -48430,8 +48430,8 @@ var require_es2017 = __commonJS({
|
|
|
48430
48430
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48431
48431
|
function default_1(fork) {
|
|
48432
48432
|
fork.use(es2016_1.default);
|
|
48433
|
-
var
|
|
48434
|
-
var def =
|
|
48433
|
+
var types18 = fork.use(types_1.default);
|
|
48434
|
+
var def = types18.Type.def;
|
|
48435
48435
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48436
48436
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
48437
48437
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -48454,9 +48454,9 @@ var require_es2018 = __commonJS({
|
|
|
48454
48454
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48455
48455
|
function default_1(fork) {
|
|
48456
48456
|
fork.use(es2017_1.default);
|
|
48457
|
-
var
|
|
48458
|
-
var def =
|
|
48459
|
-
var or =
|
|
48457
|
+
var types18 = fork.use(types_1.default);
|
|
48458
|
+
var def = types18.Type.def;
|
|
48459
|
+
var or = types18.Type.or;
|
|
48460
48460
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48461
48461
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
48462
48462
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -48487,9 +48487,9 @@ var require_es2019 = __commonJS({
|
|
|
48487
48487
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48488
48488
|
function default_1(fork) {
|
|
48489
48489
|
fork.use(es2018_1.default);
|
|
48490
|
-
var
|
|
48491
|
-
var def =
|
|
48492
|
-
var or =
|
|
48490
|
+
var types18 = fork.use(types_1.default);
|
|
48491
|
+
var def = types18.Type.def;
|
|
48492
|
+
var or = types18.Type.or;
|
|
48493
48493
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48494
48494
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
48495
48495
|
}
|
|
@@ -48513,9 +48513,9 @@ var require_es20202 = __commonJS({
|
|
|
48513
48513
|
function default_1(fork) {
|
|
48514
48514
|
fork.use(es2020_1.default);
|
|
48515
48515
|
fork.use(es2019_1.default);
|
|
48516
|
-
var
|
|
48517
|
-
var def =
|
|
48518
|
-
var or =
|
|
48516
|
+
var types18 = fork.use(types_1.default);
|
|
48517
|
+
var def = types18.Type.def;
|
|
48518
|
+
var or = types18.Type.or;
|
|
48519
48519
|
var shared = fork.use(shared_1.default);
|
|
48520
48520
|
var defaults = shared.defaults;
|
|
48521
48521
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -48565,8 +48565,8 @@ var require_es2022 = __commonJS({
|
|
|
48565
48565
|
var shared_1 = require_shared();
|
|
48566
48566
|
function default_1(fork) {
|
|
48567
48567
|
fork.use(es2021_1.default);
|
|
48568
|
-
var
|
|
48569
|
-
var def =
|
|
48568
|
+
var types18 = fork.use(types_1.default);
|
|
48569
|
+
var def = types18.Type.def;
|
|
48570
48570
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
48571
48571
|
}
|
|
48572
48572
|
exports.default = default_1;
|
|
@@ -48587,9 +48587,9 @@ var require_es_proposals = __commonJS({
|
|
|
48587
48587
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
48588
48588
|
function default_1(fork) {
|
|
48589
48589
|
fork.use(es2022_1.default);
|
|
48590
|
-
var
|
|
48591
|
-
var Type =
|
|
48592
|
-
var def =
|
|
48590
|
+
var types18 = fork.use(types_1.default);
|
|
48591
|
+
var Type = types18.Type;
|
|
48592
|
+
var def = types18.Type.def;
|
|
48593
48593
|
var or = Type.or;
|
|
48594
48594
|
var shared = fork.use(shared_1.default);
|
|
48595
48595
|
var defaults = shared.defaults;
|
|
@@ -48629,9 +48629,9 @@ var require_jsx = __commonJS({
|
|
|
48629
48629
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48630
48630
|
function default_1(fork) {
|
|
48631
48631
|
fork.use(es_proposals_1.default);
|
|
48632
|
-
var
|
|
48633
|
-
var def =
|
|
48634
|
-
var or =
|
|
48632
|
+
var types18 = fork.use(types_1.default);
|
|
48633
|
+
var def = types18.Type.def;
|
|
48634
|
+
var or = types18.Type.or;
|
|
48635
48635
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48636
48636
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
48637
48637
|
def("Literal"),
|
|
@@ -48689,9 +48689,9 @@ var require_type_annotations = __commonJS({
|
|
|
48689
48689
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
48690
48690
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48691
48691
|
function default_1(fork) {
|
|
48692
|
-
var
|
|
48693
|
-
var def =
|
|
48694
|
-
var or =
|
|
48692
|
+
var types18 = fork.use(types_1.default);
|
|
48693
|
+
var def = types18.Type.def;
|
|
48694
|
+
var or = types18.Type.or;
|
|
48695
48695
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48696
48696
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
48697
48697
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -48726,9 +48726,9 @@ var require_flow = __commonJS({
|
|
|
48726
48726
|
function default_1(fork) {
|
|
48727
48727
|
fork.use(es_proposals_1.default);
|
|
48728
48728
|
fork.use(type_annotations_1.default);
|
|
48729
|
-
var
|
|
48730
|
-
var def =
|
|
48731
|
-
var or =
|
|
48729
|
+
var types18 = fork.use(types_1.default);
|
|
48730
|
+
var def = types18.Type.def;
|
|
48731
|
+
var or = types18.Type.or;
|
|
48732
48732
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48733
48733
|
def("Flow").bases("Node");
|
|
48734
48734
|
def("FlowType").bases("Flow");
|
|
@@ -48842,10 +48842,10 @@ var require_esprima = __commonJS({
|
|
|
48842
48842
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48843
48843
|
function default_1(fork) {
|
|
48844
48844
|
fork.use(es_proposals_1.default);
|
|
48845
|
-
var
|
|
48845
|
+
var types18 = fork.use(types_1.default);
|
|
48846
48846
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48847
|
-
var def =
|
|
48848
|
-
var or =
|
|
48847
|
+
var def = types18.Type.def;
|
|
48848
|
+
var or = types18.Type.or;
|
|
48849
48849
|
def("VariableDeclaration").field("declarations", [or(
|
|
48850
48850
|
def("VariableDeclarator"),
|
|
48851
48851
|
def("Identifier")
|
|
@@ -48890,11 +48890,11 @@ var require_babel_core = __commonJS({
|
|
|
48890
48890
|
function default_1(fork) {
|
|
48891
48891
|
var _a, _b, _c, _d, _e;
|
|
48892
48892
|
fork.use(es_proposals_1.default);
|
|
48893
|
-
var
|
|
48893
|
+
var types18 = fork.use(types_1.default);
|
|
48894
48894
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48895
|
-
var def =
|
|
48896
|
-
var or =
|
|
48897
|
-
var isUndefined =
|
|
48895
|
+
var def = types18.Type.def;
|
|
48896
|
+
var or = types18.Type.or;
|
|
48897
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
48898
48898
|
def("Noop").bases("Statement").build();
|
|
48899
48899
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
48900
48900
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -48919,7 +48919,7 @@ var require_babel_core = __commonJS({
|
|
|
48919
48919
|
raw: String
|
|
48920
48920
|
},
|
|
48921
48921
|
function getDefault() {
|
|
48922
|
-
var value =
|
|
48922
|
+
var value = types18.getFieldValue(this, "value");
|
|
48923
48923
|
return {
|
|
48924
48924
|
rawValue: value,
|
|
48925
48925
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -49022,8 +49022,8 @@ var require_babel = __commonJS({
|
|
|
49022
49022
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
49023
49023
|
var shared_1 = require_shared();
|
|
49024
49024
|
function default_1(fork) {
|
|
49025
|
-
var
|
|
49026
|
-
var def =
|
|
49025
|
+
var types18 = fork.use(types_1.default);
|
|
49026
|
+
var def = types18.Type.def;
|
|
49027
49027
|
fork.use(babel_core_1.default);
|
|
49028
49028
|
fork.use(flow_1.default);
|
|
49029
49029
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -49049,12 +49049,12 @@ var require_typescript = __commonJS({
|
|
|
49049
49049
|
function default_1(fork) {
|
|
49050
49050
|
fork.use(babel_core_1.default);
|
|
49051
49051
|
fork.use(type_annotations_1.default);
|
|
49052
|
-
var
|
|
49053
|
-
var n =
|
|
49054
|
-
var def =
|
|
49055
|
-
var or =
|
|
49052
|
+
var types18 = fork.use(types_1.default);
|
|
49053
|
+
var n = types18.namedTypes;
|
|
49054
|
+
var def = types18.Type.def;
|
|
49055
|
+
var or = types18.Type.or;
|
|
49056
49056
|
var defaults = fork.use(shared_1.default).defaults;
|
|
49057
|
-
var StringLiteral =
|
|
49057
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
49058
49058
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
49059
49059
|
return true;
|
|
49060
49060
|
}
|
|
@@ -51030,8 +51030,8 @@ var require_util2 = __commonJS({
|
|
|
51030
51030
|
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;
|
|
51031
51031
|
var tslib_1 = require_tslib();
|
|
51032
51032
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51033
|
-
var
|
|
51034
|
-
var n =
|
|
51033
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
51034
|
+
var n = types18.namedTypes;
|
|
51035
51035
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
51036
51036
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
51037
51037
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -58349,10 +58349,10 @@ var require_comments = __commonJS({
|
|
|
58349
58349
|
exports.printComments = exports.attach = void 0;
|
|
58350
58350
|
var tslib_1 = require_tslib();
|
|
58351
58351
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
58352
|
-
var
|
|
58353
|
-
var n =
|
|
58354
|
-
var isArray =
|
|
58355
|
-
var isObject2 =
|
|
58352
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58353
|
+
var n = types18.namedTypes;
|
|
58354
|
+
var isArray = types18.builtInTypes.array;
|
|
58355
|
+
var isObject2 = types18.builtInTypes.object;
|
|
58356
58356
|
var lines_1 = require_lines();
|
|
58357
58357
|
var util_1 = require_util2();
|
|
58358
58358
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -58383,7 +58383,7 @@ var require_comments = __commonJS({
|
|
|
58383
58383
|
if (isArray.check(node)) {
|
|
58384
58384
|
names = Object.keys(node);
|
|
58385
58385
|
} else if (isObject2.check(node)) {
|
|
58386
|
-
names =
|
|
58386
|
+
names = types18.getFieldNames(node);
|
|
58387
58387
|
} else {
|
|
58388
58388
|
return resultArray;
|
|
58389
58389
|
}
|
|
@@ -58561,7 +58561,7 @@ var require_comments = __commonJS({
|
|
|
58561
58561
|
function printComments(path2, print9) {
|
|
58562
58562
|
var value = path2.getValue();
|
|
58563
58563
|
var innerLines = print9(path2);
|
|
58564
|
-
var comments = n.Node.check(value) &&
|
|
58564
|
+
var comments = n.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
58565
58565
|
if (!comments || comments.length === 0) {
|
|
58566
58566
|
return innerLines;
|
|
58567
58567
|
}
|
|
@@ -58569,8 +58569,8 @@ var require_comments = __commonJS({
|
|
|
58569
58569
|
var trailingParts = [innerLines];
|
|
58570
58570
|
path2.each(function(commentPath) {
|
|
58571
58571
|
var comment = commentPath.getValue();
|
|
58572
|
-
var leading =
|
|
58573
|
-
var trailing =
|
|
58572
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
58573
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
58574
58574
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
58575
58575
|
leadingParts.push(printLeadingComment(commentPath, print9));
|
|
58576
58576
|
} else if (trailing) {
|
|
@@ -58592,10 +58592,10 @@ var require_parser2 = __commonJS({
|
|
|
58592
58592
|
exports.parse = void 0;
|
|
58593
58593
|
var tslib_1 = require_tslib();
|
|
58594
58594
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
58595
|
-
var
|
|
58596
|
-
var b =
|
|
58597
|
-
var isObject2 =
|
|
58598
|
-
var isArray =
|
|
58595
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58596
|
+
var b = types18.builders;
|
|
58597
|
+
var isObject2 = types18.builtInTypes.object;
|
|
58598
|
+
var isArray = types18.builtInTypes.array;
|
|
58599
58599
|
var options_1 = require_options();
|
|
58600
58600
|
var lines_1 = require_lines();
|
|
58601
58601
|
var comments_1 = require_comments();
|
|
@@ -58781,11 +58781,11 @@ var require_fast_path = __commonJS({
|
|
|
58781
58781
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58782
58782
|
var tslib_1 = require_tslib();
|
|
58783
58783
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
58784
|
-
var
|
|
58784
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58785
58785
|
var util = tslib_1.__importStar(require_util2());
|
|
58786
|
-
var n =
|
|
58787
|
-
var isArray =
|
|
58788
|
-
var isNumber =
|
|
58786
|
+
var n = types18.namedTypes;
|
|
58787
|
+
var isArray = types18.builtInTypes.array;
|
|
58788
|
+
var isNumber = types18.builtInTypes.number;
|
|
58789
58789
|
var PRECEDENCE = {};
|
|
58790
58790
|
[
|
|
58791
58791
|
["??"],
|
|
@@ -58814,7 +58814,7 @@ var require_fast_path = __commonJS({
|
|
|
58814
58814
|
if (obj instanceof FastPath) {
|
|
58815
58815
|
return obj.copy();
|
|
58816
58816
|
}
|
|
58817
|
-
if (obj instanceof
|
|
58817
|
+
if (obj instanceof types18.NodePath) {
|
|
58818
58818
|
var copy = Object.create(FastPath.prototype);
|
|
58819
58819
|
var stack = [obj.value];
|
|
58820
58820
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -59125,7 +59125,7 @@ var require_fast_path = __commonJS({
|
|
|
59125
59125
|
return node.some(containsCallExpression);
|
|
59126
59126
|
}
|
|
59127
59127
|
if (n.Node.check(node)) {
|
|
59128
|
-
return
|
|
59128
|
+
return types18.someField(node, function(_name, child) {
|
|
59129
59129
|
return containsCallExpression(child);
|
|
59130
59130
|
});
|
|
59131
59131
|
}
|
|
@@ -59215,16 +59215,16 @@ var require_patcher = __commonJS({
|
|
|
59215
59215
|
var tslib_1 = require_tslib();
|
|
59216
59216
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
59217
59217
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
59218
|
-
var
|
|
59219
|
-
var Printable =
|
|
59220
|
-
var Expression =
|
|
59221
|
-
var ReturnStatement =
|
|
59222
|
-
var SourceLocation =
|
|
59218
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
59219
|
+
var Printable = types18.namedTypes.Printable;
|
|
59220
|
+
var Expression = types18.namedTypes.Expression;
|
|
59221
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
59222
|
+
var SourceLocation = types18.namedTypes.SourceLocation;
|
|
59223
59223
|
var util_1 = require_util2();
|
|
59224
59224
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
59225
|
-
var isObject2 =
|
|
59226
|
-
var isArray =
|
|
59227
|
-
var isString =
|
|
59225
|
+
var isObject2 = types18.builtInTypes.object;
|
|
59226
|
+
var isArray = types18.builtInTypes.array;
|
|
59227
|
+
var isString = types18.builtInTypes.string;
|
|
59228
59228
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
59229
59229
|
var Patcher = function Patcher2(lines) {
|
|
59230
59230
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -59494,8 +59494,8 @@ var require_patcher = __commonJS({
|
|
|
59494
59494
|
if (k.charAt(0) === "_") {
|
|
59495
59495
|
continue;
|
|
59496
59496
|
}
|
|
59497
|
-
newPath.stack.push(k,
|
|
59498
|
-
oldPath.stack.push(k,
|
|
59497
|
+
newPath.stack.push(k, types18.getFieldValue(newNode, k));
|
|
59498
|
+
oldPath.stack.push(k, types18.getFieldValue(oldNode, k));
|
|
59499
59499
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
59500
59500
|
newPath.stack.length -= 2;
|
|
59501
59501
|
oldPath.stack.length -= 2;
|
|
@@ -59519,16 +59519,16 @@ var require_printer2 = __commonJS({
|
|
|
59519
59519
|
exports.Printer = void 0;
|
|
59520
59520
|
var tslib_1 = require_tslib();
|
|
59521
59521
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
59522
|
-
var
|
|
59522
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
59523
59523
|
var comments_1 = require_comments();
|
|
59524
59524
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
59525
59525
|
var lines_1 = require_lines();
|
|
59526
59526
|
var options_1 = require_options();
|
|
59527
59527
|
var patcher_1 = require_patcher();
|
|
59528
59528
|
var util = tslib_1.__importStar(require_util2());
|
|
59529
|
-
var namedTypes =
|
|
59530
|
-
var isString =
|
|
59531
|
-
var isObject2 =
|
|
59529
|
+
var namedTypes = types18.namedTypes;
|
|
59530
|
+
var isString = types18.builtInTypes.string;
|
|
59531
|
+
var isObject2 = types18.builtInTypes.object;
|
|
59532
59532
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
59533
59533
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
59534
59534
|
isString.assert(code);
|
|
@@ -59690,7 +59690,7 @@ var require_printer2 = __commonJS({
|
|
|
59690
59690
|
case "OptionalMemberExpression": {
|
|
59691
59691
|
parts.push(path2.call(print9, "object"));
|
|
59692
59692
|
var property = path2.call(print9, "property");
|
|
59693
|
-
var optional =
|
|
59693
|
+
var optional = types18.getFieldValue(n, "optional");
|
|
59694
59694
|
if (n.computed) {
|
|
59695
59695
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
59696
59696
|
} else {
|
|
@@ -59961,7 +59961,7 @@ var require_printer2 = __commonJS({
|
|
|
59961
59961
|
if (n.typeArguments) {
|
|
59962
59962
|
parts.push(path2.call(print9, "typeArguments"));
|
|
59963
59963
|
}
|
|
59964
|
-
if (
|
|
59964
|
+
if (types18.getFieldValue(n, "optional")) {
|
|
59965
59965
|
parts.push("?.");
|
|
59966
59966
|
}
|
|
59967
59967
|
parts.push(printArgumentsList(path2, options, print9));
|
|
@@ -61640,8 +61640,8 @@ var require_printer2 = __commonJS({
|
|
|
61640
61640
|
});
|
|
61641
61641
|
}
|
|
61642
61642
|
function getPossibleRaw(node) {
|
|
61643
|
-
var value =
|
|
61644
|
-
var extra =
|
|
61643
|
+
var value = types18.getFieldValue(node, "value");
|
|
61644
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
61645
61645
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
61646
61646
|
return extra.raw;
|
|
61647
61647
|
}
|
|
@@ -61689,8 +61689,8 @@ var require_main2 = __commonJS({
|
|
|
61689
61689
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
61690
61690
|
var tslib_1 = require_tslib();
|
|
61691
61691
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
61692
|
-
var
|
|
61693
|
-
exports.types =
|
|
61692
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
61693
|
+
exports.types = types18;
|
|
61694
61694
|
var parser_1 = require_parser2();
|
|
61695
61695
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
61696
61696
|
return parser_1.parse;
|
|
@@ -62999,7 +62999,7 @@ var printDocASTReducer = {
|
|
|
62999
62999
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
63000
63000
|
},
|
|
63001
63001
|
UnionTypeDefinition: {
|
|
63002
|
-
leave: ({ name, directives, types:
|
|
63002
|
+
leave: ({ name, directives, types: types18 }) => join(["union", name, join(directives, " "), wrap("= ", join(types18, " | "))], " ")
|
|
63003
63003
|
},
|
|
63004
63004
|
EnumTypeDefinition: {
|
|
63005
63005
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -63026,7 +63026,7 @@ var printDocASTReducer = {
|
|
|
63026
63026
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
63027
63027
|
},
|
|
63028
63028
|
UnionTypeExtension: {
|
|
63029
|
-
leave: ({ name, directives, types:
|
|
63029
|
+
leave: ({ name, directives, types: types18 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types18, " | "))], " ")
|
|
63030
63030
|
},
|
|
63031
63031
|
EnumTypeExtension: {
|
|
63032
63032
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -63906,8 +63906,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
63906
63906
|
}
|
|
63907
63907
|
}
|
|
63908
63908
|
function healUnderlyingTypes(type) {
|
|
63909
|
-
const
|
|
63910
|
-
|
|
63909
|
+
const types18 = type.getTypes();
|
|
63910
|
+
types18.push(...types18.splice(0).map((t2) => healType(t2)).filter(Boolean));
|
|
63911
63911
|
}
|
|
63912
63912
|
function healType(type) {
|
|
63913
63913
|
if ((0, import_graphql11.isListType)(type)) {
|
|
@@ -64691,11 +64691,11 @@ function mergeEnum(e1, e2, config4) {
|
|
|
64691
64691
|
|
|
64692
64692
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.8.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
64693
64693
|
var import_graphql20 = __toESM(require_graphql2(), 1);
|
|
64694
|
-
function isStringTypes(
|
|
64695
|
-
return typeof
|
|
64694
|
+
function isStringTypes(types18) {
|
|
64695
|
+
return typeof types18 === "string";
|
|
64696
64696
|
}
|
|
64697
|
-
function isSourceTypes(
|
|
64698
|
-
return
|
|
64697
|
+
function isSourceTypes(types18) {
|
|
64698
|
+
return types18 instanceof import_graphql20.Source;
|
|
64699
64699
|
}
|
|
64700
64700
|
function extractType(type) {
|
|
64701
64701
|
let visitedType = type;
|
|
@@ -67065,6 +67065,9 @@ var GarbageCollector = class {
|
|
|
67065
67065
|
constructor(cache) {
|
|
67066
67066
|
this.cache = cache;
|
|
67067
67067
|
}
|
|
67068
|
+
reset() {
|
|
67069
|
+
this.lifetimes.clear();
|
|
67070
|
+
}
|
|
67068
67071
|
resetLifetime(id, field) {
|
|
67069
67072
|
if (!this.lifetimes.get(id)) {
|
|
67070
67073
|
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
@@ -67184,6 +67187,10 @@ var ListManager = class {
|
|
|
67184
67187
|
}
|
|
67185
67188
|
this.listsByField.get(parentID).delete(field);
|
|
67186
67189
|
}
|
|
67190
|
+
reset() {
|
|
67191
|
+
this.lists.clear();
|
|
67192
|
+
this.listsByField.clear();
|
|
67193
|
+
}
|
|
67187
67194
|
};
|
|
67188
67195
|
var List = class {
|
|
67189
67196
|
recordID;
|
|
@@ -67566,6 +67573,9 @@ var StaleManager = class {
|
|
|
67566
67573
|
}
|
|
67567
67574
|
}
|
|
67568
67575
|
}
|
|
67576
|
+
reset() {
|
|
67577
|
+
this.fieldsTime.clear();
|
|
67578
|
+
}
|
|
67569
67579
|
};
|
|
67570
67580
|
|
|
67571
67581
|
// src/runtime/cache/storage.ts
|
|
@@ -67746,6 +67756,9 @@ var InMemoryStorage = class {
|
|
|
67746
67756
|
layer.fields = fields;
|
|
67747
67757
|
layer.links = links;
|
|
67748
67758
|
}
|
|
67759
|
+
reset() {
|
|
67760
|
+
this.data = [];
|
|
67761
|
+
}
|
|
67749
67762
|
};
|
|
67750
67763
|
var Layer = class {
|
|
67751
67764
|
id;
|
|
@@ -68191,6 +68204,18 @@ var InMemorySubscriptions = class {
|
|
|
68191
68204
|
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
68192
68205
|
}
|
|
68193
68206
|
}
|
|
68207
|
+
reset() {
|
|
68208
|
+
const subscribers = Object.entries(this.subscribers).filter(
|
|
68209
|
+
([id]) => !id.startsWith(rootID)
|
|
68210
|
+
);
|
|
68211
|
+
for (const [id, _fields] of subscribers) {
|
|
68212
|
+
delete this.subscribers[id];
|
|
68213
|
+
}
|
|
68214
|
+
const subscriptionSpecs = subscribers.flatMap(
|
|
68215
|
+
([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
|
|
68216
|
+
);
|
|
68217
|
+
return subscriptionSpecs;
|
|
68218
|
+
}
|
|
68194
68219
|
removeSubscribers(id, fieldName, specs) {
|
|
68195
68220
|
let targets = [];
|
|
68196
68221
|
for (const spec of specs) {
|
|
@@ -68380,6 +68405,14 @@ var Cache = class {
|
|
|
68380
68405
|
}
|
|
68381
68406
|
this.#notifySubscribers(toNotify);
|
|
68382
68407
|
}
|
|
68408
|
+
reset() {
|
|
68409
|
+
const subSpecs = this._internal_unstable.subscriptions.reset();
|
|
68410
|
+
this._internal_unstable.staleManager.reset();
|
|
68411
|
+
this._internal_unstable.lifetimes.reset();
|
|
68412
|
+
this._internal_unstable.lists.reset();
|
|
68413
|
+
this._internal_unstable.storage.reset();
|
|
68414
|
+
this.#notifySubscribers(subSpecs);
|
|
68415
|
+
}
|
|
68383
68416
|
#notifySubscribers(subs) {
|
|
68384
68417
|
if (subs.length === 0) {
|
|
68385
68418
|
return;
|
|
@@ -68562,7 +68595,7 @@ var CacheInternal = class {
|
|
|
68562
68595
|
forceNotify
|
|
68563
68596
|
});
|
|
68564
68597
|
}
|
|
68565
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
68598
|
+
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
68566
68599
|
let oldIDs = [...previousValue || []];
|
|
68567
68600
|
const emptyEdges = !updates ? [] : oldIDs.map((id) => {
|
|
68568
68601
|
if (!id) {
|
|
@@ -68635,7 +68668,7 @@ var CacheInternal = class {
|
|
|
68635
68668
|
} else {
|
|
68636
68669
|
linkedIDs = nestedIDs;
|
|
68637
68670
|
}
|
|
68638
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
68671
|
+
const contentChanged = !deepEquals(linkedIDs, oldIDs) || previousValue === null;
|
|
68639
68672
|
if (contentChanged || forceNotify) {
|
|
68640
68673
|
toNotify.push(...currentSubscribers);
|
|
68641
68674
|
}
|
|
@@ -69355,7 +69388,7 @@ var Config = class {
|
|
|
69355
69388
|
defaultListTarget = null,
|
|
69356
69389
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
69357
69390
|
defaultKeys,
|
|
69358
|
-
types:
|
|
69391
|
+
types: types18 = {},
|
|
69359
69392
|
logLevel,
|
|
69360
69393
|
defaultFragmentMasking = "enable",
|
|
69361
69394
|
watchSchema,
|
|
@@ -69399,10 +69432,10 @@ var Config = class {
|
|
|
69399
69432
|
if (defaultKeys) {
|
|
69400
69433
|
this.defaultKeys = defaultKeys;
|
|
69401
69434
|
}
|
|
69402
|
-
if (
|
|
69435
|
+
if (types18) {
|
|
69403
69436
|
this.typeConfig = {
|
|
69404
69437
|
...this.typeConfig,
|
|
69405
|
-
...
|
|
69438
|
+
...types18
|
|
69406
69439
|
};
|
|
69407
69440
|
}
|
|
69408
69441
|
}
|
|
@@ -70543,7 +70576,7 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
70543
70576
|
|
|
70544
70577
|
// src/codegen/generators/artifacts/index.ts
|
|
70545
70578
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
70546
|
-
var
|
|
70579
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
70547
70580
|
|
|
70548
70581
|
// src/codegen/utils/commonjs.ts
|
|
70549
70582
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -71730,7 +71763,6 @@ function ancestorKey(ancestors) {
|
|
|
71730
71763
|
|
|
71731
71764
|
// src/codegen/generators/artifacts/selection.ts
|
|
71732
71765
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
71733
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
71734
71766
|
|
|
71735
71767
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
71736
71768
|
var config2 = {
|
|
@@ -72683,15 +72715,12 @@ function fieldKey(config4, field) {
|
|
|
72683
72715
|
}
|
|
72684
72716
|
|
|
72685
72717
|
// src/codegen/generators/artifacts/selection.ts
|
|
72686
|
-
var AST5 = recast5.types.builders;
|
|
72687
72718
|
function selection_default(args) {
|
|
72688
|
-
const typeMap = {};
|
|
72689
|
-
const abstractTypes = [];
|
|
72690
72719
|
return mergeSelection({
|
|
72691
|
-
|
|
72692
|
-
|
|
72693
|
-
|
|
72694
|
-
|
|
72720
|
+
config: args.config,
|
|
72721
|
+
rootType: args.rootType,
|
|
72722
|
+
object: prepareSelection(args),
|
|
72723
|
+
filepath: args.filepath
|
|
72695
72724
|
});
|
|
72696
72725
|
}
|
|
72697
72726
|
function prepareSelection({
|
|
@@ -72703,8 +72732,6 @@ function prepareSelection({
|
|
|
72703
72732
|
path: path2 = [],
|
|
72704
72733
|
document,
|
|
72705
72734
|
inConnection,
|
|
72706
|
-
typeMap,
|
|
72707
|
-
abstractTypes,
|
|
72708
72735
|
globalLoading,
|
|
72709
72736
|
includeFragments
|
|
72710
72737
|
}) {
|
|
@@ -72724,8 +72751,6 @@ function prepareSelection({
|
|
|
72724
72751
|
selections: field.selectionSet.selections,
|
|
72725
72752
|
path: path2,
|
|
72726
72753
|
document,
|
|
72727
|
-
typeMap,
|
|
72728
|
-
abstractTypes,
|
|
72729
72754
|
globalLoading,
|
|
72730
72755
|
includeFragments
|
|
72731
72756
|
}).fields || {}
|
|
@@ -72737,32 +72762,7 @@ function prepareSelection({
|
|
|
72737
72762
|
typeMap: {}
|
|
72738
72763
|
};
|
|
72739
72764
|
}
|
|
72740
|
-
const parentType = config4.schema.getType(rootType);
|
|
72741
72765
|
const typeConditionName = field.typeCondition.name.value;
|
|
72742
|
-
const typeCondition = config4.schema.getType(typeConditionName);
|
|
72743
|
-
const possibleTypes = [];
|
|
72744
|
-
if (!graphql13.isAbstractType(typeCondition)) {
|
|
72745
|
-
} else if (graphql13.isAbstractType(parentType)) {
|
|
72746
|
-
const possibleParentTypes = config4.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
72747
|
-
for (const possible of config4.schema.getPossibleTypes(typeCondition)) {
|
|
72748
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
72749
|
-
possibleTypes.push(possible.name);
|
|
72750
|
-
}
|
|
72751
|
-
}
|
|
72752
|
-
} else {
|
|
72753
|
-
possibleTypes.push(rootType);
|
|
72754
|
-
}
|
|
72755
|
-
if (possibleTypes.length > 0) {
|
|
72756
|
-
for (const type of possibleTypes) {
|
|
72757
|
-
const existing = typeMap[type];
|
|
72758
|
-
if (!existing || !existing.includes(type)) {
|
|
72759
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
72760
|
-
}
|
|
72761
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
72762
|
-
abstractTypes.push(typeConditionName);
|
|
72763
|
-
}
|
|
72764
|
-
}
|
|
72765
|
-
}
|
|
72766
72766
|
object.abstractFields.fields = {
|
|
72767
72767
|
...object.abstractFields.fields,
|
|
72768
72768
|
[typeConditionName]: prepareSelection({
|
|
@@ -72773,8 +72773,6 @@ function prepareSelection({
|
|
|
72773
72773
|
selections: field.selectionSet.selections,
|
|
72774
72774
|
path: path2,
|
|
72775
72775
|
document,
|
|
72776
|
-
typeMap,
|
|
72777
|
-
abstractTypes,
|
|
72778
72776
|
globalLoading,
|
|
72779
72777
|
includeFragments
|
|
72780
72778
|
}).fields
|
|
@@ -72786,19 +72784,38 @@ function prepareSelection({
|
|
|
72786
72784
|
} else if (field.kind === "Field") {
|
|
72787
72785
|
const type = config4.schema.getType(rootType);
|
|
72788
72786
|
if (!type) {
|
|
72789
|
-
throw new HoudiniError({
|
|
72787
|
+
throw new HoudiniError({
|
|
72788
|
+
filepath,
|
|
72789
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
72790
|
+
});
|
|
72790
72791
|
}
|
|
72791
72792
|
const attributeName = field.alias?.value || field.name.value;
|
|
72792
|
-
let fieldType;
|
|
72793
|
+
let fieldType = null;
|
|
72793
72794
|
let nullable = false;
|
|
72794
72795
|
if (field.name.value === "__typename") {
|
|
72795
72796
|
fieldType = config4.schema.getType("String");
|
|
72796
|
-
} else {
|
|
72797
|
+
} else if ("getFields" in type) {
|
|
72797
72798
|
let typeRef = type.getFields()[field.name.value].type;
|
|
72798
72799
|
fieldType = getRootType(typeRef);
|
|
72799
72800
|
nullable = !graphql13.isNonNullType(typeRef);
|
|
72801
|
+
} else if (graphql13.isAbstractType(type)) {
|
|
72802
|
+
for (const possible of config4.schema.getPossibleTypes(type)) {
|
|
72803
|
+
if (graphql13.isObjectType(possible)) {
|
|
72804
|
+
if (possible.getFields()[field.name.value]) {
|
|
72805
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
72806
|
+
nullable = !graphql13.isNonNullType(fieldType);
|
|
72807
|
+
break;
|
|
72808
|
+
}
|
|
72809
|
+
}
|
|
72810
|
+
}
|
|
72800
72811
|
}
|
|
72801
|
-
|
|
72812
|
+
if (!fieldType) {
|
|
72813
|
+
throw {
|
|
72814
|
+
message: "Could not identify field's type",
|
|
72815
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
72816
|
+
};
|
|
72817
|
+
}
|
|
72818
|
+
const typeName = getRootType(fieldType).name;
|
|
72802
72819
|
const pathSoFar = path2.concat(attributeName);
|
|
72803
72820
|
const keys2 = config4.keyFieldsForType(rootType);
|
|
72804
72821
|
let fieldObj = {
|
|
@@ -72892,8 +72909,6 @@ function prepareSelection({
|
|
|
72892
72909
|
path: pathSoFar,
|
|
72893
72910
|
document,
|
|
72894
72911
|
inConnection: connectionState,
|
|
72895
|
-
typeMap,
|
|
72896
|
-
abstractTypes,
|
|
72897
72912
|
globalLoading: forceLoading,
|
|
72898
72913
|
includeFragments
|
|
72899
72914
|
});
|
|
@@ -72979,69 +72994,107 @@ function prepareSelection({
|
|
|
72979
72994
|
return object;
|
|
72980
72995
|
}
|
|
72981
72996
|
function mergeSelection({
|
|
72997
|
+
config: config4,
|
|
72982
72998
|
filepath,
|
|
72983
72999
|
object,
|
|
72984
|
-
|
|
72985
|
-
abstractTypes
|
|
73000
|
+
rootType
|
|
72986
73001
|
}) {
|
|
72987
73002
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
72988
|
-
|
|
72989
|
-
|
|
73003
|
+
const abstractSelection = {
|
|
73004
|
+
fields: {},
|
|
73005
|
+
typeMap: {}
|
|
73006
|
+
};
|
|
73007
|
+
const possibleSelectionTypes = {};
|
|
73008
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
73009
|
+
const gqlType = config4.schema.getType(typeName);
|
|
73010
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
73011
|
+
filepath,
|
|
73012
|
+
typeSelection,
|
|
73013
|
+
abstractSelection.fields[typeName] ?? {}
|
|
73014
|
+
);
|
|
73015
|
+
if (graphql13.isAbstractType(gqlType)) {
|
|
73016
|
+
for (const possible of config4.schema.getPossibleTypes(gqlType)) {
|
|
73017
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
73018
|
+
possibleSelectionTypes[typeName] = [];
|
|
73019
|
+
}
|
|
73020
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
73021
|
+
}
|
|
73022
|
+
}
|
|
73023
|
+
}
|
|
73024
|
+
const concreteSelectionImplements = {};
|
|
73025
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
73026
|
+
for (const possible of possibles) {
|
|
73027
|
+
if (!concreteSelectionImplements[possible]) {
|
|
73028
|
+
concreteSelectionImplements[possible] = [];
|
|
73029
|
+
}
|
|
73030
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
73031
|
+
}
|
|
73032
|
+
}
|
|
73033
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
73034
|
+
if (implementations.length > 1) {
|
|
73035
|
+
abstractSelection.fields[concrete] = {};
|
|
73036
|
+
}
|
|
73037
|
+
}
|
|
73038
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
72990
73039
|
for (const possible of possibles) {
|
|
72991
|
-
if (
|
|
72992
|
-
|
|
73040
|
+
if (abstractSelection.fields[possible]) {
|
|
73041
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
72993
73042
|
filepath,
|
|
72994
|
-
|
|
72995
|
-
|
|
73043
|
+
abstractSelection.fields[typeName] ?? {},
|
|
73044
|
+
abstractSelection.fields[possible] ?? {}
|
|
72996
73045
|
);
|
|
72997
|
-
overlap = true;
|
|
72998
73046
|
}
|
|
72999
73047
|
}
|
|
73000
|
-
if (overlap) {
|
|
73001
|
-
delete typeMap[typeName];
|
|
73002
|
-
}
|
|
73003
73048
|
}
|
|
73004
|
-
|
|
73005
|
-
|
|
73006
|
-
|
|
73007
|
-
|
|
73008
|
-
|
|
73009
|
-
);
|
|
73010
|
-
delete typeMap[type];
|
|
73049
|
+
const parentType = config4.schema.getType(rootType);
|
|
73050
|
+
const possibleParents = graphql13.isAbstractType(parentType) ? config4.schema.getPossibleTypes(parentType)?.map((t2) => t2.name) : [parentType.name];
|
|
73051
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
73052
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
73053
|
+
delete abstractSelection.typeMap[key];
|
|
73011
73054
|
}
|
|
73012
73055
|
}
|
|
73013
|
-
for (const [type, sel] of Object.entries(
|
|
73014
|
-
|
|
73056
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
73057
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
73015
73058
|
}
|
|
73016
|
-
for (const [
|
|
73017
|
-
|
|
73059
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
73060
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
73061
|
+
delete abstractSelection.fields[typename];
|
|
73062
|
+
}
|
|
73018
73063
|
}
|
|
73019
|
-
const
|
|
73020
|
-
|
|
73021
|
-
|
|
73022
|
-
|
|
73064
|
+
for (const possible of possibleParents) {
|
|
73065
|
+
if (abstractSelection.fields[possible]) {
|
|
73066
|
+
continue;
|
|
73067
|
+
}
|
|
73068
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
73069
|
+
possibleSelectionTypes
|
|
73070
|
+
)) {
|
|
73071
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
73072
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
73073
|
+
break;
|
|
73074
|
+
}
|
|
73023
73075
|
}
|
|
73024
73076
|
}
|
|
73077
|
+
object.abstractFields = abstractSelection;
|
|
73025
73078
|
}
|
|
73026
|
-
for (const
|
|
73079
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
73027
73080
|
const selection = value.selection;
|
|
73028
73081
|
if (selection) {
|
|
73029
73082
|
mergeSelection({
|
|
73083
|
+
config: config4,
|
|
73084
|
+
rootType: value.type,
|
|
73030
73085
|
filepath,
|
|
73031
|
-
typeMap,
|
|
73032
|
-
abstractTypes,
|
|
73033
73086
|
object: selection
|
|
73034
73087
|
});
|
|
73035
73088
|
}
|
|
73036
73089
|
}
|
|
73037
73090
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
73038
|
-
for (const
|
|
73091
|
+
for (const value of Object.values(selection ?? {})) {
|
|
73039
73092
|
const selection2 = value.selection;
|
|
73040
73093
|
if (selection2) {
|
|
73041
73094
|
mergeSelection({
|
|
73095
|
+
config: config4,
|
|
73096
|
+
rootType: value.type,
|
|
73042
73097
|
filepath,
|
|
73043
|
-
typeMap,
|
|
73044
|
-
abstractTypes,
|
|
73045
73098
|
object: selection2
|
|
73046
73099
|
});
|
|
73047
73100
|
}
|
|
@@ -73051,7 +73104,7 @@ function mergeSelection({
|
|
|
73051
73104
|
}
|
|
73052
73105
|
|
|
73053
73106
|
// src/codegen/generators/artifacts/index.ts
|
|
73054
|
-
var
|
|
73107
|
+
var AST5 = recast5.types.builders;
|
|
73055
73108
|
function artifactGenerator(stats) {
|
|
73056
73109
|
return async function(config4, docs) {
|
|
73057
73110
|
const filterTypes = {};
|
|
@@ -73319,10 +73372,10 @@ function artifactGenerator(stats) {
|
|
|
73319
73372
|
}
|
|
73320
73373
|
plugin2.artifactEnd({ config: config4, document: doc });
|
|
73321
73374
|
}
|
|
73322
|
-
const file =
|
|
73375
|
+
const file = AST5.program([
|
|
73323
73376
|
moduleExport(config4, "default", serializeValue(artifact)),
|
|
73324
|
-
|
|
73325
|
-
|
|
73377
|
+
AST5.expressionStatement(
|
|
73378
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config4, document: doc })}`)
|
|
73326
73379
|
)
|
|
73327
73380
|
]);
|
|
73328
73381
|
const artifactPath = config4.artifactPath(document);
|
|
@@ -73402,8 +73455,8 @@ function applyMask(config4, target, mask) {
|
|
|
73402
73455
|
}
|
|
73403
73456
|
|
|
73404
73457
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
73405
|
-
var
|
|
73406
|
-
var
|
|
73458
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
73459
|
+
var AST6 = recast6.types.builders;
|
|
73407
73460
|
async function generateGraphqlReturnTypes(config4, docs) {
|
|
73408
73461
|
const indexPath = path_exports.join(config4.runtimeDirectory, "index.d.ts");
|
|
73409
73462
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -73438,18 +73491,18 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
73438
73491
|
continue;
|
|
73439
73492
|
}
|
|
73440
73493
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
73441
|
-
const input =
|
|
73442
|
-
input.typeAnnotation =
|
|
73443
|
-
|
|
73494
|
+
const input = AST6.identifier("str");
|
|
73495
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
73496
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
73444
73497
|
);
|
|
73445
73498
|
script.body.splice(
|
|
73446
73499
|
i2,
|
|
73447
73500
|
0,
|
|
73448
|
-
|
|
73449
|
-
|
|
73450
|
-
|
|
73501
|
+
AST6.exportNamedDeclaration(
|
|
73502
|
+
AST6.tsDeclareFunction(
|
|
73503
|
+
AST6.identifier("graphql"),
|
|
73451
73504
|
[input],
|
|
73452
|
-
|
|
73505
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
73453
73506
|
)
|
|
73454
73507
|
)
|
|
73455
73508
|
);
|
|
@@ -73612,20 +73665,20 @@ async function generatePluginRuntime({
|
|
|
73612
73665
|
}
|
|
73613
73666
|
|
|
73614
73667
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
73615
|
-
var
|
|
73668
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
73616
73669
|
|
|
73617
73670
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
73618
73671
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
73619
|
-
var
|
|
73672
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
73620
73673
|
|
|
73621
73674
|
// src/codegen/generators/typescript/typeReference.ts
|
|
73622
73675
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
73623
|
-
var
|
|
73676
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
73624
73677
|
|
|
73625
73678
|
// src/codegen/generators/typescript/types.ts
|
|
73626
73679
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
73627
|
-
var
|
|
73628
|
-
var
|
|
73680
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
73681
|
+
var AST7 = recast7.types.builders;
|
|
73629
73682
|
function readonlyProperty(prop, enable = true) {
|
|
73630
73683
|
if (enable) {
|
|
73631
73684
|
prop.readonly = true;
|
|
@@ -73633,28 +73686,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
73633
73686
|
return prop;
|
|
73634
73687
|
}
|
|
73635
73688
|
function nullableField(inner, input = false) {
|
|
73636
|
-
const members = [inner,
|
|
73689
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
73637
73690
|
if (input) {
|
|
73638
|
-
members.push(
|
|
73691
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
73639
73692
|
}
|
|
73640
|
-
return
|
|
73693
|
+
return AST7.tsUnionType(members);
|
|
73641
73694
|
}
|
|
73642
73695
|
function scalarPropertyValue(config4, missingScalars, target) {
|
|
73643
73696
|
switch (target.name) {
|
|
73644
73697
|
case "String": {
|
|
73645
|
-
return
|
|
73698
|
+
return AST7.tsStringKeyword();
|
|
73646
73699
|
}
|
|
73647
73700
|
case "Int": {
|
|
73648
|
-
return
|
|
73701
|
+
return AST7.tsNumberKeyword();
|
|
73649
73702
|
}
|
|
73650
73703
|
case "Float": {
|
|
73651
|
-
return
|
|
73704
|
+
return AST7.tsNumberKeyword();
|
|
73652
73705
|
}
|
|
73653
73706
|
case "Boolean": {
|
|
73654
|
-
return
|
|
73707
|
+
return AST7.tsBooleanKeyword();
|
|
73655
73708
|
}
|
|
73656
73709
|
case "ID": {
|
|
73657
|
-
return
|
|
73710
|
+
return AST7.tsStringKeyword();
|
|
73658
73711
|
}
|
|
73659
73712
|
default: {
|
|
73660
73713
|
if (graphql15.isNonNullType(target) && "ofType" in target) {
|
|
@@ -73665,16 +73718,16 @@ function scalarPropertyValue(config4, missingScalars, target) {
|
|
|
73665
73718
|
);
|
|
73666
73719
|
}
|
|
73667
73720
|
if (config4.scalars?.[target.name]) {
|
|
73668
|
-
return
|
|
73721
|
+
return AST7.tsTypeReference(AST7.identifier(config4.scalars?.[target.name].type));
|
|
73669
73722
|
}
|
|
73670
73723
|
missingScalars.add(target.name);
|
|
73671
|
-
return
|
|
73724
|
+
return AST7.tsAnyKeyword();
|
|
73672
73725
|
}
|
|
73673
73726
|
}
|
|
73674
73727
|
}
|
|
73675
73728
|
|
|
73676
73729
|
// src/codegen/generators/typescript/typeReference.ts
|
|
73677
|
-
var
|
|
73730
|
+
var AST8 = recast8.types.builders;
|
|
73678
73731
|
function tsTypeReference(config4, missingScalars, definition, body) {
|
|
73679
73732
|
const { type, wrappers } = unwrapType(config4, definition.type);
|
|
73680
73733
|
let result;
|
|
@@ -73683,7 +73736,7 @@ function tsTypeReference(config4, missingScalars, definition, body) {
|
|
|
73683
73736
|
} else if (graphql16.isEnumType(type)) {
|
|
73684
73737
|
result = enumReference(config4, body, type.name);
|
|
73685
73738
|
} else {
|
|
73686
|
-
result =
|
|
73739
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
73687
73740
|
}
|
|
73688
73741
|
for (const toWrap of wrappers) {
|
|
73689
73742
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -73691,7 +73744,7 @@ function tsTypeReference(config4, missingScalars, definition, body) {
|
|
|
73691
73744
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
73692
73745
|
result = nullableField(result, true);
|
|
73693
73746
|
} else if (toWrap === "List" /* List */) {
|
|
73694
|
-
result =
|
|
73747
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
73695
73748
|
}
|
|
73696
73749
|
}
|
|
73697
73750
|
return result;
|
|
@@ -73704,14 +73757,14 @@ function enumReference(config4, body, name) {
|
|
|
73704
73757
|
importKind: "type",
|
|
73705
73758
|
sourceModule: "$houdini/runtime/lib/types"
|
|
73706
73759
|
});
|
|
73707
|
-
return
|
|
73708
|
-
|
|
73709
|
-
|
|
73760
|
+
return AST8.tsTypeReference(
|
|
73761
|
+
AST8.identifier("ValueOf"),
|
|
73762
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
73710
73763
|
);
|
|
73711
73764
|
}
|
|
73712
73765
|
|
|
73713
73766
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
73714
|
-
var
|
|
73767
|
+
var AST9 = recast9.types.builders;
|
|
73715
73768
|
function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
73716
73769
|
const { type } = unwrapType(config4, rootType);
|
|
73717
73770
|
if (graphql17.isScalarType(type)) {
|
|
@@ -73738,20 +73791,20 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
73738
73791
|
for (const field of Object.values(type.getFields())) {
|
|
73739
73792
|
addReferencedInputTypes(config4, filepath, body, visitedTypes, missingScalars, field.type);
|
|
73740
73793
|
members.push(
|
|
73741
|
-
|
|
73742
|
-
|
|
73743
|
-
|
|
73794
|
+
AST9.tsPropertySignature(
|
|
73795
|
+
AST9.identifier(field.name),
|
|
73796
|
+
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field, body)),
|
|
73744
73797
|
graphql17.isNullableType(field.type)
|
|
73745
73798
|
)
|
|
73746
73799
|
);
|
|
73747
73800
|
}
|
|
73748
|
-
body.push(
|
|
73801
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
73749
73802
|
}
|
|
73750
73803
|
|
|
73751
73804
|
// src/codegen/generators/typescript/inlineType.ts
|
|
73752
73805
|
var graphql18 = __toESM(require_graphql2(), 1);
|
|
73753
|
-
var
|
|
73754
|
-
var
|
|
73806
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
73807
|
+
var AST10 = recast10.types.builders;
|
|
73755
73808
|
var fragmentKey2 = " $fragments";
|
|
73756
73809
|
function inlineType({
|
|
73757
73810
|
config: config4,
|
|
@@ -73849,7 +73902,7 @@ function inlineType({
|
|
|
73849
73902
|
{}
|
|
73850
73903
|
)
|
|
73851
73904
|
);
|
|
73852
|
-
result =
|
|
73905
|
+
result = AST10.tsTypeLiteral([
|
|
73853
73906
|
...fields.map((selection) => {
|
|
73854
73907
|
const { field } = selectionTypeInfo(config4.schema, filepath, rootObj, selection);
|
|
73855
73908
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -73877,12 +73930,12 @@ function inlineType({
|
|
|
73877
73930
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
73878
73931
|
).length > 0;
|
|
73879
73932
|
if (hasIncludeOrSkipDirective) {
|
|
73880
|
-
attributeType =
|
|
73933
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
73881
73934
|
}
|
|
73882
73935
|
const prop = readonlyProperty(
|
|
73883
|
-
|
|
73884
|
-
|
|
73885
|
-
|
|
73936
|
+
AST10.tsPropertySignature(
|
|
73937
|
+
AST10.identifier(attributeName),
|
|
73938
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
73886
73939
|
),
|
|
73887
73940
|
allowReadonly
|
|
73888
73941
|
);
|
|
@@ -73896,14 +73949,14 @@ function inlineType({
|
|
|
73896
73949
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
73897
73950
|
result.members.push(
|
|
73898
73951
|
readonlyProperty(
|
|
73899
|
-
|
|
73900
|
-
|
|
73901
|
-
|
|
73902
|
-
|
|
73952
|
+
AST10.tsPropertySignature(
|
|
73953
|
+
AST10.stringLiteral(fragmentKey2),
|
|
73954
|
+
AST10.tsTypeAnnotation(
|
|
73955
|
+
AST10.tsTypeLiteral(
|
|
73903
73956
|
(fragmentSpreads || []).map(
|
|
73904
|
-
(fragmentSpread) =>
|
|
73905
|
-
|
|
73906
|
-
|
|
73957
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
73958
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
73959
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
73907
73960
|
)
|
|
73908
73961
|
)
|
|
73909
73962
|
)
|
|
@@ -73948,9 +74001,9 @@ function inlineType({
|
|
|
73948
74001
|
}
|
|
73949
74002
|
objectType.members.push(
|
|
73950
74003
|
readonlyProperty(
|
|
73951
|
-
|
|
73952
|
-
|
|
73953
|
-
|
|
74004
|
+
AST10.tsPropertySignature(
|
|
74005
|
+
AST10.identifier("__typename"),
|
|
74006
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
73954
74007
|
),
|
|
73955
74008
|
allowReadonly
|
|
73956
74009
|
)
|
|
@@ -73990,8 +74043,8 @@ function inlineType({
|
|
|
73990
74043
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
73991
74044
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
73992
74045
|
([typeName, { type: type2, tsType }]) => {
|
|
73993
|
-
return
|
|
73994
|
-
|
|
74046
|
+
return AST10.tsParenthesizedType(
|
|
74047
|
+
AST10.tsIntersectionType(
|
|
73995
74048
|
[tsType].flatMap((type3) => {
|
|
73996
74049
|
if (type3.type === "TSUnionType") {
|
|
73997
74050
|
return type3.types.filter(
|
|
@@ -74017,14 +74070,14 @@ function inlineType({
|
|
|
74017
74070
|
);
|
|
74018
74071
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
74019
74072
|
selectionTypes.push(
|
|
74020
|
-
|
|
74021
|
-
|
|
74073
|
+
AST10.tsParenthesizedType(
|
|
74074
|
+
AST10.tsTypeLiteral([
|
|
74022
74075
|
readonlyProperty(
|
|
74023
|
-
|
|
74024
|
-
|
|
74025
|
-
|
|
74026
|
-
|
|
74027
|
-
|
|
74076
|
+
AST10.tsPropertySignature(
|
|
74077
|
+
AST10.identifier("__typename"),
|
|
74078
|
+
AST10.tsTypeAnnotation(
|
|
74079
|
+
AST10.tsLiteralType(
|
|
74080
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
74028
74081
|
)
|
|
74029
74082
|
)
|
|
74030
74083
|
),
|
|
@@ -74034,9 +74087,9 @@ function inlineType({
|
|
|
74034
74087
|
)
|
|
74035
74088
|
);
|
|
74036
74089
|
}
|
|
74037
|
-
result =
|
|
74090
|
+
result = AST10.tsIntersectionType([
|
|
74038
74091
|
result,
|
|
74039
|
-
|
|
74092
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
74040
74093
|
]);
|
|
74041
74094
|
}
|
|
74042
74095
|
} else {
|
|
@@ -74054,7 +74107,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
74054
74107
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
74055
74108
|
continue;
|
|
74056
74109
|
} else if (toWrap === "List" /* List */) {
|
|
74057
|
-
result =
|
|
74110
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
74058
74111
|
}
|
|
74059
74112
|
}
|
|
74060
74113
|
return result;
|
|
@@ -74099,13 +74152,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
74099
74152
|
}
|
|
74100
74153
|
|
|
74101
74154
|
// src/codegen/generators/typescript/loadingState.ts
|
|
74102
|
-
var
|
|
74103
|
-
var
|
|
74155
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
74156
|
+
var AST11 = recast11.types.builders;
|
|
74104
74157
|
function withLoadingState(args) {
|
|
74105
74158
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
74106
74159
|
return args.base;
|
|
74107
74160
|
}
|
|
74108
|
-
return
|
|
74161
|
+
return AST11.tsUnionType([
|
|
74109
74162
|
args.base,
|
|
74110
74163
|
loadingState({
|
|
74111
74164
|
parentType: args.document.artifact.rootType,
|
|
@@ -74124,7 +74177,7 @@ function loadingState(args) {
|
|
|
74124
74177
|
import: ["LoadingType"],
|
|
74125
74178
|
sourceModule: "$houdini/runtime/lib/types"
|
|
74126
74179
|
});
|
|
74127
|
-
const result =
|
|
74180
|
+
const result = AST11.tsTypeLiteral(
|
|
74128
74181
|
Object.entries(selection).reduce(
|
|
74129
74182
|
(rest, [attributeName, value]) => {
|
|
74130
74183
|
if (!value.loading) {
|
|
@@ -74132,7 +74185,7 @@ function loadingState(args) {
|
|
|
74132
74185
|
}
|
|
74133
74186
|
let keyType = null;
|
|
74134
74187
|
if (value.loading.kind === "value") {
|
|
74135
|
-
keyType =
|
|
74188
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
74136
74189
|
}
|
|
74137
74190
|
if (value.loading.kind === "continue" && value.selection) {
|
|
74138
74191
|
keyType = loadingState({
|
|
@@ -74148,15 +74201,15 @@ function loadingState(args) {
|
|
|
74148
74201
|
}
|
|
74149
74202
|
if (value.loading.list) {
|
|
74150
74203
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
74151
|
-
keyType =
|
|
74204
|
+
keyType = AST11.tsArrayType(keyType);
|
|
74152
74205
|
}
|
|
74153
74206
|
}
|
|
74154
74207
|
return [
|
|
74155
74208
|
...rest,
|
|
74156
74209
|
readonlyProperty(
|
|
74157
|
-
|
|
74158
|
-
|
|
74159
|
-
|
|
74210
|
+
AST11.tsPropertySignature(
|
|
74211
|
+
AST11.identifier(attributeName),
|
|
74212
|
+
AST11.tsTypeAnnotation(keyType)
|
|
74160
74213
|
)
|
|
74161
74214
|
)
|
|
74162
74215
|
];
|
|
@@ -74167,14 +74220,14 @@ function loadingState(args) {
|
|
|
74167
74220
|
if (args.selection.fragments) {
|
|
74168
74221
|
result.members.push(
|
|
74169
74222
|
readonlyProperty(
|
|
74170
|
-
|
|
74171
|
-
|
|
74172
|
-
|
|
74173
|
-
|
|
74223
|
+
AST11.tsPropertySignature(
|
|
74224
|
+
AST11.stringLiteral(fragmentKey),
|
|
74225
|
+
AST11.tsTypeAnnotation(
|
|
74226
|
+
AST11.tsTypeLiteral(
|
|
74174
74227
|
Object.keys(args.selection.fragments).map((name) => {
|
|
74175
|
-
return
|
|
74176
|
-
|
|
74177
|
-
|
|
74228
|
+
return AST11.tsPropertySignature(
|
|
74229
|
+
AST11.identifier(name),
|
|
74230
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
74178
74231
|
);
|
|
74179
74232
|
})
|
|
74180
74233
|
)
|
|
@@ -74187,7 +74240,7 @@ function loadingState(args) {
|
|
|
74187
74240
|
}
|
|
74188
74241
|
|
|
74189
74242
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
74190
|
-
var
|
|
74243
|
+
var AST12 = recast12.types.builders;
|
|
74191
74244
|
async function generateDocumentTypes(config4, docs) {
|
|
74192
74245
|
const typePaths = [];
|
|
74193
74246
|
const fragmentDefinitions = {};
|
|
@@ -74212,7 +74265,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
74212
74265
|
return;
|
|
74213
74266
|
}
|
|
74214
74267
|
const typeDefPath = config4.artifactTypePath(originalDocument);
|
|
74215
|
-
const program =
|
|
74268
|
+
const program = AST12.program([]);
|
|
74216
74269
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74217
74270
|
let definition = originalDocument.definitions.find(
|
|
74218
74271
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -74248,9 +74301,9 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
74248
74301
|
);
|
|
74249
74302
|
}
|
|
74250
74303
|
program.body.push(
|
|
74251
|
-
|
|
74252
|
-
|
|
74253
|
-
|
|
74304
|
+
AST12.exportNamedDeclaration(
|
|
74305
|
+
AST12.tsTypeAliasDeclaration(
|
|
74306
|
+
AST12.identifier(`${name}$artifact`),
|
|
74254
74307
|
convertToTs(serializeValue(artifact))
|
|
74255
74308
|
)
|
|
74256
74309
|
)
|
|
@@ -74260,17 +74313,17 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
74260
74313
|
typePaths.push(typeDefPath);
|
|
74261
74314
|
})
|
|
74262
74315
|
);
|
|
74263
|
-
const typeIndex =
|
|
74316
|
+
const typeIndex = AST12.program(
|
|
74264
74317
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
74265
|
-
return
|
|
74266
|
-
|
|
74318
|
+
return AST12.exportAllDeclaration(
|
|
74319
|
+
AST12.literal(
|
|
74267
74320
|
"./" + path_exports.relative(path_exports.resolve(config4.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
74268
74321
|
),
|
|
74269
74322
|
null
|
|
74270
74323
|
);
|
|
74271
74324
|
}).concat([
|
|
74272
|
-
|
|
74273
|
-
|
|
74325
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
74326
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
74274
74327
|
])
|
|
74275
74328
|
);
|
|
74276
74329
|
const exportDefaultAs = ({ module: module2, as }) => `
|
|
@@ -74325,7 +74378,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
74325
74378
|
}
|
|
74326
74379
|
function convertToTs(source) {
|
|
74327
74380
|
if (source.type === "ObjectExpression") {
|
|
74328
|
-
return
|
|
74381
|
+
return AST12.tsTypeLiteral(
|
|
74329
74382
|
source.properties.reduce(
|
|
74330
74383
|
(props, prop) => {
|
|
74331
74384
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -74333,9 +74386,9 @@ function convertToTs(source) {
|
|
|
74333
74386
|
}
|
|
74334
74387
|
return [
|
|
74335
74388
|
...props,
|
|
74336
|
-
|
|
74389
|
+
AST12.tsPropertySignature(
|
|
74337
74390
|
prop.key,
|
|
74338
|
-
|
|
74391
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
74339
74392
|
)
|
|
74340
74393
|
];
|
|
74341
74394
|
},
|
|
@@ -74344,20 +74397,20 @@ function convertToTs(source) {
|
|
|
74344
74397
|
);
|
|
74345
74398
|
}
|
|
74346
74399
|
if (source.type === "ArrayExpression") {
|
|
74347
|
-
return
|
|
74400
|
+
return AST12.tsTupleType(
|
|
74348
74401
|
source.elements.map((element) => convertToTs(element))
|
|
74349
74402
|
);
|
|
74350
74403
|
}
|
|
74351
74404
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
74352
|
-
return
|
|
74405
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
74353
74406
|
}
|
|
74354
74407
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
74355
|
-
return
|
|
74408
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
74356
74409
|
}
|
|
74357
74410
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
74358
|
-
return
|
|
74411
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
74359
74412
|
}
|
|
74360
|
-
return
|
|
74413
|
+
return AST12.tsLiteralType(source);
|
|
74361
74414
|
}
|
|
74362
74415
|
async function generateOperationTypeDefs(config4, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
74363
74416
|
let parentType = null;
|
|
@@ -74396,23 +74449,23 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74396
74449
|
});
|
|
74397
74450
|
}
|
|
74398
74451
|
body.push(
|
|
74399
|
-
|
|
74400
|
-
|
|
74401
|
-
|
|
74402
|
-
|
|
74452
|
+
AST12.exportNamedDeclaration(
|
|
74453
|
+
AST12.tsTypeAliasDeclaration(
|
|
74454
|
+
AST12.identifier(definition.name.value),
|
|
74455
|
+
AST12.tsTypeLiteral([
|
|
74403
74456
|
readonlyProperty(
|
|
74404
|
-
|
|
74405
|
-
|
|
74406
|
-
|
|
74457
|
+
AST12.tsPropertySignature(
|
|
74458
|
+
AST12.stringLiteral("input"),
|
|
74459
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
74407
74460
|
)
|
|
74408
74461
|
),
|
|
74409
74462
|
readonlyProperty(
|
|
74410
|
-
|
|
74411
|
-
|
|
74412
|
-
|
|
74413
|
-
definition.operation === "mutation" ?
|
|
74414
|
-
|
|
74415
|
-
|
|
74463
|
+
AST12.tsPropertySignature(
|
|
74464
|
+
AST12.stringLiteral("result"),
|
|
74465
|
+
AST12.tsTypeAnnotation(
|
|
74466
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
74467
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
74468
|
+
AST12.tsUndefinedKeyword()
|
|
74416
74469
|
])
|
|
74417
74470
|
)
|
|
74418
74471
|
)
|
|
@@ -74420,8 +74473,8 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74420
74473
|
])
|
|
74421
74474
|
)
|
|
74422
74475
|
),
|
|
74423
|
-
|
|
74424
|
-
|
|
74476
|
+
AST12.exportNamedDeclaration(
|
|
74477
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
74425
74478
|
)
|
|
74426
74479
|
);
|
|
74427
74480
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -74436,15 +74489,15 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74436
74489
|
);
|
|
74437
74490
|
}
|
|
74438
74491
|
body.push(
|
|
74439
|
-
|
|
74440
|
-
|
|
74441
|
-
|
|
74442
|
-
|
|
74492
|
+
AST12.exportNamedDeclaration(
|
|
74493
|
+
AST12.tsTypeAliasDeclaration(
|
|
74494
|
+
AST12.identifier(inputTypeName),
|
|
74495
|
+
AST12.tsTypeLiteral(
|
|
74443
74496
|
(definition.variableDefinitions || []).map(
|
|
74444
74497
|
(definition2) => {
|
|
74445
|
-
return
|
|
74446
|
-
|
|
74447
|
-
|
|
74498
|
+
return AST12.tsPropertySignature(
|
|
74499
|
+
AST12.identifier(definition2.variable.name.value),
|
|
74500
|
+
AST12.tsTypeAnnotation(
|
|
74448
74501
|
tsTypeReference(config4, missingScalars, definition2, body)
|
|
74449
74502
|
),
|
|
74450
74503
|
definition2.type.kind !== "NonNullType"
|
|
@@ -74457,16 +74510,16 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74457
74510
|
);
|
|
74458
74511
|
} else {
|
|
74459
74512
|
body.push(
|
|
74460
|
-
|
|
74461
|
-
|
|
74513
|
+
AST12.exportNamedDeclaration(
|
|
74514
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
74462
74515
|
)
|
|
74463
74516
|
);
|
|
74464
74517
|
}
|
|
74465
74518
|
if (definition.operation === "mutation") {
|
|
74466
74519
|
body.push(
|
|
74467
|
-
|
|
74468
|
-
|
|
74469
|
-
|
|
74520
|
+
AST12.exportNamedDeclaration(
|
|
74521
|
+
AST12.tsTypeAliasDeclaration(
|
|
74522
|
+
AST12.identifier(optimisticTypeName),
|
|
74470
74523
|
inlineType({
|
|
74471
74524
|
config: config4,
|
|
74472
74525
|
filepath,
|
|
@@ -74500,12 +74553,12 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74500
74553
|
let directive = definition.directives?.find(
|
|
74501
74554
|
(directive2) => directive2.name.value === config4.argumentsDirective
|
|
74502
74555
|
);
|
|
74503
|
-
let inputValue = !directive ?
|
|
74556
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
74504
74557
|
(fragmentArgumentsDefinitions(config4, filepath, definition) || []).map(
|
|
74505
74558
|
(definition2) => {
|
|
74506
|
-
return
|
|
74507
|
-
|
|
74508
|
-
|
|
74559
|
+
return AST12.tsPropertySignature(
|
|
74560
|
+
AST12.identifier(definition2.variable.name.value),
|
|
74561
|
+
AST12.tsTypeAnnotation(
|
|
74509
74562
|
tsTypeReference(config4, missingScalars, definition2, body)
|
|
74510
74563
|
),
|
|
74511
74564
|
definition2.type.kind !== "NonNullType"
|
|
@@ -74514,30 +74567,30 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74514
74567
|
)
|
|
74515
74568
|
);
|
|
74516
74569
|
body.push(
|
|
74517
|
-
|
|
74518
|
-
|
|
74570
|
+
AST12.exportNamedDeclaration(
|
|
74571
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
74519
74572
|
),
|
|
74520
|
-
|
|
74521
|
-
|
|
74522
|
-
|
|
74523
|
-
|
|
74573
|
+
AST12.exportNamedDeclaration(
|
|
74574
|
+
AST12.tsTypeAliasDeclaration(
|
|
74575
|
+
AST12.identifier(propTypeName),
|
|
74576
|
+
AST12.tsTypeLiteral([
|
|
74524
74577
|
readonlyProperty(
|
|
74525
|
-
|
|
74526
|
-
|
|
74527
|
-
|
|
74528
|
-
|
|
74578
|
+
AST12.tsPropertySignature(
|
|
74579
|
+
AST12.stringLiteral("shape"),
|
|
74580
|
+
AST12.tsTypeAnnotation(
|
|
74581
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
74529
74582
|
),
|
|
74530
74583
|
true
|
|
74531
74584
|
)
|
|
74532
74585
|
),
|
|
74533
74586
|
readonlyProperty(
|
|
74534
|
-
|
|
74535
|
-
|
|
74536
|
-
|
|
74537
|
-
|
|
74538
|
-
|
|
74539
|
-
|
|
74540
|
-
|
|
74587
|
+
AST12.tsPropertySignature(
|
|
74588
|
+
AST12.stringLiteral(fragmentKey2),
|
|
74589
|
+
AST12.tsTypeAnnotation(
|
|
74590
|
+
AST12.tsTypeLiteral([
|
|
74591
|
+
AST12.tsPropertySignature(
|
|
74592
|
+
AST12.stringLiteral(propTypeName),
|
|
74593
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
74541
74594
|
)
|
|
74542
74595
|
])
|
|
74543
74596
|
)
|
|
@@ -74546,9 +74599,9 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74546
74599
|
])
|
|
74547
74600
|
)
|
|
74548
74601
|
),
|
|
74549
|
-
|
|
74550
|
-
|
|
74551
|
-
|
|
74602
|
+
AST12.exportNamedDeclaration(
|
|
74603
|
+
AST12.tsTypeAliasDeclaration(
|
|
74604
|
+
AST12.identifier(shapeTypeName),
|
|
74552
74605
|
withLoadingState({
|
|
74553
74606
|
config: config4,
|
|
74554
74607
|
document,
|
|
@@ -74574,8 +74627,8 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74574
74627
|
|
|
74575
74628
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
74576
74629
|
var graphql19 = __toESM(require_graphql2(), 1);
|
|
74577
|
-
var
|
|
74578
|
-
var
|
|
74630
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
74631
|
+
var AST13 = recast13.types.builders;
|
|
74579
74632
|
async function imperativeCacheTypef(config4, docs) {
|
|
74580
74633
|
const returnType = (doc) => config4.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
74581
74634
|
config: config4,
|
|
@@ -74591,87 +74644,87 @@ async function imperativeCacheTypef(config4, docs) {
|
|
|
74591
74644
|
}) ?? "any";
|
|
74592
74645
|
const target = path_exports.join(config4.runtimeDirectory, "generated.d.ts");
|
|
74593
74646
|
const body = [];
|
|
74594
|
-
const declaration =
|
|
74595
|
-
|
|
74596
|
-
|
|
74597
|
-
|
|
74598
|
-
|
|
74599
|
-
|
|
74647
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
74648
|
+
AST13.identifier(CacheTypeDefName),
|
|
74649
|
+
AST13.tsTypeLiteral([
|
|
74650
|
+
AST13.tsPropertySignature(
|
|
74651
|
+
AST13.identifier("types"),
|
|
74652
|
+
AST13.tsTypeAnnotation(typeDefinitions(config4, body, docs, returnType))
|
|
74600
74653
|
),
|
|
74601
|
-
|
|
74602
|
-
|
|
74603
|
-
|
|
74654
|
+
AST13.tsPropertySignature(
|
|
74655
|
+
AST13.identifier("lists"),
|
|
74656
|
+
AST13.tsTypeAnnotation(listDefinitions(config4, body, docs))
|
|
74604
74657
|
),
|
|
74605
|
-
|
|
74606
|
-
|
|
74607
|
-
|
|
74658
|
+
AST13.tsPropertySignature(
|
|
74659
|
+
AST13.identifier("queries"),
|
|
74660
|
+
AST13.tsTypeAnnotation(queryDefinitions(config4, body, docs, returnType))
|
|
74608
74661
|
)
|
|
74609
74662
|
])
|
|
74610
74663
|
);
|
|
74611
74664
|
declaration.declare = true;
|
|
74612
|
-
const importRecord =
|
|
74613
|
-
[
|
|
74614
|
-
|
|
74665
|
+
const importRecord = AST13.importDeclaration(
|
|
74666
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
74667
|
+
AST13.stringLiteral("./public/record")
|
|
74615
74668
|
);
|
|
74616
74669
|
importRecord.importKind = "type";
|
|
74617
74670
|
await fs_exports.writeFile(
|
|
74618
74671
|
target,
|
|
74619
|
-
|
|
74620
|
-
|
|
74672
|
+
recast13.prettyPrint(
|
|
74673
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
74621
74674
|
).code
|
|
74622
74675
|
);
|
|
74623
74676
|
}
|
|
74624
74677
|
function typeDefinitions(config4, body, docs, returnType) {
|
|
74625
74678
|
const operationTypes = [config4.schema.getMutationType(), config4.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
74626
74679
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74627
|
-
const
|
|
74680
|
+
const types18 = Object.values(config4.schema.getTypeMap()).filter(
|
|
74628
74681
|
(type) => !graphql19.isAbstractType(type) && !graphql19.isScalarType(type) && !graphql19.isEnumType(type) && !graphql19.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
74629
74682
|
);
|
|
74630
74683
|
const fragmentMap = fragmentListMap(
|
|
74631
74684
|
config4,
|
|
74632
|
-
|
|
74685
|
+
types18.map((type) => type.name),
|
|
74633
74686
|
body,
|
|
74634
74687
|
docs,
|
|
74635
74688
|
returnType
|
|
74636
74689
|
);
|
|
74637
|
-
return
|
|
74638
|
-
|
|
74690
|
+
return AST13.tsTypeLiteral(
|
|
74691
|
+
types18.map((type) => {
|
|
74639
74692
|
let typeName = type.name;
|
|
74640
74693
|
if (config4.schema.getQueryType() && config4.schema.getQueryType()?.name === type.name) {
|
|
74641
74694
|
typeName = "__ROOT__";
|
|
74642
74695
|
}
|
|
74643
|
-
let idFields =
|
|
74696
|
+
let idFields = AST13.tsNeverKeyword();
|
|
74644
74697
|
const keys2 = keyFieldsForType(config4.configFile, type.name);
|
|
74645
74698
|
if (graphql19.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
74646
|
-
idFields =
|
|
74699
|
+
idFields = AST13.tsTypeLiteral(
|
|
74647
74700
|
keys2.map((key) => {
|
|
74648
74701
|
const fieldType = type.getFields()[key];
|
|
74649
74702
|
const unwrapped = unwrapType(config4, fieldType.type);
|
|
74650
|
-
return
|
|
74651
|
-
|
|
74652
|
-
|
|
74703
|
+
return AST13.tsPropertySignature(
|
|
74704
|
+
AST13.identifier(key),
|
|
74705
|
+
AST13.tsTypeAnnotation(
|
|
74653
74706
|
scalarPropertyValue(config4, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
74654
74707
|
)
|
|
74655
74708
|
);
|
|
74656
74709
|
})
|
|
74657
74710
|
);
|
|
74658
74711
|
} else if (typeName === "__ROOT__") {
|
|
74659
|
-
idFields =
|
|
74712
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
74660
74713
|
}
|
|
74661
|
-
let fields =
|
|
74714
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
74662
74715
|
if (graphql19.isObjectType(type)) {
|
|
74663
|
-
fields =
|
|
74716
|
+
fields = AST13.tsTypeLiteral(
|
|
74664
74717
|
Object.entries(type.getFields()).map(
|
|
74665
74718
|
([key, fieldType]) => {
|
|
74666
74719
|
const unwrapped = unwrapType(config4, fieldType.type);
|
|
74667
|
-
let typeOptions =
|
|
74720
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
74668
74721
|
if (graphql19.isScalarType(unwrapped.type)) {
|
|
74669
74722
|
typeOptions.types.push(
|
|
74670
74723
|
scalarPropertyValue(config4, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
74671
74724
|
);
|
|
74672
74725
|
} else if (graphql19.isEnumType(unwrapped.type)) {
|
|
74673
74726
|
typeOptions.types.push(
|
|
74674
|
-
|
|
74727
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
74675
74728
|
);
|
|
74676
74729
|
} else if (!graphql19.isAbstractType(unwrapped.type)) {
|
|
74677
74730
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -74682,21 +74735,21 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74682
74735
|
}
|
|
74683
74736
|
for (const wrapper of unwrapped.wrappers) {
|
|
74684
74737
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
74685
|
-
typeOptions =
|
|
74686
|
-
|
|
74738
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
74739
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
74687
74740
|
);
|
|
74688
74741
|
} else if (wrapper === "List" /* List */) {
|
|
74689
|
-
typeOptions =
|
|
74690
|
-
|
|
74742
|
+
typeOptions = AST13.tsArrayType(
|
|
74743
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
74691
74744
|
);
|
|
74692
74745
|
}
|
|
74693
74746
|
}
|
|
74694
74747
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
74695
74748
|
typeOptions = typeOptions.typeAnnotation;
|
|
74696
74749
|
}
|
|
74697
|
-
let args =
|
|
74750
|
+
let args = AST13.tsNeverKeyword();
|
|
74698
74751
|
if (fieldType.args?.length > 0) {
|
|
74699
|
-
args =
|
|
74752
|
+
args = AST13.tsTypeLiteral(
|
|
74700
74753
|
fieldType.args.map((arg) => {
|
|
74701
74754
|
addReferencedInputTypes(
|
|
74702
74755
|
config4,
|
|
@@ -74706,9 +74759,9 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74706
74759
|
/* @__PURE__ */ new Set(),
|
|
74707
74760
|
arg.type
|
|
74708
74761
|
);
|
|
74709
|
-
const prop =
|
|
74710
|
-
|
|
74711
|
-
|
|
74762
|
+
const prop = AST13.tsPropertySignature(
|
|
74763
|
+
AST13.identifier(arg.name),
|
|
74764
|
+
AST13.tsTypeAnnotation(
|
|
74712
74765
|
tsTypeReference(config4, /* @__PURE__ */ new Set(), arg, body)
|
|
74713
74766
|
)
|
|
74714
74767
|
);
|
|
@@ -74718,17 +74771,17 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74718
74771
|
})
|
|
74719
74772
|
);
|
|
74720
74773
|
}
|
|
74721
|
-
return
|
|
74722
|
-
|
|
74723
|
-
|
|
74724
|
-
|
|
74725
|
-
|
|
74726
|
-
|
|
74727
|
-
|
|
74774
|
+
return AST13.tsPropertySignature(
|
|
74775
|
+
AST13.identifier(key),
|
|
74776
|
+
AST13.tsTypeAnnotation(
|
|
74777
|
+
AST13.tsTypeLiteral([
|
|
74778
|
+
AST13.tsPropertySignature(
|
|
74779
|
+
AST13.identifier("type"),
|
|
74780
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
74728
74781
|
),
|
|
74729
|
-
|
|
74730
|
-
|
|
74731
|
-
|
|
74782
|
+
AST13.tsPropertySignature(
|
|
74783
|
+
AST13.identifier("args"),
|
|
74784
|
+
AST13.tsTypeAnnotation(args)
|
|
74732
74785
|
)
|
|
74733
74786
|
])
|
|
74734
74787
|
)
|
|
@@ -74737,21 +74790,21 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74737
74790
|
)
|
|
74738
74791
|
);
|
|
74739
74792
|
}
|
|
74740
|
-
return
|
|
74741
|
-
|
|
74742
|
-
|
|
74743
|
-
|
|
74744
|
-
|
|
74745
|
-
|
|
74746
|
-
|
|
74793
|
+
return AST13.tsPropertySignature(
|
|
74794
|
+
AST13.identifier(typeName),
|
|
74795
|
+
AST13.tsTypeAnnotation(
|
|
74796
|
+
AST13.tsTypeLiteral([
|
|
74797
|
+
AST13.tsPropertySignature(
|
|
74798
|
+
AST13.identifier("idFields"),
|
|
74799
|
+
AST13.tsTypeAnnotation(idFields)
|
|
74747
74800
|
),
|
|
74748
|
-
|
|
74749
|
-
|
|
74750
|
-
|
|
74801
|
+
AST13.tsPropertySignature(
|
|
74802
|
+
AST13.identifier("fields"),
|
|
74803
|
+
AST13.tsTypeAnnotation(fields)
|
|
74751
74804
|
),
|
|
74752
|
-
|
|
74753
|
-
|
|
74754
|
-
|
|
74805
|
+
AST13.tsPropertySignature(
|
|
74806
|
+
AST13.identifier("fragments"),
|
|
74807
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
74755
74808
|
)
|
|
74756
74809
|
])
|
|
74757
74810
|
)
|
|
@@ -74793,28 +74846,28 @@ function listDefinitions(config4, body, docs) {
|
|
|
74793
74846
|
possibleTypes.push(listType.name);
|
|
74794
74847
|
}
|
|
74795
74848
|
lists.push(
|
|
74796
|
-
|
|
74797
|
-
|
|
74798
|
-
|
|
74799
|
-
|
|
74800
|
-
|
|
74801
|
-
|
|
74802
|
-
|
|
74803
|
-
|
|
74849
|
+
AST13.tsPropertySignature(
|
|
74850
|
+
AST13.identifier(nameValue),
|
|
74851
|
+
AST13.tsTypeAnnotation(
|
|
74852
|
+
AST13.tsTypeLiteral([
|
|
74853
|
+
AST13.tsPropertySignature(
|
|
74854
|
+
AST13.identifier("types"),
|
|
74855
|
+
AST13.tsTypeAnnotation(
|
|
74856
|
+
AST13.tsUnionType(
|
|
74804
74857
|
possibleTypes.map(
|
|
74805
|
-
(possible) =>
|
|
74858
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
74806
74859
|
)
|
|
74807
74860
|
)
|
|
74808
74861
|
)
|
|
74809
74862
|
),
|
|
74810
|
-
|
|
74811
|
-
|
|
74812
|
-
|
|
74813
|
-
targetFieldDefinition.args.length === 0 ?
|
|
74863
|
+
AST13.tsPropertySignature(
|
|
74864
|
+
AST13.identifier("filters"),
|
|
74865
|
+
AST13.tsTypeAnnotation(
|
|
74866
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
74814
74867
|
targetFieldDefinition.args.map((arg) => {
|
|
74815
|
-
const argDef =
|
|
74816
|
-
|
|
74817
|
-
|
|
74868
|
+
const argDef = AST13.tsPropertySignature(
|
|
74869
|
+
AST13.identifier(arg.name),
|
|
74870
|
+
AST13.tsTypeAnnotation(
|
|
74818
74871
|
tsTypeReference(
|
|
74819
74872
|
config4,
|
|
74820
74873
|
/* @__PURE__ */ new Set(),
|
|
@@ -74836,10 +74889,10 @@ function listDefinitions(config4, body, docs) {
|
|
|
74836
74889
|
}
|
|
74837
74890
|
});
|
|
74838
74891
|
}
|
|
74839
|
-
return
|
|
74892
|
+
return AST13.tsTypeLiteral(lists);
|
|
74840
74893
|
}
|
|
74841
74894
|
function queryDefinitions(config4, body, docs, returnType) {
|
|
74842
|
-
return
|
|
74895
|
+
return AST13.tsTupleType(
|
|
74843
74896
|
docs.reduce((prev, doc) => {
|
|
74844
74897
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
74845
74898
|
return prev;
|
|
@@ -74861,10 +74914,10 @@ function queryDefinitions(config4, body, docs, returnType) {
|
|
|
74861
74914
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
74862
74915
|
});
|
|
74863
74916
|
return prev.concat(
|
|
74864
|
-
|
|
74865
|
-
|
|
74866
|
-
|
|
74867
|
-
|
|
74917
|
+
AST13.tsTupleType([
|
|
74918
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
74919
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
74920
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
74868
74921
|
])
|
|
74869
74922
|
);
|
|
74870
74923
|
}, [])
|
|
@@ -74893,13 +74946,13 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
74893
74946
|
),
|
|
74894
74947
|
import: [`${definition.name.value}$data`]
|
|
74895
74948
|
});
|
|
74896
|
-
let inputType =
|
|
74949
|
+
let inputType = AST13.tsNeverKeyword();
|
|
74897
74950
|
let directive = definition.directives?.find(
|
|
74898
74951
|
(directive2) => directive2.name.value === config4.argumentsDirective
|
|
74899
74952
|
);
|
|
74900
74953
|
if (directive) {
|
|
74901
|
-
inputType =
|
|
74902
|
-
|
|
74954
|
+
inputType = AST13.tsTypeReference(
|
|
74955
|
+
AST13.identifier(
|
|
74903
74956
|
ensureImports({
|
|
74904
74957
|
config: config4,
|
|
74905
74958
|
body,
|
|
@@ -74914,11 +74967,11 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
74914
74967
|
}
|
|
74915
74968
|
return {
|
|
74916
74969
|
...prev,
|
|
74917
|
-
[typeName]:
|
|
74970
|
+
[typeName]: AST13.tsTupleType(
|
|
74918
74971
|
previousValue.concat(
|
|
74919
|
-
|
|
74920
|
-
|
|
74921
|
-
|
|
74972
|
+
AST13.tsTupleType([
|
|
74973
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
74974
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
74922
74975
|
inputType
|
|
74923
74976
|
])
|
|
74924
74977
|
)
|
|
@@ -74928,11 +74981,11 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
74928
74981
|
}
|
|
74929
74982
|
var CacheTypeDefName = "CacheTypeDef";
|
|
74930
74983
|
function record(name) {
|
|
74931
|
-
return
|
|
74932
|
-
|
|
74933
|
-
|
|
74934
|
-
|
|
74935
|
-
|
|
74984
|
+
return AST13.tsTypeReference(
|
|
74985
|
+
AST13.identifier("Record"),
|
|
74986
|
+
AST13.tsTypeParameterInstantiation([
|
|
74987
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
74988
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
74936
74989
|
])
|
|
74937
74990
|
);
|
|
74938
74991
|
}
|
|
@@ -74985,25 +75038,25 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
74985
75038
|
|
|
74986
75039
|
// src/codegen/generators/definitions/enums.ts
|
|
74987
75040
|
var graphql21 = __toESM(require_graphql2(), 1);
|
|
74988
|
-
var
|
|
74989
|
-
var
|
|
75041
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
75042
|
+
var AST14 = recast14.types.builders;
|
|
74990
75043
|
async function definitionsGenerator(config4) {
|
|
74991
75044
|
const enums = graphql21.parse(graphql21.printSchema(config4.schema)).definitions.filter(
|
|
74992
75045
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
74993
75046
|
).filter((def) => !config4.isInternalEnum(def));
|
|
74994
75047
|
const { code: runtimeDefinitions } = await printJS(
|
|
74995
|
-
|
|
75048
|
+
AST14.program(
|
|
74996
75049
|
enums.map((defn) => {
|
|
74997
75050
|
const name = defn.name.value;
|
|
74998
75051
|
return moduleExport(
|
|
74999
75052
|
config4,
|
|
75000
75053
|
name,
|
|
75001
|
-
|
|
75054
|
+
AST14.objectExpression(
|
|
75002
75055
|
defn.values?.map((value) => {
|
|
75003
75056
|
const str = value.name.value;
|
|
75004
|
-
return
|
|
75005
|
-
|
|
75006
|
-
|
|
75057
|
+
return AST14.objectProperty(
|
|
75058
|
+
AST14.stringLiteral(str),
|
|
75059
|
+
AST14.stringLiteral(str)
|
|
75007
75060
|
);
|
|
75008
75061
|
}) || []
|
|
75009
75062
|
)
|
|
@@ -76767,8 +76820,8 @@ function find_exported_id(program, name) {
|
|
|
76767
76820
|
}
|
|
76768
76821
|
|
|
76769
76822
|
// src/vite/imports.ts
|
|
76770
|
-
var
|
|
76771
|
-
var
|
|
76823
|
+
var recast15 = __toESM(require_main2(), 1);
|
|
76824
|
+
var AST15 = recast15.types.builders;
|
|
76772
76825
|
function ensure_imports({
|
|
76773
76826
|
config: config4,
|
|
76774
76827
|
script,
|
|
@@ -76784,13 +76837,13 @@ function ensure_imports({
|
|
|
76784
76837
|
if (!has_import) {
|
|
76785
76838
|
script.body.unshift({
|
|
76786
76839
|
type: "ImportDeclaration",
|
|
76787
|
-
source:
|
|
76840
|
+
source: AST15.stringLiteral(sourceModule),
|
|
76788
76841
|
importKind
|
|
76789
76842
|
});
|
|
76790
76843
|
}
|
|
76791
76844
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
76792
76845
|
}
|
|
76793
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id) =>
|
|
76846
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id) => AST15.identifier(id));
|
|
76794
76847
|
const toImport = idList.filter(
|
|
76795
76848
|
(identifier) => !script.body.find(
|
|
76796
76849
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -76801,16 +76854,16 @@ function ensure_imports({
|
|
|
76801
76854
|
if (toImport.length > 0) {
|
|
76802
76855
|
script.body.unshift({
|
|
76803
76856
|
type: "ImportDeclaration",
|
|
76804
|
-
source:
|
|
76857
|
+
source: AST15.stringLiteral(sourceModule),
|
|
76805
76858
|
specifiers: toImport.map(
|
|
76806
|
-
(identifier, i2) => !Array.isArray(importID) ?
|
|
76859
|
+
(identifier, i2) => !Array.isArray(importID) ? AST15.importDefaultSpecifier(identifier) : AST15.importSpecifier(identifier, as?.[i2] ? AST15.identifier(as[i2]) : identifier)
|
|
76807
76860
|
),
|
|
76808
76861
|
importKind
|
|
76809
76862
|
});
|
|
76810
76863
|
}
|
|
76811
76864
|
for (const [i2, target] of (as ?? []).entries()) {
|
|
76812
76865
|
if (target) {
|
|
76813
|
-
idList[i2] =
|
|
76866
|
+
idList[i2] = AST15.identifier(target);
|
|
76814
76867
|
}
|
|
76815
76868
|
}
|
|
76816
76869
|
return {
|