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

Commit

Permalink
new: Prepare for proto v0.14 release. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Aug 8, 2023
1 parent 6b6fd7f commit 9e014d1
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v0
- uses: moonrepo/setup-rust@v1
with:
components: rustfmt
- run: cargo fmt --all --check
Expand All @@ -29,7 +29,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v0
- uses: moonrepo/setup-rust@v1
with:
components: clippy
- run: cargo clippy --workspace --all-targets
Expand All @@ -42,8 +42,8 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v0
- uses: moonrepo/setup-rust@v1
with:
bins: cargo-wasi, cargo-nextest
- run: cargo wasi build -p bun_plugin
- run: cargo wasi build
- run: cargo nextest run
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.1.0

#### 🚀 Updates

- Updated to support proto v0.14 release.

## 0.0.3

#### 🚀 Updates
Expand Down
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ crate-type = ['cdylib']

[dependencies]
extism-pdk = "0.3.3"
proto_pdk = "0.2.3"
serde = "1.0.167"
proto_pdk = "0.4.1"
serde = "1.0.183"

[dev-dependencies]
proto_core = "0.12.2"
proto_pdk_test_utils = "0.1.3"
starbase_sandbox = "0.1.5"
proto_pdk_test_utils = "0.3.3"
starbase_sandbox = "0.1.8"
tokio = "1.29.1"
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
profile = "default"
channel = "1.70.0"
channel = "1.71.1"
7 changes: 2 additions & 5 deletions src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,10 @@ pub fn download_prebuilt(
#[plugin_fn]
pub fn locate_bins(Json(input): Json<LocateBinsInput>) -> FnResult<Json<LocateBinsOutput>> {
Ok(Json(LocateBinsOutput {
bin_path: Some(if input.env.os == HostOS::Windows {
format!("{}.exe", BIN) // Not supported yet
} else {
BIN.to_owned()
}),
bin_path: Some(format_bin_name(BIN, input.env.os).into()),
fallback_last_globals_dir: true,
globals_lookup_dirs: vec!["$HOME/.bun/bin".into()],
..LocateBinsOutput::default()
}))
}

Expand Down
11 changes: 4 additions & 7 deletions tests/download_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use proto_pdk::*;
use proto_pdk_test_utils::{create_plugin, generate_download_install_tests};
use proto_pdk_test_utils::*;
use starbase_sandbox::create_empty_sandbox;
use std::path::PathBuf;

Expand All @@ -22,7 +21,6 @@ fn supports_linux_arm64() {
}),
DownloadPrebuiltOutput {
archive_prefix: Some("bun-linux-aarch64".into()),
bin_path: None,
checksum_name: None,
checksum_url: Some(
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
Expand Down Expand Up @@ -51,7 +49,6 @@ fn supports_linux_x64() {
}),
DownloadPrebuiltOutput {
archive_prefix: Some("bun-linux-x64".into()),
bin_path: None,
checksum_name: None,
checksum_url: Some(
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
Expand Down Expand Up @@ -80,7 +77,6 @@ fn supports_macos_arm64() {
}),
DownloadPrebuiltOutput {
archive_prefix: Some("bun-darwin-aarch64".into()),
bin_path: None,
checksum_name: None,
checksum_url: Some(
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
Expand Down Expand Up @@ -109,7 +105,6 @@ fn supports_macos_x64() {
}),
DownloadPrebuiltOutput {
archive_prefix: Some("bun-darwin-x64".into()),
bin_path: None,
checksum_name: None,
checksum_url: Some(
"https://github.com/oven-sh/bun/releases/download/bun-v1.2.0/SHASUMS256.txt".into()
Expand All @@ -123,7 +118,7 @@ fn supports_macos_x64() {
}

#[test]
#[should_panic(expected = "Unable to install Bun, unsupported OS windows.")]
#[should_panic(expected = "Unable to install Bun")]
fn doesnt_support_windows() {
let sandbox = create_empty_sandbox();
let plugin = create_plugin("bun-test", sandbox.path());
Expand Down Expand Up @@ -152,6 +147,7 @@ fn locates_unix_bin() {
version: "1.2.0".into(),
..Default::default()
},
home_dir: PathBuf::new(),
tool_dir: PathBuf::new()
})
.bin_path,
Expand All @@ -173,6 +169,7 @@ fn locates_windows_bin() {
version: "1.2.0".into(),
..Default::default()
},
home_dir: PathBuf::new(),
tool_dir: PathBuf::new()
})
.bin_path,
Expand Down
3 changes: 1 addition & 2 deletions tests/metadata_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use proto_pdk::*;
use proto_pdk_test_utils::create_plugin;
use proto_pdk_test_utils::*;
use starbase_sandbox::create_empty_sandbox;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tests/shims_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use proto_pdk_test_utils::{create_plugin, generate_global_shims_test};
use proto_pdk_test_utils::*;
use starbase_sandbox::{assert_snapshot, create_empty_sandbox};

#[cfg(not(windows))]
Expand Down
3 changes: 1 addition & 2 deletions tests/versions_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use proto_pdk::*;
use proto_pdk_test_utils::{create_plugin, generate_resolve_versions_tests};
use proto_pdk_test_utils::*;
use starbase_sandbox::create_empty_sandbox;

generate_resolve_versions_tests!("bun-test", {
Expand Down

0 comments on commit 9e014d1

Please sign in to comment.