@openrewrite/rewrite 8.96.3 → 8.96.4
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/dist/java/tree.d.ts +11 -11
- package/dist/java/tree.d.ts.map +1 -1
- package/dist/java/visitor.d.ts.map +1 -1
- package/dist/java/visitor.js +30 -0
- package/dist/java/visitor.js.map +1 -1
- package/dist/javascript/format/format.d.ts +2 -0
- package/dist/javascript/format/format.d.ts.map +1 -1
- package/dist/javascript/format/format.js +7 -1
- package/dist/javascript/format/format.js.map +1 -1
- package/dist/javascript/parser-utils.d.ts.map +1 -1
- package/dist/javascript/parser-utils.js +15 -7
- package/dist/javascript/parser-utils.js.map +1 -1
- package/dist/javascript/templating/precedence.js +1 -1
- package/dist/javascript/templating/precedence.js.map +1 -1
- package/dist/javascript/tree.d.ts +12 -12
- package/dist/javascript/tree.d.ts.map +1 -1
- package/dist/javascript/visitor.d.ts.map +1 -1
- package/dist/javascript/visitor.js +75 -0
- package/dist/javascript/visitor.js.map +1 -1
- package/dist/rewrite-javascript-version.txt +1 -1
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +743 -0
- package/node_modules/picomatch/index.js +17 -0
- package/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/picomatch/lib/parse.js +1506 -0
- package/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/picomatch/package.json +83 -0
- package/node_modules/picomatch/posix.js +3 -0
- package/package.json +88 -90
- package/src/java/tree.ts +11 -11
- package/src/java/visitor.ts +36 -0
- package/src/javascript/format/format.ts +7 -1
- package/src/javascript/parser-utils.ts +15 -7
- package/src/javascript/templating/precedence.ts +1 -1
- package/src/javascript/tree.ts +12 -12
- package/src/javascript/visitor.ts +90 -0
|
@@ -111,6 +111,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
protected async visitAs(as_: JS.As, p: P): Promise<J | undefined> {
|
|
114
|
+
const expression = await this.visitExpression(as_, p);
|
|
115
|
+
if (!expression?.kind || expression.kind !== JS.Kind.As) {
|
|
116
|
+
return expression;
|
|
117
|
+
}
|
|
118
|
+
as_ = expression as JS.As;
|
|
119
|
+
|
|
114
120
|
const updates: any = {
|
|
115
121
|
prefix: await this.visitSpace(as_.prefix, p),
|
|
116
122
|
markers: await this.visitMarkers(as_.markers, p),
|
|
@@ -138,6 +144,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
protected async visitJsxTag(element: JSX.Tag, p: P): Promise<J | undefined> {
|
|
147
|
+
const expression = await this.visitExpression(element, p);
|
|
148
|
+
if (!expression?.kind || expression.kind !== JS.Kind.JsxTag) {
|
|
149
|
+
return expression;
|
|
150
|
+
}
|
|
151
|
+
element = expression as JSX.Tag;
|
|
152
|
+
|
|
141
153
|
const updates: any = {
|
|
142
154
|
prefix: await this.visitSpace(element.prefix, p),
|
|
143
155
|
markers: await this.visitMarkers(element.markers, p),
|
|
@@ -174,6 +186,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
174
186
|
}
|
|
175
187
|
|
|
176
188
|
protected async visitJsxEmbeddedExpression(expr: JSX.EmbeddedExpression, p: P): Promise<J | undefined> {
|
|
189
|
+
const expression = await this.visitExpression(expr, p);
|
|
190
|
+
if (!expression?.kind || expression.kind !== JS.Kind.JsxEmbeddedExpression) {
|
|
191
|
+
return expression;
|
|
192
|
+
}
|
|
193
|
+
expr = expression as JSX.EmbeddedExpression;
|
|
194
|
+
|
|
177
195
|
const updates: any = {
|
|
178
196
|
prefix: await this.visitSpace(expr.prefix, p),
|
|
179
197
|
markers: await this.visitMarkers(expr.markers, p),
|
|
@@ -455,6 +473,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
455
473
|
}
|
|
456
474
|
|
|
457
475
|
protected async visitBinaryExtensions(jsBinary: JS.Binary, p: P): Promise<J | undefined> {
|
|
476
|
+
const expression = await this.visitExpression(jsBinary, p);
|
|
477
|
+
if (!expression?.kind || expression.kind !== JS.Kind.Binary) {
|
|
478
|
+
return expression;
|
|
479
|
+
}
|
|
480
|
+
jsBinary = expression as JS.Binary;
|
|
481
|
+
|
|
458
482
|
const updates: any = {
|
|
459
483
|
prefix: await this.visitSpace(jsBinary.prefix, p),
|
|
460
484
|
markers: await this.visitMarkers(jsBinary.markers, p),
|
|
@@ -504,6 +528,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
504
528
|
}
|
|
505
529
|
|
|
506
530
|
protected async visitMappedTypeKeysRemapping(keysRemapping: JS.MappedType.KeysRemapping, p: P): Promise<J | undefined> {
|
|
531
|
+
const statement = await this.visitStatement(keysRemapping, p);
|
|
532
|
+
if (!statement?.kind || statement.kind !== JS.Kind.MappedTypeKeysRemapping) {
|
|
533
|
+
return statement;
|
|
534
|
+
}
|
|
535
|
+
keysRemapping = statement as JS.MappedType.KeysRemapping;
|
|
536
|
+
|
|
507
537
|
const updates: any = {
|
|
508
538
|
prefix: await this.visitSpace(keysRemapping.prefix, p),
|
|
509
539
|
markers: await this.visitMarkers(keysRemapping.markers, p),
|
|
@@ -514,6 +544,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
514
544
|
}
|
|
515
545
|
|
|
516
546
|
protected async visitMappedTypeParameter(mappedTypeParameter: JS.MappedType.Parameter, p: P): Promise<J | undefined> {
|
|
547
|
+
const statement = await this.visitStatement(mappedTypeParameter, p);
|
|
548
|
+
if (!statement?.kind || statement.kind !== JS.Kind.MappedTypeParameter) {
|
|
549
|
+
return statement;
|
|
550
|
+
}
|
|
551
|
+
mappedTypeParameter = statement as JS.MappedType.Parameter;
|
|
552
|
+
|
|
517
553
|
const updates: any = {
|
|
518
554
|
prefix: await this.visitSpace(mappedTypeParameter.prefix, p),
|
|
519
555
|
markers: await this.visitMarkers(mappedTypeParameter.markers, p),
|
|
@@ -767,6 +803,18 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
767
803
|
}
|
|
768
804
|
|
|
769
805
|
protected async visitAssignmentOperationExtensions(assignmentOperation: JS.AssignmentOperation, p: P): Promise<J | undefined> {
|
|
806
|
+
const expression = await this.visitExpression(assignmentOperation, p);
|
|
807
|
+
if (!expression?.kind || expression.kind !== JS.Kind.AssignmentOperation) {
|
|
808
|
+
return expression;
|
|
809
|
+
}
|
|
810
|
+
assignmentOperation = expression as JS.AssignmentOperation;
|
|
811
|
+
|
|
812
|
+
const statement = await this.visitStatement(assignmentOperation, p);
|
|
813
|
+
if (!statement?.kind || statement.kind !== JS.Kind.AssignmentOperation) {
|
|
814
|
+
return statement;
|
|
815
|
+
}
|
|
816
|
+
assignmentOperation = statement as JS.AssignmentOperation;
|
|
817
|
+
|
|
770
818
|
const updates: any = {
|
|
771
819
|
prefix: await this.visitSpace(assignmentOperation.prefix, p),
|
|
772
820
|
markers: await this.visitMarkers(assignmentOperation.markers, p),
|
|
@@ -796,6 +844,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
796
844
|
}
|
|
797
845
|
|
|
798
846
|
protected async visitIndexedAccessTypeIndexType(indexType: JS.IndexedAccessType.IndexType, p: P): Promise<J | undefined> {
|
|
847
|
+
const expression = await this.visitExpression(indexType, p);
|
|
848
|
+
if (!expression?.kind || expression.kind !== JS.Kind.IndexedAccessTypeIndexType) {
|
|
849
|
+
return expression;
|
|
850
|
+
}
|
|
851
|
+
indexType = expression as JS.IndexedAccessType.IndexType;
|
|
852
|
+
|
|
799
853
|
const updates: any = {
|
|
800
854
|
prefix: await this.visitSpace(indexType.prefix, p),
|
|
801
855
|
markers: await this.visitMarkers(indexType.markers, p),
|
|
@@ -989,6 +1043,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
989
1043
|
}
|
|
990
1044
|
|
|
991
1045
|
protected async visitForOfLoop(forOfLoop: JS.ForOfLoop, p: P): Promise<J | undefined> {
|
|
1046
|
+
const statement = await this.visitStatement(forOfLoop, p);
|
|
1047
|
+
if (!statement?.kind || statement.kind !== JS.Kind.ForOfLoop) {
|
|
1048
|
+
return statement;
|
|
1049
|
+
}
|
|
1050
|
+
forOfLoop = statement as JS.ForOfLoop;
|
|
1051
|
+
|
|
992
1052
|
const updates: any = {
|
|
993
1053
|
prefix: await this.visitSpace(forOfLoop.prefix, p),
|
|
994
1054
|
markers: await this.visitMarkers(forOfLoop.markers, p),
|
|
@@ -999,6 +1059,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
999
1059
|
}
|
|
1000
1060
|
|
|
1001
1061
|
protected async visitForInLoop(forInLoop: JS.ForInLoop, p: P): Promise<J | undefined> {
|
|
1062
|
+
const statement = await this.visitStatement(forInLoop, p);
|
|
1063
|
+
if (!statement?.kind || statement.kind !== JS.Kind.ForInLoop) {
|
|
1064
|
+
return statement;
|
|
1065
|
+
}
|
|
1066
|
+
forInLoop = statement as JS.ForInLoop;
|
|
1067
|
+
|
|
1002
1068
|
const updates: any = {
|
|
1003
1069
|
prefix: await this.visitSpace(forInLoop.prefix, p),
|
|
1004
1070
|
markers: await this.visitMarkers(forInLoop.markers, p),
|
|
@@ -1027,6 +1093,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
1027
1093
|
}
|
|
1028
1094
|
|
|
1029
1095
|
protected async visitTypeLiteral(typeLiteral: JS.TypeLiteral, p: P): Promise<J | undefined> {
|
|
1096
|
+
const expression = await this.visitExpression(typeLiteral, p);
|
|
1097
|
+
if (!expression?.kind || expression.kind !== JS.Kind.TypeLiteral) {
|
|
1098
|
+
return expression;
|
|
1099
|
+
}
|
|
1100
|
+
typeLiteral = expression as JS.TypeLiteral;
|
|
1101
|
+
|
|
1030
1102
|
const updates: any = {
|
|
1031
1103
|
prefix: await this.visitSpace(typeLiteral.prefix, p),
|
|
1032
1104
|
markers: await this.visitMarkers(typeLiteral.markers, p),
|
|
@@ -1037,6 +1109,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
1037
1109
|
}
|
|
1038
1110
|
|
|
1039
1111
|
protected async visitArrayBindingPattern(arrayBindingPattern: JS.ArrayBindingPattern, p: P): Promise<J | undefined> {
|
|
1112
|
+
const expression = await this.visitExpression(arrayBindingPattern, p);
|
|
1113
|
+
if (!expression?.kind || expression.kind !== JS.Kind.ArrayBindingPattern) {
|
|
1114
|
+
return expression;
|
|
1115
|
+
}
|
|
1116
|
+
arrayBindingPattern = expression as JS.ArrayBindingPattern;
|
|
1117
|
+
|
|
1040
1118
|
const updates: any = {
|
|
1041
1119
|
prefix: await this.visitSpace(arrayBindingPattern.prefix, p),
|
|
1042
1120
|
markers: await this.visitMarkers(arrayBindingPattern.markers, p),
|
|
@@ -1099,6 +1177,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
1099
1177
|
}
|
|
1100
1178
|
|
|
1101
1179
|
protected async visitNamedExports(namedExports: JS.NamedExports, p: P): Promise<J | undefined> {
|
|
1180
|
+
const expression = await this.visitExpression(namedExports, p);
|
|
1181
|
+
if (!expression?.kind || expression.kind !== JS.Kind.NamedExports) {
|
|
1182
|
+
return expression;
|
|
1183
|
+
}
|
|
1184
|
+
namedExports = expression as JS.NamedExports;
|
|
1185
|
+
|
|
1102
1186
|
const updates: any = {
|
|
1103
1187
|
prefix: await this.visitSpace(namedExports.prefix, p),
|
|
1104
1188
|
markers: await this.visitMarkers(namedExports.markers, p),
|
|
@@ -1109,6 +1193,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
1109
1193
|
}
|
|
1110
1194
|
|
|
1111
1195
|
protected async visitExportSpecifier(exportSpecifier: JS.ExportSpecifier, p: P): Promise<J | undefined> {
|
|
1196
|
+
const expression = await this.visitExpression(exportSpecifier, p);
|
|
1197
|
+
if (!expression?.kind || expression.kind !== JS.Kind.ExportSpecifier) {
|
|
1198
|
+
return expression;
|
|
1199
|
+
}
|
|
1200
|
+
exportSpecifier = expression as JS.ExportSpecifier;
|
|
1201
|
+
|
|
1112
1202
|
const updates: any = {
|
|
1113
1203
|
prefix: await this.visitSpace(exportSpecifier.prefix, p),
|
|
1114
1204
|
markers: await this.visitMarkers(exportSpecifier.markers, p),
|