From 189cb81db335650889be6f02406526fecf8e0fb1 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 8 Jun 2024 19:28:46 +0800 Subject: [PATCH] refactor: rename crate `yazi-adaptor` to `yazi-adapter` --- CONTRIBUTING.md | 6 +-- Cargo.lock | 10 ++--- README.md | 4 +- scripts/publish.sh | 2 +- {yazi-adaptor => yazi-adapter}/Cargo.toml | 4 +- .../adaptor.rs => yazi-adapter/src/adapter.rs | 12 +++--- {yazi-adaptor => yazi-adapter}/src/chafa.rs | 6 +-- .../src/dimension.rs | 0 .../src/emulator.rs | 38 +++++++++---------- {yazi-adaptor => yazi-adapter}/src/image.rs | 0 {yazi-adaptor => yazi-adapter}/src/iterm2.rs | 6 +-- {yazi-adaptor => yazi-adapter}/src/kitty.rs | 6 +-- .../src/kitty_old.rs | 6 +-- {yazi-adaptor => yazi-adapter}/src/lib.rs | 8 ++-- {yazi-adaptor => yazi-adapter}/src/sixel.rs | 6 +-- .../src/ueberzug.rs | 16 ++++---- yazi-boot/Cargo.toml | 2 +- yazi-boot/src/boot.rs | 12 +++--- yazi-core/Cargo.toml | 2 +- yazi-core/src/help/help.rs | 2 +- yazi-core/src/tab/preview.rs | 2 +- yazi-core/src/tasks/tasks.rs | 2 +- yazi-fm/Cargo.toml | 2 +- yazi-fm/src/app/commands/update_notify.rs | 2 +- yazi-fm/src/completion/completion.rs | 2 +- yazi-fm/src/context.rs | 2 +- yazi-fm/src/main.rs | 2 +- yazi-fm/src/term.rs | 2 +- yazi-plugin/Cargo.toml | 2 +- yazi-plugin/src/bindings/window.rs | 2 +- yazi-plugin/src/elements/clear.rs | 2 +- yazi-plugin/src/utils/image.rs | 2 +- 32 files changed, 86 insertions(+), 86 deletions(-) rename {yazi-adaptor => yazi-adapter}/Cargo.toml (92%) rename yazi-adaptor/src/adaptor.rs => yazi-adapter/src/adapter.rs (93%) rename {yazi-adaptor => yazi-adapter}/src/chafa.rs (94%) rename {yazi-adaptor => yazi-adapter}/src/dimension.rs (100%) rename {yazi-adaptor => yazi-adapter}/src/emulator.rs (84%) rename {yazi-adaptor => yazi-adapter}/src/image.rs (100%) rename {yazi-adaptor => yazi-adapter}/src/iterm2.rs (92%) rename {yazi-adaptor => yazi-adapter}/src/kitty.rs (98%) rename {yazi-adaptor => yazi-adapter}/src/kitty_old.rs (93%) rename {yazi-adaptor => yazi-adapter}/src/lib.rs (90%) rename {yazi-adaptor => yazi-adapter}/src/sixel.rs (94%) rename {yazi-adaptor => yazi-adapter}/src/ueberzug.rs (89%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a1bf981..cb99aa35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,18 +40,18 @@ Before you begin, ensure you have met the following requirements: A brief overview of the project's structure: ```sh -yazi/ +. ├── assets/ # Assets like images and fonts ├── nix/ # Nix-related configurations ├── scripts/ # Helper scripts used by CI/CD ├── snap/ # Snapcraft configuration -├── yazi-adaptor/ # Yazi image adaptor +├── yazi-adapter/ # Yazi image adapter ├── yazi-boot/ # Yazi bootstrapper ├── yazi-cli/ # Yazi command-line interface ├── yazi-config/ # Yazi configuration file parser ├── yazi-core/ # Yazi core logic ├── yazi-dds/ # Yazi data distribution service -├── yazi-fm/ # Yazi File Manager +├── yazi-fm/ # Yazi file manager ├── yazi-plugin/ # Yazi plugin system ├── yazi-proxy/ # Yazi event proxy ├── yazi-scheduler/ # Yazi task scheduler diff --git a/Cargo.lock b/Cargo.lock index 0e2279ae..1afd63ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2690,7 +2690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" [[package]] -name = "yazi-adaptor" +name = "yazi-adapter" version = "0.2.5" dependencies = [ "ansi-to-tui", @@ -2722,7 +2722,7 @@ dependencies = [ "regex", "serde", "vergen", - "yazi-adaptor", + "yazi-adapter", "yazi-config", "yazi-shared", ] @@ -2786,7 +2786,7 @@ dependencies = [ "tokio-util", "tracing", "unicode-width", - "yazi-adaptor", + "yazi-adapter", "yazi-boot", "yazi-config", "yazi-dds", @@ -2835,7 +2835,7 @@ dependencies = [ "tracing", "tracing-appender", "tracing-subscriber", - "yazi-adaptor", + "yazi-adapter", "yazi-boot", "yazi-config", "yazi-core", @@ -2870,7 +2870,7 @@ dependencies = [ "tracing", "unicode-width", "uzers", - "yazi-adaptor", + "yazi-adapter", "yazi-boot", "yazi-config", "yazi-dds", diff --git a/README.md b/README.md index 73f8a64b..3c6ab241 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,12 @@ https://github.com/sxyazi/yazi/assets/17523360/92ff23fa-0cd5-4f04-b387-894c12265 | Platform | Protocol | Support | | ----------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | kitty | [Kitty unicode placeholders](https://sw.kovidgoyal.net/kitty/graphics-protocol/#unicode-placeholders) | ✅ Built-in | -| Konsole | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adaptor/src/kitty_old.rs) | ✅ Built-in | +| Konsole | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adapter/src/kitty_old.rs) | ✅ Built-in | | iTerm2 | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | | WezTerm | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | | Mintty (Git Bash) | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | | foot | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | -| Ghostty | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adaptor/src/kitty_old.rs) | ✅ Built-in | +| Ghostty | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adapter/src/kitty_old.rs) | ✅ Built-in | | Black Box | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | | VSCode | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | | Tabby | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | diff --git a/scripts/publish.sh b/scripts/publish.sh index 1219d23a..84b17ead 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,7 +1,7 @@ cargo publish -p yazi-shared cargo publish -p yazi-config cargo publish -p yazi-proxy -cargo publish -p yazi-adaptor +cargo publish -p yazi-adapter cargo publish -p yazi-boot cargo publish -p yazi-dds cargo publish -p yazi-scheduler diff --git a/yazi-adaptor/Cargo.toml b/yazi-adapter/Cargo.toml similarity index 92% rename from yazi-adaptor/Cargo.toml rename to yazi-adapter/Cargo.toml index 8a7a6441..1b0fdccf 100644 --- a/yazi-adaptor/Cargo.toml +++ b/yazi-adapter/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "yazi-adaptor" +name = "yazi-adapter" version = "0.2.5" edition = "2021" license = "MIT" authors = [ "sxyazi " ] -description = "Yazi image adaptor" +description = "Yazi image adapter" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" diff --git a/yazi-adaptor/src/adaptor.rs b/yazi-adapter/src/adapter.rs similarity index 93% rename from yazi-adaptor/src/adaptor.rs rename to yazi-adapter/src/adapter.rs index c0c634d9..2ee59370 100644 --- a/yazi-adaptor/src/adaptor.rs +++ b/yazi-adapter/src/adapter.rs @@ -9,7 +9,7 @@ use super::{Iterm2, Kitty, KittyOld}; use crate::{Chafa, Emulator, Sixel, Ueberzug, SHOWN, TMUX}; #[derive(Clone, Copy, PartialEq, Eq, Debug)] -pub enum Adaptor { +pub enum Adapter { Kitty, KittyOld, Iterm2, @@ -21,7 +21,7 @@ pub enum Adaptor { Chafa, } -impl Display for Adaptor { +impl Display for Adapter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Kitty => write!(f, "kitty"), @@ -35,7 +35,7 @@ impl Display for Adaptor { } } -impl Adaptor { +impl Adapter { pub async fn image_show(self, path: &Path, max: Rect) -> Result { match self { Self::Kitty => Kitty::image_show(path, max).await, @@ -76,7 +76,7 @@ impl Adaptor { } } -impl Adaptor { +impl Adapter { pub fn matches() -> Self { let mut protocols = Emulator::detect().adapters(); @@ -94,7 +94,7 @@ impl Adaptor { match env::var("XDG_SESSION_TYPE").unwrap_or_default().as_str() { "x11" => return Self::X11, "wayland" => return Self::Wayland, - _ => warn!("[Adaptor] Could not identify XDG_SESSION_TYPE"), + _ => warn!("[Adapter] Could not identify XDG_SESSION_TYPE"), } if env_exists("WAYLAND_DISPLAY") { return Self::Wayland; @@ -106,7 +106,7 @@ impl Adaptor { return Self::KittyOld; } - warn!("[Adaptor] Falling back to chafa"); + warn!("[Adapter] Falling back to chafa"); Self::Chafa } } diff --git a/yazi-adaptor/src/chafa.rs b/yazi-adapter/src/chafa.rs similarity index 94% rename from yazi-adaptor/src/chafa.rs rename to yazi-adapter/src/chafa.rs index 88ac5d64..c48a3420 100644 --- a/yazi-adaptor/src/chafa.rs +++ b/yazi-adapter/src/chafa.rs @@ -6,7 +6,7 @@ use crossterm::{cursor::MoveTo, queue}; use ratatui::layout::Rect; use tokio::process::Command; -use crate::{Adaptor, Emulator}; +use crate::{Adapter, Emulator}; pub(super) struct Chafa; @@ -53,8 +53,8 @@ impl Chafa { height: lines.len() as u16, }; - Adaptor::Chafa.image_hide()?; - Adaptor::shown_store(area); + Adapter::Chafa.image_hide()?; + Adapter::shown_store(area); Emulator::move_lock((max.x, max.y), |stderr| { for (i, line) in lines.into_iter().enumerate() { stderr.write_all(line)?; diff --git a/yazi-adaptor/src/dimension.rs b/yazi-adapter/src/dimension.rs similarity index 100% rename from yazi-adaptor/src/dimension.rs rename to yazi-adapter/src/dimension.rs diff --git a/yazi-adaptor/src/emulator.rs b/yazi-adapter/src/emulator.rs similarity index 84% rename from yazi-adaptor/src/emulator.rs rename to yazi-adapter/src/emulator.rs index 298ea18c..32c04cbd 100644 --- a/yazi-adaptor/src/emulator.rs +++ b/yazi-adapter/src/emulator.rs @@ -7,11 +7,11 @@ use tokio::{io::{AsyncReadExt, BufReader}, time::timeout}; use tracing::{error, warn}; use yazi_shared::env_exists; -use crate::{Adaptor, CLOSE, ESCAPE, START, TMUX}; +use crate::{Adapter, CLOSE, ESCAPE, START, TMUX}; #[derive(Clone, Debug)] pub enum Emulator { - Unknown(Vec), + Unknown(Vec), Kitty, Konsole, Iterm2, @@ -29,20 +29,20 @@ pub enum Emulator { } impl Emulator { - pub fn adapters(self) -> Vec { + pub fn adapters(self) -> Vec { match self { Self::Unknown(adapters) => adapters, - Self::Kitty => vec![Adaptor::Kitty], - Self::Konsole => vec![Adaptor::KittyOld], - Self::Iterm2 => vec![Adaptor::Iterm2, Adaptor::Sixel], - Self::WezTerm => vec![Adaptor::Iterm2, Adaptor::Sixel], - Self::Foot => vec![Adaptor::Sixel], - Self::Ghostty => vec![Adaptor::KittyOld], - Self::BlackBox => vec![Adaptor::Sixel], - Self::VSCode => vec![Adaptor::Iterm2, Adaptor::Sixel], - Self::Tabby => vec![Adaptor::Iterm2, Adaptor::Sixel], - Self::Hyper => vec![Adaptor::Iterm2, Adaptor::Sixel], - Self::Mintty => vec![Adaptor::Iterm2], + Self::Kitty => vec![Adapter::Kitty], + Self::Konsole => vec![Adapter::KittyOld], + Self::Iterm2 => vec![Adapter::Iterm2, Adapter::Sixel], + Self::WezTerm => vec![Adapter::Iterm2, Adapter::Sixel], + Self::Foot => vec![Adapter::Sixel], + Self::Ghostty => vec![Adapter::KittyOld], + Self::BlackBox => vec![Adapter::Sixel], + Self::VSCode => vec![Adapter::Iterm2, Adapter::Sixel], + Self::Tabby => vec![Adapter::Iterm2, Adapter::Sixel], + Self::Hyper => vec![Adapter::Iterm2, Adapter::Sixel], + Self::Mintty => vec![Adapter::Iterm2], Self::Neovim => vec![], Self::Apple => vec![], Self::Urxvt => vec![], @@ -67,7 +67,7 @@ impl Emulator { ]; match vars.into_iter().find(|v| env_exists(v.0)) { Some(var) => return var.1, - None => warn!("[Adaptor] No special environment variables detected"), + None => warn!("[Adapter] No special environment variables detected"), } let (term, program) = Self::via_env(); @@ -81,7 +81,7 @@ impl Emulator { "Hyper" => return Self::Hyper, "mintty" => return Self::Mintty, "Apple_Terminal" => return Self::Apple, - _ => warn!("[Adaptor] Unknown TERM_PROGRAM: {program}"), + _ => warn!("[Adapter] Unknown TERM_PROGRAM: {program}"), } match term.as_str() { "xterm-kitty" => return Self::Kitty, @@ -89,7 +89,7 @@ impl Emulator { "foot-extra" => return Self::Foot, "xterm-ghostty" => return Self::Ghostty, "rxvt-unicode-256color" => return Self::Urxvt, - _ => warn!("[Adaptor] Unknown TERM: {term}"), + _ => warn!("[Adapter] Unknown TERM: {term}"), } Self::via_csi().unwrap_or(Self::Unknown(vec![])) @@ -148,10 +148,10 @@ impl Emulator { let mut adapters = Vec::with_capacity(2); if resp.contains("\x1b_Gi=31;OK") { - adapters.push(Adaptor::KittyOld); + adapters.push(Adapter::KittyOld); } if ["?4;", "?4c", ";4;", ";4c"].iter().any(|s| resp.contains(s)) { - adapters.push(Adaptor::Sixel); + adapters.push(Adapter::Sixel); } Ok(Self::Unknown(adapters)) diff --git a/yazi-adaptor/src/image.rs b/yazi-adapter/src/image.rs similarity index 100% rename from yazi-adaptor/src/image.rs rename to yazi-adapter/src/image.rs diff --git a/yazi-adaptor/src/iterm2.rs b/yazi-adapter/src/iterm2.rs similarity index 92% rename from yazi-adaptor/src/iterm2.rs rename to yazi-adapter/src/iterm2.rs index fc47e3d3..d71cbf93 100644 --- a/yazi-adaptor/src/iterm2.rs +++ b/yazi-adapter/src/iterm2.rs @@ -7,7 +7,7 @@ use image::{codecs::jpeg::JpegEncoder, DynamicImage}; use ratatui::layout::Rect; use super::image::Image; -use crate::{adaptor::Adaptor, Emulator, CLOSE, START}; +use crate::{adapter::Adapter, Emulator, CLOSE, START}; pub(super) struct Iterm2; @@ -17,8 +17,8 @@ impl Iterm2 { let area = Image::pixel_area((img.width(), img.height()), max); let b = Self::encode(img).await?; - Adaptor::Iterm2.image_hide()?; - Adaptor::shown_store(area); + Adapter::Iterm2.image_hide()?; + Adapter::shown_store(area); Emulator::move_lock((max.x, max.y), |stderr| { stderr.write_all(&b)?; Ok(area) diff --git a/yazi-adaptor/src/kitty.rs b/yazi-adapter/src/kitty.rs similarity index 98% rename from yazi-adaptor/src/kitty.rs rename to yazi-adapter/src/kitty.rs index fdc93d15..b75bbb07 100644 --- a/yazi-adaptor/src/kitty.rs +++ b/yazi-adapter/src/kitty.rs @@ -8,7 +8,7 @@ use image::DynamicImage; use ratatui::layout::Rect; use super::image::Image; -use crate::{adaptor::Adaptor, Emulator, CLOSE, ESCAPE, START}; +use crate::{adapter::Adapter, Emulator, CLOSE, ESCAPE, START}; static DIACRITICS: [char; 297] = [ '\u{0305}', @@ -320,8 +320,8 @@ impl Kitty { let b1 = Self::encode(img).await?; let b2 = Self::place(&area)?; - Adaptor::Kitty.image_hide()?; - Adaptor::shown_store(area); + Adapter::Kitty.image_hide()?; + Adapter::shown_store(area); Emulator::move_lock((area.x, area.y), |stderr| { stderr.write_all(&b1)?; stderr.write_all(&b2)?; diff --git a/yazi-adaptor/src/kitty_old.rs b/yazi-adapter/src/kitty_old.rs similarity index 93% rename from yazi-adaptor/src/kitty_old.rs rename to yazi-adapter/src/kitty_old.rs index 860e2392..0de07533 100644 --- a/yazi-adaptor/src/kitty_old.rs +++ b/yazi-adapter/src/kitty_old.rs @@ -7,7 +7,7 @@ use image::DynamicImage; use ratatui::layout::Rect; use super::image::Image; -use crate::{adaptor::Adaptor, Emulator, CLOSE, ESCAPE, START}; +use crate::{adapter::Adapter, Emulator, CLOSE, ESCAPE, START}; pub(super) struct KittyOld; @@ -17,8 +17,8 @@ impl KittyOld { let area = Image::pixel_area((img.width(), img.height()), max); let b = Self::encode(img).await?; - Adaptor::KittyOld.image_hide()?; - Adaptor::shown_store(area); + Adapter::KittyOld.image_hide()?; + Adapter::shown_store(area); Emulator::move_lock((area.x, area.y), |stderr| { stderr.write_all(&b)?; Ok(area) diff --git a/yazi-adaptor/src/lib.rs b/yazi-adapter/src/lib.rs similarity index 90% rename from yazi-adaptor/src/lib.rs rename to yazi-adapter/src/lib.rs index 48baab5e..0dfe8f9c 100644 --- a/yazi-adaptor/src/lib.rs +++ b/yazi-adapter/src/lib.rs @@ -1,6 +1,6 @@ #![allow(clippy::unit_arg)] -mod adaptor; +mod adapter; mod chafa; mod dimension; mod emulator; @@ -11,7 +11,7 @@ mod kitty_old; mod sixel; mod ueberzug; -pub use adaptor::*; +pub use adapter::*; use chafa::*; pub use dimension::*; pub use emulator::*; @@ -24,7 +24,7 @@ use yazi_shared::{env_exists, RoCell}; pub use crate::image::*; -pub static ADAPTOR: RoCell = RoCell::new(); +pub static ADAPTOR: RoCell = RoCell::new(); // Tmux support pub static TMUX: RoCell = RoCell::new(); @@ -52,6 +52,6 @@ pub fn init() { SHOWN.with(Default::default); - ADAPTOR.init(Adaptor::matches()); + ADAPTOR.init(Adapter::matches()); ADAPTOR.start(); } diff --git a/yazi-adaptor/src/sixel.rs b/yazi-adapter/src/sixel.rs similarity index 94% rename from yazi-adaptor/src/sixel.rs rename to yazi-adapter/src/sixel.rs index 3a6ef153..b8e48fce 100644 --- a/yazi-adaptor/src/sixel.rs +++ b/yazi-adapter/src/sixel.rs @@ -7,7 +7,7 @@ use image::DynamicImage; use ratatui::layout::Rect; use yazi_config::PREVIEW; -use crate::{adaptor::Adaptor, Emulator, Image, CLOSE, ESCAPE, START}; +use crate::{adapter::Adapter, Emulator, Image, CLOSE, ESCAPE, START}; pub(super) struct Sixel; @@ -17,8 +17,8 @@ impl Sixel { let area = Image::pixel_area((img.width(), img.height()), max); let b = Self::encode(img).await?; - Adaptor::Sixel.image_hide()?; - Adaptor::shown_store(area); + Adapter::Sixel.image_hide()?; + Adapter::shown_store(area); Emulator::move_lock((area.x, area.y), |stderr| { stderr.write_all(&b)?; Ok(area) diff --git a/yazi-adaptor/src/ueberzug.rs b/yazi-adapter/src/ueberzug.rs similarity index 89% rename from yazi-adaptor/src/ueberzug.rs rename to yazi-adapter/src/ueberzug.rs index 2618e80c..d3a6a9bd 100644 --- a/yazi-adaptor/src/ueberzug.rs +++ b/yazi-adapter/src/ueberzug.rs @@ -8,7 +8,7 @@ use tracing::{debug, warn}; use yazi_config::PREVIEW; use yazi_shared::RoCell; -use crate::{Adaptor, Image}; +use crate::{Adapter, Image}; #[allow(clippy::type_complexity)] static DEMON: RoCell>>> = RoCell::new(); @@ -16,12 +16,12 @@ static DEMON: RoCell>>> = RoCell: pub(super) struct Ueberzug; impl Ueberzug { - pub(super) fn start(adaptor: Adaptor) { - if !adaptor.needs_ueberzug() { + pub(super) fn start(adapter: Adapter) { + if !adapter.needs_ueberzug() { return DEMON.init(None); } - let mut child = Self::create_demon(adaptor).ok(); + let mut child = Self::create_demon(adapter).ok(); let (tx, mut rx) = mpsc::unbounded_channel(); tokio::spawn(async move { @@ -31,7 +31,7 @@ impl Ueberzug { child = None; } if child.is_none() { - child = Self::create_demon(adaptor).ok(); + child = Self::create_demon(adapter).ok(); } if let Some(c) = &mut child { Self::send_command(c, cmd).await.ok(); @@ -53,7 +53,7 @@ impl Ueberzug { let area = Image::pixel_area((w as u32, h as u32), max); tx.send(Some((path.to_owned(), area)))?; - Adaptor::shown_store(area); + Adapter::shown_store(area); Ok(area) } @@ -65,10 +65,10 @@ impl Ueberzug { } } - fn create_demon(adaptor: Adaptor) -> Result { + fn create_demon(adapter: Adapter) -> Result { // TODO: demon let result = Command::new("ueberzugpp") - .args(["layer", "-so", &adaptor.to_string()]) + .args(["layer", "-so", &adapter.to_string()]) .env("SPDLOG_LEVEL", if cfg!(debug_assertions) { "debug" } else { "" }) .kill_on_drop(true) .stdin(Stdio::piped()) diff --git a/yazi-boot/Cargo.toml b/yazi-boot/Cargo.toml index 404cd483..15ef21ed 100644 --- a/yazi-boot/Cargo.toml +++ b/yazi-boot/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/sxyazi/yazi" [dependencies] regex = "1.10.4" -yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.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" } diff --git a/yazi-boot/src/boot.rs b/yazi-boot/src/boot.rs index 72048a6c..9f412674 100644 --- a/yazi-boot/src/boot.rs +++ b/yazi-boot/src/boot.rs @@ -76,12 +76,12 @@ impl Boot { writeln!(s, " Version: {}", Self::process_output("ya", "--version"))?; writeln!(s, "\nEmulator")?; - writeln!(s, " Emulator.via_env: {:?}", yazi_adaptor::Emulator::via_env())?; - writeln!(s, " Emulator.via_csi: {:?}", yazi_adaptor::Emulator::via_csi())?; - writeln!(s, " Emulator.detect : {:?}", yazi_adaptor::Emulator::detect())?; + writeln!(s, " Emulator.via_env: {:?}", yazi_adapter::Emulator::via_env())?; + writeln!(s, " Emulator.via_csi: {:?}", yazi_adapter::Emulator::via_csi())?; + writeln!(s, " Emulator.detect : {:?}", yazi_adapter::Emulator::detect())?; - writeln!(s, "\nAdaptor")?; - writeln!(s, " Adaptor.matches: {:?}", yazi_adaptor::Adaptor::matches())?; + writeln!(s, "\nAdapter")?; + writeln!(s, " Adapter.matches: {:?}", yazi_adapter::Adapter::matches())?; writeln!(s, "\nDesktop")?; writeln!(s, " XDG_SESSION_TYPE: {:?}", env::var_os("XDG_SESSION_TYPE"))?; @@ -114,7 +114,7 @@ impl Boot { writeln!(s, " block : {:?}", yazi_config::OPEN.block_opener("bulk.txt", "text/plain"))?; writeln!(s, "\ntmux")?; - writeln!(s, " TMUX : {:?}", *yazi_adaptor::TMUX)?; + writeln!(s, " TMUX : {:?}", *yazi_adapter::TMUX)?; writeln!(s, " Version: {}", Self::process_output("tmux", "-V"))?; writeln!(s, "\nDependencies")?; diff --git a/yazi-core/Cargo.toml b/yazi-core/Cargo.toml index 5324bb6c..7cd65669 100644 --- a/yazi-core/Cargo.toml +++ b/yazi-core/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" [dependencies] -yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.5" } +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" } diff --git a/yazi-core/src/help/help.rs b/yazi-core/src/help/help.rs index f5fc72c0..cde803c4 100644 --- a/yazi-core/src/help/help.rs +++ b/yazi-core/src/help/help.rs @@ -1,6 +1,6 @@ use crossterm::event::KeyCode; use unicode_width::UnicodeWidthStr; -use yazi_adaptor::Dimension; +use yazi_adapter::Dimension; use yazi_config::{keymap::{Control, Key}, KEYMAP}; use yazi_shared::{render, render_and, Layer}; diff --git a/yazi-core/src/tab/preview.rs b/yazi-core/src/tab/preview.rs index d5c8db7b..8f1741e7 100644 --- a/yazi-core/src/tab/preview.rs +++ b/yazi-core/src/tab/preview.rs @@ -3,7 +3,7 @@ use std::time::{Duration, SystemTime}; use tokio::{pin, task::JoinHandle}; use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; use tokio_util::sync::CancellationToken; -use yazi_adaptor::ADAPTOR; +use yazi_adapter::ADAPTOR; use yazi_config::PLUGIN; use yazi_plugin::{external::Highlighter, isolate, utils::PreviewLock}; use yazi_shared::{fs::{Cha, File, FilesOp, Url}, MIME_DIR}; diff --git a/yazi-core/src/tasks/tasks.rs b/yazi-core/src/tasks/tasks.rs index 7858504f..e62fd0dd 100644 --- a/yazi-core/src/tasks/tasks.rs +++ b/yazi-core/src/tasks/tasks.rs @@ -2,7 +2,7 @@ use std::{sync::Arc, time::Duration}; use parking_lot::Mutex; use tokio::{task::JoinHandle, time::sleep}; -use yazi_adaptor::Dimension; +use yazi_adapter::Dimension; use yazi_scheduler::{Ongoing, Scheduler, TaskSummary}; use yazi_shared::{emit, event::Cmd, Layer}; diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 494f0b33..eaab5478 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -13,7 +13,7 @@ default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] [dependencies] -yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.5" } +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" } diff --git a/yazi-fm/src/app/commands/update_notify.rs b/yazi-fm/src/app/commands/update_notify.rs index bb89b32c..4729ead2 100644 --- a/yazi-fm/src/app/commands/update_notify.rs +++ b/yazi-fm/src/app/commands/update_notify.rs @@ -1,6 +1,6 @@ use crossterm::terminal::WindowSize; use ratatui::layout::Rect; -use yazi_adaptor::Dimension; +use yazi_adapter::Dimension; use yazi_shared::event::Cmd; use crate::{app::App, notify}; diff --git a/yazi-fm/src/completion/completion.rs b/yazi-fm/src/completion/completion.rs index 3d43e0b1..75d2b6bb 100644 --- a/yazi-fm/src/completion/completion.rs +++ b/yazi-fm/src/completion/completion.rs @@ -1,7 +1,7 @@ use std::path::MAIN_SEPARATOR; use ratatui::{buffer::Buffer, layout::Rect, widgets::{Block, BorderType, List, ListItem, Widget}}; -use yazi_adaptor::Dimension; +use yazi_adapter::Dimension; use yazi_config::{popup::{Offset, Position}, THEME}; use crate::Ctx; diff --git a/yazi-fm/src/context.rs b/yazi-fm/src/context.rs index 6b9b6fe8..0fec1dd8 100644 --- a/yazi-fm/src/context.rs +++ b/yazi-fm/src/context.rs @@ -1,5 +1,5 @@ use ratatui::layout::Rect; -use yazi_adaptor::Dimension; +use yazi_adapter::Dimension; use yazi_config::popup::{Origin, Position}; use yazi_core::{completion::Completion, help::Help, input::Input, manager::Manager, notify::Notify, select::Select, tasks::Tasks, which::Which}; diff --git a/yazi-fm/src/main.rs b/yazi-fm/src/main.rs index bcfed874..93d67543 100644 --- a/yazi-fm/src/main.rs +++ b/yazi-fm/src/main.rs @@ -45,7 +45,7 @@ async fn main() -> anyhow::Result<()> { yazi_config::init()?; - yazi_adaptor::init(); + yazi_adapter::init(); yazi_boot::init(); diff --git a/yazi-fm/src/term.rs b/yazi-fm/src/term.rs index 2b326743..f2950cdd 100644 --- a/yazi-fm/src/term.rs +++ b/yazi-fm/src/term.rs @@ -3,7 +3,7 @@ use std::{io::{self, stderr, BufWriter, Stderr}, ops::{Deref, DerefMut}, sync::a use anyhow::Result; use crossterm::{cursor::{RestorePosition, SavePosition}, event::{DisableBracketedPaste, EnableBracketedPaste, KeyboardEnhancementFlags, PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags}, execute, queue, style::Print, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen, SetTitle}}; use ratatui::{backend::CrosstermBackend, buffer::Buffer, layout::Rect, CompletedFrame, Frame, Terminal}; -use yazi_adaptor::Emulator; +use yazi_adapter::Emulator; use yazi_config::INPUT; static CSI_U: AtomicBool = AtomicBool::new(false); diff --git a/yazi-plugin/Cargo.toml b/yazi-plugin/Cargo.toml index abe8d82e..467999aa 100644 --- a/yazi-plugin/Cargo.toml +++ b/yazi-plugin/Cargo.toml @@ -13,7 +13,7 @@ default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] [dependencies] -yazi-adaptor = { path = "../yazi-adaptor", version = "0.2.5" } +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" } diff --git a/yazi-plugin/src/bindings/window.rs b/yazi-plugin/src/bindings/window.rs index 32b40a45..b4d63bbb 100644 --- a/yazi-plugin/src/bindings/window.rs +++ b/yazi-plugin/src/bindings/window.rs @@ -1,5 +1,5 @@ use mlua::{FromLua, UserData}; -use yazi_adaptor::Dimension; +use yazi_adapter::Dimension; #[derive(Debug, Clone, Copy, FromLua)] pub struct Window { diff --git a/yazi-plugin/src/elements/clear.rs b/yazi-plugin/src/elements/clear.rs index 0c6f4c7d..1eff7978 100644 --- a/yazi-plugin/src/elements/clear.rs +++ b/yazi-plugin/src/elements/clear.rs @@ -2,7 +2,7 @@ use std::sync::atomic::{AtomicBool, Ordering}; use mlua::{Lua, Table, UserData}; use ratatui::layout::Rect; -use yazi_adaptor::ADAPTOR; +use yazi_adapter::ADAPTOR; use super::{RectRef, Renderable}; diff --git a/yazi-plugin/src/utils/image.rs b/yazi-plugin/src/utils/image.rs index acb72bf4..92d8c464 100644 --- a/yazi-plugin/src/utils/image.rs +++ b/yazi-plugin/src/utils/image.rs @@ -1,5 +1,5 @@ use mlua::{IntoLuaMulti, Lua, Table, Value}; -use yazi_adaptor::{Image, ADAPTOR}; +use yazi_adapter::{Image, ADAPTOR}; use super::Utils; use crate::{bindings::Cast, elements::{Rect, RectRef}, url::UrlRef};