-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathCargo.toml
More file actions
227 lines (201 loc) · 9.12 KB
/
Cargo.toml
File metadata and controls
227 lines (201 loc) · 9.12 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
[package]
name = "ferrite"
version = "0.2.7"
edition = "2021"
description = "A fast, lightweight text editor for Markdown, JSON, and more"
repository = "https://github.com/OlaProeis/Ferrite"
license = "MIT"
authors = ["OlaProeis"]
keywords = ["markdown", "editor", "text-editor", "egui"]
categories = ["text-editors", "gui"]
[features]
default = ["bundle-icon", "high-perf-alloc"]
# Bundle application icon in the binary (requires assets/icons/icon_256.png to exist)
bundle-icon = []
# Use high-performance memory allocators (mimalloc on Windows, jemalloc on Unix)
# This reduces heap fragmentation and memory usage, especially for long-running sessions.
# Disable with: cargo build --no-default-features --features bundle-icon
high-perf-alloc = ["mimalloc", "tikv-jemallocator"]
# Async worker infrastructure for background operations (AI, SSH, database)
async-workers = ["tokio", "poll-promise"]
[dependencies]
egui = { version = "0.28", features = ["serde"] }
eframe = "0.28"
comrak = "0.22"
syntect = "5.1"
two-face = "0.5" # Extra syntax definitions (PowerShell, TypeScript, etc.)
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
toml = "0.8"
dirs = "5"
open = "5"
rfd = "0.14"
log = "0.4"
env_logger = "0.11"
regex = "1"
arboard = "3"
clap = { version = "4", features = ["derive"] }
# Workspace support
# File system watcher - use default features for proper platform backends:
# - Linux: inotify (fast, event-based)
# - macOS: fsevent (default) or kqueue
# - Windows: ReadDirectoryChangesW
# Note: Previously had default-features = false which forced polling backend on Linux,
# causing 10+ second freezes when opening folders.
notify = "6"
fuzzy-matcher = "0.3"
walkdir = "2"
# Git integration (no SSH/HTTPS - we only need local repo status)
git2 = { version = "0.19", default-features = false }
# Icon loading + markdown image rendering (PNG, JPEG, GIF, WebP, BMP)
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp", "bmp"] }
font-kit = "0.14.3"
# Internationalization
rust-i18n = "3"
sys-locale = "0.3"
# Hashing for Mermaid diagram caching
blake3 = "1.5"
# CSV parsing for table viewer
csv = "1.3"
# Color palette generation for rainbow column coloring
palette = "0.7"
# Slug generation for Table of Contents anchors
slug = "0.1"
# Date/time formatting for snippets
chrono = "0.4"
# Rope data structure for efficient large text editing
ropey = "1.6"
# Character encoding detection and conversion
encoding_rs = "0.8"
chardetng = "0.1"
# Terminal emulation
portable-pty = "0.8"
vte = "0.13"
ctrlc = "3.5.1"
# HTTP client for update checking (lightweight, blocking)
ureq = { version = "2", default-features = false, features = ["tls", "json"] }
# Async runtime for background workers (optional, feature-gated)
tokio = { version = "1.49", features = ["rt-multi-thread", "macros", "sync", "time"], optional = true }
poll-promise = { version = "0.3", optional = true }
# HarfBuzz shaping in pure Rust — pin exact version (newer crate; see docs/technical/editor/harfrust-text-shaping.md)
harfrust = "0.5.2"
unicode-script = "0.5"
unicode-segmentation = "1.11"
unicode-width = "0.1"
# PDF rendering (pure Rust, CPU-based)
hayro = "0.5"
# High-performance memory allocators (platform-specific)
# mimalloc for Windows: faster allocation, reduced fragmentation
# jemalloc for Unix: mature, well-tested, reduces memory usage
[target.'cfg(windows)'.dependencies]
mimalloc = { version = "0.1", default-features = false, optional = true }
[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { version = "0.6", optional = true }
[dev-dependencies]
tempfile = "3"
[build-dependencies]
# Windows icon embedding
embed-resource = "2.4"
# Release build optimizations
# Note: We avoid aggressive size optimization and symbol stripping to reduce
# false positive detections by antivirus software (particularly Windows Defender's
# ML-based heuristics). See README.md "Antivirus False Positives" section.
[profile.release]
lto = "thin" # Link-time optimization (thin is faster, less aggressive)
codegen-units = 1 # Single codegen unit for better optimization
panic = "abort" # No unwinding, smaller binary
opt-level = 3 # Optimize for speed (not size - "z" can trigger AV heuristics)
# strip = "symbols" # DISABLED: Stripping symbols can trigger AV false positives
# Development profile with some optimizations for faster testing
[profile.dev.package."*"]
opt-level = 2 # Optimize dependencies in dev builds
# ============================================================================
# Linux .deb package configuration (cargo-deb)
# Build with: cargo deb
# ============================================================================
[package.metadata.deb]
name = "ferrite-editor"
maintainer = "OlaProeis <[email protected]>"
copyright = "2024-2026, OlaProeis"
license-file = ["LICENSE", "0"]
extended-description = """Ferrite is a fast, lightweight text editor built with Rust and egui.
Features include:
- Markdown editing with live preview
- Split view (raw + rendered side-by-side)
- JSON/YAML/TOML tree viewer
- MermaidJS diagram rendering
- Git integration with file status indicators
- Syntax highlighting for code blocks
- Zen mode for distraction-free writing
- Session persistence and auto-save"""
section = "editors"
priority = "optional"
depends = "$auto"
assets = [
# Binary
["target/release/ferrite", "usr/bin/ferrite", "755"],
# Desktop entry
["assets/icons/linux/ferrite.desktop", "usr/share/applications/ferrite.desktop", "644"],
# Icons at various sizes
["assets/icons/icon_16.png", "usr/share/icons/hicolor/16x16/apps/ferrite.png", "644"],
["assets/icons/icon_32.png", "usr/share/icons/hicolor/32x32/apps/ferrite.png", "644"],
["assets/icons/icon_48.png", "usr/share/icons/hicolor/48x48/apps/ferrite.png", "644"],
["assets/icons/icon_64.png", "usr/share/icons/hicolor/64x64/apps/ferrite.png", "644"],
["assets/icons/icon_128.png", "usr/share/icons/hicolor/128x128/apps/ferrite.png", "644"],
["assets/icons/icon_256.png", "usr/share/icons/hicolor/256x256/apps/ferrite.png", "644"],
["assets/icons/icon_512.png", "usr/share/icons/hicolor/512x512/apps/ferrite.png", "644"],
# Documentation
["README.md", "usr/share/doc/ferrite-editor/README.md", "644"],
["LICENSE", "usr/share/doc/ferrite-editor/LICENSE", "644"],
]
# ============================================================================
# Linux .rpm package configuration (cargo-generate-rpm)
# Build with: cargo generate-rpm
# ============================================================================
[package.metadata.generate-rpm]
name = "ferrite-editor"
license = "MIT"
summary = "A fast, lightweight text editor for Markdown, JSON, and more"
url = "https://github.com/OlaProeis/Ferrite"
assets = [
# Binary
{ source = "target/release/ferrite", dest = "/usr/bin/ferrite", mode = "755" },
# Desktop entry
{ source = "assets/icons/linux/ferrite.desktop", dest = "/usr/share/applications/ferrite.desktop", mode = "644" },
# Icons at various sizes
{ source = "assets/icons/icon_16.png", dest = "/usr/share/icons/hicolor/16x16/apps/ferrite.png", mode = "644" },
{ source = "assets/icons/icon_32.png", dest = "/usr/share/icons/hicolor/32x32/apps/ferrite.png", mode = "644" },
{ source = "assets/icons/icon_48.png", dest = "/usr/share/icons/hicolor/48x48/apps/ferrite.png", mode = "644" },
{ source = "assets/icons/icon_64.png", dest = "/usr/share/icons/hicolor/64x64/apps/ferrite.png", mode = "644" },
{ source = "assets/icons/icon_128.png", dest = "/usr/share/icons/hicolor/128x128/apps/ferrite.png", mode = "644" },
{ source = "assets/icons/icon_256.png", dest = "/usr/share/icons/hicolor/256x256/apps/ferrite.png", mode = "644" },
{ source = "assets/icons/icon_512.png", dest = "/usr/share/icons/hicolor/512x512/apps/ferrite.png", mode = "644" },
# Documentation
{ source = "README.md", dest = "/usr/share/doc/ferrite-editor/README.md", mode = "644", doc = true },
{ source = "LICENSE", dest = "/usr/share/doc/ferrite-editor/LICENSE", mode = "644", doc = true },
]
# ============================================================================
# Windows .msi installer configuration (cargo-wix)
# Build with: cargo wix
# ============================================================================
[package.metadata.wix]
name = "Ferrite"
manufacturer = "OlaProeis"
product-icon = "assets/icons/windows/app.ico"
license = false
eula = false
# ============================================================================
# macOS .app bundle configuration (cargo-bundle)
# Build with: cargo bundle --release
# ============================================================================
[package.metadata.bundle]
name = "Ferrite"
identifier = "com.olaproeis.ferrite"
icon = ["assets/icons/macos/Ferrite.icns"]
short_description = "A fast, lightweight text editor"
long_description = """Ferrite is a fast, lightweight text editor built with Rust and egui.
Features include Markdown editing with live preview, JSON/YAML/TOML tree viewer,
Git integration, and syntax highlighting."""
category = "public.app-category.developer-tools"
osx_info_plist_exts = ["assets/macos/info_plist_ext.xml"]