Skip to content

deps: update amaro to 0.4.1 #57121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions deps/amaro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,9 @@ node --experimental-transform-types --import="amaro/transform" script.ts
> Note that the "amaro/transform" loader should be used with `--experimental-transform-types` flag, or
> at least with `--enable-source-maps` flag, to preserve the original source maps.

### How to update SWC

To update the SWC version, run:

```shell
./tools/update-swc.sh
git add deps
git commit -m "chore: update swc to vX.Y.Z"
```

Once you have updated the rust source code we must build the wasm.
To build the wasm it is necessary to have Docker installed.

```shell
node ./tools/build-wasm.js
git add lib
git commit -m "chore: build wasm from swc vX.Y.Z"
```

### TypeScript Version

The supported TypeScript version is 5.5.4.
The supported TypeScript version is 5.5.4, except the stage 3 decorator proposal.

## License (MIT)

Expand Down
75 changes: 40 additions & 35 deletions deps/amaro/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/amaro/dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"강동윤 <[email protected]>"
],
"description": "wasm module for swc",
"version": "1.10.14",
"version": "1.11.5",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion deps/amaro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amaro",
"version": "0.3.2",
"version": "0.4.1",
"description": "Node.js TypeScript wrapper",
"license": "MIT",
"type": "commonjs",
Expand Down
2 changes: 1 addition & 1 deletion src/amaro_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-amaro.sh
#ifndef SRC_AMARO_VERSION_H_
#define SRC_AMARO_VERSION_H_
#define AMARO_VERSION "0.3.2"
#define AMARO_VERSION "0.4.1"
#endif // SRC_AMARO_VERSION_H_
20 changes: 20 additions & 0 deletions test/es-module/test-typescript-eval.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,23 @@ test('check syntax error is thrown when passing invalid syntax with --input-type
match(result.stderr, /ERR_INVALID_TYPESCRIPT_SYNTAX/);
strictEqual(result.code, 1);
});

test('should not allow module keyword', async () => {
const result = await spawnPromisified(process.execPath, [
'--input-type=module-typescript',
'--eval',
'module F { export type x = number }']);
strictEqual(result.stdout, '');
match(result.stderr, /ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX/);
strictEqual(result.code, 1);
});

test('should not allow declare module keyword', async () => {
const result = await spawnPromisified(process.execPath, [
'--input-type=module-typescript',
'--eval',
'declare module F { export type x = number }']);
strictEqual(result.stdout, '');
match(result.stderr, /ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX/);
strictEqual(result.code, 1);
});
7 changes: 4 additions & 3 deletions test/es-module/test-typescript-transform.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ test('execute a TypeScript file with legacy-module', async () => {
fixtures.path('typescript/ts/transformation/test-legacy-module.ts'),
]);

strictEqual(result.stderr, '');
match(result.stdout, /Hello, TypeScript!/);
strictEqual(result.code, 0);
match(result.stderr, /ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX/);
match(result.stderr, /`module` keyword is not supported\. Use `namespace` instead/);
strictEqual(result.stdout, '');
strictEqual(result.code, 1);
});

test('execute a TypeScript file with modern typescript syntax', async () => {
Expand Down
Loading