File tree Expand file tree Collapse file tree 6 files changed +35
-14
lines changed Expand file tree Collapse file tree 6 files changed +35
-14
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ console.log(code); // "const foo = 'bar';"
29
29
30
30
It is possible to use Amaro as an external loader to execute TypeScript files.
31
31
This allows the installed Amaro to override the Amaro version used by Node.js.
32
+ In order to use Amaro as an external loader, type stripping needs to be enabled.
32
33
33
34
``` bash
34
35
node --experimental-strip-types --import=" amaro/register" script.ts
@@ -51,7 +52,7 @@ node --experimental-transform-types --import="amaro/transform" script.ts
51
52
52
53
### TypeScript Version
53
54
54
- The supported TypeScript version is 5.5.4, except the stage 3 decorator proposal .
55
+ The supported TypeScript version is 5.8 .
55
56
56
57
## License (MIT)
57
58
Original file line number Diff line number Diff line change @@ -3,14 +3,19 @@ export function isSwcError(error) {
3
3
return error . code !== void 0 ;
4
4
}
5
5
export function wrapAndReThrowSwcError ( error ) {
6
+ const errorHints = `${ error . filename } :${ error . startLine } ${ error . snippet } ` ;
6
7
switch ( error . code ) {
7
8
case "UnsupportedSyntax" : {
8
9
const unsupportedSyntaxError = new Error ( error . message ) ;
9
10
unsupportedSyntaxError . name = "UnsupportedSyntaxError" ;
11
+ unsupportedSyntaxError . stack = `${ errorHints } ${ unsupportedSyntaxError . stack } ` ;
10
12
throw unsupportedSyntaxError ;
11
13
}
12
- case "InvalidSyntax" :
13
- throw new SyntaxError ( error . message ) ;
14
+ case "InvalidSyntax" : {
15
+ const syntaxError = new SyntaxError ( error . message ) ;
16
+ syntaxError . stack = `${ errorHints } ${ syntaxError . stack } ` ;
17
+ throw syntaxError ;
18
+ }
14
19
default :
15
20
throw new Error ( error . message ) ;
16
21
}
Original file line number Diff line number Diff line change 4
4
" 강동윤 <kdy1997.dev@gmail.com>"
5
5
],
6
6
"description" : " wasm module for swc" ,
7
- "version" : " 1.11.5 " ,
7
+ "version" : " 1.11.12 " ,
8
8
"license" : " Apache-2.0" ,
9
9
"repository" : {
10
10
"type" : " git" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " amaro" ,
3
- "version" : " 0.4.1 " ,
3
+ "version" : " 0.5.0 " ,
4
4
"description" : " Node.js TypeScript wrapper" ,
5
5
"license" : " MIT" ,
6
6
"type" : " commonjs" ,
24
24
"build" : " node esbuild.config.mjs" ,
25
25
"build:wasm" : " node tools/build-wasm.js" ,
26
26
"typecheck" : " tsc --noEmit" ,
27
- "test" : " node --test --experimental-test-snapshots \" **/*.test.js\" " ,
28
- "test:regenerate" : " node --test --experimental-test-snapshots -- test-update-snapshots \" **/*.test.js\" "
27
+ "test" : " node --test \" **/*.test.js\" " ,
28
+ "test:regenerate" : " node --test --test-update-snapshots \" **/*.test.js\" "
29
29
},
30
30
"devDependencies" : {
31
31
"@biomejs/biome" : " 1.8.3" ,
Original file line number Diff line number Diff line change 2
2
// Refer to tools/dep_updaters/update-amaro.sh
3
3
#ifndef SRC_AMARO_VERSION_H_
4
4
#define SRC_AMARO_VERSION_H_
5
- #define AMARO_VERSION "0.4.1 "
5
+ #define AMARO_VERSION "0.5.0 "
6
6
#endif // SRC_AMARO_VERSION_H_
You can’t perform that action at this time.
0 commit comments