feat(rename): renamed iirhai --> rhai_impl

This commit is contained in:
Byson94
2025-09-03 15:09:20 +05:30
parent ddf8b94b18
commit a734a93a2c
30 changed files with 39 additions and 39 deletions

View File

@@ -3,10 +3,10 @@
**General things to keep in mind:** **General things to keep in mind:**
- Run `cargo fmt` for formatting your code. - Run `cargo fmt` for formatting your code.
- Always do PR (Pull Request) to iidev branch (especially if its a doc change). - Always do PR (Pull Request) to iidev branch if it is a new feature.
## Codebase ## Codebase
- `crates/ewwii`: Core of ewwii (ipc, daemon, options, rt engine, gtk, etc.) - `crates/ewwii`: Core of ewwii (ipc, daemon, options, rt engine, gtk, etc.)
- `crates/iirhai`: Rhai implementation (parsing, modules, poll/listen handlers) - `crates/rhai_impl`: Rhai implementation (parsing, modules, poll/listen handlers)
- `crates/shared_utils`: Utility functions shared between rhai and ewwii (spans, helpers) - `crates/shared_utils`: Utility functions shared between rhai and ewwii (spans, helpers)

44
Cargo.lock generated
View File

@@ -590,7 +590,6 @@ dependencies = [
"grass", "grass",
"gtk", "gtk",
"gtk-layer-shell", "gtk-layer-shell",
"iirhai",
"itertools", "itertools",
"log", "log",
"nix", "nix",
@@ -600,6 +599,7 @@ dependencies = [
"pretty_env_logger", "pretty_env_logger",
"regex", "regex",
"rhai", "rhai",
"rhai_impl",
"serde", "serde",
"serde_json", "serde_json",
"shared_utils", "shared_utils",
@@ -839,9 +839,9 @@ dependencies = [
name = "generate-rhai-docs" name = "generate-rhai-docs"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"iirhai",
"rhai", "rhai",
"rhai-autodocs", "rhai-autodocs",
"rhai_impl",
] ]
[[package]] [[package]]
@@ -1175,26 +1175,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "iirhai"
version = "0.1.0"
dependencies = [
"ahash",
"anyhow",
"colored",
"gtk",
"libc",
"log",
"nix",
"once_cell",
"rhai",
"serde",
"shared_utils",
"termsize",
"textwrap",
"tokio",
]
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.5.0" version = "2.5.0"
@@ -1860,6 +1840,26 @@ dependencies = [
"syn 2.0.87", "syn 2.0.87",
] ]
[[package]]
name = "rhai_impl"
version = "0.1.0"
dependencies = [
"ahash",
"anyhow",
"colored",
"gtk",
"libc",
"log",
"nix",
"once_cell",
"rhai",
"serde",
"shared_utils",
"termsize",
"textwrap",
"tokio",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.24" version = "0.1.24"

View File

@@ -5,7 +5,7 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
shared_utils = { version = "0.1.0", path = "crates/shared_utils" } shared_utils = { version = "0.1.0", path = "crates/shared_utils" }
iirhai = { version = "0.1.0", path = "crates/iirhai" } rhai_impl = { version = "0.1.0", path = "crates/rhai_impl" }
anyhow = "1.0.86" anyhow = "1.0.86"
ahash = "0.8.12" ahash = "0.8.12"

View File

@@ -16,7 +16,7 @@ wayland = ["gtk-layer-shell"]
[dependencies] [dependencies]
shared_utils.workspace = true shared_utils.workspace = true
iirhai.workspace = true rhai_impl.workspace = true
gtk-layer-shell = { version = "0.8.1", optional = true, features=["v0_6"] } gtk-layer-shell = { version = "0.8.1", optional = true, features=["v0_6"] }
gdkx11 = { version = "0.18", optional = true } gdkx11 = { version = "0.18", optional = true }

View File

@@ -27,7 +27,7 @@ use codespan_reporting::files::Files;
use gdk::Monitor; use gdk::Monitor;
use glib::ObjectExt; use glib::ObjectExt;
use gtk::{gdk, glib}; use gtk::{gdk, glib};
use iirhai::ast::WidgetNode; use rhai_impl::ast::WidgetNode;
use itertools::Itertools; use itertools::Itertools;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use rhai::Dynamic; use rhai::Dynamic;
@@ -316,7 +316,7 @@ impl<B: DisplayBackend> App<B> {
/// Fully stop ewwii: /// Fully stop ewwii:
/// close all windows, stop the script_var_handler, quit the gtk appliaction and send the exit instruction to the lifecycle manager /// close all windows, stop the script_var_handler, quit the gtk appliaction and send the exit instruction to the lifecycle manager
fn stop_application(&mut self) { fn stop_application(&mut self) {
iirhai::updates::kill_state_change_handler(); rhai_impl::updates::kill_state_change_handler();
for (_, window) in self.open_windows.drain() { for (_, window) in self.open_windows.drain() {
window.close(); window.close();
} }
@@ -350,7 +350,7 @@ impl<B: DisplayBackend> App<B> {
// stop poll/listen handlers if no windows are open // stop poll/listen handlers if no windows are open
if self.open_windows.is_empty() { if self.open_windows.is_empty() {
iirhai::updates::kill_state_change_handler(); rhai_impl::updates::kill_state_change_handler();
} }
Ok(()) Ok(())
@@ -403,7 +403,7 @@ impl<B: DisplayBackend> App<B> {
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel::<String>(); let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel::<String>();
let config_path = self.paths.get_rhai_path(); let config_path = self.paths.get_rhai_path();
let compiled_ast = self.ewwii_config.get_owned_compiled_ast(); let compiled_ast = self.ewwii_config.get_owned_compiled_ast();
let mut stored_parser = iirhai::parser::ParseConfig::new(); let mut stored_parser = rhai_impl::parser::ParseConfig::new();
let widget_reg_store = widget_reg_store.clone(); let widget_reg_store = widget_reg_store.clone();
@@ -417,7 +417,7 @@ impl<B: DisplayBackend> App<B> {
// I just cant find the perfect place where it can live // I just cant find the perfect place where it can live
// so I guess that I will just let it stay right here. // so I guess that I will just let it stay right here.
if self.open_windows.is_empty() { if self.open_windows.is_empty() {
let store = iirhai::updates::handle_state_changes( let store = rhai_impl::updates::handle_state_changes(
self.ewwii_config.get_root_node()?.as_ref(), self.ewwii_config.get_root_node()?.as_ref(),
tx, tx,
); );
@@ -745,7 +745,7 @@ fn initialize_window<B: DisplayBackend>(
}) })
} }
use iirhai::parser::ParseConfig; use rhai_impl::parser::ParseConfig;
async fn generate_new_widgetnode( async fn generate_new_widgetnode(
all_vars: &HashMap<String, String>, all_vars: &HashMap<String, String>,

View File

@@ -8,7 +8,7 @@ use crate::{
window::backend_window_options::BackendWindowOptionsDef, window::backend_window_options::BackendWindowOptionsDef,
}; };
use iirhai::{parser::ParseConfig, ast::WidgetNode}; use rhai_impl::{parser::ParseConfig, ast::WidgetNode};
use rhai::{Map, AST}; use rhai::{Map, AST};
// use tokio::{net::UnixStream, runtime::Runtime, sync::mpsc}; // use tokio::{net::UnixStream, runtime::Runtime, sync::mpsc};

View File

@@ -3,7 +3,7 @@ use gtk::gdk::prelude::Cast;
use crate::{config::WindowDefinition, widgets::widget_definitions::*}; use crate::{config::WindowDefinition, widgets::widget_definitions::*};
use iirhai::ast::WidgetNode; use rhai_impl::ast::WidgetNode;
/// Widget input allows us to pass either a widgetnode or a window_def /// Widget input allows us to pass either a widgetnode or a window_def
/// this is important to make build_gtk_widget standalone without having to /// this is important to make build_gtk_widget standalone without having to

View File

@@ -8,7 +8,7 @@ use gtk::glib::translate::FromGlib;
use gtk::prelude::LabelExt; use gtk::prelude::LabelExt;
use gtk::{self, prelude::*, DestDefaults, TargetEntry, TargetList}; use gtk::{self, prelude::*, DestDefaults, TargetEntry, TargetList};
use gtk::{gdk, glib, pango}; use gtk::{gdk, glib, pango};
use iirhai::ast::{get_id_to_widget_info, hash_props_and_type, WidgetNode}; use rhai_impl::ast::{get_id_to_widget_info, hash_props_and_type, WidgetNode};
use rhai::Map; use rhai::Map;
use super::widget_definitions_helper::*; use super::widget_definitions_helper::*;

View File

@@ -1,10 +1,10 @@
[package] [package]
name = "iirhai" name = "rhai_impl"
version = "0.1.0" version = "0.1.0"
authors = ["byson94 <byson94wastaken@gmail.com>"] authors = ["byson94 <byson94wastaken@gmail.com>"]
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
description = "A simple rhai based expression language, used as a part of ewwii" description = "The rhai embedded language implementation of ewwii"
repository = "https://github.com/byson94/ewwii" repository = "https://github.com/byson94/ewwii"
homepage = "https://github.com/byson94/ewwii" homepage = "https://github.com/byson94/ewwii"

View File

@@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
iirhai.workspace = true rhai_impl.workspace = true
rhai = "1.22.2" rhai = "1.22.2"
rhai-autodocs = "0.9.0" rhai-autodocs = "0.9.0"

View File

@@ -1,4 +1,4 @@
use iirhai::providers; use rhai_impl::providers;
use rhai::{Engine, module_resolvers::StaticModuleResolver}; use rhai::{Engine, module_resolvers::StaticModuleResolver};
use rhai_autodocs::{export::options, generate::mdbook}; use rhai_autodocs::{export::options, generate::mdbook};
use std::{env, fs, path::Path}; use std::{env, fs, path::Path};