fix(naming): made plugin terminology more consistent
This commit is contained in:
parent
996c197fcf
commit
fee999ec40
25 changed files with 34 additions and 44 deletions
26
Cargo.lock
generated
26
Cargo.lock
generated
|
|
@ -84,19 +84,19 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-io"
|
name = "async-io"
|
||||||
version = "1.3.1"
|
version = "1.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd"
|
checksum = "fcb9af4888a70ad78ecb5efcb0ba95d66a3cf54a88b62ae81559954c7588c7a2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"futures-lite",
|
"futures-lite",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"nb-connect",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking",
|
"parking",
|
||||||
"polling",
|
"polling",
|
||||||
|
"socket2",
|
||||||
"vec-arena",
|
"vec-arena",
|
||||||
"waker-fn",
|
"waker-fn",
|
||||||
"winapi",
|
"winapi",
|
||||||
|
|
@ -104,9 +104,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-lock"
|
name = "async-lock"
|
||||||
version = "2.3.0"
|
version = "2.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb"
|
checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"event-listener",
|
"event-listener",
|
||||||
]
|
]
|
||||||
|
|
@ -1025,16 +1025,6 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
|
checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nb-connect"
|
|
||||||
version = "1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
"socket2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.19.1"
|
version = "0.19.1"
|
||||||
|
|
@ -1272,9 +1262,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_syscall"
|
name = "redox_syscall"
|
||||||
version = "0.2.5"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9"
|
checksum = "8270314b5ccceb518e7e578952f0b72b88222d02e8f77f5ecf7abbb673539041"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
]
|
]
|
||||||
|
|
@ -2227,7 +2217,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zellij-tile"
|
name = "zellij-tile"
|
||||||
version = "0.6.0"
|
version = "1.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ lazy_static = "1.4.0"
|
||||||
wasmer = "1.0.0"
|
wasmer = "1.0.0"
|
||||||
wasmer-wasi = "1.0.0"
|
wasmer-wasi = "1.0.0"
|
||||||
interprocess = "1.0.1"
|
interprocess = "1.0.1"
|
||||||
zellij-tile = { path = "zellij-tile/", version = "0.6.0" }
|
zellij-tile = { path = "zellij-tile/", version = "1.0.0" }
|
||||||
|
|
||||||
[dependencies.async-std]
|
[dependencies.async-std]
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
|
|
@ -49,9 +49,9 @@ structopt = "0.3"
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"zellij-tile",
|
"zellij-tile",
|
||||||
"default-tiles/status-bar",
|
"default-plugins/status-bar",
|
||||||
"default-tiles/strider",
|
"default-plugins/strider",
|
||||||
"default-tiles/tab-bar",
|
"default-plugins/tab-bar",
|
||||||
".",
|
".",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ args = ["clippy", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
|
||||||
# Release building and installing Zellij
|
# Release building and installing Zellij
|
||||||
[tasks.install]
|
[tasks.install]
|
||||||
workspace = false
|
workspace = false
|
||||||
dependencies = ["build-tiles-release", "wasm-opt-tiles", "build-release"]
|
dependencies = ["build-plugins-release", "wasm-opt-plugins", "build-release"]
|
||||||
script_runner = "@duckscript"
|
script_runner = "@duckscript"
|
||||||
script = '''
|
script = '''
|
||||||
if is_dir ${CARGO_MAKE_TASK_ARGS}
|
if is_dir ${CARGO_MAKE_TASK_ARGS}
|
||||||
|
|
@ -74,20 +74,20 @@ else
|
||||||
end
|
end
|
||||||
'''
|
'''
|
||||||
|
|
||||||
[tasks.build-tiles-release]
|
[tasks.build-plugins-release]
|
||||||
env = { "CARGO_MAKE_WORKSPACE_SKIP_MEMBERS" = ["."] }
|
env = { "CARGO_MAKE_WORKSPACE_SKIP_MEMBERS" = ["."] }
|
||||||
run_task = { name = "build-release", fork = true }
|
run_task = { name = "build-release", fork = true }
|
||||||
|
|
||||||
[tasks.wasm-opt-tiles]
|
[tasks.wasm-opt-plugins]
|
||||||
script_runner = "@duckscript"
|
script_runner = "@duckscript"
|
||||||
script = '''
|
script = '''
|
||||||
tiles = glob_array ${CARGO_TARGET_DIR}/wasm32-wasi/release/*.wasm
|
plugins = glob_array ${CARGO_TARGET_DIR}/wasm32-wasi/release/*.wasm
|
||||||
|
|
||||||
for tile in ${tiles}
|
for plugin in ${plugins}
|
||||||
tile_name = basename ${tile}
|
plugin_name = basename ${plugin}
|
||||||
tile_out = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/${tile_name}
|
plugin_out = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/${plugin_name}
|
||||||
if is_path_newer ${tile} ${tile_out}
|
if is_path_newer ${plugin} ${plugin_out}
|
||||||
exec wasm-opt -O ${tile} -o ${tile_out}
|
exec wasm-opt -O ${plugin} -o ${plugin_out}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
'''
|
'''
|
||||||
|
|
@ -95,7 +95,7 @@ end
|
||||||
# CI Releasing Zellij
|
# CI Releasing Zellij
|
||||||
[tasks.ci-build-release]
|
[tasks.ci-build-release]
|
||||||
workspace = false
|
workspace = false
|
||||||
dependencies = ["build-tiles-release", "wasm-opt-tiles", "build-release"]
|
dependencies = ["build-plugins-release", "wasm-opt-plugins", "build-release"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["build", "--verbose", "--release", "--target", "${CARGO_MAKE_TASK_ARGS}"]
|
args = ["build", "--verbose", "--release", "--target", "${CARGO_MAKE_TASK_ARGS}"]
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ args = ["build", "--verbose", "--release", "--target", "${CARGO_MAKE_TASK_ARGS}"
|
||||||
[tasks.publish]
|
[tasks.publish]
|
||||||
clear = true
|
clear = true
|
||||||
workspace = false
|
workspace = false
|
||||||
dependencies = ["build-tiles-release", "wasm-opt-tiles", "build-release", "publish-zellij-tile"]
|
dependencies = ["build-plugins-release", "wasm-opt-plugins", "build-release", "publish-zellij-tile"]
|
||||||
run_task = "publish-zellij"
|
run_task = "publish-zellij"
|
||||||
|
|
||||||
[tasks.publish-zellij-tile]
|
[tasks.publish-zellij-tile]
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -27,7 +27,7 @@ struct State {
|
||||||
mode_info: ModeInfo,
|
mode_info: ModeInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
register_tile!(State);
|
register_plugin!(State);
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct LinePart {
|
pub struct LinePart {
|
||||||
|
|
@ -41,7 +41,7 @@ impl Display for LinePart {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ZellijTile for State {
|
impl ZellijPlugin for State {
|
||||||
fn load(&mut self) {
|
fn load(&mut self) {
|
||||||
set_selectable(false);
|
set_selectable(false);
|
||||||
set_invisible_borders(true);
|
set_invisible_borders(true);
|
||||||
|
|
@ -3,7 +3,7 @@ name = "strider"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
authors = ["Brooks J Rady <b.j.rady@gmail.com>"]
|
authors = ["Brooks J Rady <b.j.rady@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "A simplified ranger clone written as a Zellij tile"
|
description = "A simplified ranger clone written as a Zellij plugin"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
@ -5,9 +5,9 @@ use state::{FsEntry, State};
|
||||||
use std::{cmp::min, fs::read_dir};
|
use std::{cmp::min, fs::read_dir};
|
||||||
use zellij_tile::prelude::*;
|
use zellij_tile::prelude::*;
|
||||||
|
|
||||||
register_tile!(State);
|
register_plugin!(State);
|
||||||
|
|
||||||
impl ZellijTile for State {
|
impl ZellijPlugin for State {
|
||||||
fn load(&mut self) {
|
fn load(&mut self) {
|
||||||
refresh_directory(self);
|
refresh_directory(self);
|
||||||
subscribe(&[EventType::KeyPress]);
|
subscribe(&[EventType::KeyPress]);
|
||||||
|
|
@ -31,9 +31,9 @@ pub mod colors {
|
||||||
pub const RED: Colour = Fixed(88);
|
pub const RED: Colour = Fixed(88);
|
||||||
}
|
}
|
||||||
|
|
||||||
register_tile!(State);
|
register_plugin!(State);
|
||||||
|
|
||||||
impl ZellijTile for State {
|
impl ZellijPlugin for State {
|
||||||
fn load(&mut self) {
|
fn load(&mut self) {
|
||||||
set_selectable(false);
|
set_selectable(false);
|
||||||
set_invisible_borders(true);
|
set_invisible_borders(true);
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
[package]
|
[package]
|
||||||
name = "zellij-tile"
|
name = "zellij-tile"
|
||||||
version = "0.6.0"
|
version = "1.0.0"
|
||||||
authors = ["Brooks J Rady <b.j.rady@gmail.com>"]
|
authors = ["Brooks J Rady <b.j.rady@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "A small client-side library for writing Zellij plugins (tiles)"
|
description = "A small client-side library for writing Zellij plugins"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@ pub mod shim;
|
||||||
use data::*;
|
use data::*;
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
pub trait ZellijTile {
|
pub trait ZellijPlugin {
|
||||||
fn load(&mut self) {}
|
fn load(&mut self) {}
|
||||||
fn update(&mut self, event: Event) {}
|
fn update(&mut self, event: Event) {}
|
||||||
fn render(&mut self, rows: usize, cols: usize) {}
|
fn render(&mut self, rows: usize, cols: usize) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! register_tile {
|
macro_rules! register_plugin {
|
||||||
($t:ty) => {
|
($t:ty) => {
|
||||||
thread_local! {
|
thread_local! {
|
||||||
static STATE: std::cell::RefCell<$t> = std::cell::RefCell::new(Default::default());
|
static STATE: std::cell::RefCell<$t> = std::cell::RefCell::new(Default::default());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue