🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Commit a561755

Browse files
nodejs-github-botRafaelGSS
authored andcommitted
deps: update amaro to 0.5.0
PR-URL: #57687 Fixes: #56830 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 98df744 commit a561755

6 files changed

Lines changed: 35 additions & 14 deletions

File tree

β€Ždeps/amaro/README.mdβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ console.log(code); // "const foo = 'bar';"
2929

3030
It is possible to use Amaro as an external loader to execute TypeScript files.
3131
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.
3233

3334
```bash
3435
node --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

β€Ždeps/amaro/dist/errors.jsβ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ export function isSwcError(error) {
33
return error.code !== void 0;
44
}
55
export 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
}

β€Ždeps/amaro/dist/index.jsβ€Ž

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždeps/amaro/dist/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"κ°•λ™μœ€ <kdy1997.dev@gmail.com>"
55
],
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",

β€Ždeps/amaro/package.jsonβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",
@@ -24,8 +24,8 @@
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",

β€Žsrc/amaro_version.hβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
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_

0 commit comments

Comments
Β (0)