Skip to content

Commit

Permalink
Refactor crates deps
Browse files Browse the repository at this point in the history
  • Loading branch information
tinrab committed Oct 6, 2024
1 parent b954ee8 commit aa1a190
Show file tree
Hide file tree
Showing 27 changed files with 272 additions and 256 deletions.
50 changes: 48 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,53 @@ bomboni_common = { path = "bomboni_common", version = "0.1.60" }

bomboni_prost = { path = "bomboni_prost", version = "0.1.60", default-features = false, optional = true }
bomboni_proto = { path = "bomboni_proto", version = "0.1.60", default-features = false, optional = true }
bomboni_request = { path = "bomboni_request", version = "0.1.60", default-features = false, optional = true }
bomboni_request = { path = "bomboni_request", version = "0.1.60", default-features = false, optional = true, features = [
"root-crate",
] }
bomboni_template = { path = "bomboni_template", version = "0.1.60", default-features = false, optional = true }
bomboni_wasm = { path = "bomboni_wasm", version = "0.1.60", default-features = false, optional = true }
bomboni_wasm = { path = "bomboni_wasm", version = "0.1.60", default-features = false, optional = true, features = [
"root-crate",
] }
bomboni_fs = { path = "bomboni_fs", version = "0.1.60", default-features = false, optional = true }

[workspace.dependencies]
bomboni_core = { path = "bomboni_core", version = "0.1.60" }
bomboni_common = { path = "bomboni_common", version = "0.1.60" }
bomboni_prost = { path = "bomboni_prost", version = "0.1.60" }
bomboni_proto = { path = "bomboni_proto", version = "0.1.60" }
bomboni_request = { path = "bomboni_request", version = "0.1.60" }
bomboni_request_derive = { path = "bomboni_request_derive", version = "0.1.60" }
bomboni_template = { path = "bomboni_template", version = "0.1.60" }
bomboni_wasm = { path = "bomboni_wasm", version = "0.1.60" }
bomboni_wasm_core = { path = "bomboni_wasm_core", version = "0.1.60" }
bomboni_wasm_derive = { path = "bomboni_wasm_derive", version = "0.1.60" }
bomboni_fs = { path = "bomboni_fs", version = "0.1.60" }

thiserror = "1.0.64"
regex = "1.11.0"
time = "0.3.36"
chrono = "0.4.38"
ulid = "1.1.3"
bytes = "1.7.2"
serde = "1.0.210"
serde_json = "1.0.128"
serde_derive_internals = "0.29.1"
convert_case = "0.6.0"
handlebars = "6.1.0"
rand = "0.8.5"
itertools = "0.13.0"

http = "1.1.0"
prost = "0.13.3"
prost-types = "0.13.3"
prost-build = "0.13.3"
tonic = "0.12.3"
tokio = "1.40.0"
parking_lot = "0.12.3"
postgres-types = "0.2.8"

proc-macro2 = "1.0.86"
syn = "2.0.79"
quote = "1.0.37"
prettyplease = "0.2.22"
darling = "0.20.10"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Bomboni: Utility Library for Rust

WIP.
Work in progress (WIP).

This project includes utilities for working with WASM, extras for protobuf/prost
(like constants for field names), tools for gRPC requests following Google AIP
designs, etc.
32 changes: 15 additions & 17 deletions bomboni_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,26 @@ js = []
postgres = ["dep:postgres-types", "dep:bytes"]

[dependencies]
bomboni_wasm = { path = "../bomboni_wasm", version = "0.1.60", features = [
"derive",
], optional = true }
bomboni_wasm = { workspace = true, features = ["derive"], optional = true }

thiserror = "1.0.63"
regex = "1.10.5"
time = { version = "0.3.36", features = ["formatting", "parsing"] }
ulid = "1.1.3"
thiserror.workspace = true
regex.workspace = true
time = { workspace = true, features = ["formatting", "parsing"] }
ulid.workspace = true

tokio = { version = "1.39.1", features = ["time", "sync"], optional = true }
parking_lot = { version = "0.12.3", optional = true }
serde = { version = "1.0.204", features = ["derive"], optional = true }
chrono = { version = "0.4.38", optional = true }
postgres-types = { version = "0.2.7", features = [
tokio = { workspace = true, features = ["time", "sync"], optional = true }
parking_lot = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
chrono = { workspace = true, optional = true }
postgres-types = { workspace = true, features = [
"with-time-0_3",
], optional = true }
bytes = { version = "1.6.1", optional = true }
bytes = { workspace = true, optional = true }

[target.'cfg(all(target_family = "wasm", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies]
wasm-bindgen = { version = "0.2.92", optional = true }
js-sys = { version = "0.3.69", optional = true }
wasm-bindgen = { version = "0.2.93", optional = true }
js-sys = { version = "0.3.70", optional = true }

[dev-dependencies]
serde_json = "1.0.120"
tokio = { version = "1.39.1", features = ["rt-multi-thread", "macros"] }
serde_json.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
9 changes: 2 additions & 7 deletions bomboni_common/src/date_time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod postgres;
),
derive(bomboni_wasm::Wasm),
wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value { convert_string },
)
Expand All @@ -33,12 +33,7 @@ mod postgres;
feature = "js",
),
derive(bomboni_wasm::Wasm),
wasm(
bomboni_crate = crate::bomboni,
wasm_abi,
js_value,
override_type = "Date",
)
wasm(wasm_abi, js_value, override_type = "Date",)
)]
pub struct UtcDateTime(OffsetDateTime);

Expand Down
2 changes: 1 addition & 1 deletion bomboni_common/src/id/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub mod worker;
),
derive(bomboni_wasm::Wasm),
wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value { convert_string },
)
Expand Down
12 changes: 0 additions & 12 deletions bomboni_common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
pub mod date_time;
pub mod id;
pub mod macros;

#[doc(hidden)]
#[cfg(all(
target_family = "wasm",
not(any(target_os = "emscripten", target_os = "wasi")),
feature = "wasm"
))]
pub mod bomboni {
pub mod wasm {
pub use bomboni_wasm::*;
}
}
8 changes: 4 additions & 4 deletions bomboni_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name = "bomboni_core"
path = "src/lib.rs"

[dependencies]
convert_case = "0.6.0"
proc-macro2 = "1.0.86"
syn = { version = "2.0.72", features = ["full"] }
quote = "1.0.36"
convert_case.workspace = true
proc-macro2.workspace = true
syn = { workspace = true, features = ["full"] }
quote.workspace = true
2 changes: 0 additions & 2 deletions bomboni_fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ edition = "2021"
[lib]
name = "bomboni_fs"
path = "src/lib.rs"

[dependencies]
14 changes: 7 additions & 7 deletions bomboni_prost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ name = "bomboni_prost"
path = "src/lib.rs"

[dependencies]
bomboni_core = { path = "../bomboni_core", version = "0.1.60" }
bomboni_core = { workspace = true }

prost = "0.13.1"
prost-types = "0.13.1"
proc-macro2 = "1.0.86"
syn = { version = "2.0.72", features = ["full"] }
quote = "1.0.36"
prettyplease = "0.2.20"
prost.workspace = true
prost-types.workspace = true
proc-macro2.workspace = true
syn = { workspace = true, features = ["full"] }
quote.workspace = true
prettyplease.workspace = true
36 changes: 17 additions & 19 deletions bomboni_proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,38 @@ testing = []
tonic = ["dep:tonic", "dep:http"]
chrono = ["dep:chrono", "bomboni_common/chrono"]
wasm = [
"bomboni_common/wasm",
"dep:wasm-bindgen",
"dep:js-sys",
"dep:serde-wasm-bindgen",
"bomboni_common/wasm",
"dep:bomboni_wasm",
]
js = ["bomboni_common/js"]

[dependencies]
bomboni_common = { path = "../bomboni_common", features = [
"serde",
], version = "0.1.60" }
bomboni_common = { workspace = true, features = ["serde"] }

thiserror = "1.0.63"
time = { version = "0.3.36", features = ["serde", "formatting", "parsing"] }
prost = "0.13.1"
serde = { version = "1.0.204", features = ["derive"] }
serde_json = "1.0.120"
pot = "3.0.0"
thiserror.workspace = true
time = { workspace = true, features = ["serde", "formatting", "parsing"] }
prost.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
pot = "3.0.1"

tonic = { version = "0.12.1", optional = true }
http = { version = "1.1.0", optional = true }
chrono = { version = "0.4.38", optional = true }
tonic = { workspace = true, optional = true }
http = { workspace = true, optional = true }
chrono = { workspace = true, optional = true }

[target.'cfg(all(target_family = "wasm", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies]
bomboni_wasm = { path = "../bomboni_wasm", version = "0.1.60", optional = true }
bomboni_wasm = { workspace = true, optional = true, features = ["derive"] }

wasm-bindgen = { version = "0.2.92", optional = true }
js-sys = { version = "0.3.69", optional = true }
wasm-bindgen = { version = "0.2.93", optional = true }
js-sys = { version = "0.3.70", optional = true }
serde-wasm-bindgen = { version = "0.6.5", optional = true }

[dev-dependencies]
serde_json = "1.0.120"
serde_json.workspace = true

[build-dependencies]
bomboni_prost = { path = "../bomboni_prost", version = "0.1.60" }
prost-build = "0.13.1"
bomboni_prost = { workspace = true }
prost-build.workspace = true
19 changes: 9 additions & 10 deletions bomboni_proto/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::{error::Error, path::PathBuf};

use bomboni_prost::{
compile,
config::{ApiConfig, CompileConfig},
};
use prost_build::Config;
use std::{error::Error, path::PathBuf};

fn main() -> Result<(), Box<dyn Error + 'static>> {
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
Expand Down Expand Up @@ -149,7 +148,7 @@ fn build_wasm(config: &mut Config) {
format!(".google.rpc.{type_name}"),
r"
#[derive(bomboni_wasm::Wasm)]
#[wasm(bomboni_crate = crate::bomboni, wasm_abi)]
#[wasm(bomboni_wasm_crate = bomboni_wasm, wasm_abi)]
",
);
}
Expand Down Expand Up @@ -177,7 +176,7 @@ fn build_wasm(config: &mut Config) {
r#"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value { convert_string },
override_type = "`${number}.${number}s` | `${number}s`",
Expand All @@ -189,7 +188,7 @@ fn build_wasm(config: &mut Config) {
r#"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value,
rename = "JsonObject",
Expand All @@ -202,7 +201,7 @@ fn build_wasm(config: &mut Config) {
r#"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value,
rename = "JsonValue",
Expand All @@ -217,7 +216,7 @@ fn build_wasm(config: &mut Config) {
r#"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value,
override_type = "undefined | null",
Expand All @@ -229,7 +228,7 @@ fn build_wasm(config: &mut Config) {
r#"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value,
override_type = "Date",
Expand All @@ -242,7 +241,7 @@ fn build_wasm(config: &mut Config) {
r#"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value,
override_type = "null",
Expand All @@ -254,7 +253,7 @@ fn build_wasm(config: &mut Config) {
"
#[derive(bomboni_wasm::Wasm)]
#[wasm(
bomboni_crate = crate::bomboni,
bomboni_wasm_crate = bomboni_wasm,
wasm_abi,
js_value { convert_string },
)]
Expand Down
12 changes: 0 additions & 12 deletions bomboni_proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,3 @@ pub mod google {
crate::include_proto!("google.rpc.plus");
}
}

#[doc(hidden)]
#[cfg(all(
target_family = "wasm",
not(any(target_os = "emscripten", target_os = "wasi")),
feature = "wasm"
))]
pub mod bomboni {
pub mod wasm {
pub use bomboni_wasm::*;
}
}
Loading

0 comments on commit aa1a190

Please sign in to comment.