Skip to content

Commit

Permalink
feat(deps): removed default std feature and updated to target_family
Browse files Browse the repository at this point in the history
Signed-off-by: luk3ark <[email protected]>
  • Loading branch information
LUK3ARK authored and brooksmtownsend committed Jan 2, 2025
1 parent 6b768c1 commit 11aa88b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
13 changes: 5 additions & 8 deletions crates/wadm-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ license = "Apache-2.0"
repository = "https://github.com/wasmcloud/wadm"

[features]
default = ["std"]
std = ["dep:tokio"]
wit = []

[dependencies]
Expand All @@ -22,10 +20,9 @@ regex = { workspace = true }
schemars = { workspace = true }
utoipa = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true, optional = true, features = ["full"] }
wit-bindgen-wrpc = { workspace = true, optional = true }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
tokio = { workspace = true, features = ["full"] }
wit-bindgen-wrpc = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { workspace = true, optional = true }
wit-bindgen = { workspace = true, optional = true, features = ["macros"] }
[target.'cfg(target_family = "wasm")'.dependencies]
wit-bindgen = { workspace = true, features = ["macros"] }
6 changes: 2 additions & 4 deletions crates/wadm-types/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use crate::{
};
use wasmcloud::wadm;

#[cfg(feature = "wit")]
#[cfg(target_arch = "wasm32")]
#[cfg(all(feature = "wit", target_family = "wasm"))]
wit_bindgen::generate!({
path: "wit",
additional_derives: [
Expand All @@ -25,8 +24,7 @@ wit_bindgen::generate!({
}
});

#[cfg(feature = "wit")]
#[cfg(not(target_arch = "wasm32"))]
#[cfg(all(feature = "wit", not(target_family = "wasm")))]
wit_bindgen_wrpc::generate!({
generate_unused_types: true,
additional_derives: [
Expand Down
4 changes: 2 additions & 2 deletions crates/wadm-types/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
use std::collections::{HashMap, HashSet};
#[cfg(feature = "std")]
#[cfg(not(target_family = "wasm"))]
use std::path::Path;
use std::sync::OnceLock;

Expand Down Expand Up @@ -274,7 +274,7 @@ impl ValidationOutput for Vec<ValidationFailure> {
/// # Arguments
///
/// * `path` - Path to the Manifest that will be read into memory and validated
#[cfg(feature = "std")]
#[cfg(not(target_family = "wasm"))]
pub async fn validate_manifest_file(
path: impl AsRef<Path>,
) -> Result<(Manifest, Vec<ValidationFailure>)> {
Expand Down

0 comments on commit 11aa88b

Please sign in to comment.