mirror of
https://github.com/sxyazi/yazi.git
synced 2024-09-11 02:15:27 +03:00
refactor: publish to crates.io (#298)
This commit is contained in:
parent
df4b502808
commit
671b480ab1
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -35,6 +35,8 @@ jobs:
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
YAZI_GEN_COMPLETIONS: true
|
||||
run: cargo build --release --locked --target ${{ matrix.target }}
|
||||
|
||||
- name: Pack artifacts [Linux & macOS]
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
target/
|
||||
config/completions
|
||||
yazi-config/completions
|
||||
|
||||
.DS_Store
|
||||
|
||||
|
238
Cargo.lock
generated
238
Cargo.lock
generated
@ -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"
|
||||
|
@ -1,13 +1,6 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"adaptor",
|
||||
"app",
|
||||
"config",
|
||||
"core",
|
||||
"plugin",
|
||||
"shared",
|
||||
]
|
||||
members = [ "yazi-*" ]
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
@ -1,19 +0,0 @@
|
||||
[package]
|
||||
name = "adaptor"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
config = { path = "../config" }
|
||||
shared = { path = "../shared" }
|
||||
|
||||
# External dependencies
|
||||
anyhow = "^1"
|
||||
base64 = "^0"
|
||||
color_quant = "^1"
|
||||
image = "^0"
|
||||
ratatui = "^0"
|
||||
tokio = { version = "^1", features = [ "parking_lot" ] }
|
||||
|
||||
# Logging
|
||||
tracing = "^0"
|
@ -1,33 +0,0 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
adaptor = { path = "../adaptor" }
|
||||
config = { path = "../config" }
|
||||
core = { path = "../core" }
|
||||
plugin = { path = "../plugin" }
|
||||
shared = { path = "../shared" }
|
||||
|
||||
# External dependencies
|
||||
ansi-to-tui = "^3"
|
||||
anyhow = "^1"
|
||||
crossterm = { version = "^0", features = [ "event-stream" ] }
|
||||
futures = "^0"
|
||||
ratatui = "^0"
|
||||
tokio = { version = "^1", features = [ "parking_lot" ] }
|
||||
unicode-width = "^0"
|
||||
|
||||
# Logging
|
||||
tracing = "^0"
|
||||
tracing-appender = "^0"
|
||||
tracing-subscriber = "^0"
|
||||
|
||||
[target."cfg(unix)".dependencies]
|
||||
libc = "^0"
|
||||
signal-hook-tokio = { version = "^0", features = [ "futures-v0_3" ] }
|
||||
|
||||
[[bin]]
|
||||
name = "yazi"
|
||||
path = "src/main.rs"
|
@ -1 +1 @@
|
||||
{"version":"0.2","language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode"],"flagWords":[]}
|
||||
{"words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi"],"language":"en","version":"0.2","flagWords":[]}
|
||||
|
@ -27,7 +27,7 @@
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
versionSuffix = "pre${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}_${self.shortRev or "dirty"}";
|
||||
version = (builtins.fromTOML (builtins.readFile ./app/Cargo.toml)).package.version + versionSuffix;
|
||||
version = (builtins.fromTOML (builtins.readFile ./yazi-fm/Cargo.toml)).package.version + versionSuffix;
|
||||
yazi = pkgs.callPackage ./nix/yazi.nix { inherit version; };
|
||||
in
|
||||
{
|
||||
|
@ -1,17 +0,0 @@
|
||||
[package]
|
||||
name = "plugin"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
config = { path = "../config" }
|
||||
core = { path = "../core" }
|
||||
shared = { path = "../shared" }
|
||||
|
||||
# External dependencies
|
||||
ansi-to-tui = "^3"
|
||||
anyhow = "^1"
|
||||
mlua = { version = "^0", features = [ "luajit52", "vendored", "serialize" ] }
|
||||
ratatui = "^0"
|
||||
tracing = "^0"
|
||||
unicode-width = "^0"
|
@ -8,3 +8,4 @@ echo "Bumping version: $1"
|
||||
|
||||
TOML_FILES="$(git ls-files '*Cargo.toml')"
|
||||
perl -pi -e "s/^version = .*\$/version = \"$1\"/" $TOML_FILES
|
||||
perl -pi -e "s/^(yazi-[a-z]+)\\s*=\\s*{.*\$/\\1 = { path = \"..\/\\1\", version = \"$1\" }/" $TOML_FILES
|
||||
|
24
yazi-adaptor/Cargo.toml
Normal file
24
yazi-adaptor/Cargo.toml
Normal file
@ -0,0 +1,24 @@
|
||||
[package]
|
||||
name = "yazi-adaptor"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = [ "sxyazi <sxyazi@gmail.com>" ]
|
||||
description = "Yazi image adaptor"
|
||||
homepage = "https://yazi-rs.github.io"
|
||||
repository = "https://github.com/sxyazi/yazi"
|
||||
|
||||
[dependencies]
|
||||
yazi-config = { path = "../yazi-config", version = "0.1.5" }
|
||||
yazi-shared = { path = "../yazi-shared", version = "0.1.5" }
|
||||
|
||||
# External dependencies
|
||||
anyhow = "^1"
|
||||
base64 = "^0"
|
||||
color_quant = "^1"
|
||||
image = "^0"
|
||||
ratatui = "^0"
|
||||
tokio = { version = "^1", features = [ "parking_lot", "io-util", "process" ] }
|
||||
|
||||
# Logging
|
||||
tracing = "^0"
|
@ -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};
|
@ -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;
|
||||
|
@ -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};
|
@ -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};
|
@ -10,8 +10,8 @@ mod ueberzug;
|
||||
use adaptor::*;
|
||||
use iterm2::*;
|
||||
use kitty::*;
|
||||
use shared::RoCell;
|
||||
use sixel::*;
|
||||
use yazi_shared::RoCell;
|
||||
|
||||
pub use crate::image::*;
|
||||
|
@ -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};
|
||||
|
@ -1,10 +1,15 @@
|
||||
[package]
|
||||
name = "config"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
name = "yazi-config"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = [ "sxyazi <sxyazi@gmail.com>" ]
|
||||
description = "Yazi configuration file parser"
|
||||
homepage = "https://yazi-rs.github.io"
|
||||
repository = "https://github.com/sxyazi/yazi"
|
||||
|
||||
[dependencies]
|
||||
shared = { path = "../shared" }
|
||||
yazi-shared = { path = "../yazi-shared", version = "0.1.5" }
|
||||
|
||||
# External dependencies
|
||||
anyhow = "^1"
|
@ -1,12 +1,16 @@
|
||||
#[path = "src/boot/cli.rs"]
|
||||
mod cli;
|
||||
|
||||
use std::{fs, io};
|
||||
use std::{env, fs, io};
|
||||
|
||||
use clap::CommandFactory;
|
||||
use clap_complete::{generate_to, Shell};
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
if env::var_os("YAZI_GEN_COMPLETIONS").is_none() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let cmd = &mut cli::Args::command();
|
||||
let bin = "yazi";
|
||||
let out = "completions";
|
||||
@ -19,6 +23,5 @@ fn main() -> io::Result<()> {
|
||||
generate_to(Shell::PowerShell, cmd, bin, out)?;
|
||||
generate_to(clap_complete_nushell::Nushell, cmd, bin, out)?;
|
||||
generate_to(clap_complete_fig::Fig, cmd, bin, out)?;
|
||||
|
||||
Ok(())
|
||||
}
|
@ -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};
|
@ -1,6 +1,6 @@
|
||||
#![allow(clippy::module_inception)]
|
||||
|
||||
use shared::RoCell;
|
||||
use yazi_shared::RoCell;
|
||||
|
||||
mod boot;
|
||||
pub mod keymap;
|
@ -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;
|
||||
|
@ -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};
|
@ -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;
|
||||
|
@ -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};
|
||||
|
@ -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};
|
@ -1,6 +1,6 @@
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
use shared::expand_path;
|
||||
use yazi_shared::expand_path;
|
||||
|
||||
pub(super) struct Xdg;
|
||||
|
@ -1,12 +1,17 @@
|
||||
[package]
|
||||
name = "core"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
name = "yazi-core"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = [ "sxyazi <sxyazi@gmail.com>" ]
|
||||
description = "Yazi core logic"
|
||||
homepage = "https://yazi-rs.github.io"
|
||||
repository = "https://github.com/sxyazi/yazi"
|
||||
|
||||
[dependencies]
|
||||
adaptor = { path = "../adaptor" }
|
||||
config = { path = "../config" }
|
||||
shared = { path = "../shared" }
|
||||
yazi-adaptor = { path = "../yazi-adaptor", version = "0.1.5" }
|
||||
yazi-config = { path = "../yazi-config", version = "0.1.5" }
|
||||
yazi-shared = { path = "../yazi-shared", version = "0.1.5" }
|
||||
|
||||
# External dependencies
|
||||
anyhow = "^1"
|
@ -1,5 +1,5 @@
|
||||
use shared::RoCell;
|
||||
use tokio::sync::Semaphore;
|
||||
use yazi_shared::RoCell;
|
||||
|
||||
pub static BLOCKER: RoCell<Semaphore> = RoCell::new();
|
||||
|
@ -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};
|
||||
|
@ -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};
|
@ -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;
|
||||
|
@ -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;
|
@ -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() {
|
@ -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,
|
@ -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> {
|
@ -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)]
|
@ -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> {
|
@ -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;
|
@ -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 {
|
@ -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)]
|
@ -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};
|
@ -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;
|
@ -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;
|
||||
|
@ -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;
|
@ -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();
|
@ -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;
|
||||
|
@ -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};
|
@ -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};
|
||||
|
@ -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};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user