Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
new: Support Yarn v4. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Oct 23, 2023
1 parent 9139fe6 commit beeb4c2
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 47 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
components: rustfmt
Expand All @@ -28,7 +28,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
components: clippy
Expand All @@ -41,11 +41,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
bins: cargo-wasi, cargo-nextest
- uses: moonrepo/setup-proto@v1
- uses: moonrepo/setup-toolchain@v0
- run: cargo wasi build -p node_plugin
- run: cargo wasi build -p node_depman_plugin
- run: cargo nextest run --workspace
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.4.2

#### 🚀 Updates

- Support Yarn v4.

#### 🐞 Fixes

- Temporarily fixed an issue where calling `node` as a child process may fail.

## 0.4.1

#### 🐞 Fixes
Expand Down
48 changes: 24 additions & 24 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ members = ["crates/*"]

[workspace.dependencies]
extism-pdk = "0.3.4"
proto_pdk = { version = "0.8.0" } # , path = "../../proto/crates/pdk" }
proto_pdk_api = { version = "0.8.0" } # , path = "../../proto/crates/pdk-api" }
proto_pdk_test_utils = { version = "0.8.2" } # , path = "../../proto/crates/pdk-test-utils" }
proto_pdk = { version = "0.8.1" } # , path = "../../proto/crates/pdk" }
proto_pdk_api = { version = "0.8.1" } # , path = "../../proto/crates/pdk-api" }
proto_pdk_test_utils = { version = "0.8.4" } # , path = "../../proto/crates/pdk-test-utils" }
serde = "1.0.189"
serde_json = "1.0.107"
starbase_sandbox = "0.1.11"
Expand Down
2 changes: 1 addition & 1 deletion crates/node-depman/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node_depman_plugin"
version = "0.4.1"
version = "0.4.2"
edition = "2021"
license = "MIT"
publish = false
Expand Down
25 changes: 12 additions & 13 deletions crates/node-depman/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,17 @@ pub fn resolve_version(

// Otherwise call the current `node` binary and infer from that
if !found_version {
let result = exec_command!("node", ["--version"]);

if result.exit_code == 0 {
let node_version = result.stdout.trim();

for node_release in &response {
// Both start with v
if node_release.version == node_version {
output.version = node_release.npm.clone();
found_version = true;
break;
if let Ok(result) = exec_command!(raw, "node", ["--version"]) {
if result.0.exit_code == 0 {
let node_version = result.0.stdout.trim();

for node_release in &response {
// Both start with v
if node_release.version == node_version {
output.version = node_release.npm.clone();
found_version = true;
break;
}
}
}
}
Expand All @@ -281,9 +281,8 @@ pub fn resolve_version(
}

PackageManager::Yarn => {
// Latest currently resolves to a v4-rc version...
if input.initial == "berry" || input.initial == "latest" {
output.candidate = Some("~3".into());
output.candidate = Some("~4".into());
} else if input.initial == "legacy" || input.initial == "classic" {
output.candidate = Some("~1".into());
}
Expand Down
2 changes: 1 addition & 1 deletion crates/node-depman/tests/versions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ mod yarn {
"1" => "1.22.19",
"2" => "2.4.3",
"3" => "3.6.4",
"berry" => "3.6.4",
"berry" => "4.0.0",
});

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node_plugin"
version = "0.4.1"
version = "0.4.2"
edition = "2021"
license = "MIT"
publish = false
Expand Down

0 comments on commit beeb4c2

Please sign in to comment.