From cce152411ab5655a164266deb9c546797458b6bd Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Sat, 20 Apr 2024 16:45:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=83=20docs:=20Update=20docs=20for=20v0?= =?UTF-8?q?.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- docs/tutorials/tutorial_01_run_typescript.md | 2 +- docs/tutorials/tutorial_02_transpile_jsx.md | 2 +- docs/tutorials/tutorial_03_tokens.md | 2 +- docs/tutorials/tutorial_04_ast.md | 2 +- scripts/ts/change_swc4j_version.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e8473544..403cce54 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,18 @@ com.caoccao.javet swc4j - 0.3.0 + 0.4.0 ``` ```kotlin // Gradle Kotlin DSL -implementation("com.caoccao.javet:swc4j:0.3.0") +implementation("com.caoccao.javet:swc4j:0.4.0") ``` ```groovy // Gradle Groovy DSL -implementation 'com.caoccao.javet:swc4j:0.3.0' +implementation 'com.caoccao.javet:swc4j:0.4.0' ``` * Run the following Java code. @@ -46,7 +46,7 @@ implementation 'com.caoccao.javet:swc4j:0.3.0' // Prepare a simple TypeScript code snippet. String code = "function add(a:number, b:number) { return a+b; }"; // Prepare a script name. -String specifier = "file:///abc.ts"; +URL specifier = new URL("file://abc.ts"); // Prepare an option with script name and media type. Swc4jTranspileOptions options = new Swc4jTranspileOptions() .setSpecifier(specifier) diff --git a/docs/tutorials/tutorial_01_run_typescript.md b/docs/tutorials/tutorial_01_run_typescript.md index 4a197672..02581f2d 100644 --- a/docs/tutorials/tutorial_01_run_typescript.md +++ b/docs/tutorials/tutorial_01_run_typescript.md @@ -21,7 +21,7 @@ Swc4j swc4j = new Swc4j(); // Prepare a simple TypeScript code snippet. String code = "function add(a:number, b:number) { return a+b; }"; // Prepare a script name. -String specifier = "file:///abc.ts"; +URL specifier = new URL("file://abc.ts"); // Prepare an option with script name and media type. Swc4jTranspileOptions options = new Swc4jTranspileOptions() .setSpecifier(specifier) diff --git a/docs/tutorials/tutorial_02_transpile_jsx.md b/docs/tutorials/tutorial_02_transpile_jsx.md index ad5dc7e6..dccd9b88 100644 --- a/docs/tutorials/tutorial_02_transpile_jsx.md +++ b/docs/tutorials/tutorial_02_transpile_jsx.md @@ -22,7 +22,7 @@ String code = "import React from 'react';\n" + "}\n" + "export default App;"; // Prepare a script name. -String specifier = "file:///abc.ts"; +URL specifier = new URL("file://abc.ts"); // Prepare an option with script name and media type. Swc4jTranspileOptions options = new Swc4jTranspileOptions() .setSpecifier(specifier) diff --git a/docs/tutorials/tutorial_03_tokens.md b/docs/tutorials/tutorial_03_tokens.md index 650d4830..8645f1c9 100644 --- a/docs/tutorials/tutorial_03_tokens.md +++ b/docs/tutorials/tutorial_03_tokens.md @@ -33,7 +33,7 @@ String code = "function quickSort(arr: number[]): number[] {\n" + " return [...quickSort(leftArr), pivot, ...quickSort(rightArr)];\n" + "}"; // Prepare a script name. -String specifier = "file:///abc.ts"; +URL specifier = new URL("file://abc.ts"); // Prepare an option with script name and media type. Swc4jTranspileOptions options = new Swc4jTranspileOptions() .setSpecifier(specifier) diff --git a/docs/tutorials/tutorial_04_ast.md b/docs/tutorials/tutorial_04_ast.md index 6e2d0381..a0fb62b7 100644 --- a/docs/tutorials/tutorial_04_ast.md +++ b/docs/tutorials/tutorial_04_ast.md @@ -27,7 +27,7 @@ String code = "import { Validator } from './Validator';\n" + "\n" + "export { EmailValidator };"; // Prepare a script name. -String specifier = "file:///abc.ts"; +URL specifier = new URL("file://abc.ts"); // Prepare an option with script name and media type. Swc4jTranspileOptions options = new Swc4jTranspileOptions() .setSpecifier(specifier) diff --git a/scripts/ts/change_swc4j_version.ts b/scripts/ts/change_swc4j_version.ts index f42bb9d4..f56b8fcc 100644 --- a/scripts/ts/change_swc4j_version.ts +++ b/scripts/ts/change_swc4j_version.ts @@ -112,5 +112,5 @@ class ChangeSwc4jVersion { } } -const changeSwc4jVersion = new ChangeSwc4jVersion('0.3.0', '0.4.0'); +const changeSwc4jVersion = new ChangeSwc4jVersion('0.4.0', '0.4.0'); changeSwc4jVersion.change()