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';"
2929
3030It is possible to use Amaro as an external loader to execute TypeScript files.
3131This 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.
3233
3334``` bash
3435node --experimental-strip-types --import=" amaro/register" script.ts
@@ -51,7 +52,7 @@ node --experimental-transform-types --import="amaro/transform" script.ts
5152
5253### TypeScript Version
5354
54- The supported TypeScript version is 5.5.4, except the stage 3 decorator proposal .
55+ The supported TypeScript version is 5.8 .
5556
5657## License (MIT)
5758
Original file line number Diff line number Diff line change @@ -3,14 +3,19 @@ export function isSwcError(error) {
33 return error . code !== void 0 ;
44}
55export function wrapAndReThrowSwcError ( error ) {
6+ const errorHints = `${ error . filename } :${ error . startLine } ${ error . snippet } ` ;
67 switch ( error . code ) {
78 case "UnsupportedSyntax" : {
89 const unsupportedSyntaxError = new Error ( error . message ) ;
910 unsupportedSyntaxError . name = "UnsupportedSyntaxError" ;
11+ unsupportedSyntaxError . stack = `${ errorHints } ${ unsupportedSyntaxError . stack } ` ;
1012 throw unsupportedSyntaxError ;
1113 }
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+ }
1419 default :
1520 throw new Error ( error . message ) ;
1621 }
Original file line number Diff line number Diff line change 4455 ],
66 "description" : " wasm module for swc" ,
7- "version" : " 1.11.5 " ,
7+ "version" : " 1.11.12 " ,
88 "license" : " Apache-2.0" ,
99 "repository" : {
1010 "type" : " git" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " amaro" ,
3- "version" : " 0.4.1 " ,
3+ "version" : " 0.5.0 " ,
44 "description" : " Node.js TypeScript wrapper" ,
55 "license" : " MIT" ,
66 "type" : " commonjs" ,
2424 "build" : " node esbuild.config.mjs" ,
2525 "build:wasm" : " node tools/build-wasm.js" ,
2626 "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\" "
2929 },
3030 "devDependencies" : {
3131 "@biomejs/biome" : " 1.8.3" ,
Original file line number Diff line number Diff line change 22// Refer to tools/dep_updaters/update-amaro.sh
33#ifndef SRC_AMARO_VERSION_H_
44#define SRC_AMARO_VERSION_H_
5- #define AMARO_VERSION "0.4.1 "
5+ #define AMARO_VERSION "0.5.0 "
66#endif // SRC_AMARO_VERSION_H_
You can’t perform that action at this time.
0 commit comments