Skip to content

Commit

Permalink
Move all dependencies to workspace Cargo.toml (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Oct 10, 2024
1 parent 4083c86 commit dcf5ea7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ members = ["ewebsock", "example_app", "echo_server"]
# eframe = { path = "../egui/eframe" }


[workspace.dependencies]
async-stream = "0.3"
document-features = "0.2"
eframe = "0.26.2"
env_logger = "0.10"
futures = "0.3"
futures-util = { version = "0.3", default-features = false }
js-sys = "0.3"
log = "0.4"
tokio = "1.16"
tokio-tungstenite = "0.23"
tungstenite = "0.23"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = "0.3"


[workspace.lints.rust]
unsafe_code = "deny"

Expand Down
2 changes: 1 addition & 1 deletion echo_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ publish = false


[dependencies]
tungstenite = { version = "0.23" }
tungstenite.workspace = true
29 changes: 13 additions & 16 deletions ewebsock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,34 @@ tokio = [


[dependencies]
document-features = "0.2"
log = "0.4"
document-features.workspace = true
log.workspace = true

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tungstenite = { version = "0.23" }
tungstenite.workspace = true

# Optional dependencies for feature "tokio":
async-stream = { version = "0.3", optional = true }
futures = { version = "0.3", optional = true }
futures-util = { version = "0.3", optional = true, default-features = false, features = [
async-stream = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
futures-util = { workspace = true, optional = true, default-features = false, features = [
"sink",
"std",
] }
tokio = { version = "1.16", features = ["rt", "sync"], optional = true }
tokio-tungstenite = { version = "0.23", optional = true }
tokio = { workspace = true, features = ["rt", "sync"], optional = true }
tokio-tungstenite = { workspace = true, optional = true }

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
js-sys = "0.3"
wasm-bindgen-futures = "0.4"

[dependencies.web-sys]
version = "0.3"
features = [
js-sys.workspace = true
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
web-sys = { workspace = true, features = [
"BinaryType",
"Blob",
"ErrorEvent",
"FileReader",
"MessageEvent",
"ProgressEvent",
"WebSocket",
]
] }
10 changes: 5 additions & 5 deletions example_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ tokio = ["ewebsock/tokio", "dep:tokio"]
[dependencies]
ewebsock = { path = "../ewebsock", features = ["tls"] }

eframe = "0.26.2" # Gives us egui, epi and web+native backends
log = "0.4"
env_logger = "0.10"
eframe.workspace = true
log.workspace = true
env_logger.workspace = true

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.16", optional = true, features = [
tokio = { workspace = true, optional = true, features = [
"macros",
"rt-multi-thread",
] }

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
wasm-bindgen-futures.workspace = true

0 comments on commit dcf5ea7

Please sign in to comment.