Skip to content

Commit

Permalink
feat: update swc_core to 0.109 (#195)
Browse files Browse the repository at this point in the history
- Update swc_core to 0.109
- Update rust to nightly-2024-10-07
- rename wasi to wasip1

> the `wasm32-wasi` target is being renamed to `wasm32-wasip1` and the `wasm32-wasi` target will be removed from nightly in October 2024 and removed from stable Rust in January 2025

https://plugins.swc.rs/versions/range/16
  • Loading branch information
SevereCloud authored Oct 8, 2024
1 parent 1eb2ea1 commit 56a8c19
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These command aliases are not final, may change
[alias]
# Alias to build actual plugin binary for the specified target.
build-wasi = "build --target wasm32-wasi"
build-wasip1 = "build --target wasm32-wasip1"
build-wasm32 = "build --target wasm32-unknown-unknown"
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Install wasm target
run: |
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
- run: npm run test
- run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
- uses: VKCOM/gh-actions/shared/rust/cargo-cache@main

- name: Run Build
run: cargo build-wasi --release
run: cargo build-wasip1 --release


26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path-absolutize = { version = "3", features = ["use_unix_paths_on_wasm"] }

serde = "1"
serde_json = "1"
swc_core = { version = "0.106", features = [
swc_core = { version = "0.109", features = [
"ecma_plugin_transform",
"ecma_parser",
] }
Expand All @@ -26,5 +26,5 @@ ts-rs = "10"
[dev-dependencies]
testing = "0.42"
# .cargo/config defines few alias to build plugin.
# cargo build-wasi generates wasm-wasi32 binary
# cargo build-wasip1 generates wasm-wasi32 binary
# cargo build-wasm32 generates wasm32-unknown-unknown binary.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"types": "./bindings/types.d.ts",
"scripts": {
"prepack": "npm run build",
"build": "cargo build-wasi --release",
"postbuild": "cp target/wasm32-wasi/release/swc_plugin_pre_paths.wasm .",
"build": "cargo build-wasip1 --release",
"postbuild": "cp target/wasm32-wasip1/release/swc_plugin_pre_paths.wasm .",
"test": "cargo test",
"lint": "cargo clippy --all-targets --all-features"
},
Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-06-02"
channel = "nightly-2024-10-07"
components = ["clippy", "rustfmt"]
targets = ["wasm32-wasi"]
targets = ["wasm32-wasip1"]
profile = "minimal"
3 changes: 2 additions & 1 deletion src/injector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ fn get_dir(mut context: PathBuf, filepath: PathBuf) -> PathBuf {
}

context.push(filepath);
return context.parent().unwrap().to_path_buf();

context.parent().unwrap().to_path_buf()
}

pub struct Injector {
Expand Down

0 comments on commit 56a8c19

Please sign in to comment.