From eccc1ef80065a925b84e53061fc44ac4f300e589 Mon Sep 17 00:00:00 2001 From: sam edelsten <samedelsten1@gmail.com> Date: Mon, 29 Apr 2024 19:31:27 +0100 Subject: [PATCH] restructure utilities dogfooding showed that they're quite handy to have around --- Cargo.lock | 9 --------- Cargo.toml | 2 -- src/lib.rs | 7 ++++--- util/src/lib.rs => src/util.rs | 3 ++- util/Cargo.toml | 22 ---------------------- 5 files changed, 6 insertions(+), 37 deletions(-) rename util/src/lib.rs => src/util.rs (98%) delete mode 100644 util/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index e703564..c282a36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -417,7 +417,6 @@ dependencies = [ "js-sys", "sys-locale", "unicode-segmentation", - "util", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3182,14 +3181,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "util" -version = "0.1.0" -dependencies = [ - "bevy", - "bevy_cosmic_edit", -] - [[package]] name = "uuid" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 2c425e2..a3d0358 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,3 @@ -workspace = { members = ["util"] } [package] name = "bevy_cosmic_edit" version = "0.19.0" @@ -52,4 +51,3 @@ web-sys = { version = "0.3.67", features = [ [dev-dependencies] insta = "1.29.0" -util = { path = "./util/" } diff --git a/src/lib.rs b/src/lib.rs index f877f2a..2892bfd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,11 +2,12 @@ mod buffer; mod cursor; -pub mod focus; +mod focus; mod input; -pub mod password; -pub mod placeholder; +mod password; +mod placeholder; mod render; +pub mod util; mod widget; use std::{path::PathBuf, time::Duration}; diff --git a/util/src/lib.rs b/src/util.rs similarity index 98% rename from util/src/lib.rs rename to src/util.rs index e1e1dd1..65d687b 100644 --- a/util/src/lib.rs +++ b/src/util.rs @@ -1,6 +1,7 @@ // Common functions for examples use bevy::{prelude::*, window::PrimaryWindow}; -use bevy_cosmic_edit::{focus::FocusedWidget, *}; + +use crate::*; pub fn deselect_editor_on_esc(i: Res<ButtonInput<KeyCode>>, mut focus: ResMut<FocusedWidget>) { if i.just_pressed(KeyCode::Escape) { diff --git a/util/Cargo.toml b/util/Cargo.toml deleted file mode 100644 index 51de833..0000000 --- a/util/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "util" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -bevy = { version = "0.13", default-features = false, features = [ - "bevy_asset", - "bevy_core_pipeline", - "bevy_render", - "bevy_scene", - "bevy_sprite", - "bevy_text", - "bevy_ui", - "bevy_winit", - "png", - "x11", - "webgpu", -] } -bevy_cosmic_edit = { version = "*", path = "../" } -- GitLab