refactor: publish to crates.io

This commit is contained in:
sxyazi 2023-10-22 12:22:35 +08:00
parent df4b502808
commit 72e4d63592
No known key found for this signature in database
223 changed files with 340 additions and 346 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
target/
config/completions
yazi-config/completions
.DS_Store

238
Cargo.lock generated
View file

@ -2,21 +2,6 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "adaptor"
version = "0.1.5"
dependencies = [
"anyhow",
"base64",
"color_quant",
"config",
"image",
"ratatui",
"shared",
"tokio",
"tracing",
]
[[package]]
name = "addr2line"
version = "0.21.0"
@ -121,29 +106,6 @@ version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
[[package]]
name = "app"
version = "0.1.5"
dependencies = [
"adaptor",
"ansi-to-tui",
"anyhow",
"config",
"core",
"crossterm",
"futures",
"libc",
"plugin",
"ratatui",
"shared",
"signal-hook-tokio",
"tokio",
"tracing",
"tracing-appender",
"tracing-subscriber",
"unicode-width",
]
[[package]]
name = "async-channel"
version = "1.9.0"
@ -386,58 +348,6 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "config"
version = "0.1.5"
dependencies = [
"anyhow",
"clap",
"clap_complete",
"clap_complete_fig",
"clap_complete_nushell",
"crossterm",
"dirs",
"futures",
"glob",
"indexmap 2.0.2",
"md-5",
"ratatui",
"serde",
"shared",
"shell-words",
"toml",
"validator",
]
[[package]]
name = "core"
version = "0.1.5"
dependencies = [
"adaptor",
"anyhow",
"async-channel",
"clipboard-win",
"config",
"crossterm",
"futures",
"indexmap 2.0.2",
"libc",
"notify",
"parking_lot",
"ratatui",
"regex",
"serde",
"serde_json",
"shared",
"syntect",
"tokio",
"tokio-stream",
"tracing",
"trash",
"unicode-width",
"yazi-prebuild",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.4"
@ -1385,21 +1295,6 @@ dependencies = [
"time",
]
[[package]]
name = "plugin"
version = "0.1.5"
dependencies = [
"ansi-to-tui",
"anyhow",
"config",
"core",
"mlua",
"ratatui",
"shared",
"tracing",
"unicode-width",
]
[[package]]
name = "png"
version = "0.17.10"
@ -1672,20 +1567,6 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "shared"
version = "0.1.5"
dependencies = [
"anyhow",
"crossterm",
"futures",
"libc",
"parking_lot",
"ratatui",
"regex",
"tokio",
]
[[package]]
name = "shell-words"
version = "1.1.0"
@ -2483,6 +2364,111 @@ dependencies = [
"linked-hash-map",
]
[[package]]
name = "yazi-adaptor"
version = "0.1.5"
dependencies = [
"anyhow",
"base64",
"color_quant",
"image",
"ratatui",
"tokio",
"tracing",
"yazi-config",
"yazi-shared",
]
[[package]]
name = "yazi-config"
version = "0.1.5"
dependencies = [
"anyhow",
"clap",
"clap_complete",
"clap_complete_fig",
"clap_complete_nushell",
"crossterm",
"dirs",
"futures",
"glob",
"indexmap 2.0.2",
"md-5",
"ratatui",
"serde",
"shell-words",
"toml",
"validator",
"yazi-shared",
]
[[package]]
name = "yazi-core"
version = "0.1.5"
dependencies = [
"anyhow",
"async-channel",
"clipboard-win",
"crossterm",
"futures",
"indexmap 2.0.2",
"libc",
"notify",
"parking_lot",
"ratatui",
"regex",
"serde",
"serde_json",
"syntect",
"tokio",
"tokio-stream",
"tracing",
"trash",
"unicode-width",
"yazi-adaptor",
"yazi-config",
"yazi-prebuild",
"yazi-shared",
]
[[package]]
name = "yazi-fm"
version = "0.1.5"
dependencies = [
"ansi-to-tui",
"anyhow",
"crossterm",
"futures",
"libc",
"ratatui",
"signal-hook-tokio",
"tokio",
"tracing",
"tracing-appender",
"tracing-subscriber",
"unicode-width",
"yazi-adaptor",
"yazi-config",
"yazi-core",
"yazi-plugin",
"yazi-shared",
]
[[package]]
name = "yazi-plugin"
version = "0.1.5"
dependencies = [
"ansi-to-tui",
"anyhow",
"mlua",
"ratatui",
"tracing",
"unicode-width",
"yazi-config",
"yazi-core",
"yazi-shared",
]
[[package]]
name = "yazi-prebuild"
version = "0.1.0"
@ -2494,6 +2480,20 @@ dependencies = [
"walkdir",
]
[[package]]
name = "yazi-shared"
version = "0.1.5"
dependencies = [
"anyhow",
"crossterm",
"futures",
"libc",
"parking_lot",
"ratatui",
"regex",
"tokio",
]
[[package]]
name = "zune-inflate"
version = "0.2.54"

View file

@ -1,12 +1,7 @@
[workspace]
resolver = "2"
members = [
"adaptor",
"app",
"config",
"core",
"plugin",
"shared",
"yazi-*",
]
[profile.release]

View file

@ -1,11 +1,11 @@
[package]
name = "adaptor"
name = "yazi-adaptor"
version = "0.1.5"
edition = "2021"
[dependencies]
config = { path = "../config" }
shared = { path = "../shared" }
yazi-config = { path = "../yazi-config" }
yazi-shared = { path = "../yazi-shared" }
# External dependencies
anyhow = "^1"

View file

@ -1,10 +1,10 @@
use std::{env, path::{Path, PathBuf}, sync::atomic::{AtomicBool, Ordering}};
use anyhow::{anyhow, Result};
use config::PREVIEW;
use yazi_config::PREVIEW;
use ratatui::prelude::Rect;
use shared::RoCell;
use tokio::{fs, sync::mpsc::UnboundedSender};
use yazi_shared::RoCell;
use super::{Iterm2, Kitty};
use crate::{ueberzug::Ueberzug, Sixel, TMUX};

View file

@ -1,10 +1,10 @@
use std::{path::Path, sync::Arc};
use anyhow::Result;
use config::PREVIEW;
use yazi_config::PREVIEW;
use image::{imageops::FilterType, DynamicImage, ImageFormat};
use shared::Term;
use tokio::fs;
use yazi_shared::Term;
pub struct Image;

View file

@ -4,7 +4,7 @@ use anyhow::Result;
use base64::{engine::general_purpose, Engine};
use image::{codecs::jpeg::JpegEncoder, DynamicImage};
use ratatui::prelude::Rect;
use shared::Term;
use yazi_shared::Term;
use super::image::Image;
use crate::{CLOSE, START};

View file

@ -4,7 +4,7 @@ use anyhow::Result;
use base64::{engine::general_purpose, Engine};
use image::DynamicImage;
use ratatui::prelude::Rect;
use shared::Term;
use yazi_shared::Term;
use super::image::Image;
use crate::{CLOSE, ESCAPE, START};

View file

@ -7,11 +7,11 @@ mod kitty;
mod sixel;
mod ueberzug;
use adaptor::*;
use adaptor::Adaptor;
use iterm2::*;
use kitty::*;
use shared::RoCell;
use sixel::*;
use yazi_shared::RoCell;
pub use crate::image::*;

View file

@ -4,7 +4,7 @@ use anyhow::{bail, Result};
use color_quant::NeuQuant;
use image::DynamicImage;
use ratatui::prelude::Rect;
use shared::Term;
use yazi_shared::Term;
use crate::{Image, CLOSE, ESCAPE, START};

View file

@ -1,10 +1,10 @@
[package]
name = "config"
name = "yazi-config"
version = "0.1.5"
edition = "2021"
[dependencies]
shared = { path = "../shared" }
yazi-shared = { path = "../yazi-shared" }
# External dependencies
anyhow = "^1"

View file

@ -1,7 +1,7 @@
use std::{env, fs, path::PathBuf, process};
use clap::Parser;
use shared::expand_path;
use yazi_shared::expand_path;
use super::cli::Args;
use crate::{Xdg, PREVIEW};

View file

@ -1,6 +1,6 @@
#![allow(clippy::module_inception)]
use shared::RoCell;
use yazi_shared::RoCell;
mod boot;
pub mod keymap;

View file

@ -2,7 +2,7 @@ use anyhow::bail;
use crossterm::terminal::WindowSize;
use ratatui::{prelude::Rect, widgets::{Block, Padding}};
use serde::{Deserialize, Serialize};
use shared::Term;
use yazi_shared::Term;
use crate::THEME;

View file

@ -2,7 +2,7 @@ use std::{collections::BTreeMap, path::Path};
use indexmap::IndexSet;
use serde::{Deserialize, Deserializer};
use shared::MIME_DIR;
use yazi_shared::MIME_DIR;
use super::Opener;
use crate::{open::OpenRule, MERGED_YAZI};

View file

@ -1,8 +1,8 @@
use std::path::PathBuf;
use serde::Deserialize;
use shared::expand_path;
use validator::Validate;
use yazi_shared::expand_path;
use crate::MERGED_YAZI;

View file

@ -2,7 +2,7 @@ use std::{path::{Path, PathBuf}, time::{self, SystemTime}};
use md5::{Digest, Md5};
use serde::Deserialize;
use shared::expand_path;
use yazi_shared::expand_path;
use crate::{xdg::Xdg, MERGED_YAZI};

View file

@ -1,8 +1,8 @@
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use shared::expand_path;
use validator::Validate;
use yazi_shared::expand_path;
use super::{Filetype, Icon, Style};
use crate::{validation::check_validation, MERGED_THEME};

View file

@ -1,6 +1,6 @@
use std::{env, path::PathBuf};
use shared::expand_path;
use yazi_shared::expand_path;
pub(super) struct Xdg;

View file

@ -1,12 +1,12 @@
[package]
name = "core"
name = "yazi-core"
version = "0.1.5"
edition = "2021"
[dependencies]
adaptor = { path = "../adaptor" }
config = { path = "../config" }
shared = { path = "../shared" }
yazi-adaptor = { path = "../yazi-adaptor" }
yazi-config = { path = "../yazi-config" }
yazi-shared = { path = "../yazi-shared" }
# External dependencies
anyhow = "^1"

View file

@ -1,5 +1,5 @@
use shared::RoCell;
use tokio::sync::Semaphore;
use yazi_shared::RoCell;
pub static BLOCKER: RoCell<Semaphore> = RoCell::new();

View file

@ -1,7 +1,7 @@
use config::keymap::KeymapLayer;
use yazi_config::keymap::KeymapLayer;
use crossterm::terminal::WindowSize;
use ratatui::prelude::Rect;
use shared::Term;
use yazi_shared::Term;
use crate::{help::Help, input::Input, manager::Manager, select::Select, tasks::Tasks, which::Which, Position};

View file

@ -1,10 +1,10 @@
use std::{collections::BTreeMap, ffi::OsString};
use anyhow::Result;
use config::{keymap::{Exec, KeymapLayer}, open::Opener};
use yazi_config::{keymap::{Exec, KeymapLayer}, open::Opener};
use crossterm::event::KeyEvent;
use shared::{InputError, RoCell, Url};
use tokio::sync::{mpsc::{self, UnboundedSender}, oneshot};
use yazi_shared::{InputError, RoCell, Url};
use super::{files::FilesOp, input::InputOpt, select::SelectOpt};
use crate::{preview::PreviewLock, tasks::TasksProgress};

View file

@ -1,8 +1,8 @@
use std::process::Stdio;
use anyhow::Result;
use shared::Url;
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}};
use yazi_shared::Url;
use crate::files::File;

View file

@ -1,8 +1,8 @@
use std::path::Path;
use config::PREVIEW;
use shared::PeekError;
use yazi_config::PREVIEW;
use tokio::process::Command;
use yazi_shared::PeekError;
pub async fn ffmpegthumbnailer(src: &Path, dest: &Path, skip: usize) -> Result<(), PeekError> {
let percentage = 5 + skip;

View file

@ -2,9 +2,9 @@ use std::collections::BTreeMap;
use anyhow::{bail, Result};
use futures::TryFutureExt;
use shared::{MimeKind, Url};
use tokio::process::Command;
use tracing::error;
use yazi_shared::{MimeKind, Url};
async fn _file(files: &[&Url]) -> Result<BTreeMap<Url, String>> {
if files.is_empty() {

View file

@ -1,8 +1,8 @@
use std::process::Stdio;
use anyhow::Result;
use shared::Url;
use tokio::{process::Command, sync::oneshot::{self, Receiver}};
use yazi_shared::Url;
pub struct FzfOpt {
pub cwd: Url,

View file

@ -1,8 +1,8 @@
use std::{path::Path, process::Stdio};
use anyhow::Result;
use config::PREVIEW;
use shared::PeekError;
use yazi_config::PREVIEW;
use yazi_shared::PeekError;
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command};
pub async fn jq(path: &Path, skip: usize, limit: usize) -> Result<String, PeekError> {

View file

@ -3,7 +3,7 @@ use std::path::Path;
use anyhow::anyhow;
use serde::Deserialize;
use serde_json::Value;
use shared::PeekError;
use yazi_shared::PeekError;
use tokio::process::Command;
#[derive(Debug)]

View file

@ -1,8 +1,8 @@
use std::{path::Path, sync::Arc};
use adaptor::Image;
use yazi_adaptor::Image;
use regex::Regex;
use shared::PeekError;
use yazi_shared::PeekError;
use tokio::process::Command;
pub async fn pdftoppm(src: &Path, dest: impl AsRef<Path>, skip: usize) -> Result<(), PeekError> {

View file

@ -1,7 +1,7 @@
use std::process::Stdio;
use anyhow::Result;
use shared::Url;
use yazi_shared::Url;
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}};
use crate::files::File;

View file

@ -1,7 +1,7 @@
use std::process::Stdio;
use anyhow::Result;
use shared::Url;
use yazi_shared::Url;
use tokio::{process::Command, sync::oneshot::{self, Receiver}};
pub struct ZoxideOpt {

View file

@ -1,7 +1,7 @@
use std::{borrow::Cow, collections::BTreeMap, ffi::OsStr, fs::Metadata};
use anyhow::Result;
use shared::Url;
use yazi_shared::Url;
use tokio::fs;
#[derive(Clone, Debug)]

View file

@ -1,8 +1,8 @@
use std::{collections::{BTreeMap, BTreeSet}, mem, ops::Deref, sync::atomic::Ordering};
use anyhow::Result;
use config::{manager::SortBy, MANAGER};
use shared::Url;
use yazi_config::{manager::SortBy, MANAGER};
use yazi_shared::Url;
use tokio::{fs, select, sync::mpsc::{self, UnboundedReceiver}};
use super::{File, FilesSorter, FILES_TICKET};

View file

@ -1,6 +1,6 @@
use std::{collections::{BTreeMap, BTreeSet}, sync::atomic::{AtomicU64, Ordering}};
use shared::Url;
use yazi_shared::Url;
use super::File;
use crate::emit;

View file

@ -1,7 +1,7 @@
use std::{cmp::Ordering, collections::BTreeMap, mem};
use config::manager::SortBy;
use shared::{natsort, Url};
use yazi_config::manager::SortBy;
use yazi_shared::{natsort, Url};
use super::File;

View file

@ -1,5 +1,5 @@
use config::{keymap::{Control, Key, KeymapLayer}, KEYMAP};
use shared::Term;
use yazi_config::{keymap::{Control, Key, KeymapLayer}, KEYMAP};
use yazi_shared::Term;
use unicode_width::UnicodeWidthStr;
use super::HELP_MARGIN;

View file

@ -1,7 +1,7 @@
use std::{fs::File, io::BufReader, sync::OnceLock};
use anyhow::Result;
use config::THEME;
use yazi_config::THEME;
use syntect::{dumps::from_uncompressed_data, highlighting::{Theme, ThemeSet}, parsing::SyntaxSet};
static SYNTECT_SYNTAX: OnceLock<SyntaxSet> = OnceLock::new();

View file

@ -1,8 +1,8 @@
use std::ops::Range;
use config::keymap::Key;
use yazi_config::keymap::Key;
use crossterm::event::KeyCode;
use shared::{CharKind, InputError};
use yazi_shared::{CharKind, InputError};
use tokio::sync::mpsc::UnboundedSender;
use unicode_width::UnicodeWidthStr;

View file

@ -1,6 +1,6 @@
use std::path::PathBuf;
use shared::Url;
use yazi_shared::Url;
use tokio::fs::{self};
use crate::{emit, files::{File, FilesOp}, input::InputOpt, manager::Manager};

View file

@ -1,5 +1,5 @@
use config::OPEN;
use shared::MIME_DIR;
use yazi_config::OPEN;
use yazi_shared::MIME_DIR;
use crate::{emit, external, manager::Manager, select::SelectOpt};

View file

@ -1,8 +1,8 @@
use std::{collections::BTreeSet, ffi::OsStr, io::{stdout, BufWriter, Write}, path::PathBuf};
use anyhow::{anyhow, bail, Result};
use config::{OPEN, PREVIEW};
use shared::{max_common_root, Defer, Term, Url};
use yazi_config::{OPEN, PREVIEW};
use yazi_shared::{max_common_root, Defer, Term, Url};
use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}};
use crate::{emit, external::{self, ShellOpt}, files::{File, FilesOp}, input::InputOpt, manager::Manager, Event, BLOCKER};

View file

@ -1,6 +1,6 @@
use std::collections::{BTreeMap, HashMap, HashSet};
use shared::Url;
use yazi_shared::Url;
use super::{Tabs, Watcher};
use crate::{emit, files::{File, FilesOp}, tab::{Folder, Tab}, tasks::Tasks};

View file

@ -1,5 +1,5 @@
use config::BOOT;
use shared::Url;
use yazi_config::BOOT;
use yazi_shared::Url;
use crate::{emit, tab::Tab};

View file

@ -3,7 +3,7 @@ use std::{collections::BTreeSet, sync::Arc, time::Duration};
use indexmap::IndexMap;
use notify::{event::{MetadataKind, ModifyKind}, EventKind, RecommendedWatcher, RecursiveMode, Watcher as _Watcher};
use parking_lot::RwLock;
use shared::Url;
use yazi_shared::Url;
use tokio::{fs, pin, sync::mpsc::{self, UnboundedReceiver}};
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};

Some files were not shown because too many files have changed in this diff Show more