-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
154 lines (145 loc) · 5.02 KB
/
Copy pathCargo.toml
File metadata and controls
154 lines (145 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
[package]
name = "lanes"
version = "0.2.8"
edition = "2024"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
# --- Shared (both ssr and hydrate targets) ---
leptos = { version = "0.8", features = [] }
leptos_meta = { version = "0.8" }
leptos_router = { version = "0.8" }
leptos-use = { version = "0.18" }
serde = { version = "1", features = ["derive"] }
# uuid is SSR-only: ID generation happens server-side; models use String for IDs (Anti-Patterns)
uuid = { version = "1", features = ["v4", "v7"], optional = true }
# --- SSR only (server binary) ---
leptos_axum = { version = "0.8", optional = true }
axum = { version = "0.8", features = ["multipart", "ws"], optional = true }
axum-macros = { version = "0.5", optional = true }
tokio = { version = "1", features = ["rt-multi-thread"], optional = true }
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "sqlite"], optional = true }
dotenvy = { version = "0.15", optional = true }
clap = { version = "4", features = ["derive"], optional = true }
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
thiserror = { version = "2", optional = true }
fractional_index = { version = "2", features = ["serde"], optional = true }
axum-login = { version = "0.18", optional = true }
tower-sessions = { version = "0.14", optional = true }
tower-sessions-sqlx-store = { version = "0.15", features = ["sqlite"], optional = true }
password-auth = { version = "1.0.0", optional = true }
time = { version = "0.3", optional = true }
rand = { version = "0.10", features = ["std"], optional = true }
async-trait = { version = "0.1", optional = true }
pulldown-cmark = { version = "0.13", optional = true }
ammonia = { version = "4", optional = true }
object_store = { version = "0.13", features = ["fs", "aws"], optional = true }
serde_json = { version = "1", optional = true }
dashmap = { version = "6", optional = true }
chrono = { version = "0.4", features = ["serde"], optional = true }
utoipa = { version = "5", features = ["axum_extras"], optional = true }
utoipa-axum = { version = "0.2", optional = true }
sha2 = { version = "0.11", optional = true }
# --- Hydrate only (WASM) ---
console_error_panic_hook = { version = "0.1", optional = true }
wasm-bindgen = { version = "0.2", optional = true }
# js-sys gives the WASM client a real clock (Date.now); std::time panics on wasm32.
js-sys = { version = "0.3", optional = true }
# wasm-bindgen-futures: await JS promises (attachment upload fetch) on wasm32.
wasm-bindgen-futures = { version = "0.4", optional = true }
# futures: oneshot channel used in WASM WS reconnect loop to bridge close callback to async.
futures = { version = "0.3", default-features = false, features = ["std"], optional = true }
# web-sys: browser WebSocket + DOM APIs used by the realtime WS client (hydrate only).
web-sys = { version = "0.3", optional = true, features = [
"WebSocket",
"MessageEvent",
"CloseEvent",
"ErrorEvent",
"Event",
"EventTarget",
"Element",
"HtmlElement",
"HtmlInputElement",
"FormData",
"Request",
"RequestInit",
"Response",
"Window",
"Document",
"VisibilityState",
] }
# gloo-timers: async sleep via TimeoutFuture used in the WS reconnect/heartbeat loops.
gloo-timers = { version = "0.3", optional = true, features = ["futures"] }
[features]
# `ssr` is the default so bare `cargo`/rust-analyzer (IDE) resolve the optional
# server deps (e.g. fractional_index) without manual feature flags. The real
# builds are unaffected: cargo-leptos, CI, Docker, and tests all pass
# `--no-default-features` and select `ssr`/`hydrate` explicitly.
default = ["ssr"]
hydrate = [
"leptos/hydrate",
"dep:chrono",
"dep:console_error_panic_hook",
"dep:wasm-bindgen",
"dep:js-sys",
"dep:wasm-bindgen-futures",
"dep:futures",
"dep:fractional_index",
"dep:serde_json",
"dep:web-sys",
"dep:gloo-timers",
]
ssr = [
"leptos-use/ssr",
"dep:uuid",
"dep:leptos_axum",
"dep:axum",
"dep:axum-macros",
"dep:tokio",
"dep:sqlx",
"dep:dotenvy",
"dep:clap",
"dep:tracing",
"dep:tracing-subscriber",
"dep:thiserror",
"dep:fractional_index",
"dep:axum-login",
"dep:tower-sessions",
"dep:tower-sessions-sqlx-store",
"dep:password-auth",
"dep:time",
"dep:rand",
"dep:async-trait",
"dep:pulldown-cmark",
"dep:ammonia",
"dep:object_store",
"dep:serde_json",
"dep:dashmap",
"dep:chrono",
"dep:utoipa",
"dep:utoipa-axum",
"dep:sha2",
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
]
[dev-dependencies]
tempfile = "3"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "test-util"] }
serde_json = "1"
[package.metadata.leptos]
output-name = "lanes"
site-root = "target/site"
site-pkg-dir = "pkg"
assets-dir = "public"
style-file = "style/main.css"
bin-features = ["ssr"]
lib-features = ["hydrate"]
site-addr = "127.0.0.1:3000"
reload-port = 3001
[profile.wasm-release]
inherits = "release"
opt-level = 'z'
lto = true
codegen-units = 1