houdini 1.2.26 → 1.2.28
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/adapter/index.d.ts +1 -1
- package/build/cmd-cjs/index.js +4169 -1854
- package/build/cmd-esm/index.js +4169 -1854
- package/build/codegen/generators/artifacts/selection.d.ts +2 -1
- package/build/codegen/generators/typescript/inlineType.d.ts +5 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
- package/build/codegen/generators/typescript/types.d.ts +6 -3
- package/build/codegen/transforms/collectDefinitions.d.ts +1 -1
- package/build/codegen/transforms/componentFields.d.ts +8 -0
- package/build/codegen/transforms/fragmentVariables.d.ts +1 -1
- package/build/codegen/transforms/index.d.ts +1 -0
- package/build/codegen/validators/componentFields.d.ts +2 -0
- package/build/codegen/validators/index.d.ts +1 -0
- package/build/codegen-cjs/index.js +3674 -1393
- package/build/codegen-esm/index.js +3674 -1393
- package/build/lib/config.d.ts +21 -1
- package/build/lib/detectTools.d.ts +1 -1
- package/build/lib/graphql.d.ts +6 -0
- package/build/lib/imports.d.ts +1 -1
- package/build/lib/router/conventions.d.ts +1 -0
- package/build/lib/types.d.ts +4 -2
- package/build/lib/walk.d.ts +1 -0
- package/build/lib-cjs/index.js +1120 -747
- package/build/lib-esm/index.js +1119 -747
- package/build/runtime/cache/cache.d.ts +24 -3
- package/build/runtime/cache/storage.d.ts +1 -1
- package/build/runtime/client/index.d.ts +1 -0
- package/build/runtime/index.d.ts +1 -1
- package/build/runtime/lib/config.d.ts +9 -0
- package/build/runtime/lib/index.d.ts +1 -0
- package/build/runtime/lib/types.d.ts +18 -1
- package/build/runtime/router/server.d.ts +3 -1
- package/build/runtime/router/types.d.ts +1 -0
- package/build/runtime-cjs/cache/cache.d.ts +24 -3
- package/build/runtime-cjs/cache/cache.js +78 -8
- package/build/runtime-cjs/cache/storage.d.ts +1 -1
- package/build/runtime-cjs/cache/storage.js +16 -3
- package/build/runtime-cjs/client/index.d.ts +1 -0
- package/build/runtime-cjs/client/index.js +1 -0
- package/build/runtime-cjs/index.d.ts +1 -1
- package/build/runtime-cjs/lib/config.d.ts +9 -0
- package/build/runtime-cjs/lib/index.d.ts +1 -0
- package/build/runtime-cjs/lib/index.js +1 -0
- package/build/runtime-cjs/lib/types.d.ts +18 -1
- package/build/runtime-cjs/public/cache.js +3 -2
- package/build/runtime-cjs/router/server.d.ts +3 -1
- package/build/runtime-cjs/router/server.js +5 -2
- package/build/runtime-cjs/router/session.js +9 -6
- package/build/runtime-cjs/router/types.d.ts +1 -0
- package/build/runtime-esm/cache/cache.d.ts +24 -3
- package/build/runtime-esm/cache/cache.js +76 -8
- package/build/runtime-esm/cache/storage.d.ts +1 -1
- package/build/runtime-esm/cache/storage.js +16 -3
- package/build/runtime-esm/client/index.d.ts +1 -0
- package/build/runtime-esm/client/index.js +1 -0
- package/build/runtime-esm/index.d.ts +1 -1
- package/build/runtime-esm/lib/config.d.ts +9 -0
- package/build/runtime-esm/lib/index.d.ts +1 -0
- package/build/runtime-esm/lib/index.js +1 -0
- package/build/runtime-esm/lib/types.d.ts +18 -1
- package/build/runtime-esm/public/cache.js +3 -2
- package/build/runtime-esm/router/server.d.ts +3 -1
- package/build/runtime-esm/router/server.js +5 -2
- package/build/runtime-esm/router/session.js +9 -6
- package/build/runtime-esm/router/types.d.ts +1 -0
- package/build/test-cjs/index.js +3556 -1373
- package/build/test-esm/index.js +3556 -1373
- package/build/vite/schema.d.ts +4 -1
- package/build/vite-cjs/index.js +4543 -2823
- package/build/vite-esm/index.js +4540 -2822
- package/package.json +4 -3
package/build/lib-cjs/index.js
CHANGED
|
@@ -28112,11 +28112,11 @@ var require_types = __commonJS({
|
|
|
28112
28112
|
}();
|
|
28113
28113
|
exports.Def = Def;
|
|
28114
28114
|
var Field = function() {
|
|
28115
|
-
function Field2(name, type, defaultFn,
|
|
28115
|
+
function Field2(name, type, defaultFn, hidden3) {
|
|
28116
28116
|
this.name = name;
|
|
28117
28117
|
this.type = type;
|
|
28118
28118
|
this.defaultFn = defaultFn;
|
|
28119
|
-
this.hidden = !!
|
|
28119
|
+
this.hidden = !!hidden3;
|
|
28120
28120
|
}
|
|
28121
28121
|
Field2.prototype.toString = function() {
|
|
28122
28122
|
return JSON.stringify(this.name) + ": " + this.type;
|
|
@@ -28365,12 +28365,12 @@ var require_types = __commonJS({
|
|
|
28365
28365
|
});
|
|
28366
28366
|
return this;
|
|
28367
28367
|
};
|
|
28368
|
-
DefImpl2.prototype.field = function(name, type, defaultFn,
|
|
28368
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden3) {
|
|
28369
28369
|
if (this.finalized) {
|
|
28370
28370
|
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
28371
28371
|
return this;
|
|
28372
28372
|
}
|
|
28373
|
-
this.ownFields[name] = new Field(name, Type.from(type), defaultFn,
|
|
28373
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden3);
|
|
28374
28374
|
return this;
|
|
28375
28375
|
};
|
|
28376
28376
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -29750,7 +29750,7 @@ var require_path_visitor = __commonJS({
|
|
|
29750
29750
|
return Context;
|
|
29751
29751
|
}
|
|
29752
29752
|
var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null);
|
|
29753
|
-
sharedContextProtoMethods.reset = function
|
|
29753
|
+
sharedContextProtoMethods.reset = function reset3(path3) {
|
|
29754
29754
|
if (!(this instanceof this.Context)) {
|
|
29755
29755
|
throw new Error("");
|
|
29756
29756
|
}
|
|
@@ -39308,13 +39308,13 @@ var require_esprima2 = __commonJS({
|
|
|
39308
39308
|
return Reader2;
|
|
39309
39309
|
}();
|
|
39310
39310
|
var Tokenizer = function() {
|
|
39311
|
-
function Tokenizer2(code,
|
|
39311
|
+
function Tokenizer2(code, config) {
|
|
39312
39312
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
39313
|
-
this.errorHandler.tolerant =
|
|
39313
|
+
this.errorHandler.tolerant = config ? typeof config.tolerant === "boolean" && config.tolerant : false;
|
|
39314
39314
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
39315
|
-
this.scanner.trackComment =
|
|
39316
|
-
this.trackRange =
|
|
39317
|
-
this.trackLoc =
|
|
39315
|
+
this.scanner.trackComment = config ? typeof config.comment === "boolean" && config.comment : false;
|
|
39316
|
+
this.trackRange = config ? typeof config.range === "boolean" && config.range : false;
|
|
39317
|
+
this.trackLoc = config ? typeof config.loc === "boolean" && config.loc : false;
|
|
39318
39318
|
this.buffer = [];
|
|
39319
39319
|
this.reader = new Reader();
|
|
39320
39320
|
}
|
|
@@ -40455,12 +40455,12 @@ var require_comments = __commonJS({
|
|
|
40455
40455
|
comment.trailing = true;
|
|
40456
40456
|
addCommentHelper(node, comment);
|
|
40457
40457
|
}
|
|
40458
|
-
function printLeadingComment(commentPath,
|
|
40458
|
+
function printLeadingComment(commentPath, print6) {
|
|
40459
40459
|
var comment = commentPath.getValue();
|
|
40460
40460
|
n.Comment.assert(comment);
|
|
40461
40461
|
var loc = comment.loc;
|
|
40462
40462
|
var lines = loc && loc.lines;
|
|
40463
|
-
var parts = [
|
|
40463
|
+
var parts = [print6(commentPath)];
|
|
40464
40464
|
if (comment.trailing) {
|
|
40465
40465
|
parts.push("\n");
|
|
40466
40466
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -40475,7 +40475,7 @@ var require_comments = __commonJS({
|
|
|
40475
40475
|
}
|
|
40476
40476
|
return (0, lines_1.concat)(parts);
|
|
40477
40477
|
}
|
|
40478
|
-
function printTrailingComment(commentPath,
|
|
40478
|
+
function printTrailingComment(commentPath, print6) {
|
|
40479
40479
|
var comment = commentPath.getValue(commentPath);
|
|
40480
40480
|
n.Comment.assert(comment);
|
|
40481
40481
|
var loc = comment.loc;
|
|
@@ -40490,12 +40490,12 @@ var require_comments = __commonJS({
|
|
|
40490
40490
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
40491
40491
|
}
|
|
40492
40492
|
}
|
|
40493
|
-
parts.push(
|
|
40493
|
+
parts.push(print6(commentPath));
|
|
40494
40494
|
return (0, lines_1.concat)(parts);
|
|
40495
40495
|
}
|
|
40496
|
-
function printComments(path3,
|
|
40496
|
+
function printComments(path3, print6) {
|
|
40497
40497
|
var value = path3.getValue();
|
|
40498
|
-
var innerLines =
|
|
40498
|
+
var innerLines = print6(path3);
|
|
40499
40499
|
var comments = n.Node.check(value) && types4.getFieldValue(value, "comments");
|
|
40500
40500
|
if (!comments || comments.length === 0) {
|
|
40501
40501
|
return innerLines;
|
|
@@ -40507,9 +40507,9 @@ var require_comments = __commonJS({
|
|
|
40507
40507
|
var leading = types4.getFieldValue(comment, "leading");
|
|
40508
40508
|
var trailing = types4.getFieldValue(comment, "trailing");
|
|
40509
40509
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
40510
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
40510
|
+
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
40511
40511
|
} else if (trailing) {
|
|
40512
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
40512
|
+
trailingParts.push(printTrailingComment(commentPath, print6));
|
|
40513
40513
|
}
|
|
40514
40514
|
}, "comments");
|
|
40515
40515
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -41200,7 +41200,7 @@ var require_patcher = __commonJS({
|
|
|
41200
41200
|
};
|
|
41201
41201
|
exports.Patcher = Patcher;
|
|
41202
41202
|
var Pp = Patcher.prototype;
|
|
41203
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
41203
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print6) {
|
|
41204
41204
|
var patcher = this;
|
|
41205
41205
|
if (!newNode.comments && !oldNode.comments) {
|
|
41206
41206
|
return true;
|
|
@@ -41217,7 +41217,7 @@ var require_patcher = __commonJS({
|
|
|
41217
41217
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
41218
41218
|
patcher.replace(
|
|
41219
41219
|
oldComment.loc,
|
|
41220
|
-
|
|
41220
|
+
print6(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
41221
41221
|
);
|
|
41222
41222
|
});
|
|
41223
41223
|
}
|
|
@@ -41264,17 +41264,17 @@ var require_patcher = __commonJS({
|
|
|
41264
41264
|
var reprints = [];
|
|
41265
41265
|
if (!lines || !findReprints(path3, reprints))
|
|
41266
41266
|
return;
|
|
41267
|
-
return function(
|
|
41267
|
+
return function(print6) {
|
|
41268
41268
|
var patcher = new Patcher(lines);
|
|
41269
41269
|
reprints.forEach(function(reprint) {
|
|
41270
41270
|
var newNode = reprint.newPath.getValue();
|
|
41271
41271
|
var oldNode = reprint.oldPath.getValue();
|
|
41272
41272
|
SourceLocation.assert(oldNode.loc, true);
|
|
41273
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
41273
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print6);
|
|
41274
41274
|
if (needToPrintNewPathWithComments) {
|
|
41275
41275
|
patcher.deleteComments(oldNode);
|
|
41276
41276
|
}
|
|
41277
|
-
var newLines =
|
|
41277
|
+
var newLines = print6(reprint.newPath, {
|
|
41278
41278
|
includeComments: needToPrintNewPathWithComments,
|
|
41279
41279
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
41280
41280
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -41483,18 +41483,18 @@ var require_printer = __commonJS({
|
|
|
41483
41483
|
return this.code;
|
|
41484
41484
|
};
|
|
41485
41485
|
var emptyPrintResult = new PrintResult("");
|
|
41486
|
-
var Printer = function Printer2(
|
|
41486
|
+
var Printer = function Printer2(config) {
|
|
41487
41487
|
assert_1.default.ok(this instanceof Printer2);
|
|
41488
|
-
var explicitTabWidth =
|
|
41489
|
-
|
|
41490
|
-
|
|
41488
|
+
var explicitTabWidth = config && config.tabWidth;
|
|
41489
|
+
config = (0, options_1.normalize)(config);
|
|
41490
|
+
config.sourceFileName = null;
|
|
41491
41491
|
function makePrintFunctionWith(options, overrides) {
|
|
41492
41492
|
options = Object.assign({}, options, overrides);
|
|
41493
41493
|
return function(path3) {
|
|
41494
|
-
return
|
|
41494
|
+
return print6(path3, options);
|
|
41495
41495
|
};
|
|
41496
41496
|
}
|
|
41497
|
-
function
|
|
41497
|
+
function print6(path3, options) {
|
|
41498
41498
|
assert_1.default.ok(path3 instanceof fast_path_1.default);
|
|
41499
41499
|
options = options || {};
|
|
41500
41500
|
if (options.includeComments) {
|
|
@@ -41502,30 +41502,30 @@ var require_printer = __commonJS({
|
|
|
41502
41502
|
includeComments: false
|
|
41503
41503
|
}));
|
|
41504
41504
|
}
|
|
41505
|
-
var oldTabWidth =
|
|
41505
|
+
var oldTabWidth = config.tabWidth;
|
|
41506
41506
|
if (!explicitTabWidth) {
|
|
41507
41507
|
var loc = path3.getNode().loc;
|
|
41508
41508
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
41509
|
-
|
|
41509
|
+
config.tabWidth = loc.lines.guessTabWidth();
|
|
41510
41510
|
}
|
|
41511
41511
|
}
|
|
41512
41512
|
var reprinter = (0, patcher_1.getReprinter)(path3);
|
|
41513
|
-
var lines = reprinter ? reprinter(
|
|
41513
|
+
var lines = reprinter ? reprinter(print6) : genericPrint(path3, config, options, makePrintFunctionWith(options, {
|
|
41514
41514
|
includeComments: true,
|
|
41515
41515
|
avoidRootParens: false
|
|
41516
41516
|
}));
|
|
41517
|
-
|
|
41517
|
+
config.tabWidth = oldTabWidth;
|
|
41518
41518
|
return lines;
|
|
41519
41519
|
}
|
|
41520
41520
|
this.print = function(ast) {
|
|
41521
41521
|
if (!ast) {
|
|
41522
41522
|
return emptyPrintResult;
|
|
41523
41523
|
}
|
|
41524
|
-
var lines =
|
|
41524
|
+
var lines = print6(fast_path_1.default.from(ast), {
|
|
41525
41525
|
includeComments: true,
|
|
41526
41526
|
avoidRootParens: false
|
|
41527
41527
|
});
|
|
41528
|
-
return new PrintResult(lines.toString(
|
|
41528
|
+
return new PrintResult(lines.toString(config), util.composeSourceMaps(config.inputSourceMap, lines.getSourceMap(config.sourceMapName, config.sourceRoot)));
|
|
41529
41529
|
};
|
|
41530
41530
|
this.printGenerically = function(ast) {
|
|
41531
41531
|
if (!ast) {
|
|
@@ -41533,26 +41533,26 @@ var require_printer = __commonJS({
|
|
|
41533
41533
|
}
|
|
41534
41534
|
function printGenerically(path4) {
|
|
41535
41535
|
return (0, comments_1.printComments)(path4, function(path5) {
|
|
41536
|
-
return genericPrint(path5,
|
|
41536
|
+
return genericPrint(path5, config, {
|
|
41537
41537
|
includeComments: true,
|
|
41538
41538
|
avoidRootParens: false
|
|
41539
41539
|
}, printGenerically);
|
|
41540
41540
|
});
|
|
41541
41541
|
}
|
|
41542
41542
|
var path3 = fast_path_1.default.from(ast);
|
|
41543
|
-
var oldReuseWhitespace =
|
|
41544
|
-
|
|
41545
|
-
var pr = new PrintResult(printGenerically(path3).toString(
|
|
41546
|
-
|
|
41543
|
+
var oldReuseWhitespace = config.reuseWhitespace;
|
|
41544
|
+
config.reuseWhitespace = false;
|
|
41545
|
+
var pr = new PrintResult(printGenerically(path3).toString(config));
|
|
41546
|
+
config.reuseWhitespace = oldReuseWhitespace;
|
|
41547
41547
|
return pr;
|
|
41548
41548
|
};
|
|
41549
41549
|
};
|
|
41550
41550
|
exports.Printer = Printer;
|
|
41551
|
-
function genericPrint(path3,
|
|
41551
|
+
function genericPrint(path3, config, options, printPath) {
|
|
41552
41552
|
assert_1.default.ok(path3 instanceof fast_path_1.default);
|
|
41553
41553
|
var node = path3.getValue();
|
|
41554
41554
|
var parts = [];
|
|
41555
|
-
var linesWithoutParens = genericPrintNoParens(path3,
|
|
41555
|
+
var linesWithoutParens = genericPrintNoParens(path3, config, printPath);
|
|
41556
41556
|
if (!node || linesWithoutParens.isEmpty()) {
|
|
41557
41557
|
return linesWithoutParens;
|
|
41558
41558
|
}
|
|
@@ -41574,7 +41574,7 @@ var require_printer = __commonJS({
|
|
|
41574
41574
|
}
|
|
41575
41575
|
return (0, lines_1.concat)(parts);
|
|
41576
41576
|
}
|
|
41577
|
-
function genericPrintNoParens(path3, options,
|
|
41577
|
+
function genericPrintNoParens(path3, options, print6) {
|
|
41578
41578
|
var n = path3.getValue();
|
|
41579
41579
|
if (!n) {
|
|
41580
41580
|
return (0, lines_1.fromString)("");
|
|
@@ -41586,45 +41586,45 @@ var require_printer = __commonJS({
|
|
|
41586
41586
|
var parts = [];
|
|
41587
41587
|
switch (n.type) {
|
|
41588
41588
|
case "File":
|
|
41589
|
-
return path3.call(
|
|
41589
|
+
return path3.call(print6, "program");
|
|
41590
41590
|
case "Program":
|
|
41591
41591
|
if (n.directives) {
|
|
41592
41592
|
path3.each(function(childPath) {
|
|
41593
|
-
parts.push(
|
|
41593
|
+
parts.push(print6(childPath), ";\n");
|
|
41594
41594
|
}, "directives");
|
|
41595
41595
|
}
|
|
41596
41596
|
if (n.interpreter) {
|
|
41597
|
-
parts.push(path3.call(
|
|
41597
|
+
parts.push(path3.call(print6, "interpreter"));
|
|
41598
41598
|
}
|
|
41599
41599
|
parts.push(path3.call(function(bodyPath) {
|
|
41600
|
-
return printStatementSequence(bodyPath, options,
|
|
41600
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
41601
41601
|
}, "body"));
|
|
41602
41602
|
return (0, lines_1.concat)(parts);
|
|
41603
41603
|
case "Noop":
|
|
41604
41604
|
case "EmptyStatement":
|
|
41605
41605
|
return (0, lines_1.fromString)("");
|
|
41606
41606
|
case "ExpressionStatement":
|
|
41607
|
-
return (0, lines_1.concat)([path3.call(
|
|
41607
|
+
return (0, lines_1.concat)([path3.call(print6, "expression"), ";"]);
|
|
41608
41608
|
case "ParenthesizedExpression":
|
|
41609
|
-
return (0, lines_1.concat)(["(", path3.call(
|
|
41609
|
+
return (0, lines_1.concat)(["(", path3.call(print6, "expression"), ")"]);
|
|
41610
41610
|
case "BinaryExpression":
|
|
41611
41611
|
case "LogicalExpression":
|
|
41612
41612
|
case "AssignmentExpression":
|
|
41613
41613
|
return (0, lines_1.fromString)(" ").join([
|
|
41614
|
-
path3.call(
|
|
41614
|
+
path3.call(print6, "left"),
|
|
41615
41615
|
n.operator,
|
|
41616
|
-
path3.call(
|
|
41616
|
+
path3.call(print6, "right")
|
|
41617
41617
|
]);
|
|
41618
41618
|
case "AssignmentPattern":
|
|
41619
41619
|
return (0, lines_1.concat)([
|
|
41620
|
-
path3.call(
|
|
41620
|
+
path3.call(print6, "left"),
|
|
41621
41621
|
" = ",
|
|
41622
|
-
path3.call(
|
|
41622
|
+
path3.call(print6, "right")
|
|
41623
41623
|
]);
|
|
41624
41624
|
case "MemberExpression":
|
|
41625
41625
|
case "OptionalMemberExpression": {
|
|
41626
|
-
parts.push(path3.call(
|
|
41627
|
-
var property = path3.call(
|
|
41626
|
+
parts.push(path3.call(print6, "object"));
|
|
41627
|
+
var property = path3.call(print6, "property");
|
|
41628
41628
|
var optional = types4.getFieldValue(n, "optional");
|
|
41629
41629
|
if (n.computed) {
|
|
41630
41630
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -41634,18 +41634,18 @@ var require_printer = __commonJS({
|
|
|
41634
41634
|
return (0, lines_1.concat)(parts);
|
|
41635
41635
|
}
|
|
41636
41636
|
case "ChainExpression":
|
|
41637
|
-
return path3.call(
|
|
41637
|
+
return path3.call(print6, "expression");
|
|
41638
41638
|
case "MetaProperty":
|
|
41639
41639
|
return (0, lines_1.concat)([
|
|
41640
|
-
path3.call(
|
|
41640
|
+
path3.call(print6, "meta"),
|
|
41641
41641
|
".",
|
|
41642
|
-
path3.call(
|
|
41642
|
+
path3.call(print6, "property")
|
|
41643
41643
|
]);
|
|
41644
41644
|
case "BindExpression":
|
|
41645
41645
|
if (n.object) {
|
|
41646
|
-
parts.push(path3.call(
|
|
41646
|
+
parts.push(path3.call(print6, "object"));
|
|
41647
41647
|
}
|
|
41648
|
-
parts.push("::", path3.call(
|
|
41648
|
+
parts.push("::", path3.call(print6, "callee"));
|
|
41649
41649
|
return (0, lines_1.concat)(parts);
|
|
41650
41650
|
case "Path":
|
|
41651
41651
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -41653,7 +41653,7 @@ var require_printer = __commonJS({
|
|
|
41653
41653
|
return (0, lines_1.concat)([
|
|
41654
41654
|
(0, lines_1.fromString)(n.name, options),
|
|
41655
41655
|
n.optional ? "?" : "",
|
|
41656
|
-
path3.call(
|
|
41656
|
+
path3.call(print6, "typeAnnotation")
|
|
41657
41657
|
]);
|
|
41658
41658
|
case "SpreadElement":
|
|
41659
41659
|
case "SpreadElementPattern":
|
|
@@ -41664,8 +41664,8 @@ var require_printer = __commonJS({
|
|
|
41664
41664
|
case "RestElement":
|
|
41665
41665
|
return (0, lines_1.concat)([
|
|
41666
41666
|
"...",
|
|
41667
|
-
path3.call(
|
|
41668
|
-
path3.call(
|
|
41667
|
+
path3.call(print6, "argument"),
|
|
41668
|
+
path3.call(print6, "typeAnnotation")
|
|
41669
41669
|
]);
|
|
41670
41670
|
case "FunctionDeclaration":
|
|
41671
41671
|
case "FunctionExpression":
|
|
@@ -41680,15 +41680,15 @@ var require_printer = __commonJS({
|
|
|
41680
41680
|
if (n.generator)
|
|
41681
41681
|
parts.push("*");
|
|
41682
41682
|
if (n.id) {
|
|
41683
|
-
parts.push(" ", path3.call(
|
|
41683
|
+
parts.push(" ", path3.call(print6, "id"), path3.call(print6, "typeParameters"));
|
|
41684
41684
|
} else {
|
|
41685
41685
|
if (n.typeParameters) {
|
|
41686
|
-
parts.push(path3.call(
|
|
41686
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
41687
41687
|
}
|
|
41688
41688
|
}
|
|
41689
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
41689
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
41690
41690
|
if (n.body) {
|
|
41691
|
-
parts.push(" ", path3.call(
|
|
41691
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
41692
41692
|
}
|
|
41693
41693
|
return (0, lines_1.concat)(parts);
|
|
41694
41694
|
case "ArrowFunctionExpression":
|
|
@@ -41696,44 +41696,44 @@ var require_printer = __commonJS({
|
|
|
41696
41696
|
parts.push("async ");
|
|
41697
41697
|
}
|
|
41698
41698
|
if (n.typeParameters) {
|
|
41699
|
-
parts.push(path3.call(
|
|
41699
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
41700
41700
|
}
|
|
41701
41701
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
41702
|
-
parts.push(path3.call(
|
|
41702
|
+
parts.push(path3.call(print6, "params", 0));
|
|
41703
41703
|
} else {
|
|
41704
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
41704
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
41705
41705
|
}
|
|
41706
|
-
parts.push(" => ", path3.call(
|
|
41706
|
+
parts.push(" => ", path3.call(print6, "body"));
|
|
41707
41707
|
return (0, lines_1.concat)(parts);
|
|
41708
41708
|
case "MethodDefinition":
|
|
41709
|
-
return printMethod(path3, options,
|
|
41709
|
+
return printMethod(path3, options, print6);
|
|
41710
41710
|
case "YieldExpression":
|
|
41711
41711
|
parts.push("yield");
|
|
41712
41712
|
if (n.delegate)
|
|
41713
41713
|
parts.push("*");
|
|
41714
41714
|
if (n.argument)
|
|
41715
|
-
parts.push(" ", path3.call(
|
|
41715
|
+
parts.push(" ", path3.call(print6, "argument"));
|
|
41716
41716
|
return (0, lines_1.concat)(parts);
|
|
41717
41717
|
case "AwaitExpression":
|
|
41718
41718
|
parts.push("await");
|
|
41719
41719
|
if (n.all)
|
|
41720
41720
|
parts.push("*");
|
|
41721
41721
|
if (n.argument)
|
|
41722
|
-
parts.push(" ", path3.call(
|
|
41722
|
+
parts.push(" ", path3.call(print6, "argument"));
|
|
41723
41723
|
return (0, lines_1.concat)(parts);
|
|
41724
41724
|
case "ModuleExpression":
|
|
41725
41725
|
return (0, lines_1.concat)([
|
|
41726
41726
|
"module {\n",
|
|
41727
|
-
path3.call(
|
|
41727
|
+
path3.call(print6, "body").indent(options.tabWidth),
|
|
41728
41728
|
"\n}"
|
|
41729
41729
|
]);
|
|
41730
41730
|
case "ModuleDeclaration":
|
|
41731
|
-
parts.push("module", path3.call(
|
|
41731
|
+
parts.push("module", path3.call(print6, "id"));
|
|
41732
41732
|
if (n.source) {
|
|
41733
41733
|
assert_1.default.ok(!n.body);
|
|
41734
|
-
parts.push("from", path3.call(
|
|
41734
|
+
parts.push("from", path3.call(print6, "source"));
|
|
41735
41735
|
} else {
|
|
41736
|
-
parts.push(path3.call(
|
|
41736
|
+
parts.push(path3.call(print6, "body"));
|
|
41737
41737
|
}
|
|
41738
41738
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
41739
41739
|
case "ImportSpecifier":
|
|
@@ -41741,27 +41741,27 @@ var require_printer = __commonJS({
|
|
|
41741
41741
|
parts.push(n.importKind + " ");
|
|
41742
41742
|
}
|
|
41743
41743
|
if (n.imported) {
|
|
41744
|
-
parts.push(path3.call(
|
|
41744
|
+
parts.push(path3.call(print6, "imported"));
|
|
41745
41745
|
if (n.local && n.local.name !== n.imported.name) {
|
|
41746
|
-
parts.push(" as ", path3.call(
|
|
41746
|
+
parts.push(" as ", path3.call(print6, "local"));
|
|
41747
41747
|
}
|
|
41748
41748
|
} else if (n.id) {
|
|
41749
|
-
parts.push(path3.call(
|
|
41749
|
+
parts.push(path3.call(print6, "id"));
|
|
41750
41750
|
if (n.name) {
|
|
41751
|
-
parts.push(" as ", path3.call(
|
|
41751
|
+
parts.push(" as ", path3.call(print6, "name"));
|
|
41752
41752
|
}
|
|
41753
41753
|
}
|
|
41754
41754
|
return (0, lines_1.concat)(parts);
|
|
41755
41755
|
case "ExportSpecifier":
|
|
41756
41756
|
if (n.local) {
|
|
41757
|
-
parts.push(path3.call(
|
|
41757
|
+
parts.push(path3.call(print6, "local"));
|
|
41758
41758
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
41759
|
-
parts.push(" as ", path3.call(
|
|
41759
|
+
parts.push(" as ", path3.call(print6, "exported"));
|
|
41760
41760
|
}
|
|
41761
41761
|
} else if (n.id) {
|
|
41762
|
-
parts.push(path3.call(
|
|
41762
|
+
parts.push(path3.call(print6, "id"));
|
|
41763
41763
|
if (n.name) {
|
|
41764
|
-
parts.push(" as ", path3.call(
|
|
41764
|
+
parts.push(" as ", path3.call(print6, "name"));
|
|
41765
41765
|
}
|
|
41766
41766
|
}
|
|
41767
41767
|
return (0, lines_1.concat)(parts);
|
|
@@ -41770,40 +41770,40 @@ var require_printer = __commonJS({
|
|
|
41770
41770
|
case "ImportNamespaceSpecifier":
|
|
41771
41771
|
parts.push("* as ");
|
|
41772
41772
|
if (n.local) {
|
|
41773
|
-
parts.push(path3.call(
|
|
41773
|
+
parts.push(path3.call(print6, "local"));
|
|
41774
41774
|
} else if (n.id) {
|
|
41775
|
-
parts.push(path3.call(
|
|
41775
|
+
parts.push(path3.call(print6, "id"));
|
|
41776
41776
|
}
|
|
41777
41777
|
return (0, lines_1.concat)(parts);
|
|
41778
41778
|
case "ImportDefaultSpecifier":
|
|
41779
41779
|
if (n.local) {
|
|
41780
|
-
return path3.call(
|
|
41780
|
+
return path3.call(print6, "local");
|
|
41781
41781
|
}
|
|
41782
|
-
return path3.call(
|
|
41782
|
+
return path3.call(print6, "id");
|
|
41783
41783
|
case "TSExportAssignment":
|
|
41784
|
-
return (0, lines_1.concat)(["export = ", path3.call(
|
|
41784
|
+
return (0, lines_1.concat)(["export = ", path3.call(print6, "expression")]);
|
|
41785
41785
|
case "ExportDeclaration":
|
|
41786
41786
|
case "ExportDefaultDeclaration":
|
|
41787
41787
|
case "ExportNamedDeclaration":
|
|
41788
|
-
return printExportDeclaration(path3, options,
|
|
41788
|
+
return printExportDeclaration(path3, options, print6);
|
|
41789
41789
|
case "ExportAllDeclaration":
|
|
41790
41790
|
parts.push("export *");
|
|
41791
41791
|
if (n.exported) {
|
|
41792
|
-
parts.push(" as ", path3.call(
|
|
41792
|
+
parts.push(" as ", path3.call(print6, "exported"));
|
|
41793
41793
|
}
|
|
41794
|
-
parts.push(" from ", path3.call(
|
|
41794
|
+
parts.push(" from ", path3.call(print6, "source"), ";");
|
|
41795
41795
|
return (0, lines_1.concat)(parts);
|
|
41796
41796
|
case "TSNamespaceExportDeclaration":
|
|
41797
|
-
parts.push("export as namespace ", path3.call(
|
|
41797
|
+
parts.push("export as namespace ", path3.call(print6, "id"));
|
|
41798
41798
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
41799
41799
|
case "ExportNamespaceSpecifier":
|
|
41800
|
-
return (0, lines_1.concat)(["* as ", path3.call(
|
|
41800
|
+
return (0, lines_1.concat)(["* as ", path3.call(print6, "exported")]);
|
|
41801
41801
|
case "ExportDefaultSpecifier":
|
|
41802
|
-
return path3.call(
|
|
41802
|
+
return path3.call(print6, "exported");
|
|
41803
41803
|
case "Import":
|
|
41804
41804
|
return (0, lines_1.fromString)("import", options);
|
|
41805
41805
|
case "ImportExpression":
|
|
41806
|
-
return (0, lines_1.concat)(["import(", path3.call(
|
|
41806
|
+
return (0, lines_1.concat)(["import(", path3.call(print6, "source"), ")"]);
|
|
41807
41807
|
case "ImportDeclaration": {
|
|
41808
41808
|
parts.push("import ");
|
|
41809
41809
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -41815,9 +41815,9 @@ var require_printer = __commonJS({
|
|
|
41815
41815
|
path3.each(function(specifierPath) {
|
|
41816
41816
|
var spec = specifierPath.getValue();
|
|
41817
41817
|
if (spec.type === "ImportSpecifier") {
|
|
41818
|
-
bracedSpecifiers_1.push(
|
|
41818
|
+
bracedSpecifiers_1.push(print6(specifierPath));
|
|
41819
41819
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
41820
|
-
unbracedSpecifiers_1.push(
|
|
41820
|
+
unbracedSpecifiers_1.push(print6(specifierPath));
|
|
41821
41821
|
}
|
|
41822
41822
|
}, "specifiers");
|
|
41823
41823
|
unbracedSpecifiers_1.forEach(function(lines2, i2) {
|
|
@@ -41847,16 +41847,16 @@ var require_printer = __commonJS({
|
|
|
41847
41847
|
}
|
|
41848
41848
|
parts.push(" from ");
|
|
41849
41849
|
}
|
|
41850
|
-
parts.push(path3.call(
|
|
41850
|
+
parts.push(path3.call(print6, "source"), maybePrintImportAssertions(path3, options, print6), ";");
|
|
41851
41851
|
return (0, lines_1.concat)(parts);
|
|
41852
41852
|
}
|
|
41853
41853
|
case "ImportAttribute":
|
|
41854
|
-
return (0, lines_1.concat)([path3.call(
|
|
41854
|
+
return (0, lines_1.concat)([path3.call(print6, "key"), ": ", path3.call(print6, "value")]);
|
|
41855
41855
|
case "StaticBlock":
|
|
41856
41856
|
parts.push("static ");
|
|
41857
41857
|
case "BlockStatement": {
|
|
41858
41858
|
var naked_1 = path3.call(function(bodyPath) {
|
|
41859
|
-
return printStatementSequence(bodyPath, options,
|
|
41859
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
41860
41860
|
}, "body");
|
|
41861
41861
|
if (naked_1.isEmpty()) {
|
|
41862
41862
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -41867,7 +41867,7 @@ var require_printer = __commonJS({
|
|
|
41867
41867
|
parts.push("{\n");
|
|
41868
41868
|
if (n.directives) {
|
|
41869
41869
|
path3.each(function(childPath) {
|
|
41870
|
-
parts.push(maybeAddSemicolon(
|
|
41870
|
+
parts.push(maybeAddSemicolon(print6(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
41871
41871
|
}, "directives");
|
|
41872
41872
|
}
|
|
41873
41873
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -41877,7 +41877,7 @@ var require_printer = __commonJS({
|
|
|
41877
41877
|
case "ReturnStatement": {
|
|
41878
41878
|
parts.push("return");
|
|
41879
41879
|
if (n.argument) {
|
|
41880
|
-
var argLines = path3.call(
|
|
41880
|
+
var argLines = path3.call(print6, "argument");
|
|
41881
41881
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
41882
41882
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
41883
41883
|
} else {
|
|
@@ -41889,17 +41889,17 @@ var require_printer = __commonJS({
|
|
|
41889
41889
|
}
|
|
41890
41890
|
case "CallExpression":
|
|
41891
41891
|
case "OptionalCallExpression":
|
|
41892
|
-
parts.push(path3.call(
|
|
41892
|
+
parts.push(path3.call(print6, "callee"));
|
|
41893
41893
|
if (n.typeParameters) {
|
|
41894
|
-
parts.push(path3.call(
|
|
41894
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
41895
41895
|
}
|
|
41896
41896
|
if (n.typeArguments) {
|
|
41897
|
-
parts.push(path3.call(
|
|
41897
|
+
parts.push(path3.call(print6, "typeArguments"));
|
|
41898
41898
|
}
|
|
41899
41899
|
if (types4.getFieldValue(n, "optional")) {
|
|
41900
41900
|
parts.push("?.");
|
|
41901
41901
|
}
|
|
41902
|
-
parts.push(printArgumentsList(path3, options,
|
|
41902
|
+
parts.push(printArgumentsList(path3, options, print6));
|
|
41903
41903
|
return (0, lines_1.concat)(parts);
|
|
41904
41904
|
case "RecordExpression":
|
|
41905
41905
|
parts.push("#");
|
|
@@ -41929,7 +41929,7 @@ var require_printer = __commonJS({
|
|
|
41929
41929
|
var i_1 = 0;
|
|
41930
41930
|
fields.forEach(function(field) {
|
|
41931
41931
|
path3.each(function(childPath) {
|
|
41932
|
-
var lines2 =
|
|
41932
|
+
var lines2 = print6(childPath);
|
|
41933
41933
|
if (!oneLine_1) {
|
|
41934
41934
|
lines2 = lines2.indent(options.tabWidth);
|
|
41935
41935
|
}
|
|
@@ -41966,32 +41966,32 @@ var require_printer = __commonJS({
|
|
|
41966
41966
|
parts[parts.length - 1] = " " + rightBrace;
|
|
41967
41967
|
}
|
|
41968
41968
|
if (n.typeAnnotation) {
|
|
41969
|
-
parts.push(path3.call(
|
|
41969
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
41970
41970
|
}
|
|
41971
41971
|
return (0, lines_1.concat)(parts);
|
|
41972
41972
|
}
|
|
41973
41973
|
case "PropertyPattern":
|
|
41974
41974
|
return (0, lines_1.concat)([
|
|
41975
|
-
path3.call(
|
|
41975
|
+
path3.call(print6, "key"),
|
|
41976
41976
|
": ",
|
|
41977
|
-
path3.call(
|
|
41977
|
+
path3.call(print6, "pattern")
|
|
41978
41978
|
]);
|
|
41979
41979
|
case "ObjectProperty":
|
|
41980
41980
|
case "Property": {
|
|
41981
41981
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
41982
|
-
return printMethod(path3, options,
|
|
41982
|
+
return printMethod(path3, options, print6);
|
|
41983
41983
|
}
|
|
41984
41984
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
41985
|
-
return path3.call(
|
|
41985
|
+
return path3.call(print6, "value");
|
|
41986
41986
|
}
|
|
41987
|
-
var key = path3.call(
|
|
41987
|
+
var key = path3.call(print6, "key");
|
|
41988
41988
|
if (n.computed) {
|
|
41989
41989
|
parts.push("[", key, "]");
|
|
41990
41990
|
} else {
|
|
41991
41991
|
parts.push(key);
|
|
41992
41992
|
}
|
|
41993
41993
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
41994
|
-
parts.push(": ", path3.call(
|
|
41994
|
+
parts.push(": ", path3.call(print6, "value"));
|
|
41995
41995
|
}
|
|
41996
41996
|
return (0, lines_1.concat)(parts);
|
|
41997
41997
|
}
|
|
@@ -41999,18 +41999,18 @@ var require_printer = __commonJS({
|
|
|
41999
41999
|
case "ObjectMethod":
|
|
42000
42000
|
case "ClassPrivateMethod":
|
|
42001
42001
|
case "TSDeclareMethod":
|
|
42002
|
-
return printMethod(path3, options,
|
|
42002
|
+
return printMethod(path3, options, print6);
|
|
42003
42003
|
case "PrivateName":
|
|
42004
|
-
return (0, lines_1.concat)(["#", path3.call(
|
|
42004
|
+
return (0, lines_1.concat)(["#", path3.call(print6, "id")]);
|
|
42005
42005
|
case "Decorator":
|
|
42006
|
-
return (0, lines_1.concat)(["@", path3.call(
|
|
42006
|
+
return (0, lines_1.concat)(["@", path3.call(print6, "expression")]);
|
|
42007
42007
|
case "TupleExpression":
|
|
42008
42008
|
parts.push("#");
|
|
42009
42009
|
case "ArrayExpression":
|
|
42010
42010
|
case "ArrayPattern": {
|
|
42011
42011
|
var elems = n.elements;
|
|
42012
42012
|
var len_2 = elems.length;
|
|
42013
|
-
var printed_1 = path3.map(
|
|
42013
|
+
var printed_1 = path3.map(print6, "elements");
|
|
42014
42014
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
42015
42015
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
42016
42016
|
if (oneLine_2) {
|
|
@@ -42048,12 +42048,12 @@ var require_printer = __commonJS({
|
|
|
42048
42048
|
parts.push("]");
|
|
42049
42049
|
}
|
|
42050
42050
|
if (n.typeAnnotation) {
|
|
42051
|
-
parts.push(path3.call(
|
|
42051
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
42052
42052
|
}
|
|
42053
42053
|
return (0, lines_1.concat)(parts);
|
|
42054
42054
|
}
|
|
42055
42055
|
case "SequenceExpression":
|
|
42056
|
-
return (0, lines_1.fromString)(", ").join(path3.map(
|
|
42056
|
+
return (0, lines_1.fromString)(", ").join(path3.map(print6, "expressions"));
|
|
42057
42057
|
case "ThisExpression":
|
|
42058
42058
|
return (0, lines_1.fromString)("this");
|
|
42059
42059
|
case "Super":
|
|
@@ -42074,7 +42074,7 @@ var require_printer = __commonJS({
|
|
|
42074
42074
|
case "Literal":
|
|
42075
42075
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
42076
42076
|
case "Directive":
|
|
42077
|
-
return path3.call(
|
|
42077
|
+
return path3.call(print6, "value");
|
|
42078
42078
|
case "DirectiveLiteral":
|
|
42079
42079
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
42080
42080
|
case "InterpreterDirective":
|
|
@@ -42088,32 +42088,32 @@ var require_printer = __commonJS({
|
|
|
42088
42088
|
parts.push(n.operator);
|
|
42089
42089
|
if (/[a-z]$/.test(n.operator))
|
|
42090
42090
|
parts.push(" ");
|
|
42091
|
-
parts.push(path3.call(
|
|
42091
|
+
parts.push(path3.call(print6, "argument"));
|
|
42092
42092
|
return (0, lines_1.concat)(parts);
|
|
42093
42093
|
case "UpdateExpression":
|
|
42094
|
-
parts.push(path3.call(
|
|
42094
|
+
parts.push(path3.call(print6, "argument"), n.operator);
|
|
42095
42095
|
if (n.prefix)
|
|
42096
42096
|
parts.reverse();
|
|
42097
42097
|
return (0, lines_1.concat)(parts);
|
|
42098
42098
|
case "ConditionalExpression":
|
|
42099
42099
|
return (0, lines_1.concat)([
|
|
42100
|
-
path3.call(
|
|
42100
|
+
path3.call(print6, "test"),
|
|
42101
42101
|
" ? ",
|
|
42102
|
-
path3.call(
|
|
42102
|
+
path3.call(print6, "consequent"),
|
|
42103
42103
|
" : ",
|
|
42104
|
-
path3.call(
|
|
42104
|
+
path3.call(print6, "alternate")
|
|
42105
42105
|
]);
|
|
42106
42106
|
case "NewExpression": {
|
|
42107
|
-
parts.push("new ", path3.call(
|
|
42107
|
+
parts.push("new ", path3.call(print6, "callee"));
|
|
42108
42108
|
if (n.typeParameters) {
|
|
42109
|
-
parts.push(path3.call(
|
|
42109
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
42110
42110
|
}
|
|
42111
42111
|
if (n.typeArguments) {
|
|
42112
|
-
parts.push(path3.call(
|
|
42112
|
+
parts.push(path3.call(print6, "typeArguments"));
|
|
42113
42113
|
}
|
|
42114
42114
|
var args = n.arguments;
|
|
42115
42115
|
if (args) {
|
|
42116
|
-
parts.push(printArgumentsList(path3, options,
|
|
42116
|
+
parts.push(printArgumentsList(path3, options, print6));
|
|
42117
42117
|
}
|
|
42118
42118
|
return (0, lines_1.concat)(parts);
|
|
42119
42119
|
}
|
|
@@ -42124,7 +42124,7 @@ var require_printer = __commonJS({
|
|
|
42124
42124
|
parts.push(n.kind, " ");
|
|
42125
42125
|
var maxLen_1 = 0;
|
|
42126
42126
|
var printed = path3.map(function(childPath) {
|
|
42127
|
-
var lines2 =
|
|
42127
|
+
var lines2 = print6(childPath);
|
|
42128
42128
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
42129
42129
|
return lines2;
|
|
42130
42130
|
}, "declarations");
|
|
@@ -42143,30 +42143,30 @@ var require_printer = __commonJS({
|
|
|
42143
42143
|
}
|
|
42144
42144
|
case "VariableDeclarator":
|
|
42145
42145
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
42146
|
-
path3.call(
|
|
42147
|
-
path3.call(
|
|
42148
|
-
]) : path3.call(
|
|
42146
|
+
path3.call(print6, "id"),
|
|
42147
|
+
path3.call(print6, "init")
|
|
42148
|
+
]) : path3.call(print6, "id");
|
|
42149
42149
|
case "WithStatement":
|
|
42150
42150
|
return (0, lines_1.concat)([
|
|
42151
42151
|
"with (",
|
|
42152
|
-
path3.call(
|
|
42152
|
+
path3.call(print6, "object"),
|
|
42153
42153
|
") ",
|
|
42154
|
-
path3.call(
|
|
42154
|
+
path3.call(print6, "body")
|
|
42155
42155
|
]);
|
|
42156
42156
|
case "IfStatement": {
|
|
42157
|
-
var con = adjustClause(path3.call(
|
|
42158
|
-
parts.push("if (", path3.call(
|
|
42157
|
+
var con = adjustClause(path3.call(print6, "consequent"), options);
|
|
42158
|
+
parts.push("if (", path3.call(print6, "test"), ")", con);
|
|
42159
42159
|
if (n.alternate)
|
|
42160
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path3.call(
|
|
42160
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path3.call(print6, "alternate"), options));
|
|
42161
42161
|
return (0, lines_1.concat)(parts);
|
|
42162
42162
|
}
|
|
42163
42163
|
case "ForStatement": {
|
|
42164
|
-
var init = path3.call(
|
|
42164
|
+
var init = path3.call(print6, "init");
|
|
42165
42165
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
42166
42166
|
var forParen = "for (";
|
|
42167
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path3.call(
|
|
42167
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path3.call(print6, "test"), path3.call(print6, "update")]).indentTail(forParen.length);
|
|
42168
42168
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
42169
|
-
var clause = adjustClause(path3.call(
|
|
42169
|
+
var clause = adjustClause(path3.call(print6, "body"), options);
|
|
42170
42170
|
parts.push(head);
|
|
42171
42171
|
if (head.length > 1) {
|
|
42172
42172
|
parts.push("\n");
|
|
@@ -42178,18 +42178,18 @@ var require_printer = __commonJS({
|
|
|
42178
42178
|
case "WhileStatement":
|
|
42179
42179
|
return (0, lines_1.concat)([
|
|
42180
42180
|
"while (",
|
|
42181
|
-
path3.call(
|
|
42181
|
+
path3.call(print6, "test"),
|
|
42182
42182
|
")",
|
|
42183
|
-
adjustClause(path3.call(
|
|
42183
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
42184
42184
|
]);
|
|
42185
42185
|
case "ForInStatement":
|
|
42186
42186
|
return (0, lines_1.concat)([
|
|
42187
42187
|
n.each ? "for each (" : "for (",
|
|
42188
|
-
path3.call(
|
|
42188
|
+
path3.call(print6, "left"),
|
|
42189
42189
|
" in ",
|
|
42190
|
-
path3.call(
|
|
42190
|
+
path3.call(print6, "right"),
|
|
42191
42191
|
")",
|
|
42192
|
-
adjustClause(path3.call(
|
|
42192
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
42193
42193
|
]);
|
|
42194
42194
|
case "ForOfStatement":
|
|
42195
42195
|
case "ForAwaitStatement":
|
|
@@ -42197,122 +42197,122 @@ var require_printer = __commonJS({
|
|
|
42197
42197
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
42198
42198
|
parts.push("await ");
|
|
42199
42199
|
}
|
|
42200
|
-
parts.push("(", path3.call(
|
|
42200
|
+
parts.push("(", path3.call(print6, "left"), " of ", path3.call(print6, "right"), ")", adjustClause(path3.call(print6, "body"), options));
|
|
42201
42201
|
return (0, lines_1.concat)(parts);
|
|
42202
42202
|
case "DoWhileStatement": {
|
|
42203
42203
|
var doBody = (0, lines_1.concat)([
|
|
42204
42204
|
"do",
|
|
42205
|
-
adjustClause(path3.call(
|
|
42205
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
42206
42206
|
]);
|
|
42207
42207
|
parts.push(doBody);
|
|
42208
42208
|
if (endsWithBrace(doBody))
|
|
42209
42209
|
parts.push(" while");
|
|
42210
42210
|
else
|
|
42211
42211
|
parts.push("\nwhile");
|
|
42212
|
-
parts.push(" (", path3.call(
|
|
42212
|
+
parts.push(" (", path3.call(print6, "test"), ");");
|
|
42213
42213
|
return (0, lines_1.concat)(parts);
|
|
42214
42214
|
}
|
|
42215
42215
|
case "DoExpression": {
|
|
42216
42216
|
var statements = path3.call(function(bodyPath) {
|
|
42217
|
-
return printStatementSequence(bodyPath, options,
|
|
42217
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
42218
42218
|
}, "body");
|
|
42219
42219
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
42220
42220
|
}
|
|
42221
42221
|
case "BreakStatement":
|
|
42222
42222
|
parts.push("break");
|
|
42223
42223
|
if (n.label)
|
|
42224
|
-
parts.push(" ", path3.call(
|
|
42224
|
+
parts.push(" ", path3.call(print6, "label"));
|
|
42225
42225
|
parts.push(";");
|
|
42226
42226
|
return (0, lines_1.concat)(parts);
|
|
42227
42227
|
case "ContinueStatement":
|
|
42228
42228
|
parts.push("continue");
|
|
42229
42229
|
if (n.label)
|
|
42230
|
-
parts.push(" ", path3.call(
|
|
42230
|
+
parts.push(" ", path3.call(print6, "label"));
|
|
42231
42231
|
parts.push(";");
|
|
42232
42232
|
return (0, lines_1.concat)(parts);
|
|
42233
42233
|
case "LabeledStatement":
|
|
42234
42234
|
return (0, lines_1.concat)([
|
|
42235
|
-
path3.call(
|
|
42235
|
+
path3.call(print6, "label"),
|
|
42236
42236
|
":\n",
|
|
42237
|
-
path3.call(
|
|
42237
|
+
path3.call(print6, "body")
|
|
42238
42238
|
]);
|
|
42239
42239
|
case "TryStatement":
|
|
42240
|
-
parts.push("try ", path3.call(
|
|
42240
|
+
parts.push("try ", path3.call(print6, "block"));
|
|
42241
42241
|
if (n.handler) {
|
|
42242
|
-
parts.push(" ", path3.call(
|
|
42242
|
+
parts.push(" ", path3.call(print6, "handler"));
|
|
42243
42243
|
} else if (n.handlers) {
|
|
42244
42244
|
path3.each(function(handlerPath) {
|
|
42245
|
-
parts.push(" ",
|
|
42245
|
+
parts.push(" ", print6(handlerPath));
|
|
42246
42246
|
}, "handlers");
|
|
42247
42247
|
}
|
|
42248
42248
|
if (n.finalizer) {
|
|
42249
|
-
parts.push(" finally ", path3.call(
|
|
42249
|
+
parts.push(" finally ", path3.call(print6, "finalizer"));
|
|
42250
42250
|
}
|
|
42251
42251
|
return (0, lines_1.concat)(parts);
|
|
42252
42252
|
case "CatchClause":
|
|
42253
42253
|
parts.push("catch ");
|
|
42254
42254
|
if (n.param) {
|
|
42255
|
-
parts.push("(", path3.call(
|
|
42255
|
+
parts.push("(", path3.call(print6, "param"));
|
|
42256
42256
|
}
|
|
42257
42257
|
if (n.guard) {
|
|
42258
|
-
parts.push(" if ", path3.call(
|
|
42258
|
+
parts.push(" if ", path3.call(print6, "guard"));
|
|
42259
42259
|
}
|
|
42260
42260
|
if (n.param) {
|
|
42261
42261
|
parts.push(") ");
|
|
42262
42262
|
}
|
|
42263
|
-
parts.push(path3.call(
|
|
42263
|
+
parts.push(path3.call(print6, "body"));
|
|
42264
42264
|
return (0, lines_1.concat)(parts);
|
|
42265
42265
|
case "ThrowStatement":
|
|
42266
|
-
return (0, lines_1.concat)(["throw ", path3.call(
|
|
42266
|
+
return (0, lines_1.concat)(["throw ", path3.call(print6, "argument"), ";"]);
|
|
42267
42267
|
case "SwitchStatement":
|
|
42268
42268
|
return (0, lines_1.concat)([
|
|
42269
42269
|
"switch (",
|
|
42270
|
-
path3.call(
|
|
42270
|
+
path3.call(print6, "discriminant"),
|
|
42271
42271
|
") {\n",
|
|
42272
|
-
(0, lines_1.fromString)("\n").join(path3.map(
|
|
42272
|
+
(0, lines_1.fromString)("\n").join(path3.map(print6, "cases")),
|
|
42273
42273
|
"\n}"
|
|
42274
42274
|
]);
|
|
42275
42275
|
case "SwitchCase":
|
|
42276
42276
|
if (n.test)
|
|
42277
|
-
parts.push("case ", path3.call(
|
|
42277
|
+
parts.push("case ", path3.call(print6, "test"), ":");
|
|
42278
42278
|
else
|
|
42279
42279
|
parts.push("default:");
|
|
42280
42280
|
if (n.consequent.length > 0) {
|
|
42281
42281
|
parts.push("\n", path3.call(function(consequentPath) {
|
|
42282
|
-
return printStatementSequence(consequentPath, options,
|
|
42282
|
+
return printStatementSequence(consequentPath, options, print6);
|
|
42283
42283
|
}, "consequent").indent(options.tabWidth));
|
|
42284
42284
|
}
|
|
42285
42285
|
return (0, lines_1.concat)(parts);
|
|
42286
42286
|
case "DebuggerStatement":
|
|
42287
42287
|
return (0, lines_1.fromString)("debugger;");
|
|
42288
42288
|
case "JSXAttribute":
|
|
42289
|
-
parts.push(path3.call(
|
|
42289
|
+
parts.push(path3.call(print6, "name"));
|
|
42290
42290
|
if (n.value)
|
|
42291
|
-
parts.push("=", path3.call(
|
|
42291
|
+
parts.push("=", path3.call(print6, "value"));
|
|
42292
42292
|
return (0, lines_1.concat)(parts);
|
|
42293
42293
|
case "JSXIdentifier":
|
|
42294
42294
|
return (0, lines_1.fromString)(n.name, options);
|
|
42295
42295
|
case "JSXNamespacedName":
|
|
42296
42296
|
return (0, lines_1.fromString)(":").join([
|
|
42297
|
-
path3.call(
|
|
42298
|
-
path3.call(
|
|
42297
|
+
path3.call(print6, "namespace"),
|
|
42298
|
+
path3.call(print6, "name")
|
|
42299
42299
|
]);
|
|
42300
42300
|
case "JSXMemberExpression":
|
|
42301
42301
|
return (0, lines_1.fromString)(".").join([
|
|
42302
|
-
path3.call(
|
|
42303
|
-
path3.call(
|
|
42302
|
+
path3.call(print6, "object"),
|
|
42303
|
+
path3.call(print6, "property")
|
|
42304
42304
|
]);
|
|
42305
42305
|
case "JSXSpreadAttribute":
|
|
42306
|
-
return (0, lines_1.concat)(["{...", path3.call(
|
|
42306
|
+
return (0, lines_1.concat)(["{...", path3.call(print6, "argument"), "}"]);
|
|
42307
42307
|
case "JSXSpreadChild":
|
|
42308
|
-
return (0, lines_1.concat)(["{...", path3.call(
|
|
42308
|
+
return (0, lines_1.concat)(["{...", path3.call(print6, "expression"), "}"]);
|
|
42309
42309
|
case "JSXExpressionContainer":
|
|
42310
|
-
return (0, lines_1.concat)(["{", path3.call(
|
|
42310
|
+
return (0, lines_1.concat)(["{", path3.call(print6, "expression"), "}"]);
|
|
42311
42311
|
case "JSXElement":
|
|
42312
42312
|
case "JSXFragment": {
|
|
42313
42313
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
42314
42314
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
42315
|
-
var openingLines = path3.call(
|
|
42315
|
+
var openingLines = path3.call(print6, openingPropName);
|
|
42316
42316
|
if (n[openingPropName].selfClosing) {
|
|
42317
42317
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
42318
42318
|
return openingLines;
|
|
@@ -42326,16 +42326,16 @@ var require_printer = __commonJS({
|
|
|
42326
42326
|
return "\n";
|
|
42327
42327
|
}
|
|
42328
42328
|
}
|
|
42329
|
-
return
|
|
42329
|
+
return print6(childPath);
|
|
42330
42330
|
}, "children")).indentTail(options.tabWidth);
|
|
42331
|
-
var closingLines = path3.call(
|
|
42331
|
+
var closingLines = path3.call(print6, closingPropName);
|
|
42332
42332
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
42333
42333
|
}
|
|
42334
42334
|
case "JSXOpeningElement": {
|
|
42335
|
-
parts.push("<", path3.call(
|
|
42335
|
+
parts.push("<", path3.call(print6, "name"));
|
|
42336
42336
|
var attrParts_1 = [];
|
|
42337
42337
|
path3.each(function(attrPath) {
|
|
42338
|
-
attrParts_1.push(" ",
|
|
42338
|
+
attrParts_1.push(" ", print6(attrPath));
|
|
42339
42339
|
}, "attributes");
|
|
42340
42340
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
42341
42341
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -42352,7 +42352,7 @@ var require_printer = __commonJS({
|
|
|
42352
42352
|
return (0, lines_1.concat)(parts);
|
|
42353
42353
|
}
|
|
42354
42354
|
case "JSXClosingElement":
|
|
42355
|
-
return (0, lines_1.concat)(["</", path3.call(
|
|
42355
|
+
return (0, lines_1.concat)(["</", path3.call(print6, "name"), ">"]);
|
|
42356
42356
|
case "JSXOpeningFragment":
|
|
42357
42357
|
return (0, lines_1.fromString)("<>");
|
|
42358
42358
|
case "JSXClosingFragment":
|
|
@@ -42363,9 +42363,9 @@ var require_printer = __commonJS({
|
|
|
42363
42363
|
return (0, lines_1.fromString)("");
|
|
42364
42364
|
case "TypeAnnotatedIdentifier":
|
|
42365
42365
|
return (0, lines_1.concat)([
|
|
42366
|
-
path3.call(
|
|
42366
|
+
path3.call(print6, "annotation"),
|
|
42367
42367
|
" ",
|
|
42368
|
-
path3.call(
|
|
42368
|
+
path3.call(print6, "identifier")
|
|
42369
42369
|
]);
|
|
42370
42370
|
case "ClassBody":
|
|
42371
42371
|
if (n.body.length === 0) {
|
|
@@ -42374,12 +42374,12 @@ var require_printer = __commonJS({
|
|
|
42374
42374
|
return (0, lines_1.concat)([
|
|
42375
42375
|
"{\n",
|
|
42376
42376
|
path3.call(function(bodyPath) {
|
|
42377
|
-
return printStatementSequence(bodyPath, options,
|
|
42377
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
42378
42378
|
}, "body").indent(options.tabWidth),
|
|
42379
42379
|
"\n}"
|
|
42380
42380
|
]);
|
|
42381
42381
|
case "ClassPropertyDefinition":
|
|
42382
|
-
parts.push("static ", path3.call(
|
|
42382
|
+
parts.push("static ", path3.call(print6, "definition"));
|
|
42383
42383
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
42384
42384
|
parts.push(";");
|
|
42385
42385
|
return (0, lines_1.concat)(parts);
|
|
@@ -42400,12 +42400,12 @@ var require_printer = __commonJS({
|
|
|
42400
42400
|
if (n.readonly) {
|
|
42401
42401
|
parts.push("readonly ");
|
|
42402
42402
|
}
|
|
42403
|
-
var key = path3.call(
|
|
42403
|
+
var key = path3.call(print6, "key");
|
|
42404
42404
|
if (n.computed) {
|
|
42405
42405
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
42406
42406
|
}
|
|
42407
42407
|
if (n.variance) {
|
|
42408
|
-
key = (0, lines_1.concat)([printVariance(path3,
|
|
42408
|
+
key = (0, lines_1.concat)([printVariance(path3, print6), key]);
|
|
42409
42409
|
}
|
|
42410
42410
|
parts.push(key);
|
|
42411
42411
|
if (n.optional) {
|
|
@@ -42415,10 +42415,10 @@ var require_printer = __commonJS({
|
|
|
42415
42415
|
parts.push("!");
|
|
42416
42416
|
}
|
|
42417
42417
|
if (n.typeAnnotation) {
|
|
42418
|
-
parts.push(path3.call(
|
|
42418
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
42419
42419
|
}
|
|
42420
42420
|
if (n.value) {
|
|
42421
|
-
parts.push(" = ", path3.call(
|
|
42421
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
42422
42422
|
}
|
|
42423
42423
|
parts.push(";");
|
|
42424
42424
|
return (0, lines_1.concat)(parts);
|
|
@@ -42427,21 +42427,21 @@ var require_printer = __commonJS({
|
|
|
42427
42427
|
if (n.static) {
|
|
42428
42428
|
parts.push("static ");
|
|
42429
42429
|
}
|
|
42430
|
-
parts.push(path3.call(
|
|
42430
|
+
parts.push(path3.call(print6, "key"));
|
|
42431
42431
|
if (n.typeAnnotation) {
|
|
42432
|
-
parts.push(path3.call(
|
|
42432
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
42433
42433
|
}
|
|
42434
42434
|
if (n.value) {
|
|
42435
|
-
parts.push(" = ", path3.call(
|
|
42435
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
42436
42436
|
}
|
|
42437
42437
|
parts.push(";");
|
|
42438
42438
|
return (0, lines_1.concat)(parts);
|
|
42439
42439
|
case "ClassAccessorProperty": {
|
|
42440
42440
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
42441
42441
|
if (n.computed) {
|
|
42442
|
-
parts.push("[", path3.call(
|
|
42442
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
42443
42443
|
} else {
|
|
42444
|
-
parts.push(path3.call(
|
|
42444
|
+
parts.push(path3.call(print6, "key"));
|
|
42445
42445
|
}
|
|
42446
42446
|
if (n.optional) {
|
|
42447
42447
|
parts.push("?");
|
|
@@ -42450,10 +42450,10 @@ var require_printer = __commonJS({
|
|
|
42450
42450
|
parts.push("!");
|
|
42451
42451
|
}
|
|
42452
42452
|
if (n.typeAnnotation) {
|
|
42453
|
-
parts.push(path3.call(
|
|
42453
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
42454
42454
|
}
|
|
42455
42455
|
if (n.value) {
|
|
42456
|
-
parts.push(" = ", path3.call(
|
|
42456
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
42457
42457
|
}
|
|
42458
42458
|
parts.push(";");
|
|
42459
42459
|
return (0, lines_1.concat)(parts);
|
|
@@ -42469,21 +42469,21 @@ var require_printer = __commonJS({
|
|
|
42469
42469
|
}
|
|
42470
42470
|
parts.push("class");
|
|
42471
42471
|
if (n.id) {
|
|
42472
|
-
parts.push(" ", path3.call(
|
|
42472
|
+
parts.push(" ", path3.call(print6, "id"));
|
|
42473
42473
|
}
|
|
42474
42474
|
if (n.typeParameters) {
|
|
42475
|
-
parts.push(path3.call(
|
|
42475
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
42476
42476
|
}
|
|
42477
42477
|
if (n.superClass) {
|
|
42478
|
-
parts.push(" extends ", path3.call(
|
|
42478
|
+
parts.push(" extends ", path3.call(print6, "superClass"), path3.call(print6, "superTypeParameters"));
|
|
42479
42479
|
}
|
|
42480
42480
|
if (n.extends && n.extends.length > 0) {
|
|
42481
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
42481
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")));
|
|
42482
42482
|
}
|
|
42483
42483
|
if (n["implements"] && n["implements"].length > 0) {
|
|
42484
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
42484
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path3.map(print6, "implements")));
|
|
42485
42485
|
}
|
|
42486
|
-
parts.push(" ", path3.call(
|
|
42486
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
42487
42487
|
if (n.type === "DeclareClass") {
|
|
42488
42488
|
return printFlowDeclaration(path3, parts);
|
|
42489
42489
|
} else {
|
|
@@ -42492,11 +42492,11 @@ var require_printer = __commonJS({
|
|
|
42492
42492
|
case "TemplateElement":
|
|
42493
42493
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
42494
42494
|
case "TemplateLiteral": {
|
|
42495
|
-
var expressions_1 = path3.map(
|
|
42495
|
+
var expressions_1 = path3.map(print6, "expressions");
|
|
42496
42496
|
parts.push("`");
|
|
42497
42497
|
path3.each(function(childPath) {
|
|
42498
42498
|
var i2 = childPath.getName();
|
|
42499
|
-
parts.push(
|
|
42499
|
+
parts.push(print6(childPath));
|
|
42500
42500
|
if (i2 < expressions_1.length) {
|
|
42501
42501
|
parts.push("${", expressions_1[i2], "}");
|
|
42502
42502
|
}
|
|
@@ -42505,7 +42505,7 @@ var require_printer = __commonJS({
|
|
|
42505
42505
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
42506
42506
|
}
|
|
42507
42507
|
case "TaggedTemplateExpression":
|
|
42508
|
-
return (0, lines_1.concat)([path3.call(
|
|
42508
|
+
return (0, lines_1.concat)([path3.call(print6, "tag"), path3.call(print6, "quasi")]);
|
|
42509
42509
|
case "Node":
|
|
42510
42510
|
case "Printable":
|
|
42511
42511
|
case "SourceLocation":
|
|
@@ -42539,7 +42539,7 @@ var require_printer = __commonJS({
|
|
|
42539
42539
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
42540
42540
|
parts.push(": ");
|
|
42541
42541
|
}
|
|
42542
|
-
parts.push(path3.call(
|
|
42542
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
42543
42543
|
return (0, lines_1.concat)(parts);
|
|
42544
42544
|
}
|
|
42545
42545
|
return (0, lines_1.fromString)("");
|
|
@@ -42553,9 +42553,9 @@ var require_printer = __commonJS({
|
|
|
42553
42553
|
case "MixedTypeAnnotation":
|
|
42554
42554
|
return (0, lines_1.fromString)("mixed", options);
|
|
42555
42555
|
case "ArrayTypeAnnotation":
|
|
42556
|
-
return (0, lines_1.concat)([path3.call(
|
|
42556
|
+
return (0, lines_1.concat)([path3.call(print6, "elementType"), "[]"]);
|
|
42557
42557
|
case "TupleTypeAnnotation": {
|
|
42558
|
-
var printed_2 = path3.map(
|
|
42558
|
+
var printed_2 = path3.map(print6, "types");
|
|
42559
42559
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
42560
42560
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
42561
42561
|
if (oneLine_3) {
|
|
@@ -42602,38 +42602,38 @@ var require_printer = __commonJS({
|
|
|
42602
42602
|
case "InterfaceTypeAnnotation":
|
|
42603
42603
|
parts.push("interface");
|
|
42604
42604
|
if (n.extends && n.extends.length > 0) {
|
|
42605
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
42605
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")));
|
|
42606
42606
|
}
|
|
42607
|
-
parts.push(" ", path3.call(
|
|
42607
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
42608
42608
|
return (0, lines_1.concat)(parts);
|
|
42609
42609
|
case "DeclareFunction":
|
|
42610
42610
|
return printFlowDeclaration(path3, [
|
|
42611
42611
|
"function ",
|
|
42612
|
-
path3.call(
|
|
42612
|
+
path3.call(print6, "id"),
|
|
42613
42613
|
";"
|
|
42614
42614
|
]);
|
|
42615
42615
|
case "DeclareModule":
|
|
42616
42616
|
return printFlowDeclaration(path3, [
|
|
42617
42617
|
"module ",
|
|
42618
|
-
path3.call(
|
|
42618
|
+
path3.call(print6, "id"),
|
|
42619
42619
|
" ",
|
|
42620
|
-
path3.call(
|
|
42620
|
+
path3.call(print6, "body")
|
|
42621
42621
|
]);
|
|
42622
42622
|
case "DeclareModuleExports":
|
|
42623
42623
|
return printFlowDeclaration(path3, [
|
|
42624
42624
|
"module.exports",
|
|
42625
|
-
path3.call(
|
|
42625
|
+
path3.call(print6, "typeAnnotation")
|
|
42626
42626
|
]);
|
|
42627
42627
|
case "DeclareVariable":
|
|
42628
|
-
return printFlowDeclaration(path3, ["var ", path3.call(
|
|
42628
|
+
return printFlowDeclaration(path3, ["var ", path3.call(print6, "id"), ";"]);
|
|
42629
42629
|
case "DeclareExportDeclaration":
|
|
42630
42630
|
case "DeclareExportAllDeclaration":
|
|
42631
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path3, options,
|
|
42631
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path3, options, print6)]);
|
|
42632
42632
|
case "EnumDeclaration":
|
|
42633
42633
|
return (0, lines_1.concat)([
|
|
42634
42634
|
"enum ",
|
|
42635
|
-
path3.call(
|
|
42636
|
-
path3.call(
|
|
42635
|
+
path3.call(print6, "id"),
|
|
42636
|
+
path3.call(print6, "body")
|
|
42637
42637
|
]);
|
|
42638
42638
|
case "EnumBooleanBody":
|
|
42639
42639
|
case "EnumNumberBody":
|
|
@@ -42645,24 +42645,24 @@ var require_printer = __commonJS({
|
|
|
42645
42645
|
n.type.slice(4, -4).toLowerCase()
|
|
42646
42646
|
);
|
|
42647
42647
|
}
|
|
42648
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path3.map(
|
|
42648
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path3.map(print6, "members")).indent(options.tabWidth), "\n}");
|
|
42649
42649
|
return (0, lines_1.concat)(parts);
|
|
42650
42650
|
}
|
|
42651
42651
|
case "EnumDefaultedMember":
|
|
42652
|
-
return (0, lines_1.concat)([path3.call(
|
|
42652
|
+
return (0, lines_1.concat)([path3.call(print6, "id"), ","]);
|
|
42653
42653
|
case "EnumBooleanMember":
|
|
42654
42654
|
case "EnumNumberMember":
|
|
42655
42655
|
case "EnumStringMember":
|
|
42656
42656
|
return (0, lines_1.concat)([
|
|
42657
|
-
path3.call(
|
|
42657
|
+
path3.call(print6, "id"),
|
|
42658
42658
|
" = ",
|
|
42659
|
-
path3.call(
|
|
42659
|
+
path3.call(print6, "init"),
|
|
42660
42660
|
","
|
|
42661
42661
|
]);
|
|
42662
42662
|
case "InferredPredicate":
|
|
42663
42663
|
return (0, lines_1.fromString)("%checks", options);
|
|
42664
42664
|
case "DeclaredPredicate":
|
|
42665
|
-
return (0, lines_1.concat)(["%checks(", path3.call(
|
|
42665
|
+
return (0, lines_1.concat)(["%checks(", path3.call(print6, "value"), ")"]);
|
|
42666
42666
|
case "FunctionTypeAnnotation": {
|
|
42667
42667
|
var parent = path3.getParentNode(0);
|
|
42668
42668
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path3.getParentNode(2)));
|
|
@@ -42672,14 +42672,14 @@ var require_printer = __commonJS({
|
|
|
42672
42672
|
}
|
|
42673
42673
|
var hasTypeParameters = !!n.typeParameters;
|
|
42674
42674
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
42675
|
-
parts.push(hasTypeParameters ? path3.call(
|
|
42675
|
+
parts.push(hasTypeParameters ? path3.call(print6, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path3, options, print6), needsParens ? ")" : "");
|
|
42676
42676
|
if (n.returnType) {
|
|
42677
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path3.call(
|
|
42677
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path3.call(print6, "returnType"));
|
|
42678
42678
|
}
|
|
42679
42679
|
return (0, lines_1.concat)(parts);
|
|
42680
42680
|
}
|
|
42681
42681
|
case "FunctionTypeParam": {
|
|
42682
|
-
var name = path3.call(
|
|
42682
|
+
var name = path3.call(print6, "name");
|
|
42683
42683
|
parts.push(name);
|
|
42684
42684
|
if (n.optional) {
|
|
42685
42685
|
parts.push("?");
|
|
@@ -42687,13 +42687,13 @@ var require_printer = __commonJS({
|
|
|
42687
42687
|
if (name.infos[0].line) {
|
|
42688
42688
|
parts.push(": ");
|
|
42689
42689
|
}
|
|
42690
|
-
parts.push(path3.call(
|
|
42690
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
42691
42691
|
return (0, lines_1.concat)(parts);
|
|
42692
42692
|
}
|
|
42693
42693
|
case "GenericTypeAnnotation":
|
|
42694
42694
|
return (0, lines_1.concat)([
|
|
42695
|
-
path3.call(
|
|
42696
|
-
path3.call(
|
|
42695
|
+
path3.call(print6, "id"),
|
|
42696
|
+
path3.call(print6, "typeParameters")
|
|
42697
42697
|
]);
|
|
42698
42698
|
case "DeclareInterface":
|
|
42699
42699
|
parts.push("declare ");
|
|
@@ -42702,24 +42702,24 @@ var require_printer = __commonJS({
|
|
|
42702
42702
|
if (n.declare) {
|
|
42703
42703
|
parts.push("declare ");
|
|
42704
42704
|
}
|
|
42705
|
-
parts.push("interface ", path3.call(
|
|
42705
|
+
parts.push("interface ", path3.call(print6, "id"), path3.call(print6, "typeParameters"), " ");
|
|
42706
42706
|
if (n["extends"] && n["extends"].length > 0) {
|
|
42707
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
42707
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")), " ");
|
|
42708
42708
|
}
|
|
42709
42709
|
if (n.body) {
|
|
42710
|
-
parts.push(path3.call(
|
|
42710
|
+
parts.push(path3.call(print6, "body"));
|
|
42711
42711
|
}
|
|
42712
42712
|
return (0, lines_1.concat)(parts);
|
|
42713
42713
|
case "ClassImplements":
|
|
42714
42714
|
case "InterfaceExtends":
|
|
42715
42715
|
return (0, lines_1.concat)([
|
|
42716
|
-
path3.call(
|
|
42717
|
-
path3.call(
|
|
42716
|
+
path3.call(print6, "id"),
|
|
42717
|
+
path3.call(print6, "typeParameters")
|
|
42718
42718
|
]);
|
|
42719
42719
|
case "IntersectionTypeAnnotation":
|
|
42720
|
-
return (0, lines_1.fromString)(" & ").join(path3.map(
|
|
42720
|
+
return (0, lines_1.fromString)(" & ").join(path3.map(print6, "types"));
|
|
42721
42721
|
case "NullableTypeAnnotation":
|
|
42722
|
-
return (0, lines_1.concat)(["?", path3.call(
|
|
42722
|
+
return (0, lines_1.concat)(["?", path3.call(print6, "typeAnnotation")]);
|
|
42723
42723
|
case "NullLiteralTypeAnnotation":
|
|
42724
42724
|
return (0, lines_1.fromString)("null", options);
|
|
42725
42725
|
case "ThisTypeAnnotation":
|
|
@@ -42727,40 +42727,40 @@ var require_printer = __commonJS({
|
|
|
42727
42727
|
case "NumberTypeAnnotation":
|
|
42728
42728
|
return (0, lines_1.fromString)("number", options);
|
|
42729
42729
|
case "ObjectTypeCallProperty":
|
|
42730
|
-
return path3.call(
|
|
42730
|
+
return path3.call(print6, "value");
|
|
42731
42731
|
case "ObjectTypeIndexer":
|
|
42732
42732
|
if (n.static) {
|
|
42733
42733
|
parts.push("static ");
|
|
42734
42734
|
}
|
|
42735
|
-
parts.push(printVariance(path3,
|
|
42735
|
+
parts.push(printVariance(path3, print6), "[");
|
|
42736
42736
|
if (n.id) {
|
|
42737
|
-
parts.push(path3.call(
|
|
42737
|
+
parts.push(path3.call(print6, "id"), ": ");
|
|
42738
42738
|
}
|
|
42739
|
-
parts.push(path3.call(
|
|
42739
|
+
parts.push(path3.call(print6, "key"), "]: ", path3.call(print6, "value"));
|
|
42740
42740
|
return (0, lines_1.concat)(parts);
|
|
42741
42741
|
case "ObjectTypeProperty":
|
|
42742
42742
|
return (0, lines_1.concat)([
|
|
42743
|
-
printVariance(path3,
|
|
42744
|
-
path3.call(
|
|
42743
|
+
printVariance(path3, print6),
|
|
42744
|
+
path3.call(print6, "key"),
|
|
42745
42745
|
n.optional ? "?" : "",
|
|
42746
42746
|
": ",
|
|
42747
|
-
path3.call(
|
|
42747
|
+
path3.call(print6, "value")
|
|
42748
42748
|
]);
|
|
42749
42749
|
case "ObjectTypeInternalSlot":
|
|
42750
42750
|
return (0, lines_1.concat)([
|
|
42751
42751
|
n.static ? "static " : "",
|
|
42752
42752
|
"[[",
|
|
42753
|
-
path3.call(
|
|
42753
|
+
path3.call(print6, "id"),
|
|
42754
42754
|
"]]",
|
|
42755
42755
|
n.optional ? "?" : "",
|
|
42756
42756
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
42757
|
-
path3.call(
|
|
42757
|
+
path3.call(print6, "value")
|
|
42758
42758
|
]);
|
|
42759
42759
|
case "QualifiedTypeIdentifier":
|
|
42760
42760
|
return (0, lines_1.concat)([
|
|
42761
|
-
path3.call(
|
|
42761
|
+
path3.call(print6, "qualification"),
|
|
42762
42762
|
".",
|
|
42763
|
-
path3.call(
|
|
42763
|
+
path3.call(print6, "id")
|
|
42764
42764
|
]);
|
|
42765
42765
|
case "StringLiteralTypeAnnotation":
|
|
42766
42766
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -42777,36 +42777,36 @@ var require_printer = __commonJS({
|
|
|
42777
42777
|
case "TypeAlias":
|
|
42778
42778
|
return (0, lines_1.concat)([
|
|
42779
42779
|
"type ",
|
|
42780
|
-
path3.call(
|
|
42781
|
-
path3.call(
|
|
42780
|
+
path3.call(print6, "id"),
|
|
42781
|
+
path3.call(print6, "typeParameters"),
|
|
42782
42782
|
" = ",
|
|
42783
|
-
path3.call(
|
|
42783
|
+
path3.call(print6, "right"),
|
|
42784
42784
|
";"
|
|
42785
42785
|
]);
|
|
42786
42786
|
case "DeclareOpaqueType":
|
|
42787
42787
|
parts.push("declare ");
|
|
42788
42788
|
case "OpaqueType":
|
|
42789
|
-
parts.push("opaque type ", path3.call(
|
|
42789
|
+
parts.push("opaque type ", path3.call(print6, "id"), path3.call(print6, "typeParameters"));
|
|
42790
42790
|
if (n["supertype"]) {
|
|
42791
|
-
parts.push(": ", path3.call(
|
|
42791
|
+
parts.push(": ", path3.call(print6, "supertype"));
|
|
42792
42792
|
}
|
|
42793
42793
|
if (n["impltype"]) {
|
|
42794
|
-
parts.push(" = ", path3.call(
|
|
42794
|
+
parts.push(" = ", path3.call(print6, "impltype"));
|
|
42795
42795
|
}
|
|
42796
42796
|
parts.push(";");
|
|
42797
42797
|
return (0, lines_1.concat)(parts);
|
|
42798
42798
|
case "TypeCastExpression":
|
|
42799
42799
|
return (0, lines_1.concat)([
|
|
42800
42800
|
"(",
|
|
42801
|
-
path3.call(
|
|
42802
|
-
path3.call(
|
|
42801
|
+
path3.call(print6, "expression"),
|
|
42802
|
+
path3.call(print6, "typeAnnotation"),
|
|
42803
42803
|
")"
|
|
42804
42804
|
]);
|
|
42805
42805
|
case "TypeParameterDeclaration":
|
|
42806
42806
|
case "TypeParameterInstantiation":
|
|
42807
42807
|
return (0, lines_1.concat)([
|
|
42808
42808
|
"<",
|
|
42809
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
42809
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "params")),
|
|
42810
42810
|
">"
|
|
42811
42811
|
]);
|
|
42812
42812
|
case "Variance":
|
|
@@ -42819,32 +42819,32 @@ var require_printer = __commonJS({
|
|
|
42819
42819
|
return (0, lines_1.fromString)("");
|
|
42820
42820
|
case "TypeParameter":
|
|
42821
42821
|
if (n.variance) {
|
|
42822
|
-
parts.push(printVariance(path3,
|
|
42822
|
+
parts.push(printVariance(path3, print6));
|
|
42823
42823
|
}
|
|
42824
|
-
parts.push(path3.call(
|
|
42824
|
+
parts.push(path3.call(print6, "name"));
|
|
42825
42825
|
if (n.bound) {
|
|
42826
|
-
parts.push(path3.call(
|
|
42826
|
+
parts.push(path3.call(print6, "bound"));
|
|
42827
42827
|
}
|
|
42828
42828
|
if (n["default"]) {
|
|
42829
|
-
parts.push("=", path3.call(
|
|
42829
|
+
parts.push("=", path3.call(print6, "default"));
|
|
42830
42830
|
}
|
|
42831
42831
|
return (0, lines_1.concat)(parts);
|
|
42832
42832
|
case "TypeofTypeAnnotation":
|
|
42833
42833
|
return (0, lines_1.concat)([
|
|
42834
42834
|
(0, lines_1.fromString)("typeof ", options),
|
|
42835
|
-
path3.call(
|
|
42835
|
+
path3.call(print6, "argument")
|
|
42836
42836
|
]);
|
|
42837
42837
|
case "IndexedAccessType":
|
|
42838
42838
|
case "OptionalIndexedAccessType":
|
|
42839
42839
|
return (0, lines_1.concat)([
|
|
42840
|
-
path3.call(
|
|
42840
|
+
path3.call(print6, "objectType"),
|
|
42841
42841
|
n.optional ? "?." : "",
|
|
42842
42842
|
"[",
|
|
42843
|
-
path3.call(
|
|
42843
|
+
path3.call(print6, "indexType"),
|
|
42844
42844
|
"]"
|
|
42845
42845
|
]);
|
|
42846
42846
|
case "UnionTypeAnnotation":
|
|
42847
|
-
return (0, lines_1.fromString)(" | ").join(path3.map(
|
|
42847
|
+
return (0, lines_1.fromString)(" | ").join(path3.map(print6, "types"));
|
|
42848
42848
|
case "VoidTypeAnnotation":
|
|
42849
42849
|
return (0, lines_1.fromString)("void", options);
|
|
42850
42850
|
case "NullTypeAnnotation":
|
|
@@ -42884,77 +42884,77 @@ var require_printer = __commonJS({
|
|
|
42884
42884
|
case "TSNeverKeyword":
|
|
42885
42885
|
return (0, lines_1.fromString)("never", options);
|
|
42886
42886
|
case "TSArrayType":
|
|
42887
|
-
return (0, lines_1.concat)([path3.call(
|
|
42887
|
+
return (0, lines_1.concat)([path3.call(print6, "elementType"), "[]"]);
|
|
42888
42888
|
case "TSLiteralType":
|
|
42889
|
-
return path3.call(
|
|
42889
|
+
return path3.call(print6, "literal");
|
|
42890
42890
|
case "TSUnionType":
|
|
42891
|
-
return (0, lines_1.fromString)(" | ").join(path3.map(
|
|
42891
|
+
return (0, lines_1.fromString)(" | ").join(path3.map(print6, "types"));
|
|
42892
42892
|
case "TSIntersectionType":
|
|
42893
|
-
return (0, lines_1.fromString)(" & ").join(path3.map(
|
|
42893
|
+
return (0, lines_1.fromString)(" & ").join(path3.map(print6, "types"));
|
|
42894
42894
|
case "TSConditionalType":
|
|
42895
|
-
parts.push(path3.call(
|
|
42895
|
+
parts.push(path3.call(print6, "checkType"), " extends ", path3.call(print6, "extendsType"), " ? ", path3.call(print6, "trueType"), " : ", path3.call(print6, "falseType"));
|
|
42896
42896
|
return (0, lines_1.concat)(parts);
|
|
42897
42897
|
case "TSInferType":
|
|
42898
|
-
parts.push("infer ", path3.call(
|
|
42898
|
+
parts.push("infer ", path3.call(print6, "typeParameter"));
|
|
42899
42899
|
return (0, lines_1.concat)(parts);
|
|
42900
42900
|
case "TSParenthesizedType":
|
|
42901
|
-
return (0, lines_1.concat)(["(", path3.call(
|
|
42901
|
+
return (0, lines_1.concat)(["(", path3.call(print6, "typeAnnotation"), ")"]);
|
|
42902
42902
|
case "TSFunctionType":
|
|
42903
42903
|
return (0, lines_1.concat)([
|
|
42904
|
-
path3.call(
|
|
42904
|
+
path3.call(print6, "typeParameters"),
|
|
42905
42905
|
"(",
|
|
42906
|
-
printFunctionParams(path3, options,
|
|
42906
|
+
printFunctionParams(path3, options, print6),
|
|
42907
42907
|
") => ",
|
|
42908
|
-
path3.call(
|
|
42908
|
+
path3.call(print6, "typeAnnotation", "typeAnnotation")
|
|
42909
42909
|
]);
|
|
42910
42910
|
case "TSConstructorType":
|
|
42911
42911
|
return (0, lines_1.concat)([
|
|
42912
42912
|
"new ",
|
|
42913
|
-
path3.call(
|
|
42913
|
+
path3.call(print6, "typeParameters"),
|
|
42914
42914
|
"(",
|
|
42915
|
-
printFunctionParams(path3, options,
|
|
42915
|
+
printFunctionParams(path3, options, print6),
|
|
42916
42916
|
") => ",
|
|
42917
|
-
path3.call(
|
|
42917
|
+
path3.call(print6, "typeAnnotation", "typeAnnotation")
|
|
42918
42918
|
]);
|
|
42919
42919
|
case "TSMappedType": {
|
|
42920
|
-
parts.push(n.readonly ? "readonly " : "", "[", path3.call(
|
|
42920
|
+
parts.push(n.readonly ? "readonly " : "", "[", path3.call(print6, "typeParameter"), "]", n.optional ? "?" : "");
|
|
42921
42921
|
if (n.typeAnnotation) {
|
|
42922
|
-
parts.push(": ", path3.call(
|
|
42922
|
+
parts.push(": ", path3.call(print6, "typeAnnotation"), ";");
|
|
42923
42923
|
}
|
|
42924
42924
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
42925
42925
|
}
|
|
42926
42926
|
case "TSTupleType":
|
|
42927
42927
|
return (0, lines_1.concat)([
|
|
42928
42928
|
"[",
|
|
42929
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
42929
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "elementTypes")),
|
|
42930
42930
|
"]"
|
|
42931
42931
|
]);
|
|
42932
42932
|
case "TSNamedTupleMember":
|
|
42933
|
-
parts.push(path3.call(
|
|
42933
|
+
parts.push(path3.call(print6, "label"));
|
|
42934
42934
|
if (n.optional) {
|
|
42935
42935
|
parts.push("?");
|
|
42936
42936
|
}
|
|
42937
|
-
parts.push(": ", path3.call(
|
|
42937
|
+
parts.push(": ", path3.call(print6, "elementType"));
|
|
42938
42938
|
return (0, lines_1.concat)(parts);
|
|
42939
42939
|
case "TSRestType":
|
|
42940
|
-
return (0, lines_1.concat)(["...", path3.call(
|
|
42940
|
+
return (0, lines_1.concat)(["...", path3.call(print6, "typeAnnotation")]);
|
|
42941
42941
|
case "TSOptionalType":
|
|
42942
|
-
return (0, lines_1.concat)([path3.call(
|
|
42942
|
+
return (0, lines_1.concat)([path3.call(print6, "typeAnnotation"), "?"]);
|
|
42943
42943
|
case "TSIndexedAccessType":
|
|
42944
42944
|
return (0, lines_1.concat)([
|
|
42945
|
-
path3.call(
|
|
42945
|
+
path3.call(print6, "objectType"),
|
|
42946
42946
|
"[",
|
|
42947
|
-
path3.call(
|
|
42947
|
+
path3.call(print6, "indexType"),
|
|
42948
42948
|
"]"
|
|
42949
42949
|
]);
|
|
42950
42950
|
case "TSTypeOperator":
|
|
42951
42951
|
return (0, lines_1.concat)([
|
|
42952
|
-
path3.call(
|
|
42952
|
+
path3.call(print6, "operator"),
|
|
42953
42953
|
" ",
|
|
42954
|
-
path3.call(
|
|
42954
|
+
path3.call(print6, "typeAnnotation")
|
|
42955
42955
|
]);
|
|
42956
42956
|
case "TSTypeLiteral": {
|
|
42957
|
-
var members = (0, lines_1.fromString)("\n").join(path3.map(
|
|
42957
|
+
var members = (0, lines_1.fromString)("\n").join(path3.map(print6, "members").map(function(member) {
|
|
42958
42958
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
42959
42959
|
return member.concat(";");
|
|
42960
42960
|
}
|
|
@@ -42967,13 +42967,13 @@ var require_printer = __commonJS({
|
|
|
42967
42967
|
return (0, lines_1.concat)(parts);
|
|
42968
42968
|
}
|
|
42969
42969
|
case "TSEnumMember":
|
|
42970
|
-
parts.push(path3.call(
|
|
42970
|
+
parts.push(path3.call(print6, "id"));
|
|
42971
42971
|
if (n.initializer) {
|
|
42972
|
-
parts.push(" = ", path3.call(
|
|
42972
|
+
parts.push(" = ", path3.call(print6, "initializer"));
|
|
42973
42973
|
}
|
|
42974
42974
|
return (0, lines_1.concat)(parts);
|
|
42975
42975
|
case "TSTypeQuery":
|
|
42976
|
-
return (0, lines_1.concat)(["typeof ", path3.call(
|
|
42976
|
+
return (0, lines_1.concat)(["typeof ", path3.call(print6, "exprName")]);
|
|
42977
42977
|
case "TSParameterProperty":
|
|
42978
42978
|
if (n.accessibility) {
|
|
42979
42979
|
parts.push(n.accessibility, " ");
|
|
@@ -42987,119 +42987,119 @@ var require_printer = __commonJS({
|
|
|
42987
42987
|
if (n.readonly) {
|
|
42988
42988
|
parts.push("readonly ");
|
|
42989
42989
|
}
|
|
42990
|
-
parts.push(path3.call(
|
|
42990
|
+
parts.push(path3.call(print6, "parameter"));
|
|
42991
42991
|
return (0, lines_1.concat)(parts);
|
|
42992
42992
|
case "TSTypeReference":
|
|
42993
42993
|
return (0, lines_1.concat)([
|
|
42994
|
-
path3.call(
|
|
42995
|
-
path3.call(
|
|
42994
|
+
path3.call(print6, "typeName"),
|
|
42995
|
+
path3.call(print6, "typeParameters")
|
|
42996
42996
|
]);
|
|
42997
42997
|
case "TSQualifiedName":
|
|
42998
|
-
return (0, lines_1.concat)([path3.call(
|
|
42998
|
+
return (0, lines_1.concat)([path3.call(print6, "left"), ".", path3.call(print6, "right")]);
|
|
42999
42999
|
case "TSAsExpression":
|
|
43000
43000
|
case "TSSatisfiesExpression": {
|
|
43001
|
-
var expression = path3.call(
|
|
43002
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path3.call(
|
|
43001
|
+
var expression = path3.call(print6, "expression");
|
|
43002
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path3.call(print6, "typeAnnotation"));
|
|
43003
43003
|
return (0, lines_1.concat)(parts);
|
|
43004
43004
|
}
|
|
43005
43005
|
case "TSTypeCastExpression":
|
|
43006
43006
|
return (0, lines_1.concat)([
|
|
43007
|
-
path3.call(
|
|
43008
|
-
path3.call(
|
|
43007
|
+
path3.call(print6, "expression"),
|
|
43008
|
+
path3.call(print6, "typeAnnotation")
|
|
43009
43009
|
]);
|
|
43010
43010
|
case "TSNonNullExpression":
|
|
43011
|
-
return (0, lines_1.concat)([path3.call(
|
|
43011
|
+
return (0, lines_1.concat)([path3.call(print6, "expression"), "!"]);
|
|
43012
43012
|
case "TSTypeAnnotation":
|
|
43013
|
-
return (0, lines_1.concat)([": ", path3.call(
|
|
43013
|
+
return (0, lines_1.concat)([": ", path3.call(print6, "typeAnnotation")]);
|
|
43014
43014
|
case "TSIndexSignature":
|
|
43015
43015
|
return (0, lines_1.concat)([
|
|
43016
43016
|
n.readonly ? "readonly " : "",
|
|
43017
43017
|
"[",
|
|
43018
|
-
path3.map(
|
|
43018
|
+
path3.map(print6, "parameters"),
|
|
43019
43019
|
"]",
|
|
43020
|
-
path3.call(
|
|
43020
|
+
path3.call(print6, "typeAnnotation")
|
|
43021
43021
|
]);
|
|
43022
43022
|
case "TSPropertySignature":
|
|
43023
|
-
parts.push(printVariance(path3,
|
|
43023
|
+
parts.push(printVariance(path3, print6), n.readonly ? "readonly " : "");
|
|
43024
43024
|
if (n.computed) {
|
|
43025
|
-
parts.push("[", path3.call(
|
|
43025
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
43026
43026
|
} else {
|
|
43027
|
-
parts.push(path3.call(
|
|
43027
|
+
parts.push(path3.call(print6, "key"));
|
|
43028
43028
|
}
|
|
43029
|
-
parts.push(n.optional ? "?" : "", path3.call(
|
|
43029
|
+
parts.push(n.optional ? "?" : "", path3.call(print6, "typeAnnotation"));
|
|
43030
43030
|
return (0, lines_1.concat)(parts);
|
|
43031
43031
|
case "TSMethodSignature":
|
|
43032
43032
|
if (n.computed) {
|
|
43033
|
-
parts.push("[", path3.call(
|
|
43033
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
43034
43034
|
} else {
|
|
43035
|
-
parts.push(path3.call(
|
|
43035
|
+
parts.push(path3.call(print6, "key"));
|
|
43036
43036
|
}
|
|
43037
43037
|
if (n.optional) {
|
|
43038
43038
|
parts.push("?");
|
|
43039
43039
|
}
|
|
43040
|
-
parts.push(path3.call(
|
|
43040
|
+
parts.push(path3.call(print6, "typeParameters"), "(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "typeAnnotation"));
|
|
43041
43041
|
return (0, lines_1.concat)(parts);
|
|
43042
43042
|
case "TSTypePredicate":
|
|
43043
43043
|
if (n.asserts) {
|
|
43044
43044
|
parts.push("asserts ");
|
|
43045
43045
|
}
|
|
43046
|
-
parts.push(path3.call(
|
|
43046
|
+
parts.push(path3.call(print6, "parameterName"));
|
|
43047
43047
|
if (n.typeAnnotation) {
|
|
43048
|
-
parts.push(" is ", path3.call(
|
|
43048
|
+
parts.push(" is ", path3.call(print6, "typeAnnotation", "typeAnnotation"));
|
|
43049
43049
|
}
|
|
43050
43050
|
return (0, lines_1.concat)(parts);
|
|
43051
43051
|
case "TSCallSignatureDeclaration":
|
|
43052
43052
|
return (0, lines_1.concat)([
|
|
43053
|
-
path3.call(
|
|
43053
|
+
path3.call(print6, "typeParameters"),
|
|
43054
43054
|
"(",
|
|
43055
|
-
printFunctionParams(path3, options,
|
|
43055
|
+
printFunctionParams(path3, options, print6),
|
|
43056
43056
|
")",
|
|
43057
|
-
path3.call(
|
|
43057
|
+
path3.call(print6, "typeAnnotation")
|
|
43058
43058
|
]);
|
|
43059
43059
|
case "TSConstructSignatureDeclaration":
|
|
43060
43060
|
if (n.typeParameters) {
|
|
43061
|
-
parts.push("new", path3.call(
|
|
43061
|
+
parts.push("new", path3.call(print6, "typeParameters"));
|
|
43062
43062
|
} else {
|
|
43063
43063
|
parts.push("new ");
|
|
43064
43064
|
}
|
|
43065
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
43065
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "typeAnnotation"));
|
|
43066
43066
|
return (0, lines_1.concat)(parts);
|
|
43067
43067
|
case "TSTypeAliasDeclaration":
|
|
43068
43068
|
return (0, lines_1.concat)([
|
|
43069
43069
|
n.declare ? "declare " : "",
|
|
43070
43070
|
"type ",
|
|
43071
|
-
path3.call(
|
|
43072
|
-
path3.call(
|
|
43071
|
+
path3.call(print6, "id"),
|
|
43072
|
+
path3.call(print6, "typeParameters"),
|
|
43073
43073
|
" = ",
|
|
43074
|
-
path3.call(
|
|
43074
|
+
path3.call(print6, "typeAnnotation"),
|
|
43075
43075
|
";"
|
|
43076
43076
|
]);
|
|
43077
43077
|
case "TSTypeParameter": {
|
|
43078
|
-
parts.push(path3.call(
|
|
43078
|
+
parts.push(path3.call(print6, "name"));
|
|
43079
43079
|
var parent = path3.getParentNode(0);
|
|
43080
43080
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
43081
43081
|
if (n.constraint) {
|
|
43082
|
-
parts.push(isInMappedType ? " in " : " extends ", path3.call(
|
|
43082
|
+
parts.push(isInMappedType ? " in " : " extends ", path3.call(print6, "constraint"));
|
|
43083
43083
|
}
|
|
43084
43084
|
if (n["default"]) {
|
|
43085
|
-
parts.push(" = ", path3.call(
|
|
43085
|
+
parts.push(" = ", path3.call(print6, "default"));
|
|
43086
43086
|
}
|
|
43087
43087
|
return (0, lines_1.concat)(parts);
|
|
43088
43088
|
}
|
|
43089
43089
|
case "TSTypeAssertion": {
|
|
43090
|
-
parts.push("<", path3.call(
|
|
43090
|
+
parts.push("<", path3.call(print6, "typeAnnotation"), "> ", path3.call(print6, "expression"));
|
|
43091
43091
|
return (0, lines_1.concat)(parts);
|
|
43092
43092
|
}
|
|
43093
43093
|
case "TSTypeParameterDeclaration":
|
|
43094
43094
|
case "TSTypeParameterInstantiation":
|
|
43095
43095
|
return (0, lines_1.concat)([
|
|
43096
43096
|
"<",
|
|
43097
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
43097
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "params")),
|
|
43098
43098
|
">"
|
|
43099
43099
|
]);
|
|
43100
43100
|
case "TSEnumDeclaration": {
|
|
43101
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path3.call(
|
|
43102
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path3.map(
|
|
43101
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path3.call(print6, "id"));
|
|
43102
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path3.map(print6, "members"));
|
|
43103
43103
|
if (memberLines.isEmpty()) {
|
|
43104
43104
|
parts.push(" {}");
|
|
43105
43105
|
} else {
|
|
@@ -43109,11 +43109,11 @@ var require_printer = __commonJS({
|
|
|
43109
43109
|
}
|
|
43110
43110
|
case "TSExpressionWithTypeArguments":
|
|
43111
43111
|
return (0, lines_1.concat)([
|
|
43112
|
-
path3.call(
|
|
43113
|
-
path3.call(
|
|
43112
|
+
path3.call(print6, "expression"),
|
|
43113
|
+
path3.call(print6, "typeParameters")
|
|
43114
43114
|
]);
|
|
43115
43115
|
case "TSInterfaceBody": {
|
|
43116
|
-
var lines = (0, lines_1.fromString)("\n").join(path3.map(
|
|
43116
|
+
var lines = (0, lines_1.fromString)("\n").join(path3.map(print6, "body").map(function(element) {
|
|
43117
43117
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
43118
43118
|
return element.concat(";");
|
|
43119
43119
|
}
|
|
@@ -43125,22 +43125,22 @@ var require_printer = __commonJS({
|
|
|
43125
43125
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
43126
43126
|
}
|
|
43127
43127
|
case "TSImportType":
|
|
43128
|
-
parts.push("import(", path3.call(
|
|
43128
|
+
parts.push("import(", path3.call(print6, "argument"), ")");
|
|
43129
43129
|
if (n.qualifier) {
|
|
43130
|
-
parts.push(".", path3.call(
|
|
43130
|
+
parts.push(".", path3.call(print6, "qualifier"));
|
|
43131
43131
|
}
|
|
43132
43132
|
if (n.typeParameters) {
|
|
43133
|
-
parts.push(path3.call(
|
|
43133
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
43134
43134
|
}
|
|
43135
43135
|
return (0, lines_1.concat)(parts);
|
|
43136
43136
|
case "TSImportEqualsDeclaration":
|
|
43137
43137
|
if (n.isExport) {
|
|
43138
43138
|
parts.push("export ");
|
|
43139
43139
|
}
|
|
43140
|
-
parts.push("import ", path3.call(
|
|
43140
|
+
parts.push("import ", path3.call(print6, "id"), " = ", path3.call(print6, "moduleReference"));
|
|
43141
43141
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
43142
43142
|
case "TSExternalModuleReference":
|
|
43143
|
-
return (0, lines_1.concat)(["require(", path3.call(
|
|
43143
|
+
return (0, lines_1.concat)(["require(", path3.call(print6, "expression"), ")"]);
|
|
43144
43144
|
case "TSModuleDeclaration": {
|
|
43145
43145
|
var parent = path3.getParentNode();
|
|
43146
43146
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -43165,16 +43165,16 @@ var require_printer = __commonJS({
|
|
|
43165
43165
|
}
|
|
43166
43166
|
}
|
|
43167
43167
|
}
|
|
43168
|
-
parts.push(path3.call(
|
|
43168
|
+
parts.push(path3.call(print6, "id"));
|
|
43169
43169
|
if (n.body) {
|
|
43170
43170
|
parts.push(" ");
|
|
43171
|
-
parts.push(path3.call(
|
|
43171
|
+
parts.push(path3.call(print6, "body"));
|
|
43172
43172
|
}
|
|
43173
43173
|
return (0, lines_1.concat)(parts);
|
|
43174
43174
|
}
|
|
43175
43175
|
case "TSModuleBlock": {
|
|
43176
43176
|
var naked = path3.call(function(bodyPath) {
|
|
43177
|
-
return printStatementSequence(bodyPath, options,
|
|
43177
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
43178
43178
|
}, "body");
|
|
43179
43179
|
if (naked.isEmpty()) {
|
|
43180
43180
|
parts.push("{}");
|
|
@@ -43184,11 +43184,11 @@ var require_printer = __commonJS({
|
|
|
43184
43184
|
return (0, lines_1.concat)(parts);
|
|
43185
43185
|
}
|
|
43186
43186
|
case "TSInstantiationExpression": {
|
|
43187
|
-
parts.push(path3.call(
|
|
43187
|
+
parts.push(path3.call(print6, "expression"), path3.call(print6, "typeParameters"));
|
|
43188
43188
|
return (0, lines_1.concat)(parts);
|
|
43189
43189
|
}
|
|
43190
43190
|
case "V8IntrinsicIdentifier":
|
|
43191
|
-
return (0, lines_1.concat)(["%", path3.call(
|
|
43191
|
+
return (0, lines_1.concat)(["%", path3.call(print6, "name")]);
|
|
43192
43192
|
case "TopicReference":
|
|
43193
43193
|
return (0, lines_1.fromString)("#");
|
|
43194
43194
|
case "ClassHeritage":
|
|
@@ -43238,7 +43238,7 @@ var require_printer = __commonJS({
|
|
|
43238
43238
|
}
|
|
43239
43239
|
return (0, lines_1.concat)(parts);
|
|
43240
43240
|
}
|
|
43241
|
-
function printStatementSequence(path3, options,
|
|
43241
|
+
function printStatementSequence(path3, options, print6) {
|
|
43242
43242
|
var filtered = [];
|
|
43243
43243
|
var sawComment = false;
|
|
43244
43244
|
var sawStatement = false;
|
|
@@ -43259,7 +43259,7 @@ var require_printer = __commonJS({
|
|
|
43259
43259
|
}
|
|
43260
43260
|
filtered.push({
|
|
43261
43261
|
node: stmt,
|
|
43262
|
-
printed:
|
|
43262
|
+
printed: print6(stmtPath)
|
|
43263
43263
|
});
|
|
43264
43264
|
});
|
|
43265
43265
|
if (sawComment) {
|
|
@@ -43351,7 +43351,7 @@ var require_printer = __commonJS({
|
|
|
43351
43351
|
}
|
|
43352
43352
|
return parts;
|
|
43353
43353
|
}
|
|
43354
|
-
function printMethod(path3, options,
|
|
43354
|
+
function printMethod(path3, options, print6) {
|
|
43355
43355
|
var node = path3.getNode();
|
|
43356
43356
|
var kind = node.kind;
|
|
43357
43357
|
var parts = [];
|
|
@@ -43369,7 +43369,7 @@ var require_printer = __commonJS({
|
|
|
43369
43369
|
if (kind === "get" || kind === "set") {
|
|
43370
43370
|
parts.push(kind, " ");
|
|
43371
43371
|
}
|
|
43372
|
-
var key = path3.call(
|
|
43372
|
+
var key = path3.call(print6, "key");
|
|
43373
43373
|
if (node.computed) {
|
|
43374
43374
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
43375
43375
|
}
|
|
@@ -43378,26 +43378,26 @@ var require_printer = __commonJS({
|
|
|
43378
43378
|
parts.push("?");
|
|
43379
43379
|
}
|
|
43380
43380
|
if (node === nodeValue) {
|
|
43381
|
-
parts.push(path3.call(
|
|
43381
|
+
parts.push(path3.call(print6, "typeParameters"), "(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
43382
43382
|
if (node.body) {
|
|
43383
|
-
parts.push(" ", path3.call(
|
|
43383
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
43384
43384
|
} else {
|
|
43385
43385
|
parts.push(";");
|
|
43386
43386
|
}
|
|
43387
43387
|
} else {
|
|
43388
|
-
parts.push(path3.call(
|
|
43389
|
-
return printFunctionParams(valuePath, options,
|
|
43390
|
-
}, "value"), ")", path3.call(
|
|
43388
|
+
parts.push(path3.call(print6, "value", "typeParameters"), "(", path3.call(function(valuePath) {
|
|
43389
|
+
return printFunctionParams(valuePath, options, print6);
|
|
43390
|
+
}, "value"), ")", path3.call(print6, "value", "returnType"));
|
|
43391
43391
|
if (nodeValue.body) {
|
|
43392
|
-
parts.push(" ", path3.call(
|
|
43392
|
+
parts.push(" ", path3.call(print6, "value", "body"));
|
|
43393
43393
|
} else {
|
|
43394
43394
|
parts.push(";");
|
|
43395
43395
|
}
|
|
43396
43396
|
}
|
|
43397
43397
|
return (0, lines_1.concat)(parts);
|
|
43398
43398
|
}
|
|
43399
|
-
function printArgumentsList(path3, options,
|
|
43400
|
-
var printed = path3.map(
|
|
43399
|
+
function printArgumentsList(path3, options, print6) {
|
|
43400
|
+
var printed = path3.map(print6, "arguments");
|
|
43401
43401
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
43402
43402
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
43403
43403
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -43410,28 +43410,28 @@ var require_printer = __commonJS({
|
|
|
43410
43410
|
}
|
|
43411
43411
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
43412
43412
|
}
|
|
43413
|
-
function printFunctionParams(path3, options,
|
|
43413
|
+
function printFunctionParams(path3, options, print6) {
|
|
43414
43414
|
var fun = path3.getValue();
|
|
43415
43415
|
var params;
|
|
43416
43416
|
var printed = [];
|
|
43417
43417
|
if (fun.params) {
|
|
43418
43418
|
params = fun.params;
|
|
43419
|
-
printed = path3.map(
|
|
43419
|
+
printed = path3.map(print6, "params");
|
|
43420
43420
|
} else if (fun.parameters) {
|
|
43421
43421
|
params = fun.parameters;
|
|
43422
|
-
printed = path3.map(
|
|
43422
|
+
printed = path3.map(print6, "parameters");
|
|
43423
43423
|
}
|
|
43424
43424
|
if (fun.defaults) {
|
|
43425
43425
|
path3.each(function(defExprPath) {
|
|
43426
43426
|
var i2 = defExprPath.getName();
|
|
43427
43427
|
var p = printed[i2];
|
|
43428
43428
|
if (p && defExprPath.getValue()) {
|
|
43429
|
-
printed[i2] = (0, lines_1.concat)([p, " = ",
|
|
43429
|
+
printed[i2] = (0, lines_1.concat)([p, " = ", print6(defExprPath)]);
|
|
43430
43430
|
}
|
|
43431
43431
|
}, "defaults");
|
|
43432
43432
|
}
|
|
43433
43433
|
if (fun.rest) {
|
|
43434
|
-
printed.push((0, lines_1.concat)(["...", path3.call(
|
|
43434
|
+
printed.push((0, lines_1.concat)(["...", path3.call(print6, "rest")]));
|
|
43435
43435
|
}
|
|
43436
43436
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
43437
43437
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -43445,11 +43445,11 @@ var require_printer = __commonJS({
|
|
|
43445
43445
|
}
|
|
43446
43446
|
return joined;
|
|
43447
43447
|
}
|
|
43448
|
-
function maybePrintImportAssertions(path3, options,
|
|
43448
|
+
function maybePrintImportAssertions(path3, options, print6) {
|
|
43449
43449
|
var n = path3.getValue();
|
|
43450
43450
|
if (n.assertions && n.assertions.length > 0) {
|
|
43451
43451
|
var parts = [" assert {"];
|
|
43452
|
-
var printed = path3.map(
|
|
43452
|
+
var printed = path3.map(print6, "assertions");
|
|
43453
43453
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
43454
43454
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
43455
43455
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -43460,7 +43460,7 @@ var require_printer = __commonJS({
|
|
|
43460
43460
|
}
|
|
43461
43461
|
return (0, lines_1.fromString)("");
|
|
43462
43462
|
}
|
|
43463
|
-
function printExportDeclaration(path3, options,
|
|
43463
|
+
function printExportDeclaration(path3, options, print6) {
|
|
43464
43464
|
var decl = path3.getValue();
|
|
43465
43465
|
var parts = ["export "];
|
|
43466
43466
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -43474,7 +43474,7 @@ var require_printer = __commonJS({
|
|
|
43474
43474
|
parts.push("default ");
|
|
43475
43475
|
}
|
|
43476
43476
|
if (decl.declaration) {
|
|
43477
|
-
parts.push(path3.call(
|
|
43477
|
+
parts.push(path3.call(print6, "declaration"));
|
|
43478
43478
|
} else if (decl.specifiers) {
|
|
43479
43479
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
43480
43480
|
parts.push("*");
|
|
@@ -43486,9 +43486,9 @@ var require_printer = __commonJS({
|
|
|
43486
43486
|
path3.each(function(specifierPath) {
|
|
43487
43487
|
var spec = specifierPath.getValue();
|
|
43488
43488
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
43489
|
-
unbracedSpecifiers_2.push(
|
|
43489
|
+
unbracedSpecifiers_2.push(print6(specifierPath));
|
|
43490
43490
|
} else {
|
|
43491
|
-
bracedSpecifiers_2.push(
|
|
43491
|
+
bracedSpecifiers_2.push(print6(specifierPath));
|
|
43492
43492
|
}
|
|
43493
43493
|
}, "specifiers");
|
|
43494
43494
|
unbracedSpecifiers_2.forEach(function(lines2, i2) {
|
|
@@ -43517,10 +43517,10 @@ var require_printer = __commonJS({
|
|
|
43517
43517
|
}
|
|
43518
43518
|
}
|
|
43519
43519
|
} else {
|
|
43520
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path3.map(
|
|
43520
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path3.map(print6, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
43521
43521
|
}
|
|
43522
43522
|
if (decl.source) {
|
|
43523
|
-
parts.push(" from ", path3.call(
|
|
43523
|
+
parts.push(" from ", path3.call(print6, "source"), maybePrintImportAssertions(path3, options, print6));
|
|
43524
43524
|
}
|
|
43525
43525
|
}
|
|
43526
43526
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -43538,7 +43538,7 @@ var require_printer = __commonJS({
|
|
|
43538
43538
|
}
|
|
43539
43539
|
return (0, lines_1.concat)(parts);
|
|
43540
43540
|
}
|
|
43541
|
-
function printVariance(path3,
|
|
43541
|
+
function printVariance(path3, print6) {
|
|
43542
43542
|
return path3.call(function(variancePath) {
|
|
43543
43543
|
var value = variancePath.getValue();
|
|
43544
43544
|
if (value) {
|
|
@@ -43548,7 +43548,7 @@ var require_printer = __commonJS({
|
|
|
43548
43548
|
if (value === "minus") {
|
|
43549
43549
|
return (0, lines_1.fromString)("-");
|
|
43550
43550
|
}
|
|
43551
|
-
return
|
|
43551
|
+
return print6(variancePath);
|
|
43552
43552
|
}
|
|
43553
43553
|
return (0, lines_1.fromString)("");
|
|
43554
43554
|
}, "variance");
|
|
@@ -43635,10 +43635,10 @@ var require_main2 = __commonJS({
|
|
|
43635
43635
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
43636
43636
|
return ast_types_1.visit;
|
|
43637
43637
|
} });
|
|
43638
|
-
function
|
|
43638
|
+
function print6(node, options) {
|
|
43639
43639
|
return new printer_1.Printer(options).print(node);
|
|
43640
43640
|
}
|
|
43641
|
-
exports.print =
|
|
43641
|
+
exports.print = print6;
|
|
43642
43642
|
function prettyPrint2(node, options) {
|
|
43643
43643
|
return new printer_1.Printer(options).printGenerically(node);
|
|
43644
43644
|
}
|
|
@@ -43662,7 +43662,7 @@ var require_main2 = __commonJS({
|
|
|
43662
43662
|
function runString(code, transformer, options) {
|
|
43663
43663
|
var writeback = options && options.writeback || defaultWriteback;
|
|
43664
43664
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
43665
|
-
writeback(
|
|
43665
|
+
writeback(print6(node, options).code);
|
|
43666
43666
|
});
|
|
43667
43667
|
}
|
|
43668
43668
|
}
|
|
@@ -58647,6 +58647,7 @@ __export(lib_exports, {
|
|
|
58647
58647
|
path: () => path_exports,
|
|
58648
58648
|
plugin: () => plugin,
|
|
58649
58649
|
printJS: () => printJS,
|
|
58650
|
+
processComponentFieldDirective: () => processComponentFieldDirective,
|
|
58650
58651
|
pullSchema: () => pullSchema,
|
|
58651
58652
|
query: () => query,
|
|
58652
58653
|
readConfigFile: () => readConfigFile,
|
|
@@ -58661,9 +58662,9 @@ __export(lib_exports, {
|
|
|
58661
58662
|
module.exports = __toCommonJS(lib_exports);
|
|
58662
58663
|
|
|
58663
58664
|
// src/lib/pipeline.ts
|
|
58664
|
-
async function runPipeline(
|
|
58665
|
+
async function runPipeline(config, pipeline2, target) {
|
|
58665
58666
|
for (const transform of pipeline2) {
|
|
58666
|
-
await transform?.(
|
|
58667
|
+
await transform?.(config, target);
|
|
58667
58668
|
}
|
|
58668
58669
|
}
|
|
58669
58670
|
|
|
@@ -59775,35 +59776,35 @@ function rewireTypes(originalTypeMap, directives) {
|
|
|
59775
59776
|
}
|
|
59776
59777
|
function rewireNamedType(type) {
|
|
59777
59778
|
if ((0, import_graphql9.isObjectType)(type)) {
|
|
59778
|
-
const
|
|
59779
|
+
const config = type.toConfig();
|
|
59779
59780
|
const newConfig = {
|
|
59780
|
-
...
|
|
59781
|
-
fields: () => rewireFields(
|
|
59782
|
-
interfaces: () => rewireNamedTypes(
|
|
59781
|
+
...config,
|
|
59782
|
+
fields: () => rewireFields(config.fields),
|
|
59783
|
+
interfaces: () => rewireNamedTypes(config.interfaces)
|
|
59783
59784
|
};
|
|
59784
59785
|
return new import_graphql9.GraphQLObjectType(newConfig);
|
|
59785
59786
|
} else if ((0, import_graphql9.isInterfaceType)(type)) {
|
|
59786
|
-
const
|
|
59787
|
+
const config = type.toConfig();
|
|
59787
59788
|
const newConfig = {
|
|
59788
|
-
...
|
|
59789
|
-
fields: () => rewireFields(
|
|
59789
|
+
...config,
|
|
59790
|
+
fields: () => rewireFields(config.fields)
|
|
59790
59791
|
};
|
|
59791
59792
|
if ("interfaces" in newConfig) {
|
|
59792
|
-
newConfig.interfaces = () => rewireNamedTypes(
|
|
59793
|
+
newConfig.interfaces = () => rewireNamedTypes(config.interfaces);
|
|
59793
59794
|
}
|
|
59794
59795
|
return new import_graphql9.GraphQLInterfaceType(newConfig);
|
|
59795
59796
|
} else if ((0, import_graphql9.isUnionType)(type)) {
|
|
59796
|
-
const
|
|
59797
|
+
const config = type.toConfig();
|
|
59797
59798
|
const newConfig = {
|
|
59798
|
-
...
|
|
59799
|
-
types: () => rewireNamedTypes(
|
|
59799
|
+
...config,
|
|
59800
|
+
types: () => rewireNamedTypes(config.types)
|
|
59800
59801
|
};
|
|
59801
59802
|
return new import_graphql9.GraphQLUnionType(newConfig);
|
|
59802
59803
|
} else if ((0, import_graphql9.isInputObjectType)(type)) {
|
|
59803
|
-
const
|
|
59804
|
+
const config = type.toConfig();
|
|
59804
59805
|
const newConfig = {
|
|
59805
|
-
...
|
|
59806
|
-
fields: () => rewireInputFields(
|
|
59806
|
+
...config,
|
|
59807
|
+
fields: () => rewireInputFields(config.fields)
|
|
59807
59808
|
};
|
|
59808
59809
|
return new import_graphql9.GraphQLInputObjectType(newConfig);
|
|
59809
59810
|
} else if ((0, import_graphql9.isEnumType)(type)) {
|
|
@@ -59960,8 +59961,8 @@ function mapEnumValues(originalTypeMap, schema, schemaMapper) {
|
|
|
59960
59961
|
}
|
|
59961
59962
|
return mapTypes(originalTypeMap, schema, {
|
|
59962
59963
|
[MapperKind.ENUM_TYPE]: (type) => {
|
|
59963
|
-
const
|
|
59964
|
-
const originalEnumValueConfigMap =
|
|
59964
|
+
const config = type.toConfig();
|
|
59965
|
+
const originalEnumValueConfigMap = config.values;
|
|
59965
59966
|
const newEnumValueConfigMap = {};
|
|
59966
59967
|
for (const externalValue in originalEnumValueConfigMap) {
|
|
59967
59968
|
const originalEnumValueConfig = originalEnumValueConfigMap[externalValue];
|
|
@@ -59976,7 +59977,7 @@ function mapEnumValues(originalTypeMap, schema, schemaMapper) {
|
|
|
59976
59977
|
}
|
|
59977
59978
|
}
|
|
59978
59979
|
return correctASTNodes(new import_graphql11.GraphQLEnumType({
|
|
59979
|
-
...
|
|
59980
|
+
...config,
|
|
59980
59981
|
values: newEnumValueConfigMap
|
|
59981
59982
|
}));
|
|
59982
59983
|
}
|
|
@@ -60039,8 +60040,8 @@ function mapFields(originalTypeMap, schema, schemaMapper) {
|
|
|
60039
60040
|
newTypeMap[typeName] = originalType;
|
|
60040
60041
|
continue;
|
|
60041
60042
|
}
|
|
60042
|
-
const
|
|
60043
|
-
const originalFieldConfigMap =
|
|
60043
|
+
const config = originalType.toConfig();
|
|
60044
|
+
const originalFieldConfigMap = config.fields;
|
|
60044
60045
|
const newFieldConfigMap = {};
|
|
60045
60046
|
for (const fieldName in originalFieldConfigMap) {
|
|
60046
60047
|
const originalFieldConfig = originalFieldConfigMap[fieldName];
|
|
@@ -60065,17 +60066,17 @@ function mapFields(originalTypeMap, schema, schemaMapper) {
|
|
|
60065
60066
|
}
|
|
60066
60067
|
if ((0, import_graphql11.isObjectType)(originalType)) {
|
|
60067
60068
|
newTypeMap[typeName] = correctASTNodes(new import_graphql11.GraphQLObjectType({
|
|
60068
|
-
...
|
|
60069
|
+
...config,
|
|
60069
60070
|
fields: newFieldConfigMap
|
|
60070
60071
|
}));
|
|
60071
60072
|
} else if ((0, import_graphql11.isInterfaceType)(originalType)) {
|
|
60072
60073
|
newTypeMap[typeName] = correctASTNodes(new import_graphql11.GraphQLInterfaceType({
|
|
60073
|
-
...
|
|
60074
|
+
...config,
|
|
60074
60075
|
fields: newFieldConfigMap
|
|
60075
60076
|
}));
|
|
60076
60077
|
} else {
|
|
60077
60078
|
newTypeMap[typeName] = correctASTNodes(new import_graphql11.GraphQLInputObjectType({
|
|
60078
|
-
...
|
|
60079
|
+
...config,
|
|
60079
60080
|
fields: newFieldConfigMap
|
|
60080
60081
|
}));
|
|
60081
60082
|
}
|
|
@@ -60097,8 +60098,8 @@ function mapArguments(originalTypeMap, schema, schemaMapper) {
|
|
|
60097
60098
|
newTypeMap[typeName] = originalType;
|
|
60098
60099
|
continue;
|
|
60099
60100
|
}
|
|
60100
|
-
const
|
|
60101
|
-
const originalFieldConfigMap =
|
|
60101
|
+
const config = originalType.toConfig();
|
|
60102
|
+
const originalFieldConfigMap = config.fields;
|
|
60102
60103
|
const newFieldConfigMap = {};
|
|
60103
60104
|
for (const fieldName in originalFieldConfigMap) {
|
|
60104
60105
|
const originalFieldConfig = originalFieldConfigMap[fieldName];
|
|
@@ -60132,17 +60133,17 @@ function mapArguments(originalTypeMap, schema, schemaMapper) {
|
|
|
60132
60133
|
}
|
|
60133
60134
|
if ((0, import_graphql11.isObjectType)(originalType)) {
|
|
60134
60135
|
newTypeMap[typeName] = new import_graphql11.GraphQLObjectType({
|
|
60135
|
-
...
|
|
60136
|
+
...config,
|
|
60136
60137
|
fields: newFieldConfigMap
|
|
60137
60138
|
});
|
|
60138
60139
|
} else if ((0, import_graphql11.isInterfaceType)(originalType)) {
|
|
60139
60140
|
newTypeMap[typeName] = new import_graphql11.GraphQLInterfaceType({
|
|
60140
|
-
...
|
|
60141
|
+
...config,
|
|
60141
60142
|
fields: newFieldConfigMap
|
|
60142
60143
|
});
|
|
60143
60144
|
} else {
|
|
60144
60145
|
newTypeMap[typeName] = new import_graphql11.GraphQLInputObjectType({
|
|
60145
|
-
...
|
|
60146
|
+
...config,
|
|
60146
60147
|
fields: newFieldConfigMap
|
|
60147
60148
|
});
|
|
60148
60149
|
}
|
|
@@ -60246,99 +60247,99 @@ function getEnumValueMapper(schemaMapper) {
|
|
|
60246
60247
|
}
|
|
60247
60248
|
function correctASTNodes(type) {
|
|
60248
60249
|
if ((0, import_graphql11.isObjectType)(type)) {
|
|
60249
|
-
const
|
|
60250
|
-
if (
|
|
60250
|
+
const config = type.toConfig();
|
|
60251
|
+
if (config.astNode != null) {
|
|
60251
60252
|
const fields = [];
|
|
60252
|
-
for (const fieldName in
|
|
60253
|
-
const fieldConfig =
|
|
60253
|
+
for (const fieldName in config.fields) {
|
|
60254
|
+
const fieldConfig = config.fields[fieldName];
|
|
60254
60255
|
if (fieldConfig.astNode != null) {
|
|
60255
60256
|
fields.push(fieldConfig.astNode);
|
|
60256
60257
|
}
|
|
60257
60258
|
}
|
|
60258
|
-
|
|
60259
|
-
...
|
|
60259
|
+
config.astNode = {
|
|
60260
|
+
...config.astNode,
|
|
60260
60261
|
kind: import_graphql11.Kind.OBJECT_TYPE_DEFINITION,
|
|
60261
60262
|
fields
|
|
60262
60263
|
};
|
|
60263
60264
|
}
|
|
60264
|
-
if (
|
|
60265
|
-
|
|
60265
|
+
if (config.extensionASTNodes != null) {
|
|
60266
|
+
config.extensionASTNodes = config.extensionASTNodes.map((node) => ({
|
|
60266
60267
|
...node,
|
|
60267
60268
|
kind: import_graphql11.Kind.OBJECT_TYPE_EXTENSION,
|
|
60268
60269
|
fields: void 0
|
|
60269
60270
|
}));
|
|
60270
60271
|
}
|
|
60271
|
-
return new import_graphql11.GraphQLObjectType(
|
|
60272
|
+
return new import_graphql11.GraphQLObjectType(config);
|
|
60272
60273
|
} else if ((0, import_graphql11.isInterfaceType)(type)) {
|
|
60273
|
-
const
|
|
60274
|
-
if (
|
|
60274
|
+
const config = type.toConfig();
|
|
60275
|
+
if (config.astNode != null) {
|
|
60275
60276
|
const fields = [];
|
|
60276
|
-
for (const fieldName in
|
|
60277
|
-
const fieldConfig =
|
|
60277
|
+
for (const fieldName in config.fields) {
|
|
60278
|
+
const fieldConfig = config.fields[fieldName];
|
|
60278
60279
|
if (fieldConfig.astNode != null) {
|
|
60279
60280
|
fields.push(fieldConfig.astNode);
|
|
60280
60281
|
}
|
|
60281
60282
|
}
|
|
60282
|
-
|
|
60283
|
-
...
|
|
60283
|
+
config.astNode = {
|
|
60284
|
+
...config.astNode,
|
|
60284
60285
|
kind: import_graphql11.Kind.INTERFACE_TYPE_DEFINITION,
|
|
60285
60286
|
fields
|
|
60286
60287
|
};
|
|
60287
60288
|
}
|
|
60288
|
-
if (
|
|
60289
|
-
|
|
60289
|
+
if (config.extensionASTNodes != null) {
|
|
60290
|
+
config.extensionASTNodes = config.extensionASTNodes.map((node) => ({
|
|
60290
60291
|
...node,
|
|
60291
60292
|
kind: import_graphql11.Kind.INTERFACE_TYPE_EXTENSION,
|
|
60292
60293
|
fields: void 0
|
|
60293
60294
|
}));
|
|
60294
60295
|
}
|
|
60295
|
-
return new import_graphql11.GraphQLInterfaceType(
|
|
60296
|
+
return new import_graphql11.GraphQLInterfaceType(config);
|
|
60296
60297
|
} else if ((0, import_graphql11.isInputObjectType)(type)) {
|
|
60297
|
-
const
|
|
60298
|
-
if (
|
|
60298
|
+
const config = type.toConfig();
|
|
60299
|
+
if (config.astNode != null) {
|
|
60299
60300
|
const fields = [];
|
|
60300
|
-
for (const fieldName in
|
|
60301
|
-
const fieldConfig =
|
|
60301
|
+
for (const fieldName in config.fields) {
|
|
60302
|
+
const fieldConfig = config.fields[fieldName];
|
|
60302
60303
|
if (fieldConfig.astNode != null) {
|
|
60303
60304
|
fields.push(fieldConfig.astNode);
|
|
60304
60305
|
}
|
|
60305
60306
|
}
|
|
60306
|
-
|
|
60307
|
-
...
|
|
60307
|
+
config.astNode = {
|
|
60308
|
+
...config.astNode,
|
|
60308
60309
|
kind: import_graphql11.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
60309
60310
|
fields
|
|
60310
60311
|
};
|
|
60311
60312
|
}
|
|
60312
|
-
if (
|
|
60313
|
-
|
|
60313
|
+
if (config.extensionASTNodes != null) {
|
|
60314
|
+
config.extensionASTNodes = config.extensionASTNodes.map((node) => ({
|
|
60314
60315
|
...node,
|
|
60315
60316
|
kind: import_graphql11.Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
60316
60317
|
fields: void 0
|
|
60317
60318
|
}));
|
|
60318
60319
|
}
|
|
60319
|
-
return new import_graphql11.GraphQLInputObjectType(
|
|
60320
|
+
return new import_graphql11.GraphQLInputObjectType(config);
|
|
60320
60321
|
} else if ((0, import_graphql11.isEnumType)(type)) {
|
|
60321
|
-
const
|
|
60322
|
-
if (
|
|
60322
|
+
const config = type.toConfig();
|
|
60323
|
+
if (config.astNode != null) {
|
|
60323
60324
|
const values = [];
|
|
60324
|
-
for (const enumKey in
|
|
60325
|
-
const enumValueConfig =
|
|
60325
|
+
for (const enumKey in config.values) {
|
|
60326
|
+
const enumValueConfig = config.values[enumKey];
|
|
60326
60327
|
if (enumValueConfig.astNode != null) {
|
|
60327
60328
|
values.push(enumValueConfig.astNode);
|
|
60328
60329
|
}
|
|
60329
60330
|
}
|
|
60330
|
-
|
|
60331
|
-
...
|
|
60331
|
+
config.astNode = {
|
|
60332
|
+
...config.astNode,
|
|
60332
60333
|
values
|
|
60333
60334
|
};
|
|
60334
60335
|
}
|
|
60335
|
-
if (
|
|
60336
|
-
|
|
60336
|
+
if (config.extensionASTNodes != null) {
|
|
60337
|
+
config.extensionASTNodes = config.extensionASTNodes.map((node) => ({
|
|
60337
60338
|
...node,
|
|
60338
60339
|
values: void 0
|
|
60339
60340
|
}));
|
|
60340
60341
|
}
|
|
60341
|
-
return new import_graphql11.GraphQLEnumType(
|
|
60342
|
+
return new import_graphql11.GraphQLEnumType(config);
|
|
60342
60343
|
} else {
|
|
60343
60344
|
return type;
|
|
60344
60345
|
}
|
|
@@ -60472,9 +60473,9 @@ function getResolversFromSchema(schema, includeDefaultMergedResolver) {
|
|
|
60472
60473
|
const type = typeMap[typeName];
|
|
60473
60474
|
if ((0, import_graphql13.isScalarType)(type)) {
|
|
60474
60475
|
if (!(0, import_graphql13.isSpecifiedScalarType)(type)) {
|
|
60475
|
-
const
|
|
60476
|
-
delete
|
|
60477
|
-
resolvers[typeName] = new import_graphql13.GraphQLScalarType(
|
|
60476
|
+
const config = type.toConfig();
|
|
60477
|
+
delete config.astNode;
|
|
60478
|
+
resolvers[typeName] = new import_graphql13.GraphQLScalarType(config);
|
|
60478
60479
|
}
|
|
60479
60480
|
} else if ((0, import_graphql13.isEnumType)(type)) {
|
|
60480
60481
|
resolvers[typeName] = {};
|
|
@@ -60850,26 +60851,26 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
|
|
|
60850
60851
|
}
|
|
60851
60852
|
}
|
|
60852
60853
|
} else if ((0, import_graphql18.isEnumType)(type)) {
|
|
60853
|
-
const
|
|
60854
|
-
const enumValueConfigMap =
|
|
60854
|
+
const config = type.toConfig();
|
|
60855
|
+
const enumValueConfigMap = config.values;
|
|
60855
60856
|
for (const fieldName in resolverValue) {
|
|
60856
60857
|
if (fieldName.startsWith("__")) {
|
|
60857
|
-
|
|
60858
|
-
} else if (fieldName === "astNode" &&
|
|
60859
|
-
|
|
60860
|
-
...
|
|
60861
|
-
description: (_h = (_g = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _g === void 0 ? void 0 : _g.description) !== null && _h !== void 0 ? _h :
|
|
60862
|
-
directives: ((_j =
|
|
60858
|
+
config[fieldName.substring(2)] = resolverValue[fieldName];
|
|
60859
|
+
} else if (fieldName === "astNode" && config.astNode != null) {
|
|
60860
|
+
config.astNode = {
|
|
60861
|
+
...config.astNode,
|
|
60862
|
+
description: (_h = (_g = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _g === void 0 ? void 0 : _g.description) !== null && _h !== void 0 ? _h : config.astNode.description,
|
|
60863
|
+
directives: ((_j = config.astNode.directives) !== null && _j !== void 0 ? _j : []).concat((_l = (_k = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _k === void 0 ? void 0 : _k.directives) !== null && _l !== void 0 ? _l : [])
|
|
60863
60864
|
};
|
|
60864
|
-
} else if (fieldName === "extensionASTNodes" &&
|
|
60865
|
-
|
|
60865
|
+
} else if (fieldName === "extensionASTNodes" && config.extensionASTNodes != null) {
|
|
60866
|
+
config.extensionASTNodes = config.extensionASTNodes.concat((_m = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.extensionASTNodes) !== null && _m !== void 0 ? _m : []);
|
|
60866
60867
|
} else if (fieldName === "extensions" && type.extensions != null && resolverValue.extensions != null) {
|
|
60867
60868
|
type.extensions = Object.assign(/* @__PURE__ */ Object.create(null), type.extensions, resolverValue.extensions);
|
|
60868
60869
|
} else if (enumValueConfigMap[fieldName]) {
|
|
60869
60870
|
enumValueConfigMap[fieldName].value = resolverValue[fieldName];
|
|
60870
60871
|
}
|
|
60871
60872
|
}
|
|
60872
|
-
typeMap[typeName] = new import_graphql18.GraphQLEnumType(
|
|
60873
|
+
typeMap[typeName] = new import_graphql18.GraphQLEnumType(config);
|
|
60873
60874
|
} else if ((0, import_graphql18.isUnionType)(type)) {
|
|
60874
60875
|
for (const fieldName in resolverValue) {
|
|
60875
60876
|
if (fieldName.startsWith("__")) {
|
|
@@ -60911,83 +60912,83 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
|
|
|
60911
60912
|
schema = mapSchema(schema, {
|
|
60912
60913
|
[MapperKind.SCALAR_TYPE]: (type) => {
|
|
60913
60914
|
var _a, _b, _c, _d, _e, _f;
|
|
60914
|
-
const
|
|
60915
|
+
const config = type.toConfig();
|
|
60915
60916
|
const resolverValue = resolvers[type.name];
|
|
60916
60917
|
if (!(0, import_graphql18.isSpecifiedScalarType)(type) && resolverValue != null) {
|
|
60917
60918
|
for (const fieldName in resolverValue) {
|
|
60918
60919
|
if (fieldName.startsWith("__")) {
|
|
60919
|
-
|
|
60920
|
-
} else if (fieldName === "astNode" &&
|
|
60921
|
-
|
|
60922
|
-
...
|
|
60923
|
-
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b :
|
|
60924
|
-
directives: ((_c =
|
|
60920
|
+
config[fieldName.substring(2)] = resolverValue[fieldName];
|
|
60921
|
+
} else if (fieldName === "astNode" && config.astNode != null) {
|
|
60922
|
+
config.astNode = {
|
|
60923
|
+
...config.astNode,
|
|
60924
|
+
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : config.astNode.description,
|
|
60925
|
+
directives: ((_c = config.astNode.directives) !== null && _c !== void 0 ? _c : []).concat((_e = (_d = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _d === void 0 ? void 0 : _d.directives) !== null && _e !== void 0 ? _e : [])
|
|
60925
60926
|
};
|
|
60926
|
-
} else if (fieldName === "extensionASTNodes" &&
|
|
60927
|
-
|
|
60928
|
-
} else if (fieldName === "extensions" &&
|
|
60929
|
-
|
|
60927
|
+
} else if (fieldName === "extensionASTNodes" && config.extensionASTNodes != null) {
|
|
60928
|
+
config.extensionASTNodes = config.extensionASTNodes.concat((_f = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.extensionASTNodes) !== null && _f !== void 0 ? _f : []);
|
|
60929
|
+
} else if (fieldName === "extensions" && config.extensions != null && resolverValue.extensions != null) {
|
|
60930
|
+
config.extensions = Object.assign(/* @__PURE__ */ Object.create(null), type.extensions, resolverValue.extensions);
|
|
60930
60931
|
} else {
|
|
60931
|
-
|
|
60932
|
+
config[fieldName] = resolverValue[fieldName];
|
|
60932
60933
|
}
|
|
60933
60934
|
}
|
|
60934
|
-
return new import_graphql18.GraphQLScalarType(
|
|
60935
|
+
return new import_graphql18.GraphQLScalarType(config);
|
|
60935
60936
|
}
|
|
60936
60937
|
},
|
|
60937
60938
|
[MapperKind.ENUM_TYPE]: (type) => {
|
|
60938
60939
|
var _a, _b, _c, _d, _e, _f;
|
|
60939
60940
|
const resolverValue = resolvers[type.name];
|
|
60940
|
-
const
|
|
60941
|
-
const enumValueConfigMap =
|
|
60941
|
+
const config = type.toConfig();
|
|
60942
|
+
const enumValueConfigMap = config.values;
|
|
60942
60943
|
if (resolverValue != null) {
|
|
60943
60944
|
for (const fieldName in resolverValue) {
|
|
60944
60945
|
if (fieldName.startsWith("__")) {
|
|
60945
|
-
|
|
60946
|
-
} else if (fieldName === "astNode" &&
|
|
60947
|
-
|
|
60948
|
-
...
|
|
60949
|
-
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b :
|
|
60950
|
-
directives: ((_c =
|
|
60946
|
+
config[fieldName.substring(2)] = resolverValue[fieldName];
|
|
60947
|
+
} else if (fieldName === "astNode" && config.astNode != null) {
|
|
60948
|
+
config.astNode = {
|
|
60949
|
+
...config.astNode,
|
|
60950
|
+
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : config.astNode.description,
|
|
60951
|
+
directives: ((_c = config.astNode.directives) !== null && _c !== void 0 ? _c : []).concat((_e = (_d = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _d === void 0 ? void 0 : _d.directives) !== null && _e !== void 0 ? _e : [])
|
|
60951
60952
|
};
|
|
60952
|
-
} else if (fieldName === "extensionASTNodes" &&
|
|
60953
|
-
|
|
60954
|
-
} else if (fieldName === "extensions" &&
|
|
60955
|
-
|
|
60953
|
+
} else if (fieldName === "extensionASTNodes" && config.extensionASTNodes != null) {
|
|
60954
|
+
config.extensionASTNodes = config.extensionASTNodes.concat((_f = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.extensionASTNodes) !== null && _f !== void 0 ? _f : []);
|
|
60955
|
+
} else if (fieldName === "extensions" && config.extensions != null && resolverValue.extensions != null) {
|
|
60956
|
+
config.extensions = Object.assign(/* @__PURE__ */ Object.create(null), type.extensions, resolverValue.extensions);
|
|
60956
60957
|
} else if (enumValueConfigMap[fieldName]) {
|
|
60957
60958
|
enumValueConfigMap[fieldName].value = resolverValue[fieldName];
|
|
60958
60959
|
}
|
|
60959
60960
|
}
|
|
60960
|
-
return new import_graphql18.GraphQLEnumType(
|
|
60961
|
+
return new import_graphql18.GraphQLEnumType(config);
|
|
60961
60962
|
}
|
|
60962
60963
|
},
|
|
60963
60964
|
[MapperKind.UNION_TYPE]: (type) => {
|
|
60964
60965
|
const resolverValue = resolvers[type.name];
|
|
60965
60966
|
if (resolverValue != null) {
|
|
60966
|
-
const
|
|
60967
|
+
const config = type.toConfig();
|
|
60967
60968
|
if (resolverValue["__resolveType"]) {
|
|
60968
|
-
|
|
60969
|
+
config.resolveType = resolverValue["__resolveType"];
|
|
60969
60970
|
}
|
|
60970
|
-
return new import_graphql18.GraphQLUnionType(
|
|
60971
|
+
return new import_graphql18.GraphQLUnionType(config);
|
|
60971
60972
|
}
|
|
60972
60973
|
},
|
|
60973
60974
|
[MapperKind.OBJECT_TYPE]: (type) => {
|
|
60974
60975
|
const resolverValue = resolvers[type.name];
|
|
60975
60976
|
if (resolverValue != null) {
|
|
60976
|
-
const
|
|
60977
|
+
const config = type.toConfig();
|
|
60977
60978
|
if (resolverValue["__isTypeOf"]) {
|
|
60978
|
-
|
|
60979
|
+
config.isTypeOf = resolverValue["__isTypeOf"];
|
|
60979
60980
|
}
|
|
60980
|
-
return new import_graphql18.GraphQLObjectType(
|
|
60981
|
+
return new import_graphql18.GraphQLObjectType(config);
|
|
60981
60982
|
}
|
|
60982
60983
|
},
|
|
60983
60984
|
[MapperKind.INTERFACE_TYPE]: (type) => {
|
|
60984
60985
|
const resolverValue = resolvers[type.name];
|
|
60985
60986
|
if (resolverValue != null) {
|
|
60986
|
-
const
|
|
60987
|
+
const config = type.toConfig();
|
|
60987
60988
|
if (resolverValue["__resolveType"]) {
|
|
60988
|
-
|
|
60989
|
+
config.resolveType = resolverValue["__resolveType"];
|
|
60989
60990
|
}
|
|
60990
|
-
return new import_graphql18.GraphQLInterfaceType(
|
|
60991
|
+
return new import_graphql18.GraphQLInterfaceType(config);
|
|
60991
60992
|
}
|
|
60992
60993
|
},
|
|
60993
60994
|
[MapperKind.COMPOSITE_FIELD]: (fieldConfig, fieldName, typeName) => {
|
|
@@ -61060,9 +61061,9 @@ function mergeResolvers(resolversDefinitions, options) {
|
|
|
61060
61061
|
}
|
|
61061
61062
|
|
|
61062
61063
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js
|
|
61063
|
-
function mergeArguments(args1, args2,
|
|
61064
|
+
function mergeArguments(args1, args2, config) {
|
|
61064
61065
|
const result = deduplicateArguments([...args2, ...args1].filter(isSome));
|
|
61065
|
-
if (
|
|
61066
|
+
if (config && config.sort) {
|
|
61066
61067
|
result.sort(compareNodes);
|
|
61067
61068
|
}
|
|
61068
61069
|
return result;
|
|
@@ -61118,8 +61119,8 @@ function deduplicateDirectives(directives) {
|
|
|
61118
61119
|
return directive;
|
|
61119
61120
|
}).filter(isSome);
|
|
61120
61121
|
}
|
|
61121
|
-
function mergeDirectives(d1 = [], d2 = [],
|
|
61122
|
-
const reverseOrder =
|
|
61122
|
+
function mergeDirectives(d1 = [], d2 = [], config) {
|
|
61123
|
+
const reverseOrder = config && config.reverseDirectives;
|
|
61123
61124
|
const asNext = reverseOrder ? d1 : d2;
|
|
61124
61125
|
const asFirst = reverseOrder ? d2 : d1;
|
|
61125
61126
|
const result = deduplicateDirectives([...asNext]);
|
|
@@ -61171,8 +61172,8 @@ function deduplicateLists(source, target, filterFn) {
|
|
|
61171
61172
|
}
|
|
61172
61173
|
|
|
61173
61174
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js
|
|
61174
|
-
function mergeEnumValues(first, second,
|
|
61175
|
-
if (
|
|
61175
|
+
function mergeEnumValues(first, second, config) {
|
|
61176
|
+
if (config === null || config === void 0 ? void 0 : config.consistentEnumMerge) {
|
|
61176
61177
|
const reversed = [];
|
|
61177
61178
|
if (first) {
|
|
61178
61179
|
reversed.push(...first);
|
|
@@ -61199,7 +61200,7 @@ function mergeEnumValues(first, second, config2) {
|
|
|
61199
61200
|
}
|
|
61200
61201
|
}
|
|
61201
61202
|
const result = [...enumValueMap.values()];
|
|
61202
|
-
if (
|
|
61203
|
+
if (config && config.sort) {
|
|
61203
61204
|
result.sort(compareNodes);
|
|
61204
61205
|
}
|
|
61205
61206
|
return result;
|
|
@@ -61207,18 +61208,18 @@ function mergeEnumValues(first, second, config2) {
|
|
|
61207
61208
|
|
|
61208
61209
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js
|
|
61209
61210
|
var import_graphql20 = require("graphql");
|
|
61210
|
-
function mergeEnum(e1, e2,
|
|
61211
|
+
function mergeEnum(e1, e2, config) {
|
|
61211
61212
|
if (e2) {
|
|
61212
61213
|
return {
|
|
61213
61214
|
name: e1.name,
|
|
61214
61215
|
description: e1["description"] || e2["description"],
|
|
61215
|
-
kind: (
|
|
61216
|
+
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || e1.kind === "EnumTypeDefinition" || e2.kind === "EnumTypeDefinition" ? "EnumTypeDefinition" : "EnumTypeExtension",
|
|
61216
61217
|
loc: e1.loc,
|
|
61217
|
-
directives: mergeDirectives(e1.directives, e2.directives,
|
|
61218
|
-
values: mergeEnumValues(e1.values, e2.values,
|
|
61218
|
+
directives: mergeDirectives(e1.directives, e2.directives, config),
|
|
61219
|
+
values: mergeEnumValues(e1.values, e2.values, config)
|
|
61219
61220
|
};
|
|
61220
61221
|
}
|
|
61221
|
-
return (
|
|
61222
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61222
61223
|
...e1,
|
|
61223
61224
|
kind: import_graphql20.Kind.ENUM_TYPE_DEFINITION
|
|
61224
61225
|
} : e1;
|
|
@@ -61281,9 +61282,9 @@ function defaultStringComparator(a, b) {
|
|
|
61281
61282
|
}
|
|
61282
61283
|
|
|
61283
61284
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js
|
|
61284
|
-
function fieldAlreadyExists(fieldsArr, otherField,
|
|
61285
|
+
function fieldAlreadyExists(fieldsArr, otherField, config) {
|
|
61285
61286
|
const result = fieldsArr.find((field) => field.name.value === otherField.name.value);
|
|
61286
|
-
if (result && !(
|
|
61287
|
+
if (result && !(config === null || config === void 0 ? void 0 : config.ignoreFieldConflicts)) {
|
|
61287
61288
|
const t1 = extractType(result.type);
|
|
61288
61289
|
const t22 = extractType(otherField.type);
|
|
61289
61290
|
if (t1.name.value !== t22.name.value) {
|
|
@@ -61292,17 +61293,17 @@ function fieldAlreadyExists(fieldsArr, otherField, config2) {
|
|
|
61292
61293
|
}
|
|
61293
61294
|
return !!result;
|
|
61294
61295
|
}
|
|
61295
|
-
function mergeFields(type, f1, f22,
|
|
61296
|
+
function mergeFields(type, f1, f22, config) {
|
|
61296
61297
|
const result = [];
|
|
61297
61298
|
if (f22 != null) {
|
|
61298
61299
|
result.push(...f22);
|
|
61299
61300
|
}
|
|
61300
61301
|
if (f1 != null) {
|
|
61301
61302
|
for (const field of f1) {
|
|
61302
|
-
if (fieldAlreadyExists(result, field,
|
|
61303
|
+
if (fieldAlreadyExists(result, field, config)) {
|
|
61303
61304
|
const existing = result.find((f3) => f3.name.value === field.name.value);
|
|
61304
|
-
if (!(
|
|
61305
|
-
if (
|
|
61305
|
+
if (!(config === null || config === void 0 ? void 0 : config.ignoreFieldConflicts)) {
|
|
61306
|
+
if (config === null || config === void 0 ? void 0 : config.throwOnConflict) {
|
|
61306
61307
|
preventConflicts(type, existing, field, false);
|
|
61307
61308
|
} else {
|
|
61308
61309
|
preventConflicts(type, existing, field, true);
|
|
@@ -61311,19 +61312,19 @@ function mergeFields(type, f1, f22, config2) {
|
|
|
61311
61312
|
existing.type = field.type;
|
|
61312
61313
|
}
|
|
61313
61314
|
}
|
|
61314
|
-
existing.arguments = mergeArguments(field["arguments"] || [], existing.arguments || [],
|
|
61315
|
-
existing.directives = mergeDirectives(field.directives, existing.directives,
|
|
61315
|
+
existing.arguments = mergeArguments(field["arguments"] || [], existing.arguments || [], config);
|
|
61316
|
+
existing.directives = mergeDirectives(field.directives, existing.directives, config);
|
|
61316
61317
|
existing.description = field.description || existing.description;
|
|
61317
61318
|
} else {
|
|
61318
61319
|
result.push(field);
|
|
61319
61320
|
}
|
|
61320
61321
|
}
|
|
61321
61322
|
}
|
|
61322
|
-
if (
|
|
61323
|
+
if (config && config.sort) {
|
|
61323
61324
|
result.sort(compareNodes);
|
|
61324
61325
|
}
|
|
61325
|
-
if (
|
|
61326
|
-
const exclusions =
|
|
61326
|
+
if (config && config.exclusions) {
|
|
61327
|
+
const exclusions = config.exclusions;
|
|
61327
61328
|
return result.filter((field) => !exclusions.includes(`${type.name.value}.${field.name.value}`));
|
|
61328
61329
|
}
|
|
61329
61330
|
return result;
|
|
@@ -61354,22 +61355,22 @@ function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
|
|
|
61354
61355
|
|
|
61355
61356
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js
|
|
61356
61357
|
var import_graphql22 = require("graphql");
|
|
61357
|
-
function mergeInputType(node, existingNode,
|
|
61358
|
+
function mergeInputType(node, existingNode, config) {
|
|
61358
61359
|
if (existingNode) {
|
|
61359
61360
|
try {
|
|
61360
61361
|
return {
|
|
61361
61362
|
name: node.name,
|
|
61362
61363
|
description: node["description"] || existingNode["description"],
|
|
61363
|
-
kind: (
|
|
61364
|
+
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || node.kind === "InputObjectTypeDefinition" || existingNode.kind === "InputObjectTypeDefinition" ? "InputObjectTypeDefinition" : "InputObjectTypeExtension",
|
|
61364
61365
|
loc: node.loc,
|
|
61365
|
-
fields: mergeFields(node, node.fields, existingNode.fields,
|
|
61366
|
-
directives: mergeDirectives(node.directives, existingNode.directives,
|
|
61366
|
+
fields: mergeFields(node, node.fields, existingNode.fields, config),
|
|
61367
|
+
directives: mergeDirectives(node.directives, existingNode.directives, config)
|
|
61367
61368
|
};
|
|
61368
61369
|
} catch (e2) {
|
|
61369
61370
|
throw new Error(`Unable to merge GraphQL input type "${node.name.value}": ${e2.message}`);
|
|
61370
61371
|
}
|
|
61371
61372
|
}
|
|
61372
|
-
return (
|
|
61373
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61373
61374
|
...node,
|
|
61374
61375
|
kind: import_graphql22.Kind.INPUT_OBJECT_TYPE_DEFINITION
|
|
61375
61376
|
} : node;
|
|
@@ -61377,23 +61378,23 @@ function mergeInputType(node, existingNode, config2) {
|
|
|
61377
61378
|
|
|
61378
61379
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js
|
|
61379
61380
|
var import_graphql23 = require("graphql");
|
|
61380
|
-
function mergeInterface(node, existingNode,
|
|
61381
|
+
function mergeInterface(node, existingNode, config) {
|
|
61381
61382
|
if (existingNode) {
|
|
61382
61383
|
try {
|
|
61383
61384
|
return {
|
|
61384
61385
|
name: node.name,
|
|
61385
61386
|
description: node["description"] || existingNode["description"],
|
|
61386
|
-
kind: (
|
|
61387
|
+
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || node.kind === "InterfaceTypeDefinition" || existingNode.kind === "InterfaceTypeDefinition" ? "InterfaceTypeDefinition" : "InterfaceTypeExtension",
|
|
61387
61388
|
loc: node.loc,
|
|
61388
|
-
fields: mergeFields(node, node.fields, existingNode.fields,
|
|
61389
|
-
directives: mergeDirectives(node.directives, existingNode.directives,
|
|
61390
|
-
interfaces: node["interfaces"] ? mergeNamedTypeArray(node["interfaces"], existingNode["interfaces"],
|
|
61389
|
+
fields: mergeFields(node, node.fields, existingNode.fields, config),
|
|
61390
|
+
directives: mergeDirectives(node.directives, existingNode.directives, config),
|
|
61391
|
+
interfaces: node["interfaces"] ? mergeNamedTypeArray(node["interfaces"], existingNode["interfaces"], config) : void 0
|
|
61391
61392
|
};
|
|
61392
61393
|
} catch (e2) {
|
|
61393
61394
|
throw new Error(`Unable to merge GraphQL interface "${node.name.value}": ${e2.message}`);
|
|
61394
61395
|
}
|
|
61395
61396
|
}
|
|
61396
|
-
return (
|
|
61397
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61397
61398
|
...node,
|
|
61398
61399
|
kind: import_graphql23.Kind.INTERFACE_TYPE_DEFINITION
|
|
61399
61400
|
} : node;
|
|
@@ -61403,9 +61404,9 @@ function mergeInterface(node, existingNode, config2) {
|
|
|
61403
61404
|
function alreadyExists(arr, other) {
|
|
61404
61405
|
return !!arr.find((i2) => i2.name.value === other.name.value);
|
|
61405
61406
|
}
|
|
61406
|
-
function mergeNamedTypeArray(first = [], second = [],
|
|
61407
|
+
function mergeNamedTypeArray(first = [], second = [], config = {}) {
|
|
61407
61408
|
const result = [...second, ...first.filter((d) => !alreadyExists(second, d))];
|
|
61408
|
-
if (
|
|
61409
|
+
if (config && config.sort) {
|
|
61409
61410
|
result.sort(compareNodes);
|
|
61410
61411
|
}
|
|
61411
61412
|
return result;
|
|
@@ -61416,23 +61417,23 @@ var import_graphql28 = require("graphql");
|
|
|
61416
61417
|
|
|
61417
61418
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js
|
|
61418
61419
|
var import_graphql24 = require("graphql");
|
|
61419
|
-
function mergeType(node, existingNode,
|
|
61420
|
+
function mergeType(node, existingNode, config) {
|
|
61420
61421
|
if (existingNode) {
|
|
61421
61422
|
try {
|
|
61422
61423
|
return {
|
|
61423
61424
|
name: node.name,
|
|
61424
61425
|
description: node["description"] || existingNode["description"],
|
|
61425
|
-
kind: (
|
|
61426
|
+
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || node.kind === "ObjectTypeDefinition" || existingNode.kind === "ObjectTypeDefinition" ? "ObjectTypeDefinition" : "ObjectTypeExtension",
|
|
61426
61427
|
loc: node.loc,
|
|
61427
|
-
fields: mergeFields(node, node.fields, existingNode.fields,
|
|
61428
|
-
directives: mergeDirectives(node.directives, existingNode.directives,
|
|
61429
|
-
interfaces: mergeNamedTypeArray(node.interfaces, existingNode.interfaces,
|
|
61428
|
+
fields: mergeFields(node, node.fields, existingNode.fields, config),
|
|
61429
|
+
directives: mergeDirectives(node.directives, existingNode.directives, config),
|
|
61430
|
+
interfaces: mergeNamedTypeArray(node.interfaces, existingNode.interfaces, config)
|
|
61430
61431
|
};
|
|
61431
61432
|
} catch (e2) {
|
|
61432
61433
|
throw new Error(`Unable to merge GraphQL type "${node.name.value}": ${e2.message}`);
|
|
61433
61434
|
}
|
|
61434
61435
|
}
|
|
61435
|
-
return (
|
|
61436
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61436
61437
|
...node,
|
|
61437
61438
|
kind: import_graphql24.Kind.OBJECT_TYPE_DEFINITION
|
|
61438
61439
|
} : node;
|
|
@@ -61440,17 +61441,17 @@ function mergeType(node, existingNode, config2) {
|
|
|
61440
61441
|
|
|
61441
61442
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js
|
|
61442
61443
|
var import_graphql25 = require("graphql");
|
|
61443
|
-
function mergeScalar(node, existingNode,
|
|
61444
|
+
function mergeScalar(node, existingNode, config) {
|
|
61444
61445
|
if (existingNode) {
|
|
61445
61446
|
return {
|
|
61446
61447
|
name: node.name,
|
|
61447
61448
|
description: node["description"] || existingNode["description"],
|
|
61448
|
-
kind: (
|
|
61449
|
+
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || node.kind === "ScalarTypeDefinition" || existingNode.kind === "ScalarTypeDefinition" ? "ScalarTypeDefinition" : "ScalarTypeExtension",
|
|
61449
61450
|
loc: node.loc,
|
|
61450
|
-
directives: mergeDirectives(node.directives, existingNode.directives,
|
|
61451
|
+
directives: mergeDirectives(node.directives, existingNode.directives, config)
|
|
61451
61452
|
};
|
|
61452
61453
|
}
|
|
61453
|
-
return (
|
|
61454
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61454
61455
|
...node,
|
|
61455
61456
|
kind: import_graphql25.Kind.SCALAR_TYPE_DEFINITION
|
|
61456
61457
|
} : node;
|
|
@@ -61458,18 +61459,18 @@ function mergeScalar(node, existingNode, config2) {
|
|
|
61458
61459
|
|
|
61459
61460
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js
|
|
61460
61461
|
var import_graphql26 = require("graphql");
|
|
61461
|
-
function mergeUnion(first, second,
|
|
61462
|
+
function mergeUnion(first, second, config) {
|
|
61462
61463
|
if (second) {
|
|
61463
61464
|
return {
|
|
61464
61465
|
name: first.name,
|
|
61465
61466
|
description: first["description"] || second["description"],
|
|
61466
|
-
directives: mergeDirectives(first.directives, second.directives,
|
|
61467
|
-
kind: (
|
|
61467
|
+
directives: mergeDirectives(first.directives, second.directives, config),
|
|
61468
|
+
kind: (config === null || config === void 0 ? void 0 : config.convertExtensions) || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql26.Kind.UNION_TYPE_DEFINITION : import_graphql26.Kind.UNION_TYPE_EXTENSION,
|
|
61468
61469
|
loc: first.loc,
|
|
61469
|
-
types: mergeNamedTypeArray(first.types, second.types,
|
|
61470
|
+
types: mergeNamedTypeArray(first.types, second.types, config)
|
|
61470
61471
|
};
|
|
61471
61472
|
}
|
|
61472
|
-
return (
|
|
61473
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61473
61474
|
...first,
|
|
61474
61475
|
kind: import_graphql26.Kind.UNION_TYPE_DEFINITION
|
|
61475
61476
|
} : first;
|
|
@@ -61492,16 +61493,16 @@ function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) {
|
|
|
61492
61493
|
}
|
|
61493
61494
|
return finalOpNodeList;
|
|
61494
61495
|
}
|
|
61495
|
-
function mergeSchemaDefs(node, existingNode,
|
|
61496
|
+
function mergeSchemaDefs(node, existingNode, config) {
|
|
61496
61497
|
if (existingNode) {
|
|
61497
61498
|
return {
|
|
61498
61499
|
kind: node.kind === import_graphql27.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql27.Kind.SCHEMA_DEFINITION ? import_graphql27.Kind.SCHEMA_DEFINITION : import_graphql27.Kind.SCHEMA_EXTENSION,
|
|
61499
61500
|
description: node["description"] || existingNode["description"],
|
|
61500
|
-
directives: mergeDirectives(node.directives, existingNode.directives,
|
|
61501
|
+
directives: mergeDirectives(node.directives, existingNode.directives, config),
|
|
61501
61502
|
operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes)
|
|
61502
61503
|
};
|
|
61503
61504
|
}
|
|
61504
|
-
return (
|
|
61505
|
+
return (config === null || config === void 0 ? void 0 : config.convertExtensions) ? {
|
|
61505
61506
|
...node,
|
|
61506
61507
|
kind: import_graphql27.Kind.SCHEMA_DEFINITION
|
|
61507
61508
|
} : node;
|
|
@@ -61512,45 +61513,45 @@ var schemaDefSymbol = "SCHEMA_DEF_SYMBOL";
|
|
|
61512
61513
|
function isNamedDefinitionNode(definitionNode) {
|
|
61513
61514
|
return "name" in definitionNode;
|
|
61514
61515
|
}
|
|
61515
|
-
function mergeGraphQLNodes(nodes,
|
|
61516
|
+
function mergeGraphQLNodes(nodes, config) {
|
|
61516
61517
|
var _a, _b, _c;
|
|
61517
61518
|
const mergedResultMap = {};
|
|
61518
61519
|
for (const nodeDefinition of nodes) {
|
|
61519
61520
|
if (isNamedDefinitionNode(nodeDefinition)) {
|
|
61520
61521
|
const name = (_a = nodeDefinition.name) === null || _a === void 0 ? void 0 : _a.value;
|
|
61521
|
-
if (
|
|
61522
|
+
if (config === null || config === void 0 ? void 0 : config.commentDescriptions) {
|
|
61522
61523
|
collectComment(nodeDefinition);
|
|
61523
61524
|
}
|
|
61524
61525
|
if (name == null) {
|
|
61525
61526
|
continue;
|
|
61526
61527
|
}
|
|
61527
|
-
if (((_b =
|
|
61528
|
+
if (((_b = config === null || config === void 0 ? void 0 : config.exclusions) === null || _b === void 0 ? void 0 : _b.includes(name + ".*")) || ((_c = config === null || config === void 0 ? void 0 : config.exclusions) === null || _c === void 0 ? void 0 : _c.includes(name))) {
|
|
61528
61529
|
delete mergedResultMap[name];
|
|
61529
61530
|
} else {
|
|
61530
61531
|
switch (nodeDefinition.kind) {
|
|
61531
61532
|
case import_graphql28.Kind.OBJECT_TYPE_DEFINITION:
|
|
61532
61533
|
case import_graphql28.Kind.OBJECT_TYPE_EXTENSION:
|
|
61533
|
-
mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name],
|
|
61534
|
+
mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config);
|
|
61534
61535
|
break;
|
|
61535
61536
|
case import_graphql28.Kind.ENUM_TYPE_DEFINITION:
|
|
61536
61537
|
case import_graphql28.Kind.ENUM_TYPE_EXTENSION:
|
|
61537
|
-
mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name],
|
|
61538
|
+
mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config);
|
|
61538
61539
|
break;
|
|
61539
61540
|
case import_graphql28.Kind.UNION_TYPE_DEFINITION:
|
|
61540
61541
|
case import_graphql28.Kind.UNION_TYPE_EXTENSION:
|
|
61541
|
-
mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name],
|
|
61542
|
+
mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config);
|
|
61542
61543
|
break;
|
|
61543
61544
|
case import_graphql28.Kind.SCALAR_TYPE_DEFINITION:
|
|
61544
61545
|
case import_graphql28.Kind.SCALAR_TYPE_EXTENSION:
|
|
61545
|
-
mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name],
|
|
61546
|
+
mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config);
|
|
61546
61547
|
break;
|
|
61547
61548
|
case import_graphql28.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
61548
61549
|
case import_graphql28.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
61549
|
-
mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name],
|
|
61550
|
+
mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config);
|
|
61550
61551
|
break;
|
|
61551
61552
|
case import_graphql28.Kind.INTERFACE_TYPE_DEFINITION:
|
|
61552
61553
|
case import_graphql28.Kind.INTERFACE_TYPE_EXTENSION:
|
|
61553
|
-
mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name],
|
|
61554
|
+
mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config);
|
|
61554
61555
|
break;
|
|
61555
61556
|
case import_graphql28.Kind.DIRECTIVE_DEFINITION:
|
|
61556
61557
|
mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]);
|
|
@@ -61558,7 +61559,7 @@ function mergeGraphQLNodes(nodes, config2) {
|
|
|
61558
61559
|
}
|
|
61559
61560
|
}
|
|
61560
61561
|
} else if (nodeDefinition.kind === import_graphql28.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql28.Kind.SCHEMA_EXTENSION) {
|
|
61561
|
-
mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol],
|
|
61562
|
+
mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config);
|
|
61562
61563
|
}
|
|
61563
61564
|
}
|
|
61564
61565
|
return mergedResultMap;
|
|
@@ -61566,7 +61567,7 @@ function mergeGraphQLNodes(nodes, config2) {
|
|
|
61566
61567
|
|
|
61567
61568
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js
|
|
61568
61569
|
var import_graphql29 = require("graphql");
|
|
61569
|
-
function mergeTypeDefs(typeSource,
|
|
61570
|
+
function mergeTypeDefs(typeSource, config) {
|
|
61570
61571
|
resetComments();
|
|
61571
61572
|
const doc = {
|
|
61572
61573
|
kind: import_graphql29.Kind.DOCUMENT,
|
|
@@ -61575,11 +61576,11 @@ function mergeTypeDefs(typeSource, config2) {
|
|
|
61575
61576
|
forceSchemaDefinition: false,
|
|
61576
61577
|
throwOnConflict: false,
|
|
61577
61578
|
commentDescriptions: false,
|
|
61578
|
-
...
|
|
61579
|
+
...config
|
|
61579
61580
|
})
|
|
61580
61581
|
};
|
|
61581
61582
|
let result;
|
|
61582
|
-
if (
|
|
61583
|
+
if (config === null || config === void 0 ? void 0 : config.commentDescriptions) {
|
|
61583
61584
|
result = printWithComments(doc);
|
|
61584
61585
|
} else {
|
|
61585
61586
|
result = doc;
|
|
@@ -61612,12 +61613,12 @@ function visitTypeSources(typeSource, options, allNodes = [], visitedTypeSources
|
|
|
61612
61613
|
}
|
|
61613
61614
|
return allNodes;
|
|
61614
61615
|
}
|
|
61615
|
-
function mergeGraphQLTypes(typeSource,
|
|
61616
|
+
function mergeGraphQLTypes(typeSource, config) {
|
|
61616
61617
|
var _a, _b, _c;
|
|
61617
61618
|
resetComments();
|
|
61618
|
-
const allNodes = visitTypeSources(typeSource,
|
|
61619
|
-
const mergedNodes = mergeGraphQLNodes(allNodes,
|
|
61620
|
-
if (
|
|
61619
|
+
const allNodes = visitTypeSources(typeSource, config);
|
|
61620
|
+
const mergedNodes = mergeGraphQLNodes(allNodes, config);
|
|
61621
|
+
if (config === null || config === void 0 ? void 0 : config.useSchemaDefinition) {
|
|
61621
61622
|
const schemaDef = mergedNodes[schemaDefSymbol] || {
|
|
61622
61623
|
kind: import_graphql29.Kind.SCHEMA_DEFINITION,
|
|
61623
61624
|
operationTypes: []
|
|
@@ -61644,7 +61645,7 @@ function mergeGraphQLTypes(typeSource, config2) {
|
|
|
61644
61645
|
mergedNodes[schemaDefSymbol] = schemaDef;
|
|
61645
61646
|
}
|
|
61646
61647
|
}
|
|
61647
|
-
if ((
|
|
61648
|
+
if ((config === null || config === void 0 ? void 0 : config.forceSchemaDefinition) && !((_c = (_b = mergedNodes[schemaDefSymbol]) === null || _b === void 0 ? void 0 : _b.operationTypes) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
61648
61649
|
mergedNodes[schemaDefSymbol] = {
|
|
61649
61650
|
kind: import_graphql29.Kind.SCHEMA_DEFINITION,
|
|
61650
61651
|
operationTypes: [
|
|
@@ -61663,8 +61664,8 @@ function mergeGraphQLTypes(typeSource, config2) {
|
|
|
61663
61664
|
};
|
|
61664
61665
|
}
|
|
61665
61666
|
const mergedNodeDefinitions = Object.values(mergedNodes);
|
|
61666
|
-
if (
|
|
61667
|
-
const sortFn = typeof
|
|
61667
|
+
if (config === null || config === void 0 ? void 0 : config.sort) {
|
|
61668
|
+
const sortFn = typeof config.sort === "function" ? config.sort : defaultStringComparator;
|
|
61668
61669
|
mergedNodeDefinitions.sort((a, b) => {
|
|
61669
61670
|
var _a2, _b2;
|
|
61670
61671
|
return sortFn((_a2 = a.name) === null || _a2 === void 0 ? void 0 : _a2.value, (_b2 = b.name) === null || _b2 === void 0 ? void 0 : _b2.value);
|
|
@@ -61754,30 +61755,30 @@ function makeExecutableSchema({ typeDefs, resolvers = {}, resolverValidationOpti
|
|
|
61754
61755
|
}
|
|
61755
61756
|
|
|
61756
61757
|
// ../../node_modules/.pnpm/@graphql-tools+schema@9.0.12_graphql@15.5.0/node_modules/@graphql-tools/schema/esm/merge-schemas.js
|
|
61757
|
-
function mergeSchemas(
|
|
61758
|
+
function mergeSchemas(config) {
|
|
61758
61759
|
const extractedTypeDefs = [];
|
|
61759
61760
|
const extractedResolvers = [];
|
|
61760
61761
|
const extractedSchemaExtensions = [];
|
|
61761
|
-
if (
|
|
61762
|
-
for (const schema of
|
|
61762
|
+
if (config.schemas != null) {
|
|
61763
|
+
for (const schema of config.schemas) {
|
|
61763
61764
|
extractedTypeDefs.push(schema);
|
|
61764
61765
|
extractedResolvers.push(getResolversFromSchema(schema));
|
|
61765
61766
|
extractedSchemaExtensions.push(extractExtensionsFromSchema(schema));
|
|
61766
61767
|
}
|
|
61767
61768
|
}
|
|
61768
|
-
if (
|
|
61769
|
-
extractedTypeDefs.push(
|
|
61769
|
+
if (config.typeDefs != null) {
|
|
61770
|
+
extractedTypeDefs.push(config.typeDefs);
|
|
61770
61771
|
}
|
|
61771
|
-
if (
|
|
61772
|
-
const additionalResolvers = asArray(
|
|
61772
|
+
if (config.resolvers != null) {
|
|
61773
|
+
const additionalResolvers = asArray(config.resolvers);
|
|
61773
61774
|
extractedResolvers.push(...additionalResolvers);
|
|
61774
61775
|
}
|
|
61775
|
-
if (
|
|
61776
|
-
const additionalSchemaExtensions = asArray(
|
|
61776
|
+
if (config.schemaExtensions != null) {
|
|
61777
|
+
const additionalSchemaExtensions = asArray(config.schemaExtensions);
|
|
61777
61778
|
extractedSchemaExtensions.push(...additionalSchemaExtensions);
|
|
61778
61779
|
}
|
|
61779
61780
|
return makeExecutableSchema({
|
|
61780
|
-
...
|
|
61781
|
+
...config,
|
|
61781
61782
|
typeDefs: extractedTypeDefs,
|
|
61782
61783
|
resolvers: extractedResolvers,
|
|
61783
61784
|
schemaExtensions: extractedSchemaExtensions
|
|
@@ -61801,8 +61802,8 @@ var mockConfig = null;
|
|
|
61801
61802
|
function getMockConfig() {
|
|
61802
61803
|
return mockConfig;
|
|
61803
61804
|
}
|
|
61804
|
-
function setMockConfig(
|
|
61805
|
-
mockConfig =
|
|
61805
|
+
function setMockConfig(config) {
|
|
61806
|
+
mockConfig = config;
|
|
61806
61807
|
}
|
|
61807
61808
|
function defaultConfigValues(file) {
|
|
61808
61809
|
return {
|
|
@@ -61930,7 +61931,7 @@ async function marshalSelection({
|
|
|
61930
61931
|
selection,
|
|
61931
61932
|
data
|
|
61932
61933
|
}) {
|
|
61933
|
-
const
|
|
61934
|
+
const config = getCurrentConfig();
|
|
61934
61935
|
if (data === null || typeof data === "undefined") {
|
|
61935
61936
|
return data;
|
|
61936
61937
|
}
|
|
@@ -61948,8 +61949,8 @@ async function marshalSelection({
|
|
|
61948
61949
|
if (selection2) {
|
|
61949
61950
|
return [fieldName, await marshalSelection({ selection: selection2, data: value })];
|
|
61950
61951
|
}
|
|
61951
|
-
if (
|
|
61952
|
-
const marshalFn =
|
|
61952
|
+
if (config.scalars?.[type]) {
|
|
61953
|
+
const marshalFn = config.scalars[type].marshal;
|
|
61953
61954
|
if (!marshalFn) {
|
|
61954
61955
|
throw new Error(
|
|
61955
61956
|
`scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
|
|
@@ -61968,7 +61969,7 @@ async function marshalSelection({
|
|
|
61968
61969
|
function marshalInputs({
|
|
61969
61970
|
artifact,
|
|
61970
61971
|
input,
|
|
61971
|
-
config
|
|
61972
|
+
config,
|
|
61972
61973
|
rootType = "@root"
|
|
61973
61974
|
}) {
|
|
61974
61975
|
if (input === null || typeof input === "undefined") {
|
|
@@ -61979,7 +61980,7 @@ function marshalInputs({
|
|
|
61979
61980
|
}
|
|
61980
61981
|
const fields = rootType === "@root" ? artifact.input.fields : artifact.input.types[rootType];
|
|
61981
61982
|
if (Array.isArray(input)) {
|
|
61982
|
-
return input.map((val) => marshalInputs({ artifact, input: val, rootType, config
|
|
61983
|
+
return input.map((val) => marshalInputs({ artifact, input: val, rootType, config }));
|
|
61983
61984
|
}
|
|
61984
61985
|
return Object.fromEntries(
|
|
61985
61986
|
Object.entries(input).map(([fieldName, value]) => {
|
|
@@ -61987,22 +61988,22 @@ function marshalInputs({
|
|
|
61987
61988
|
if (!type) {
|
|
61988
61989
|
return [fieldName, value];
|
|
61989
61990
|
}
|
|
61990
|
-
const marshalFn =
|
|
61991
|
+
const marshalFn = config.scalars?.[type]?.marshal;
|
|
61991
61992
|
if (marshalFn) {
|
|
61992
61993
|
if (Array.isArray(value)) {
|
|
61993
61994
|
return [fieldName, value.map(marshalFn)];
|
|
61994
61995
|
}
|
|
61995
61996
|
return [fieldName, marshalFn(value)];
|
|
61996
61997
|
}
|
|
61997
|
-
if (isScalar(
|
|
61998
|
+
if (isScalar(config, type) || !artifact.input.types[type]) {
|
|
61998
61999
|
return [fieldName, value];
|
|
61999
62000
|
}
|
|
62000
|
-
return [fieldName, marshalInputs({ artifact, input: value, rootType: type, config
|
|
62001
|
+
return [fieldName, marshalInputs({ artifact, input: value, rootType: type, config })];
|
|
62001
62002
|
})
|
|
62002
62003
|
);
|
|
62003
62004
|
}
|
|
62004
|
-
function isScalar(
|
|
62005
|
-
return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(
|
|
62005
|
+
function isScalar(config, type) {
|
|
62006
|
+
return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
|
|
62006
62007
|
}
|
|
62007
62008
|
|
|
62008
62009
|
// src/runtime/lib/types.ts
|
|
@@ -62425,36 +62426,115 @@ async function glob(pattern) {
|
|
|
62425
62426
|
}
|
|
62426
62427
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
62427
62428
|
|
|
62428
|
-
// ../../node_modules/.pnpm
|
|
62429
|
-
var
|
|
62430
|
-
|
|
62431
|
-
|
|
62432
|
-
|
|
62433
|
-
|
|
62434
|
-
|
|
62435
|
-
|
|
62436
|
-
|
|
62437
|
-
|
|
62438
|
-
|
|
62439
|
-
|
|
62440
|
-
|
|
62441
|
-
|
|
62442
|
-
|
|
62443
|
-
|
|
62444
|
-
|
|
62445
|
-
|
|
62446
|
-
|
|
62447
|
-
|
|
62448
|
-
|
|
62449
|
-
|
|
62450
|
-
|
|
62451
|
-
|
|
62452
|
-
|
|
62453
|
-
|
|
62429
|
+
// ../../node_modules/.pnpm/esm-env@1.0.0/node_modules/esm-env/prod-ssr.js
|
|
62430
|
+
var BROWSER = false;
|
|
62431
|
+
|
|
62432
|
+
// ../../node_modules/.pnpm/@kitql+helpers@0.8.2/node_modules/@kitql/helpers/dist/colors/stylesNode.js
|
|
62433
|
+
var stylesNode_exports = {};
|
|
62434
|
+
__export(stylesNode_exports, {
|
|
62435
|
+
bgBlack: () => bgBlack,
|
|
62436
|
+
bgBlackBright: () => bgBlackBright,
|
|
62437
|
+
bgBlue: () => bgBlue,
|
|
62438
|
+
bgBlueBright: () => bgBlueBright,
|
|
62439
|
+
bgCyan: () => bgCyan,
|
|
62440
|
+
bgCyanBright: () => bgCyanBright,
|
|
62441
|
+
bgGreen: () => bgGreen,
|
|
62442
|
+
bgGreenBright: () => bgGreenBright,
|
|
62443
|
+
bgMagenta: () => bgMagenta,
|
|
62444
|
+
bgMagentaBright: () => bgMagentaBright,
|
|
62445
|
+
bgRed: () => bgRed,
|
|
62446
|
+
bgRedBright: () => bgRedBright,
|
|
62447
|
+
bgWhite: () => bgWhite,
|
|
62448
|
+
bgWhiteBright: () => bgWhiteBright,
|
|
62449
|
+
bgYellow: () => bgYellow,
|
|
62450
|
+
bgYellowBright: () => bgYellowBright,
|
|
62451
|
+
black: () => black,
|
|
62452
|
+
blackBright: () => blackBright,
|
|
62453
|
+
blue: () => blue,
|
|
62454
|
+
blueBright: () => blueBright,
|
|
62455
|
+
bold: () => bold,
|
|
62456
|
+
cyan: () => cyan,
|
|
62457
|
+
cyanBright: () => cyanBright,
|
|
62458
|
+
dim: () => dim,
|
|
62459
|
+
gray: () => gray,
|
|
62460
|
+
green: () => green,
|
|
62461
|
+
greenBright: () => greenBright,
|
|
62462
|
+
hidden: () => hidden,
|
|
62463
|
+
inverse: () => inverse,
|
|
62464
|
+
italic: () => italic,
|
|
62465
|
+
magenta: () => magenta,
|
|
62466
|
+
magentaBright: () => magentaBright,
|
|
62467
|
+
red: () => red,
|
|
62468
|
+
redBright: () => redBright,
|
|
62469
|
+
reset: () => reset,
|
|
62470
|
+
strikethrough: () => strikethrough,
|
|
62471
|
+
underline: () => underline,
|
|
62472
|
+
white: () => white,
|
|
62473
|
+
whiteBright: () => whiteBright,
|
|
62474
|
+
yellow: () => yellow,
|
|
62475
|
+
yellowBright: () => yellowBright
|
|
62476
|
+
});
|
|
62477
|
+
var reset = { start: "\x1B[0m", end: "\x1B[0m" };
|
|
62478
|
+
var bold = { start: "\x1B[1m", end: "\x1B[22m" };
|
|
62479
|
+
var dim = { start: "\x1B[2m", end: "\x1B[22m" };
|
|
62480
|
+
var italic = { start: "\x1B[3m", end: "\x1B[23m" };
|
|
62481
|
+
var underline = { start: "\x1B[4m", end: "\x1B[24m" };
|
|
62482
|
+
var inverse = { start: "\x1B[7m", end: "\x1B[27m" };
|
|
62483
|
+
var hidden = { start: "\x1B[8m", end: "\x1B[28m" };
|
|
62484
|
+
var strikethrough = { start: "\x1B[9m", end: "\x1B[29m" };
|
|
62485
|
+
var black = { start: "\x1B[30m", end: "\x1B[39m" };
|
|
62486
|
+
var red = { start: "\x1B[31m", end: "\x1B[39m" };
|
|
62487
|
+
var green = { start: "\x1B[32m", end: "\x1B[39m" };
|
|
62488
|
+
var yellow = { start: "\x1B[33m", end: "\x1B[39m" };
|
|
62489
|
+
var blue = { start: "\x1B[34m", end: "\x1B[39m" };
|
|
62490
|
+
var magenta = { start: "\x1B[35m", end: "\x1B[39m" };
|
|
62491
|
+
var cyan = { start: "\x1B[36m", end: "\x1B[39m" };
|
|
62492
|
+
var white = { start: "\x1B[37m", end: "\x1B[39m" };
|
|
62493
|
+
var gray = { start: "\x1B[90m", end: "\x1B[39m" };
|
|
62494
|
+
var bgBlack = { start: "\x1B[40m", end: "\x1B[49m" };
|
|
62495
|
+
var bgRed = { start: "\x1B[41m", end: "\x1B[49m" };
|
|
62496
|
+
var bgGreen = { start: "\x1B[42m", end: "\x1B[49m" };
|
|
62497
|
+
var bgYellow = { start: "\x1B[43m", end: "\x1B[49m" };
|
|
62498
|
+
var bgBlue = { start: "\x1B[44m", end: "\x1B[49m" };
|
|
62499
|
+
var bgMagenta = { start: "\x1B[45m", end: "\x1B[49m" };
|
|
62500
|
+
var bgCyan = { start: "\x1B[46m", end: "\x1B[49m" };
|
|
62501
|
+
var bgWhite = { start: "\x1B[47m", end: "\x1B[49m" };
|
|
62502
|
+
var blackBright = { start: "\x1B[90m", end: "\x1B[39m" };
|
|
62503
|
+
var redBright = { start: "\x1B[91m", end: "\x1B[39m" };
|
|
62504
|
+
var greenBright = { start: "\x1B[92m", end: "\x1B[39m" };
|
|
62505
|
+
var yellowBright = { start: "\x1B[93m", end: "\x1B[39m" };
|
|
62506
|
+
var blueBright = { start: "\x1B[94m", end: "\x1B[39m" };
|
|
62507
|
+
var magentaBright = { start: "\x1B[95m", end: "\x1B[39m" };
|
|
62508
|
+
var cyanBright = { start: "\x1B[96m", end: "\x1B[39m" };
|
|
62509
|
+
var whiteBright = { start: "\x1B[97m", end: "\x1B[39m" };
|
|
62510
|
+
var bgBlackBright = { start: "\x1B[100m", end: "\x1B[49m" };
|
|
62511
|
+
var bgRedBright = { start: "\x1B[101m", end: "\x1B[49m" };
|
|
62512
|
+
var bgGreenBright = { start: "\x1B[102m", end: "\x1B[49m" };
|
|
62513
|
+
var bgYellowBright = { start: "\x1B[103m", end: "\x1B[49m" };
|
|
62514
|
+
var bgBlueBright = { start: "\x1B[104m", end: "\x1B[49m" };
|
|
62515
|
+
var bgMagentaBright = { start: "\x1B[105m", end: "\x1B[49m" };
|
|
62516
|
+
var bgCyanBright = { start: "\x1B[106m", end: "\x1B[49m" };
|
|
62517
|
+
var bgWhiteBright = { start: "\x1B[107m", end: "\x1B[49m" };
|
|
62518
|
+
|
|
62519
|
+
// ../../node_modules/.pnpm/@kitql+helpers@0.8.2/node_modules/@kitql/helpers/dist/colors/index.js
|
|
62520
|
+
var getStyleNode = (styleKey) => {
|
|
62521
|
+
return stylesNode_exports[styleKey] ?? void 0;
|
|
62522
|
+
};
|
|
62523
|
+
var color = (style, str) => {
|
|
62524
|
+
return BROWSER ? colorBrowser(style, str) : colorNode(style, str);
|
|
62525
|
+
};
|
|
62526
|
+
var colorNode = (style, str) => {
|
|
62527
|
+
return `${getStyleNode(style).start}${str}${getStyleNode(style).end}`;
|
|
62528
|
+
};
|
|
62529
|
+
var START1 = `$$KitQL_`;
|
|
62530
|
+
var START2 = `_KitQL$$`;
|
|
62531
|
+
var END = `$$KitQLEND$$`;
|
|
62532
|
+
var colorBrowser = (style, str) => {
|
|
62533
|
+
return `${START1}${style}${START2}${str}${END}`;
|
|
62534
|
+
};
|
|
62535
|
+
var cyan2 = (str) => {
|
|
62536
|
+
return color("cyan", str);
|
|
62454
62537
|
};
|
|
62455
|
-
function logCyan(str) {
|
|
62456
|
-
return `${config.cyan.node}${str}${config.reset.node}`;
|
|
62457
|
-
}
|
|
62458
62538
|
|
|
62459
62539
|
// src/lib/introspection.ts
|
|
62460
62540
|
var graphql = __toESM(require("graphql"), 1);
|
|
@@ -63698,8 +63778,8 @@ async function pullSchema(url, schemaPath, headers, skipWriting) {
|
|
|
63698
63778
|
if (content) {
|
|
63699
63779
|
console.warn(
|
|
63700
63780
|
`\u26A0\uFE0F Couldn't pull your schema.
|
|
63701
|
-
${
|
|
63702
|
-
${
|
|
63781
|
+
${cyan2(" Reponse:")} ${content}
|
|
63782
|
+
${cyan2(" Error :")} ${e2.message}`
|
|
63703
63783
|
);
|
|
63704
63784
|
} else {
|
|
63705
63785
|
console.warn(`\u26A0\uFE0F Couldn't pull your schema: ${e2.message}`);
|
|
@@ -63735,10 +63815,10 @@ function plugin(name, hooks) {
|
|
|
63735
63815
|
name,
|
|
63736
63816
|
plugin: hooks,
|
|
63737
63817
|
__plugin_init__: true,
|
|
63738
|
-
with(
|
|
63818
|
+
with(config) {
|
|
63739
63819
|
return {
|
|
63740
63820
|
...data,
|
|
63741
|
-
config
|
|
63821
|
+
config
|
|
63742
63822
|
};
|
|
63743
63823
|
}
|
|
63744
63824
|
};
|
|
@@ -64490,7 +64570,7 @@ var InMemoryStorage = class {
|
|
|
64490
64570
|
layer.replaceID(replacement);
|
|
64491
64571
|
}
|
|
64492
64572
|
}
|
|
64493
|
-
get(id, field) {
|
|
64573
|
+
get(id, field, defaultValue) {
|
|
64494
64574
|
const operations = {
|
|
64495
64575
|
[OperationKind.insert]: {
|
|
64496
64576
|
[OperationLocation.start]: [],
|
|
@@ -64501,7 +64581,7 @@ var InMemoryStorage = class {
|
|
|
64501
64581
|
const layerIDs = [];
|
|
64502
64582
|
for (let i2 = this.data.length - 1; i2 >= 0; i2--) {
|
|
64503
64583
|
const layer = this.data[i2];
|
|
64504
|
-
|
|
64584
|
+
let [layerValue, kind] = layer.get(id, field);
|
|
64505
64585
|
const layerOperations = layer.getOperations(id, field) || [];
|
|
64506
64586
|
layer.deletedIDs.forEach((v) => {
|
|
64507
64587
|
if (layer.operations[v]?.undoDeletesInList?.includes(field)) {
|
|
@@ -64509,6 +64589,12 @@ var InMemoryStorage = class {
|
|
|
64509
64589
|
}
|
|
64510
64590
|
operations.remove.add(v);
|
|
64511
64591
|
});
|
|
64592
|
+
if (typeof layerValue === "undefined" && defaultValue) {
|
|
64593
|
+
const targetLayer = this.topLayer;
|
|
64594
|
+
const layerID = targetLayer.id;
|
|
64595
|
+
targetLayer.writeField(id, field, defaultValue);
|
|
64596
|
+
layerValue = defaultValue;
|
|
64597
|
+
}
|
|
64512
64598
|
if (typeof layerValue === "undefined" && layerOperations.length === 0) {
|
|
64513
64599
|
if (layer.deletedIDs.size > 0) {
|
|
64514
64600
|
layerIDs.push(layer.id);
|
|
@@ -64609,7 +64695,14 @@ var InMemoryStorage = class {
|
|
|
64609
64695
|
serialize() {
|
|
64610
64696
|
return JSON.stringify({
|
|
64611
64697
|
rank: this.rank,
|
|
64612
|
-
fields:
|
|
64698
|
+
fields: Object.fromEntries(
|
|
64699
|
+
Object.entries(this.topLayer.fields).map(([id, fieldMap]) => [
|
|
64700
|
+
id,
|
|
64701
|
+
Object.fromEntries(
|
|
64702
|
+
Object.entries(fieldMap).filter(([_, value]) => typeof value !== "function")
|
|
64703
|
+
)
|
|
64704
|
+
])
|
|
64705
|
+
),
|
|
64613
64706
|
links: this.topLayer.links
|
|
64614
64707
|
});
|
|
64615
64708
|
}
|
|
@@ -65126,7 +65219,12 @@ var InMemorySubscriptions = class {
|
|
|
65126
65219
|
// src/runtime/cache/cache.ts
|
|
65127
65220
|
var Cache = class {
|
|
65128
65221
|
_internal_unstable;
|
|
65129
|
-
constructor({
|
|
65222
|
+
constructor({
|
|
65223
|
+
disabled,
|
|
65224
|
+
componentCache,
|
|
65225
|
+
createComponent,
|
|
65226
|
+
...config
|
|
65227
|
+
} = {}) {
|
|
65130
65228
|
this._internal_unstable = new CacheInternal({
|
|
65131
65229
|
cache: this,
|
|
65132
65230
|
storage: new InMemoryStorage(),
|
|
@@ -65134,10 +65232,12 @@ var Cache = class {
|
|
|
65134
65232
|
lists: new ListManager(this, rootID),
|
|
65135
65233
|
lifetimes: new GarbageCollector(this),
|
|
65136
65234
|
staleManager: new StaleManager(this),
|
|
65137
|
-
disabled: disabled ?? typeof globalThis.window === "undefined"
|
|
65235
|
+
disabled: disabled ?? typeof globalThis.window === "undefined",
|
|
65236
|
+
componentCache,
|
|
65237
|
+
createComponent
|
|
65138
65238
|
});
|
|
65139
|
-
if (Object.keys(
|
|
65140
|
-
this.setConfig(defaultConfigValues(
|
|
65239
|
+
if (Object.keys(config).length > 0) {
|
|
65240
|
+
this.setConfig(defaultConfigValues(config));
|
|
65141
65241
|
}
|
|
65142
65242
|
}
|
|
65143
65243
|
write({
|
|
@@ -65191,8 +65291,8 @@ var Cache = class {
|
|
|
65191
65291
|
this._internal_unstable.lists.removeIDFromAllLists(id, layer);
|
|
65192
65292
|
this._internal_unstable.storage.delete(id, layer);
|
|
65193
65293
|
}
|
|
65194
|
-
setConfig(
|
|
65195
|
-
this._internal_unstable.setConfig(
|
|
65294
|
+
setConfig(config) {
|
|
65295
|
+
this._internal_unstable.setConfig(config);
|
|
65196
65296
|
}
|
|
65197
65297
|
markTypeStale(options) {
|
|
65198
65298
|
if (!options) {
|
|
@@ -65309,6 +65409,8 @@ var CacheInternal = class {
|
|
|
65309
65409
|
cache;
|
|
65310
65410
|
lifetimes;
|
|
65311
65411
|
staleManager;
|
|
65412
|
+
componentCache;
|
|
65413
|
+
createComponent;
|
|
65312
65414
|
constructor({
|
|
65313
65415
|
storage,
|
|
65314
65416
|
subscriptions,
|
|
@@ -65317,7 +65419,9 @@ var CacheInternal = class {
|
|
|
65317
65419
|
lifetimes,
|
|
65318
65420
|
staleManager,
|
|
65319
65421
|
disabled,
|
|
65320
|
-
config
|
|
65422
|
+
config,
|
|
65423
|
+
componentCache,
|
|
65424
|
+
createComponent
|
|
65321
65425
|
}) {
|
|
65322
65426
|
this.storage = storage;
|
|
65323
65427
|
this.subscriptions = subscriptions;
|
|
@@ -65325,7 +65429,9 @@ var CacheInternal = class {
|
|
|
65325
65429
|
this.cache = cache;
|
|
65326
65430
|
this.lifetimes = lifetimes;
|
|
65327
65431
|
this.staleManager = staleManager;
|
|
65328
|
-
this._config =
|
|
65432
|
+
this._config = config;
|
|
65433
|
+
this.componentCache = componentCache ?? {};
|
|
65434
|
+
this.createComponent = createComponent ?? (() => ({}));
|
|
65329
65435
|
this._disabled = disabled;
|
|
65330
65436
|
try {
|
|
65331
65437
|
if (process.env.HOUDINI_TEST === "true") {
|
|
@@ -65337,8 +65443,8 @@ var CacheInternal = class {
|
|
|
65337
65443
|
get config() {
|
|
65338
65444
|
return this._config ?? getCurrentConfig();
|
|
65339
65445
|
}
|
|
65340
|
-
setConfig(
|
|
65341
|
-
this._config =
|
|
65446
|
+
setConfig(config) {
|
|
65447
|
+
this._config = config;
|
|
65342
65448
|
}
|
|
65343
65449
|
writeSelection({
|
|
65344
65450
|
data,
|
|
@@ -65655,7 +65761,8 @@ var CacheInternal = class {
|
|
|
65655
65761
|
visible,
|
|
65656
65762
|
directives,
|
|
65657
65763
|
loading: fieldLoading,
|
|
65658
|
-
abstractHasRequired
|
|
65764
|
+
abstractHasRequired,
|
|
65765
|
+
component
|
|
65659
65766
|
}
|
|
65660
65767
|
] of Object.entries(targetSelection)) {
|
|
65661
65768
|
if (!visible && !ignoreMasking && !fullCheck) {
|
|
@@ -65682,7 +65789,13 @@ var CacheInternal = class {
|
|
|
65682
65789
|
if (generateLoading && !fieldLoading) {
|
|
65683
65790
|
continue;
|
|
65684
65791
|
}
|
|
65685
|
-
|
|
65792
|
+
const defaultValue = !component ? void 0 : defaultComponentField({
|
|
65793
|
+
cache: this.cache,
|
|
65794
|
+
component,
|
|
65795
|
+
variables,
|
|
65796
|
+
parent
|
|
65797
|
+
});
|
|
65798
|
+
let { value } = this.storage.get(parent, key, defaultValue);
|
|
65686
65799
|
const dt_field = this.staleManager.getFieldTime(parent, key);
|
|
65687
65800
|
if (dt_field === null) {
|
|
65688
65801
|
stale = true;
|
|
@@ -65729,12 +65842,16 @@ var CacheInternal = class {
|
|
|
65729
65842
|
stepsFromConnection: nextStep,
|
|
65730
65843
|
ignoreMasking: !!ignoreMasking,
|
|
65731
65844
|
fullCheck,
|
|
65732
|
-
loading: generateLoading
|
|
65845
|
+
loading: generateLoading,
|
|
65846
|
+
nullable: !!nullable
|
|
65733
65847
|
});
|
|
65734
65848
|
fieldTarget[attributeName] = listValue.data;
|
|
65735
65849
|
if (listValue.partial) {
|
|
65736
65850
|
partial = true;
|
|
65737
65851
|
}
|
|
65852
|
+
if (listValue.cascadeNull) {
|
|
65853
|
+
cascadeNull = true;
|
|
65854
|
+
}
|
|
65738
65855
|
if (listValue.stale) {
|
|
65739
65856
|
stale = true;
|
|
65740
65857
|
}
|
|
@@ -65814,16 +65931,19 @@ var CacheInternal = class {
|
|
|
65814
65931
|
stepsFromConnection,
|
|
65815
65932
|
ignoreMasking,
|
|
65816
65933
|
fullCheck,
|
|
65817
|
-
loading
|
|
65934
|
+
loading,
|
|
65935
|
+
nullable
|
|
65818
65936
|
}) {
|
|
65819
65937
|
const result = [];
|
|
65820
65938
|
let partialData = false;
|
|
65821
65939
|
let stale = false;
|
|
65822
65940
|
let hasValues = false;
|
|
65941
|
+
let cascadeNull = false;
|
|
65823
65942
|
for (const entry of linkedList) {
|
|
65824
65943
|
if (Array.isArray(entry)) {
|
|
65825
65944
|
const nestedValue = this.hydrateNestedList({
|
|
65826
65945
|
fields,
|
|
65946
|
+
nullable,
|
|
65827
65947
|
variables,
|
|
65828
65948
|
linkedList: entry,
|
|
65829
65949
|
stepsFromConnection,
|
|
@@ -65835,6 +65955,9 @@ var CacheInternal = class {
|
|
|
65835
65955
|
if (nestedValue.partial) {
|
|
65836
65956
|
partialData = true;
|
|
65837
65957
|
}
|
|
65958
|
+
if (nestedValue.cascadeNull) {
|
|
65959
|
+
cascadeNull = true;
|
|
65960
|
+
}
|
|
65838
65961
|
continue;
|
|
65839
65962
|
}
|
|
65840
65963
|
if (entry === null) {
|
|
@@ -65855,6 +65978,9 @@ var CacheInternal = class {
|
|
|
65855
65978
|
fullCheck,
|
|
65856
65979
|
loading
|
|
65857
65980
|
});
|
|
65981
|
+
if (data === null && !nullable) {
|
|
65982
|
+
cascadeNull = true;
|
|
65983
|
+
}
|
|
65858
65984
|
result.push(data);
|
|
65859
65985
|
if (partial) {
|
|
65860
65986
|
partialData = true;
|
|
@@ -65870,7 +65996,8 @@ var CacheInternal = class {
|
|
|
65870
65996
|
data: result,
|
|
65871
65997
|
partial: partialData,
|
|
65872
65998
|
stale,
|
|
65873
|
-
hasData: hasValues
|
|
65999
|
+
hasData: hasValues,
|
|
66000
|
+
cascadeNull
|
|
65874
66001
|
};
|
|
65875
66002
|
}
|
|
65876
66003
|
extractNestedListIDs({
|
|
@@ -65999,6 +66126,32 @@ function fragmentVariableValue(value, args) {
|
|
|
65999
66126
|
}
|
|
66000
66127
|
}
|
|
66001
66128
|
var rootID = "_ROOT_";
|
|
66129
|
+
function defaultComponentField({
|
|
66130
|
+
cache,
|
|
66131
|
+
component,
|
|
66132
|
+
loading,
|
|
66133
|
+
variables,
|
|
66134
|
+
parent
|
|
66135
|
+
}) {
|
|
66136
|
+
return (props) => {
|
|
66137
|
+
const componentFn = cache._internal_unstable.componentCache[component.key];
|
|
66138
|
+
const args = evaluateFragmentVariables(component.variables ?? {}, variables ?? {});
|
|
66139
|
+
return cache._internal_unstable.createComponent(componentFn, {
|
|
66140
|
+
...props,
|
|
66141
|
+
[component.prop]: {
|
|
66142
|
+
[fragmentKey]: {
|
|
66143
|
+
loading,
|
|
66144
|
+
values: {
|
|
66145
|
+
[component.fragment]: {
|
|
66146
|
+
variables: args,
|
|
66147
|
+
parent
|
|
66148
|
+
}
|
|
66149
|
+
}
|
|
66150
|
+
}
|
|
66151
|
+
}
|
|
66152
|
+
});
|
|
66153
|
+
};
|
|
66154
|
+
}
|
|
66002
66155
|
|
|
66003
66156
|
// src/runtime/cache/index.ts
|
|
66004
66157
|
var cache_default = new Cache();
|
|
@@ -66804,6 +66957,7 @@ var HoudiniClient = class {
|
|
|
66804
66957
|
plugins;
|
|
66805
66958
|
throwOnError_operations;
|
|
66806
66959
|
proxies = {};
|
|
66960
|
+
componentCache = {};
|
|
66807
66961
|
constructor({
|
|
66808
66962
|
url,
|
|
66809
66963
|
fetchParams: fetchParams2,
|
|
@@ -66918,6 +67072,7 @@ var Config = class {
|
|
|
66918
67072
|
schemaPollHeaders;
|
|
66919
67073
|
pluginMode = false;
|
|
66920
67074
|
plugins = [];
|
|
67075
|
+
componentFields = {};
|
|
66921
67076
|
constructor({
|
|
66922
67077
|
filepath,
|
|
66923
67078
|
loadFrameworkConfig,
|
|
@@ -67074,10 +67229,13 @@ var Config = class {
|
|
|
67074
67229
|
)
|
|
67075
67230
|
];
|
|
67076
67231
|
}
|
|
67232
|
+
get componentScalar() {
|
|
67233
|
+
return "Component";
|
|
67234
|
+
}
|
|
67077
67235
|
#newSchemaInstance = null;
|
|
67078
|
-
|
|
67236
|
+
schemaString = "";
|
|
67079
67237
|
set newSchema(value) {
|
|
67080
|
-
this
|
|
67238
|
+
this.schemaString = value;
|
|
67081
67239
|
if (value) {
|
|
67082
67240
|
this.#newSchemaInstance = graphql2.buildSchema(value);
|
|
67083
67241
|
} else {
|
|
@@ -67085,7 +67243,7 @@ var Config = class {
|
|
|
67085
67243
|
}
|
|
67086
67244
|
}
|
|
67087
67245
|
get newSchema() {
|
|
67088
|
-
return this
|
|
67246
|
+
return this.schemaString;
|
|
67089
67247
|
}
|
|
67090
67248
|
get artifactDirectory() {
|
|
67091
67249
|
return join2(this.rootDir, this.artifactDirectoryName);
|
|
@@ -67121,7 +67279,7 @@ var Config = class {
|
|
|
67121
67279
|
return join2(this.definitionsDirectory, "schema.graphql");
|
|
67122
67280
|
}
|
|
67123
67281
|
get routerBuildDirectory() {
|
|
67124
|
-
return join2(this.projectRoot, "dist"
|
|
67282
|
+
return join2(this.projectRoot, "dist");
|
|
67125
67283
|
}
|
|
67126
67284
|
get definitionsDocumentsPath() {
|
|
67127
67285
|
return join2(this.definitionsDirectory, "documents.gql");
|
|
@@ -67364,16 +67522,41 @@ var Config = class {
|
|
|
67364
67522
|
}, []) ?? [];
|
|
67365
67523
|
return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
|
|
67366
67524
|
}
|
|
67367
|
-
|
|
67368
|
-
|
|
67369
|
-
|
|
67370
|
-
|
|
67371
|
-
|
|
67372
|
-
|
|
67525
|
+
get componentFieldDirective() {
|
|
67526
|
+
return "componentField";
|
|
67527
|
+
}
|
|
67528
|
+
componentFieldFragmentName(args) {
|
|
67529
|
+
let fieldValue = args.entry;
|
|
67530
|
+
if (typeof fieldValue !== "string") {
|
|
67531
|
+
const field = fieldValue.arguments?.find((arg) => arg.name.value === "field")?.value;
|
|
67532
|
+
fieldValue = field?.kind === "StringValue" ? field.value : "";
|
|
67533
|
+
}
|
|
67534
|
+
if (!fieldValue) {
|
|
67535
|
+
return "";
|
|
67536
|
+
}
|
|
67537
|
+
return `__componentField__${args.type}_${fieldValue}`;
|
|
67538
|
+
}
|
|
67539
|
+
localDocumentData(document) {
|
|
67540
|
+
let paginated = false;
|
|
67541
|
+
let componentFields = [];
|
|
67542
|
+
const typeInfo = new graphql2.TypeInfo(this.schema);
|
|
67543
|
+
graphql2.visit(
|
|
67544
|
+
document,
|
|
67545
|
+
graphql2.visitWithTypeInfo(typeInfo, {
|
|
67546
|
+
Directive: (node) => {
|
|
67547
|
+
if ([this.paginateDirective].includes(node.name.value)) {
|
|
67548
|
+
paginated = true;
|
|
67549
|
+
}
|
|
67550
|
+
},
|
|
67551
|
+
Field: (node) => {
|
|
67552
|
+
const parentType = typeInfo.getParentType();
|
|
67553
|
+
if (this.componentFields[parentType?.name ?? ""]?.[node.name.value] && parentType?.name) {
|
|
67554
|
+
componentFields.push({ type: parentType?.name, field: node.name.value });
|
|
67555
|
+
}
|
|
67373
67556
|
}
|
|
67374
|
-
}
|
|
67375
|
-
|
|
67376
|
-
return
|
|
67557
|
+
})
|
|
67558
|
+
);
|
|
67559
|
+
return { paginated, componentFields };
|
|
67377
67560
|
}
|
|
67378
67561
|
#fragmentVariableMaps;
|
|
67379
67562
|
registerFragmentVariablesHash({
|
|
@@ -67507,8 +67690,12 @@ async function getConfig({
|
|
|
67507
67690
|
});
|
|
67508
67691
|
try {
|
|
67509
67692
|
let configFile = await readConfigFile(configPath);
|
|
67693
|
+
const pluginConfigs = Object.entries(configFile.plugins ?? {});
|
|
67694
|
+
if (process.env.HOUDINI_CODEGEN_PLUGIN) {
|
|
67695
|
+
pluginConfigs.push([process.env.HOUDINI_CODEGEN_PLUGIN, {}]);
|
|
67696
|
+
}
|
|
67510
67697
|
const pluginsNested = [];
|
|
67511
|
-
for (const [pluginName, plugin_config] of
|
|
67698
|
+
for (const [pluginName, plugin_config] of pluginConfigs) {
|
|
67512
67699
|
let pluginFile = join2(dirname(configPath), pluginName);
|
|
67513
67700
|
if (!pluginName.startsWith(".")) {
|
|
67514
67701
|
pluginFile = await pluginPath(pluginName, configPath);
|
|
@@ -67626,8 +67813,8 @@ async function readConfigFile(configPath = DEFAULT_CONFIG_PATH) {
|
|
|
67626
67813
|
throw new Error(`Could not load config file at file://${configPath}.
|
|
67627
67814
|
${e2.message}`);
|
|
67628
67815
|
}
|
|
67629
|
-
const
|
|
67630
|
-
return
|
|
67816
|
+
const config = imported.default || imported;
|
|
67817
|
+
return config;
|
|
67631
67818
|
}
|
|
67632
67819
|
var orderedPlugins = (plugins2) => {
|
|
67633
67820
|
const ordered = plugins2.filter(
|
|
@@ -67727,6 +67914,39 @@ function getRootType(type) {
|
|
|
67727
67914
|
}
|
|
67728
67915
|
return type;
|
|
67729
67916
|
}
|
|
67917
|
+
function processComponentFieldDirective(directive) {
|
|
67918
|
+
let field;
|
|
67919
|
+
let exportValue;
|
|
67920
|
+
let prop;
|
|
67921
|
+
let raw;
|
|
67922
|
+
for (const arg of directive.arguments ?? []) {
|
|
67923
|
+
if (arg.name.value === "field" && arg.value.kind === "StringValue") {
|
|
67924
|
+
field = arg.value.value;
|
|
67925
|
+
} else if (arg.name.value === "export" && arg.value.kind === "StringValue") {
|
|
67926
|
+
exportValue = arg.value.value;
|
|
67927
|
+
} else if (arg.name.value === "prop" && arg.value.kind === "StringValue") {
|
|
67928
|
+
prop = arg.value.value;
|
|
67929
|
+
} else if (arg.name.value === "raw" && arg.value.kind === "StringValue") {
|
|
67930
|
+
raw = arg.value.value;
|
|
67931
|
+
}
|
|
67932
|
+
}
|
|
67933
|
+
const missing = [];
|
|
67934
|
+
if (!field) {
|
|
67935
|
+
missing.push("field");
|
|
67936
|
+
}
|
|
67937
|
+
if (!prop) {
|
|
67938
|
+
missing.push("prop");
|
|
67939
|
+
}
|
|
67940
|
+
if (missing.length > 0) {
|
|
67941
|
+
throw new Error(`missing arguments to @componentField: ${missing.join(", ")}`);
|
|
67942
|
+
}
|
|
67943
|
+
return {
|
|
67944
|
+
prop,
|
|
67945
|
+
field,
|
|
67946
|
+
raw,
|
|
67947
|
+
export: exportValue
|
|
67948
|
+
};
|
|
67949
|
+
}
|
|
67730
67950
|
function hashOriginal({ document }) {
|
|
67731
67951
|
return hashDocument(document.originalString);
|
|
67732
67952
|
}
|
|
@@ -67843,23 +68063,23 @@ function operation_requires_variables(operation) {
|
|
|
67843
68063
|
)
|
|
67844
68064
|
);
|
|
67845
68065
|
}
|
|
67846
|
-
function unwrapType(
|
|
68066
|
+
function unwrapType(config, type, wrappers = []) {
|
|
67847
68067
|
if (type.kind === "NonNullType") {
|
|
67848
|
-
return unwrapType(
|
|
68068
|
+
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
67849
68069
|
}
|
|
67850
68070
|
if (type instanceof graphql3.GraphQLNonNull) {
|
|
67851
|
-
return unwrapType(
|
|
68071
|
+
return unwrapType(config, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
67852
68072
|
}
|
|
67853
68073
|
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
67854
68074
|
wrappers.unshift(TypeWrapper.Nullable);
|
|
67855
68075
|
}
|
|
67856
68076
|
if (type.kind === "ListType") {
|
|
67857
|
-
return unwrapType(
|
|
68077
|
+
return unwrapType(config, type.type, [TypeWrapper.List, ...wrappers]);
|
|
67858
68078
|
}
|
|
67859
68079
|
if (type instanceof graphql3.GraphQLList) {
|
|
67860
|
-
return unwrapType(
|
|
68080
|
+
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
67861
68081
|
}
|
|
67862
|
-
const namedType =
|
|
68082
|
+
const namedType = config.schema.getType(type.name.value || type.name);
|
|
67863
68083
|
if (!namedType) {
|
|
67864
68084
|
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
67865
68085
|
}
|
|
@@ -67924,12 +68144,12 @@ function deepMerge2(filepath, ...targets) {
|
|
|
67924
68144
|
}
|
|
67925
68145
|
|
|
67926
68146
|
// src/lib/parse.ts
|
|
67927
|
-
function parseJS(str,
|
|
68147
|
+
function parseJS(str, config) {
|
|
67928
68148
|
const defaultConfig = {
|
|
67929
68149
|
plugins: ["typescript", "importAssertions", "decorators-legacy"],
|
|
67930
68150
|
sourceType: "module"
|
|
67931
68151
|
};
|
|
67932
|
-
return (0, import_parser.parse)(str || "",
|
|
68152
|
+
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
|
67933
68153
|
}
|
|
67934
68154
|
function parseJSON(str) {
|
|
67935
68155
|
str = str.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (m2, g) => g ? "" : m2);
|
|
@@ -67947,26 +68167,40 @@ async function printJS(script, options) {
|
|
|
67947
68167
|
var recast = __toESM(require_main2(), 1);
|
|
67948
68168
|
var AST = recast.types.builders;
|
|
67949
68169
|
function ensureArtifactImport({
|
|
67950
|
-
config
|
|
68170
|
+
config,
|
|
67951
68171
|
artifact,
|
|
67952
68172
|
body,
|
|
67953
68173
|
local,
|
|
67954
68174
|
withExtension
|
|
67955
68175
|
}) {
|
|
67956
68176
|
return ensureImports({
|
|
67957
|
-
config
|
|
68177
|
+
config,
|
|
67958
68178
|
body,
|
|
67959
|
-
sourceModule:
|
|
68179
|
+
sourceModule: config.artifactImportPath(artifact.name) + (withExtension ? ".js" : ""),
|
|
67960
68180
|
import: local || `_${artifact.name}Artifact`
|
|
67961
68181
|
});
|
|
67962
68182
|
}
|
|
67963
68183
|
function ensureImports({
|
|
67964
|
-
config
|
|
68184
|
+
config,
|
|
67965
68185
|
body,
|
|
67966
68186
|
import: importID,
|
|
67967
68187
|
sourceModule,
|
|
67968
68188
|
importKind
|
|
67969
68189
|
}) {
|
|
68190
|
+
if (!importID) {
|
|
68191
|
+
if (body.find(
|
|
68192
|
+
(statement) => statement.type === "ImportDeclaration" && statement.source.value === sourceModule
|
|
68193
|
+
)) {
|
|
68194
|
+
return null;
|
|
68195
|
+
}
|
|
68196
|
+
body.unshift({
|
|
68197
|
+
type: "ImportDeclaration",
|
|
68198
|
+
source: AST.stringLiteral(sourceModule),
|
|
68199
|
+
specifiers: [],
|
|
68200
|
+
importKind
|
|
68201
|
+
});
|
|
68202
|
+
return null;
|
|
68203
|
+
}
|
|
67970
68204
|
const idList = Array.isArray(importID) ? importID : [importID];
|
|
67971
68205
|
const toImport = idList.filter(
|
|
67972
68206
|
(identifier) => !body.find(
|
|
@@ -68027,7 +68261,7 @@ async function detectFromPackageJSON(cwd) {
|
|
|
68027
68261
|
module: packageJSON["type"] === "module" ? "esm" : "commonjs"
|
|
68028
68262
|
};
|
|
68029
68263
|
}
|
|
68030
|
-
async function detectTools(cwd) {
|
|
68264
|
+
async function detectTools(cwd = process.cwd()) {
|
|
68031
68265
|
let typescript = false;
|
|
68032
68266
|
try {
|
|
68033
68267
|
await fs_exports.stat(path_exports.join(cwd, "tsconfig.json"));
|
|
@@ -68285,13 +68519,14 @@ async function asyncWalk(ast, { enter, leave }) {
|
|
|
68285
68519
|
|
|
68286
68520
|
// src/lib/walk.ts
|
|
68287
68521
|
var graphql4 = __toESM(require("graphql"), 1);
|
|
68288
|
-
async function find_graphql(
|
|
68522
|
+
async function find_graphql(config, parsedScript, walker) {
|
|
68289
68523
|
await asyncWalk(parsedScript, {
|
|
68290
68524
|
async enter(node, parent) {
|
|
68291
|
-
if (node.type !== "TaggedTemplateExpression" && node.type !== "CallExpression") {
|
|
68525
|
+
if (node.type !== "TaggedTemplateExpression" && node.type !== "CallExpression" && node.type !== "TSPropertySignature") {
|
|
68292
68526
|
return;
|
|
68293
68527
|
}
|
|
68294
|
-
let documentString;
|
|
68528
|
+
let documentString = "";
|
|
68529
|
+
let propName = "";
|
|
68295
68530
|
if (node.type === "TaggedTemplateExpression") {
|
|
68296
68531
|
const expr = node;
|
|
68297
68532
|
if (expr.tag.type !== "Identifier" || expr.tag.name !== "graphql") {
|
|
@@ -68311,55 +68546,184 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
68311
68546
|
} else {
|
|
68312
68547
|
return;
|
|
68313
68548
|
}
|
|
68314
|
-
} else {
|
|
68549
|
+
} else if (node.type === "TSPropertySignature" && !walker.skipGraphqlType) {
|
|
68550
|
+
const signature = node;
|
|
68551
|
+
if (signature.typeAnnotation?.typeAnnotation?.type !== "TSTypeReference") {
|
|
68552
|
+
return;
|
|
68553
|
+
}
|
|
68554
|
+
const annotation = signature.typeAnnotation?.typeAnnotation;
|
|
68555
|
+
if (annotation.typeName.type !== "Identifier") {
|
|
68556
|
+
return;
|
|
68557
|
+
}
|
|
68558
|
+
if (annotation.typeName.name !== "GraphQL") {
|
|
68559
|
+
return;
|
|
68560
|
+
}
|
|
68561
|
+
if (annotation.typeParameters?.params[0].type !== "TSLiteralType") {
|
|
68562
|
+
return;
|
|
68563
|
+
}
|
|
68564
|
+
const literal = annotation.typeParameters?.params[0];
|
|
68565
|
+
if (literal.literal.type === "StringLiteral") {
|
|
68566
|
+
documentString = literal.literal.value;
|
|
68567
|
+
} else if (literal.literal.type === "TemplateLiteral") {
|
|
68568
|
+
documentString = literal.literal.quasis[0].value.raw;
|
|
68569
|
+
}
|
|
68570
|
+
if (signature.key.type === "Identifier") {
|
|
68571
|
+
propName = signature.key.name;
|
|
68572
|
+
}
|
|
68573
|
+
} else if (!documentString) {
|
|
68315
68574
|
return;
|
|
68316
68575
|
}
|
|
68317
68576
|
const parsedTag = graphql4.parse(documentString);
|
|
68318
68577
|
if (walker.where && !walker.where(parsedTag, { node, parent })) {
|
|
68319
68578
|
return;
|
|
68320
68579
|
}
|
|
68321
|
-
|
|
68322
|
-
|
|
68323
|
-
|
|
68324
|
-
|
|
68325
|
-
|
|
68580
|
+
let anonOkay = false;
|
|
68581
|
+
let definitions = [
|
|
68582
|
+
{ raw: documentString, parsed: config.extractDefinition(parsedTag) }
|
|
68583
|
+
];
|
|
68584
|
+
const name = definitions[0].parsed.name?.value;
|
|
68326
68585
|
let kind;
|
|
68327
|
-
if (
|
|
68586
|
+
if (definitions[0].parsed.kind === "FragmentDefinition") {
|
|
68328
68587
|
kind = CompiledFragmentKind;
|
|
68329
68588
|
} else {
|
|
68330
|
-
if (
|
|
68589
|
+
if (definitions[0].parsed.operation === "query") {
|
|
68331
68590
|
kind = CompiledQueryKind;
|
|
68332
|
-
} else if (
|
|
68591
|
+
} else if (definitions[0].parsed.operation === "mutation") {
|
|
68333
68592
|
kind = CompiledMutationKind;
|
|
68334
68593
|
} else {
|
|
68335
68594
|
kind = CompiledSubscriptionKind;
|
|
68336
68595
|
}
|
|
68337
68596
|
}
|
|
68338
|
-
|
|
68339
|
-
|
|
68340
|
-
|
|
68341
|
-
|
|
68342
|
-
|
|
68343
|
-
|
|
68344
|
-
|
|
68345
|
-
|
|
68346
|
-
}
|
|
68347
|
-
|
|
68348
|
-
|
|
68349
|
-
|
|
68350
|
-
|
|
68351
|
-
|
|
68352
|
-
|
|
68353
|
-
|
|
68597
|
+
if (kind === CompiledQueryKind) {
|
|
68598
|
+
anonOkay = definitions[0].parsed.selectionSet.selections.every(
|
|
68599
|
+
(selection) => selection.kind === "InlineFragment" && selection.directives?.find(
|
|
68600
|
+
(directive) => directive.name.value === config.componentFieldDirective
|
|
68601
|
+
)
|
|
68602
|
+
);
|
|
68603
|
+
if (name) {
|
|
68604
|
+
definitions = [{ parsed: definitions[0].parsed, raw: definitions[0].raw }];
|
|
68605
|
+
} else if (config.configFile.features?.componentFields) {
|
|
68606
|
+
definitions = extractAnonymousQuery(
|
|
68607
|
+
config,
|
|
68608
|
+
definitions[0].raw,
|
|
68609
|
+
definitions[0].parsed,
|
|
68610
|
+
propName
|
|
68611
|
+
);
|
|
68612
|
+
}
|
|
68613
|
+
}
|
|
68614
|
+
if (!name && !anonOkay) {
|
|
68615
|
+
throw new Error("Could not find definition name");
|
|
68616
|
+
}
|
|
68617
|
+
walker.dependency?.(config.artifactPath(parsedTag));
|
|
68618
|
+
for (const definition of definitions) {
|
|
68619
|
+
const name2 = definition.parsed.name?.value;
|
|
68620
|
+
if (!name2) {
|
|
68621
|
+
continue;
|
|
68622
|
+
}
|
|
68623
|
+
await walker.tag({
|
|
68624
|
+
parsedDocument: { kind: "Document", definitions: [definition.parsed] },
|
|
68625
|
+
node: {
|
|
68626
|
+
...node,
|
|
68627
|
+
...this,
|
|
68628
|
+
remove: this.remove,
|
|
68629
|
+
replaceWith: this.replace
|
|
68630
|
+
},
|
|
68631
|
+
artifact: {
|
|
68632
|
+
name: name2,
|
|
68633
|
+
kind
|
|
68634
|
+
},
|
|
68635
|
+
parent,
|
|
68636
|
+
tagContent: definition.raw
|
|
68637
|
+
});
|
|
68638
|
+
}
|
|
68354
68639
|
}
|
|
68355
68640
|
});
|
|
68356
68641
|
}
|
|
68642
|
+
function extractAnonymousQuery(config, raw, expr, propName) {
|
|
68643
|
+
const definitions = expr.selectionSet.selections.reduce(
|
|
68644
|
+
(defs, selection) => {
|
|
68645
|
+
if (selection.kind !== "InlineFragment") {
|
|
68646
|
+
return defs;
|
|
68647
|
+
}
|
|
68648
|
+
const componentField = selection.directives.find(
|
|
68649
|
+
(dir) => dir.name.value === config.componentFieldDirective
|
|
68650
|
+
);
|
|
68651
|
+
const fragmentName = config.componentFieldFragmentName({
|
|
68652
|
+
type: selection.typeCondition.name.value,
|
|
68653
|
+
entry: componentField
|
|
68654
|
+
});
|
|
68655
|
+
if (componentField) {
|
|
68656
|
+
componentField.arguments = [
|
|
68657
|
+
...componentField?.arguments ?? [],
|
|
68658
|
+
{
|
|
68659
|
+
kind: "Argument",
|
|
68660
|
+
name: {
|
|
68661
|
+
kind: "Name",
|
|
68662
|
+
value: "raw"
|
|
68663
|
+
},
|
|
68664
|
+
value: {
|
|
68665
|
+
kind: "StringValue",
|
|
68666
|
+
value: raw
|
|
68667
|
+
}
|
|
68668
|
+
}
|
|
68669
|
+
];
|
|
68670
|
+
}
|
|
68671
|
+
if (componentField && propName && !componentField.arguments?.find((arg) => arg.name.value === "prop")) {
|
|
68672
|
+
componentField.arguments = [
|
|
68673
|
+
...componentField?.arguments ?? [],
|
|
68674
|
+
{
|
|
68675
|
+
kind: "Argument",
|
|
68676
|
+
name: {
|
|
68677
|
+
kind: "Name",
|
|
68678
|
+
value: "prop"
|
|
68679
|
+
},
|
|
68680
|
+
value: {
|
|
68681
|
+
kind: "StringValue",
|
|
68682
|
+
value: propName
|
|
68683
|
+
}
|
|
68684
|
+
}
|
|
68685
|
+
];
|
|
68686
|
+
}
|
|
68687
|
+
const parsed = {
|
|
68688
|
+
kind: "FragmentDefinition",
|
|
68689
|
+
typeCondition: {
|
|
68690
|
+
kind: "NamedType",
|
|
68691
|
+
name: {
|
|
68692
|
+
kind: "Name",
|
|
68693
|
+
value: selection.typeCondition?.name.value || ""
|
|
68694
|
+
}
|
|
68695
|
+
},
|
|
68696
|
+
name: {
|
|
68697
|
+
kind: "Name",
|
|
68698
|
+
value: fragmentName
|
|
68699
|
+
},
|
|
68700
|
+
selectionSet: {
|
|
68701
|
+
kind: "SelectionSet",
|
|
68702
|
+
selections: selection.selectionSet.selections
|
|
68703
|
+
},
|
|
68704
|
+
directives: selection.directives
|
|
68705
|
+
};
|
|
68706
|
+
return defs.concat([
|
|
68707
|
+
{
|
|
68708
|
+
raw: graphql4.print(parsed),
|
|
68709
|
+
parsed
|
|
68710
|
+
}
|
|
68711
|
+
]);
|
|
68712
|
+
},
|
|
68713
|
+
[]
|
|
68714
|
+
);
|
|
68715
|
+
if (definitions.length > 1) {
|
|
68716
|
+
throw new Error("Anonymous queries can only contain a single inline fragment");
|
|
68717
|
+
}
|
|
68718
|
+
return definitions;
|
|
68719
|
+
}
|
|
68357
68720
|
|
|
68358
68721
|
// src/lib/router/conventions.ts
|
|
68359
68722
|
var conventions_exports = {};
|
|
68360
68723
|
__export(conventions_exports, {
|
|
68361
68724
|
adapter_config_path: () => adapter_config_path,
|
|
68362
68725
|
app_component_path: () => app_component_path,
|
|
68726
|
+
componentField_unit_path: () => componentField_unit_path,
|
|
68363
68727
|
fallback_unit_path: () => fallback_unit_path,
|
|
68364
68728
|
is_layout: () => is_layout,
|
|
68365
68729
|
layout_unit_path: () => layout_unit_path,
|
|
@@ -68377,32 +68741,35 @@ __export(conventions_exports, {
|
|
|
68377
68741
|
server_adapter_path: () => server_adapter_path,
|
|
68378
68742
|
vite_render_path: () => vite_render_path
|
|
68379
68743
|
});
|
|
68380
|
-
function router_path(
|
|
68381
|
-
return path_exports.join(base_dir(
|
|
68744
|
+
function router_path(config) {
|
|
68745
|
+
return path_exports.join(base_dir(config), "Router.jsx");
|
|
68382
68746
|
}
|
|
68383
|
-
function page_entry_path(
|
|
68384
|
-
return path_exports.join(page_entries_dir(
|
|
68747
|
+
function page_entry_path(config, id, base) {
|
|
68748
|
+
return path_exports.join(page_entries_dir(config, base), `${id}.jsx`);
|
|
68385
68749
|
}
|
|
68386
|
-
function server_adapter_path(
|
|
68387
|
-
return path_exports.join(units_dir(
|
|
68750
|
+
function server_adapter_path(config, base) {
|
|
68751
|
+
return path_exports.join(units_dir(config, base), "render", "server.js");
|
|
68388
68752
|
}
|
|
68389
|
-
function adapter_config_path(
|
|
68390
|
-
return path_exports.join(units_dir(
|
|
68753
|
+
function adapter_config_path(config, base) {
|
|
68754
|
+
return path_exports.join(units_dir(config, base), "render", "config.js");
|
|
68391
68755
|
}
|
|
68392
|
-
function vite_render_path(
|
|
68393
|
-
return path_exports.join(units_dir(
|
|
68756
|
+
function vite_render_path(config, base) {
|
|
68757
|
+
return path_exports.join(units_dir(config, base), "render", "vite.js");
|
|
68394
68758
|
}
|
|
68395
|
-
function app_component_path(
|
|
68396
|
-
return path_exports.join(units_dir(
|
|
68759
|
+
function app_component_path(config, base) {
|
|
68760
|
+
return path_exports.join(units_dir(config, base), "render", "App.jsx");
|
|
68397
68761
|
}
|
|
68398
|
-
function page_unit_path(
|
|
68399
|
-
return path_exports.join(page_units_dir(
|
|
68762
|
+
function page_unit_path(config, id, base) {
|
|
68763
|
+
return path_exports.join(page_units_dir(config, base), `${id}.jsx`);
|
|
68400
68764
|
}
|
|
68401
|
-
function layout_unit_path(
|
|
68402
|
-
return path_exports.join(layout_units_dir(
|
|
68765
|
+
function layout_unit_path(config, id, base) {
|
|
68766
|
+
return path_exports.join(layout_units_dir(config, base), `${id}.jsx`);
|
|
68403
68767
|
}
|
|
68404
|
-
function
|
|
68405
|
-
return path_exports.join(
|
|
68768
|
+
function componentField_unit_path(config, id, base) {
|
|
68769
|
+
return path_exports.join(units_dir(config, base), "componentFields", `wrapper_${id}.jsx`);
|
|
68770
|
+
}
|
|
68771
|
+
function fallback_unit_path(config, which, id, base) {
|
|
68772
|
+
return path_exports.join(fallbacks_units_dir(config, which, base), `${id}.jsx`);
|
|
68406
68773
|
}
|
|
68407
68774
|
async function read_pageQuery(base) {
|
|
68408
68775
|
const target = path_exports.join(base, "+page.gql");
|
|
@@ -68432,8 +68799,8 @@ async function read_layoutView(base) {
|
|
|
68432
68799
|
}
|
|
68433
68800
|
return [null, null];
|
|
68434
68801
|
}
|
|
68435
|
-
function router_index_path(
|
|
68436
|
-
return path_exports.join(
|
|
68802
|
+
function router_index_path(config) {
|
|
68803
|
+
return path_exports.join(config.routesDir, "..", "+index.jsx");
|
|
68437
68804
|
}
|
|
68438
68805
|
function is_layout(path3) {
|
|
68439
68806
|
return path3.endsWith("+layout.tsx") || path3.endsWith("+layout.jsx");
|
|
@@ -68455,25 +68822,25 @@ function page_id(path3) {
|
|
|
68455
68822
|
}
|
|
68456
68823
|
return copy;
|
|
68457
68824
|
}
|
|
68458
|
-
function page_entries_dir(
|
|
68459
|
-
return path_exports.join(units_dir(
|
|
68825
|
+
function page_entries_dir(config, base) {
|
|
68826
|
+
return path_exports.join(units_dir(config, base), "entries");
|
|
68460
68827
|
}
|
|
68461
|
-
function page_units_dir(
|
|
68462
|
-
return path_exports.join(units_dir(
|
|
68828
|
+
function page_units_dir(config, base) {
|
|
68829
|
+
return path_exports.join(units_dir(config, base), "pages");
|
|
68463
68830
|
}
|
|
68464
|
-
function layout_units_dir(
|
|
68465
|
-
return path_exports.join(units_dir(
|
|
68831
|
+
function layout_units_dir(config, base) {
|
|
68832
|
+
return path_exports.join(units_dir(config, base), "layouts");
|
|
68466
68833
|
}
|
|
68467
|
-
function fallbacks_units_dir(
|
|
68468
|
-
return path_exports.join(units_dir(
|
|
68834
|
+
function fallbacks_units_dir(config, which, base) {
|
|
68835
|
+
return path_exports.join(units_dir(config, base), "fallbacks", which);
|
|
68469
68836
|
}
|
|
68470
|
-
function units_dir(
|
|
68837
|
+
function units_dir(config, base = base_dir(config)) {
|
|
68471
68838
|
return path_exports.join(base, "units");
|
|
68472
68839
|
}
|
|
68473
|
-
function base_dir(
|
|
68474
|
-
return
|
|
68840
|
+
function base_dir(config) {
|
|
68841
|
+
return config.pluginDirectory("houdini-react");
|
|
68475
68842
|
}
|
|
68476
|
-
function serialized_manifest_path(
|
|
68843
|
+
function serialized_manifest_path(config, base = base_dir(config)) {
|
|
68477
68844
|
return path_exports.join(base, "manifest.json");
|
|
68478
68845
|
}
|
|
68479
68846
|
|
|
@@ -68486,6 +68853,7 @@ async function load_manifest(args) {
|
|
|
68486
68853
|
url: "/",
|
|
68487
68854
|
filepath: args.config.routesDir,
|
|
68488
68855
|
project: {
|
|
68856
|
+
component_fields: {},
|
|
68489
68857
|
pages: {},
|
|
68490
68858
|
layouts: {},
|
|
68491
68859
|
page_queries: {},
|
|
@@ -68610,8 +68978,7 @@ async function add_view(args) {
|
|
|
68610
68978
|
const missing_queries = queries.filter((query2) => !args.queries.includes(query2));
|
|
68611
68979
|
if (missing_queries.length > 0) {
|
|
68612
68980
|
throw {
|
|
68613
|
-
message: "
|
|
68614
|
-
description: JSON.stringify(missing_queries)
|
|
68981
|
+
message: `Unknown queries in ${args.path}: ${missing_queries.join(", ")}`
|
|
68615
68982
|
};
|
|
68616
68983
|
}
|
|
68617
68984
|
const id = page_id(args.url);
|
|
@@ -68646,7 +69013,8 @@ async function add_query(args) {
|
|
|
68646
69013
|
path: path_exports.relative(args.config.routesDir, args.path),
|
|
68647
69014
|
name: query2.name.value,
|
|
68648
69015
|
url: args.url,
|
|
68649
|
-
loading
|
|
69016
|
+
loading,
|
|
69017
|
+
variables: query2.variableDefinitions?.map((variable) => variable.variable.name.value) ?? []
|
|
68650
69018
|
};
|
|
68651
69019
|
return target[page_id(args.url)];
|
|
68652
69020
|
}
|
|
@@ -68682,7 +69050,7 @@ async function extractQueries(source) {
|
|
|
68682
69050
|
}
|
|
68683
69051
|
}
|
|
68684
69052
|
if (!defaultExportNode) {
|
|
68685
|
-
|
|
69053
|
+
return [];
|
|
68686
69054
|
}
|
|
68687
69055
|
let props = [];
|
|
68688
69056
|
const componentFunction = defaultExportNode;
|
|
@@ -68708,32 +69076,33 @@ var import_node_path2 = __toESM(require("node:path"), 1);
|
|
|
68708
69076
|
function isSecondaryBuild() {
|
|
68709
69077
|
return process.env.HOUDINI_SECONDARY_BUILD && process.env.HOUDINI_SECONDARY_BUILD !== "false";
|
|
68710
69078
|
}
|
|
68711
|
-
function internalRoutes(
|
|
68712
|
-
const routes = [localApiEndpoint(
|
|
68713
|
-
if (
|
|
68714
|
-
routes.push(
|
|
69079
|
+
function internalRoutes(config) {
|
|
69080
|
+
const routes = [localApiEndpoint(config)];
|
|
69081
|
+
if (config.router?.auth && "redirect" in config.router.auth) {
|
|
69082
|
+
routes.push(config.router.auth.redirect);
|
|
68715
69083
|
}
|
|
68716
69084
|
return routes;
|
|
68717
69085
|
}
|
|
68718
|
-
async function buildLocalSchema(
|
|
69086
|
+
async function buildLocalSchema(config) {
|
|
68719
69087
|
const { build } = await import("vite");
|
|
68720
69088
|
process.env.HOUDINI_SECONDARY_BUILD = "true";
|
|
69089
|
+
const schema = import_node_path2.default.join(config.localApiDir, "+schema");
|
|
68721
69090
|
await build({
|
|
68722
69091
|
logLevel: "silent",
|
|
68723
69092
|
build: {
|
|
68724
|
-
outDir: import_node_path2.default.join(
|
|
69093
|
+
outDir: import_node_path2.default.join(config.rootDir, "temp"),
|
|
68725
69094
|
rollupOptions: {
|
|
68726
69095
|
input: {
|
|
68727
|
-
schema
|
|
69096
|
+
schema
|
|
68728
69097
|
},
|
|
68729
|
-
external: ["graphql"],
|
|
68730
69098
|
output: {
|
|
68731
69099
|
entryFileNames: "assets/[name].js"
|
|
68732
69100
|
}
|
|
68733
69101
|
},
|
|
69102
|
+
ssr: true,
|
|
68734
69103
|
lib: {
|
|
68735
69104
|
entry: {
|
|
68736
|
-
schema
|
|
69105
|
+
schema
|
|
68737
69106
|
},
|
|
68738
69107
|
formats: ["es"]
|
|
68739
69108
|
}
|
|
@@ -68741,9 +69110,9 @@ async function buildLocalSchema(config2) {
|
|
|
68741
69110
|
});
|
|
68742
69111
|
process.env.HOUDINI_SECONDARY_BUILD = "false";
|
|
68743
69112
|
}
|
|
68744
|
-
async function loadLocalSchema(
|
|
68745
|
-
await buildLocalSchema(
|
|
68746
|
-
const { default: schema } = await import(import_node_path2.default.join(
|
|
69113
|
+
async function loadLocalSchema(config) {
|
|
69114
|
+
await buildLocalSchema(config);
|
|
69115
|
+
const { default: schema } = await import(import_node_path2.default.join(config.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
|
|
68747
69116
|
return schema;
|
|
68748
69117
|
}
|
|
68749
69118
|
|
|
@@ -68951,13 +69320,16 @@ async function handle_request(args) {
|
|
|
68951
69320
|
}
|
|
68952
69321
|
}
|
|
68953
69322
|
async function redirect_auth(args) {
|
|
68954
|
-
const { searchParams } = new URL(args.url, `http://${args.headers.get("host")}`);
|
|
69323
|
+
const { searchParams, host } = new URL(args.url, `http://${args.headers.get("host")}`);
|
|
68955
69324
|
const { redirectTo, ...session } = Object.fromEntries(searchParams.entries());
|
|
68956
|
-
|
|
68957
|
-
|
|
68958
|
-
|
|
68959
|
-
|
|
68960
|
-
|
|
69325
|
+
const response = new Response("ok", {
|
|
69326
|
+
status: 302,
|
|
69327
|
+
headers: {
|
|
69328
|
+
Location: redirectTo ?? "/"
|
|
69329
|
+
}
|
|
69330
|
+
});
|
|
69331
|
+
await set_session(args, response, session);
|
|
69332
|
+
return response;
|
|
68961
69333
|
}
|
|
68962
69334
|
var session_cookie_name = "__houdini__";
|
|
68963
69335
|
async function set_session(req, response, value) {
|
|
@@ -69059,6 +69431,7 @@ async function get_session(req, secrets) {
|
|
|
69059
69431
|
path,
|
|
69060
69432
|
plugin,
|
|
69061
69433
|
printJS,
|
|
69434
|
+
processComponentFieldDirective,
|
|
69062
69435
|
pullSchema,
|
|
69063
69436
|
query,
|
|
69064
69437
|
readConfigFile,
|