Skip to content

Commit

Permalink
fix: Rework feature deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 11, 2023
1 parent ca04562 commit 87ad7e9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

#### ⚙️ Internal

- Reworked dependencies and features so that some dependencies only enable when a feature is
enabled.

## 0.12.2

#### 🚀 Updates
Expand Down
30 changes: 21 additions & 9 deletions crates/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ all-features = true
[dependencies]
schematic_macros = { version = "0.12.2", path = "../macros" }
schematic_types = { version = "0.4.8", path = "../types" }
garde = { version = "0.15.0", default-features = false, features = ["regex"] }
indexmap = "2.0.2"
miette = { workspace = true }
serde = { workspace = true }
serde_path_to_error = "0.1.14"
starbase_styles = "0.1.16"
thiserror = "1.0.49"
tracing = "0.1.37"

# config
garde = { version = "0.15.0", default-features = false, optional = true, features = [
"regex",
] }
serde = { workspace = true, optional = true }
serde_path_to_error = { version = "0.1.14", optional = true }
starbase_styles = { version = "0.1.16", optional = true }

# schema
indexmap = { version = "2.0.2", optional = true }

# json
serde_json = { version = "1.0.107", optional = true }

Expand All @@ -40,16 +46,22 @@ toml = { version = "0.8.2", optional = true }
serde_yaml = { version = "0.9.25", optional = true }

# url
reqwest = { version = "0.11.22", default-features = false, features = [
reqwest = { version = "0.11.22", default-features = false, optional = true, features = [
"blocking",
], optional = true }
] }

[features]
default = ["config", "url"]
config = ["schematic_macros/config"]
config = [
"dep:garde",
"dep:serde",
"dep:serde_path_to_error",
"dep:starbase_styles",
"schematic_macros/config",
]
json = ["dep:serde_json"]
json_schema = ["dep:schemars", "json", "schema"]
schema = ["schematic_macros/schema"]
schema = ["dep:indexmap", "schematic_macros/schema"]
toml = ["dep:toml"]
typescript = ["schema"]
url = ["dep:reqwest"]
Expand Down
9 changes: 9 additions & 0 deletions crates/config/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ pub use loader::*;
pub use path::*;
pub use source::*;
pub use validator::*;

#[macro_export]
macro_rules! derive_enum {
($impl:item) => {
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "kebab-case")]
$impl
};
}
9 changes: 0 additions & 9 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,3 @@ pub use config::*;

pub use schematic_macros::*;
pub use schematic_types::{SchemaField, SchemaType, Schematic};

#[macro_export]
macro_rules! derive_enum {
($impl:item) => {
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "kebab-case")]
$impl
};
}

0 comments on commit 87ad7e9

Please sign in to comment.