forked from sinelaw/fresh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
236 lines (217 loc) · 9.23 KB
/
Cargo.toml
File metadata and controls
236 lines (217 loc) · 9.23 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
[package]
name = "fresh-editor"
version = "0.1.67"
authors = ["Noam Lewis"]
edition = "2021"
default-run = "fresh"
description = "A lightweight, fast terminal-based text editor with LSP support and TypeScript plugins"
license = "GPL-2.0"
repository = "https://github.com/sinelaw/fresh"
homepage = "https://sinelaw.github.io/fresh/"
keywords = ["editor", "terminal", "tui", "text-editor", "lsp"]
categories = ["command-line-utilities", "text-editors"]
[[bin]]
name = "fresh"
path = "src/main.rs"
required-features = ["runtime"]
[[bin]]
name = "generate_schema"
path = "src/bin/generate_schema.rs"
required-features = ["dev-bins"]
[[bin]]
name = "event_debug"
path = "src/bin/event_debug.rs"
required-features = ["dev-bins", "runtime"]
[lib]
name = "fresh"
path = "src/lib.rs"
[features]
default = ["plugins", "runtime", "embed-plugins"]
plugins = ["dep:deno_core", "dep:deno_ast", "dep:deno_error"]
# Embed plugins into the binary as a fallback when no disk plugins are found
embed-plugins = ["plugins", "dep:include_dir", "dep:tempfile"]
# Feature for optional development binaries (generate_schema, event_debug)
dev-bins = []
# Runtime feature includes all heavy dependencies needed for the actual editor
runtime = [
"dep:crossterm",
"dep:ratatui",
"dep:chrono",
"dep:clap",
"dep:tracing",
"dep:tracing-subscriber",
"dep:tree-sitter",
"dep:tree-sitter-highlight",
"dep:tree-sitter-rust",
"dep:tree-sitter-python",
"dep:tree-sitter-javascript",
"dep:tree-sitter-typescript",
"dep:tree-sitter-html",
"dep:tree-sitter-css",
"dep:tree-sitter-c",
"dep:tree-sitter-cpp",
"dep:tree-sitter-go",
"dep:tree-sitter-json",
"dep:tree-sitter-java",
"dep:tree-sitter-c-sharp",
"dep:tree-sitter-php",
"dep:tree-sitter-ruby",
"dep:tree-sitter-bash",
"dep:tree-sitter-lua",
"dep:tree-sitter-pascal",
"dep:lsp-types",
"dep:url",
"dep:tokio",
"dep:async-trait",
"dep:lru",
"dep:ignore",
"dep:regex",
"dep:libc",
"dep:libloading",
"dep:nix",
"dep:anyhow",
"dep:dirs",
"dep:pulldown-cmark",
"dep:sha2",
"dep:arboard",
"dep:syntect",
"dep:ureq",
"dep:unicode-width",
"dep:unicode-segmentation",
"dep:alacritty_terminal",
"dep:portable-pty",
"dep:trash",
]
# Schema-only feature for minimal builds (just schema generation)
schema-only = []
[dependencies]
# Always required (for schema generation and runtime)
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
schemars = { version = "1.2", features = ["preserve_order"] } # JSON Schema generation for config editor
rust-i18n = "3" # Internationalization support
# Runtime dependencies (optional, enabled by "runtime" feature)
crossterm = { version = "0.29.0", features = ["osc52"], optional = true }
ratatui = { version = "0.29.0", optional = true }
chrono = { version = "0.4", default-features = false, features = ["std", "clock"], optional = true }
clap = { version = "4.5", default-features = false, features = ["derive", "std", "help", "usage", "error-context"], optional = true }
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
tree-sitter = { version = "0.25.10", optional = true }
tree-sitter-highlight = { version = "0.25.10", optional = true }
tree-sitter-rust = { version = "0.24.0", optional = true }
lsp-types = { version = "0.97", default-features = false, optional = true }
url = { version = "2.5", optional = true }
tokio = { version = "1.48", features = ["fs", "io-util", "process", "rt", "rt-multi-thread", "sync", "time", "macros"], optional = true }
async-trait = { version = "0.1", optional = true }
lru = { version = "0.16", optional = true }
ignore = { version = "0.4", default-features = false, optional = true }
regex = { version = "1.12", optional = true }
libc = { version = "0.2", optional = true }
libloading = { version = "0.9", optional = true }
nix = { version = "0.30", features = ["signal", "pthread", "resource", "poll", "fs"], optional = true }
deno_core = { version = "0.376.0", default-features = false, features = ["v8_use_custom_libcxx"], optional = true }
deno_ast = { version = "0.51.0", default-features = false, features = ["transpiling"], optional = true }
deno_error = { version = "0.7", optional = true }
tree-sitter-python = { version = "0.25.0", optional = true }
tree-sitter-javascript = { version = "0.25.0", optional = true }
tree-sitter-typescript = { version = "0.23.2", optional = true }
tree-sitter-html = { version = "0.23.2", optional = true }
tree-sitter-css = { version = "0.25.0", optional = true }
tree-sitter-c = { version = "0.24.1", optional = true }
tree-sitter-cpp = { version = "0.23.4", optional = true }
tree-sitter-go = { version = "0.25.0", optional = true }
tree-sitter-json = { version = "0.24.8", optional = true }
tree-sitter-java = { version = "0.23.5", optional = true }
tree-sitter-c-sharp = { version = "0.23.1", optional = true }
tree-sitter-php = { version = "0.24.2", optional = true }
tree-sitter-ruby = { version = "0.23.1", optional = true }
tree-sitter-bash = { version = "0.25.1", optional = true }
tree-sitter-lua = { version = "0.2.0", optional = true }
tree-sitter-pascal = { version = "0.10.2", optional = true }
anyhow = { version = "1.0.100", default-features = false, optional = true }
dirs = { version = "6.0", optional = true }
pulldown-cmark = { version = "0.13", default-features = false, optional = true }
sha2 = { version = "0.10", optional = true }
arboard = { version = "3.6", default-features = false, features = ["wayland-data-control"], optional = true }
syntect = { version = "5.3", optional = true }
ureq = { version = "2.12", default-features = false, features = ["tls"], optional = true }
unicode-width = { version = "0.2", optional = true }
unicode-segmentation = { version = "1.12", optional = true }
# Terminal emulation (optional)
alacritty_terminal = { version = "0.25", optional = true }
portable-pty = { version = "0.9", optional = true }
# Embedded plugins support (optional)
include_dir = { version = "0.7", optional = true }
tempfile = { version = "3.24", optional = true }
trash = { version = "5.2.5", optional = true }
[dev-dependencies]
proptest = "1.9"
tempfile = "3.24.0"
insta = { version = "1.45", features = ["yaml"] }
vt100 = "0.15" # Virtual terminal emulator for testing real ANSI output
ctor = "0.6.3"
tiny_http = "0.12" # Lightweight HTTP server for testing release checker
unicode-segmentation = "1.12" # For grapheme cluster testing
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_Threading"] }
[build-dependencies]
serde_json = "1.0"
[profile.release]
debug = true
split-debuginfo = "packed"
# The profile that 'dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"
[package.metadata.dist]
# Point dist at the changelog so GitHub Releases get populated
changelog = "CHANGELOG.md"
# Debian package configuration for cargo-deb
[package.metadata.deb]
maintainer = "Noam Lewis"
section = "editors"
priority = "optional"
depends = "$auto"
assets = [
# Binary goes in /usr/share/fresh-editor/ alongside plugins
["target/release/fresh", "usr/share/fresh-editor/", "755"],
["README.md", "usr/share/doc/fresh-editor/", "644"],
["plugins/*", "usr/share/fresh-editor/plugins/", "644"],
["plugins/lib/*", "usr/share/fresh-editor/plugins/lib/", "644"],
["plugins/examples/*", "usr/share/fresh-editor/plugins/examples/", "644"],
["themes/*", "usr/share/fresh-editor/themes/", "644"],
]
# Maintainer scripts to create/remove symlink at /usr/bin/fresh
maintainer-scripts = "debian/"
extended-description = """
Fresh is a lightweight, fast terminal-based text editor with LSP support
and TypeScript plugins. It provides syntax highlighting, code completion,
and other IDE-like features in a minimal terminal interface."""
# RPM package configuration for cargo-generate-rpm
[package.metadata.generate-rpm]
assets = [
# Binary goes in /usr/share/fresh-editor/ alongside plugins
{ source = "target/release/fresh", dest = "/usr/share/fresh-editor/fresh", mode = "755" },
# Wrapper script in /usr/bin for PATH access
{ source = "scripts/fresh-wrapper.sh", dest = "/usr/bin/fresh", mode = "755" },
{ source = "README.md", dest = "/usr/share/doc/fresh-editor/README.md", mode = "644" },
{ source = "plugins/*.ts", dest = "/usr/share/fresh-editor/plugins/", mode = "644" },
{ source = "plugins/*.json", dest = "/usr/share/fresh-editor/plugins/", mode = "644" },
{ source = "plugins/*.md", dest = "/usr/share/fresh-editor/plugins/", mode = "644" },
{ source = "plugins/lib/*", dest = "/usr/share/fresh-editor/plugins/lib/", mode = "644" },
{ source = "plugins/examples/*", dest = "/usr/share/fresh-editor/plugins/examples/", mode = "644" },
{ source = "themes/*.json", dest = "/usr/share/fresh-editor/themes/", mode = "644" },
]
# posttrans runs after ALL transaction operations complete - needed because older versions
# (<=0.1.56) had a preuninstall script that removes /usr/bin/fresh, which deletes our wrapper
# during upgrades. This script restores it.
post_trans_script = """
if [ ! -e /usr/bin/fresh ]; then
cat > /usr/bin/fresh << 'WRAPPER'
#!/bin/sh
exec /usr/share/fresh-editor/fresh "$@"
WRAPPER
chmod 755 /usr/bin/fresh
fi
"""