@openrewrite/rewrite 0.27.0 → 0.28.1

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 (37) hide show
  1. package/dist/src/java/remote/receiver.d.ts.map +1 -1
  2. package/dist/src/java/remote/receiver.js +0 -10
  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 +0 -7
  6. package/dist/src/java/remote/sender.js.map +1 -1
  7. package/dist/src/java/tree/tree.d.ts +0 -39
  8. package/dist/src/java/tree/tree.d.ts.map +1 -1
  9. package/dist/src/java/tree/tree.js +2 -48
  10. package/dist/src/java/tree/tree.js.map +1 -1
  11. package/dist/src/java/visitor.d.ts +1 -2
  12. package/dist/src/java/visitor.d.ts.map +1 -1
  13. package/dist/src/java/visitor.js +0 -15
  14. package/dist/src/java/visitor.js.map +1 -1
  15. package/dist/src/javascript/parser.d.ts +10 -9
  16. package/dist/src/javascript/parser.d.ts.map +1 -1
  17. package/dist/src/javascript/parser.js +52 -23
  18. package/dist/src/javascript/parser.js.map +1 -1
  19. package/dist/src/javascript/remote/receiver.d.ts.map +1 -1
  20. package/dist/src/javascript/remote/receiver.js +84 -17
  21. package/dist/src/javascript/remote/receiver.js.map +1 -1
  22. package/dist/src/javascript/remote/sender.d.ts.map +1 -1
  23. package/dist/src/javascript/remote/sender.js +62 -13
  24. package/dist/src/javascript/remote/sender.js.map +1 -1
  25. package/dist/src/javascript/tree/support_types.d.ts +19 -4
  26. package/dist/src/javascript/tree/support_types.d.ts.map +1 -1
  27. package/dist/src/javascript/tree/support_types.js +15 -0
  28. package/dist/src/javascript/tree/support_types.js.map +1 -1
  29. package/dist/src/javascript/tree/tree.d.ts +349 -26
  30. package/dist/src/javascript/tree/tree.d.ts.map +1 -1
  31. package/dist/src/javascript/tree/tree.js +447 -59
  32. package/dist/src/javascript/tree/tree.js.map +1 -1
  33. package/dist/src/javascript/visitor.d.ts +8 -1
  34. package/dist/src/javascript/visitor.d.ts.map +1 -1
  35. package/dist/src/javascript/visitor.js +67 -6
  36. package/dist/src/javascript/visitor.js.map +1 -1
  37. 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,EAAo7B,MAAM,SAAS,CAAC;AAI98B,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,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"}
@@ -195,14 +195,29 @@ class Visitor extends __1.JavaScriptVisitor {
195
195
  jsImport = jsImport.withId(ctx.receiveValue(jsImport.id, 0));
196
196
  jsImport = jsImport.withPrefix(ctx.receiveNode(jsImport.prefix, receiveSpace));
197
197
  jsImport = jsImport.withMarkers(ctx.receiveNode(jsImport.markers, ctx.receiveMarkers));
198
- jsImport = jsImport.padding.withName(ctx.receiveNode(jsImport.padding.name, receiveRightPaddedTree));
199
- jsImport = jsImport.padding.withImportType(ctx.receiveNode(jsImport.padding.importType, leftPaddedValueReceiver(1)));
200
- jsImport = jsImport.padding.withImports(ctx.receiveNode(jsImport.padding.imports, receiveContainer));
201
- jsImport = jsImport.withFrom(ctx.receiveNode(jsImport.from, receiveSpace));
202
- jsImport = jsImport.withTarget(ctx.receiveNode(jsImport.target, ctx.receiveTree));
203
- jsImport = jsImport.padding.withInitializer(ctx.receiveNode(jsImport.padding.initializer, receiveLeftPaddedTree));
198
+ jsImport = jsImport.withModifiers(ctx.receiveNodes(jsImport.modifiers, ctx.receiveTree));
199
+ jsImport = jsImport.withImportClause(ctx.receiveNode(jsImport.importClause, ctx.receiveTree));
200
+ jsImport = jsImport.padding.withModuleSpecifier(ctx.receiveNode(jsImport.padding.moduleSpecifier, receiveLeftPaddedTree));
201
+ jsImport = jsImport.withAttributes(ctx.receiveNode(jsImport.attributes, ctx.receiveTree));
204
202
  return jsImport;
205
203
  }
204
+ visitJsImportClause(jsImportClause, ctx) {
205
+ jsImportClause = jsImportClause.withId(ctx.receiveValue(jsImportClause.id, 0));
206
+ jsImportClause = jsImportClause.withPrefix(ctx.receiveNode(jsImportClause.prefix, receiveSpace));
207
+ jsImportClause = jsImportClause.withMarkers(ctx.receiveNode(jsImportClause.markers, ctx.receiveMarkers));
208
+ jsImportClause = jsImportClause.withTypeOnly(ctx.receiveValue(jsImportClause.typeOnly, 1));
209
+ jsImportClause = jsImportClause.padding.withName(ctx.receiveNode(jsImportClause.padding.name, receiveRightPaddedTree));
210
+ jsImportClause = jsImportClause.withNamedBindings(ctx.receiveNode(jsImportClause.namedBindings, ctx.receiveTree));
211
+ return jsImportClause;
212
+ }
213
+ visitNamedImports(namedImports, ctx) {
214
+ namedImports = namedImports.withId(ctx.receiveValue(namedImports.id, 0));
215
+ namedImports = namedImports.withPrefix(ctx.receiveNode(namedImports.prefix, receiveSpace));
216
+ namedImports = namedImports.withMarkers(ctx.receiveNode(namedImports.markers, ctx.receiveMarkers));
217
+ namedImports = namedImports.padding.withElements(ctx.receiveNode(namedImports.padding.elements, receiveContainer));
218
+ namedImports = namedImports.withType(ctx.receiveValue(namedImports.type, 5));
219
+ return namedImports;
220
+ }
206
221
  visitJsImportSpecifier(jsImportSpecifier, ctx) {
207
222
  jsImportSpecifier = jsImportSpecifier.withId(ctx.receiveValue(jsImportSpecifier.id, 0));
208
223
  jsImportSpecifier = jsImportSpecifier.withPrefix(ctx.receiveNode(jsImportSpecifier.prefix, receiveSpace));
@@ -212,6 +227,22 @@ class Visitor extends __1.JavaScriptVisitor {
212
227
  jsImportSpecifier = jsImportSpecifier.withType(ctx.receiveValue(jsImportSpecifier.type, 5));
213
228
  return jsImportSpecifier;
214
229
  }
230
+ visitImportAttributes(importAttributes, ctx) {
231
+ importAttributes = importAttributes.withId(ctx.receiveValue(importAttributes.id, 0));
232
+ importAttributes = importAttributes.withPrefix(ctx.receiveNode(importAttributes.prefix, receiveSpace));
233
+ importAttributes = importAttributes.withMarkers(ctx.receiveNode(importAttributes.markers, ctx.receiveMarkers));
234
+ importAttributes = importAttributes.withToken(ctx.receiveValue(importAttributes.token, 3));
235
+ importAttributes = importAttributes.padding.withElements(ctx.receiveNode(importAttributes.padding.elements, receiveContainer));
236
+ return importAttributes;
237
+ }
238
+ visitImportAttribute(importAttribute, ctx) {
239
+ importAttribute = importAttribute.withId(ctx.receiveValue(importAttribute.id, 0));
240
+ importAttribute = importAttribute.withPrefix(ctx.receiveNode(importAttribute.prefix, receiveSpace));
241
+ importAttribute = importAttribute.withMarkers(ctx.receiveNode(importAttribute.markers, ctx.receiveMarkers));
242
+ importAttribute = importAttribute.withName(ctx.receiveNode(importAttribute.name, ctx.receiveTree));
243
+ importAttribute = importAttribute.padding.withValue(ctx.receiveNode(importAttribute.padding.value, receiveLeftPaddedTree));
244
+ return importAttribute;
245
+ }
215
246
  visitJsBinary(jsBinary, ctx) {
216
247
  jsBinary = jsBinary.withId(ctx.receiveValue(jsBinary.id, 0));
217
248
  jsBinary = jsBinary.withPrefix(ctx.receiveNode(jsBinary.prefix, receiveSpace));
@@ -302,6 +333,14 @@ class Visitor extends __1.JavaScriptVisitor {
302
333
  statementExpression = statementExpression.withStatement(ctx.receiveNode(statementExpression.statement, ctx.receiveTree));
303
334
  return statementExpression;
304
335
  }
336
+ visitWithStatement(withStatement, ctx) {
337
+ withStatement = withStatement.withId(ctx.receiveValue(withStatement.id, 0));
338
+ withStatement = withStatement.withPrefix(ctx.receiveNode(withStatement.prefix, receiveSpace));
339
+ withStatement = withStatement.withMarkers(ctx.receiveNode(withStatement.markers, ctx.receiveMarkers));
340
+ withStatement = withStatement.withExpression(ctx.receiveNode(withStatement.expression, ctx.receiveTree));
341
+ withStatement = withStatement.padding.withBody(ctx.receiveNode(withStatement.padding.body, receiveRightPaddedTree));
342
+ return withStatement;
343
+ }
305
344
  visitTaggedTemplateExpression(taggedTemplateExpression, ctx) {
306
345
  taggedTemplateExpression = taggedTemplateExpression.withId(ctx.receiveValue(taggedTemplateExpression.id, 0));
307
346
  taggedTemplateExpression = taggedTemplateExpression.withPrefix(ctx.receiveNode(taggedTemplateExpression.prefix, receiveSpace));
@@ -493,6 +532,23 @@ class Visitor extends __1.JavaScriptVisitor {
493
532
  jSForInOfLoopControl = jSForInOfLoopControl.padding.withIterable(ctx.receiveNode(jSForInOfLoopControl.padding.iterable, receiveRightPaddedTree));
494
533
  return jSForInOfLoopControl;
495
534
  }
535
+ visitJSTry(jSTry, ctx) {
536
+ jSTry = jSTry.withId(ctx.receiveValue(jSTry.id, 0));
537
+ jSTry = jSTry.withPrefix(ctx.receiveNode(jSTry.prefix, receiveSpace));
538
+ jSTry = jSTry.withMarkers(ctx.receiveNode(jSTry.markers, ctx.receiveMarkers));
539
+ jSTry = jSTry.withBody(ctx.receiveNode(jSTry.body, ctx.receiveTree));
540
+ jSTry = jSTry.withCatches(ctx.receiveNode(jSTry.catches, ctx.receiveTree));
541
+ jSTry = jSTry.padding.withFinallie(ctx.receiveNode(jSTry.padding.finallie, receiveLeftPaddedTree));
542
+ return jSTry;
543
+ }
544
+ visitJSTryJSCatch(jSCatch, ctx) {
545
+ jSCatch = jSCatch.withId(ctx.receiveValue(jSCatch.id, 0));
546
+ jSCatch = jSCatch.withPrefix(ctx.receiveNode(jSCatch.prefix, receiveSpace));
547
+ jSCatch = jSCatch.withMarkers(ctx.receiveNode(jSCatch.markers, ctx.receiveMarkers));
548
+ jSCatch = jSCatch.withParameter(ctx.receiveNode(jSCatch.parameter, ctx.receiveTree));
549
+ jSCatch = jSCatch.withBody(ctx.receiveNode(jSCatch.body, ctx.receiveTree));
550
+ return jSCatch;
551
+ }
496
552
  visitNamespaceDeclaration(namespaceDeclaration, ctx) {
497
553
  namespaceDeclaration = namespaceDeclaration.withId(ctx.receiveValue(namespaceDeclaration.id, 0));
498
554
  namespaceDeclaration = namespaceDeclaration.withPrefix(ctx.receiveNode(namespaceDeclaration.prefix, receiveSpace));
@@ -1221,13 +1277,6 @@ class Visitor extends __1.JavaScriptVisitor {
1221
1277
  source = source.withText(ctx.receiveValue(source.text, 1));
1222
1278
  return source;
1223
1279
  }
1224
- visitErroneous(erroneous, ctx) {
1225
- erroneous = erroneous.withId(ctx.receiveValue(erroneous.id, 0));
1226
- erroneous = erroneous.withPrefix(ctx.receiveNode(erroneous.prefix, receiveSpace));
1227
- erroneous = erroneous.withMarkers(ctx.receiveNode(erroneous.markers, ctx.receiveMarkers));
1228
- erroneous = erroneous.withText(ctx.receiveValue(erroneous.text, 1));
1229
- return erroneous;
1230
- }
1231
1280
  }
1232
1281
  class Factory {
1233
1282
  create(type, ctx) {
@@ -1274,11 +1323,23 @@ class Factory {
1274
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));
1275
1324
  }
1276
1325
  if (type === "org.openrewrite.javascript.tree.JS$JsImport") {
1277
- return new tree_1.JsImport(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, leftPaddedValueReceiver(1)), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree));
1326
+ 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));
1327
+ }
1328
+ if (type === "org.openrewrite.javascript.tree.JS$JsImportClause") {
1329
+ return new tree_1.JsImportClause(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 1), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, ctx.receiveTree));
1330
+ }
1331
+ if (type === "org.openrewrite.javascript.tree.JS$NamedImports") {
1332
+ return new tree_1.NamedImports(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveContainer), ctx.receiveValue(null, 5));
1278
1333
  }
1279
1334
  if (type === "org.openrewrite.javascript.tree.JS$JsImportSpecifier") {
1280
1335
  return new tree_1.JsImportSpecifier(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, leftPaddedValueReceiver(1)), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveValue(null, 5));
1281
1336
  }
1337
+ if (type === "org.openrewrite.javascript.tree.JS$ImportAttributes") {
1338
+ 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
+ }
1340
+ if (type === "org.openrewrite.javascript.tree.JS$ImportAttribute") {
1341
+ 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
+ }
1282
1343
  if (type === "org.openrewrite.javascript.tree.JS$JsBinary") {
1283
1344
  return new tree_1.JsBinary(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, leftPaddedValueReceiver(3)), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveValue(null, 5));
1284
1345
  }
@@ -1309,6 +1370,9 @@ class Factory {
1309
1370
  if (type === "org.openrewrite.javascript.tree.JS$StatementExpression") {
1310
1371
  return new tree_1.StatementExpression(ctx.receiveValue(null, 0), ctx.receiveNode(null, ctx.receiveTree));
1311
1372
  }
1373
+ if (type === "org.openrewrite.javascript.tree.JS$WithStatement") {
1374
+ return new tree_1.WithStatement(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveRightPaddedTree));
1375
+ }
1312
1376
  if (type === "org.openrewrite.javascript.tree.JS$TaggedTemplateExpression") {
1313
1377
  return new tree_1.TaggedTemplateExpression(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, receiveContainer), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveValue(null, 5));
1314
1378
  }
@@ -1372,6 +1436,12 @@ class Factory {
1372
1436
  if (type === "org.openrewrite.javascript.tree.JS$JSForInOfLoopControl") {
1373
1437
  return new tree_1.JSForInOfLoopControl(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, receiveRightPaddedTree));
1374
1438
  }
1439
+ if (type === "org.openrewrite.javascript.tree.JS$JSTry") {
1440
+ return new tree_1.JSTry(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, receiveLeftPaddedTree));
1441
+ }
1442
+ if (type === "org.openrewrite.javascript.tree.JS$JSTry$JSCatch") {
1443
+ return new tree_1.JSTry.JSCatch(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNode(null, ctx.receiveTree), ctx.receiveNode(null, ctx.receiveTree));
1444
+ }
1375
1445
  if (type === "org.openrewrite.javascript.tree.JS$NamespaceDeclaration") {
1376
1446
  return new tree_1.NamespaceDeclaration(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveNodes(null, ctx.receiveTree), ctx.receiveNode(null, leftPaddedValueReceiver(3)), ctx.receiveNode(null, receiveRightPaddedTree), ctx.receiveNode(null, ctx.receiveTree));
1377
1447
  }
@@ -1618,9 +1688,6 @@ class Factory {
1618
1688
  if (type === "org.openrewrite.java.tree.J$Unknown$Source") {
1619
1689
  return new Java.Unknown.Source(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 1));
1620
1690
  }
1621
- if (type === "org.openrewrite.java.tree.J$Erroneous") {
1622
- return new Java.Erroneous(ctx.receiveValue(null, 0), ctx.receiveNode(null, receiveSpace), ctx.receiveNode(null, ctx.receiveMarkers), ctx.receiveValue(null, 1));
1623
- }
1624
1691
  throw new Error("No factory method for type: " + type);
1625
1692
  }
1626
1693
  }