From 6b0027c077a61d380522f10e650375126e35c8f1 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 24 Nov 2025 06:52:00 +0100 Subject: [PATCH 1/2] chore: update ubuntu image and use nvmrc --- .github/workflows/audit.yml | 4 ++-- .github/workflows/build-swc.yml | 5 ++--- .github/workflows/update-swc.yml | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 2e4a2a457..b4b05d0c0 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -14,7 +14,7 @@ on: jobs: rust-audit: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 @@ -23,7 +23,7 @@ jobs: manifest-path: "deps/swc/bindings/binding_typescript_wasm/Cargo.toml" typescript-audit: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest permissions: security-events: write packages: read diff --git a/.github/workflows/build-swc.yml b/.github/workflows/build-swc.yml index 30ca52cda..85a168753 100644 --- a/.github/workflows/build-swc.yml +++ b/.github/workflows/build-swc.yml @@ -6,9 +6,6 @@ on: - 'tools/*' - 'deps/*' -env: - NODE_VERSION: lts/* - jobs: build-swc: runs-on: ubuntu-latest @@ -18,6 +15,8 @@ jobs: - name: Set up Node.js uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version-file: '.nvmrc' - name: Set up Docker uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 diff --git a/.github/workflows/update-swc.yml b/.github/workflows/update-swc.yml index cba937a51..c7e4be972 100644 --- a/.github/workflows/update-swc.yml +++ b/.github/workflows/update-swc.yml @@ -9,9 +9,6 @@ on: schedule: - cron: '0 0 * * 1' # Every Monday at 00:00 UTC -env: - NODE_VERSION: lts/* - jobs: update-swc: runs-on: ubuntu-latest @@ -26,6 +23,8 @@ jobs: - name: Set up Node.js uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + with: + node-version-file: '.nvmrc' - name: Check if SWC update is required id: version-check From a17047317935836e7e0174bfe12f8993488ea924 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 24 Nov 2025 06:55:19 +0100 Subject: [PATCH 2/2] chore: update documentation to reflect changes in --experimental-strip-types --- README.md | 6 +++--- test/loader.test.js | 8 -------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 28b0347ba..0079b2880 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,12 @@ It is possible to use Amaro as an external loader to execute TypeScript files. This allows the installed Amaro to override the Amaro version used by Node.js. In order to use Amaro as an external loader, type stripping needs to be enabled. -In node v23 and later you can omit the `--experimental-strip-types` flag, as it is enabled by default. - ```bash -node --experimental-strip-types --import="amaro/strip" file.ts +node --import="amaro/strip" file.ts ``` +> In node v22.18.0 and later you can omit the `--experimental-strip-types` flag, as it is enabled by default. + Enabling TypeScript feature transformation: ```bash diff --git a/test/loader.test.js b/test/loader.test.js index 068471d2e..d3ed4a3c4 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -4,7 +4,6 @@ const { match, doesNotMatch, strictEqual } = require("node:assert"); test("should work as a loader", async () => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--no-warnings", "--import=./dist/register-strip.mjs", fixturesPath("hello.ts"), @@ -17,7 +16,6 @@ test("should work as a loader", async () => { test("should not work with enums", async (t) => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--no-warnings", "--import=./dist/register-strip.mjs", fixturesPath("enum.ts"), @@ -31,7 +29,6 @@ test("should not work with enums", async (t) => { test("should work with enums", async () => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--no-warnings", "--import=./dist/register-transform.mjs", fixturesPath("enum.ts"), @@ -44,7 +41,6 @@ test("should work with enums", async () => { test("should warn and inaccurate stracktrace", async () => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--import=./dist/register-transform.mjs", fixturesPath("stacktrace.ts"), ]); @@ -57,7 +53,6 @@ test("should warn and inaccurate stracktrace", async () => { test("should not warn and accurate stracktrace", async () => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--enable-source-maps", "--import=./dist/register-transform.mjs", fixturesPath("stacktrace.ts"), @@ -71,7 +66,6 @@ test("should not warn and accurate stracktrace", async () => { test("should call nextLoader for non-typescript files for striping", async () => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--no-warnings", "--import=./dist/register-strip.mjs", fixturesPath("hello.js"), @@ -84,7 +78,6 @@ test("should call nextLoader for non-typescript files for striping", async () => test("should call nextLoader for non-typescript files for transform", async () => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--no-warnings", "--import=./dist/register-transform.mjs", fixturesPath("hello.js"), @@ -97,7 +90,6 @@ test("should call nextLoader for non-typescript files for transform", async () = test("should throw syntax error for invalid typescript", async (t) => { const result = await spawnPromisified(process.execPath, [ - "--experimental-strip-types", "--no-warnings", "--import=./dist/register-strip.mjs", fixturesPath("invalid-syntax.ts"),