houdini 1.0.0-next.5 → 1.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +484 -475
- package/build/cmd-esm/index.js +484 -475
- package/build/codegen/generators/artifacts/index.d.ts +2 -2
- package/build/codegen/generators/artifacts/indexFile.d.ts +2 -2
- package/build/codegen/generators/artifacts/selection.d.ts +2 -2
- package/build/codegen/generators/indexFile/index.d.ts +2 -2
- package/build/codegen/generators/persistedQueries/index.d.ts +2 -2
- package/build/codegen/generators/runtime/graphqlFunction.d.ts +2 -2
- package/build/codegen/generators/runtime/index.d.ts +2 -2
- package/build/codegen/generators/typescript/documentTypes.d.ts +2 -2
- package/build/codegen/generators/typescript/imperativeTypeDef.d.ts +2 -2
- package/build/codegen/generators/typescript/index.d.ts +2 -2
- package/build/codegen/index.d.ts +2 -2
- package/build/codegen/transforms/addID.d.ts +2 -2
- package/build/codegen/transforms/composeQueries.d.ts +4 -4
- package/build/codegen/transforms/fragmentVariables.d.ts +2 -2
- package/build/codegen/transforms/list.d.ts +2 -2
- package/build/codegen/transforms/paginate.d.ts +2 -2
- package/build/codegen/transforms/schema.d.ts +2 -2
- package/build/codegen/transforms/typename.d.ts +2 -2
- package/build/codegen/validators/noIDAlias.d.ts +2 -2
- package/build/codegen/validators/plugins.d.ts +2 -2
- package/build/codegen/validators/typeCheck.d.ts +2 -2
- package/build/codegen/validators/uniqueNames.d.ts +2 -2
- package/build/codegen-cjs/index.js +481 -472
- package/build/codegen-esm/index.js +481 -472
- package/build/lib/graphql.d.ts +2 -2
- package/build/lib/types.d.ts +35 -35
- package/build/lib-cjs/index.js +355 -355
- package/build/lib-esm/index.js +355 -355
- package/build/runtime/client/documentStore.d.ts +1 -1
- package/build/runtime/client/index.d.ts +7 -6
- package/build/runtime-cjs/client/documentStore.d.ts +1 -1
- package/build/runtime-cjs/client/index.d.ts +7 -6
- package/build/runtime-esm/client/documentStore.d.ts +1 -1
- package/build/runtime-esm/client/index.d.ts +7 -6
- package/build/test/index.d.ts +3 -3
- package/build/test-cjs/index.js +479 -470
- package/build/test-esm/index.js +479 -470
- package/build/vite-cjs/index.js +484 -475
- package/build/vite-esm/index.js +484 -475
- package/package.json +1 -1
package/build/vite-esm/index.js
CHANGED
|
@@ -7219,10 +7219,10 @@ var require_printer = __commonJS({
|
|
|
7219
7219
|
Object.defineProperty(exports, "__esModule", {
|
|
7220
7220
|
value: true
|
|
7221
7221
|
});
|
|
7222
|
-
exports.print =
|
|
7222
|
+
exports.print = print11;
|
|
7223
7223
|
var _visitor = require_visitor();
|
|
7224
7224
|
var _blockString = require_blockString();
|
|
7225
|
-
function
|
|
7225
|
+
function print11(ast) {
|
|
7226
7226
|
return (0, _visitor.visit)(ast, {
|
|
7227
7227
|
leave: printDocASTReducer2
|
|
7228
7228
|
});
|
|
@@ -58561,12 +58561,12 @@ var require_comments = __commonJS({
|
|
|
58561
58561
|
comment.trailing = true;
|
|
58562
58562
|
addCommentHelper(node, comment);
|
|
58563
58563
|
}
|
|
58564
|
-
function printLeadingComment(commentPath,
|
|
58564
|
+
function printLeadingComment(commentPath, print11) {
|
|
58565
58565
|
var comment = commentPath.getValue();
|
|
58566
58566
|
n.Comment.assert(comment);
|
|
58567
58567
|
var loc = comment.loc;
|
|
58568
58568
|
var lines = loc && loc.lines;
|
|
58569
|
-
var parts = [
|
|
58569
|
+
var parts = [print11(commentPath)];
|
|
58570
58570
|
if (comment.trailing) {
|
|
58571
58571
|
parts.push("\n");
|
|
58572
58572
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -58581,7 +58581,7 @@ var require_comments = __commonJS({
|
|
|
58581
58581
|
}
|
|
58582
58582
|
return (0, lines_1.concat)(parts);
|
|
58583
58583
|
}
|
|
58584
|
-
function printTrailingComment(commentPath,
|
|
58584
|
+
function printTrailingComment(commentPath, print11) {
|
|
58585
58585
|
var comment = commentPath.getValue(commentPath);
|
|
58586
58586
|
n.Comment.assert(comment);
|
|
58587
58587
|
var loc = comment.loc;
|
|
@@ -58596,12 +58596,12 @@ var require_comments = __commonJS({
|
|
|
58596
58596
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
58597
58597
|
}
|
|
58598
58598
|
}
|
|
58599
|
-
parts.push(
|
|
58599
|
+
parts.push(print11(commentPath));
|
|
58600
58600
|
return (0, lines_1.concat)(parts);
|
|
58601
58601
|
}
|
|
58602
|
-
function printComments(path2,
|
|
58602
|
+
function printComments(path2, print11) {
|
|
58603
58603
|
var value = path2.getValue();
|
|
58604
|
-
var innerLines =
|
|
58604
|
+
var innerLines = print11(path2);
|
|
58605
58605
|
var comments = n.Node.check(value) && types17.getFieldValue(value, "comments");
|
|
58606
58606
|
if (!comments || comments.length === 0) {
|
|
58607
58607
|
return innerLines;
|
|
@@ -58613,9 +58613,9 @@ var require_comments = __commonJS({
|
|
|
58613
58613
|
var leading = types17.getFieldValue(comment, "leading");
|
|
58614
58614
|
var trailing = types17.getFieldValue(comment, "trailing");
|
|
58615
58615
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
58616
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
58616
|
+
leadingParts.push(printLeadingComment(commentPath, print11));
|
|
58617
58617
|
} else if (trailing) {
|
|
58618
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
58618
|
+
trailingParts.push(printTrailingComment(commentPath, print11));
|
|
58619
58619
|
}
|
|
58620
58620
|
}, "comments");
|
|
58621
58621
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -59306,7 +59306,7 @@ var require_patcher = __commonJS({
|
|
|
59306
59306
|
};
|
|
59307
59307
|
exports.Patcher = Patcher;
|
|
59308
59308
|
var Pp = Patcher.prototype;
|
|
59309
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
59309
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print11) {
|
|
59310
59310
|
var patcher = this;
|
|
59311
59311
|
if (!newNode.comments && !oldNode.comments) {
|
|
59312
59312
|
return true;
|
|
@@ -59323,7 +59323,7 @@ var require_patcher = __commonJS({
|
|
|
59323
59323
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
59324
59324
|
patcher.replace(
|
|
59325
59325
|
oldComment.loc,
|
|
59326
|
-
|
|
59326
|
+
print11(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
59327
59327
|
);
|
|
59328
59328
|
});
|
|
59329
59329
|
}
|
|
@@ -59370,17 +59370,17 @@ var require_patcher = __commonJS({
|
|
|
59370
59370
|
var reprints = [];
|
|
59371
59371
|
if (!lines || !findReprints(path2, reprints))
|
|
59372
59372
|
return;
|
|
59373
|
-
return function(
|
|
59373
|
+
return function(print11) {
|
|
59374
59374
|
var patcher = new Patcher(lines);
|
|
59375
59375
|
reprints.forEach(function(reprint) {
|
|
59376
59376
|
var newNode = reprint.newPath.getValue();
|
|
59377
59377
|
var oldNode = reprint.oldPath.getValue();
|
|
59378
59378
|
SourceLocation.assert(oldNode.loc, true);
|
|
59379
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
59379
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print11);
|
|
59380
59380
|
if (needToPrintNewPathWithComments) {
|
|
59381
59381
|
patcher.deleteComments(oldNode);
|
|
59382
59382
|
}
|
|
59383
|
-
var newLines =
|
|
59383
|
+
var newLines = print11(reprint.newPath, {
|
|
59384
59384
|
includeComments: needToPrintNewPathWithComments,
|
|
59385
59385
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
59386
59386
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -59597,10 +59597,10 @@ var require_printer2 = __commonJS({
|
|
|
59597
59597
|
function makePrintFunctionWith(options, overrides) {
|
|
59598
59598
|
options = Object.assign({}, options, overrides);
|
|
59599
59599
|
return function(path2) {
|
|
59600
|
-
return
|
|
59600
|
+
return print11(path2, options);
|
|
59601
59601
|
};
|
|
59602
59602
|
}
|
|
59603
|
-
function
|
|
59603
|
+
function print11(path2, options) {
|
|
59604
59604
|
assert_1.default.ok(path2 instanceof fast_path_1.default);
|
|
59605
59605
|
options = options || {};
|
|
59606
59606
|
if (options.includeComments) {
|
|
@@ -59616,7 +59616,7 @@ var require_printer2 = __commonJS({
|
|
|
59616
59616
|
}
|
|
59617
59617
|
}
|
|
59618
59618
|
var reprinter = (0, patcher_1.getReprinter)(path2);
|
|
59619
|
-
var lines = reprinter ? reprinter(
|
|
59619
|
+
var lines = reprinter ? reprinter(print11) : genericPrint(path2, config4, options, makePrintFunctionWith(options, {
|
|
59620
59620
|
includeComments: true,
|
|
59621
59621
|
avoidRootParens: false
|
|
59622
59622
|
}));
|
|
@@ -59627,7 +59627,7 @@ var require_printer2 = __commonJS({
|
|
|
59627
59627
|
if (!ast) {
|
|
59628
59628
|
return emptyPrintResult;
|
|
59629
59629
|
}
|
|
59630
|
-
var lines =
|
|
59630
|
+
var lines = print11(fast_path_1.default.from(ast), {
|
|
59631
59631
|
includeComments: true,
|
|
59632
59632
|
avoidRootParens: false
|
|
59633
59633
|
});
|
|
@@ -59680,7 +59680,7 @@ var require_printer2 = __commonJS({
|
|
|
59680
59680
|
}
|
|
59681
59681
|
return (0, lines_1.concat)(parts);
|
|
59682
59682
|
}
|
|
59683
|
-
function genericPrintNoParens(path2, options,
|
|
59683
|
+
function genericPrintNoParens(path2, options, print11) {
|
|
59684
59684
|
var n = path2.getValue();
|
|
59685
59685
|
if (!n) {
|
|
59686
59686
|
return (0, lines_1.fromString)("");
|
|
@@ -59692,45 +59692,45 @@ var require_printer2 = __commonJS({
|
|
|
59692
59692
|
var parts = [];
|
|
59693
59693
|
switch (n.type) {
|
|
59694
59694
|
case "File":
|
|
59695
|
-
return path2.call(
|
|
59695
|
+
return path2.call(print11, "program");
|
|
59696
59696
|
case "Program":
|
|
59697
59697
|
if (n.directives) {
|
|
59698
59698
|
path2.each(function(childPath) {
|
|
59699
|
-
parts.push(
|
|
59699
|
+
parts.push(print11(childPath), ";\n");
|
|
59700
59700
|
}, "directives");
|
|
59701
59701
|
}
|
|
59702
59702
|
if (n.interpreter) {
|
|
59703
|
-
parts.push(path2.call(
|
|
59703
|
+
parts.push(path2.call(print11, "interpreter"));
|
|
59704
59704
|
}
|
|
59705
59705
|
parts.push(path2.call(function(bodyPath) {
|
|
59706
|
-
return printStatementSequence(bodyPath, options,
|
|
59706
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
59707
59707
|
}, "body"));
|
|
59708
59708
|
return (0, lines_1.concat)(parts);
|
|
59709
59709
|
case "Noop":
|
|
59710
59710
|
case "EmptyStatement":
|
|
59711
59711
|
return (0, lines_1.fromString)("");
|
|
59712
59712
|
case "ExpressionStatement":
|
|
59713
|
-
return (0, lines_1.concat)([path2.call(
|
|
59713
|
+
return (0, lines_1.concat)([path2.call(print11, "expression"), ";"]);
|
|
59714
59714
|
case "ParenthesizedExpression":
|
|
59715
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
59715
|
+
return (0, lines_1.concat)(["(", path2.call(print11, "expression"), ")"]);
|
|
59716
59716
|
case "BinaryExpression":
|
|
59717
59717
|
case "LogicalExpression":
|
|
59718
59718
|
case "AssignmentExpression":
|
|
59719
59719
|
return (0, lines_1.fromString)(" ").join([
|
|
59720
|
-
path2.call(
|
|
59720
|
+
path2.call(print11, "left"),
|
|
59721
59721
|
n.operator,
|
|
59722
|
-
path2.call(
|
|
59722
|
+
path2.call(print11, "right")
|
|
59723
59723
|
]);
|
|
59724
59724
|
case "AssignmentPattern":
|
|
59725
59725
|
return (0, lines_1.concat)([
|
|
59726
|
-
path2.call(
|
|
59726
|
+
path2.call(print11, "left"),
|
|
59727
59727
|
" = ",
|
|
59728
|
-
path2.call(
|
|
59728
|
+
path2.call(print11, "right")
|
|
59729
59729
|
]);
|
|
59730
59730
|
case "MemberExpression":
|
|
59731
59731
|
case "OptionalMemberExpression": {
|
|
59732
|
-
parts.push(path2.call(
|
|
59733
|
-
var property = path2.call(
|
|
59732
|
+
parts.push(path2.call(print11, "object"));
|
|
59733
|
+
var property = path2.call(print11, "property");
|
|
59734
59734
|
var optional = types17.getFieldValue(n, "optional");
|
|
59735
59735
|
if (n.computed) {
|
|
59736
59736
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -59740,18 +59740,18 @@ var require_printer2 = __commonJS({
|
|
|
59740
59740
|
return (0, lines_1.concat)(parts);
|
|
59741
59741
|
}
|
|
59742
59742
|
case "ChainExpression":
|
|
59743
|
-
return path2.call(
|
|
59743
|
+
return path2.call(print11, "expression");
|
|
59744
59744
|
case "MetaProperty":
|
|
59745
59745
|
return (0, lines_1.concat)([
|
|
59746
|
-
path2.call(
|
|
59746
|
+
path2.call(print11, "meta"),
|
|
59747
59747
|
".",
|
|
59748
|
-
path2.call(
|
|
59748
|
+
path2.call(print11, "property")
|
|
59749
59749
|
]);
|
|
59750
59750
|
case "BindExpression":
|
|
59751
59751
|
if (n.object) {
|
|
59752
|
-
parts.push(path2.call(
|
|
59752
|
+
parts.push(path2.call(print11, "object"));
|
|
59753
59753
|
}
|
|
59754
|
-
parts.push("::", path2.call(
|
|
59754
|
+
parts.push("::", path2.call(print11, "callee"));
|
|
59755
59755
|
return (0, lines_1.concat)(parts);
|
|
59756
59756
|
case "Path":
|
|
59757
59757
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -59759,7 +59759,7 @@ var require_printer2 = __commonJS({
|
|
|
59759
59759
|
return (0, lines_1.concat)([
|
|
59760
59760
|
(0, lines_1.fromString)(n.name, options),
|
|
59761
59761
|
n.optional ? "?" : "",
|
|
59762
|
-
path2.call(
|
|
59762
|
+
path2.call(print11, "typeAnnotation")
|
|
59763
59763
|
]);
|
|
59764
59764
|
case "SpreadElement":
|
|
59765
59765
|
case "SpreadElementPattern":
|
|
@@ -59770,8 +59770,8 @@ var require_printer2 = __commonJS({
|
|
|
59770
59770
|
case "RestElement":
|
|
59771
59771
|
return (0, lines_1.concat)([
|
|
59772
59772
|
"...",
|
|
59773
|
-
path2.call(
|
|
59774
|
-
path2.call(
|
|
59773
|
+
path2.call(print11, "argument"),
|
|
59774
|
+
path2.call(print11, "typeAnnotation")
|
|
59775
59775
|
]);
|
|
59776
59776
|
case "FunctionDeclaration":
|
|
59777
59777
|
case "FunctionExpression":
|
|
@@ -59786,15 +59786,15 @@ var require_printer2 = __commonJS({
|
|
|
59786
59786
|
if (n.generator)
|
|
59787
59787
|
parts.push("*");
|
|
59788
59788
|
if (n.id) {
|
|
59789
|
-
parts.push(" ", path2.call(
|
|
59789
|
+
parts.push(" ", path2.call(print11, "id"), path2.call(print11, "typeParameters"));
|
|
59790
59790
|
} else {
|
|
59791
59791
|
if (n.typeParameters) {
|
|
59792
|
-
parts.push(path2.call(
|
|
59792
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
59793
59793
|
}
|
|
59794
59794
|
}
|
|
59795
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
59795
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
59796
59796
|
if (n.body) {
|
|
59797
|
-
parts.push(" ", path2.call(
|
|
59797
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
59798
59798
|
}
|
|
59799
59799
|
return (0, lines_1.concat)(parts);
|
|
59800
59800
|
case "ArrowFunctionExpression":
|
|
@@ -59802,44 +59802,44 @@ var require_printer2 = __commonJS({
|
|
|
59802
59802
|
parts.push("async ");
|
|
59803
59803
|
}
|
|
59804
59804
|
if (n.typeParameters) {
|
|
59805
|
-
parts.push(path2.call(
|
|
59805
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
59806
59806
|
}
|
|
59807
59807
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
59808
|
-
parts.push(path2.call(
|
|
59808
|
+
parts.push(path2.call(print11, "params", 0));
|
|
59809
59809
|
} else {
|
|
59810
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
59810
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
59811
59811
|
}
|
|
59812
|
-
parts.push(" => ", path2.call(
|
|
59812
|
+
parts.push(" => ", path2.call(print11, "body"));
|
|
59813
59813
|
return (0, lines_1.concat)(parts);
|
|
59814
59814
|
case "MethodDefinition":
|
|
59815
|
-
return printMethod(path2, options,
|
|
59815
|
+
return printMethod(path2, options, print11);
|
|
59816
59816
|
case "YieldExpression":
|
|
59817
59817
|
parts.push("yield");
|
|
59818
59818
|
if (n.delegate)
|
|
59819
59819
|
parts.push("*");
|
|
59820
59820
|
if (n.argument)
|
|
59821
|
-
parts.push(" ", path2.call(
|
|
59821
|
+
parts.push(" ", path2.call(print11, "argument"));
|
|
59822
59822
|
return (0, lines_1.concat)(parts);
|
|
59823
59823
|
case "AwaitExpression":
|
|
59824
59824
|
parts.push("await");
|
|
59825
59825
|
if (n.all)
|
|
59826
59826
|
parts.push("*");
|
|
59827
59827
|
if (n.argument)
|
|
59828
|
-
parts.push(" ", path2.call(
|
|
59828
|
+
parts.push(" ", path2.call(print11, "argument"));
|
|
59829
59829
|
return (0, lines_1.concat)(parts);
|
|
59830
59830
|
case "ModuleExpression":
|
|
59831
59831
|
return (0, lines_1.concat)([
|
|
59832
59832
|
"module {\n",
|
|
59833
|
-
path2.call(
|
|
59833
|
+
path2.call(print11, "body").indent(options.tabWidth),
|
|
59834
59834
|
"\n}"
|
|
59835
59835
|
]);
|
|
59836
59836
|
case "ModuleDeclaration":
|
|
59837
|
-
parts.push("module", path2.call(
|
|
59837
|
+
parts.push("module", path2.call(print11, "id"));
|
|
59838
59838
|
if (n.source) {
|
|
59839
59839
|
assert_1.default.ok(!n.body);
|
|
59840
|
-
parts.push("from", path2.call(
|
|
59840
|
+
parts.push("from", path2.call(print11, "source"));
|
|
59841
59841
|
} else {
|
|
59842
|
-
parts.push(path2.call(
|
|
59842
|
+
parts.push(path2.call(print11, "body"));
|
|
59843
59843
|
}
|
|
59844
59844
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
59845
59845
|
case "ImportSpecifier":
|
|
@@ -59847,27 +59847,27 @@ var require_printer2 = __commonJS({
|
|
|
59847
59847
|
parts.push(n.importKind + " ");
|
|
59848
59848
|
}
|
|
59849
59849
|
if (n.imported) {
|
|
59850
|
-
parts.push(path2.call(
|
|
59850
|
+
parts.push(path2.call(print11, "imported"));
|
|
59851
59851
|
if (n.local && n.local.name !== n.imported.name) {
|
|
59852
|
-
parts.push(" as ", path2.call(
|
|
59852
|
+
parts.push(" as ", path2.call(print11, "local"));
|
|
59853
59853
|
}
|
|
59854
59854
|
} else if (n.id) {
|
|
59855
|
-
parts.push(path2.call(
|
|
59855
|
+
parts.push(path2.call(print11, "id"));
|
|
59856
59856
|
if (n.name) {
|
|
59857
|
-
parts.push(" as ", path2.call(
|
|
59857
|
+
parts.push(" as ", path2.call(print11, "name"));
|
|
59858
59858
|
}
|
|
59859
59859
|
}
|
|
59860
59860
|
return (0, lines_1.concat)(parts);
|
|
59861
59861
|
case "ExportSpecifier":
|
|
59862
59862
|
if (n.local) {
|
|
59863
|
-
parts.push(path2.call(
|
|
59863
|
+
parts.push(path2.call(print11, "local"));
|
|
59864
59864
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
59865
|
-
parts.push(" as ", path2.call(
|
|
59865
|
+
parts.push(" as ", path2.call(print11, "exported"));
|
|
59866
59866
|
}
|
|
59867
59867
|
} else if (n.id) {
|
|
59868
|
-
parts.push(path2.call(
|
|
59868
|
+
parts.push(path2.call(print11, "id"));
|
|
59869
59869
|
if (n.name) {
|
|
59870
|
-
parts.push(" as ", path2.call(
|
|
59870
|
+
parts.push(" as ", path2.call(print11, "name"));
|
|
59871
59871
|
}
|
|
59872
59872
|
}
|
|
59873
59873
|
return (0, lines_1.concat)(parts);
|
|
@@ -59876,40 +59876,40 @@ var require_printer2 = __commonJS({
|
|
|
59876
59876
|
case "ImportNamespaceSpecifier":
|
|
59877
59877
|
parts.push("* as ");
|
|
59878
59878
|
if (n.local) {
|
|
59879
|
-
parts.push(path2.call(
|
|
59879
|
+
parts.push(path2.call(print11, "local"));
|
|
59880
59880
|
} else if (n.id) {
|
|
59881
|
-
parts.push(path2.call(
|
|
59881
|
+
parts.push(path2.call(print11, "id"));
|
|
59882
59882
|
}
|
|
59883
59883
|
return (0, lines_1.concat)(parts);
|
|
59884
59884
|
case "ImportDefaultSpecifier":
|
|
59885
59885
|
if (n.local) {
|
|
59886
|
-
return path2.call(
|
|
59886
|
+
return path2.call(print11, "local");
|
|
59887
59887
|
}
|
|
59888
|
-
return path2.call(
|
|
59888
|
+
return path2.call(print11, "id");
|
|
59889
59889
|
case "TSExportAssignment":
|
|
59890
|
-
return (0, lines_1.concat)(["export = ", path2.call(
|
|
59890
|
+
return (0, lines_1.concat)(["export = ", path2.call(print11, "expression")]);
|
|
59891
59891
|
case "ExportDeclaration":
|
|
59892
59892
|
case "ExportDefaultDeclaration":
|
|
59893
59893
|
case "ExportNamedDeclaration":
|
|
59894
|
-
return printExportDeclaration(path2, options,
|
|
59894
|
+
return printExportDeclaration(path2, options, print11);
|
|
59895
59895
|
case "ExportAllDeclaration":
|
|
59896
59896
|
parts.push("export *");
|
|
59897
59897
|
if (n.exported) {
|
|
59898
|
-
parts.push(" as ", path2.call(
|
|
59898
|
+
parts.push(" as ", path2.call(print11, "exported"));
|
|
59899
59899
|
}
|
|
59900
|
-
parts.push(" from ", path2.call(
|
|
59900
|
+
parts.push(" from ", path2.call(print11, "source"), ";");
|
|
59901
59901
|
return (0, lines_1.concat)(parts);
|
|
59902
59902
|
case "TSNamespaceExportDeclaration":
|
|
59903
|
-
parts.push("export as namespace ", path2.call(
|
|
59903
|
+
parts.push("export as namespace ", path2.call(print11, "id"));
|
|
59904
59904
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
59905
59905
|
case "ExportNamespaceSpecifier":
|
|
59906
|
-
return (0, lines_1.concat)(["* as ", path2.call(
|
|
59906
|
+
return (0, lines_1.concat)(["* as ", path2.call(print11, "exported")]);
|
|
59907
59907
|
case "ExportDefaultSpecifier":
|
|
59908
|
-
return path2.call(
|
|
59908
|
+
return path2.call(print11, "exported");
|
|
59909
59909
|
case "Import":
|
|
59910
59910
|
return (0, lines_1.fromString)("import", options);
|
|
59911
59911
|
case "ImportExpression":
|
|
59912
|
-
return (0, lines_1.concat)(["import(", path2.call(
|
|
59912
|
+
return (0, lines_1.concat)(["import(", path2.call(print11, "source"), ")"]);
|
|
59913
59913
|
case "ImportDeclaration": {
|
|
59914
59914
|
parts.push("import ");
|
|
59915
59915
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -59921,9 +59921,9 @@ var require_printer2 = __commonJS({
|
|
|
59921
59921
|
path2.each(function(specifierPath) {
|
|
59922
59922
|
var spec = specifierPath.getValue();
|
|
59923
59923
|
if (spec.type === "ImportSpecifier") {
|
|
59924
|
-
bracedSpecifiers_1.push(
|
|
59924
|
+
bracedSpecifiers_1.push(print11(specifierPath));
|
|
59925
59925
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
59926
|
-
unbracedSpecifiers_1.push(
|
|
59926
|
+
unbracedSpecifiers_1.push(print11(specifierPath));
|
|
59927
59927
|
}
|
|
59928
59928
|
}, "specifiers");
|
|
59929
59929
|
unbracedSpecifiers_1.forEach(function(lines2, i2) {
|
|
@@ -59953,16 +59953,16 @@ var require_printer2 = __commonJS({
|
|
|
59953
59953
|
}
|
|
59954
59954
|
parts.push(" from ");
|
|
59955
59955
|
}
|
|
59956
|
-
parts.push(path2.call(
|
|
59956
|
+
parts.push(path2.call(print11, "source"), maybePrintImportAssertions(path2, options, print11), ";");
|
|
59957
59957
|
return (0, lines_1.concat)(parts);
|
|
59958
59958
|
}
|
|
59959
59959
|
case "ImportAttribute":
|
|
59960
|
-
return (0, lines_1.concat)([path2.call(
|
|
59960
|
+
return (0, lines_1.concat)([path2.call(print11, "key"), ": ", path2.call(print11, "value")]);
|
|
59961
59961
|
case "StaticBlock":
|
|
59962
59962
|
parts.push("static ");
|
|
59963
59963
|
case "BlockStatement": {
|
|
59964
59964
|
var naked_1 = path2.call(function(bodyPath) {
|
|
59965
|
-
return printStatementSequence(bodyPath, options,
|
|
59965
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
59966
59966
|
}, "body");
|
|
59967
59967
|
if (naked_1.isEmpty()) {
|
|
59968
59968
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -59973,7 +59973,7 @@ var require_printer2 = __commonJS({
|
|
|
59973
59973
|
parts.push("{\n");
|
|
59974
59974
|
if (n.directives) {
|
|
59975
59975
|
path2.each(function(childPath) {
|
|
59976
|
-
parts.push(maybeAddSemicolon(
|
|
59976
|
+
parts.push(maybeAddSemicolon(print11(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
59977
59977
|
}, "directives");
|
|
59978
59978
|
}
|
|
59979
59979
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -59983,7 +59983,7 @@ var require_printer2 = __commonJS({
|
|
|
59983
59983
|
case "ReturnStatement": {
|
|
59984
59984
|
parts.push("return");
|
|
59985
59985
|
if (n.argument) {
|
|
59986
|
-
var argLines = path2.call(
|
|
59986
|
+
var argLines = path2.call(print11, "argument");
|
|
59987
59987
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
59988
59988
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
59989
59989
|
} else {
|
|
@@ -59995,17 +59995,17 @@ var require_printer2 = __commonJS({
|
|
|
59995
59995
|
}
|
|
59996
59996
|
case "CallExpression":
|
|
59997
59997
|
case "OptionalCallExpression":
|
|
59998
|
-
parts.push(path2.call(
|
|
59998
|
+
parts.push(path2.call(print11, "callee"));
|
|
59999
59999
|
if (n.typeParameters) {
|
|
60000
|
-
parts.push(path2.call(
|
|
60000
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
60001
60001
|
}
|
|
60002
60002
|
if (n.typeArguments) {
|
|
60003
|
-
parts.push(path2.call(
|
|
60003
|
+
parts.push(path2.call(print11, "typeArguments"));
|
|
60004
60004
|
}
|
|
60005
60005
|
if (types17.getFieldValue(n, "optional")) {
|
|
60006
60006
|
parts.push("?.");
|
|
60007
60007
|
}
|
|
60008
|
-
parts.push(printArgumentsList(path2, options,
|
|
60008
|
+
parts.push(printArgumentsList(path2, options, print11));
|
|
60009
60009
|
return (0, lines_1.concat)(parts);
|
|
60010
60010
|
case "RecordExpression":
|
|
60011
60011
|
parts.push("#");
|
|
@@ -60035,7 +60035,7 @@ var require_printer2 = __commonJS({
|
|
|
60035
60035
|
var i_1 = 0;
|
|
60036
60036
|
fields.forEach(function(field) {
|
|
60037
60037
|
path2.each(function(childPath) {
|
|
60038
|
-
var lines2 =
|
|
60038
|
+
var lines2 = print11(childPath);
|
|
60039
60039
|
if (!oneLine_1) {
|
|
60040
60040
|
lines2 = lines2.indent(options.tabWidth);
|
|
60041
60041
|
}
|
|
@@ -60072,32 +60072,32 @@ var require_printer2 = __commonJS({
|
|
|
60072
60072
|
parts[parts.length - 1] = " " + rightBrace;
|
|
60073
60073
|
}
|
|
60074
60074
|
if (n.typeAnnotation) {
|
|
60075
|
-
parts.push(path2.call(
|
|
60075
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60076
60076
|
}
|
|
60077
60077
|
return (0, lines_1.concat)(parts);
|
|
60078
60078
|
}
|
|
60079
60079
|
case "PropertyPattern":
|
|
60080
60080
|
return (0, lines_1.concat)([
|
|
60081
|
-
path2.call(
|
|
60081
|
+
path2.call(print11, "key"),
|
|
60082
60082
|
": ",
|
|
60083
|
-
path2.call(
|
|
60083
|
+
path2.call(print11, "pattern")
|
|
60084
60084
|
]);
|
|
60085
60085
|
case "ObjectProperty":
|
|
60086
60086
|
case "Property": {
|
|
60087
60087
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
60088
|
-
return printMethod(path2, options,
|
|
60088
|
+
return printMethod(path2, options, print11);
|
|
60089
60089
|
}
|
|
60090
60090
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
60091
|
-
return path2.call(
|
|
60091
|
+
return path2.call(print11, "value");
|
|
60092
60092
|
}
|
|
60093
|
-
var key = path2.call(
|
|
60093
|
+
var key = path2.call(print11, "key");
|
|
60094
60094
|
if (n.computed) {
|
|
60095
60095
|
parts.push("[", key, "]");
|
|
60096
60096
|
} else {
|
|
60097
60097
|
parts.push(key);
|
|
60098
60098
|
}
|
|
60099
60099
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
60100
|
-
parts.push(": ", path2.call(
|
|
60100
|
+
parts.push(": ", path2.call(print11, "value"));
|
|
60101
60101
|
}
|
|
60102
60102
|
return (0, lines_1.concat)(parts);
|
|
60103
60103
|
}
|
|
@@ -60105,18 +60105,18 @@ var require_printer2 = __commonJS({
|
|
|
60105
60105
|
case "ObjectMethod":
|
|
60106
60106
|
case "ClassPrivateMethod":
|
|
60107
60107
|
case "TSDeclareMethod":
|
|
60108
|
-
return printMethod(path2, options,
|
|
60108
|
+
return printMethod(path2, options, print11);
|
|
60109
60109
|
case "PrivateName":
|
|
60110
|
-
return (0, lines_1.concat)(["#", path2.call(
|
|
60110
|
+
return (0, lines_1.concat)(["#", path2.call(print11, "id")]);
|
|
60111
60111
|
case "Decorator":
|
|
60112
|
-
return (0, lines_1.concat)(["@", path2.call(
|
|
60112
|
+
return (0, lines_1.concat)(["@", path2.call(print11, "expression")]);
|
|
60113
60113
|
case "TupleExpression":
|
|
60114
60114
|
parts.push("#");
|
|
60115
60115
|
case "ArrayExpression":
|
|
60116
60116
|
case "ArrayPattern": {
|
|
60117
60117
|
var elems = n.elements;
|
|
60118
60118
|
var len_2 = elems.length;
|
|
60119
|
-
var printed_1 = path2.map(
|
|
60119
|
+
var printed_1 = path2.map(print11, "elements");
|
|
60120
60120
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
60121
60121
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
60122
60122
|
if (oneLine_2) {
|
|
@@ -60154,12 +60154,12 @@ var require_printer2 = __commonJS({
|
|
|
60154
60154
|
parts.push("]");
|
|
60155
60155
|
}
|
|
60156
60156
|
if (n.typeAnnotation) {
|
|
60157
|
-
parts.push(path2.call(
|
|
60157
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60158
60158
|
}
|
|
60159
60159
|
return (0, lines_1.concat)(parts);
|
|
60160
60160
|
}
|
|
60161
60161
|
case "SequenceExpression":
|
|
60162
|
-
return (0, lines_1.fromString)(", ").join(path2.map(
|
|
60162
|
+
return (0, lines_1.fromString)(", ").join(path2.map(print11, "expressions"));
|
|
60163
60163
|
case "ThisExpression":
|
|
60164
60164
|
return (0, lines_1.fromString)("this");
|
|
60165
60165
|
case "Super":
|
|
@@ -60180,7 +60180,7 @@ var require_printer2 = __commonJS({
|
|
|
60180
60180
|
case "Literal":
|
|
60181
60181
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
60182
60182
|
case "Directive":
|
|
60183
|
-
return path2.call(
|
|
60183
|
+
return path2.call(print11, "value");
|
|
60184
60184
|
case "DirectiveLiteral":
|
|
60185
60185
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
60186
60186
|
case "InterpreterDirective":
|
|
@@ -60194,32 +60194,32 @@ var require_printer2 = __commonJS({
|
|
|
60194
60194
|
parts.push(n.operator);
|
|
60195
60195
|
if (/[a-z]$/.test(n.operator))
|
|
60196
60196
|
parts.push(" ");
|
|
60197
|
-
parts.push(path2.call(
|
|
60197
|
+
parts.push(path2.call(print11, "argument"));
|
|
60198
60198
|
return (0, lines_1.concat)(parts);
|
|
60199
60199
|
case "UpdateExpression":
|
|
60200
|
-
parts.push(path2.call(
|
|
60200
|
+
parts.push(path2.call(print11, "argument"), n.operator);
|
|
60201
60201
|
if (n.prefix)
|
|
60202
60202
|
parts.reverse();
|
|
60203
60203
|
return (0, lines_1.concat)(parts);
|
|
60204
60204
|
case "ConditionalExpression":
|
|
60205
60205
|
return (0, lines_1.concat)([
|
|
60206
|
-
path2.call(
|
|
60206
|
+
path2.call(print11, "test"),
|
|
60207
60207
|
" ? ",
|
|
60208
|
-
path2.call(
|
|
60208
|
+
path2.call(print11, "consequent"),
|
|
60209
60209
|
" : ",
|
|
60210
|
-
path2.call(
|
|
60210
|
+
path2.call(print11, "alternate")
|
|
60211
60211
|
]);
|
|
60212
60212
|
case "NewExpression": {
|
|
60213
|
-
parts.push("new ", path2.call(
|
|
60213
|
+
parts.push("new ", path2.call(print11, "callee"));
|
|
60214
60214
|
if (n.typeParameters) {
|
|
60215
|
-
parts.push(path2.call(
|
|
60215
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
60216
60216
|
}
|
|
60217
60217
|
if (n.typeArguments) {
|
|
60218
|
-
parts.push(path2.call(
|
|
60218
|
+
parts.push(path2.call(print11, "typeArguments"));
|
|
60219
60219
|
}
|
|
60220
60220
|
var args = n.arguments;
|
|
60221
60221
|
if (args) {
|
|
60222
|
-
parts.push(printArgumentsList(path2, options,
|
|
60222
|
+
parts.push(printArgumentsList(path2, options, print11));
|
|
60223
60223
|
}
|
|
60224
60224
|
return (0, lines_1.concat)(parts);
|
|
60225
60225
|
}
|
|
@@ -60230,7 +60230,7 @@ var require_printer2 = __commonJS({
|
|
|
60230
60230
|
parts.push(n.kind, " ");
|
|
60231
60231
|
var maxLen_1 = 0;
|
|
60232
60232
|
var printed = path2.map(function(childPath) {
|
|
60233
|
-
var lines2 =
|
|
60233
|
+
var lines2 = print11(childPath);
|
|
60234
60234
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
60235
60235
|
return lines2;
|
|
60236
60236
|
}, "declarations");
|
|
@@ -60249,30 +60249,30 @@ var require_printer2 = __commonJS({
|
|
|
60249
60249
|
}
|
|
60250
60250
|
case "VariableDeclarator":
|
|
60251
60251
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
60252
|
-
path2.call(
|
|
60253
|
-
path2.call(
|
|
60254
|
-
]) : path2.call(
|
|
60252
|
+
path2.call(print11, "id"),
|
|
60253
|
+
path2.call(print11, "init")
|
|
60254
|
+
]) : path2.call(print11, "id");
|
|
60255
60255
|
case "WithStatement":
|
|
60256
60256
|
return (0, lines_1.concat)([
|
|
60257
60257
|
"with (",
|
|
60258
|
-
path2.call(
|
|
60258
|
+
path2.call(print11, "object"),
|
|
60259
60259
|
") ",
|
|
60260
|
-
path2.call(
|
|
60260
|
+
path2.call(print11, "body")
|
|
60261
60261
|
]);
|
|
60262
60262
|
case "IfStatement": {
|
|
60263
|
-
var con = adjustClause(path2.call(
|
|
60264
|
-
parts.push("if (", path2.call(
|
|
60263
|
+
var con = adjustClause(path2.call(print11, "consequent"), options);
|
|
60264
|
+
parts.push("if (", path2.call(print11, "test"), ")", con);
|
|
60265
60265
|
if (n.alternate)
|
|
60266
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(
|
|
60266
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print11, "alternate"), options));
|
|
60267
60267
|
return (0, lines_1.concat)(parts);
|
|
60268
60268
|
}
|
|
60269
60269
|
case "ForStatement": {
|
|
60270
|
-
var init = path2.call(
|
|
60270
|
+
var init = path2.call(print11, "init");
|
|
60271
60271
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
60272
60272
|
var forParen = "for (";
|
|
60273
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(
|
|
60273
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print11, "test"), path2.call(print11, "update")]).indentTail(forParen.length);
|
|
60274
60274
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
60275
|
-
var clause = adjustClause(path2.call(
|
|
60275
|
+
var clause = adjustClause(path2.call(print11, "body"), options);
|
|
60276
60276
|
parts.push(head);
|
|
60277
60277
|
if (head.length > 1) {
|
|
60278
60278
|
parts.push("\n");
|
|
@@ -60284,18 +60284,18 @@ var require_printer2 = __commonJS({
|
|
|
60284
60284
|
case "WhileStatement":
|
|
60285
60285
|
return (0, lines_1.concat)([
|
|
60286
60286
|
"while (",
|
|
60287
|
-
path2.call(
|
|
60287
|
+
path2.call(print11, "test"),
|
|
60288
60288
|
")",
|
|
60289
|
-
adjustClause(path2.call(
|
|
60289
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
60290
60290
|
]);
|
|
60291
60291
|
case "ForInStatement":
|
|
60292
60292
|
return (0, lines_1.concat)([
|
|
60293
60293
|
n.each ? "for each (" : "for (",
|
|
60294
|
-
path2.call(
|
|
60294
|
+
path2.call(print11, "left"),
|
|
60295
60295
|
" in ",
|
|
60296
|
-
path2.call(
|
|
60296
|
+
path2.call(print11, "right"),
|
|
60297
60297
|
")",
|
|
60298
|
-
adjustClause(path2.call(
|
|
60298
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
60299
60299
|
]);
|
|
60300
60300
|
case "ForOfStatement":
|
|
60301
60301
|
case "ForAwaitStatement":
|
|
@@ -60303,122 +60303,122 @@ var require_printer2 = __commonJS({
|
|
|
60303
60303
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
60304
60304
|
parts.push("await ");
|
|
60305
60305
|
}
|
|
60306
|
-
parts.push("(", path2.call(
|
|
60306
|
+
parts.push("(", path2.call(print11, "left"), " of ", path2.call(print11, "right"), ")", adjustClause(path2.call(print11, "body"), options));
|
|
60307
60307
|
return (0, lines_1.concat)(parts);
|
|
60308
60308
|
case "DoWhileStatement": {
|
|
60309
60309
|
var doBody = (0, lines_1.concat)([
|
|
60310
60310
|
"do",
|
|
60311
|
-
adjustClause(path2.call(
|
|
60311
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
60312
60312
|
]);
|
|
60313
60313
|
parts.push(doBody);
|
|
60314
60314
|
if (endsWithBrace(doBody))
|
|
60315
60315
|
parts.push(" while");
|
|
60316
60316
|
else
|
|
60317
60317
|
parts.push("\nwhile");
|
|
60318
|
-
parts.push(" (", path2.call(
|
|
60318
|
+
parts.push(" (", path2.call(print11, "test"), ");");
|
|
60319
60319
|
return (0, lines_1.concat)(parts);
|
|
60320
60320
|
}
|
|
60321
60321
|
case "DoExpression": {
|
|
60322
60322
|
var statements = path2.call(function(bodyPath) {
|
|
60323
|
-
return printStatementSequence(bodyPath, options,
|
|
60323
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
60324
60324
|
}, "body");
|
|
60325
60325
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
60326
60326
|
}
|
|
60327
60327
|
case "BreakStatement":
|
|
60328
60328
|
parts.push("break");
|
|
60329
60329
|
if (n.label)
|
|
60330
|
-
parts.push(" ", path2.call(
|
|
60330
|
+
parts.push(" ", path2.call(print11, "label"));
|
|
60331
60331
|
parts.push(";");
|
|
60332
60332
|
return (0, lines_1.concat)(parts);
|
|
60333
60333
|
case "ContinueStatement":
|
|
60334
60334
|
parts.push("continue");
|
|
60335
60335
|
if (n.label)
|
|
60336
|
-
parts.push(" ", path2.call(
|
|
60336
|
+
parts.push(" ", path2.call(print11, "label"));
|
|
60337
60337
|
parts.push(";");
|
|
60338
60338
|
return (0, lines_1.concat)(parts);
|
|
60339
60339
|
case "LabeledStatement":
|
|
60340
60340
|
return (0, lines_1.concat)([
|
|
60341
|
-
path2.call(
|
|
60341
|
+
path2.call(print11, "label"),
|
|
60342
60342
|
":\n",
|
|
60343
|
-
path2.call(
|
|
60343
|
+
path2.call(print11, "body")
|
|
60344
60344
|
]);
|
|
60345
60345
|
case "TryStatement":
|
|
60346
|
-
parts.push("try ", path2.call(
|
|
60346
|
+
parts.push("try ", path2.call(print11, "block"));
|
|
60347
60347
|
if (n.handler) {
|
|
60348
|
-
parts.push(" ", path2.call(
|
|
60348
|
+
parts.push(" ", path2.call(print11, "handler"));
|
|
60349
60349
|
} else if (n.handlers) {
|
|
60350
60350
|
path2.each(function(handlerPath) {
|
|
60351
|
-
parts.push(" ",
|
|
60351
|
+
parts.push(" ", print11(handlerPath));
|
|
60352
60352
|
}, "handlers");
|
|
60353
60353
|
}
|
|
60354
60354
|
if (n.finalizer) {
|
|
60355
|
-
parts.push(" finally ", path2.call(
|
|
60355
|
+
parts.push(" finally ", path2.call(print11, "finalizer"));
|
|
60356
60356
|
}
|
|
60357
60357
|
return (0, lines_1.concat)(parts);
|
|
60358
60358
|
case "CatchClause":
|
|
60359
60359
|
parts.push("catch ");
|
|
60360
60360
|
if (n.param) {
|
|
60361
|
-
parts.push("(", path2.call(
|
|
60361
|
+
parts.push("(", path2.call(print11, "param"));
|
|
60362
60362
|
}
|
|
60363
60363
|
if (n.guard) {
|
|
60364
|
-
parts.push(" if ", path2.call(
|
|
60364
|
+
parts.push(" if ", path2.call(print11, "guard"));
|
|
60365
60365
|
}
|
|
60366
60366
|
if (n.param) {
|
|
60367
60367
|
parts.push(") ");
|
|
60368
60368
|
}
|
|
60369
|
-
parts.push(path2.call(
|
|
60369
|
+
parts.push(path2.call(print11, "body"));
|
|
60370
60370
|
return (0, lines_1.concat)(parts);
|
|
60371
60371
|
case "ThrowStatement":
|
|
60372
|
-
return (0, lines_1.concat)(["throw ", path2.call(
|
|
60372
|
+
return (0, lines_1.concat)(["throw ", path2.call(print11, "argument"), ";"]);
|
|
60373
60373
|
case "SwitchStatement":
|
|
60374
60374
|
return (0, lines_1.concat)([
|
|
60375
60375
|
"switch (",
|
|
60376
|
-
path2.call(
|
|
60376
|
+
path2.call(print11, "discriminant"),
|
|
60377
60377
|
") {\n",
|
|
60378
|
-
(0, lines_1.fromString)("\n").join(path2.map(
|
|
60378
|
+
(0, lines_1.fromString)("\n").join(path2.map(print11, "cases")),
|
|
60379
60379
|
"\n}"
|
|
60380
60380
|
]);
|
|
60381
60381
|
case "SwitchCase":
|
|
60382
60382
|
if (n.test)
|
|
60383
|
-
parts.push("case ", path2.call(
|
|
60383
|
+
parts.push("case ", path2.call(print11, "test"), ":");
|
|
60384
60384
|
else
|
|
60385
60385
|
parts.push("default:");
|
|
60386
60386
|
if (n.consequent.length > 0) {
|
|
60387
60387
|
parts.push("\n", path2.call(function(consequentPath) {
|
|
60388
|
-
return printStatementSequence(consequentPath, options,
|
|
60388
|
+
return printStatementSequence(consequentPath, options, print11);
|
|
60389
60389
|
}, "consequent").indent(options.tabWidth));
|
|
60390
60390
|
}
|
|
60391
60391
|
return (0, lines_1.concat)(parts);
|
|
60392
60392
|
case "DebuggerStatement":
|
|
60393
60393
|
return (0, lines_1.fromString)("debugger;");
|
|
60394
60394
|
case "JSXAttribute":
|
|
60395
|
-
parts.push(path2.call(
|
|
60395
|
+
parts.push(path2.call(print11, "name"));
|
|
60396
60396
|
if (n.value)
|
|
60397
|
-
parts.push("=", path2.call(
|
|
60397
|
+
parts.push("=", path2.call(print11, "value"));
|
|
60398
60398
|
return (0, lines_1.concat)(parts);
|
|
60399
60399
|
case "JSXIdentifier":
|
|
60400
60400
|
return (0, lines_1.fromString)(n.name, options);
|
|
60401
60401
|
case "JSXNamespacedName":
|
|
60402
60402
|
return (0, lines_1.fromString)(":").join([
|
|
60403
|
-
path2.call(
|
|
60404
|
-
path2.call(
|
|
60403
|
+
path2.call(print11, "namespace"),
|
|
60404
|
+
path2.call(print11, "name")
|
|
60405
60405
|
]);
|
|
60406
60406
|
case "JSXMemberExpression":
|
|
60407
60407
|
return (0, lines_1.fromString)(".").join([
|
|
60408
|
-
path2.call(
|
|
60409
|
-
path2.call(
|
|
60408
|
+
path2.call(print11, "object"),
|
|
60409
|
+
path2.call(print11, "property")
|
|
60410
60410
|
]);
|
|
60411
60411
|
case "JSXSpreadAttribute":
|
|
60412
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
60412
|
+
return (0, lines_1.concat)(["{...", path2.call(print11, "argument"), "}"]);
|
|
60413
60413
|
case "JSXSpreadChild":
|
|
60414
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
60414
|
+
return (0, lines_1.concat)(["{...", path2.call(print11, "expression"), "}"]);
|
|
60415
60415
|
case "JSXExpressionContainer":
|
|
60416
|
-
return (0, lines_1.concat)(["{", path2.call(
|
|
60416
|
+
return (0, lines_1.concat)(["{", path2.call(print11, "expression"), "}"]);
|
|
60417
60417
|
case "JSXElement":
|
|
60418
60418
|
case "JSXFragment": {
|
|
60419
60419
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
60420
60420
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
60421
|
-
var openingLines = path2.call(
|
|
60421
|
+
var openingLines = path2.call(print11, openingPropName);
|
|
60422
60422
|
if (n[openingPropName].selfClosing) {
|
|
60423
60423
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
60424
60424
|
return openingLines;
|
|
@@ -60432,16 +60432,16 @@ var require_printer2 = __commonJS({
|
|
|
60432
60432
|
return "\n";
|
|
60433
60433
|
}
|
|
60434
60434
|
}
|
|
60435
|
-
return
|
|
60435
|
+
return print11(childPath);
|
|
60436
60436
|
}, "children")).indentTail(options.tabWidth);
|
|
60437
|
-
var closingLines = path2.call(
|
|
60437
|
+
var closingLines = path2.call(print11, closingPropName);
|
|
60438
60438
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
60439
60439
|
}
|
|
60440
60440
|
case "JSXOpeningElement": {
|
|
60441
|
-
parts.push("<", path2.call(
|
|
60441
|
+
parts.push("<", path2.call(print11, "name"));
|
|
60442
60442
|
var attrParts_1 = [];
|
|
60443
60443
|
path2.each(function(attrPath) {
|
|
60444
|
-
attrParts_1.push(" ",
|
|
60444
|
+
attrParts_1.push(" ", print11(attrPath));
|
|
60445
60445
|
}, "attributes");
|
|
60446
60446
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
60447
60447
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -60458,7 +60458,7 @@ var require_printer2 = __commonJS({
|
|
|
60458
60458
|
return (0, lines_1.concat)(parts);
|
|
60459
60459
|
}
|
|
60460
60460
|
case "JSXClosingElement":
|
|
60461
|
-
return (0, lines_1.concat)(["</", path2.call(
|
|
60461
|
+
return (0, lines_1.concat)(["</", path2.call(print11, "name"), ">"]);
|
|
60462
60462
|
case "JSXOpeningFragment":
|
|
60463
60463
|
return (0, lines_1.fromString)("<>");
|
|
60464
60464
|
case "JSXClosingFragment":
|
|
@@ -60469,9 +60469,9 @@ var require_printer2 = __commonJS({
|
|
|
60469
60469
|
return (0, lines_1.fromString)("");
|
|
60470
60470
|
case "TypeAnnotatedIdentifier":
|
|
60471
60471
|
return (0, lines_1.concat)([
|
|
60472
|
-
path2.call(
|
|
60472
|
+
path2.call(print11, "annotation"),
|
|
60473
60473
|
" ",
|
|
60474
|
-
path2.call(
|
|
60474
|
+
path2.call(print11, "identifier")
|
|
60475
60475
|
]);
|
|
60476
60476
|
case "ClassBody":
|
|
60477
60477
|
if (n.body.length === 0) {
|
|
@@ -60480,12 +60480,12 @@ var require_printer2 = __commonJS({
|
|
|
60480
60480
|
return (0, lines_1.concat)([
|
|
60481
60481
|
"{\n",
|
|
60482
60482
|
path2.call(function(bodyPath) {
|
|
60483
|
-
return printStatementSequence(bodyPath, options,
|
|
60483
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
60484
60484
|
}, "body").indent(options.tabWidth),
|
|
60485
60485
|
"\n}"
|
|
60486
60486
|
]);
|
|
60487
60487
|
case "ClassPropertyDefinition":
|
|
60488
|
-
parts.push("static ", path2.call(
|
|
60488
|
+
parts.push("static ", path2.call(print11, "definition"));
|
|
60489
60489
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
60490
60490
|
parts.push(";");
|
|
60491
60491
|
return (0, lines_1.concat)(parts);
|
|
@@ -60506,12 +60506,12 @@ var require_printer2 = __commonJS({
|
|
|
60506
60506
|
if (n.readonly) {
|
|
60507
60507
|
parts.push("readonly ");
|
|
60508
60508
|
}
|
|
60509
|
-
var key = path2.call(
|
|
60509
|
+
var key = path2.call(print11, "key");
|
|
60510
60510
|
if (n.computed) {
|
|
60511
60511
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
60512
60512
|
}
|
|
60513
60513
|
if (n.variance) {
|
|
60514
|
-
key = (0, lines_1.concat)([printVariance(path2,
|
|
60514
|
+
key = (0, lines_1.concat)([printVariance(path2, print11), key]);
|
|
60515
60515
|
}
|
|
60516
60516
|
parts.push(key);
|
|
60517
60517
|
if (n.optional) {
|
|
@@ -60521,10 +60521,10 @@ var require_printer2 = __commonJS({
|
|
|
60521
60521
|
parts.push("!");
|
|
60522
60522
|
}
|
|
60523
60523
|
if (n.typeAnnotation) {
|
|
60524
|
-
parts.push(path2.call(
|
|
60524
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60525
60525
|
}
|
|
60526
60526
|
if (n.value) {
|
|
60527
|
-
parts.push(" = ", path2.call(
|
|
60527
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
60528
60528
|
}
|
|
60529
60529
|
parts.push(";");
|
|
60530
60530
|
return (0, lines_1.concat)(parts);
|
|
@@ -60533,21 +60533,21 @@ var require_printer2 = __commonJS({
|
|
|
60533
60533
|
if (n.static) {
|
|
60534
60534
|
parts.push("static ");
|
|
60535
60535
|
}
|
|
60536
|
-
parts.push(path2.call(
|
|
60536
|
+
parts.push(path2.call(print11, "key"));
|
|
60537
60537
|
if (n.typeAnnotation) {
|
|
60538
|
-
parts.push(path2.call(
|
|
60538
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60539
60539
|
}
|
|
60540
60540
|
if (n.value) {
|
|
60541
|
-
parts.push(" = ", path2.call(
|
|
60541
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
60542
60542
|
}
|
|
60543
60543
|
parts.push(";");
|
|
60544
60544
|
return (0, lines_1.concat)(parts);
|
|
60545
60545
|
case "ClassAccessorProperty": {
|
|
60546
60546
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
60547
60547
|
if (n.computed) {
|
|
60548
|
-
parts.push("[", path2.call(
|
|
60548
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
60549
60549
|
} else {
|
|
60550
|
-
parts.push(path2.call(
|
|
60550
|
+
parts.push(path2.call(print11, "key"));
|
|
60551
60551
|
}
|
|
60552
60552
|
if (n.optional) {
|
|
60553
60553
|
parts.push("?");
|
|
@@ -60556,10 +60556,10 @@ var require_printer2 = __commonJS({
|
|
|
60556
60556
|
parts.push("!");
|
|
60557
60557
|
}
|
|
60558
60558
|
if (n.typeAnnotation) {
|
|
60559
|
-
parts.push(path2.call(
|
|
60559
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60560
60560
|
}
|
|
60561
60561
|
if (n.value) {
|
|
60562
|
-
parts.push(" = ", path2.call(
|
|
60562
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
60563
60563
|
}
|
|
60564
60564
|
parts.push(";");
|
|
60565
60565
|
return (0, lines_1.concat)(parts);
|
|
@@ -60575,21 +60575,21 @@ var require_printer2 = __commonJS({
|
|
|
60575
60575
|
}
|
|
60576
60576
|
parts.push("class");
|
|
60577
60577
|
if (n.id) {
|
|
60578
|
-
parts.push(" ", path2.call(
|
|
60578
|
+
parts.push(" ", path2.call(print11, "id"));
|
|
60579
60579
|
}
|
|
60580
60580
|
if (n.typeParameters) {
|
|
60581
|
-
parts.push(path2.call(
|
|
60581
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
60582
60582
|
}
|
|
60583
60583
|
if (n.superClass) {
|
|
60584
|
-
parts.push(" extends ", path2.call(
|
|
60584
|
+
parts.push(" extends ", path2.call(print11, "superClass"), path2.call(print11, "superTypeParameters"));
|
|
60585
60585
|
}
|
|
60586
60586
|
if (n.extends && n.extends.length > 0) {
|
|
60587
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60587
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")));
|
|
60588
60588
|
}
|
|
60589
60589
|
if (n["implements"] && n["implements"].length > 0) {
|
|
60590
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60590
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print11, "implements")));
|
|
60591
60591
|
}
|
|
60592
|
-
parts.push(" ", path2.call(
|
|
60592
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
60593
60593
|
if (n.type === "DeclareClass") {
|
|
60594
60594
|
return printFlowDeclaration(path2, parts);
|
|
60595
60595
|
} else {
|
|
@@ -60598,11 +60598,11 @@ var require_printer2 = __commonJS({
|
|
|
60598
60598
|
case "TemplateElement":
|
|
60599
60599
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
60600
60600
|
case "TemplateLiteral": {
|
|
60601
|
-
var expressions_1 = path2.map(
|
|
60601
|
+
var expressions_1 = path2.map(print11, "expressions");
|
|
60602
60602
|
parts.push("`");
|
|
60603
60603
|
path2.each(function(childPath) {
|
|
60604
60604
|
var i2 = childPath.getName();
|
|
60605
|
-
parts.push(
|
|
60605
|
+
parts.push(print11(childPath));
|
|
60606
60606
|
if (i2 < expressions_1.length) {
|
|
60607
60607
|
parts.push("${", expressions_1[i2], "}");
|
|
60608
60608
|
}
|
|
@@ -60611,7 +60611,7 @@ var require_printer2 = __commonJS({
|
|
|
60611
60611
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
60612
60612
|
}
|
|
60613
60613
|
case "TaggedTemplateExpression":
|
|
60614
|
-
return (0, lines_1.concat)([path2.call(
|
|
60614
|
+
return (0, lines_1.concat)([path2.call(print11, "tag"), path2.call(print11, "quasi")]);
|
|
60615
60615
|
case "Node":
|
|
60616
60616
|
case "Printable":
|
|
60617
60617
|
case "SourceLocation":
|
|
@@ -60645,7 +60645,7 @@ var require_printer2 = __commonJS({
|
|
|
60645
60645
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
60646
60646
|
parts.push(": ");
|
|
60647
60647
|
}
|
|
60648
|
-
parts.push(path2.call(
|
|
60648
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60649
60649
|
return (0, lines_1.concat)(parts);
|
|
60650
60650
|
}
|
|
60651
60651
|
return (0, lines_1.fromString)("");
|
|
@@ -60659,9 +60659,9 @@ var require_printer2 = __commonJS({
|
|
|
60659
60659
|
case "MixedTypeAnnotation":
|
|
60660
60660
|
return (0, lines_1.fromString)("mixed", options);
|
|
60661
60661
|
case "ArrayTypeAnnotation":
|
|
60662
|
-
return (0, lines_1.concat)([path2.call(
|
|
60662
|
+
return (0, lines_1.concat)([path2.call(print11, "elementType"), "[]"]);
|
|
60663
60663
|
case "TupleTypeAnnotation": {
|
|
60664
|
-
var printed_2 = path2.map(
|
|
60664
|
+
var printed_2 = path2.map(print11, "types");
|
|
60665
60665
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
60666
60666
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
60667
60667
|
if (oneLine_3) {
|
|
@@ -60708,38 +60708,38 @@ var require_printer2 = __commonJS({
|
|
|
60708
60708
|
case "InterfaceTypeAnnotation":
|
|
60709
60709
|
parts.push("interface");
|
|
60710
60710
|
if (n.extends && n.extends.length > 0) {
|
|
60711
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60711
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")));
|
|
60712
60712
|
}
|
|
60713
|
-
parts.push(" ", path2.call(
|
|
60713
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
60714
60714
|
return (0, lines_1.concat)(parts);
|
|
60715
60715
|
case "DeclareFunction":
|
|
60716
60716
|
return printFlowDeclaration(path2, [
|
|
60717
60717
|
"function ",
|
|
60718
|
-
path2.call(
|
|
60718
|
+
path2.call(print11, "id"),
|
|
60719
60719
|
";"
|
|
60720
60720
|
]);
|
|
60721
60721
|
case "DeclareModule":
|
|
60722
60722
|
return printFlowDeclaration(path2, [
|
|
60723
60723
|
"module ",
|
|
60724
|
-
path2.call(
|
|
60724
|
+
path2.call(print11, "id"),
|
|
60725
60725
|
" ",
|
|
60726
|
-
path2.call(
|
|
60726
|
+
path2.call(print11, "body")
|
|
60727
60727
|
]);
|
|
60728
60728
|
case "DeclareModuleExports":
|
|
60729
60729
|
return printFlowDeclaration(path2, [
|
|
60730
60730
|
"module.exports",
|
|
60731
|
-
path2.call(
|
|
60731
|
+
path2.call(print11, "typeAnnotation")
|
|
60732
60732
|
]);
|
|
60733
60733
|
case "DeclareVariable":
|
|
60734
|
-
return printFlowDeclaration(path2, ["var ", path2.call(
|
|
60734
|
+
return printFlowDeclaration(path2, ["var ", path2.call(print11, "id"), ";"]);
|
|
60735
60735
|
case "DeclareExportDeclaration":
|
|
60736
60736
|
case "DeclareExportAllDeclaration":
|
|
60737
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options,
|
|
60737
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print11)]);
|
|
60738
60738
|
case "EnumDeclaration":
|
|
60739
60739
|
return (0, lines_1.concat)([
|
|
60740
60740
|
"enum ",
|
|
60741
|
-
path2.call(
|
|
60742
|
-
path2.call(
|
|
60741
|
+
path2.call(print11, "id"),
|
|
60742
|
+
path2.call(print11, "body")
|
|
60743
60743
|
]);
|
|
60744
60744
|
case "EnumBooleanBody":
|
|
60745
60745
|
case "EnumNumberBody":
|
|
@@ -60751,24 +60751,24 @@ var require_printer2 = __commonJS({
|
|
|
60751
60751
|
n.type.slice(4, -4).toLowerCase()
|
|
60752
60752
|
);
|
|
60753
60753
|
}
|
|
60754
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(
|
|
60754
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print11, "members")).indent(options.tabWidth), "\n}");
|
|
60755
60755
|
return (0, lines_1.concat)(parts);
|
|
60756
60756
|
}
|
|
60757
60757
|
case "EnumDefaultedMember":
|
|
60758
|
-
return (0, lines_1.concat)([path2.call(
|
|
60758
|
+
return (0, lines_1.concat)([path2.call(print11, "id"), ","]);
|
|
60759
60759
|
case "EnumBooleanMember":
|
|
60760
60760
|
case "EnumNumberMember":
|
|
60761
60761
|
case "EnumStringMember":
|
|
60762
60762
|
return (0, lines_1.concat)([
|
|
60763
|
-
path2.call(
|
|
60763
|
+
path2.call(print11, "id"),
|
|
60764
60764
|
" = ",
|
|
60765
|
-
path2.call(
|
|
60765
|
+
path2.call(print11, "init"),
|
|
60766
60766
|
","
|
|
60767
60767
|
]);
|
|
60768
60768
|
case "InferredPredicate":
|
|
60769
60769
|
return (0, lines_1.fromString)("%checks", options);
|
|
60770
60770
|
case "DeclaredPredicate":
|
|
60771
|
-
return (0, lines_1.concat)(["%checks(", path2.call(
|
|
60771
|
+
return (0, lines_1.concat)(["%checks(", path2.call(print11, "value"), ")"]);
|
|
60772
60772
|
case "FunctionTypeAnnotation": {
|
|
60773
60773
|
var parent = path2.getParentNode(0);
|
|
60774
60774
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
|
|
@@ -60778,14 +60778,14 @@ var require_printer2 = __commonJS({
|
|
|
60778
60778
|
}
|
|
60779
60779
|
var hasTypeParameters = !!n.typeParameters;
|
|
60780
60780
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
60781
|
-
parts.push(hasTypeParameters ? path2.call(
|
|
60781
|
+
parts.push(hasTypeParameters ? path2.call(print11, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print11), needsParens ? ")" : "");
|
|
60782
60782
|
if (n.returnType) {
|
|
60783
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(
|
|
60783
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print11, "returnType"));
|
|
60784
60784
|
}
|
|
60785
60785
|
return (0, lines_1.concat)(parts);
|
|
60786
60786
|
}
|
|
60787
60787
|
case "FunctionTypeParam": {
|
|
60788
|
-
var name = path2.call(
|
|
60788
|
+
var name = path2.call(print11, "name");
|
|
60789
60789
|
parts.push(name);
|
|
60790
60790
|
if (n.optional) {
|
|
60791
60791
|
parts.push("?");
|
|
@@ -60793,13 +60793,13 @@ var require_printer2 = __commonJS({
|
|
|
60793
60793
|
if (name.infos[0].line) {
|
|
60794
60794
|
parts.push(": ");
|
|
60795
60795
|
}
|
|
60796
|
-
parts.push(path2.call(
|
|
60796
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60797
60797
|
return (0, lines_1.concat)(parts);
|
|
60798
60798
|
}
|
|
60799
60799
|
case "GenericTypeAnnotation":
|
|
60800
60800
|
return (0, lines_1.concat)([
|
|
60801
|
-
path2.call(
|
|
60802
|
-
path2.call(
|
|
60801
|
+
path2.call(print11, "id"),
|
|
60802
|
+
path2.call(print11, "typeParameters")
|
|
60803
60803
|
]);
|
|
60804
60804
|
case "DeclareInterface":
|
|
60805
60805
|
parts.push("declare ");
|
|
@@ -60808,24 +60808,24 @@ var require_printer2 = __commonJS({
|
|
|
60808
60808
|
if (n.declare) {
|
|
60809
60809
|
parts.push("declare ");
|
|
60810
60810
|
}
|
|
60811
|
-
parts.push("interface ", path2.call(
|
|
60811
|
+
parts.push("interface ", path2.call(print11, "id"), path2.call(print11, "typeParameters"), " ");
|
|
60812
60812
|
if (n["extends"] && n["extends"].length > 0) {
|
|
60813
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60813
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")), " ");
|
|
60814
60814
|
}
|
|
60815
60815
|
if (n.body) {
|
|
60816
|
-
parts.push(path2.call(
|
|
60816
|
+
parts.push(path2.call(print11, "body"));
|
|
60817
60817
|
}
|
|
60818
60818
|
return (0, lines_1.concat)(parts);
|
|
60819
60819
|
case "ClassImplements":
|
|
60820
60820
|
case "InterfaceExtends":
|
|
60821
60821
|
return (0, lines_1.concat)([
|
|
60822
|
-
path2.call(
|
|
60823
|
-
path2.call(
|
|
60822
|
+
path2.call(print11, "id"),
|
|
60823
|
+
path2.call(print11, "typeParameters")
|
|
60824
60824
|
]);
|
|
60825
60825
|
case "IntersectionTypeAnnotation":
|
|
60826
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
60826
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print11, "types"));
|
|
60827
60827
|
case "NullableTypeAnnotation":
|
|
60828
|
-
return (0, lines_1.concat)(["?", path2.call(
|
|
60828
|
+
return (0, lines_1.concat)(["?", path2.call(print11, "typeAnnotation")]);
|
|
60829
60829
|
case "NullLiteralTypeAnnotation":
|
|
60830
60830
|
return (0, lines_1.fromString)("null", options);
|
|
60831
60831
|
case "ThisTypeAnnotation":
|
|
@@ -60833,40 +60833,40 @@ var require_printer2 = __commonJS({
|
|
|
60833
60833
|
case "NumberTypeAnnotation":
|
|
60834
60834
|
return (0, lines_1.fromString)("number", options);
|
|
60835
60835
|
case "ObjectTypeCallProperty":
|
|
60836
|
-
return path2.call(
|
|
60836
|
+
return path2.call(print11, "value");
|
|
60837
60837
|
case "ObjectTypeIndexer":
|
|
60838
60838
|
if (n.static) {
|
|
60839
60839
|
parts.push("static ");
|
|
60840
60840
|
}
|
|
60841
|
-
parts.push(printVariance(path2,
|
|
60841
|
+
parts.push(printVariance(path2, print11), "[");
|
|
60842
60842
|
if (n.id) {
|
|
60843
|
-
parts.push(path2.call(
|
|
60843
|
+
parts.push(path2.call(print11, "id"), ": ");
|
|
60844
60844
|
}
|
|
60845
|
-
parts.push(path2.call(
|
|
60845
|
+
parts.push(path2.call(print11, "key"), "]: ", path2.call(print11, "value"));
|
|
60846
60846
|
return (0, lines_1.concat)(parts);
|
|
60847
60847
|
case "ObjectTypeProperty":
|
|
60848
60848
|
return (0, lines_1.concat)([
|
|
60849
|
-
printVariance(path2,
|
|
60850
|
-
path2.call(
|
|
60849
|
+
printVariance(path2, print11),
|
|
60850
|
+
path2.call(print11, "key"),
|
|
60851
60851
|
n.optional ? "?" : "",
|
|
60852
60852
|
": ",
|
|
60853
|
-
path2.call(
|
|
60853
|
+
path2.call(print11, "value")
|
|
60854
60854
|
]);
|
|
60855
60855
|
case "ObjectTypeInternalSlot":
|
|
60856
60856
|
return (0, lines_1.concat)([
|
|
60857
60857
|
n.static ? "static " : "",
|
|
60858
60858
|
"[[",
|
|
60859
|
-
path2.call(
|
|
60859
|
+
path2.call(print11, "id"),
|
|
60860
60860
|
"]]",
|
|
60861
60861
|
n.optional ? "?" : "",
|
|
60862
60862
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
60863
|
-
path2.call(
|
|
60863
|
+
path2.call(print11, "value")
|
|
60864
60864
|
]);
|
|
60865
60865
|
case "QualifiedTypeIdentifier":
|
|
60866
60866
|
return (0, lines_1.concat)([
|
|
60867
|
-
path2.call(
|
|
60867
|
+
path2.call(print11, "qualification"),
|
|
60868
60868
|
".",
|
|
60869
|
-
path2.call(
|
|
60869
|
+
path2.call(print11, "id")
|
|
60870
60870
|
]);
|
|
60871
60871
|
case "StringLiteralTypeAnnotation":
|
|
60872
60872
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -60883,36 +60883,36 @@ var require_printer2 = __commonJS({
|
|
|
60883
60883
|
case "TypeAlias":
|
|
60884
60884
|
return (0, lines_1.concat)([
|
|
60885
60885
|
"type ",
|
|
60886
|
-
path2.call(
|
|
60887
|
-
path2.call(
|
|
60886
|
+
path2.call(print11, "id"),
|
|
60887
|
+
path2.call(print11, "typeParameters"),
|
|
60888
60888
|
" = ",
|
|
60889
|
-
path2.call(
|
|
60889
|
+
path2.call(print11, "right"),
|
|
60890
60890
|
";"
|
|
60891
60891
|
]);
|
|
60892
60892
|
case "DeclareOpaqueType":
|
|
60893
60893
|
parts.push("declare ");
|
|
60894
60894
|
case "OpaqueType":
|
|
60895
|
-
parts.push("opaque type ", path2.call(
|
|
60895
|
+
parts.push("opaque type ", path2.call(print11, "id"), path2.call(print11, "typeParameters"));
|
|
60896
60896
|
if (n["supertype"]) {
|
|
60897
|
-
parts.push(": ", path2.call(
|
|
60897
|
+
parts.push(": ", path2.call(print11, "supertype"));
|
|
60898
60898
|
}
|
|
60899
60899
|
if (n["impltype"]) {
|
|
60900
|
-
parts.push(" = ", path2.call(
|
|
60900
|
+
parts.push(" = ", path2.call(print11, "impltype"));
|
|
60901
60901
|
}
|
|
60902
60902
|
parts.push(";");
|
|
60903
60903
|
return (0, lines_1.concat)(parts);
|
|
60904
60904
|
case "TypeCastExpression":
|
|
60905
60905
|
return (0, lines_1.concat)([
|
|
60906
60906
|
"(",
|
|
60907
|
-
path2.call(
|
|
60908
|
-
path2.call(
|
|
60907
|
+
path2.call(print11, "expression"),
|
|
60908
|
+
path2.call(print11, "typeAnnotation"),
|
|
60909
60909
|
")"
|
|
60910
60910
|
]);
|
|
60911
60911
|
case "TypeParameterDeclaration":
|
|
60912
60912
|
case "TypeParameterInstantiation":
|
|
60913
60913
|
return (0, lines_1.concat)([
|
|
60914
60914
|
"<",
|
|
60915
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
60915
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "params")),
|
|
60916
60916
|
">"
|
|
60917
60917
|
]);
|
|
60918
60918
|
case "Variance":
|
|
@@ -60925,32 +60925,32 @@ var require_printer2 = __commonJS({
|
|
|
60925
60925
|
return (0, lines_1.fromString)("");
|
|
60926
60926
|
case "TypeParameter":
|
|
60927
60927
|
if (n.variance) {
|
|
60928
|
-
parts.push(printVariance(path2,
|
|
60928
|
+
parts.push(printVariance(path2, print11));
|
|
60929
60929
|
}
|
|
60930
|
-
parts.push(path2.call(
|
|
60930
|
+
parts.push(path2.call(print11, "name"));
|
|
60931
60931
|
if (n.bound) {
|
|
60932
|
-
parts.push(path2.call(
|
|
60932
|
+
parts.push(path2.call(print11, "bound"));
|
|
60933
60933
|
}
|
|
60934
60934
|
if (n["default"]) {
|
|
60935
|
-
parts.push("=", path2.call(
|
|
60935
|
+
parts.push("=", path2.call(print11, "default"));
|
|
60936
60936
|
}
|
|
60937
60937
|
return (0, lines_1.concat)(parts);
|
|
60938
60938
|
case "TypeofTypeAnnotation":
|
|
60939
60939
|
return (0, lines_1.concat)([
|
|
60940
60940
|
(0, lines_1.fromString)("typeof ", options),
|
|
60941
|
-
path2.call(
|
|
60941
|
+
path2.call(print11, "argument")
|
|
60942
60942
|
]);
|
|
60943
60943
|
case "IndexedAccessType":
|
|
60944
60944
|
case "OptionalIndexedAccessType":
|
|
60945
60945
|
return (0, lines_1.concat)([
|
|
60946
|
-
path2.call(
|
|
60946
|
+
path2.call(print11, "objectType"),
|
|
60947
60947
|
n.optional ? "?." : "",
|
|
60948
60948
|
"[",
|
|
60949
|
-
path2.call(
|
|
60949
|
+
path2.call(print11, "indexType"),
|
|
60950
60950
|
"]"
|
|
60951
60951
|
]);
|
|
60952
60952
|
case "UnionTypeAnnotation":
|
|
60953
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
60953
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print11, "types"));
|
|
60954
60954
|
case "VoidTypeAnnotation":
|
|
60955
60955
|
return (0, lines_1.fromString)("void", options);
|
|
60956
60956
|
case "NullTypeAnnotation":
|
|
@@ -60990,77 +60990,77 @@ var require_printer2 = __commonJS({
|
|
|
60990
60990
|
case "TSNeverKeyword":
|
|
60991
60991
|
return (0, lines_1.fromString)("never", options);
|
|
60992
60992
|
case "TSArrayType":
|
|
60993
|
-
return (0, lines_1.concat)([path2.call(
|
|
60993
|
+
return (0, lines_1.concat)([path2.call(print11, "elementType"), "[]"]);
|
|
60994
60994
|
case "TSLiteralType":
|
|
60995
|
-
return path2.call(
|
|
60995
|
+
return path2.call(print11, "literal");
|
|
60996
60996
|
case "TSUnionType":
|
|
60997
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
60997
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print11, "types"));
|
|
60998
60998
|
case "TSIntersectionType":
|
|
60999
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
60999
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print11, "types"));
|
|
61000
61000
|
case "TSConditionalType":
|
|
61001
|
-
parts.push(path2.call(
|
|
61001
|
+
parts.push(path2.call(print11, "checkType"), " extends ", path2.call(print11, "extendsType"), " ? ", path2.call(print11, "trueType"), " : ", path2.call(print11, "falseType"));
|
|
61002
61002
|
return (0, lines_1.concat)(parts);
|
|
61003
61003
|
case "TSInferType":
|
|
61004
|
-
parts.push("infer ", path2.call(
|
|
61004
|
+
parts.push("infer ", path2.call(print11, "typeParameter"));
|
|
61005
61005
|
return (0, lines_1.concat)(parts);
|
|
61006
61006
|
case "TSParenthesizedType":
|
|
61007
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
61007
|
+
return (0, lines_1.concat)(["(", path2.call(print11, "typeAnnotation"), ")"]);
|
|
61008
61008
|
case "TSFunctionType":
|
|
61009
61009
|
return (0, lines_1.concat)([
|
|
61010
|
-
path2.call(
|
|
61010
|
+
path2.call(print11, "typeParameters"),
|
|
61011
61011
|
"(",
|
|
61012
|
-
printFunctionParams(path2, options,
|
|
61012
|
+
printFunctionParams(path2, options, print11),
|
|
61013
61013
|
") => ",
|
|
61014
|
-
path2.call(
|
|
61014
|
+
path2.call(print11, "typeAnnotation", "typeAnnotation")
|
|
61015
61015
|
]);
|
|
61016
61016
|
case "TSConstructorType":
|
|
61017
61017
|
return (0, lines_1.concat)([
|
|
61018
61018
|
"new ",
|
|
61019
|
-
path2.call(
|
|
61019
|
+
path2.call(print11, "typeParameters"),
|
|
61020
61020
|
"(",
|
|
61021
|
-
printFunctionParams(path2, options,
|
|
61021
|
+
printFunctionParams(path2, options, print11),
|
|
61022
61022
|
") => ",
|
|
61023
|
-
path2.call(
|
|
61023
|
+
path2.call(print11, "typeAnnotation", "typeAnnotation")
|
|
61024
61024
|
]);
|
|
61025
61025
|
case "TSMappedType": {
|
|
61026
|
-
parts.push(n.readonly ? "readonly " : "", "[", path2.call(
|
|
61026
|
+
parts.push(n.readonly ? "readonly " : "", "[", path2.call(print11, "typeParameter"), "]", n.optional ? "?" : "");
|
|
61027
61027
|
if (n.typeAnnotation) {
|
|
61028
|
-
parts.push(": ", path2.call(
|
|
61028
|
+
parts.push(": ", path2.call(print11, "typeAnnotation"), ";");
|
|
61029
61029
|
}
|
|
61030
61030
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
61031
61031
|
}
|
|
61032
61032
|
case "TSTupleType":
|
|
61033
61033
|
return (0, lines_1.concat)([
|
|
61034
61034
|
"[",
|
|
61035
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
61035
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "elementTypes")),
|
|
61036
61036
|
"]"
|
|
61037
61037
|
]);
|
|
61038
61038
|
case "TSNamedTupleMember":
|
|
61039
|
-
parts.push(path2.call(
|
|
61039
|
+
parts.push(path2.call(print11, "label"));
|
|
61040
61040
|
if (n.optional) {
|
|
61041
61041
|
parts.push("?");
|
|
61042
61042
|
}
|
|
61043
|
-
parts.push(": ", path2.call(
|
|
61043
|
+
parts.push(": ", path2.call(print11, "elementType"));
|
|
61044
61044
|
return (0, lines_1.concat)(parts);
|
|
61045
61045
|
case "TSRestType":
|
|
61046
|
-
return (0, lines_1.concat)(["...", path2.call(
|
|
61046
|
+
return (0, lines_1.concat)(["...", path2.call(print11, "typeAnnotation")]);
|
|
61047
61047
|
case "TSOptionalType":
|
|
61048
|
-
return (0, lines_1.concat)([path2.call(
|
|
61048
|
+
return (0, lines_1.concat)([path2.call(print11, "typeAnnotation"), "?"]);
|
|
61049
61049
|
case "TSIndexedAccessType":
|
|
61050
61050
|
return (0, lines_1.concat)([
|
|
61051
|
-
path2.call(
|
|
61051
|
+
path2.call(print11, "objectType"),
|
|
61052
61052
|
"[",
|
|
61053
|
-
path2.call(
|
|
61053
|
+
path2.call(print11, "indexType"),
|
|
61054
61054
|
"]"
|
|
61055
61055
|
]);
|
|
61056
61056
|
case "TSTypeOperator":
|
|
61057
61057
|
return (0, lines_1.concat)([
|
|
61058
|
-
path2.call(
|
|
61058
|
+
path2.call(print11, "operator"),
|
|
61059
61059
|
" ",
|
|
61060
|
-
path2.call(
|
|
61060
|
+
path2.call(print11, "typeAnnotation")
|
|
61061
61061
|
]);
|
|
61062
61062
|
case "TSTypeLiteral": {
|
|
61063
|
-
var members = (0, lines_1.fromString)("\n").join(path2.map(
|
|
61063
|
+
var members = (0, lines_1.fromString)("\n").join(path2.map(print11, "members").map(function(member) {
|
|
61064
61064
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
61065
61065
|
return member.concat(";");
|
|
61066
61066
|
}
|
|
@@ -61073,13 +61073,13 @@ var require_printer2 = __commonJS({
|
|
|
61073
61073
|
return (0, lines_1.concat)(parts);
|
|
61074
61074
|
}
|
|
61075
61075
|
case "TSEnumMember":
|
|
61076
|
-
parts.push(path2.call(
|
|
61076
|
+
parts.push(path2.call(print11, "id"));
|
|
61077
61077
|
if (n.initializer) {
|
|
61078
|
-
parts.push(" = ", path2.call(
|
|
61078
|
+
parts.push(" = ", path2.call(print11, "initializer"));
|
|
61079
61079
|
}
|
|
61080
61080
|
return (0, lines_1.concat)(parts);
|
|
61081
61081
|
case "TSTypeQuery":
|
|
61082
|
-
return (0, lines_1.concat)(["typeof ", path2.call(
|
|
61082
|
+
return (0, lines_1.concat)(["typeof ", path2.call(print11, "exprName")]);
|
|
61083
61083
|
case "TSParameterProperty":
|
|
61084
61084
|
if (n.accessibility) {
|
|
61085
61085
|
parts.push(n.accessibility, " ");
|
|
@@ -61093,119 +61093,119 @@ var require_printer2 = __commonJS({
|
|
|
61093
61093
|
if (n.readonly) {
|
|
61094
61094
|
parts.push("readonly ");
|
|
61095
61095
|
}
|
|
61096
|
-
parts.push(path2.call(
|
|
61096
|
+
parts.push(path2.call(print11, "parameter"));
|
|
61097
61097
|
return (0, lines_1.concat)(parts);
|
|
61098
61098
|
case "TSTypeReference":
|
|
61099
61099
|
return (0, lines_1.concat)([
|
|
61100
|
-
path2.call(
|
|
61101
|
-
path2.call(
|
|
61100
|
+
path2.call(print11, "typeName"),
|
|
61101
|
+
path2.call(print11, "typeParameters")
|
|
61102
61102
|
]);
|
|
61103
61103
|
case "TSQualifiedName":
|
|
61104
|
-
return (0, lines_1.concat)([path2.call(
|
|
61104
|
+
return (0, lines_1.concat)([path2.call(print11, "left"), ".", path2.call(print11, "right")]);
|
|
61105
61105
|
case "TSAsExpression":
|
|
61106
61106
|
case "TSSatisfiesExpression": {
|
|
61107
|
-
var expression = path2.call(
|
|
61108
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(
|
|
61107
|
+
var expression = path2.call(print11, "expression");
|
|
61108
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print11, "typeAnnotation"));
|
|
61109
61109
|
return (0, lines_1.concat)(parts);
|
|
61110
61110
|
}
|
|
61111
61111
|
case "TSTypeCastExpression":
|
|
61112
61112
|
return (0, lines_1.concat)([
|
|
61113
|
-
path2.call(
|
|
61114
|
-
path2.call(
|
|
61113
|
+
path2.call(print11, "expression"),
|
|
61114
|
+
path2.call(print11, "typeAnnotation")
|
|
61115
61115
|
]);
|
|
61116
61116
|
case "TSNonNullExpression":
|
|
61117
|
-
return (0, lines_1.concat)([path2.call(
|
|
61117
|
+
return (0, lines_1.concat)([path2.call(print11, "expression"), "!"]);
|
|
61118
61118
|
case "TSTypeAnnotation":
|
|
61119
|
-
return (0, lines_1.concat)([": ", path2.call(
|
|
61119
|
+
return (0, lines_1.concat)([": ", path2.call(print11, "typeAnnotation")]);
|
|
61120
61120
|
case "TSIndexSignature":
|
|
61121
61121
|
return (0, lines_1.concat)([
|
|
61122
61122
|
n.readonly ? "readonly " : "",
|
|
61123
61123
|
"[",
|
|
61124
|
-
path2.map(
|
|
61124
|
+
path2.map(print11, "parameters"),
|
|
61125
61125
|
"]",
|
|
61126
|
-
path2.call(
|
|
61126
|
+
path2.call(print11, "typeAnnotation")
|
|
61127
61127
|
]);
|
|
61128
61128
|
case "TSPropertySignature":
|
|
61129
|
-
parts.push(printVariance(path2,
|
|
61129
|
+
parts.push(printVariance(path2, print11), n.readonly ? "readonly " : "");
|
|
61130
61130
|
if (n.computed) {
|
|
61131
|
-
parts.push("[", path2.call(
|
|
61131
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
61132
61132
|
} else {
|
|
61133
|
-
parts.push(path2.call(
|
|
61133
|
+
parts.push(path2.call(print11, "key"));
|
|
61134
61134
|
}
|
|
61135
|
-
parts.push(n.optional ? "?" : "", path2.call(
|
|
61135
|
+
parts.push(n.optional ? "?" : "", path2.call(print11, "typeAnnotation"));
|
|
61136
61136
|
return (0, lines_1.concat)(parts);
|
|
61137
61137
|
case "TSMethodSignature":
|
|
61138
61138
|
if (n.computed) {
|
|
61139
|
-
parts.push("[", path2.call(
|
|
61139
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
61140
61140
|
} else {
|
|
61141
|
-
parts.push(path2.call(
|
|
61141
|
+
parts.push(path2.call(print11, "key"));
|
|
61142
61142
|
}
|
|
61143
61143
|
if (n.optional) {
|
|
61144
61144
|
parts.push("?");
|
|
61145
61145
|
}
|
|
61146
|
-
parts.push(path2.call(
|
|
61146
|
+
parts.push(path2.call(print11, "typeParameters"), "(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "typeAnnotation"));
|
|
61147
61147
|
return (0, lines_1.concat)(parts);
|
|
61148
61148
|
case "TSTypePredicate":
|
|
61149
61149
|
if (n.asserts) {
|
|
61150
61150
|
parts.push("asserts ");
|
|
61151
61151
|
}
|
|
61152
|
-
parts.push(path2.call(
|
|
61152
|
+
parts.push(path2.call(print11, "parameterName"));
|
|
61153
61153
|
if (n.typeAnnotation) {
|
|
61154
|
-
parts.push(" is ", path2.call(
|
|
61154
|
+
parts.push(" is ", path2.call(print11, "typeAnnotation", "typeAnnotation"));
|
|
61155
61155
|
}
|
|
61156
61156
|
return (0, lines_1.concat)(parts);
|
|
61157
61157
|
case "TSCallSignatureDeclaration":
|
|
61158
61158
|
return (0, lines_1.concat)([
|
|
61159
|
-
path2.call(
|
|
61159
|
+
path2.call(print11, "typeParameters"),
|
|
61160
61160
|
"(",
|
|
61161
|
-
printFunctionParams(path2, options,
|
|
61161
|
+
printFunctionParams(path2, options, print11),
|
|
61162
61162
|
")",
|
|
61163
|
-
path2.call(
|
|
61163
|
+
path2.call(print11, "typeAnnotation")
|
|
61164
61164
|
]);
|
|
61165
61165
|
case "TSConstructSignatureDeclaration":
|
|
61166
61166
|
if (n.typeParameters) {
|
|
61167
|
-
parts.push("new", path2.call(
|
|
61167
|
+
parts.push("new", path2.call(print11, "typeParameters"));
|
|
61168
61168
|
} else {
|
|
61169
61169
|
parts.push("new ");
|
|
61170
61170
|
}
|
|
61171
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
61171
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "typeAnnotation"));
|
|
61172
61172
|
return (0, lines_1.concat)(parts);
|
|
61173
61173
|
case "TSTypeAliasDeclaration":
|
|
61174
61174
|
return (0, lines_1.concat)([
|
|
61175
61175
|
n.declare ? "declare " : "",
|
|
61176
61176
|
"type ",
|
|
61177
|
-
path2.call(
|
|
61178
|
-
path2.call(
|
|
61177
|
+
path2.call(print11, "id"),
|
|
61178
|
+
path2.call(print11, "typeParameters"),
|
|
61179
61179
|
" = ",
|
|
61180
|
-
path2.call(
|
|
61180
|
+
path2.call(print11, "typeAnnotation"),
|
|
61181
61181
|
";"
|
|
61182
61182
|
]);
|
|
61183
61183
|
case "TSTypeParameter": {
|
|
61184
|
-
parts.push(path2.call(
|
|
61184
|
+
parts.push(path2.call(print11, "name"));
|
|
61185
61185
|
var parent = path2.getParentNode(0);
|
|
61186
61186
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
61187
61187
|
if (n.constraint) {
|
|
61188
|
-
parts.push(isInMappedType ? " in " : " extends ", path2.call(
|
|
61188
|
+
parts.push(isInMappedType ? " in " : " extends ", path2.call(print11, "constraint"));
|
|
61189
61189
|
}
|
|
61190
61190
|
if (n["default"]) {
|
|
61191
|
-
parts.push(" = ", path2.call(
|
|
61191
|
+
parts.push(" = ", path2.call(print11, "default"));
|
|
61192
61192
|
}
|
|
61193
61193
|
return (0, lines_1.concat)(parts);
|
|
61194
61194
|
}
|
|
61195
61195
|
case "TSTypeAssertion": {
|
|
61196
|
-
parts.push("<", path2.call(
|
|
61196
|
+
parts.push("<", path2.call(print11, "typeAnnotation"), "> ", path2.call(print11, "expression"));
|
|
61197
61197
|
return (0, lines_1.concat)(parts);
|
|
61198
61198
|
}
|
|
61199
61199
|
case "TSTypeParameterDeclaration":
|
|
61200
61200
|
case "TSTypeParameterInstantiation":
|
|
61201
61201
|
return (0, lines_1.concat)([
|
|
61202
61202
|
"<",
|
|
61203
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
61203
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "params")),
|
|
61204
61204
|
">"
|
|
61205
61205
|
]);
|
|
61206
61206
|
case "TSEnumDeclaration": {
|
|
61207
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(
|
|
61208
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(
|
|
61207
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print11, "id"));
|
|
61208
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print11, "members"));
|
|
61209
61209
|
if (memberLines.isEmpty()) {
|
|
61210
61210
|
parts.push(" {}");
|
|
61211
61211
|
} else {
|
|
@@ -61215,11 +61215,11 @@ var require_printer2 = __commonJS({
|
|
|
61215
61215
|
}
|
|
61216
61216
|
case "TSExpressionWithTypeArguments":
|
|
61217
61217
|
return (0, lines_1.concat)([
|
|
61218
|
-
path2.call(
|
|
61219
|
-
path2.call(
|
|
61218
|
+
path2.call(print11, "expression"),
|
|
61219
|
+
path2.call(print11, "typeParameters")
|
|
61220
61220
|
]);
|
|
61221
61221
|
case "TSInterfaceBody": {
|
|
61222
|
-
var lines = (0, lines_1.fromString)("\n").join(path2.map(
|
|
61222
|
+
var lines = (0, lines_1.fromString)("\n").join(path2.map(print11, "body").map(function(element) {
|
|
61223
61223
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
61224
61224
|
return element.concat(";");
|
|
61225
61225
|
}
|
|
@@ -61231,22 +61231,22 @@ var require_printer2 = __commonJS({
|
|
|
61231
61231
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
61232
61232
|
}
|
|
61233
61233
|
case "TSImportType":
|
|
61234
|
-
parts.push("import(", path2.call(
|
|
61234
|
+
parts.push("import(", path2.call(print11, "argument"), ")");
|
|
61235
61235
|
if (n.qualifier) {
|
|
61236
|
-
parts.push(".", path2.call(
|
|
61236
|
+
parts.push(".", path2.call(print11, "qualifier"));
|
|
61237
61237
|
}
|
|
61238
61238
|
if (n.typeParameters) {
|
|
61239
|
-
parts.push(path2.call(
|
|
61239
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
61240
61240
|
}
|
|
61241
61241
|
return (0, lines_1.concat)(parts);
|
|
61242
61242
|
case "TSImportEqualsDeclaration":
|
|
61243
61243
|
if (n.isExport) {
|
|
61244
61244
|
parts.push("export ");
|
|
61245
61245
|
}
|
|
61246
|
-
parts.push("import ", path2.call(
|
|
61246
|
+
parts.push("import ", path2.call(print11, "id"), " = ", path2.call(print11, "moduleReference"));
|
|
61247
61247
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
61248
61248
|
case "TSExternalModuleReference":
|
|
61249
|
-
return (0, lines_1.concat)(["require(", path2.call(
|
|
61249
|
+
return (0, lines_1.concat)(["require(", path2.call(print11, "expression"), ")"]);
|
|
61250
61250
|
case "TSModuleDeclaration": {
|
|
61251
61251
|
var parent = path2.getParentNode();
|
|
61252
61252
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -61271,16 +61271,16 @@ var require_printer2 = __commonJS({
|
|
|
61271
61271
|
}
|
|
61272
61272
|
}
|
|
61273
61273
|
}
|
|
61274
|
-
parts.push(path2.call(
|
|
61274
|
+
parts.push(path2.call(print11, "id"));
|
|
61275
61275
|
if (n.body) {
|
|
61276
61276
|
parts.push(" ");
|
|
61277
|
-
parts.push(path2.call(
|
|
61277
|
+
parts.push(path2.call(print11, "body"));
|
|
61278
61278
|
}
|
|
61279
61279
|
return (0, lines_1.concat)(parts);
|
|
61280
61280
|
}
|
|
61281
61281
|
case "TSModuleBlock": {
|
|
61282
61282
|
var naked = path2.call(function(bodyPath) {
|
|
61283
|
-
return printStatementSequence(bodyPath, options,
|
|
61283
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
61284
61284
|
}, "body");
|
|
61285
61285
|
if (naked.isEmpty()) {
|
|
61286
61286
|
parts.push("{}");
|
|
@@ -61290,11 +61290,11 @@ var require_printer2 = __commonJS({
|
|
|
61290
61290
|
return (0, lines_1.concat)(parts);
|
|
61291
61291
|
}
|
|
61292
61292
|
case "TSInstantiationExpression": {
|
|
61293
|
-
parts.push(path2.call(
|
|
61293
|
+
parts.push(path2.call(print11, "expression"), path2.call(print11, "typeParameters"));
|
|
61294
61294
|
return (0, lines_1.concat)(parts);
|
|
61295
61295
|
}
|
|
61296
61296
|
case "V8IntrinsicIdentifier":
|
|
61297
|
-
return (0, lines_1.concat)(["%", path2.call(
|
|
61297
|
+
return (0, lines_1.concat)(["%", path2.call(print11, "name")]);
|
|
61298
61298
|
case "TopicReference":
|
|
61299
61299
|
return (0, lines_1.fromString)("#");
|
|
61300
61300
|
case "ClassHeritage":
|
|
@@ -61344,7 +61344,7 @@ var require_printer2 = __commonJS({
|
|
|
61344
61344
|
}
|
|
61345
61345
|
return (0, lines_1.concat)(parts);
|
|
61346
61346
|
}
|
|
61347
|
-
function printStatementSequence(path2, options,
|
|
61347
|
+
function printStatementSequence(path2, options, print11) {
|
|
61348
61348
|
var filtered = [];
|
|
61349
61349
|
var sawComment = false;
|
|
61350
61350
|
var sawStatement = false;
|
|
@@ -61365,7 +61365,7 @@ var require_printer2 = __commonJS({
|
|
|
61365
61365
|
}
|
|
61366
61366
|
filtered.push({
|
|
61367
61367
|
node: stmt,
|
|
61368
|
-
printed:
|
|
61368
|
+
printed: print11(stmtPath)
|
|
61369
61369
|
});
|
|
61370
61370
|
});
|
|
61371
61371
|
if (sawComment) {
|
|
@@ -61457,7 +61457,7 @@ var require_printer2 = __commonJS({
|
|
|
61457
61457
|
}
|
|
61458
61458
|
return parts;
|
|
61459
61459
|
}
|
|
61460
|
-
function printMethod(path2, options,
|
|
61460
|
+
function printMethod(path2, options, print11) {
|
|
61461
61461
|
var node = path2.getNode();
|
|
61462
61462
|
var kind = node.kind;
|
|
61463
61463
|
var parts = [];
|
|
@@ -61475,7 +61475,7 @@ var require_printer2 = __commonJS({
|
|
|
61475
61475
|
if (kind === "get" || kind === "set") {
|
|
61476
61476
|
parts.push(kind, " ");
|
|
61477
61477
|
}
|
|
61478
|
-
var key = path2.call(
|
|
61478
|
+
var key = path2.call(print11, "key");
|
|
61479
61479
|
if (node.computed) {
|
|
61480
61480
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
61481
61481
|
}
|
|
@@ -61484,26 +61484,26 @@ var require_printer2 = __commonJS({
|
|
|
61484
61484
|
parts.push("?");
|
|
61485
61485
|
}
|
|
61486
61486
|
if (node === nodeValue) {
|
|
61487
|
-
parts.push(path2.call(
|
|
61487
|
+
parts.push(path2.call(print11, "typeParameters"), "(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
61488
61488
|
if (node.body) {
|
|
61489
|
-
parts.push(" ", path2.call(
|
|
61489
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
61490
61490
|
} else {
|
|
61491
61491
|
parts.push(";");
|
|
61492
61492
|
}
|
|
61493
61493
|
} else {
|
|
61494
|
-
parts.push(path2.call(
|
|
61495
|
-
return printFunctionParams(valuePath, options,
|
|
61496
|
-
}, "value"), ")", path2.call(
|
|
61494
|
+
parts.push(path2.call(print11, "value", "typeParameters"), "(", path2.call(function(valuePath) {
|
|
61495
|
+
return printFunctionParams(valuePath, options, print11);
|
|
61496
|
+
}, "value"), ")", path2.call(print11, "value", "returnType"));
|
|
61497
61497
|
if (nodeValue.body) {
|
|
61498
|
-
parts.push(" ", path2.call(
|
|
61498
|
+
parts.push(" ", path2.call(print11, "value", "body"));
|
|
61499
61499
|
} else {
|
|
61500
61500
|
parts.push(";");
|
|
61501
61501
|
}
|
|
61502
61502
|
}
|
|
61503
61503
|
return (0, lines_1.concat)(parts);
|
|
61504
61504
|
}
|
|
61505
|
-
function printArgumentsList(path2, options,
|
|
61506
|
-
var printed = path2.map(
|
|
61505
|
+
function printArgumentsList(path2, options, print11) {
|
|
61506
|
+
var printed = path2.map(print11, "arguments");
|
|
61507
61507
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
61508
61508
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
61509
61509
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -61516,28 +61516,28 @@ var require_printer2 = __commonJS({
|
|
|
61516
61516
|
}
|
|
61517
61517
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
61518
61518
|
}
|
|
61519
|
-
function printFunctionParams(path2, options,
|
|
61519
|
+
function printFunctionParams(path2, options, print11) {
|
|
61520
61520
|
var fun = path2.getValue();
|
|
61521
61521
|
var params;
|
|
61522
61522
|
var printed = [];
|
|
61523
61523
|
if (fun.params) {
|
|
61524
61524
|
params = fun.params;
|
|
61525
|
-
printed = path2.map(
|
|
61525
|
+
printed = path2.map(print11, "params");
|
|
61526
61526
|
} else if (fun.parameters) {
|
|
61527
61527
|
params = fun.parameters;
|
|
61528
|
-
printed = path2.map(
|
|
61528
|
+
printed = path2.map(print11, "parameters");
|
|
61529
61529
|
}
|
|
61530
61530
|
if (fun.defaults) {
|
|
61531
61531
|
path2.each(function(defExprPath) {
|
|
61532
61532
|
var i2 = defExprPath.getName();
|
|
61533
61533
|
var p = printed[i2];
|
|
61534
61534
|
if (p && defExprPath.getValue()) {
|
|
61535
|
-
printed[i2] = (0, lines_1.concat)([p, " = ",
|
|
61535
|
+
printed[i2] = (0, lines_1.concat)([p, " = ", print11(defExprPath)]);
|
|
61536
61536
|
}
|
|
61537
61537
|
}, "defaults");
|
|
61538
61538
|
}
|
|
61539
61539
|
if (fun.rest) {
|
|
61540
|
-
printed.push((0, lines_1.concat)(["...", path2.call(
|
|
61540
|
+
printed.push((0, lines_1.concat)(["...", path2.call(print11, "rest")]));
|
|
61541
61541
|
}
|
|
61542
61542
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
61543
61543
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -61551,11 +61551,11 @@ var require_printer2 = __commonJS({
|
|
|
61551
61551
|
}
|
|
61552
61552
|
return joined;
|
|
61553
61553
|
}
|
|
61554
|
-
function maybePrintImportAssertions(path2, options,
|
|
61554
|
+
function maybePrintImportAssertions(path2, options, print11) {
|
|
61555
61555
|
var n = path2.getValue();
|
|
61556
61556
|
if (n.assertions && n.assertions.length > 0) {
|
|
61557
61557
|
var parts = [" assert {"];
|
|
61558
|
-
var printed = path2.map(
|
|
61558
|
+
var printed = path2.map(print11, "assertions");
|
|
61559
61559
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
61560
61560
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
61561
61561
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -61566,7 +61566,7 @@ var require_printer2 = __commonJS({
|
|
|
61566
61566
|
}
|
|
61567
61567
|
return (0, lines_1.fromString)("");
|
|
61568
61568
|
}
|
|
61569
|
-
function printExportDeclaration(path2, options,
|
|
61569
|
+
function printExportDeclaration(path2, options, print11) {
|
|
61570
61570
|
var decl = path2.getValue();
|
|
61571
61571
|
var parts = ["export "];
|
|
61572
61572
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -61580,7 +61580,7 @@ var require_printer2 = __commonJS({
|
|
|
61580
61580
|
parts.push("default ");
|
|
61581
61581
|
}
|
|
61582
61582
|
if (decl.declaration) {
|
|
61583
|
-
parts.push(path2.call(
|
|
61583
|
+
parts.push(path2.call(print11, "declaration"));
|
|
61584
61584
|
} else if (decl.specifiers) {
|
|
61585
61585
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
61586
61586
|
parts.push("*");
|
|
@@ -61592,9 +61592,9 @@ var require_printer2 = __commonJS({
|
|
|
61592
61592
|
path2.each(function(specifierPath) {
|
|
61593
61593
|
var spec = specifierPath.getValue();
|
|
61594
61594
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
61595
|
-
unbracedSpecifiers_2.push(
|
|
61595
|
+
unbracedSpecifiers_2.push(print11(specifierPath));
|
|
61596
61596
|
} else {
|
|
61597
|
-
bracedSpecifiers_2.push(
|
|
61597
|
+
bracedSpecifiers_2.push(print11(specifierPath));
|
|
61598
61598
|
}
|
|
61599
61599
|
}, "specifiers");
|
|
61600
61600
|
unbracedSpecifiers_2.forEach(function(lines2, i2) {
|
|
@@ -61623,10 +61623,10 @@ var require_printer2 = __commonJS({
|
|
|
61623
61623
|
}
|
|
61624
61624
|
}
|
|
61625
61625
|
} else {
|
|
61626
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(
|
|
61626
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print11, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
61627
61627
|
}
|
|
61628
61628
|
if (decl.source) {
|
|
61629
|
-
parts.push(" from ", path2.call(
|
|
61629
|
+
parts.push(" from ", path2.call(print11, "source"), maybePrintImportAssertions(path2, options, print11));
|
|
61630
61630
|
}
|
|
61631
61631
|
}
|
|
61632
61632
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -61644,7 +61644,7 @@ var require_printer2 = __commonJS({
|
|
|
61644
61644
|
}
|
|
61645
61645
|
return (0, lines_1.concat)(parts);
|
|
61646
61646
|
}
|
|
61647
|
-
function printVariance(path2,
|
|
61647
|
+
function printVariance(path2, print11) {
|
|
61648
61648
|
return path2.call(function(variancePath) {
|
|
61649
61649
|
var value = variancePath.getValue();
|
|
61650
61650
|
if (value) {
|
|
@@ -61654,7 +61654,7 @@ var require_printer2 = __commonJS({
|
|
|
61654
61654
|
if (value === "minus") {
|
|
61655
61655
|
return (0, lines_1.fromString)("-");
|
|
61656
61656
|
}
|
|
61657
|
-
return
|
|
61657
|
+
return print11(variancePath);
|
|
61658
61658
|
}
|
|
61659
61659
|
return (0, lines_1.fromString)("");
|
|
61660
61660
|
}, "variance");
|
|
@@ -61741,10 +61741,10 @@ var require_main2 = __commonJS({
|
|
|
61741
61741
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
61742
61742
|
return ast_types_1.visit;
|
|
61743
61743
|
} });
|
|
61744
|
-
function
|
|
61744
|
+
function print11(node, options) {
|
|
61745
61745
|
return new printer_1.Printer(options).print(node);
|
|
61746
61746
|
}
|
|
61747
|
-
exports.print =
|
|
61747
|
+
exports.print = print11;
|
|
61748
61748
|
function prettyPrint3(node, options) {
|
|
61749
61749
|
return new printer_1.Printer(options).printGenerically(node);
|
|
61750
61750
|
}
|
|
@@ -61768,7 +61768,7 @@ var require_main2 = __commonJS({
|
|
|
61768
61768
|
function runString(code, transformer, options) {
|
|
61769
61769
|
var writeback = options && options.writeback || defaultWriteback;
|
|
61770
61770
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
61771
|
-
writeback(
|
|
61771
|
+
writeback(print11(node, options).code);
|
|
61772
61772
|
});
|
|
61773
61773
|
}
|
|
61774
61774
|
}
|
|
@@ -67363,7 +67363,7 @@ async function getConfig({
|
|
|
67363
67363
|
}
|
|
67364
67364
|
}
|
|
67365
67365
|
_config.plugins = orderedPlugins(plugins);
|
|
67366
|
-
await Promise.all(_config.plugins.map((plugin2) => plugin2.
|
|
67366
|
+
await Promise.all(_config.plugins.map((plugin2) => plugin2.afterLoad?.({ config: _config })));
|
|
67367
67367
|
resolve2(_config);
|
|
67368
67368
|
return _config;
|
|
67369
67369
|
} catch (e2) {
|
|
@@ -67510,8 +67510,8 @@ function getRootType(type) {
|
|
|
67510
67510
|
function hashDocument({
|
|
67511
67511
|
document
|
|
67512
67512
|
}) {
|
|
67513
|
-
const docString = typeof document === "string" ? document :
|
|
67514
|
-
return crypto.createHash("sha256").update(docString).digest("hex");
|
|
67513
|
+
const docString = typeof document === "string" ? document : document.artifact?.raw;
|
|
67514
|
+
return crypto.createHash("sha256").update(docString ?? "").digest("hex");
|
|
67515
67515
|
}
|
|
67516
67516
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
67517
67517
|
const parents = [...ancestors];
|
|
@@ -68276,7 +68276,7 @@ async function fragmentVariables(config4, documents) {
|
|
|
68276
68276
|
name: "generated::fragmentVariables",
|
|
68277
68277
|
kind: "HoudiniFragment" /* Fragment */,
|
|
68278
68278
|
document: doc,
|
|
68279
|
-
|
|
68279
|
+
originalParsed: doc,
|
|
68280
68280
|
generateStore: false,
|
|
68281
68281
|
generateArtifact: false,
|
|
68282
68282
|
filename: "generated::fragmentVariables",
|
|
@@ -69205,7 +69205,7 @@ async function paginate(config4, documents) {
|
|
|
69205
69205
|
filename: doc.filename,
|
|
69206
69206
|
name: refetchQueryName,
|
|
69207
69207
|
document: queryDoc,
|
|
69208
|
-
|
|
69208
|
+
originalParsed: queryDoc,
|
|
69209
69209
|
generateArtifact: true,
|
|
69210
69210
|
generateStore: false,
|
|
69211
69211
|
refetch: doc.refetch,
|
|
@@ -69625,7 +69625,7 @@ async function addListFragments(config4, documents) {
|
|
|
69625
69625
|
generateArtifact: false,
|
|
69626
69626
|
generateStore: false,
|
|
69627
69627
|
document: generatedDoc,
|
|
69628
|
-
|
|
69628
|
+
originalParsed: generatedDoc,
|
|
69629
69629
|
filename: "generated::lists",
|
|
69630
69630
|
originalString: "",
|
|
69631
69631
|
artifact: null
|
|
@@ -70153,11 +70153,11 @@ function artifactGenerator(stats) {
|
|
|
70153
70153
|
};
|
|
70154
70154
|
const plugin_data = config4.plugins.reduce(
|
|
70155
70155
|
(prev, plugin2) => {
|
|
70156
|
-
if (!plugin2.
|
|
70156
|
+
if (!plugin2.artifactData) {
|
|
70157
70157
|
return prev;
|
|
70158
70158
|
}
|
|
70159
70159
|
const result = { ...prev };
|
|
70160
|
-
const dataToAdd = plugin2.
|
|
70160
|
+
const dataToAdd = plugin2.artifactData({ config: config4, document: doc }) ?? {};
|
|
70161
70161
|
if (Object.keys(dataToAdd).length > 0) {
|
|
70162
70162
|
result[plugin2.name] = dataToAdd;
|
|
70163
70163
|
}
|
|
@@ -70202,10 +70202,10 @@ function artifactGenerator(stats) {
|
|
|
70202
70202
|
}
|
|
70203
70203
|
doc.artifact = artifact;
|
|
70204
70204
|
for (const plugin2 of config4.plugins) {
|
|
70205
|
-
if (!plugin2.
|
|
70205
|
+
if (!plugin2.artifactEnd) {
|
|
70206
70206
|
continue;
|
|
70207
70207
|
}
|
|
70208
|
-
plugin2.
|
|
70208
|
+
plugin2.artifactEnd({ config: config4, document: doc });
|
|
70209
70209
|
}
|
|
70210
70210
|
const file = AST5.program([
|
|
70211
70211
|
moduleExport(config4, "default", serializeValue(artifact)),
|
|
@@ -70245,18 +70245,18 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
70245
70245
|
const indexPath = path_exports.join(config4.runtimeDirectory, "index.d.ts");
|
|
70246
70246
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
70247
70247
|
const contents = await parseJS(fileContent);
|
|
70248
|
-
const
|
|
70249
|
-
(plugin2) => plugin2.
|
|
70250
|
-
)?.
|
|
70251
|
-
if (!
|
|
70248
|
+
const graphqlTagReturn = config4.plugins.find(
|
|
70249
|
+
(plugin2) => plugin2.graphqlTagReturn
|
|
70250
|
+
)?.graphqlTagReturn;
|
|
70251
|
+
if (!graphqlTagReturn || !contents) {
|
|
70252
70252
|
return fileContent;
|
|
70253
70253
|
}
|
|
70254
70254
|
const overloaded_returns = {};
|
|
70255
70255
|
for (const doc of docs) {
|
|
70256
|
-
const return_value =
|
|
70256
|
+
const return_value = graphqlTagReturn({
|
|
70257
70257
|
config: config4,
|
|
70258
70258
|
document: doc,
|
|
70259
|
-
|
|
70259
|
+
ensureImport({ identifier, module }) {
|
|
70260
70260
|
ensureImports({
|
|
70261
70261
|
config: config4,
|
|
70262
70262
|
body: contents.script.body,
|
|
@@ -70304,18 +70304,18 @@ async function injectPlugins({
|
|
|
70304
70304
|
importStatement,
|
|
70305
70305
|
exportStatement
|
|
70306
70306
|
}) {
|
|
70307
|
-
const
|
|
70308
|
-
let plugins = plugin2.
|
|
70307
|
+
const clientPlugins = config4.plugins.filter((plugin2) => plugin2.clientPlugins).reduce((acc, plugin2) => {
|
|
70308
|
+
let plugins = plugin2.clientPlugins;
|
|
70309
70309
|
if (typeof plugins === "function") {
|
|
70310
70310
|
plugins = plugins(config4, config4.pluginConfig(plugin2.name));
|
|
70311
70311
|
}
|
|
70312
70312
|
return [...acc, ...Object.entries(plugins)];
|
|
70313
70313
|
}, []);
|
|
70314
|
-
return
|
|
70315
|
-
${
|
|
70314
|
+
return clientPlugins.length > 0 ? `
|
|
70315
|
+
${clientPlugins.map((plugin2, i2) => importStatement(plugin2[0], `plugin${i2}`))}
|
|
70316
70316
|
|
|
70317
70317
|
const plugins = [
|
|
70318
|
-
${
|
|
70318
|
+
${clientPlugins.map((plugin2, i2) => {
|
|
70319
70319
|
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
70320
70320
|
return `plugin${i2}${suffix}`;
|
|
70321
70321
|
}).join(",\n")}
|
|
@@ -70359,18 +70359,18 @@ ${exportStatement("config")}
|
|
|
70359
70359
|
},
|
|
70360
70360
|
[path_exports.join(config4.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config4, content, importStatement, exportStatement })
|
|
70361
70361
|
}),
|
|
70362
|
-
...config4.plugins.filter((plugin2) => plugin2.
|
|
70362
|
+
...config4.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config4, plugin2)),
|
|
70363
70363
|
generatePluginIndex({ config: config4, exportStatement: exportStar })
|
|
70364
70364
|
]);
|
|
70365
70365
|
await generateGraphqlReturnTypes(config4, docs);
|
|
70366
70366
|
}
|
|
70367
70367
|
async function generatePluginRuntime(config4, plugin2) {
|
|
70368
|
-
if (houdini_mode.is_testing || !plugin2.
|
|
70368
|
+
if (houdini_mode.is_testing || !plugin2.includeRuntime) {
|
|
70369
70369
|
return;
|
|
70370
70370
|
}
|
|
70371
70371
|
const runtime_path = path_exports.join(
|
|
70372
70372
|
path_exports.dirname(plugin2.filepath),
|
|
70373
|
-
typeof plugin2.
|
|
70373
|
+
typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime[config4.module]
|
|
70374
70374
|
);
|
|
70375
70375
|
try {
|
|
70376
70376
|
await fs_exports.stat(runtime_path);
|
|
@@ -70386,7 +70386,7 @@ async function generatePluginRuntime(config4, plugin2) {
|
|
|
70386
70386
|
runtime_path,
|
|
70387
70387
|
pluginDir,
|
|
70388
70388
|
Object.fromEntries(
|
|
70389
|
-
Object.entries(plugin2.
|
|
70389
|
+
Object.entries(plugin2.transformRuntime ?? {}).map(([key, value]) => [
|
|
70390
70390
|
path_exports.join(runtime_path, key),
|
|
70391
70391
|
(content) => value({ config: config4, content })
|
|
70392
70392
|
])
|
|
@@ -70780,7 +70780,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70780
70780
|
const typePaths = [];
|
|
70781
70781
|
const fragmentDefinitions = {};
|
|
70782
70782
|
for (const document of docs) {
|
|
70783
|
-
for (const defn of document.
|
|
70783
|
+
for (const defn of document.originalParsed.definitions.filter(
|
|
70784
70784
|
({ kind }) => kind === "FragmentDefinition"
|
|
70785
70785
|
)) {
|
|
70786
70786
|
fragmentDefinitions[defn.name.value] = defn;
|
|
@@ -70788,47 +70788,54 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70788
70788
|
}
|
|
70789
70789
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
70790
70790
|
await Promise.all(
|
|
70791
|
-
docs.map(
|
|
70792
|
-
|
|
70793
|
-
|
|
70794
|
-
|
|
70795
|
-
|
|
70796
|
-
|
|
70797
|
-
|
|
70798
|
-
|
|
70799
|
-
|
|
70800
|
-
|
|
70801
|
-
|
|
70802
|
-
|
|
70803
|
-
|
|
70804
|
-
|
|
70805
|
-
|
|
70806
|
-
applyFragments: definition.kind === "OperationDefinition"
|
|
70807
|
-
});
|
|
70808
|
-
if (definition?.kind === "OperationDefinition") {
|
|
70809
|
-
await generateOperationTypeDefs(
|
|
70810
|
-
config4,
|
|
70811
|
-
filename,
|
|
70812
|
-
program.body,
|
|
70813
|
-
definition,
|
|
70814
|
-
selections,
|
|
70815
|
-
visitedTypes,
|
|
70816
|
-
missingScalars
|
|
70817
|
-
);
|
|
70818
|
-
} else {
|
|
70819
|
-
await generateFragmentTypeDefs(
|
|
70820
|
-
config4,
|
|
70821
|
-
filename,
|
|
70822
|
-
program.body,
|
|
70823
|
-
selections,
|
|
70824
|
-
originalDocument.definitions,
|
|
70825
|
-
visitedTypes,
|
|
70826
|
-
missingScalars
|
|
70791
|
+
docs.map(
|
|
70792
|
+
async ({
|
|
70793
|
+
originalParsed: originalDocument,
|
|
70794
|
+
name,
|
|
70795
|
+
filename,
|
|
70796
|
+
generateArtifact
|
|
70797
|
+
}) => {
|
|
70798
|
+
if (!generateArtifact) {
|
|
70799
|
+
return;
|
|
70800
|
+
}
|
|
70801
|
+
const typeDefPath = config4.artifactTypePath(originalDocument);
|
|
70802
|
+
const program = AST11.program([]);
|
|
70803
|
+
const visitedTypes = /* @__PURE__ */ new Set();
|
|
70804
|
+
let definition = originalDocument.definitions.find(
|
|
70805
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
70827
70806
|
);
|
|
70807
|
+
const selections = flattenSelections({
|
|
70808
|
+
config: config4,
|
|
70809
|
+
filepath: filename,
|
|
70810
|
+
selections: definition.selectionSet.selections,
|
|
70811
|
+
fragmentDefinitions,
|
|
70812
|
+
applyFragments: definition.kind === "OperationDefinition"
|
|
70813
|
+
});
|
|
70814
|
+
if (definition?.kind === "OperationDefinition") {
|
|
70815
|
+
await generateOperationTypeDefs(
|
|
70816
|
+
config4,
|
|
70817
|
+
filename,
|
|
70818
|
+
program.body,
|
|
70819
|
+
definition,
|
|
70820
|
+
selections,
|
|
70821
|
+
visitedTypes,
|
|
70822
|
+
missingScalars
|
|
70823
|
+
);
|
|
70824
|
+
} else {
|
|
70825
|
+
await generateFragmentTypeDefs(
|
|
70826
|
+
config4,
|
|
70827
|
+
filename,
|
|
70828
|
+
program.body,
|
|
70829
|
+
selections,
|
|
70830
|
+
originalDocument.definitions,
|
|
70831
|
+
visitedTypes,
|
|
70832
|
+
missingScalars
|
|
70833
|
+
);
|
|
70834
|
+
}
|
|
70835
|
+
await fs_exports.writeFile(typeDefPath, recast11.print(program).code);
|
|
70836
|
+
typePaths.push(typeDefPath);
|
|
70828
70837
|
}
|
|
70829
|
-
|
|
70830
|
-
typePaths.push(typeDefPath);
|
|
70831
|
-
})
|
|
70838
|
+
)
|
|
70832
70839
|
);
|
|
70833
70840
|
const typeIndex = AST11.program(
|
|
70834
70841
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
@@ -70843,28 +70850,28 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70843
70850
|
AST11.exportAllDeclaration(AST11.literal("./graphql"), null)
|
|
70844
70851
|
])
|
|
70845
70852
|
);
|
|
70846
|
-
const
|
|
70853
|
+
const exportDefaultAs = ({ module, as }) => `
|
|
70847
70854
|
export { default as ${as} } from "${module}"
|
|
70848
70855
|
`;
|
|
70849
|
-
const
|
|
70856
|
+
const exportStarFrom2 = ({ module }) => `
|
|
70850
70857
|
export * from "${module}"
|
|
70851
70858
|
`;
|
|
70852
70859
|
let indexContent = recast11.print(typeIndex).code;
|
|
70853
70860
|
for (const plugin2 of config4.plugins) {
|
|
70854
|
-
if (!plugin2.
|
|
70861
|
+
if (!plugin2.indexFile) {
|
|
70855
70862
|
continue;
|
|
70856
70863
|
}
|
|
70857
|
-
indexContent = plugin2.
|
|
70864
|
+
indexContent = plugin2.indexFile({
|
|
70858
70865
|
config: config4,
|
|
70859
70866
|
content: indexContent,
|
|
70860
|
-
|
|
70861
|
-
|
|
70862
|
-
|
|
70867
|
+
exportDefaultAs,
|
|
70868
|
+
exportStarFrom: exportStarFrom2,
|
|
70869
|
+
pluginRoot: config4.pluginDirectory(plugin2.name),
|
|
70863
70870
|
typedef: true,
|
|
70864
70871
|
documents: docs
|
|
70865
70872
|
});
|
|
70866
|
-
if (plugin2.
|
|
70867
|
-
indexContent +=
|
|
70873
|
+
if (plugin2.includeRuntime) {
|
|
70874
|
+
indexContent += exportStarFrom2({
|
|
70868
70875
|
module: "./" + path_exports.relative(config4.rootDir, config4.pluginRuntimeDirectory(plugin2.name))
|
|
70869
70876
|
});
|
|
70870
70877
|
}
|
|
@@ -71111,10 +71118,10 @@ var graphql19 = __toESM(require_graphql2(), 1);
|
|
|
71111
71118
|
var recast12 = __toESM(require_main2(), 1);
|
|
71112
71119
|
var AST12 = recast12.types.builders;
|
|
71113
71120
|
async function imperativeCacheTypef(config4, docs) {
|
|
71114
|
-
const returnType = (doc) => config4.plugins.find((plugin2) => plugin2.
|
|
71121
|
+
const returnType = (doc) => config4.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
71115
71122
|
config: config4,
|
|
71116
71123
|
document: doc,
|
|
71117
|
-
|
|
71124
|
+
ensureImport({ identifier, module }) {
|
|
71118
71125
|
ensureImports({
|
|
71119
71126
|
config: config4,
|
|
71120
71127
|
body,
|
|
@@ -71485,27 +71492,30 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
71485
71492
|
console.log("Can only write the queryMap to a json file");
|
|
71486
71493
|
return;
|
|
71487
71494
|
}
|
|
71488
|
-
const queryMap = docs.reduce(
|
|
71489
|
-
|
|
71490
|
-
|
|
71491
|
-
|
|
71492
|
-
|
|
71493
|
-
graphql20.
|
|
71494
|
-
|
|
71495
|
-
|
|
71496
|
-
|
|
71495
|
+
const queryMap = docs.reduce(
|
|
71496
|
+
(acc, { document, generateArtifact }) => {
|
|
71497
|
+
if (!generateArtifact) {
|
|
71498
|
+
return acc;
|
|
71499
|
+
}
|
|
71500
|
+
let rawString = graphql20.print(
|
|
71501
|
+
graphql20.visit(document, {
|
|
71502
|
+
Directive(node) {
|
|
71503
|
+
if (config4.isInternalDirective(node.name.value)) {
|
|
71504
|
+
return null;
|
|
71505
|
+
}
|
|
71497
71506
|
}
|
|
71498
|
-
}
|
|
71499
|
-
|
|
71500
|
-
|
|
71501
|
-
|
|
71502
|
-
|
|
71503
|
-
|
|
71504
|
-
|
|
71505
|
-
|
|
71506
|
-
|
|
71507
|
-
|
|
71508
|
-
|
|
71507
|
+
})
|
|
71508
|
+
);
|
|
71509
|
+
const operations = document.definitions.filter(
|
|
71510
|
+
({ kind }) => kind === graphql20.Kind.OPERATION_DEFINITION
|
|
71511
|
+
);
|
|
71512
|
+
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
71513
|
+
acc[hashDocument({ config: config4, document: rawString })] = rawString;
|
|
71514
|
+
}
|
|
71515
|
+
return acc;
|
|
71516
|
+
},
|
|
71517
|
+
{}
|
|
71518
|
+
);
|
|
71509
71519
|
if (Object.keys(queryMap).length === 0)
|
|
71510
71520
|
return;
|
|
71511
71521
|
await fs_exports.writeFile(config4.persistedQueryPath, JSON.stringify(queryMap, null, 4));
|
|
@@ -71574,32 +71584,32 @@ async function writeIndexFile2(config4, docs) {
|
|
|
71574
71584
|
const definitionsDir = relative2(config4.definitionsDirectory);
|
|
71575
71585
|
const cjs = config4.module === "commonjs";
|
|
71576
71586
|
let body = cjs ? cjsIndexFilePreamble : "";
|
|
71577
|
-
const
|
|
71578
|
-
const
|
|
71587
|
+
const exportStar = ({ module }) => "\n" + (cjs ? exportStarFrom(module) : `export * from "${module}"`) + "\n";
|
|
71588
|
+
const exportDefaultAs = ({ module, as }) => "\n" + (cjs ? exportDefaultFrom(module, as) : `export { default as ${as} } from "${module}"`) + "\n";
|
|
71579
71589
|
body += [
|
|
71580
|
-
|
|
71581
|
-
|
|
71582
|
-
|
|
71583
|
-
|
|
71590
|
+
exportStar({ module: "./" + path_exports.join(runtimeDir, "client") }),
|
|
71591
|
+
exportStar({ module: runtimeDir }),
|
|
71592
|
+
exportStar({ module: artifactDir }),
|
|
71593
|
+
exportStar({ module: definitionsDir })
|
|
71584
71594
|
].join("");
|
|
71585
71595
|
for (const plugin2 of config4.plugins) {
|
|
71586
|
-
if (plugin2.
|
|
71587
|
-
body = plugin2.
|
|
71596
|
+
if (plugin2.indexFile) {
|
|
71597
|
+
body = plugin2.indexFile({
|
|
71588
71598
|
config: config4,
|
|
71589
71599
|
content: body,
|
|
71590
|
-
|
|
71591
|
-
|
|
71592
|
-
|
|
71600
|
+
exportDefaultAs,
|
|
71601
|
+
exportStarFrom: exportStar,
|
|
71602
|
+
pluginRoot: config4.pluginDirectory(plugin2.name),
|
|
71593
71603
|
typedef: false,
|
|
71594
71604
|
documents: docs
|
|
71595
71605
|
});
|
|
71596
71606
|
}
|
|
71597
|
-
if (plugin2.
|
|
71598
|
-
body +=
|
|
71607
|
+
if (plugin2.includeRuntime) {
|
|
71608
|
+
body += exportStar({
|
|
71599
71609
|
module: relative2(config4.pluginRuntimeDirectory(plugin2.name))
|
|
71600
71610
|
});
|
|
71601
71611
|
}
|
|
71602
|
-
if (!plugin2.
|
|
71612
|
+
if (!plugin2.indexFile) {
|
|
71603
71613
|
continue;
|
|
71604
71614
|
}
|
|
71605
71615
|
}
|
|
@@ -72647,10 +72657,10 @@ async function runPipeline2(config4, docs) {
|
|
|
72647
72657
|
deleted: []
|
|
72648
72658
|
};
|
|
72649
72659
|
const generatePlugins = config4.plugins.filter((plugin2) => plugin2.generate);
|
|
72650
|
-
const
|
|
72660
|
+
const afterValidate = config4.plugins.filter((plugin2) => plugin2.afterValidate).map((plugin2) => plugin2.afterValidate);
|
|
72651
72661
|
const validate2 = config4.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
72652
|
-
const
|
|
72653
|
-
const
|
|
72662
|
+
const beforeValidate = config4.plugins.filter((plugin2) => plugin2.beforeValidate).map((plugin2) => plugin2.beforeValidate);
|
|
72663
|
+
const beforeGenerate = config4.plugins.filter((plugin2) => plugin2.beforeGenerate).map((plugin2) => plugin2.beforeGenerate);
|
|
72654
72664
|
const wrapHook = (hooks) => hooks.map(
|
|
72655
72665
|
(fn) => (config5, docs2) => fn({
|
|
72656
72666
|
config: config5,
|
|
@@ -72663,20 +72673,20 @@ async function runPipeline2(config4, docs) {
|
|
|
72663
72673
|
config4,
|
|
72664
72674
|
[
|
|
72665
72675
|
graphqlExtensions,
|
|
72666
|
-
...wrapHook(
|
|
72676
|
+
...wrapHook(beforeValidate),
|
|
72667
72677
|
typeCheck,
|
|
72668
72678
|
uniqueDocumentNames,
|
|
72669
72679
|
noIDAlias,
|
|
72670
72680
|
validatePlugins,
|
|
72671
72681
|
...wrapHook(validate2),
|
|
72672
|
-
...wrapHook(
|
|
72682
|
+
...wrapHook(afterValidate),
|
|
72673
72683
|
addID,
|
|
72674
72684
|
addTypename,
|
|
72675
72685
|
addListFragments,
|
|
72676
72686
|
paginate,
|
|
72677
72687
|
fragmentVariables,
|
|
72678
72688
|
includeFragmentDefinitions,
|
|
72679
|
-
...wrapHook(
|
|
72689
|
+
...wrapHook(beforeGenerate),
|
|
72680
72690
|
artifactGenerator(artifactStats),
|
|
72681
72691
|
runtimeGenerator,
|
|
72682
72692
|
writeIndexFile2,
|
|
@@ -72687,14 +72697,13 @@ async function runPipeline2(config4, docs) {
|
|
|
72687
72697
|
(plugin2) => async (config5, docs2) => await plugin2.generate({
|
|
72688
72698
|
config: config5,
|
|
72689
72699
|
documents: docs2,
|
|
72690
|
-
|
|
72700
|
+
pluginRoot: config5.pluginDirectory(plugin2.name)
|
|
72691
72701
|
})
|
|
72692
72702
|
)
|
|
72693
72703
|
],
|
|
72694
72704
|
docs
|
|
72695
72705
|
);
|
|
72696
72706
|
} catch (e2) {
|
|
72697
|
-
console.log(e2);
|
|
72698
72707
|
error = e2;
|
|
72699
72708
|
}
|
|
72700
72709
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -72744,9 +72753,9 @@ async function collectDocuments(config4) {
|
|
|
72744
72753
|
".ts": []
|
|
72745
72754
|
};
|
|
72746
72755
|
for (const plugin2 of config4.plugins) {
|
|
72747
|
-
if (plugin2.extensions && plugin2.
|
|
72756
|
+
if (plugin2.extensions && plugin2.extractDocuments) {
|
|
72748
72757
|
for (const extension of plugin2.extensions) {
|
|
72749
|
-
extractors[extension] = [...extractors[extension] || [], plugin2.
|
|
72758
|
+
extractors[extension] = [...extractors[extension] || [], plugin2.extractDocuments];
|
|
72750
72759
|
}
|
|
72751
72760
|
}
|
|
72752
72761
|
}
|
|
@@ -72845,7 +72854,7 @@ async function processGraphQLDocument(config4, filepath, document) {
|
|
|
72845
72854
|
kind,
|
|
72846
72855
|
document: parsedDoc,
|
|
72847
72856
|
filename: filepath,
|
|
72848
|
-
|
|
72857
|
+
originalParsed: parsedDoc,
|
|
72849
72858
|
generateArtifact: true,
|
|
72850
72859
|
generateStore: true,
|
|
72851
72860
|
originalString: document,
|
|
@@ -72933,10 +72942,10 @@ function Plugin(opts = {}) {
|
|
|
72933
72942
|
filepath
|
|
72934
72943
|
};
|
|
72935
72944
|
for (const plugin2 of config3.plugins) {
|
|
72936
|
-
if (!plugin2.
|
|
72945
|
+
if (!plugin2.transformFile) {
|
|
72937
72946
|
continue;
|
|
72938
72947
|
}
|
|
72939
|
-
const { code: code2 } = await plugin2.
|
|
72948
|
+
const { code: code2 } = await plugin2.transformFile(ctx);
|
|
72940
72949
|
ctx.content = code2;
|
|
72941
72950
|
}
|
|
72942
72951
|
return { code: ctx.content };
|