diff --git a/.github/workflows/update-swc.yml b/.github/workflows/update-swc.yml index dcae496d5..24ef76cce 100644 --- a/.github/workflows/update-swc.yml +++ b/.github/workflows/update-swc.yml @@ -27,7 +27,7 @@ jobs: - name: Check if SWC update is required id: version-check run: | - CURRENT_SWC_VERSION=$(cat lib/swc/package.json | jq -r '.version') + CURRENT_SWC_VERSION=$(cat lib/package.json | jq -r '.version') if [[ -n "${{ github.event.inputs.swc_version }}" ]]; then NEW_SWC_VERSION="${{ github.event.inputs.swc_version }}" else diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..2bd5a0a98 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/lib/swc/README.md b/lib/README.md similarity index 100% rename from lib/swc/README.md rename to lib/README.md diff --git a/lib/swc/package.json b/lib/package.json similarity index 100% rename from lib/swc/package.json rename to lib/package.json diff --git a/lib/swc/wasm.d.ts b/lib/wasm.d.ts similarity index 100% rename from lib/swc/wasm.d.ts rename to lib/wasm.d.ts diff --git a/lib/swc/wasm.js b/lib/wasm.js similarity index 100% rename from lib/swc/wasm.js rename to lib/wasm.js diff --git a/lib/swc/wasm_bg.wasm.d.ts b/lib/wasm_bg.wasm.d.ts similarity index 100% rename from lib/swc/wasm_bg.wasm.d.ts rename to lib/wasm_bg.wasm.d.ts diff --git a/src/index.ts b/src/index.ts index 93f064486..fb27b67ff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -import type { Options, TransformOutput } from "../lib/swc/wasm.d.ts"; -import swc from "../lib/swc/wasm.js"; +import type { Options, TransformOutput } from "../lib/wasm"; +import swc from "../lib/wasm.js"; const DEFAULT_OPTIONS: Options = { mode: "strip-only", diff --git a/tools/build-wasm.js b/tools/build-wasm.js index 3b639508d..ca7d25a88 100644 --- a/tools/build-wasm.js +++ b/tools/build-wasm.js @@ -4,7 +4,7 @@ const { resolve } = require("node:path"); const ROOT = resolve(__dirname, "../"); const DOCKERFILE = resolve(__dirname, "./Dockerfile"); -const name = "swc_build_wasm"; +const name = `swc_build_wasm-${Date.now()}`; const buildArgs = [ "build", @@ -20,7 +20,7 @@ const runArgs = ["run", "-d", "--name", name, "swc_wasm_typescript"]; execFileSync("docker", runArgs, { stdio: "inherit" }); // Copies the new directory inside the Docker image to the host. -const copyArgs = ["cp", `${name}:/usr/src/amaro/swc`, `${ROOT}/lib`]; +const copyArgs = ["cp", `${name}:/usr/src/amaro/swc/.`, `${ROOT}/lib/`]; execFileSync("docker", copyArgs, { stdio: "inherit" }); // Removes the Docker image.