From c33fd8a15f2d3508971e4654849e55cd8b68d32c Mon Sep 17 00:00:00 2001 From: "Bruce Reif (Buswolley)" Date: Sat, 12 Mar 2022 11:24:26 -0800 Subject: [PATCH 1/3] export some types directly --- Cargo.toml | 2 +- src/data.rs | 2 +- src/lib.rs | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6e427f8..cf05bfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_proto" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = ["Gino Valente "] description = "Create config files for entities in Bevy" diff --git a/src/data.rs b/src/data.rs index 3368e56..76f3acb 100644 --- a/src/data.rs +++ b/src/data.rs @@ -13,7 +13,7 @@ use dyn_clone::DynClone; use indexmap::IndexSet; use serde::{Deserialize, Serialize}; -use crate::prelude::DefaultProtoDeserializer; +use crate::plugin::DefaultProtoDeserializer; use crate::{components::ProtoComponent, prototype::Prototypical, utils::handle_cycle}; /// A String newtype for a handle's asset path diff --git a/src/lib.rs b/src/lib.rs index 2aa7964..71c842e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,19 +74,23 @@ //! extern crate bevy_proto_derive; -pub mod components; +mod components; +pub use components::ProtoComponent; +mod plugin; +pub use plugin::ProtoPlugin; +mod prototype; +pub use prototype::{deserialize_templates_list, Prototype, Prototypical}; + pub mod data; -pub mod plugin; -pub mod prototype; #[macro_use] mod utils; pub mod prelude { //! Includes all public types and the macro to derive [`ProtoComponent`](super::components::ProtoComponent). - pub use super::components::*; + pub use super::components::ProtoComponent; pub use super::data::*; - pub use super::plugin::*; + pub use super::plugin::ProtoPlugin; pub use super::prototype::{Prototype, Prototypical}; pub use bevy_proto_derive::*; } From 055b61bd145a295802427860903b7d0f88c0f9eb Mon Sep 17 00:00:00 2001 From: "Bruce Reif (Buswolley)" Date: Sat, 12 Mar 2022 11:32:16 -0800 Subject: [PATCH 2/3] update docs --- README.md | 2 +- src/data.rs | 2 +- src/plugin.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 65f5bb7..cb6420d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Then add it to your app like so: ```rust use bevy::prelude::*; -use bevy_proto::plugin::ProtoPlugin; +use bevy_proto::ProtoPlugin; fn main() { App::new() diff --git a/src/data.rs b/src/data.rs index 76f3acb..392cbf5 100644 --- a/src/data.rs +++ b/src/data.rs @@ -440,7 +440,7 @@ pub trait ProtoDeserializer: DynClone { /// /// ``` /// // The default implementation: - /// use bevy_proto::prototype::{Prototype, Prototypical}; + /// use bevy_proto::{Prototype, Prototypical}; /// fn example_deserialize(data: &str) -> Option> { /// if let Ok(value) = serde_yaml::from_str::(data) { /// Some(Box::new(value)) diff --git a/src/plugin.rs b/src/plugin.rs index 29325db..2b876d1 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -24,7 +24,7 @@ impl ProtoPlugin { /// # Examples /// /// ``` - /// use bevy_proto::plugin::ProtoPlugin; + /// use bevy_proto::ProtoPlugin; /// /// let plugin = ProtoPlugin::with_dir("assets/config"); /// ``` @@ -49,7 +49,7 @@ impl ProtoPlugin { /// # Examples /// /// ``` - /// use bevy_proto::plugin::ProtoPlugin; + /// use bevy_proto::ProtoPlugin; /// /// let plugin = ProtoPlugin::with_dir_recursive("assets/config"); /// ``` @@ -73,7 +73,7 @@ impl ProtoPlugin { /// # Examples /// /// ``` - /// use bevy_proto::plugin::ProtoPlugin; + /// use bevy_proto::ProtoPlugin; /// /// let plugin = ProtoPlugin::with_dirs(vec![ /// String::from("assets/config"), @@ -100,7 +100,7 @@ impl ProtoPlugin { /// # Examples /// /// ``` - /// use bevy_proto::plugin::ProtoPlugin; + /// use bevy_proto::ProtoPlugin; /// /// let plugin = ProtoPlugin::with_dirs(vec![ /// String::from("assets/config"), From 27f9918d7ab0d88ac2724ef9199132b060c8e681 Mon Sep 17 00:00:00 2001 From: "Bruce Reif (Buswolley)" Date: Sat, 12 Mar 2022 15:34:35 -0800 Subject: [PATCH 3/3] tweak visibilities --- Cargo.toml | 2 +- src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cf05bfc..6e427f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_proto" -version = "0.3.1" +version = "0.3.0" edition = "2021" authors = ["Gino Valente "] description = "Create config files for entities in Bevy" diff --git a/src/lib.rs b/src/lib.rs index 71c842e..59adac6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,6 +75,7 @@ extern crate bevy_proto_derive; mod components; +pub use bevy_proto_derive::ProtoComponent; pub use components::ProtoComponent; mod plugin; pub use plugin::ProtoPlugin;