[package]
name = "musli-web"
version = "0.2.0"
authors = ["John-John Tedro <udoprog@tedro.se>"]
edition = "2024"
description = """
Types for integrating Müsli with websocket frameworks.
"""
documentation = "https://docs.rs/musli"
readme = "README.md"
homepage = "https://github.com/udoprog/musli"
repository = "https://github.com/udoprog/musli"
license = "MIT OR Apache-2.0"
keywords = ["framework", "http", "web"]
categories = ["asynchronous", "network-programming", "web-programming::http-server"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg, loom)'] }

[features]
default = ["alloc", "std"]
alloc = ["musli?/alloc"]
std = ["musli?/std"]
api = ["alloc", "dep:musli"]
axum08 = ["dep:axum08", "axum-core05", "dep:bytes", "dep:futures-core03", "dep:futures-sink03", "ws", "dep:tracing"]
json = ["musli/json", "std", "alloc", "dep:bytes", "dep:mime", "axum-core05", "dep:http"]
ws = ["musli/storage", "std", "api", "dep:bytes", "dep:rand", "tokio/time", "axum-core05", "axum08/ws", "dep:tracing"]
yew021 = ["web03", "dep:yew021"]
yew022 = ["web03", "dep:yew022"]
web03 = ["std", "alloc", "api", "slab", "musli/storage", "dep:web-sys03", "dep:tracing", "wasm_bindgen02"]
wasm_bindgen02 = ["dep:wasm-bindgen02"]
test = ["api", "json", "ws", "yew021", "yew022"]

[dependencies]
musli-web-macros = { path = "../musli-web-macros", version = "0.2.0" }

musli = { path = "../musli", version = "0.0.149", default-features = false, optional = true }
http = { version = "1.3.1", default-features = false, optional = true }
bytes = { version = "1.10.0", default-features = false, optional = true }
mime = { version = "0.3.17", default-features = false, optional = true }
rand = { version = "0.9.1", default-features = false, optional = true, features = ["small_rng"] }
tracing = { version = "0.1.40", default-features = false, optional = true, features = ["attributes"] }
tokio = { version = "1.37.0", default-features = false, optional = true }
slab = { version = "0.4.9", default-features = false, optional = true }

futures-core03 = { package = "futures-core", version = "0.3.0", default-features = false, optional = true }
futures-sink03 = { package = "futures-sink", version = "0.3.0", default-features = false, optional = true }
axum-core05 = { package="axum-core", version = "0.5.0", default-features = false, optional = true }
axum08 = { package = "axum", version = "0.8.0", default-features = false, optional = true }
yew021 = { package = "yew", version = "0.21.0", default-features = false, optional = true }
yew022 = { package = "yew", version = "0.22.0", default-features = false, optional = true }
wasm-bindgen02 = { package = "wasm-bindgen", version = "0.2.0", default-features = false, optional = true }

[dependencies.web-sys03]
package = "web-sys"
version = "0.3.0"
default-features = false
features = ["WebSocket", "MessageEvent", "Performance", "BinaryType", "CloseEvent", "ErrorEvent", "Window", "Location"]
optional = true

[target.'cfg(any())'.dependencies]
musli-web-macros = { path = "../musli-web-macros", version = "=0.2.0" }
