Add a shared error type and shared file helpers to the Rust host

Replace the three error styles with one Error type and one Result alias in
error.rs. The error crosses IPC as the same plain string as before. The
message text does not change.

Move the shared file mechanics to fsutil.rs. These are the reserved-name
check, the link and junction check, the limited reads, and the atomic
writes. Each module keeps its own path rules, limits, and messages. The
plugin settings writer now flushes its file to disk before the rename.

Remove the current_root_path and list_entries wrappers and an unused mime
value. Use named windows-sys constants for the process, file, drive, and
error codes.

Add a test that compares the command lists in lib.rs, build.rs, and the
capability files. The settings capability must be a subset of the full list.

In Cargo.toml, set the author, keep only the rlib crate type, and remove
the unused thiserror dependency. Remove panic = "abort" from the release
profile. A panic on a worker thread then stops only that thread. It does
not stop the editor with unsaved buffers.
This commit is contained in:
Knotty Wyvern
2026-10-27 22:41:11 -07:00
parent 69f90df571
commit bd46f3a189
18 changed files with 1103 additions and 882 deletions
+3 -5
View File
@@ -2,12 +2,12 @@
name = "runestone"
version = "0.1.44"
description = "Writing workspace plus script editor"
authors = ["you"]
authors = ["Knotty Wyvern"]
edition = "2021"
[lib]
name = "runestone_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
crate-type = ["rlib"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
@@ -17,7 +17,6 @@ tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2.0.20"
notify = "8.2.0"
ignore = "0.4.33"
dunce = "1.0.5"
@@ -30,7 +29,7 @@ uuid = { version = "1", features = ["v4"] }
reqwest = { version = "0.13.5", default-features = false, features = ["blocking", "native-tls"] }
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61.2", features = ["Win32_Storage_FileSystem", "Win32_UI_Input_KeyboardAndMouse"] }
windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Threading", "Win32_System_WindowsProgramming", "Win32_UI_Input_KeyboardAndMouse"] }
webview2-com = "0.38.2"
windows = { version = "0.61.3", features = ["Win32_Foundation", "Win32_System_Com", "Win32_Globalization"] }
@@ -40,7 +39,6 @@ windows = { version = "0.61.3", features = ["Win32_Foundation", "Win32_System_Co
codegen-units = 1
lto = true
opt-level = 3
panic = "abort"
strip = true
[package.metadata.runestone]