From d30eda33d10d50d1641776c9e7b058d65a785361 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Fri, 14 Mar 2025 23:39:31 +0200 Subject: [PATCH] tek_ -> tengri_; reset to v0.1.0; add root reexporter package --- Cargo.toml | 1 + README.md | 4 +--- edn/Cargo.lock | 18 +++++++++--------- edn/Cargo.toml | 12 ++++++------ edn/README.md | 14 +++++++------- edn/src/iter.rs | 2 +- edn/src/lib.rs | 2 +- edn/src/token.rs | 2 +- input/Cargo.lock | 2 +- input/Cargo.toml | 14 +++++++++----- input/README.md | 2 +- output/Cargo.lock | 6 +++--- output/Cargo.toml | 16 ++++++++++------ output/src/lib.rs | 4 ++++ tengri/Cargo.toml | 18 ++++++++++++++++++ tengri/README.md | 3 +++ tengri/src/lib.rs | 4 ++++ tui/Cargo.toml | 29 ++++++++++++++++------------- tui/README.md | 4 ++-- tui/examples/demo.rs.old | 15 +-------------- tui/examples/tui.rs | 4 ++-- 21 files changed, 101 insertions(+), 75 deletions(-) mode change 100644 => 120000 README.md create mode 100644 tengri/Cargo.toml create mode 100644 tengri/README.md create mode 100644 tengri/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 251c6e8..82b0888 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] resolver = "2" members = [ + "./tengri", "./input", "./output", "./tui", diff --git a/README.md b/README.md deleted file mode 100644 index 4500aef..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# tengri - -an interface metaframework. currently supports ratatui. diff --git a/README.md b/README.md new file mode 120000 index 0000000..7cad1cb --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +tengri/README.md \ No newline at end of file diff --git a/edn/Cargo.lock b/edn/Cargo.lock index 7305975..d29fc11 100644 --- a/edn/Cargo.lock +++ b/edn/Cargo.lock @@ -764,28 +764,28 @@ dependencies = [ ] [[package]] -name = "tek_edn" +name = "tengri_edn" version = "0.1.0" dependencies = [ "clojure-reader", "itertools 0.14.0", "konst", - "tek_tui", + "tengri_tui", ] [[package]] -name = "tek_input" +name = "tengri_input" version = "0.2.0" [[package]] -name = "tek_output" +name = "tengri_output" version = "0.2.0" dependencies = [ - "tek_edn", + "tengri_edn", ] [[package]] -name = "tek_tui" +name = "tengri_tui" version = "0.2.0" dependencies = [ "better-panic", @@ -793,9 +793,9 @@ dependencies = [ "palette", "rand", "ratatui", - "tek_edn", - "tek_input", - "tek_output", + "tengri_edn", + "tengri_input", + "tengri_output", ] [[package]] diff --git a/edn/Cargo.toml b/edn/Cargo.toml index 1060b98..7824723 100644 --- a/edn/Cargo.toml +++ b/edn/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "tek_edn" -edition = "2021" -version = "0.1.0" +name = "tengri_dsl" +edition = "2024" +version = "0.1.0" +description = "UI metaframework, tiny S-expression-based DSL." [dependencies] -#clojure-reader = "0.3.0" -konst = { version = "0.3.16", features = [ "rust_1_83" ] } +konst = { version = "0.3.16", features = [ "rust_1_83" ] } itertools = "0.14.0" thiserror = "2.0" @@ -13,5 +13,5 @@ thiserror = "2.0" default = [] [dev-dependencies] -tek_tui = { path = "../tui" } +tengri_tui = { path = "../tui" } proptest = "^1.6.0" diff --git a/edn/README.md b/edn/README.md index bffd5f5..97f1d2c 100644 --- a/edn/README.md +++ b/edn/README.md @@ -6,9 +6,9 @@ but without all the features. ## usage -### with `tek_output` +### with `tengri_output` -this is a `tek_output` view layout defined using ket: +this is a `tengri_output` view layout defined using ket: ```edn (bsp/s (fixed/y 2 :toolbar) @@ -16,9 +16,9 @@ this is a `tek_output` view layout defined using ket: (bsp/s :outputs (bsp/s :inputs (bsp/s :tracks :scenes))))))) ``` -### with `tek_input` +### with `tengri_input` -this is a `tek_input` keymap defined using ket: +this is a `tengri_input` keymap defined using ket: ```edn (@u undo 1) @@ -58,8 +58,8 @@ multi-part/key keys are implemented by the underlying subsystem: -* in `tek_output`, keys are names of layout primitives -* in `tek_input`, keys are names of commands +* in `tengri_output`, keys are names of layout primitives +* in `tengri_input`, keys are names of commands ### symbols @@ -72,7 +72,7 @@ or entire layout components: ``` symbols that start with `@` represent keybindings. -they are parsed in `tek_tui` and look like this: +they are parsed in `tengri_tui` and look like this: ```edn @ctrl-alt-shift-space diff --git a/edn/src/iter.rs b/edn/src/iter.rs index 02ff043..bf1b19d 100644 --- a/edn/src/iter.rs +++ b/edn/src/iter.rs @@ -5,7 +5,7 @@ //! //! ``` //! let src = include_str!("../test.edn"); -//! let mut view = tek_edn::TokenIter::new(src); +//! let mut view = tengri_edn::TokenIter::new(src); //! assert_eq!(view.0.0, src); //! assert_eq!(view.peek(), view.0.peek()) //! ``` diff --git a/edn/src/lib.rs b/edn/src/lib.rs index 8315cb1..eae465f 100644 --- a/edn/src/lib.rs +++ b/edn/src/lib.rs @@ -54,7 +54,7 @@ pub(crate) use std::fmt::Debug; ////] { //////let items = Atom::read_all(example)?; //////panic!("{layout:?}"); - //////let content = >::from(&layout); + //////let content = >::from(&layout); ////} //Ok(()) //} diff --git a/edn/src/token.rs b/edn/src/token.rs index 6a5b3e6..6ef6d55 100644 --- a/edn/src/token.rs +++ b/edn/src/token.rs @@ -10,7 +10,7 @@ //! with slightly different parsing rules. //! * [Value::Num] is an unsigned integer literal. //!``` -//! use tek_edn::{*, Value::*}; +//! use tengri_edn::{*, Value::*}; //! let source = include_str!("../test.edn"); //! let mut view = TokenIter::new(source); //! assert_eq!(view.peek(), Some(Token { diff --git a/input/Cargo.lock b/input/Cargo.lock index f9911b0..7747441 100644 --- a/input/Cargo.lock +++ b/input/Cargo.lock @@ -3,5 +3,5 @@ version = 4 [[package]] -name = "tek_engine" +name = "tengri_engine" version = "0.2.0" diff --git a/input/Cargo.toml b/input/Cargo.toml index 8022543..4e65716 100644 --- a/input/Cargo.toml +++ b/input/Cargo.toml @@ -1,10 +1,14 @@ [package] -name = "tek_input" -edition = "2021" -version = "0.2.0" +name = "tengri_input" +edition = "2024" +version = "0.1.0" +description = "UI metaframework, input layer." [dependencies] -tek_edn = { path = "../edn" } +tengri_edn = { optional = true, path = "../edn" } + +[features] +edn = [ "tengri_edn" ] [dev-dependencies] -tek_tui = { path = "../tui" } +tengri_tui = { path = "../tui" } diff --git a/input/README.md b/input/README.md index 6187e5a..4261a22 100644 --- a/input/README.md +++ b/input/README.md @@ -1,4 +1,4 @@ -# `tek_engine` +# `tengri_engine` ## rendering diff --git a/output/Cargo.lock b/output/Cargo.lock index b6f132d..8b1fd6a 100644 --- a/output/Cargo.lock +++ b/output/Cargo.lock @@ -3,12 +3,12 @@ version = 4 [[package]] -name = "tek_engine" +name = "tengri_engine" version = "0.2.0" [[package]] -name = "tek_layout" +name = "tengri_layout" version = "0.2.0" dependencies = [ - "tek_engine", + "tengri_engine", ] diff --git a/output/Cargo.toml b/output/Cargo.toml index 3a708ad..8cb2ebc 100644 --- a/output/Cargo.toml +++ b/output/Cargo.toml @@ -1,12 +1,16 @@ [package] -name = "tek_output" -edition = "2021" -version = "0.2.0" +name = "tengri_output" +edition = "2024" +version = "0.1.0" +description = "UI metaframework, output layer." [dependencies] -tek_edn = { path = "../edn" } +tengri_edn = { optional = true, path = "../edn" } + +[features] +edn = [ "tengri_edn" ] [dev-dependencies] -tek_tui = { path = "../tui" } -proptest = "^1" +tengri_tui = { path = "../tui" } +proptest = "^1" proptest-derive = "^0.5.1" diff --git a/output/src/lib.rs b/output/src/lib.rs index f6353d1..0ff7a8f 100644 --- a/output/src/lib.rs +++ b/output/src/lib.rs @@ -15,6 +15,7 @@ mod op_align; pub use self::op_align::*; mod op_bsp; pub use self::op_bsp::*; mod op_transform; pub use self::op_transform::*; mod view; pub use self::view::*; + pub(crate) use std::marker::PhantomData; pub(crate) use std::error::Error; pub(crate) use ::tek_edn::*; @@ -22,6 +23,7 @@ pub(crate) use ::tek_edn::*; pub type Usually = Result>; /// Standard optional result type. pub type Perhaps = Result, Box>; + #[cfg(test)] #[test] fn test_stub_output () -> Usually<()> { use crate::*; struct TestOutput([u16;4]); @@ -46,10 +48,12 @@ pub type Perhaps = Result, Box>; } Ok(()) } + #[cfg(test)] #[test] fn test_dimensions () { use crate::*; assert_eq!(Area::center(&[10u16, 10, 20, 20]), [20, 20]); } + #[cfg(test)] #[test] fn test_layout () -> Usually<()> { Ok(()) } diff --git a/tengri/Cargo.toml b/tengri/Cargo.toml new file mode 100644 index 0000000..818da4e --- /dev/null +++ b/tengri/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "tengri" +edition = "2024" +version = "0.1.0" +description = "UI metaframework." + +[dependencies] +tengri_edn = { optional = true, path = "../edn" } +tengri_input = { optional = true, path = "../input" } +tengri_output = { optional = true, path = "../output" } +tengri_tui = { optional = true, path = "../tui" } + +[features] +default = [ "input", "output", "tui" ] +input = [ "tengri_input" ] +output = [ "tengri_output" ] +tui = [ "tengri_tui" ] +edn = [ "tengri_edn", "tengri_input/edn", "tengri_output/edn", "tengri_tui/edn" ] diff --git a/tengri/README.md b/tengri/README.md new file mode 100644 index 0000000..4500aef --- /dev/null +++ b/tengri/README.md @@ -0,0 +1,3 @@ +# tengri + +an interface metaframework. currently supports ratatui. diff --git a/tengri/src/lib.rs b/tengri/src/lib.rs new file mode 100644 index 0000000..39979e5 --- /dev/null +++ b/tengri/src/lib.rs @@ -0,0 +1,4 @@ +#[cfg(feature="output")] pub use ::tengri_output as output; +#[cfg(feature="input")] pub use ::tengri_input as input; +#[cfg(feature="edn")] pub use ::tengri_edn as edn; +#[cfg(feature="tui")] pub use ::tengri_tui as tui; diff --git a/tui/Cargo.toml b/tui/Cargo.toml index 14e754b..b9adc29 100644 --- a/tui/Cargo.toml +++ b/tui/Cargo.toml @@ -1,19 +1,22 @@ [package] -name = "tek_tui" -edition = "2021" -version = "0.2.0" +name = "tengri_tui" +edition = "2021" +version = "0.1.0" +description = "UI metaframework, Ratatui backend." [dependencies] -palette = { version = "0.7.6", features = [ "random" ] } -rand = "0.8.5" -crossterm = "0.28.1" -ratatui = { version = "0.29.0", features = [ "unstable-widget-ref", "underline-color" ] } +palette = { version = "0.7.6", features = [ "random" ] } +rand = "0.8.5" +crossterm = "0.28.1" +ratatui = { version = "0.29.0", features = [ "unstable-widget-ref", "underline-color" ] } better-panic = "0.3.0" -konst = { version = "0.3.16", features = [ "rust_1_83" ] } +konst = { version = "0.3.16", features = [ "rust_1_83" ] } atomic_float = "1" -quanta = "0.12.3" +quanta = "0.12.3" -tek_edn = { path = "../edn" } -tek_input = { path = "../input" } -tek_output = { path = "../output" } -#tek_time = { path = "../time" } +tengri_input = { path = "../input" } +tengri_output = { path = "../output" } +tengri_edn = { optional = true, path = "../edn" } + +[features] +edn = [ "tengri_edn", "tengri_input/edn", "tengri_output/edn" ] diff --git a/tui/README.md b/tui/README.md index 36606d5..d8c2f29 100644 --- a/tui/README.md +++ b/tui/README.md @@ -1,7 +1,7 @@ -# `tek_tui` +# `tengri_tui` the `Tui` struct (the *engine*) implements the -`tek_input::Input` and `tek_output::Output` traits. +`tengri_input::Input` and `tengri_output::Output` traits. at launch, the `Tui` engine spawns two threads, a **render thread** and an **input thread**. (the diff --git a/tui/examples/demo.rs.old b/tui/examples/demo.rs.old index a68d26d..ba013de 100644 --- a/tui/examples/demo.rs.old +++ b/tui/examples/demo.rs.old @@ -14,20 +14,7 @@ impl Demo { fn new () -> Self { Self { index: 0, - items: vec![ - //Box::new(tek_sequencer::TransportPlayPauseButton { - //_engine: Default::default(), - //transport: None, - //value: Some(TransportState::Stopped), - //focused: true - //}), - //Box::new(tek_sequencer::TransportPlayPauseButton { - //_engine: Default::default(), - //transport: None, - //value: Some(TransportState::Rolling), - //focused: false - //}), - ] + items: vec![] } } } diff --git a/tui/examples/tui.rs b/tui/examples/tui.rs index 37fd116..8eb5ba7 100644 --- a/tui/examples/tui.rs +++ b/tui/examples/tui.rs @@ -1,5 +1,5 @@ -use tek_tui::{*, tek_input::*, tek_output::*}; -use tek_edn::*; +use tengri_tui::{*, tengri_input::*, tengri_output::*}; +use tengri_edn::*; use std::sync::{Arc, RwLock}; use crossterm::event::{*, KeyCode::*}; use crate::ratatui::style::Color;