Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
260 lines (236 loc) · 13.1 KB
/
Copy pathCargo.toml
File metadata and controls
260 lines (236 loc) · 13.1 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# editor — one root workspace.
#
# Split out of FastTrackStudios/task (see docs/SPLIT.md). A text and
# markdown editor: document model, live-preview decorations, vim bindings,
# tree-sitter syntax, CRDT collaboration, LSP, and a Dioxus view.
#
# It exists as its own repo because it is *embeddable*. The whole stack
# depends on `dioxus` and crates.io and nothing else — no framework, no
# RPC layer, no product. That is deliberate and worth protecting: Task,
# Keyflow and Session all embed it, and a dependency on any one of them
# would make it useless to the others.
#
# Fence languages the editor cannot own are plugged in rather than linked.
# `editor-state::fence_renderer` is the seam; `editor-keyflow` (in the
# keyflow repo) is the reference implementation. Do NOT add a dependency
# on a language that sits above this repo — register it instead.
[workspace]
resolver = "3"
# Layout follows architect's shape (see the `architect` skill):
# crates/ the facade + the document model — what an embedder reaches for
# features/ one capability per directory, each independently consumable
# apps/ runnable binaries
# A feature is a single crate at `features/<name>` and only nests a level
# deeper when it genuinely needs more than one crate — `mermaid` does,
# because the vendored renderer is a separate package from the fence
# adapter. Directories are bare capability names; package names keep the
# `editor-` prefix so they stay publishable and downstream imports don't
# move.
members = [
"crates/editor",
"crates/editor-ext",
"crates/editor-state",
"features/crdt",
"features/lsp",
"features/mermaid/mermaid",
"features/mermaid/mermaid-rs-renderer",
"features/syntax",
"features/typst",
"features/ui",
"features/vim",
"apps/playground",
"vendor/dioxus-test",
]
[workspace.package]
version = "0.1.0"
edition = "2024"
rust-version = "1.87"
authors = ["FastTrack Studio"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/FastTrackStudios/editor"
[workspace.dependencies]
# CommonMark reference parser. A dev-dependency only: it is the oracle
# the markdown pass is diffed against in `conformance.rs`, never part of
# a shipped build. `OffsetIter` gives byte ranges for every event, which
# is the same shape the decoration model wants — see that test's header.
pulldown-cmark = { version = "0.10", default-features = false }
# ── Internal ──────────────────────────────────────────────────────────
# `editor` is the facade. `editor-state` is the document model and the
# markdown pass; everything else hangs off it.
editor = { path = "crates/editor" }
# `default-features = false`: the Typst and Mermaid fence renderers are
# opt-in for crates that depend on the core directly (an app that only
# edits plain or keyflow text should not build a Typst compiler). The
# `editor` umbrella turns both back on by default.
editor-ext = { path = "crates/editor-ext" }
editor-state = { path = "crates/editor-state", default-features = false }
editor-crdt = { path = "features/crdt" }
editor-lsp = { path = "features/lsp" }
editor-mermaid = { path = "features/mermaid/mermaid" }
editor-syntax = { path = "features/syntax" }
editor-typst = { path = "features/typst" }
editor-view = { path = "features/ui" }
editor-vim = { path = "features/vim" }
# The vendored copy, with the wasm fixes (no clock read on wasm). Its CLI
# and PNG stack stay off: the editor only needs the SVG pipeline.
mermaid-rs-renderer = { path = "features/mermaid/mermaid-rs-renderer", default-features = false }
# Headless component tests on blitz-dom (dev-only, unpublished). Vendored
# from DioxusLabs/dioxus-test by way of FastTrackStudio's copy, and ported
# here to the pins below: the FastTrackStudio copy pins its own (older)
# dioxus rev, which would put two Dioxus copies in this lock.
dioxus-test = { path = "vendor/dioxus-test" }
# ── UI framework ──────────────────────────────────────────────────────
# dioxus 0.8 line — git rev pinned (main 430cfb56, the 0.8.0-alpha.3 line),
# the same dioxus rev, blitz rev and vendor tags architect pins, so a
# downstream lock (keyflow, task, studio) resolves one Dioxus and one
# Blitz. It must stay in lockstep across every dioxus-* entry and the
# `[patch]` sections below; move it only together with architect.
dioxus = { git = "https://github.com/DioxusLabs/dioxus", rev = "430cfb563f1b70602ef387f0c80f171d84527b41", default-features = false, features = ["lib"] }
dioxus-native = { git = "https://github.com/DioxusLabs/dioxus", rev = "430cfb563f1b70602ef387f0c80f171d84527b41", features = ["prelude", "system-fonts", "svg", "autofocus", "data-uri"] }
dioxus-native-dom = { git = "https://github.com/DioxusLabs/dioxus", rev = "430cfb563f1b70602ef387f0c80f171d84527b41" }
dioxus-vdom = { git = "https://github.com/DioxusLabs/dioxus", rev = "430cfb563f1b70602ef387f0c80f171d84527b41" }
dioxus-html = { git = "https://github.com/DioxusLabs/dioxus", rev = "430cfb563f1b70602ef387f0c80f171d84527b41" }
blitz-dom = "=0.3.0-beta.4"
blitz-html = "=0.3.0-beta.4"
blitz-paint = "=0.3.0-beta.4"
blitz-traits = "=0.3.0-beta.4"
anyrender = "0.14"
anyrender_vello_cpu = "0.18"
peniko = "0.6"
# ── Editor stack externals ────────────────────────────────────────────
arborium = { version = "2.16.0", default-features = false }
arborium-theme = "2.16.0"
arborium-tree-sitter = "2.16.0"
# A grammar outside `editor_syntax::Lang`, for the tests of host-supplied
# languages (dev-dependency only).
arborium-toml = "2.16.0"
ropey = "1.6"
# ── Async runtime ─────────────────────────────────────────────────────
tokio = { version = "1.48", features = ["full"] }
# ── Serialization ─────────────────────────────────────────────────────
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"
# ── Observability ─────────────────────────────────────────────────────
tracing = { version = "0.1", features = ["std"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-appender = "0.2"
[patch.crates-io]
# Blitz from the FTS fork, at the rev architect pins: DioxusLabs/blitz
# main (0.3.0-beta.4+) with the FTS work (fts-focus: focus follows
# pointerdown for all focusable content — upstream only click-focuses
# text inputs, leaving the editor's tabindex div unfocusable by mouse;
# touch as pointer events; the measure fix; …) and, on top of tag
# fts-upstream-2026-11, the native IME the editor composes with (an
# `inputmode` element turns the IME on; `composition*` listeners take
# the Ime events: tests/native_ime.rs). dioxus git pins `=0.3.0-beta.4`.
# One rev across all blitz crates, and anyrender from the same rev; it
# moves together with the dioxus rev.
blitz-dom = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
blitz-traits = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
blitz-paint = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
blitz-shell = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
blitz-net = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
blitz-html = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
anyrender = { git = "https://github.com/FastTrackStudios/blitz", rev = "db5b7ef11e4df19ef317c23f77152ec5e1887101" }
# The renderer and windowing forks a Blitz app needs, as architect pins
# them (each one's reason is in vendor's README). architect also
# patches `anyrender_vello` (same tag); dioxus-native renders through
# `anyrender_vello_hybrid` here, so it does not resolve into this graph and
# is left out rather than carried as an unused-patch warning on every build.
anyrender_vello_hybrid = { git = "https://github.com/FastTrackStudios/vendor", tag = "v0.7.1" }
winit-uikit = { git = "https://github.com/FastTrackStudios/vendor", tag = "v0.7.1" }
wgpu-hal = { git = "https://github.com/FastTrackStudios/vendor", tag = "v0.7.1" }
raw-window-metal = { git = "https://github.com/FastTrackStudios/vendor", tag = "v0.7.1" }
# task also patches styx-format / phon / phon-jit / facet-core to the
# vendor repo. None of them resolves into this graph — the editor has no
# RPC or reflection layer — so they are deliberately absent rather than
# carried as unused-patch warnings on every build.
# The Dioxus crates from the FTS vendor fork, as architect pins them
# (each one's reason is in its UPSTREAM.md): dioxus-native — winit beta.4
# to match Blitz main; dioxus-native-dom — `text_input_focused`, focus and
# measurements that never panic on a busy document, and, at a rev on top
# of v0.7.1, Blitz's IME events delivered as `compositionupdate` /
# `compositionend` (tests/native_ime.rs); dioxus-vdom (upstream's renamed
# dioxus-core) — a dropped handler's owner is not a panic.
[patch."https://github.com/DioxusLabs/dioxus"]
dioxus-native = { git = "https://github.com/FastTrackStudios/vendor", tag = "v0.7.1" }
dioxus-native-dom = { git = "https://github.com/FastTrackStudios/vendor", rev = "25bf4bcdfd0b6acb268ca91a93bc8ff8da683a96" }
dioxus-vdom = { git = "https://github.com/FastTrackStudios/vendor", tag = "v0.7.1" }
[workspace.lints.rust]
dead_code = "warn"
unused = "warn"
unused_unsafe = "warn"
[workspace.lints.rustdoc]
broken_intra_doc_links = "allow"
private_intra_doc_links = "allow"
redundant_explicit_links = "allow"
[workspace.lints.clippy]
# See namtao.com/rust. pedantic + nursery teach good patterns; the rest
# make it a compile error to write code that can panic at runtime.
#
# There is no escape hatch: `#[allow(clippy::…)]` is banned in this repo.
# If a lint fires, the code changes — not the lint level. Tests are the
# one exception, granted by clippy.toml (allow-*-in-tests), because fast
# prototyping belongs there and a panicking test is just a failing test.
pedantic = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
# ── No panics ─────────────────────────────────────────────────────────
unwrap_used = "deny"
expect_used = "deny"
indexing_slicing = "deny"
arithmetic_side_effects = "deny"
unreachable = "deny"
unimplemented = "deny"
unchecked_time_subtraction = "deny"
todo = "deny"
string_slice = "deny"
panic_in_result_fn = "deny"
panic = "deny"
exit = "deny"
as_conversions = "deny"
# The ban on suppression, enforced by the compiler rather than by review:
# `#[allow(clippy::…)]` is itself an error here. `#[expect]` still works and
# must carry a reason — so the rare unavoidable case is a deliberate, dated,
# explained exception that fails loudly once it stops being needed, instead
# of an `allow` that quietly outlives its excuse.
allow_attributes = "deny"
allow_attributes_without_reason = "deny"
# ── Profiles ──────────────────────────────────────────────────────────
[profile.dev]
opt-level = 1
# Debuginfo discipline. Full DWARF was the single biggest cost in the
# monorepo: a `debug` test binary measured 1.62 GB, of which 98% was
# `.debug_*` sections, copied into every artifact on every relink.
#
# line-tables-only keeps file:line in backtraces + profiler symbols
# (samply/perf still work); drops variable/type DWARF,
# so a *debugger* can't inspect locals.
# unpacked leaves the remaining DWARF in the .o files under
# deps/ instead of copying it into each artifact.
#
# Need a real debugger session? Build with `--profile dev-dbg`.
debug = "line-tables-only"
split-debuginfo = "unpacked"
# Escape hatch: full DWARF for stepping in gdb/lldb.
[profile.dev-dbg]
inherits = "dev"
debug = 2
split-debuginfo = "packed"
# dx web builds: native debuginfo in the wasm module blew past Chrome's
# 1 GiB WebAssembly module cap (1.14 GB observed). Wasm dev builds don't
# need it — strip it and dev bundles come back to a loadable size.
[profile.wasm-dev]
inherits = "dev"
debug = false
strip = "debuginfo"
[profile.wasm-dev.package."*"]
opt-level = 3
# Dependencies at opt-level 1: gets rid of the pathological O0 debug
# codegen at a fraction of the compile cost. Applies to dependencies only
# — workspace members are governed by profile.dev's base opt-level.
[profile.dev.package."*"]
opt-level = 1
[profile.dev.build-override]
opt-level = 3
debug = false