From 3de9c2aa71df9a5001a8f735f22d54161113f162 Mon Sep 17 00:00:00 2001
From: yushijie1 <yushijie1@jd.com>
Date: Mon, 13 Jan 2025 13:41:20 +0800
Subject: [PATCH] =?UTF-8?q?chore(rust):=20=E4=BD=BF=E7=94=A8wasm32-wasip1?=
 =?UTF-8?q?=E4=BB=A3=E6=9B=BFwasm32-wasi,=E8=A7=A3=E5=86=B3=E7=BC=96?=
 =?UTF-8?q?=E8=AF=91=E5=87=BA=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .cargo/config.toml                    | 2 +-
 .github/workflows/build-rust-wasm.yml | 4 ++--
 .github/workflows/nodejs.yml          | 2 +-
 CONTRIBUTING.md                       | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.cargo/config.toml b/.cargo/config.toml
index 73aaed3491f0..0ab34b12f451 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -18,7 +18,7 @@ rustflags = ["-C", "target-feature=+crt-static"]
 
 [alias]
 # Alias to build actual SWC plugin binary for the specified target.
-build-wasi = "build --target wasm32-wasi"
+build-wasi = "build --target wasm32-wasip1"
 build-wasm32 = "build --target wasm32-unknown-unknown"
 build-swc-plugins = "build-wasi --release -p swc_plugin_compile_mode -p swc_plugin_define_config -p swc_plugin_compile_mode_pre_process"
 test-swc-plugins = "test -p swc_plugin_compile_mode -p swc_plugin_define_config -p swc_plugin_compile_mode_pre_process"
diff --git a/.github/workflows/build-rust-wasm.yml b/.github/workflows/build-rust-wasm.yml
index 7278ee0dc42a..3ff28543f86f 100644
--- a/.github/workflows/build-rust-wasm.yml
+++ b/.github/workflows/build-rust-wasm.yml
@@ -16,7 +16,7 @@ jobs:
         uses: dtolnay/rust-toolchain@stable
         with:
           toolchain: stable
-          targets: wasm32-wasi
+          targets: wasm32-wasip1
       - name: Cache cargo
         uses: actions/cache@v3
         with:
@@ -33,5 +33,5 @@ jobs:
         uses: actions/upload-artifact@v4
         with:
           name: wasm-wasi-swc_plugins
-          path: target/wasm32-wasi/release/*.wasm
+          path: target/wasm32-wasip1/release/*.wasm
           if-no-files-found: error
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index b55bef9e5c0c..43eadb826fb2 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -164,7 +164,7 @@ jobs:
         uses: dtolnay/rust-toolchain@stable
         with:
           toolchain: stable
-          targets: wasm32-wasi
+          targets: wasm32-wasip1
       - name: Cache cargo
         uses: actions/cache@v3
         with:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 67574c6f0615..88af558cb3c8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -185,7 +185,7 @@ $ pnpm --filter @tarojs/binding run test
 
 #### SWC 插件
 
-首先在项目根目录执行 `rustup target add wasm32-wasi` 命令安装 `wasm32-wasi` 的 `target`。
+首先在项目根目录执行 `rustup target add wasm32-wasip1` 命令安装 `wasm32-wasip1` 的 `target`。
 
 开发过程中可以使用 SWC 测试套件进行单元测试:
 
@@ -207,7 +207,7 @@ $ cargo build -p [package-name]
 
 Cargo workspace 会把编译产物输出到根目录的 `target` 文件夹中。进行集成测试时,需要手动把 `.wasm` 产物软链到目标文件夹,而 Github CI 在正式发布时会自动拷贝产物到正确的文件夹中。
 
-如对 `@taorjs/helper` 进行集成测试时,会把 `target/wasm32-wasi/release/swc_plugin_xxx.wasm` 文件的软链到 `packages/taro-helper/swc/swc_plugin_xxx.wasm`。
+如对 `@taorjs/helper` 进行集成测试时,会把 `target/wasm32-wasip1/release/swc_plugin_xxx.wasm` 文件的软链到 `packages/taro-helper/swc/swc_plugin_xxx.wasm`。
 
 ####