@openrewrite/rewrite 8.62.0 → 8.62.2
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/rpc.d.ts +3 -3
- package/dist/java/rpc.d.ts.map +1 -1
- package/dist/java/rpc.js +6 -6
- package/dist/java/rpc.js.map +1 -1
- package/dist/java/tree.d.ts +31 -33
- package/dist/java/tree.d.ts.map +1 -1
- package/dist/java/tree.js +125 -7
- package/dist/java/tree.js.map +1 -1
- package/dist/java/type.d.ts +70 -57
- package/dist/java/type.d.ts.map +1 -1
- package/dist/java/type.js +454 -25
- package/dist/java/type.js.map +1 -1
- package/dist/java/visitor.d.ts +4 -4
- package/dist/java/visitor.d.ts.map +1 -1
- package/dist/java/visitor.js +34 -28
- package/dist/java/visitor.js.map +1 -1
- package/dist/javascript/assertions.d.ts +3 -0
- package/dist/javascript/assertions.d.ts.map +1 -1
- package/dist/javascript/assertions.js +78 -1
- package/dist/javascript/assertions.js.map +1 -1
- package/dist/javascript/format.js +4 -4
- package/dist/javascript/format.js.map +1 -1
- package/dist/javascript/parser.d.ts +1 -1
- package/dist/javascript/parser.d.ts.map +1 -1
- package/dist/javascript/parser.js +38 -11
- package/dist/javascript/parser.js.map +1 -1
- package/dist/javascript/rpc.js +1 -4
- package/dist/javascript/rpc.js.map +1 -1
- package/dist/javascript/tree.d.ts +33 -35
- package/dist/javascript/tree.d.ts.map +1 -1
- package/dist/javascript/tree.js +70 -17
- package/dist/javascript/tree.js.map +1 -1
- package/dist/javascript/type-mapping.d.ts +44 -8
- package/dist/javascript/type-mapping.d.ts.map +1 -1
- package/dist/javascript/type-mapping.js +571 -101
- package/dist/javascript/type-mapping.js.map +1 -1
- package/dist/javascript/visitor.d.ts +2 -2
- package/dist/javascript/visitor.d.ts.map +1 -1
- package/dist/javascript/visitor.js.map +1 -1
- package/dist/json/tree.d.ts +0 -2
- package/dist/json/tree.d.ts.map +1 -1
- package/dist/json/tree.js +12 -2
- package/dist/json/tree.js.map +1 -1
- package/dist/reference.js +1 -1
- package/dist/reference.js.map +1 -1
- package/dist/rpc/chrome-profiler.d.ts +25 -0
- package/dist/rpc/chrome-profiler.d.ts.map +1 -0
- package/dist/rpc/chrome-profiler.js +405 -0
- package/dist/rpc/chrome-profiler.js.map +1 -0
- package/dist/rpc/queue.d.ts +0 -3
- package/dist/rpc/queue.d.ts.map +1 -1
- package/dist/rpc/queue.js +6 -6
- package/dist/rpc/queue.js.map +1 -1
- package/dist/rpc/request/parse.d.ts.map +1 -1
- package/dist/rpc/request/parse.js.map +1 -1
- package/dist/rpc/rewrite-rpc.d.ts +1 -0
- package/dist/rpc/rewrite-rpc.d.ts.map +1 -1
- package/dist/rpc/rewrite-rpc.js +1 -1
- package/dist/rpc/rewrite-rpc.js.map +1 -1
- package/dist/rpc/server.d.ts.map +1 -1
- package/dist/rpc/server.js +26 -1
- package/dist/rpc/server.js.map +1 -1
- package/dist/test/rewrite-test.d.ts +1 -1
- package/dist/test/rewrite-test.d.ts.map +1 -1
- package/dist/test/rewrite-test.js +18 -2
- package/dist/test/rewrite-test.js.map +1 -1
- package/dist/text/tree.d.ts +0 -2
- package/dist/text/tree.d.ts.map +1 -1
- package/dist/text/tree.js +4 -17
- package/dist/text/tree.js.map +1 -1
- package/dist/tree.d.ts +1 -0
- package/dist/tree.d.ts.map +1 -1
- package/dist/tree.js +14 -0
- package/dist/tree.js.map +1 -1
- package/dist/version.txt +1 -1
- package/package.json +3 -3
- package/src/java/rpc.ts +18 -15
- package/src/java/tree.ts +68 -38
- package/src/java/type.ts +475 -74
- package/src/java/visitor.ts +45 -39
- package/src/javascript/assertions.ts +52 -1
- package/src/javascript/format.ts +4 -4
- package/src/javascript/parser.ts +51 -18
- package/src/javascript/rpc.ts +8 -10
- package/src/javascript/tree.ts +34 -35
- package/src/javascript/type-mapping.ts +582 -47
- package/src/javascript/visitor.ts +5 -5
- package/src/json/tree.ts +1 -2
- package/src/reference.ts +1 -1
- package/src/rpc/chrome-profiler.ts +373 -0
- package/src/rpc/queue.ts +8 -12
- package/src/rpc/request/parse.ts +1 -1
- package/src/rpc/rewrite-rpc.ts +3 -2
- package/src/rpc/server.ts +30 -1
- package/src/test/rewrite-test.ts +19 -3
- package/src/text/tree.ts +0 -1
- package/src/tree.ts +15 -0
package/src/javascript/tree.ts
CHANGED
|
@@ -16,15 +16,14 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import {SourceFile
|
|
20
|
-
import {Expression, J,
|
|
19
|
+
import {SourceFile} from "../tree";
|
|
20
|
+
import {Expression, J, NameTree, Statement, Type, TypedTree, TypeTree, VariableDeclarator,} from "../java";
|
|
21
21
|
|
|
22
22
|
export interface JS extends J {
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export namespace JS {
|
|
26
26
|
export const Kind = {
|
|
27
|
-
...TreeKind,
|
|
28
27
|
Alias: "org.openrewrite.javascript.tree.JS$Alias",
|
|
29
28
|
ArrayBindingPattern: "org.openrewrite.javascript.tree.JS$ArrayBindingPattern",
|
|
30
29
|
ArrowFunction: "org.openrewrite.javascript.tree.JS$ArrowFunction",
|
|
@@ -137,7 +136,7 @@ export namespace JS {
|
|
|
137
136
|
readonly kind: typeof Kind.As;
|
|
138
137
|
readonly left: J.RightPadded<Expression>;
|
|
139
138
|
readonly right: Expression;
|
|
140
|
-
readonly type?:
|
|
139
|
+
readonly type?: Type;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
/**
|
|
@@ -147,7 +146,7 @@ export namespace JS {
|
|
|
147
146
|
export interface Await extends JS, Expression {
|
|
148
147
|
readonly kind: typeof Kind.Await;
|
|
149
148
|
readonly expression: Expression;
|
|
150
|
-
readonly type?:
|
|
149
|
+
readonly type?: Type;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
/**
|
|
@@ -158,7 +157,7 @@ export namespace JS {
|
|
|
158
157
|
readonly kind: typeof Kind.ConditionalType;
|
|
159
158
|
readonly checkType: Expression;
|
|
160
159
|
readonly condition: J.LeftPadded<J.Ternary>;
|
|
161
|
-
readonly type?:
|
|
160
|
+
readonly type?: Type;
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
/**
|
|
@@ -187,7 +186,7 @@ export namespace JS {
|
|
|
187
186
|
readonly kind: typeof Kind.ExpressionWithTypeArguments;
|
|
188
187
|
readonly clazz: J;
|
|
189
188
|
readonly typeArguments?: J.Container<Expression>;
|
|
190
|
-
readonly type?:
|
|
189
|
+
readonly type?: Type;
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
/**
|
|
@@ -210,7 +209,7 @@ export namespace JS {
|
|
|
210
209
|
export interface InferType extends JS, Expression, TypeTree {
|
|
211
210
|
readonly kind: typeof Kind.InferType;
|
|
212
211
|
readonly typeParameter: J.LeftPadded<J>;
|
|
213
|
-
readonly type?:
|
|
212
|
+
readonly type?: Type;
|
|
214
213
|
}
|
|
215
214
|
|
|
216
215
|
/**
|
|
@@ -223,7 +222,7 @@ export namespace JS {
|
|
|
223
222
|
readonly argumentAndAttributes: J.Container<J>;
|
|
224
223
|
readonly qualifier?: J.LeftPadded<Expression>;
|
|
225
224
|
readonly typeArguments?: J.Container<Expression>;
|
|
226
|
-
readonly type?:
|
|
225
|
+
readonly type?: Type;
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
/**
|
|
@@ -257,7 +256,7 @@ export namespace JS {
|
|
|
257
256
|
export interface NamedImports extends JS, Expression {
|
|
258
257
|
readonly kind: typeof Kind.NamedImports;
|
|
259
258
|
readonly elements: J.Container<ImportSpecifier>;
|
|
260
|
-
readonly type?:
|
|
259
|
+
readonly type?: Type;
|
|
261
260
|
}
|
|
262
261
|
|
|
263
262
|
/**
|
|
@@ -268,7 +267,7 @@ export namespace JS {
|
|
|
268
267
|
readonly kind: typeof Kind.ImportSpecifier;
|
|
269
268
|
readonly importType: J.LeftPadded<boolean>;
|
|
270
269
|
readonly specifier: J.Identifier | Alias;
|
|
271
|
-
readonly type?:
|
|
270
|
+
readonly type?: Type;
|
|
272
271
|
}
|
|
273
272
|
|
|
274
273
|
/**
|
|
@@ -318,7 +317,7 @@ export namespace JS {
|
|
|
318
317
|
readonly left: Expression;
|
|
319
318
|
readonly operator: J.LeftPadded<Binary.Type>;
|
|
320
319
|
readonly right: Expression;
|
|
321
|
-
readonly type?:
|
|
320
|
+
readonly type?: Type;
|
|
322
321
|
}
|
|
323
322
|
|
|
324
323
|
export namespace Binary {
|
|
@@ -339,7 +338,7 @@ export namespace JS {
|
|
|
339
338
|
export interface LiteralType extends JS, Expression, TypeTree {
|
|
340
339
|
readonly kind: typeof Kind.LiteralType;
|
|
341
340
|
readonly literal: Expression;
|
|
342
|
-
readonly type:
|
|
341
|
+
readonly type: Type;
|
|
343
342
|
}
|
|
344
343
|
|
|
345
344
|
|
|
@@ -355,7 +354,7 @@ export namespace JS {
|
|
|
355
354
|
readonly suffixToken?: J.LeftPadded<J.Literal>;
|
|
356
355
|
readonly hasQuestionToken: J.LeftPadded<boolean>;
|
|
357
356
|
readonly valueType: J.Container<TypeTree>;
|
|
358
|
-
readonly type?:
|
|
357
|
+
readonly type?: Type;
|
|
359
358
|
}
|
|
360
359
|
|
|
361
360
|
export namespace MappedType {
|
|
@@ -420,7 +419,7 @@ export namespace JS {
|
|
|
420
419
|
readonly kind: typeof Kind.SatisfiesExpression;
|
|
421
420
|
readonly expression: J;
|
|
422
421
|
readonly satisfiesType: J.LeftPadded<Expression>;
|
|
423
|
-
readonly type?:
|
|
422
|
+
readonly type?: Type;
|
|
424
423
|
}
|
|
425
424
|
|
|
426
425
|
/**
|
|
@@ -451,7 +450,7 @@ export namespace JS {
|
|
|
451
450
|
readonly tag?: J.RightPadded<Expression>;
|
|
452
451
|
readonly typeArguments?: J.Container<Expression>;
|
|
453
452
|
readonly templateExpression: Expression;
|
|
454
|
-
readonly type?:
|
|
453
|
+
readonly type?: Type;
|
|
455
454
|
}
|
|
456
455
|
|
|
457
456
|
/**
|
|
@@ -462,7 +461,7 @@ export namespace JS {
|
|
|
462
461
|
readonly kind: typeof Kind.TemplateExpression;
|
|
463
462
|
readonly head: J.Literal;
|
|
464
463
|
readonly spans: J.RightPadded<TemplateExpression.Span>[];
|
|
465
|
-
readonly type?:
|
|
464
|
+
readonly type?: Type;
|
|
466
465
|
}
|
|
467
466
|
|
|
468
467
|
export namespace TemplateExpression {
|
|
@@ -484,7 +483,7 @@ export namespace JS {
|
|
|
484
483
|
export interface Tuple extends JS, Expression, TypeTree {
|
|
485
484
|
readonly kind: typeof Kind.Tuple;
|
|
486
485
|
readonly elements: J.Container<J>;
|
|
487
|
-
readonly type?:
|
|
486
|
+
readonly type?: Type;
|
|
488
487
|
}
|
|
489
488
|
|
|
490
489
|
/**
|
|
@@ -497,7 +496,7 @@ export namespace JS {
|
|
|
497
496
|
readonly name: J.LeftPadded<J.Identifier>;
|
|
498
497
|
readonly typeParameters?: J.TypeParameters;
|
|
499
498
|
readonly initializer: J.LeftPadded<Expression>;
|
|
500
|
-
readonly type?:
|
|
499
|
+
readonly type?: Type;
|
|
501
500
|
}
|
|
502
501
|
|
|
503
502
|
/**
|
|
@@ -507,7 +506,7 @@ export namespace JS {
|
|
|
507
506
|
export interface TypeOf extends JS, Expression {
|
|
508
507
|
readonly kind: typeof Kind.TypeOf;
|
|
509
508
|
readonly expression: Expression;
|
|
510
|
-
readonly type?:
|
|
509
|
+
readonly type?: Type;
|
|
511
510
|
}
|
|
512
511
|
|
|
513
512
|
/**
|
|
@@ -528,7 +527,7 @@ export namespace JS {
|
|
|
528
527
|
readonly variable: Expression;
|
|
529
528
|
readonly operator: J.LeftPadded<AssignmentOperation.Type>;
|
|
530
529
|
readonly assignment: Expression;
|
|
531
|
-
readonly type?:
|
|
530
|
+
readonly type?: Type;
|
|
532
531
|
}
|
|
533
532
|
|
|
534
533
|
export namespace AssignmentOperation {
|
|
@@ -549,7 +548,7 @@ export namespace JS {
|
|
|
549
548
|
readonly kind: typeof Kind.IndexedAccessType;
|
|
550
549
|
readonly objectType: TypeTree;
|
|
551
550
|
readonly indexType: TypeTree;
|
|
552
|
-
readonly type?:
|
|
551
|
+
readonly type?: Type;
|
|
553
552
|
}
|
|
554
553
|
|
|
555
554
|
|
|
@@ -561,7 +560,7 @@ export namespace JS {
|
|
|
561
560
|
export interface IndexType extends JS {
|
|
562
561
|
readonly kind: typeof Kind.IndexedAccessTypeIndexType;
|
|
563
562
|
readonly element: J.RightPadded<TypeTree>;
|
|
564
|
-
readonly type?:
|
|
563
|
+
readonly type?: Type;
|
|
565
564
|
}
|
|
566
565
|
}
|
|
567
566
|
|
|
@@ -573,7 +572,7 @@ export namespace JS {
|
|
|
573
572
|
readonly kind: typeof Kind.TypeQuery;
|
|
574
573
|
readonly typeExpression: TypeTree;
|
|
575
574
|
readonly typeArguments?: J.Container<Expression>;
|
|
576
|
-
readonly type?:
|
|
575
|
+
readonly type?: Type;
|
|
577
576
|
}
|
|
578
577
|
|
|
579
578
|
/**
|
|
@@ -621,7 +620,7 @@ export namespace JS {
|
|
|
621
620
|
readonly asserts: J.LeftPadded<boolean>;
|
|
622
621
|
readonly parameterName: J.Identifier;
|
|
623
622
|
readonly expression?: J.LeftPadded<Expression>;
|
|
624
|
-
readonly type?:
|
|
623
|
+
readonly type?: Type;
|
|
625
624
|
}
|
|
626
625
|
|
|
627
626
|
/**
|
|
@@ -631,7 +630,7 @@ export namespace JS {
|
|
|
631
630
|
export interface Union extends JS, Expression, TypeTree {
|
|
632
631
|
readonly kind: typeof Kind.Union;
|
|
633
632
|
readonly types: J.RightPadded<Expression>[];
|
|
634
|
-
readonly type?:
|
|
633
|
+
readonly type?: Type;
|
|
635
634
|
}
|
|
636
635
|
|
|
637
636
|
/**
|
|
@@ -641,7 +640,7 @@ export namespace JS {
|
|
|
641
640
|
export interface Intersection extends JS, Expression, TypeTree {
|
|
642
641
|
readonly kind: typeof Kind.Intersection;
|
|
643
642
|
readonly types: J.RightPadded<Expression>[];
|
|
644
|
-
readonly type?:
|
|
643
|
+
readonly type?: Type;
|
|
645
644
|
}
|
|
646
645
|
|
|
647
646
|
/**
|
|
@@ -656,7 +655,7 @@ export namespace JS {
|
|
|
656
655
|
readonly function?: J.RightPadded<Expression>;
|
|
657
656
|
readonly typeParameters?: J.Container<Expression>;
|
|
658
657
|
readonly arguments: J.Container<Expression>;
|
|
659
|
-
readonly functionType?:
|
|
658
|
+
readonly functionType?: Type.Method;
|
|
660
659
|
}
|
|
661
660
|
|
|
662
661
|
/**
|
|
@@ -687,7 +686,7 @@ export namespace JS {
|
|
|
687
686
|
readonly modifiers: J.Modifier[];
|
|
688
687
|
readonly parameters: J.Container<J>;
|
|
689
688
|
readonly typeExpression: J.LeftPadded<Expression>;
|
|
690
|
-
readonly type?:
|
|
689
|
+
readonly type?: Type;
|
|
691
690
|
}
|
|
692
691
|
|
|
693
692
|
/**
|
|
@@ -703,7 +702,7 @@ export namespace JS {
|
|
|
703
702
|
readonly name: ComputedPropertyName;
|
|
704
703
|
readonly parameters: J.Container<Statement>;
|
|
705
704
|
readonly body?: J.Block;
|
|
706
|
-
readonly methodType?:
|
|
705
|
+
readonly methodType?: Type.Method;
|
|
707
706
|
}
|
|
708
707
|
|
|
709
708
|
/**
|
|
@@ -762,7 +761,7 @@ export namespace JS {
|
|
|
762
761
|
export interface TypeLiteral extends JS, TypeTree {
|
|
763
762
|
readonly kind: typeof Kind.TypeLiteral;
|
|
764
763
|
readonly members: J.Block;
|
|
765
|
-
readonly type?:
|
|
764
|
+
readonly type?: Type;
|
|
766
765
|
}
|
|
767
766
|
|
|
768
767
|
/**
|
|
@@ -772,7 +771,7 @@ export namespace JS {
|
|
|
772
771
|
export interface ArrayBindingPattern extends JS, TypedTree, VariableDeclarator {
|
|
773
772
|
readonly kind: typeof Kind.ArrayBindingPattern;
|
|
774
773
|
readonly elements: J.Container<Expression>;
|
|
775
|
-
readonly type?:
|
|
774
|
+
readonly type?: Type;
|
|
776
775
|
}
|
|
777
776
|
|
|
778
777
|
/**
|
|
@@ -784,7 +783,7 @@ export namespace JS {
|
|
|
784
783
|
readonly propertyName?: J.RightPadded<Expression>;
|
|
785
784
|
readonly name: TypedTree;
|
|
786
785
|
readonly initializer?: J.LeftPadded<Expression>;
|
|
787
|
-
readonly variableType?:
|
|
786
|
+
readonly variableType?: Type.Variable;
|
|
788
787
|
}
|
|
789
788
|
|
|
790
789
|
/**
|
|
@@ -818,7 +817,7 @@ export namespace JS {
|
|
|
818
817
|
export interface NamedExports extends JS {
|
|
819
818
|
readonly kind: typeof Kind.NamedExports;
|
|
820
819
|
readonly elements: J.Container<Expression>;
|
|
821
|
-
readonly type?:
|
|
820
|
+
readonly type?: Type;
|
|
822
821
|
}
|
|
823
822
|
|
|
824
823
|
/**
|
|
@@ -829,7 +828,7 @@ export namespace JS {
|
|
|
829
828
|
readonly kind: typeof Kind.ExportSpecifier;
|
|
830
829
|
readonly typeOnly: J.LeftPadded<boolean>;
|
|
831
830
|
readonly specifier: Expression;
|
|
832
|
-
readonly type?:
|
|
831
|
+
readonly type?: Type;
|
|
833
832
|
}
|
|
834
833
|
}
|
|
835
834
|
|