-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
121 lines (101 loc) · 2.94 KB
/
Copy pathCargo.toml
File metadata and controls
121 lines (101 loc) · 2.94 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
[package]
name = "wat-lsp-rust"
version = "0.1.0"
edition = "2021"
[lib]
name = "wat_lsp_rust"
path = "src/lib.rs"
crate-type = ["cdylib", "rlib"]
[[bin]]
name = "wat-lsp-rust"
path = "src/main.rs"
required-features = ["native"]
[[bin]]
name = "wat-check"
path = "src/bin/wat-check.rs"
required-features = ["native"]
[[bin]]
name = "wat-hover"
path = "src/bin/wat-hover.rs"
required-features = ["native"]
[[bin]]
name = "wat-docs"
path = "src/bin/wat-docs.rs"
required-features = ["native"]
[[bin]]
name = "wat-bench"
path = "src/bin/wat-bench.rs"
required-features = ["native"]
[[bin]]
name = "wast-runner"
path = "src/bin/wast-runner.rs"
required-features = ["native"]
[[bin]]
name = "wat-hover-coverage"
path = "src/bin/wat-hover-coverage.rs"
required-features = ["native"]
[features]
default = ["native"]
native = [
"dep:tower-lsp",
"dep:tokio",
"dep:tree-sitter",
"dep:dashmap",
"dep:clap",
"dep:wast",
"dep:serde_json",
"dep:serde",
]
wasm = [
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
"dep:js-sys",
"dep:web-sys",
"dep:console_error_panic_hook",
"dep:web-tree-sitter-sg",
]
[dependencies]
# Native-only serialization (not needed by WASM — uses js_sys for JS conversion)
serde = { version = "1.0", features = ["derive"], optional = true }
# Native-only core dependencies
serde_json = { version = "1.0", optional = true }
wast = { version = "243.0", optional = true }
# Native-only dependencies
tower-lsp = { version = "0.20", optional = true }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "io-std", "sync", "time"], optional = true }
tree-sitter = { version = "0.25.3", optional = true }
dashmap = { version = "6.1", optional = true }
clap = { version = "4", features = ["derive"], optional = true }
# WASM-only dependencies
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
js-sys = { version = "0.3", optional = true }
web-sys = { version = "0.3", features = ["console"], optional = true }
console_error_panic_hook = { version = "0.1", optional = true }
web-tree-sitter-sg = { version = "0.25.3", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.build-dependencies]
cc = "1.0"
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "sync"] }
tower = "0.4"
serde_json = "1.0"
futures = "0.3"
[[bench]]
name = "lsp_features"
harness = false
required-features = ["native"]
[[bench]]
name = "parser"
harness = false
required-features = ["native"]
# ============================================================================
# Release profile — tuned for small WASM binary + fast native binary
# ============================================================================
[profile.release]
lto = true
codegen-units = 1
strip = true
# WASM-specific: optimise for binary size
[profile.release.package.wat-lsp-rust]
opt-level = "z"