summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2022-12-09 10:49:32 +0000
committerGitHub <noreply@github.com>2022-12-09 10:49:32 +0000
commit1e141aa7fe4a49a8df8b0c268952d01268776199 (patch)
tree56e7db7f6713f78eec7a7f3b2afea06f585bea66
parent36233439f930f0c50bed574e95ff4cd887893120 (diff)
HOTFIX: utils: Move plugins into new assets folder (#2003)
that is included in the utils to make builds pass.
-rw-r--r--Cargo.toml2
-rw-r--r--Makefile.toml8
-rwxr-xr-xassets/plugins/compact-bar.wasmbin387904 -> 0 bytes
-rwxr-xr-xassets/plugins/status-bar.wasmbin476637 -> 0 bytes
-rwxr-xr-xassets/plugins/strider.wasmbin404135 -> 0 bytes
-rwxr-xr-xassets/plugins/tab-bar.wasmbin363803 -> 0 bytes
-rw-r--r--zellij-utils/Cargo.toml1
-rw-r--r--zellij-utils/src/consts.rs14
-rw-r--r--zellij-utils/src/input/plugins.rs6
-rw-r--r--zellij-utils/src/setup.rs6
10 files changed, 18 insertions, 19 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 264854cb7..7b52e7371 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,7 +7,7 @@ description = "A terminal workspace with batteries included"
license = "MIT"
repository = "https://github.com/zellij-org/zellij"
homepage = "https://zellij.dev"
-include = ["src/**/*", "assets/plugins/*", "assets/layouts/*", "assets/config/*", "LICENSE.md", "README.md", "!**/*_test.*", "!**/tests/**/*"]
+include = ["src/**/*", "assets/layouts/*", "assets/config/*", "LICENSE.md", "README.md", "!**/*_test.*", "!**/tests/**/*"]
rust-version = "1.60"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/Makefile.toml b/Makefile.toml
index 1fcdb138b..a14cc0e98 100644
--- a/Makefile.toml
+++ b/Makefile.toml
@@ -92,7 +92,7 @@ workspace = false
script_runner = "@duckscript"
script = '''
plugins = glob_array ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/default-plugins/*
-out_dir = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/
+out_dir = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/zellij-utils/assets/plugins/
mkdir ${out_dir}
for plugin in ${plugins}
@@ -111,10 +111,16 @@ workspace = false
script_runner = "@duckscript"
script = '''
plugins = glob_array ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/default-plugins/*
+out_dir = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/zellij-utils/assets/plugins/
+mkdir ${out_dir}
for plugin in ${plugins}
cd ${plugin}
exec cargo build
+ plugin_name = basename ${plugin}
+ plugin_in = set ${CARGO_TARGET_DIR}/wasm32-wasi/debug/${plugin_name}.wasm
+ plugin_out = set ${out_dir}/${plugin_name}.wasm
+ cp ${plugin_in} ${plugin_out}
cd ..
end
'''
diff --git a/assets/plugins/compact-bar.wasm b/assets/plugins/compact-bar.wasm
deleted file mode 100755
index 36579e780..000000000
--- a/assets/plugins/compact-bar.wasm
+++ /dev/null
Binary files differ
diff --git a/assets/plugins/status-bar.wasm b/assets/plugins/status-bar.wasm
deleted file mode 100755
index d4d12a689..000000000
--- a/assets/plugins/status-bar.wasm
+++ /dev/null
Binary files differ
diff --git a/assets/plugins/strider.wasm b/assets/plugins/strider.wasm
deleted file mode 100755
index eeef83121..000000000
--- a/assets/plugins/strider.wasm
+++ /dev/null
Binary files differ
diff --git a/assets/plugins/tab-bar.wasm b/assets/plugins/tab-bar.wasm
deleted file mode 100755
index 96e2dfdc2..000000000
--- a/assets/plugins/tab-bar.wasm
+++ /dev/null
Binary files differ
diff --git a/zellij-utils/Cargo.toml b/zellij-utils/Cargo.toml
index 6d0e34519..0e88c63a6 100644
--- a/zellij-utils/Cargo.toml
+++ b/zellij-utils/Cargo.toml
@@ -5,6 +5,7 @@ authors = ["Kunal Mohan <kunalmohan99@gmail.com>"]
edition = "2021"
description = "A utility library for Zellij client and server"
license = "MIT"
+include = ["src/**/*", "assets/"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs
index 328be223b..0e8a6acc1 100644
--- a/zellij-utils/src/consts.rs
+++ b/zellij-utils/src/consts.rs
@@ -35,10 +35,10 @@ pub const FEATURES: &[&str] = &[
"disable_automatic_asset_installation",
];
-#[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+#[cfg(not(target_family = "wasm"))]
pub use not_wasm::*;
-#[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+#[cfg(not(target_family = "wasm"))]
mod not_wasm {
use lazy_static::lazy_static;
use std::collections::HashMap;
@@ -49,17 +49,9 @@ mod not_wasm {
($assets:expr, $plugin:literal) => {
$assets.insert(
PathBuf::from("plugins").join($plugin),
- #[cfg(debug_assertions)]
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
- "/../target/wasm32-wasi/debug/",
- $plugin
- ))
- .to_vec(),
- #[cfg(not(debug_assertions))]
- include_bytes!(concat!(
- env!("CARGO_MANIFEST_DIR"),
- "/../assets/plugins/",
+ "/assets/plugins/",
$plugin
))
.to_vec(),
diff --git a/zellij-utils/src/input/plugins.rs b/zellij-utils/src/input/plugins.rs
index 7503f43b0..1ab3e831f 100644
--- a/zellij-utils/src/input/plugins.rs
+++ b/zellij-utils/src/input/plugins.rs
@@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use url::Url;
use super::layout::{RunPlugin, RunPluginLocation};
-#[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+#[cfg(not(target_family = "wasm"))]
use crate::consts::ASSET_MAP;
pub use crate::data::PluginTag;
use crate::errors::prelude::*;
@@ -129,7 +129,7 @@ impl PluginConfig {
for path in paths {
// Check if the plugin path matches an entry in the asset map. If so, load it directly
// from memory, don't bother with the disk.
- #[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+ #[cfg(not(target_family = "wasm"))]
if !cfg!(feature = "disable_automatic_asset_installation") && self.is_builtin() {
let asset_path = PathBuf::from("plugins").join(path);
if let Some(bytes) = ASSET_MAP.get(&asset_path) {
@@ -160,7 +160,7 @@ impl PluginConfig {
}
// Not reached if a plugin is found!
- #[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+ #[cfg(not(target_family = "wasm"))]
if self.is_builtin() {
// Layout requested a builtin plugin that wasn't found
let plugin_path = self.path.with_extension("wasm");
diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs
index 5de536c71..ddbc59673 100644
--- a/zellij-utils/src/setup.rs
+++ b/zellij-utils/src/setup.rs
@@ -1,4 +1,4 @@
-#[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+#[cfg(not(target_family = "wasm"))]
use crate::consts::ASSET_MAP;
use crate::input::theme::Themes;
use crate::{
@@ -175,7 +175,7 @@ pub fn dump_specified_layout(layout: &str) -> std::io::Result<()> {
}
}
-#[cfg(all(not(target_family = "wasm"), feature = "asset_map"))]
+#[cfg(not(target_family = "wasm"))]
pub fn dump_builtin_plugins(path: &PathBuf) -> Result<()> {
for (asset_path, bytes) in ASSET_MAP.iter() {
let plugin_path = path.join(asset_path);
@@ -205,7 +205,7 @@ pub fn dump_builtin_plugins(path: &PathBuf) -> Result<()> {
Ok(())
}
-#[cfg(any(target_family = "wasm", not(feature = "asset_map")))]
+#[cfg(target_family = "wasm")]
pub fn dump_builtin_plugins(_path: &PathBuf) -> Result<()> {
Ok(())
}