Files
cnats/Cargo.toml
T

130 lines
3.6 KiB
TOML
Raw Permalink Normal View History

[package]
name = "cnats"
2026-07-28 12:03:23 +02:00
version = "0.2.2"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
leptos = { version = "0.8" }
leptos_meta = { version = "0.8" }
leptos_router = { version = "0.8" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# --- server only ---
leptos_axum = { version = "0.8", optional = true }
axum = { version = "0.8", optional = true }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal"], optional = true }
tower = { version = "0.5", optional = true }
tower-http = { version = "0.6", features = ["fs", "trace"], optional = true }
tower-sessions = { version = "0.14", optional = true }
async-nats = { version = "0.38", optional = true }
url = { version = "2", optional = true }
sqlx = { version = "0.8", default-features = false, features = [
"runtime-tokio",
"tls-rustls",
"postgres",
"macros",
], optional = true }
openidconnect = { version = "4", optional = true }
# For pulling the `groups` custom claim out of the already-verified ID
# token's raw JWT payload - openidconnect's Core* type aliases default to
# EmptyAdditionalClaims, and reworking that generic stack for one extra
# field isn't worth it. The token's signature is already checked by
# id_token.claims(...) before this ever runs.
base64 = { version = "0.22", optional = true }
futures = { version = "0.3", optional = true }
chrono = { version = "0.4", features = ["serde"], optional = true }
uuid = { version = "1", features = ["v4"], optional = true }
dotenvy = { version = "0.15", optional = true }
anyhow = { version = "1", optional = true }
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
# --- browser only ---
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
js-sys = { version = "0.3", optional = true }
console_error_panic_hook = { version = "0.1", optional = true }
web-sys = { version = "0.3", features = [
"EventSource",
"MessageEvent",
"HtmlElement",
"Element",
# --- WebRTC mesh calling ---
"RtcPeerConnection",
"RtcConfiguration",
"RtcIceServer",
"RtcSdpType",
"RtcSessionDescriptionInit",
"RtcIceCandidate",
"RtcIceCandidateInit",
"RtcPeerConnectionIceEvent",
"RtcRtpSender",
"RtcTrackEvent",
"RtcRtpTransceiver",
"RtcOfferOptions",
"MediaStream",
"MediaStreamConstraints",
"MediaStreamTrack",
"MediaDevices",
"Navigator",
"HtmlVideoElement",
], optional = true }
[features]
default = []
hydrate = [
"leptos/hydrate",
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
"dep:js-sys",
"dep:console_error_panic_hook",
"dep:web-sys",
]
ssr = [
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
"dep:leptos_axum",
"dep:axum",
"dep:tokio",
"dep:tower",
"dep:tower-http",
"dep:tower-sessions",
"dep:async-nats",
"dep:url",
"dep:sqlx",
"dep:openidconnect",
"dep:base64",
"dep:futures",
"dep:chrono",
"dep:uuid",
"dep:dotenvy",
"dep:anyhow",
"dep:tracing",
"dep:tracing-subscriber",
]
[profile.wasm-release]
inherits = "release"
opt-level = 'z'
lto = true
codegen-units = 1
[package.metadata.leptos]
output-name = "cnats"
site-root = "target/site"
site-pkg-dir = "pkg"
style-file = "style/main.css"
assets-dir = "public"
site-addr = "127.0.0.1:3000"
reload-port = 3001
bin-features = ["ssr"]
bin-default-features = false
lib-features = ["hydrate"]
lib-default-features = false
lib-profile-release = "wasm-release"