From b28990e53f0f51173126be7600899368458cac1d Mon Sep 17 00:00:00 2001 From: Shane Celis Date: Mon, 24 Feb 2025 17:30:53 -0500 Subject: [PATCH 1/5] feat: Allow trailing comma in callback_labels. (#325) --- crates/bevy_mod_scripting_core/src/event.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_mod_scripting_core/src/event.rs b/crates/bevy_mod_scripting_core/src/event.rs index 5b29554e..4e74ed7b 100644 --- a/crates/bevy_mod_scripting_core/src/event.rs +++ b/crates/bevy_mod_scripting_core/src/event.rs @@ -57,7 +57,7 @@ impl CallbackLabel { #[macro_export] /// Creates a set of callback labels macro_rules! callback_labels { - ($($name:ident => $label:expr),*) => { + ($($name:ident => $label:expr),* $(,)?) => { $( #[doc = "A callback label for the event: "] @@ -74,7 +74,7 @@ macro_rules! callback_labels { callback_labels!( OnScriptLoaded => "on_script_loaded", - OnScriptUnloaded => "on_script_unloaded" + OnScriptUnloaded => "on_script_unloaded", ); /// A trait for types that can be converted into a callback label From eb9b36c7b650f50083fda6576f0e52db014c0cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Le=C3=B3n?= <51842726+Joakker@users.noreply.github.com> Date: Tue, 25 Feb 2025 16:23:04 -0300 Subject: [PATCH 2/5] fix: Generate IntoScript implementation with the correct path (#326) --- crates/bevy_mod_scripting_derive/src/derive/into_script.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_mod_scripting_derive/src/derive/into_script.rs b/crates/bevy_mod_scripting_derive/src/derive/into_script.rs index d67d3ab2..8135ca44 100644 --- a/crates/bevy_mod_scripting_derive/src/derive/into_script.rs +++ b/crates/bevy_mod_scripting_derive/src/derive/into_script.rs @@ -13,7 +13,7 @@ pub fn into_script(input: TokenStream) -> TokenStream { let (impl_generics, type_generics, where_clause) = generics.split_for_impl(); quote! { - impl #impl_generics ::bevy_mod_scripting::bindings::function::into::IntoScript for #ident #type_generics #where_clause { + impl #impl_generics ::bevy_mod_scripting::core::bindings::function::into::IntoScript for #ident #type_generics #where_clause { fn into_script(self, world: ::bevy_mod_scripting::core::bindings::WorldGuard) -> Result<::bevy_mod_scripting::core::bindings::script_value::ScriptValue, ::bevy_mod_scripting::core::error::InteropError> { ::bevy_mod_scripting::core::bindings::function::into::IntoScript::into_script( ::bevy_mod_scripting::core::bindings::function::from::Val(self), From e9e6c3a9712636a0249d377bd1c2b2de7b9d9021 Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Tue, 25 Feb 2025 23:01:55 +0000 Subject: [PATCH 3/5] fix: `enable_context_sharing` not returning the plugin like a real builder --- crates/bevy_mod_scripting_core/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/bevy_mod_scripting_core/src/lib.rs b/crates/bevy_mod_scripting_core/src/lib.rs index fc7a054b..1bc0214f 100644 --- a/crates/bevy_mod_scripting_core/src/lib.rs +++ b/crates/bevy_mod_scripting_core/src/lib.rs @@ -183,8 +183,8 @@ pub trait ConfigureScriptPlugin { /// Switch the context assigning strategy to a global context assigner. /// /// This means that all scripts will share the same context. This is useful for when you want to share data between scripts easilly. - /// Be careful however as this also means that scripts can interfere with each other in unexpected ways!. - fn enable_context_sharing(self); + /// Be careful however as this also means that scripts can interfere with each other in unexpected ways! Including overwriting each other's handlers. + fn enable_context_sharing(self) -> Self; } impl>> ConfigureScriptPlugin for P { @@ -209,8 +209,9 @@ impl>> ConfigureScriptPlugi self } - fn enable_context_sharing(mut self) { + fn enable_context_sharing(mut self) -> Self{ self.as_mut().context_assigner = ContextAssigner::new_global_context_assigner(); + self } } From d933d3e43607d69b4261278e70c772641ffda5ed Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Tue, 25 Feb 2025 23:16:58 +0000 Subject: [PATCH 4/5] chore: formatting --- crates/bevy_mod_scripting_core/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_mod_scripting_core/src/lib.rs b/crates/bevy_mod_scripting_core/src/lib.rs index 1bc0214f..2f556b19 100644 --- a/crates/bevy_mod_scripting_core/src/lib.rs +++ b/crates/bevy_mod_scripting_core/src/lib.rs @@ -209,7 +209,7 @@ impl>> ConfigureScriptPlugi self } - fn enable_context_sharing(mut self) -> Self{ + fn enable_context_sharing(mut self) -> Self { self.as_mut().context_assigner = ContextAssigner::new_global_context_assigner(); self } From 4af18c02ea1526a3ddb52b1329588b8ee0fb2d1e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 00:08:16 +0000 Subject: [PATCH 5/5] chore: release (#323) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ Cargo.toml | 14 +++++++------- crates/bevy_mod_scripting_core/CHANGELOG.md | 10 ++++++++++ crates/bevy_mod_scripting_core/Cargo.toml | 2 +- crates/bevy_mod_scripting_derive/CHANGELOG.md | 6 ++++++ crates/bevy_mod_scripting_derive/Cargo.toml | 2 +- crates/bevy_mod_scripting_functions/Cargo.toml | 2 +- .../mdbook_lad_preprocessor/CHANGELOG.md | 6 ++++++ .../mdbook_lad_preprocessor/Cargo.toml | 4 ++-- crates/ladfile/CHANGELOG.md | 6 ++++++ crates/ladfile/Cargo.toml | 2 +- crates/ladfile_builder/Cargo.toml | 4 ++-- crates/languages/bevy_mod_scripting_lua/Cargo.toml | 2 +- .../languages/bevy_mod_scripting_rhai/Cargo.toml | 2 +- 14 files changed, 55 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5daa74d..b96c0431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [0.9.8](https://github.com/makspll/bevy_mod_scripting/compare/v0.9.7...v0.9.8) - 2025-02-25 + +### Added + +- Allow trailing comma in callback_labels. (#325) + +### Fixed + +- `enable_context_sharing` not returning the plugin like a real builder + ## [0.9.7](https://github.com/makspll/bevy_mod_scripting/compare/v0.9.6...v0.9.7) - 2025-02-23 ### Added diff --git a/Cargo.toml b/Cargo.toml index bbf76f74..4b5f2cfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting" -version = "0.9.7" +version = "0.9.8" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -53,8 +53,8 @@ rhai = ["bevy_mod_scripting_rhai"] [dependencies] bevy = { workspace = true } bevy_mod_scripting_core = { workspace = true } -bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.9.7", optional = true } -bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.9.7", optional = true } +bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.9.8", optional = true } +bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.9.8", optional = true } # bevy_mod_scripting_rune = { path = "crates/languages/bevy_mod_scripting_rune", version = "0.9.0-alpha.2", optional = true } bevy_mod_scripting_functions = { workspace = true } bevy_mod_scripting_derive = { workspace = true } @@ -62,9 +62,9 @@ bevy_mod_scripting_derive = { workspace = true } [workspace.dependencies] profiling = { version = "1.0" } bevy = { version = "0.15.2", default-features = false } -bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.9.7" } -bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.9.7", default-features = false } -bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.9.7" } +bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.9.8" } +bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.9.8", default-features = false } +bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.9.8" } # test utilities script_integration_test_harness = { path = "crates/testing_crates/script_integration_test_harness" } @@ -77,7 +77,7 @@ rand = "0.8.5" bevy_console = "0.13" # rhai-rand = "0.1" ansi-parser = "0.9" -ladfile_builder = { path = "crates/ladfile_builder", version = "0.2.1" } +ladfile_builder = { path = "crates/ladfile_builder", version = "0.2.2" } [workspace] members = [ diff --git a/crates/bevy_mod_scripting_core/CHANGELOG.md b/crates/bevy_mod_scripting_core/CHANGELOG.md index e07c794c..ca0df3c2 100644 --- a/crates/bevy_mod_scripting_core/CHANGELOG.md +++ b/crates/bevy_mod_scripting_core/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.8](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_core-v0.9.7...bevy_mod_scripting_core-v0.9.8) - 2025-02-25 + +### Added + +- Allow trailing comma in callback_labels. (#325) + +### Fixed + +- `enable_context_sharing` not returning the plugin like a real builder + ## [0.9.7](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_core-v0.9.6...bevy_mod_scripting_core-v0.9.7) - 2025-02-23 ### Added diff --git a/crates/bevy_mod_scripting_core/Cargo.toml b/crates/bevy_mod_scripting_core/Cargo.toml index 20cc5bed..92883c9f 100644 --- a/crates/bevy_mod_scripting_core/Cargo.toml +++ b/crates/bevy_mod_scripting_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_core" -version = "0.9.7" +version = "0.9.8" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/crates/bevy_mod_scripting_derive/CHANGELOG.md b/crates/bevy_mod_scripting_derive/CHANGELOG.md index 95f23072..4ea8a922 100644 --- a/crates/bevy_mod_scripting_derive/CHANGELOG.md +++ b/crates/bevy_mod_scripting_derive/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.8](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_derive-v0.9.7...bevy_mod_scripting_derive-v0.9.8) - 2025-02-25 + +### Fixed + +- Generate IntoScript implementation with the correct path (#326) + ## [0.9.7](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_derive-v0.9.6...bevy_mod_scripting_derive-v0.9.7) - 2025-02-23 ### Added diff --git a/crates/bevy_mod_scripting_derive/Cargo.toml b/crates/bevy_mod_scripting_derive/Cargo.toml index deea5f53..c9b464b7 100644 --- a/crates/bevy_mod_scripting_derive/Cargo.toml +++ b/crates/bevy_mod_scripting_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_derive" -version = "0.9.7" +version = "0.9.8" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" diff --git a/crates/bevy_mod_scripting_functions/Cargo.toml b/crates/bevy_mod_scripting_functions/Cargo.toml index 0f9f47b2..a155a385 100644 --- a/crates/bevy_mod_scripting_functions/Cargo.toml +++ b/crates/bevy_mod_scripting_functions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_functions" -version = "0.9.7" +version = "0.9.8" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" diff --git a/crates/lad_backends/mdbook_lad_preprocessor/CHANGELOG.md b/crates/lad_backends/mdbook_lad_preprocessor/CHANGELOG.md index 22cce8ac..47ef36c2 100644 --- a/crates/lad_backends/mdbook_lad_preprocessor/CHANGELOG.md +++ b/crates/lad_backends/mdbook_lad_preprocessor/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.2](https://github.com/makspll/bevy_mod_scripting/compare/mdbook_lad_preprocessor-v0.1.1...mdbook_lad_preprocessor-v0.1.2) - 2025-02-25 + +### Added + +- *(mdbook)* improve mdbook generics behaviour and fix broken links (#319) + ## [0.1.1](https://github.com/makspll/bevy_mod_scripting/compare/mdbook_lad_preprocessor-v0.1.0...mdbook_lad_preprocessor-v0.1.1) - 2025-02-23 ### Added diff --git a/crates/lad_backends/mdbook_lad_preprocessor/Cargo.toml b/crates/lad_backends/mdbook_lad_preprocessor/Cargo.toml index 4ef92790..28b9904d 100644 --- a/crates/lad_backends/mdbook_lad_preprocessor/Cargo.toml +++ b/crates/lad_backends/mdbook_lad_preprocessor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mdbook_lad_preprocessor" -version = "0.1.1" +version = "0.1.2" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" @@ -15,7 +15,7 @@ readme = "readme.md" [dependencies] clap = "4" mdbook = "0.4" -ladfile = { path = "../../ladfile", version = "0.3.0" } +ladfile = { path = "../../ladfile", version = "0.3.1" } env_logger = "0.11" log = "0.4" serde_json = "1.0" diff --git a/crates/ladfile/CHANGELOG.md b/crates/ladfile/CHANGELOG.md index 67a3cff8..c46f05d8 100644 --- a/crates/ladfile/CHANGELOG.md +++ b/crates/ladfile/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.1](https://github.com/makspll/bevy_mod_scripting/compare/v0.3.0-ladfile...v0.3.1-ladfile) - 2025-02-25 + +### Added + +- *(mdbook)* improve mdbook generics behaviour and fix broken links (#319) + ## [0.3.0](https://github.com/makspll/bevy_mod_scripting/compare/v0.2.0-ladfile...v0.3.0-ladfile) - 2025-02-23 ### Added diff --git a/crates/ladfile/Cargo.toml b/crates/ladfile/Cargo.toml index 8292964f..72e56d5f 100644 --- a/crates/ladfile/Cargo.toml +++ b/crates/ladfile/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ladfile" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" diff --git a/crates/ladfile_builder/Cargo.toml b/crates/ladfile_builder/Cargo.toml index 5c0ddf71..3c4971d5 100644 --- a/crates/ladfile_builder/Cargo.toml +++ b/crates/ladfile_builder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ladfile_builder" -version = "0.2.1" +version = "0.2.2" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" @@ -17,7 +17,7 @@ bevy_mod_scripting_core = { workspace = true } # I don't think bevy has a top level feature for this :C bevy = { workspace = true } bevy_reflect = { version = "0.15.2", features = ["documentation"] } -ladfile = { version = "0.3.0", path = "../ladfile" } +ladfile = { version = "0.3.1", path = "../ladfile" } regex = "1.11" [dev-dependencies] diff --git a/crates/languages/bevy_mod_scripting_lua/Cargo.toml b/crates/languages/bevy_mod_scripting_lua/Cargo.toml index 698306e4..74245453 100644 --- a/crates/languages/bevy_mod_scripting_lua/Cargo.toml +++ b/crates/languages/bevy_mod_scripting_lua/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_lua" -version = "0.9.7" +version = "0.9.8" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/crates/languages/bevy_mod_scripting_rhai/Cargo.toml b/crates/languages/bevy_mod_scripting_rhai/Cargo.toml index 7adc77f6..61a0340e 100644 --- a/crates/languages/bevy_mod_scripting_rhai/Cargo.toml +++ b/crates/languages/bevy_mod_scripting_rhai/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting_rhai" -version = "0.9.7" +version = "0.9.8" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0"