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

Commit 9e014d1

Browse files
authored
new: Prepare for proto v0.14 release. (#3)
1 parent 6b6fd7f commit 9e014d1

File tree

9 files changed

+24
-27
lines changed

9 files changed

+24
-27
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
steps:
1818
- uses: actions/checkout@v3
19-
- uses: moonrepo/setup-rust@v0
19+
- uses: moonrepo/setup-rust@v1
2020
with:
2121
components: rustfmt
2222
- run: cargo fmt --all --check
@@ -29,7 +29,7 @@ jobs:
2929
fail-fast: false
3030
steps:
3131
- uses: actions/checkout@v3
32-
- uses: moonrepo/setup-rust@v0
32+
- uses: moonrepo/setup-rust@v1
3333
with:
3434
components: clippy
3535
- run: cargo clippy --workspace --all-targets
@@ -42,8 +42,8 @@ jobs:
4242
fail-fast: false
4343
steps:
4444
- uses: actions/checkout@v3
45-
- uses: moonrepo/setup-rust@v0
45+
- uses: moonrepo/setup-rust@v1
4646
with:
4747
bins: cargo-wasi, cargo-nextest
48-
- run: cargo wasi build -p bun_plugin
48+
- run: cargo wasi build
4949
- run: cargo nextest run

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.1.0
4+
5+
#### 🚀 Updates
6+
7+
- Updated to support proto v0.14 release.
8+
39
## 0.0.3
410

511
#### 🚀 Updates

Cargo.toml

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ crate-type = ['cdylib']
1010

1111
[dependencies]
1212
extism-pdk = "0.3.3"
13-
proto_pdk = "0.2.3"
14-
serde = "1.0.167"
13+
proto_pdk = "0.4.1"
14+
serde = "1.0.183"
1515

1616
[dev-dependencies]
17-
proto_core = "0.12.2"
18-
proto_pdk_test_utils = "0.1.3"
19-
starbase_sandbox = "0.1.5"
17+
proto_pdk_test_utils = "0.3.3"
18+
starbase_sandbox = "0.1.8"
2019
tokio = "1.29.1"

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
profile = "default"
3-
channel = "1.70.0"
3+
channel = "1.71.1"

src/proto.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,10 @@ pub fn download_prebuilt(
5959
#[plugin_fn]
6060
pub fn locate_bins(Json(input): Json<LocateBinsInput>) -> FnResult<Json<LocateBinsOutput>> {
6161
Ok(Json(LocateBinsOutput {
62-
bin_path: Some(if input.env.os == HostOS::Windows {
63-
format!("{}.exe", BIN) // Not supported yet
64-
} else {
65-
BIN.to_owned()
66-
}),
62+
bin_path: Some(format_bin_name(BIN, input.env.os).into()),
6763
fallback_last_globals_dir: true,
6864
globals_lookup_dirs: vec!["$HOME/.bun/bin".into()],
65+
..LocateBinsOutput::default()
6966
}))
7067
}
7168

tests/download_test.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use proto_pdk::*;
2-
use proto_pdk_test_utils::{create_plugin, generate_download_install_tests};
1+
use proto_pdk_test_utils::*;
32
use starbase_sandbox::create_empty_sandbox;
43
use std::path::PathBuf;
54

@@ -22,7 +21,6 @@ fn supports_linux_arm64() {
2221
}),
2322
DownloadPrebuiltOutput {
2423
archive_prefix: Some("bun-linux-aarch64".into()),
25-
bin_path: None,
2624
checksum_name: None,
2725
checksum_url: Some(
2826
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
@@ -51,7 +49,6 @@ fn supports_linux_x64() {
5149
}),
5250
DownloadPrebuiltOutput {
5351
archive_prefix: Some("bun-linux-x64".into()),
54-
bin_path: None,
5552
checksum_name: None,
5653
checksum_url: Some(
5754
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
@@ -80,7 +77,6 @@ fn supports_macos_arm64() {
8077
}),
8178
DownloadPrebuiltOutput {
8279
archive_prefix: Some("bun-darwin-aarch64".into()),
83-
bin_path: None,
8480
checksum_name: None,
8581
checksum_url: Some(
8682
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
@@ -109,7 +105,6 @@ fn supports_macos_x64() {
109105
}),
110106
DownloadPrebuiltOutput {
111107
archive_prefix: Some("bun-darwin-x64".into()),
112-
bin_path: None,
113108
checksum_name: None,
114109
checksum_url: Some(
115110
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
@@ -123,7 +118,7 @@ fn supports_macos_x64() {
123118
}
124119

125120
#[test]
126-
#[should_panic(expected = "Unable to install Bun, unsupported OS windows.")]
121+
#[should_panic(expected = "Unable to install Bun")]
127122
fn doesnt_support_windows() {
128123
let sandbox = create_empty_sandbox();
129124
let plugin = create_plugin("bun-test", sandbox.path());
@@ -152,6 +147,7 @@ fn locates_unix_bin() {
152147
version: "1.2.0".into(),
153148
..Default::default()
154149
},
150+
home_dir: PathBuf::new(),
155151
tool_dir: PathBuf::new()
156152
})
157153
.bin_path,
@@ -173,6 +169,7 @@ fn locates_windows_bin() {
173169
version: "1.2.0".into(),
174170
..Default::default()
175171
},
172+
home_dir: PathBuf::new(),
176173
tool_dir: PathBuf::new()
177174
})
178175
.bin_path,

tests/metadata_test.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use proto_pdk::*;
2-
use proto_pdk_test_utils::create_plugin;
1+
use proto_pdk_test_utils::*;
32
use starbase_sandbox::create_empty_sandbox;
43

54
#[test]

tests/shims_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use proto_pdk_test_utils::{create_plugin, generate_global_shims_test};
1+
use proto_pdk_test_utils::*;
22
use starbase_sandbox::{assert_snapshot, create_empty_sandbox};
33

44
#[cfg(not(windows))]

tests/versions_test.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use proto_pdk::*;
2-
use proto_pdk_test_utils::{create_plugin, generate_resolve_versions_tests};
1+
use proto_pdk_test_utils::*;
32
use starbase_sandbox::create_empty_sandbox;
43

54
generate_resolve_versions_tests!("bun-test", {

0 commit comments

Comments
 (0)