Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
- [Rust](https://github.com/moonrepo/plugins/blob/master/tools/rust/CHANGELOG.md)
- [Schema (TOML, JSON, YAML)](https://github.com/moonrepo/plugins/blob/master/tools/internal-schema/CHANGELOG.md)

## Unreleased

#### 🚀 Updates

- Added support for base64 encoded `data://` locators for plugins. This is primarily for tools built around proto, like moon.

## 0.55.4

#### 🚀 Updates
Expand Down
13 changes: 7 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rmcp = { version = "1.1.0", default-features = false, features = [
rustc-hash = "2.1.1"
scc = "3.6.9"
schemars = "1.2.1"
schematic = { version = "0.19.4", default-features = false }
schematic = { version = "0.19.6", default-features = false }
semver = { version = "1.0.27", features = ["serde"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.49", features = ["preserve_order"] }
Expand Down
11 changes: 11 additions & 0 deletions crates/cli/src/components/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ pub struct LocatorProps<'a> {
#[component]
pub fn Locator<'a>(props: &LocatorProps<'a>) -> impl Into<AnyElement<'a>> + use<'a> {
match props.value.as_ref().expect("`value` prop is required!") {
PluginLocator::Data(_) => element! {
Entry(
name: "Source",
value: element! {
StyledText(
content: "(built-in plugin)",
)
}.into_any()
)
}
.into_any(),
PluginLocator::File(file) => element! {
Entry(
name: "Source file",
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/workflows/exec_workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ async fn prepare_tool(
.globals_dir
.as_ref()
.map(|dir| tool.to_virtual_path(dir)),
globals_prefix: locations.globals_prefix,
passthrough_args: params.passthrough_args,
globals_prefix: locations.globals_prefix.as_deref(),
passthrough_args: params.passthrough_args.iter().map(|a| a.as_str()).collect(),
},
)
.await?;
Expand Down
14 changes: 11 additions & 3 deletions crates/cli/src/workflows/install_workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ impl InstallWorkflow {
InstallHook {
context: tool.create_plugin_context(spec),
forced: params.force,
passthrough_args: params.passthrough_args.clone(),
passthrough_args: params
.passthrough_args
.iter()
.map(|a| a.as_str())
.collect(),
pinned: params.pin_to.is_some(),
quiet: params.quiet,
},
Expand Down Expand Up @@ -373,7 +377,11 @@ impl InstallWorkflow {
InstallHook {
context: tool.create_plugin_context(spec),
forced: params.force,
passthrough_args: params.passthrough_args.clone(),
passthrough_args: params
.passthrough_args
.iter()
.map(|a| a.as_str())
.collect(),
pinned: params.pin_to.is_some(),
quiet: params.quiet,
},
Expand Down Expand Up @@ -438,7 +446,7 @@ impl InstallWorkflow {
PluginFunction::SyncShellProfile,
SyncShellProfileInput {
context: tool.create_plugin_context(spec),
passthrough_args: params.passthrough_args.clone(),
passthrough_args: params.passthrough_args.iter().map(|a| a.as_str()).collect(),
},
)
.await?;
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/tests/exec_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mod exec {

assert
.success()
.stdout(predicate::str::contains("v20.20.1"));
.stdout(predicate::str::contains("v20.20.2"));
}

#[test]
Expand Down Expand Up @@ -107,7 +107,7 @@ bun = "1.2"

assert
.inner
.stdout(predicate::str::contains("v20.20.1").and(predicate::str::contains("1.2.23")));
.stdout(predicate::str::contains("v20.20.2").and(predicate::str::contains("1.2.23")));
}

#[test]
Expand Down Expand Up @@ -141,7 +141,7 @@ bun = "1.2"

assert
.inner
.stdout(predicate::str::contains("v20.20.1").and(predicate::str::contains("1.2.23")));
.stdout(predicate::str::contains("v20.20.2").and(predicate::str::contains("1.2.23")));
}

#[test]
Expand Down
5 changes: 3 additions & 2 deletions crates/core/src/flow/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::tool::Tool;
use crate::tool_spec::ToolSpec;
use proto_pdk_api::*;
use starbase_utils::fs;
use std::borrow::Cow;
use std::env;
use std::path::{Path, PathBuf};
use tracing::{debug, instrument, trace};
Expand Down Expand Up @@ -151,9 +152,9 @@ impl<'tool> Detector<'tool> {
.call_func_with(
PluginFunction::ParseVersionFile,
ParseVersionFileInput {
content,
content: Cow::Borrowed(&content),
context: self.tool.create_plugin_unresolved_context(),
file: file.clone(),
file: Cow::Borrowed(&file),
path: self.tool.to_virtual_path(&file_path),
},
)
Expand Down
6 changes: 3 additions & 3 deletions crates/pdk-api/src/api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use rustc_hash::FxHashMap;
use semver::VersionReq;
use std::path::PathBuf;
use system_env::SystemDependency;
use warpgate_api::{Id, VirtualPath, api_enum, api_struct};
use warpgate_api::{Id, VirtualPath, api_enum, api_input_struct, api_output_struct, api_struct};

api_struct!(
api_input_struct!(
/// Input passed to the `build_instructions` function.
pub struct BuildInstructionsInput {
/// Current tool context.
Expand Down Expand Up @@ -141,7 +141,7 @@ api_enum!(
}
);

api_struct!(
api_output_struct!(
/// Output returned by the `build_instructions` function.
#[serde(default)]
pub struct BuildInstructionsOutput {
Expand Down
Loading
Loading