diff --git a/Cargo.lock b/Cargo.lock index 7db79e403..253e98d65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -376,7 +376,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1728,7 +1728,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2551,9 +2551,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" +checksum = "7a44eede9b727419af8095cb2d72fab15487a541f54647ad4414b34096ee4631" dependencies = [ "indexmap", "serde", @@ -2564,18 +2564,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.17" +version = "0.22.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" +checksum = "1490595c74d930da779e944f5ba2ecdf538af67df1a9848cbd156af43c1b7cf0" dependencies = [ "indexmap", "serde", @@ -2983,7 +2983,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ "windows-core 0.56.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2992,7 +2992,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3004,7 +3004,7 @@ dependencies = [ "windows-implement", "windows-interface", "windows-result", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3035,7 +3035,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3053,7 +3053,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3073,18 +3082,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3095,9 +3104,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3107,9 +3116,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3119,15 +3128,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3137,9 +3146,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3149,9 +3158,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3161,9 +3170,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3173,15 +3182,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" dependencies = [ "memchr", ] @@ -3194,7 +3203,7 @@ checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" [[package]] name = "yazi-adapter" -version = "0.2.5" +version = "0.3.0" dependencies = [ "ansi-to-tui", "anyhow", @@ -3216,7 +3225,7 @@ dependencies = [ [[package]] name = "yazi-boot" -version = "0.2.5" +version = "0.3.0" dependencies = [ "clap", "clap_complete", @@ -3232,7 +3241,7 @@ dependencies = [ [[package]] name = "yazi-cli" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "clap", @@ -3252,7 +3261,7 @@ dependencies = [ [[package]] name = "yazi-config" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "arc-swap", @@ -3270,7 +3279,7 @@ dependencies = [ [[package]] name = "yazi-core" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -3281,7 +3290,6 @@ dependencies = [ "notify", "parking_lot", "ratatui", - "regex", "scopeguard", "serde", "shell-words", @@ -3294,6 +3302,7 @@ dependencies = [ "yazi-boot", "yazi-config", "yazi-dds", + "yazi-fs", "yazi-plugin", "yazi-proxy", "yazi-scheduler", @@ -3302,7 +3311,7 @@ dependencies = [ [[package]] name = "yazi-dds" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "mlua", @@ -3321,7 +3330,7 @@ dependencies = [ [[package]] name = "yazi-fm" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "better-panic", @@ -3345,14 +3354,29 @@ dependencies = [ "yazi-config", "yazi-core", "yazi-dds", + "yazi-fs", "yazi-plugin", "yazi-proxy", "yazi-shared", ] +[[package]] +name = "yazi-fs" +version = "0.3.0" +dependencies = [ + "anyhow", + "futures", + "ratatui", + "regex", + "tokio", + "yazi-config", + "yazi-proxy", + "yazi-shared", +] + [[package]] name = "yazi-plugin" -version = "0.2.5" +version = "0.3.0" dependencies = [ "ansi-to-tui", "anyhow", @@ -3390,7 +3414,7 @@ checksum = "f4b6c8e12e39ac0f79fa96f36e5b88e0da8d230691abd729eec709b43c74f632" [[package]] name = "yazi-proxy" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "mlua", @@ -3401,7 +3425,7 @@ dependencies = [ [[package]] name = "yazi-scheduler" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "async-priority-channel", @@ -3421,7 +3445,7 @@ dependencies = [ [[package]] name = "yazi-shared" -version = "0.2.5" +version = "0.3.0" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -3436,7 +3460,7 @@ dependencies = [ "serde", "shell-words", "tokio", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/yazi-adapter/Cargo.toml b/yazi-adapter/Cargo.toml index 9541686da..3224b6a33 100644 --- a/yazi-adapter/Cargo.toml +++ b/yazi-adapter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-adapter" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -9,8 +9,8 @@ homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" [dependencies] -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies ansi-to-tui = "=3.1.0" diff --git a/yazi-boot/Cargo.toml b/yazi-boot/Cargo.toml index ea2c81085..b334dfb6b 100644 --- a/yazi-boot/Cargo.toml +++ b/yazi-boot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-boot" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -10,9 +10,9 @@ repository = "https://github.com/sxyazi/yazi" [dependencies] regex = "1.10.5" -yazi-adapter = { path = "../yazi-adapter", version = "0.2.5" } -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-adapter = { path = "../yazi-adapter", version = "0.3.0" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies clap = { version = "4.5.11", features = [ "derive" ] } diff --git a/yazi-cli/Cargo.toml b/yazi-cli/Cargo.toml index a6cd1afa3..b512f4a06 100644 --- a/yazi-cli/Cargo.toml +++ b/yazi-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-cli" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -9,9 +9,9 @@ homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" [dependencies] -yazi-boot = { path = "../yazi-boot", version = "0.2.5" } -yazi-dds = { path = "../yazi-dds", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-boot = { path = "../yazi-boot", version = "0.3.0" } +yazi-dds = { path = "../yazi-dds", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" @@ -20,10 +20,10 @@ crossterm = "0.27.0" md-5 = "0.10.6" serde_json = "1.0.121" tokio = { version = "1.39.2", features = [ "full" ] } -toml_edit = "0.22.17" +toml_edit = "0.22.18" [build-dependencies] -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External build dependencies anyhow = "1.0.86" diff --git a/yazi-config/Cargo.toml b/yazi-config/Cargo.toml index e63ac5103..c5b778c1c 100644 --- a/yazi-config/Cargo.toml +++ b/yazi-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-config" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -9,7 +9,7 @@ homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" [dependencies] -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" @@ -21,7 +21,7 @@ indexmap = "2.2.6" ratatui = "0.27.0" regex = "1.10.5" serde = { version = "1.0.204", features = [ "derive" ] } -toml = { version = "0.8.16", features = [ "preserve_order" ] } +toml = { version = "0.8.17", features = [ "preserve_order" ] } validator = { version = "0.18.1", features = [ "derive" ] } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/yazi-core/Cargo.toml b/yazi-core/Cargo.toml index 8ac5454b1..5acc011ad 100644 --- a/yazi-core/Cargo.toml +++ b/yazi-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-core" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -9,14 +9,15 @@ homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" [dependencies] -yazi-adapter = { path = "../yazi-adapter", version = "0.2.5" } -yazi-boot = { path = "../yazi-boot", version = "0.2.5" } -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-dds = { path = "../yazi-dds", version = "0.2.5" } -yazi-plugin = { path = "../yazi-plugin", version = "0.2.5" } -yazi-proxy = { path = "../yazi-proxy", version = "0.2.5" } -yazi-scheduler = { path = "../yazi-scheduler", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-adapter = { path = "../yazi-adapter", version = "0.3.0" } +yazi-boot = { path = "../yazi-boot", version = "0.3.0" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-dds = { path = "../yazi-dds", version = "0.3.0" } +yazi-fs = { path = "../yazi-fs", version = "0.3.0" } +yazi-plugin = { path = "../yazi-plugin", version = "0.3.0" } +yazi-proxy = { path = "../yazi-proxy", version = "0.3.0" } +yazi-scheduler = { path = "../yazi-scheduler", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" @@ -27,7 +28,6 @@ futures = "0.3.30" notify = { git = "https://github.com/notify-rs/notify.git", rev = "96dec74316a93bed6eec9db177b233e6e017275e", default-features = false, features = [ "macos_fsevent" ] } parking_lot = "0.12.3" ratatui = "0.27.0" -regex = "1.10.5" scopeguard = "1.2.0" serde = "1.0.204" shell-words = "1.1.0" diff --git a/yazi-core/src/lib.rs b/yazi-core/src/lib.rs index 2d9696ec6..88bdc2b00 100644 --- a/yazi-core/src/lib.rs +++ b/yazi-core/src/lib.rs @@ -7,19 +7,15 @@ )] pub mod completion; -pub mod folder; pub mod help; pub mod input; pub mod manager; pub mod notify; pub mod select; -mod step; pub mod tab; pub mod tasks; pub mod which; -pub use step::*; - pub fn init() { manager::WATCHED.with(<_>::default); manager::LINKED.with(<_>::default); diff --git a/yazi-core/src/manager/commands/open.rs b/yazi-core/src/manager/commands/open.rs index 1b36edc1a..c0194708e 100644 --- a/yazi-core/src/manager/commands/open.rs +++ b/yazi-core/src/manager/commands/open.rs @@ -3,11 +3,12 @@ use std::{borrow::Cow, ffi::OsString}; use tracing::error; use yazi_boot::ARGS; use yazi_config::{popup::SelectCfg, OPEN}; +use yazi_fs::Folder; use yazi_plugin::isolate; use yazi_proxy::{options::OpenDoOpt, ManagerProxy, TasksProxy}; use yazi_shared::{emit, event::{Cmd, EventQuit}, fs::{File, Url}, MIME_DIR}; -use crate::{folder::Folder, manager::Manager, tasks::Tasks}; +use crate::{manager::Manager, tasks::Tasks}; #[derive(Clone, Copy)] pub struct Opt { diff --git a/yazi-core/src/manager/commands/update_files.rs b/yazi-core/src/manager/commands/update_files.rs index 10a73c8a8..3f5e630b5 100644 --- a/yazi-core/src/manager/commands/update_files.rs +++ b/yazi-core/src/manager/commands/update_files.rs @@ -1,9 +1,10 @@ use std::borrow::Cow; +use yazi_fs::Folder; use yazi_proxy::ManagerProxy; use yazi_shared::{event::Cmd, fs::FilesOp, render}; -use crate::{folder::Folder, manager::{Manager, LINKED}, tab::Tab, tasks::Tasks}; +use crate::{manager::{Manager, LINKED}, tab::Tab, tasks::Tasks}; pub struct Opt { op: FilesOp, diff --git a/yazi-core/src/manager/manager.rs b/yazi-core/src/manager/manager.rs index 38f6d6716..91831f0ac 100644 --- a/yazi-core/src/manager/manager.rs +++ b/yazi-core/src/manager/manager.rs @@ -1,9 +1,10 @@ use std::collections::HashMap; +use yazi_fs::Folder; use yazi_shared::fs::{File, Url}; use super::{Tabs, Watcher, Yanked}; -use crate::{folder::Folder, tab::Tab}; +use crate::tab::Tab; pub struct Manager { pub tabs: Tabs, diff --git a/yazi-core/src/manager/watcher.rs b/yazi-core/src/manager/watcher.rs index a2c14d922..d417936a8 100644 --- a/yazi-core/src/manager/watcher.rs +++ b/yazi-core/src/manager/watcher.rs @@ -6,12 +6,12 @@ use parking_lot::RwLock; use tokio::{fs, pin, sync::{mpsc::{self, UnboundedReceiver}, watch}}; use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; use tracing::error; +use yazi_fs::{Files, Folder}; use yazi_plugin::isolate; use yazi_proxy::WATCHER; use yazi_shared::{fs::{symlink_realname, File, FilesOp, Url}, RoCell}; use super::Linked; -use crate::folder::{Files, Folder}; pub(crate) static WATCHED: RoCell>> = RoCell::new(); pub static LINKED: RoCell> = RoCell::new(); diff --git a/yazi-core/src/tab/commands/arrow.rs b/yazi-core/src/tab/commands/arrow.rs index 49ec378c7..867bd918b 100644 --- a/yazi-core/src/tab/commands/arrow.rs +++ b/yazi-core/src/tab/commands/arrow.rs @@ -1,7 +1,8 @@ +use yazi_fs::Step; use yazi_proxy::ManagerProxy; use yazi_shared::{event::{Cmd, Data}, render}; -use crate::{tab::Tab, Step}; +use crate::tab::Tab; pub struct Opt { step: Step, @@ -19,11 +20,8 @@ impl From for Opt { } } -impl From for Opt -where - T: Into, -{ - fn from(t: T) -> Self { Self { step: t.into() } } +impl From for Opt { + fn from(n: isize) -> Self { Self { step: n.into() } } } impl Tab { diff --git a/yazi-core/src/tab/commands/filter.rs b/yazi-core/src/tab/commands/filter.rs index 38a2c46bc..a6fdfc69f 100644 --- a/yazi-core/src/tab/commands/filter.rs +++ b/yazi-core/src/tab/commands/filter.rs @@ -3,10 +3,11 @@ use std::time::Duration; use tokio::pin; use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; use yazi_config::popup::InputCfg; +use yazi_fs::{Filter, FilterCase}; use yazi_proxy::{InputProxy, ManagerProxy}; use yazi_shared::{emit, event::Cmd, render, Debounce, InputError, Layer}; -use crate::{folder::{Filter, FilterCase}, tab::Tab}; +use crate::tab::Tab; #[derive(Default)] pub struct Opt { diff --git a/yazi-core/src/tab/commands/find.rs b/yazi-core/src/tab/commands/find.rs index 3676182b5..9dbd43ccd 100644 --- a/yazi-core/src/tab/commands/find.rs +++ b/yazi-core/src/tab/commands/find.rs @@ -3,10 +3,11 @@ use std::time::Duration; use tokio::pin; use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; use yazi_config::popup::InputCfg; +use yazi_fs::FilterCase; use yazi_proxy::InputProxy; use yazi_shared::{emit, event::Cmd, render, Debounce, InputError, Layer}; -use crate::{folder::FilterCase, tab::{Finder, Tab}}; +use crate::tab::{Finder, Tab}; pub struct Opt { query: Option, diff --git a/yazi-core/src/tab/config.rs b/yazi-core/src/tab/config.rs index edce7fb7a..49124e70b 100644 --- a/yazi-core/src/tab/config.rs +++ b/yazi-core/src/tab/config.rs @@ -1,6 +1,5 @@ use yazi_config::{manager::SortBy, MANAGER}; - -use crate::folder::FilesSorter; +use yazi_fs::FilesSorter; #[derive(Clone, PartialEq)] pub struct Config { diff --git a/yazi-core/src/tab/finder.rs b/yazi-core/src/tab/finder.rs index 2da8571ac..48a9b6be1 100644 --- a/yazi-core/src/tab/finder.rs +++ b/yazi-core/src/tab/finder.rs @@ -1,10 +1,9 @@ use std::collections::HashMap; use anyhow::Result; +use yazi_fs::{Files, Filter, FilterCase}; use yazi_shared::fs::Url; -use crate::folder::{Files, Filter, FilterCase}; - pub struct Finder { pub filter: Filter, matched: HashMap, diff --git a/yazi-core/src/tab/preview.rs b/yazi-core/src/tab/preview.rs index dd80d5b97..11d77528f 100644 --- a/yazi-core/src/tab/preview.rs +++ b/yazi-core/src/tab/preview.rs @@ -5,11 +5,10 @@ use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; use tokio_util::sync::CancellationToken; use yazi_adapter::ADAPTOR; use yazi_config::PLUGIN; +use yazi_fs::Files; use yazi_plugin::{external::Highlighter, isolate, utils::PreviewLock}; use yazi_shared::{fs::{Cha, File, FilesOp, Url}, MIME_DIR}; -use crate::folder::Files; - #[derive(Default)] pub struct Preview { pub lock: Option, diff --git a/yazi-core/src/tab/tab.rs b/yazi-core/src/tab/tab.rs index 35a372720..c6c553bf2 100644 --- a/yazi-core/src/tab/tab.rs +++ b/yazi-core/src/tab/tab.rs @@ -2,10 +2,11 @@ use std::{collections::HashMap, iter}; use anyhow::Result; use tokio::task::JoinHandle; +use yazi_fs::{Folder, FolderStage}; use yazi_shared::{fs::Url, render}; use super::{Backstack, Config, Finder, Mode, Preview}; -use crate::{folder::{Folder, FolderStage}, tab::Selected}; +use crate::tab::Selected; #[derive(Default)] pub struct Tab { diff --git a/yazi-core/src/tasks/preload.rs b/yazi-core/src/tasks/preload.rs index f2ce3d5b4..c430719b4 100644 --- a/yazi-core/src/tasks/preload.rs +++ b/yazi-core/src/tasks/preload.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; use yazi_config::{manager::SortBy, plugin::MAX_PREWORKERS, PLUGIN}; +use yazi_fs::Files; use yazi_shared::{fs::{File, Url}, MIME_DIR}; use super::Tasks; -use crate::folder::Files; impl Tasks { pub fn fetch_paged(&self, paged: &[File], mimetype: &HashMap) { diff --git a/yazi-dds/Cargo.toml b/yazi-dds/Cargo.toml index dca5e4fdc..f9e5f062a 100644 --- a/yazi-dds/Cargo.toml +++ b/yazi-dds/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-dds" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -13,8 +13,8 @@ default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] [dependencies] -yazi-boot = { path = "../yazi-boot", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-boot = { path = "../yazi-boot", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 2ffb2176f..f58688ab1 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-fm" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -13,14 +13,15 @@ default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] [dependencies] -yazi-adapter = { path = "../yazi-adapter", version = "0.2.5" } -yazi-boot = { path = "../yazi-boot", version = "0.2.5" } -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-core = { path = "../yazi-core", version = "0.2.5" } -yazi-dds = { path = "../yazi-dds", version = "0.2.5" } -yazi-plugin = { path = "../yazi-plugin", version = "0.2.5" } -yazi-proxy = { path = "../yazi-proxy", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-adapter = { path = "../yazi-adapter", version = "0.3.0" } +yazi-boot = { path = "../yazi-boot", version = "0.3.0" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-core = { path = "../yazi-core", version = "0.3.0" } +yazi-dds = { path = "../yazi-dds", version = "0.3.0" } +yazi-fs = { path = "../yazi-fs", version = "0.3.0" } +yazi-plugin = { path = "../yazi-plugin", version = "0.3.0" } +yazi-proxy = { path = "../yazi-proxy", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" diff --git a/yazi-fm/src/lives/file.rs b/yazi-fm/src/lives/file.rs index bb8e28c54..5a69b84fb 100644 --- a/yazi-fm/src/lives/file.rs +++ b/yazi-fm/src/lives/file.rs @@ -9,7 +9,7 @@ use super::{CtxRef, SCOPE}; pub(super) struct File { idx: usize, - folder: *const yazi_core::folder::Folder, + folder: *const yazi_fs::Folder, tab: *const yazi_core::tab::Tab, } @@ -27,7 +27,7 @@ impl File { #[inline] pub(super) fn make( idx: usize, - folder: &yazi_core::folder::Folder, + folder: &yazi_fs::Folder, tab: &yazi_core::tab::Tab, ) -> mlua::Result> { SCOPE.create_any_userdata(Self { idx, folder, tab }) @@ -125,7 +125,7 @@ impl File { } #[inline] - fn folder(&self) -> &yazi_core::folder::Folder { unsafe { &*self.folder } } + fn folder(&self) -> &yazi_fs::Folder { unsafe { &*self.folder } } #[inline] fn tab(&self) -> &yazi_core::tab::Tab { unsafe { &*self.tab } } diff --git a/yazi-fm/src/lives/files.rs b/yazi-fm/src/lives/files.rs index 1437986a9..bb19233c0 100644 --- a/yazi-fm/src/lives/files.rs +++ b/yazi-fm/src/lives/files.rs @@ -6,12 +6,12 @@ use super::{File, Filter, SCOPE}; pub(super) struct Files { window: Range, - folder: *const yazi_core::folder::Folder, + folder: *const yazi_fs::Folder, tab: *const yazi_core::tab::Tab, } impl Deref for Files { - type Target = yazi_core::folder::Files; + type Target = yazi_fs::Files; fn deref(&self) -> &Self::Target { &self.folder().files } } @@ -20,7 +20,7 @@ impl Files { #[inline] pub(super) fn make( window: Range, - folder: &yazi_core::folder::Folder, + folder: &yazi_fs::Folder, tab: &yazi_core::tab::Tab, ) -> mlua::Result> { SCOPE.create_any_userdata(Self { window, folder, tab }) @@ -46,7 +46,7 @@ impl Files { } #[inline] - fn folder(&self) -> &yazi_core::folder::Folder { unsafe { &*self.folder } } + fn folder(&self) -> &yazi_fs::Folder { unsafe { &*self.folder } } #[inline] fn tab(&self) -> &yazi_core::tab::Tab { unsafe { &*self.tab } } diff --git a/yazi-fm/src/lives/filter.rs b/yazi-fm/src/lives/filter.rs index 79c9119ce..c437b5090 100644 --- a/yazi-fm/src/lives/filter.rs +++ b/yazi-fm/src/lives/filter.rs @@ -5,18 +5,18 @@ use mlua::{AnyUserData, Lua, MetaMethod, UserDataMethods}; use super::SCOPE; pub(super) struct Filter { - inner: *const yazi_core::folder::Filter, + inner: *const yazi_fs::Filter, } impl Deref for Filter { - type Target = yazi_core::folder::Filter; + type Target = yazi_fs::Filter; fn deref(&self) -> &Self::Target { unsafe { &*self.inner } } } impl Filter { #[inline] - pub(super) fn make(inner: &yazi_core::folder::Filter) -> mlua::Result> { + pub(super) fn make(inner: &yazi_fs::Filter) -> mlua::Result> { SCOPE.create_any_userdata(Self { inner }) } diff --git a/yazi-fm/src/lives/folder.rs b/yazi-fm/src/lives/folder.rs index 95e3754e8..b12bdf80e 100644 --- a/yazi-fm/src/lives/folder.rs +++ b/yazi-fm/src/lives/folder.rs @@ -8,12 +8,12 @@ use super::{File, Files, SCOPE}; pub(super) struct Folder { window: Range, - inner: *const yazi_core::folder::Folder, + inner: *const yazi_fs::Folder, tab: *const yazi_core::tab::Tab, } impl Deref for Folder { - type Target = yazi_core::folder::Folder; + type Target = yazi_fs::Folder; fn deref(&self) -> &Self::Target { unsafe { &*self.inner } } } @@ -22,7 +22,7 @@ impl Folder { #[inline] pub(super) fn make( window: Option>, - inner: &yazi_core::folder::Folder, + inner: &yazi_fs::Folder, tab: &yazi_core::tab::Tab, ) -> mlua::Result> { let window = match window { @@ -50,9 +50,9 @@ impl Folder { }); })?; - lua.register_userdata_type::(|reg| { + lua.register_userdata_type::(|reg| { reg.add_meta_method(MetaMethod::ToString, |lua, me, ()| { - use yazi_core::folder::FolderStage::{Failed, Loaded, Loading}; + use yazi_fs::FolderStage::{Failed, Loaded, Loading}; lua.create_string(match me { Loading => "loading", Loaded => "loaded", diff --git a/yazi-fs/Cargo.toml b/yazi-fs/Cargo.toml new file mode 100644 index 000000000..b4e2c63aa --- /dev/null +++ b/yazi-fs/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "yazi-fs" +version = "0.3.0" +edition = "2021" +license = "MIT" +authors = [ "sxyazi " ] +description = "Yazi File System" +homepage = "https://yazi-rs.github.io" +repository = "https://github.com/sxyazi/yazi" + +[dependencies] +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-proxy = { path = "../yazi-proxy", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } + +# External dependencies +anyhow = "1.0.86" +futures = "0.3.30" +ratatui = "0.27.0" +regex = "1.10.5" +tokio = { version = "1.39.2", features = [ "full" ] } diff --git a/yazi-core/src/folder/files.rs b/yazi-fs/src/files.rs similarity index 98% rename from yazi-core/src/folder/files.rs rename to yazi-fs/src/files.rs index e55535fef..78cebe572 100644 --- a/yazi-core/src/folder/files.rs +++ b/yazi-fs/src/files.rs @@ -7,11 +7,11 @@ use yazi_shared::fs::{maybe_exists, File, FilesOp, Url, FILES_TICKET}; use super::{FilesSorter, Filter}; pub struct Files { - hidden: Vec, - items: Vec, - ticket: u64, - version: u64, - pub(crate) revision: u64, + hidden: Vec, + items: Vec, + ticket: u64, + version: u64, + pub revision: u64, pub sizes: HashMap, diff --git a/yazi-core/src/folder/filter.rs b/yazi-fs/src/filter.rs similarity index 100% rename from yazi-core/src/folder/filter.rs rename to yazi-fs/src/filter.rs diff --git a/yazi-core/src/folder/folder.rs b/yazi-fs/src/folder.rs similarity index 99% rename from yazi-core/src/folder/folder.rs rename to yazi-fs/src/folder.rs index 16178886a..74c5aa02c 100644 --- a/yazi-core/src/folder/folder.rs +++ b/yazi-fs/src/folder.rs @@ -6,7 +6,7 @@ use yazi_proxy::ManagerProxy; use yazi_shared::fs::{File, FilesOp, Url}; use super::FolderStage; -use crate::{folder::Files, Step}; +use crate::{Files, Step}; #[derive(Default)] pub struct Folder { diff --git a/yazi-core/src/folder/mod.rs b/yazi-fs/src/lib.rs similarity index 70% rename from yazi-core/src/folder/mod.rs rename to yazi-fs/src/lib.rs index 1acfc9f40..2b7567c38 100644 --- a/yazi-core/src/folder/mod.rs +++ b/yazi-fs/src/lib.rs @@ -1,11 +1,15 @@ +#![allow(clippy::if_same_then_else)] + mod files; mod filter; mod folder; mod sorter; mod stage; +mod step; pub use files::*; pub use filter::*; pub use folder::*; pub use sorter::*; pub use stage::*; +pub use step::*; diff --git a/yazi-core/src/folder/sorter.rs b/yazi-fs/src/sorter.rs similarity index 100% rename from yazi-core/src/folder/sorter.rs rename to yazi-fs/src/sorter.rs diff --git a/yazi-core/src/folder/stage.rs b/yazi-fs/src/stage.rs similarity index 100% rename from yazi-core/src/folder/stage.rs rename to yazi-fs/src/stage.rs diff --git a/yazi-core/src/step.rs b/yazi-fs/src/step.rs similarity index 100% rename from yazi-core/src/step.rs rename to yazi-fs/src/step.rs diff --git a/yazi-plugin/Cargo.toml b/yazi-plugin/Cargo.toml index 941f86f3c..47ec884d4 100644 --- a/yazi-plugin/Cargo.toml +++ b/yazi-plugin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-plugin" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -13,12 +13,12 @@ default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] [dependencies] -yazi-adapter = { path = "../yazi-adapter", version = "0.2.5" } -yazi-boot = { path = "../yazi-boot", version = "0.2.5" } -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-dds = { path = "../yazi-dds", version = "0.2.5" } -yazi-proxy = { path = "../yazi-proxy", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-adapter = { path = "../yazi-adapter", version = "0.3.0" } +yazi-boot = { path = "../yazi-boot", version = "0.3.0" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-dds = { path = "../yazi-dds", version = "0.3.0" } +yazi-proxy = { path = "../yazi-proxy", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies ansi-to-tui = "=3.1.0" diff --git a/yazi-proxy/Cargo.toml b/yazi-proxy/Cargo.toml index f09ffb815..1266adeb6 100644 --- a/yazi-proxy/Cargo.toml +++ b/yazi-proxy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-proxy" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -13,8 +13,8 @@ default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] [dependencies] -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" diff --git a/yazi-scheduler/Cargo.toml b/yazi-scheduler/Cargo.toml index 2a8ab6721..e732d5408 100644 --- a/yazi-scheduler/Cargo.toml +++ b/yazi-scheduler/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-scheduler" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -9,11 +9,11 @@ homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" [dependencies] -yazi-config = { path = "../yazi-config", version = "0.2.5" } -yazi-dds = { path = "../yazi-dds", version = "0.2.5" } -yazi-plugin = { path = "../yazi-plugin", version = "0.2.5" } -yazi-proxy = { path = "../yazi-proxy", version = "0.2.5" } -yazi-shared = { path = "../yazi-shared", version = "0.2.5" } +yazi-config = { path = "../yazi-config", version = "0.3.0" } +yazi-dds = { path = "../yazi-dds", version = "0.3.0" } +yazi-plugin = { path = "../yazi-plugin", version = "0.3.0" } +yazi-proxy = { path = "../yazi-proxy", version = "0.3.0" } +yazi-shared = { path = "../yazi-shared", version = "0.3.0" } # External dependencies anyhow = "1.0.86" diff --git a/yazi-shared/Cargo.toml b/yazi-shared/Cargo.toml index 96c00bebe..fd419cbea 100644 --- a/yazi-shared/Cargo.toml +++ b/yazi-shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yazi-shared" -version = "0.2.5" +version = "0.3.0" edition = "2021" license = "MIT" authors = [ "sxyazi " ] @@ -25,7 +25,7 @@ shell-words = "1.1.0" tokio = { version = "1.39.2", features = [ "full" ] } [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.52.0", features = [ "Win32_Storage_FileSystem", "Win32_UI_Shell" ] } +windows-sys = { version = "0.59.0", features = [ "Win32_Storage_FileSystem", "Win32_UI_Shell" ] } [target.'cfg(target_os = "macos")'.dependencies] crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] }