diff options
| author | har7an <99636919+har7an@users.noreply.github.com> | 2025-03-23 10:03:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-23 10:03:42 +0000 |
| commit | 6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34 (patch) | |
| tree | 5df14ebd014407f087cb8b5d46c4f0f44a5b3908 /zellij-server/src/plugins | |
| parent | build: Don't use default features (#4086) (diff) | |
| download | sl0ppij-6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34.tar.gz sl0ppij-6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34.tar.xz sl0ppij-6be8c495bcbdc2aa4fd4d6528b213ca8b6189b34.zip | |
build: Don't re-export foreign crates in utils (#4087)
* build(utils): Don't use reexported dependency
for internal code, but use the dependency directly.
* build(client): Don't use re-exports from `utils`
but turn `zellij-utils` dependencies into shared workspace dependencies
instead and specify those in `Cargo.toml` explicitly. This gives a much
better overview of what component in zellij uses which crates. The
previous approach hides a lot of this information since it looks like
crates are used in a single place where this isn't actually true.
* deps(tile): Don't use re-exports from zellij-utils.
* build(zellij): Don't use re-exports from zellij-utils.
* build(server): Don't use re-exports from zellij-utils.
* build(utils): Don't re-export foreign crates.
* docs: Update Changelog with PR #4087.
* style: Apply rustfmt.
* style: Apply rustfmt.
* build(e2e): Don't use re-export from zellij-utils.
* test: Restore e2e tests.
* style: Apply more formatting.
Diffstat (limited to 'zellij-server/src/plugins')
| -rw-r--r-- | zellij-server/src/plugins/mod.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/plugins/pipes.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/plugins/plugin_loader.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/plugins/plugin_map.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/plugins/plugin_worker.rs | 6 | ||||
| -rw-r--r-- | zellij-server/src/plugins/unit/plugin_tests.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/plugins/wasm_bridge.rs | 8 | ||||
| -rw-r--r-- | zellij-server/src/plugins/watch_filesystem.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/plugins/zellij_exports.rs | 11 |
9 files changed, 17 insertions, 20 deletions
diff --git a/zellij-server/src/plugins/mod.rs b/zellij-server/src/plugins/mod.rs index f1d11377..d7cb07d2 100644 --- a/zellij-server/src/plugins/mod.rs +++ b/zellij-server/src/plugins/mod.rs @@ -22,8 +22,8 @@ use crate::{pty::PtyInstruction, thread_bus::Bus, ClientId, ServerInstruction}; pub use wasm_bridge::PluginRenderAsset; use wasm_bridge::WasmBridge; +use async_std::{channel, future::timeout, task}; use zellij_utils::{ - async_std::{channel, future::timeout, task}, data::{ ClientInfo, Event, EventType, InputMode, MessageToPlugin, PermissionStatus, PermissionType, PipeMessage, PipeSource, PluginCapabilities, diff --git a/zellij-server/src/plugins/pipes.rs b/zellij-server/src/plugins/pipes.rs index 36cee46e..840af17b 100644 --- a/zellij-server/src/plugins/pipes.rs +++ b/zellij-server/src/plugins/pipes.rs @@ -6,8 +6,8 @@ use std::collections::{HashMap, HashSet}; use zellij_utils::data::{PipeMessage, PipeSource}; use zellij_utils::plugin_api::pipe_message::ProtobufPipeMessage; +use prost::Message; use zellij_utils::errors::prelude::*; -use zellij_utils::prost::Message; use crate::{thread_bus::ThreadSenders, ClientId}; diff --git a/zellij-server/src/plugins/plugin_loader.rs b/zellij-server/src/plugins/plugin_loader.rs index 4dac8df8..1dbe020e 100644 --- a/zellij-server/src/plugins/plugin_loader.rs +++ b/zellij-server/src/plugins/plugin_loader.rs @@ -6,6 +6,7 @@ use crate::plugins::zellij_exports::{wasi_write_object, zellij_exports}; use crate::plugins::PluginId; use highway::{HighwayHash, PortableHash}; use log::info; +use prost::Message; use std::{ collections::{HashMap, HashSet, VecDeque}, fs, @@ -16,7 +17,6 @@ use url::Url; use wasmtime::{Engine, Instance, Linker, Module, Store}; use wasmtime_wasi::{preview1::WasiP1Ctx, DirPerms, FilePerms, WasiCtxBuilder}; use zellij_utils::consts::ZELLIJ_PLUGIN_ARTIFACT_DIR; -use zellij_utils::prost::Message; use crate::{ logging_pipe::LoggingPipe, screen::ScreenInstruction, thread_bus::ThreadSenders, diff --git a/zellij-server/src/plugins/plugin_map.rs b/zellij-server/src/plugins/plugin_map.rs index 655aec50..6716dffd 100644 --- a/zellij-server/src/plugins/plugin_map.rs +++ b/zellij-server/src/plugins/plugin_map.rs @@ -16,7 +16,7 @@ use wasmtime_wasi::{ use crate::{thread_bus::ThreadSenders, ClientId}; -use zellij_utils::async_channel::Sender; +use async_channel::Sender; use zellij_utils::{ data::EventType, data::InputMode, diff --git a/zellij-server/src/plugins/plugin_worker.rs b/zellij-server/src/plugins/plugin_worker.rs index 635c8f50..30085a3a 100644 --- a/zellij-server/src/plugins/plugin_worker.rs +++ b/zellij-server/src/plugins/plugin_worker.rs @@ -2,11 +2,11 @@ use crate::plugins::plugin_map::PluginEnv; use crate::plugins::zellij_exports::wasi_write_object; use wasmtime::{Instance, Store}; -use zellij_utils::async_channel::{unbounded, Receiver, Sender}; -use zellij_utils::async_std::task; +use async_channel::{unbounded, Receiver, Sender}; +use async_std::task; +use prost::Message; use zellij_utils::errors::prelude::*; use zellij_utils::plugin_api::message::ProtobufMessage; -use zellij_utils::prost::Message; pub struct RunningWorker { pub instance: Instance, diff --git a/zellij-server/src/plugins/unit/plugin_tests.rs b/zellij-server/src/plugins/unit/plugin_tests.rs index 38b8448b..327252a1 100644 --- a/zellij-server/src/plugins/unit/plugin_tests.rs +++ b/zellij-server/src/plugins/unit/plugin_tests.rs @@ -2,6 +2,7 @@ use super::plugin_thread_main; use crate::screen::ScreenInstruction; use crate::{channels::SenderWithContext, thread_bus::Bus, ServerInstruction}; use insta::assert_snapshot; +use lazy_static::lazy_static; use std::collections::BTreeMap; use std::path::PathBuf; use tempfile::tempdir; @@ -18,7 +19,6 @@ use zellij_utils::input::layout::{ use zellij_utils::input::permission::PermissionCache; use zellij_utils::input::plugins::PluginAliases; use zellij_utils::ipc::ClientAttributes; -use zellij_utils::lazy_static::lazy_static; use zellij_utils::pane_size::Size; use crate::background_jobs::BackgroundJob; diff --git a/zellij-server/src/plugins/wasm_bridge.rs b/zellij-server/src/plugins/wasm_bridge.rs index 5bac0294..5efebf38 100644 --- a/zellij-server/src/plugins/wasm_bridge.rs +++ b/zellij-server/src/plugins/wasm_bridge.rs @@ -8,8 +8,11 @@ use crate::plugins::plugin_map::{AtomicEvent, PluginEnv, PluginMap, RunningPlugi use crate::plugins::plugin_worker::MessageToWorker; use crate::plugins::watch_filesystem::watch_filesystem; use crate::plugins::zellij_exports::{wasi_read_string, wasi_write_object}; +use async_channel::Sender; +use async_std::task::{self, JoinHandle}; use highway::{HighwayHash, PortableHash}; use log::info; +use notify_debouncer_full::{notify::RecommendedWatcher, Debouncer, FileIdMap}; use std::{ collections::{BTreeMap, HashMap, HashSet}, path::PathBuf, @@ -17,17 +20,14 @@ use std::{ sync::{Arc, Mutex}, }; use wasmtime::{Engine, Module}; -use zellij_utils::async_channel::Sender; -use zellij_utils::async_std::task::{self, JoinHandle}; use zellij_utils::consts::{ZELLIJ_CACHE_DIR, ZELLIJ_TMP_DIR}; use zellij_utils::data::{InputMode, PermissionStatus, PermissionType, PipeMessage, PipeSource}; use zellij_utils::downloader::Downloader; use zellij_utils::input::keybinds::Keybinds; use zellij_utils::input::permission::PermissionCache; -use zellij_utils::notify_debouncer_full::{notify::RecommendedWatcher, Debouncer, FileIdMap}; use zellij_utils::plugin_api::event::ProtobufEvent; -use zellij_utils::prost::Message; +use prost::Message; use crate::panes::PaneId; use crate::{ diff --git a/zellij-server/src/plugins/watch_filesystem.rs b/zellij-server/src/plugins/watch_filesystem.rs index d21d1c02..8cb01af2 100644 --- a/zellij-server/src/plugins/watch_filesystem.rs +++ b/zellij-server/src/plugins/watch_filesystem.rs @@ -5,7 +5,7 @@ use crate::thread_bus::ThreadSenders; use std::path::Path; use std::time::Duration; -use zellij_utils::notify_debouncer_full::{ +use notify_debouncer_full::{ new_debouncer, notify::{EventKind, RecommendedWatcher, RecursiveMode, Watcher}, DebounceEventResult, Debouncer, FileIdMap, diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs index 4c6496cc..25964938 100644 --- a/zellij-server/src/plugins/zellij_exports.rs +++ b/zellij-server/src/plugins/zellij_exports.rs @@ -5,6 +5,8 @@ use crate::plugins::wasm_bridge::handle_plugin_crash; use crate::pty::{ClientTabIndexOrPaneId, PtyInstruction}; use crate::route::route_action; use crate::ServerInstruction; +use async_std::task; +use interprocess::local_socket::LocalSocketStream; use log::warn; use serde::Serialize; use std::{ @@ -22,14 +24,11 @@ use zellij_utils::data::{ MessageToPlugin, OriginatingPlugin, PermissionStatus, PermissionType, PluginPermission, }; use zellij_utils::input::permission::PermissionCache; -use zellij_utils::{ - async_std::task, - interprocess::local_socket::LocalSocketStream, - ipc::{ClientToServerMsg, IpcSenderWithContext}, -}; +use zellij_utils::ipc::{ClientToServerMsg, IpcSenderWithContext}; use crate::{panes::PaneId, screen::ScreenInstruction}; +use prost::Message; use zellij_utils::{ consts::{VERSION, ZELLIJ_SESSION_INFO_CACHE_DIR, ZELLIJ_SOCK_DIR}, data::{ @@ -46,8 +45,6 @@ use zellij_utils::{ plugin_command::ProtobufPluginCommand, plugin_ids::{ProtobufPluginIds, ProtobufZellijVersion}, }, - prost::Message, - serde, }; macro_rules! apply_action { |
