From 1cf5cdbeca842f01860e3e80ece4ebdaeafa4d67 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 6 Oct 2023 16:52:05 -0400 Subject: [PATCH] Add `ui2` crate --- Cargo.lock | 16 ++++++++++++++++ Cargo.toml | 1 + crates/storybook2/Cargo.toml | 1 + crates/ui2/Cargo.toml | 16 ++++++++++++++++ crates/ui2/src/lib.rs | 14 ++++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 crates/ui2/Cargo.toml create mode 100644 crates/ui2/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index bb49d238df..72e4557fe1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7829,6 +7829,7 @@ dependencies = [ "smallvec", "strum", "theme", + "ui2", "util", ] @@ -9051,6 +9052,21 @@ dependencies = [ "theme", ] +[[package]] +name = "ui2" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "gpui3", + "rand 0.8.5", + "serde", + "settings", + "smallvec", + "strum", + "theme", +] + [[package]] name = "unicase" version = "2.7.0" diff --git a/Cargo.toml b/Cargo.toml index 6e4cb4f12f..c4a71d5959 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,7 @@ members = [ "crates/theme", "crates/theme_selector", "crates/ui", + "crates/ui2", "crates/util", "crates/semantic_index", "crates/vim", diff --git a/crates/storybook2/Cargo.toml b/crates/storybook2/Cargo.toml index 021bf9a46a..a8f67cf6ce 100644 --- a/crates/storybook2/Cargo.toml +++ b/crates/storybook2/Cargo.toml @@ -23,6 +23,7 @@ simplelog = "0.9" smallvec.workspace = true strum = { version = "0.25.0", features = ["derive"] } theme = { path = "../theme" } +ui = { package = "ui2", path = "../ui2" } util = { path = "../util" } [dev-dependencies] diff --git a/crates/ui2/Cargo.toml b/crates/ui2/Cargo.toml new file mode 100644 index 0000000000..eaccb96e65 --- /dev/null +++ b/crates/ui2/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "ui2" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +anyhow.workspace = true +chrono = "0.4" +gpui3 = { path = "../gpui3" } +serde.workspace = true +settings = { path = "../settings" } +smallvec.workspace = true +strum = { version = "0.25.0", features = ["derive"] } +theme = { path = "../theme" } +rand = "0.8" diff --git a/crates/ui2/src/lib.rs b/crates/ui2/src/lib.rs new file mode 100644 index 0000000000..7d12d9af81 --- /dev/null +++ b/crates/ui2/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}