-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
131 lines (111 loc) · 3.77 KB
/
Cargo.toml
File metadata and controls
131 lines (111 loc) · 3.77 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
[package]
name = "primordium"
version = "0.1.0"
edition = "2021"
default-run = "primordium"
[workspace]
members = ["crates/*"]
# ============================================================================
# Library Configuration
# ============================================================================
[lib]
name = "primordium_lib"
crate-type = ["cdylib", "rlib"]
# ============================================================================
# Binary Targets
# ============================================================================
[[bin]]
name = "primordium"
path = "src/main.rs"
# ============================================================================
# Common Dependencies
# ============================================================================
[dependencies]
primordium_data = { path = "crates/primordium_data" }
primordium_core = { path = "crates/primordium_core" }
primordium_observer = { path = "crates/primordium_observer" }
primordium_net = { path = "crates/primordium_net" }
primordium_tui = { path = "crates/primordium_tui" }
primordium_io = { path = "crates/primordium_io" }
# Error handling
anyhow = "1.0"
thiserror = "1.0"
# Serialization & Data
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
chrono = "0.4"
uuid = { version = "1.0", features = ["v4", "serde"] }
# CLI & Configuration
clap = { version = "4.0", features = ["derive"] }
toml = "0.8"
# Algorithms & Data Structures
petgraph = "0.6"
hecs = "0.10"
rand = "0.8"
rand_chacha = "0.3"
rayon = "1.8"
flate2 = "1.0"
futures = "0.3"
futures-util = "0.3"
async-trait = "0.1"
tokio = { version = "1.0", features = ["full"] }
reqwest = { version = "0.12", features = ["json"] }
hex = "0.4"
sha2 = "0.10"
rkyv = { version = "0.7", features = ["validation", "uuid"] }
# Terminal UI (non-WASM only in practice, but listed here)
ratatui = "0.30"
crossterm = { version = "0.28", features = ["serde"] }
sysinfo = "0.30"
tokio-tungstenite = "0.21"
# ============================================================================
# Development Dependencies
# ============================================================================
[dev-dependencies]
husky-rs = "0.3.2"
proptest = "1.4"
proptest-derive = "0.4"
tower = { version = "0.5", features = ["util"] }
# ============================================================================
# WASM-specific Dependencies
# ============================================================================
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
js-sys = "0.3"
console_error_panic_hook = "0.1"
web-sys = { version = "0.3", features = [
# Core DOM
"Document",
"Window",
"Element",
# Canvas
"HtmlCanvasElement",
"CanvasRenderingContext2d",
# Utilities
"Performance",
"console",
# Networking
"WebSocket",
"MessageEvent",
"ErrorEvent",
] }
# ============================================================================
# Server-specific Dependencies (non-WASM)
# ============================================================================
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Web framework
axum = { version = "0.7", features = ["ws"] }
# HTTP utilities
tower-http = { version = "0.5", features = ["fs", "cors"] }
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# ============================================================================
# Release Profile Optimization
# ============================================================================
[profile.release]
strip = true # 移除调试符号
opt-level = 3 # 最大优化
lto = "fat" # 链接时优化
codegen-units = 1 # 单个代码生成单元以提高优化效果
panic = "abort" # panic 时直接终止,减小二进制大小