Skip to content

Commit

Permalink
Upgrade Javet, node, V8, tsc and node-gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
ammachado committed Oct 20, 2023
1 parent 7d4d532 commit 1fada0c
Show file tree
Hide file tree
Showing 17 changed files with 40,294 additions and 37,294 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ dependencies {

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")

implementation("com.caoccao.javet:javet-macos:2.1.2") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet:2.1.2") // Linux and Windows
implementation("com.caoccao.javet:javet-macos:3.0.0") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet:3.0.0") // Linux and Windows
}

tasks.withType<Javadoc> {
Expand Down
2 changes: 1 addition & 1 deletion js/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.15.0
20.8.0
6 changes: 3 additions & 3 deletions js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("com.github.node-gradle.node") version "3.5.1"
id("com.github.node-gradle.node") version "7.0.1"
}

apply(plugin = "base")
Expand All @@ -8,8 +8,8 @@ apply(plugin = "com.github.node-gradle.node")
group = "org.openrewrite"

node {
version.set("18.15.0")
npmVersion.set("9.5.0")
version.set("20.8.0")
npmVersion.set("10.1.0")
download.set(true)
}

Expand Down
10 changes: 5 additions & 5 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"format": "prettier --write ./src"
},
"devDependencies": {
"@types/node": "^18.15.11",
"parcel": "^2.8.3",
"prettier": "^2.8.8",
"@types/node": "^20.8.0",
"parcel": "^2.10.0",
"prettier": "^3.0.3",
"process": "^0.11.10",
"ts-node": "^10.9.1"
},
"dependencies": {
"@typescript/vfs": "^1.4.0",
"typescript": "^5.0.4"
"@typescript/vfs": "^1.5.0",
"typescript": "^5.2.2"
}
}
1,170 changes: 616 additions & 554 deletions js/yarn.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/main/java/com/caoccao/javet/interop/JavetBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public final class JavetBridge {
private JavetBridge() {}

public static Map<Long, IV8ValueReference> getReferenceMapSnapshot(V8Runtime runtime) {
synchronized (runtime.referenceLock) {
return new HashMap<>(runtime.referenceMap);
}
return new HashMap<>(runtime.referenceMap);
}

public static V8Runtime makeWrappedV8Runtime() {
Expand Down
143 changes: 0 additions & 143 deletions src/main/java/org/openrewrite/javascript/TypeScriptTypeGoat.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static void actuallyInit() {
try {
System.err.printf(" tmp path: %s%n", tempFile.getAbsolutePath());
System.err.printf(" tmp exists: %s%n", tempFile.exists());
System.err.printf(" tmp size: %s%n", tempFile.length());
System.err.printf(" tmp size: %s%n", tempFile.length());
} catch (Throwable ignored) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ private J visitDefaultClause(TSCNode node) {
null,
JContainer.build(
EMPTY,
singletonList(JRightPadded.build(new J.Identifier(randomId(), sourceBefore(TSCSyntaxKind.DefaultKeyword), Markers.EMPTY, "default", null, null))),
singletonList(JRightPadded.build(new J.Identifier(randomId(), sourceBefore(TSCSyntaxKind.DefaultKeyword), Markers.EMPTY, emptyList(), "default", null, null))),
Markers.EMPTY
),
JContainer.build(
Expand Down Expand Up @@ -1264,6 +1264,7 @@ private J.Identifier visitIdentifier(TSCNode node, @Nullable JavaType type, @Nul
randomId(),
prefix,
Markers.EMPTY,
emptyList(),
node.getText(),
type == null ? typeMapping.type(node) : type,
fieldType
Expand Down Expand Up @@ -3180,7 +3181,7 @@ private <J2 extends J> List<JRightPadded<J2>> convertAll(List<TSCNode> elements,
* @return a J.Identifier representing the String.
*/
private J.Identifier convertToIdentifier(Space prefix, String simpleName) {
return new J.Identifier(randomId(), prefix, Markers.EMPTY, simpleName, null, null);
return new J.Identifier(randomId(), prefix, Markers.EMPTY, emptyList(), simpleName, null, null);
}

private J.Literal mapKeywordToLiteralType(TSCNode node) {
Expand Down Expand Up @@ -3332,32 +3333,32 @@ private List<J.Modifier> mapModifiers(@Nullable List<TSCNode> nodes, List<J.Anno
// Keywords that exist in J.
case AbstractKeyword:
consumeToken(TSCSyntaxKind.AbstractKeyword);
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, J.Modifier.Type.Abstract, annotations == null ? emptyList() : annotations));
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, null, J.Modifier.Type.Abstract, annotations == null ? emptyList() : annotations));
annotations = null;
break;
case AsyncKeyword:
consumeToken(TSCSyntaxKind.AsyncKeyword);
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, J.Modifier.Type.Async, annotations == null ? emptyList() : annotations));
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, null, J.Modifier.Type.Async, annotations == null ? emptyList() : annotations));
annotations = null;
break;
case PublicKeyword:
consumeToken(TSCSyntaxKind.PublicKeyword);
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, J.Modifier.Type.Public, annotations == null ? emptyList() : annotations));
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, null, J.Modifier.Type.Public, annotations == null ? emptyList() : annotations));
annotations = null;
break;
case PrivateKeyword:
consumeToken(TSCSyntaxKind.PrivateKeyword);
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, J.Modifier.Type.Private, annotations == null ? emptyList() : annotations));
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, null, J.Modifier.Type.Private, annotations == null ? emptyList() : annotations));
annotations = null;
break;
case ProtectedKeyword:
consumeToken(TSCSyntaxKind.ProtectedKeyword);
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, J.Modifier.Type.Protected, annotations == null ? emptyList() : annotations));
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, null, J.Modifier.Type.Protected, annotations == null ? emptyList() : annotations));
annotations = null;
break;
case StaticKeyword:
consumeToken(TSCSyntaxKind.StaticKeyword);
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, J.Modifier.Type.Static, annotations == null ? emptyList() : annotations));
modifiers.add(new J.Modifier(randomId(), prefix, Markers.EMPTY, null, J.Modifier.Type.Static, annotations == null ? emptyList() : annotations));
annotations = null;
break;
default:
Expand Down Expand Up @@ -3437,7 +3438,7 @@ private Space sourceBefore(TSCSyntaxKind syntaxKind) {
* whitespace and comments.
*/
private Space whitespace() {
String initialSpace = "";
StringBuilder initialSpace = new StringBuilder();
List<Comment> comments = Collections.emptyList();
TSCSyntaxKind kind;
boolean done = false;
Expand All @@ -3447,7 +3448,7 @@ private Space whitespace() {
case WhitespaceTrivia:
case NewLineTrivia: {
if (comments.isEmpty()) {
initialSpace += lastToken();
initialSpace.append(lastToken());
} else {
comments = ListUtils.map(
comments,
Expand Down Expand Up @@ -3479,7 +3480,7 @@ private Space whitespace() {
break;
}
} while (!done);
return Space.build(initialSpace, comments);
return Space.build(initialSpace.toString(), comments);
}

private J unknown(TSCNode node) {
Expand Down
Loading

0 comments on commit 1fada0c

Please sign in to comment.