@openrewrite/rewrite 0.28.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/src/java/remote/receiver.d.ts.map +1 -1
  2. package/dist/src/java/remote/receiver.js +13 -2
  3. package/dist/src/java/remote/receiver.js.map +1 -1
  4. package/dist/src/java/remote/sender.d.ts.map +1 -1
  5. package/dist/src/java/remote/sender.js +9 -1
  6. package/dist/src/java/remote/sender.js.map +1 -1
  7. package/dist/src/java/tree/support_types.d.ts +1 -1
  8. package/dist/src/java/tree/support_types.d.ts.map +1 -1
  9. package/dist/src/java/tree/support_types.js +1 -1
  10. package/dist/src/java/tree/support_types.js.map +1 -1
  11. package/dist/src/java/tree/tree.d.ts +48 -6
  12. package/dist/src/java/tree/tree.d.ts.map +1 -1
  13. package/dist/src/java/tree/tree.js +71 -18
  14. package/dist/src/java/tree/tree.js.map +1 -1
  15. package/dist/src/java/visitor.d.ts +2 -1
  16. package/dist/src/java/visitor.d.ts.map +1 -1
  17. package/dist/src/java/visitor.js +17 -1
  18. package/dist/src/java/visitor.js.map +1 -1
  19. package/dist/src/javascript/parser.d.ts +1 -1
  20. package/dist/src/javascript/parser.d.ts.map +1 -1
  21. package/dist/src/javascript/parser.js +18 -8
  22. package/dist/src/javascript/parser.js.map +1 -1
  23. package/dist/src/javascript/remote/receiver.d.ts.map +1 -1
  24. package/dist/src/javascript/remote/receiver.js +29 -5
  25. package/dist/src/javascript/remote/receiver.js.map +1 -1
  26. package/dist/src/javascript/remote/sender.d.ts.map +1 -1
  27. package/dist/src/javascript/remote/sender.js +20 -2
  28. package/dist/src/javascript/remote/sender.js.map +1 -1
  29. package/dist/src/javascript/tree/support_types.d.ts +8 -3
  30. package/dist/src/javascript/tree/support_types.d.ts.map +1 -1
  31. package/dist/src/javascript/tree/support_types.js +5 -0
  32. package/dist/src/javascript/tree/support_types.js.map +1 -1
  33. package/dist/src/javascript/tree/tree.d.ts +61 -5
  34. package/dist/src/javascript/tree/tree.d.ts.map +1 -1
  35. package/dist/src/javascript/tree/tree.js +108 -24
  36. package/dist/src/javascript/tree/tree.js.map +1 -1
  37. package/dist/src/javascript/visitor.d.ts +2 -1
  38. package/dist/src/javascript/visitor.d.ts.map +1 -1
  39. package/dist/src/javascript/visitor.js +10 -1
  40. package/dist/src/javascript/visitor.js.map +1 -1
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../../../../src/javascript/remote/receiver.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,IAAI,EAAC,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAkB,QAAQ,EAAE,eAAe,EAA6B,MAAM,6BAA6B,CAAC;AAEnH,OAAO,EAAC,EAAE,EAA2gC,MAAM,SAAS,CAAC;AAIriC,qBAAa,kBAAmB,YAAW,QAAQ,CAAC,EAAE,CAAC;IAC5C,IAAI,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe;IAI3C,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI;CAIhE"}
1
+ {"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../../../../src/javascript/remote/receiver.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,IAAI,EAAC,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAkB,QAAQ,EAAE,eAAe,EAA6B,MAAM,6BAA6B,CAAC;AAEnH,OAAO,EAAC,EAAE,EAAiiC,MAAM,SAAS,CAAC;AAI3jC,qBAAa,kBAAmB,YAAW,QAAQ,CAAC,EAAE,CAAC;IAC5C,IAAI,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe;IAI3C,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI;CAIhE"}
@@ -185,7 +185,7 @@ class Visitor extends __1.JavaScriptVisitor {
185
185
  importType = importType.withPrefix(ctx.receiveNode(importType.prefix, receiveSpace));
186
186
  importType = importType.withMarkers(ctx.receiveNode(importType.markers, ctx.receiveMarkers));
187
187
  importType = importType.padding.withHasTypeof(ctx.receiveNode(importType.padding.hasTypeof, rightPaddedValueReceiver(1)));
188
- importType = importType.withImportArgument(ctx.receiveNode(importType.importArgument, ctx.receiveTree));
188
+ importType = importType.padding.withArgumentAndAttributes(ctx.receiveNode(importType.padding.argumentAndAttributes, receiveContainer));
189
189
  importType = importType.padding.withQualifier(ctx.receiveNode(importType.padding.qualifier, receiveLeftPaddedTree));
190
190
  importType = importType.padding.withTypeArguments(ctx.receiveNode(importType.padding.typeArguments, receiveContainer));
191
191
  importType = importType.withType(ctx.receiveValue(importType.type, 5));
@@ -235,6 +235,15 @@ class Visitor extends __1.JavaScriptVisitor {
235
235
  importAttributes = importAttributes.padding.withElements(ctx.receiveNode(importAttributes.padding.elements, receiveContainer));
236
236
  return importAttributes;
237
237
  }
238
+ visitImportTypeAttributes(importTypeAttributes, ctx) {
239
+ importTypeAttributes = importTypeAttributes.withId(ctx.receiveValue(importTypeAttributes.id, 0));
240
+ importTypeAttributes = importTypeAttributes.withPrefix(ctx.receiveNode(importTypeAttributes.prefix, receiveSpace));
241
+ importTypeAttributes = importTypeAttributes.withMarkers(ctx.receiveNode(importTypeAttributes.markers, ctx.receiveMarkers));
242
+ importTypeAttributes = importTypeAttributes.padding.withToken(ctx.receiveNode(importTypeAttributes.padding.token, receiveRightPaddedTree));
243
+ importTypeAttributes = importTypeAttributes.padding.withElements(ctx.receiveNode(importTypeAttributes.padding.elements, receiveContainer));
244
+ importTypeAttributes = importTypeAttributes.withEnd(ctx.receiveNode(importTypeAttributes.end, receiveSpace));
245
+ return importTypeAttributes;
246
+ }
238
247
  visitImportAttribute(importAttribute, ctx) {
239
248
  importAttribute = importAttribute.withId(ctx.receiveValue(importAttribute.id, 0));
240
249
  importAttribute = importAttribute.withPrefix(ctx.receiveNode(importAttribute.prefix, receiveSpace));
@@ -617,6 +626,7 @@ class Visitor extends __1.JavaScriptVisitor {
617
626
  exportDeclaration = exportDeclaration.padding.withTypeOnly(ctx.receiveNode(exportDeclaration.padding.typeOnly, leftPaddedValueReceiver(1)));
618
627
  exportDeclaration = exportDeclaration.withExportClause(ctx.receiveNode(exportDeclaration.exportClause, ctx.receiveTree));
619
628
  exportDeclaration = exportDeclaration.padding.withModuleSpecifier(ctx.receiveNode(exportDeclaration.padding.moduleSpecifier, receiveLeftPaddedTree));
629
+ exportDeclaration = exportDeclaration.withAttributes(ctx.receiveNode(exportDeclaration.attributes, ctx.receiveTree));
620
630
  return exportDeclaration;
621
631
  }
622
632
  visitExportAssignment(exportAssignment, ctx) {
@@ -772,9 +782,10 @@ class Visitor extends __1.JavaScriptVisitor {
772
782
  _case = _case.withPrefix(ctx.receiveNode(_case.prefix, receiveSpace));
773
783
  _case = _case.withMarkers(ctx.receiveNode(_case.markers, ctx.receiveMarkers));
774
784
  _case = _case.withType(ctx.receiveValue(_case.type, 3));
775
- _case = _case.padding.withExpressions(ctx.receiveNode(_case.padding.expressions, receiveContainer));
785
+ _case = _case.padding.withCaseLabels(ctx.receiveNode(_case.padding.caseLabels, receiveContainer));
776
786
  _case = _case.padding.withStatements(ctx.receiveNode(_case.padding.statements, receiveContainer));
777
787
  _case = _case.padding.withBody(ctx.receiveNode(_case.padding.body, receiveRightPaddedTree));
788
+ _case = _case.withGuard(ctx.receiveNode(_case.guard, ctx.receiveTree));
778
789
  return _case;
779
790
  }
780
791
  visitClassDeclaration(classDeclaration, ctx) {
@@ -1277,6 +1288,13 @@ class Visitor extends __1.JavaScriptVisitor {
1277
1288
  source = source.withText(ctx.receiveValue(source.text, 1));
1278
1289
  return source;
1279
1290
  }
1291
+ visitErroneous(erroneous, ctx) {
1292
+ erroneous = erroneous.withId(ctx.receiveValue(erroneous.id, 0));
1293
+ erroneous = erroneous.withPrefix(ctx.receiveNode(erroneous.prefix, receiveSpace));
1294
+ erroneous = erroneous.withMarkers(ctx.receiveNode(erroneous.markers, ctx.receiveMarkers));
1295
+ erroneous = erroneous.withText(ctx.receiveValue(erroneous.text, 1));
1296
+ return erroneous;
1297
+ }
1280
1298
  }
1281
1299
  class Factory {
1282
1300
  create(type, ctx) {
@@ -1320,7 +1338,7 @@ class Factory {
1320
1338
  return new tree_1.InferType(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveValue(null, 5));
1321
1339
  }
1322
1340
  if (type === "org.openrewrite.javascript.tree.JS$ImportType") {
1323
- return new tree_1.ImportType(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, rightPaddedValueReceiver(1)), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveNode(null, receiveContainer), ctx.receiveValue(null, 5));
1341
+ return new tree_1.ImportType(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, rightPaddedValueReceiver(1)), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveNode(null, receiveContainer), ctx.receiveValue(null, 5));
1324
1342
  }
1325
1343
  if (type === "org.openrewrite.javascript.tree.JS$JsImport") {
1326
1344
  return new tree_1.JsImport(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveNode(null, ctx.receiveTree));
@@ -1337,6 +1355,9 @@ class Factory {
1337
1355
  if (type === "org.openrewrite.javascript.tree.JS$ImportAttributes") {
1338
1356
  return new tree_1.ImportAttributes(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 3), ctx.receiveNode(null, receiveContainer));
1339
1357
  }
1358
+ if (type === "org.openrewrite.javascript.tree.JS$ImportTypeAttributes") {
1359
+ return new tree_1.ImportTypeAttributes(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveSpace));
1360
+ }
1340
1361
  if (type === "org.openrewrite.javascript.tree.JS$ImportAttribute") {
1341
1362
  return new tree_1.ImportAttribute(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree));
1342
1363
  }
@@ -1461,7 +1482,7 @@ class Factory {
1461
1482
  return new tree_1.BindingElement(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveValue(null, 5));
1462
1483
  }
1463
1484
  if (type === "org.openrewrite.javascript.tree.JS$ExportDeclaration") {
1464
- return new tree_1.ExportDeclaration(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNode(null, leftPaddedValueReceiver(1)), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree));
1485
+ return new tree_1.ExportDeclaration(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNode(null, leftPaddedValueReceiver(1)), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveNode(null, ctx.receiveTree));
1465
1486
  }
1466
1487
  if (type === "org.openrewrite.javascript.tree.JS$ExportAssignment") {
1467
1488
  return new tree_1.ExportAssignment(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNode(null, leftPaddedValueReceiver(1)), ctx.receiveNode(null, ctx.receiveTree));
@@ -1515,7 +1536,7 @@ class Factory {
1515
1536
  return new Java.Break(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, ctx.receiveTree));
1516
1537
  }
1517
1538
  if (type === "org.openrewrite.java.tree.J$Case") {
1518
- return new Java.Case(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 3), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveRightPaddedTree));
1539
+ return new Java.Case(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 3), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, ctx.receiveTree));
1519
1540
  }
1520
1541
  if (type === "org.openrewrite.java.tree.J$ClassDeclaration") {
1521
1542
  return new Java.ClassDeclaration(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveLeftPaddedTree), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveValue(null, 5));
@@ -1688,6 +1709,9 @@ class Factory {
1688
1709
  if (type === "org.openrewrite.java.tree.J$Unknown$Source") {
1689
1710
  return new Java.Unknown.Source(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 1));
1690
1711
  }
1712
+ if (type === "org.openrewrite.java.tree.J$Erroneous") {
1713
+ return new Java.Erroneous(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 1));
1714
+ }
1691
1715
  throw new Error("No factory method for type: " + type);
1692
1716
  }
1693
1717
  }