From bb376114bf9892f2143d1f0d6236c10189debc1c Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 1 Feb 2025 15:37:35 +0000 Subject: [PATCH 01/10] chore: bump from prerelease --- Cargo.toml | 10 +++++----- crates/bevy_mod_scripting_core/Cargo.toml | 4 ++-- crates/bevy_mod_scripting_functions/Cargo.toml | 4 ++-- crates/languages/bevy_mod_scripting_lua/Cargo.toml | 4 ++-- crates/languages/bevy_mod_scripting_rhai/Cargo.toml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f272838a65..de60cdc281 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_mod_scripting" -version = "0.9.0-alpha.9" +version = "0.9.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -53,15 +53,15 @@ 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.0-alpha.9", optional = true } -bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.9.0-alpha.9", optional = true } +bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.9.0", optional = true } +bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.9.0", 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 } [workspace.dependencies] profiling = { version = "1.0" } bevy = { version = "0.15.0", default-features = false } -bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.9.0-alpha.9" } -bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.9.0-alpha.9", default-features = false } +bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.9.0" } +bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.9.0", default-features = false } # test utilities script_integration_test_harness = { path = "crates/script_integration_test_harness" } diff --git a/crates/bevy_mod_scripting_core/Cargo.toml b/crates/bevy_mod_scripting_core/Cargo.toml index b1d12a0f45..e677a742eb 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.0-alpha.9" +version = "0.9.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -40,7 +40,7 @@ dashmap = "6" smallvec = "1.11" itertools = "0.13" derivative = "2.2" -profiling = {workspace = true} +profiling = { workspace = true } [dev-dependencies] test_utils = { workspace = true } diff --git a/crates/bevy_mod_scripting_functions/Cargo.toml b/crates/bevy_mod_scripting_functions/Cargo.toml index 75d65c7d8f..bbaf1446ae 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.0-alpha.9" +version = "0.9.0" edition = "2021" authors = ["Maksymilian Mozolewski "] license = "MIT OR Apache-2.0" @@ -30,7 +30,7 @@ bevy = { workspace = true, features = [ "file_watcher", "multi_threaded", ] } -profiling = {workspace = true} +profiling = { workspace = true } uuid = "1.11" smol_str = "0.2.2" bevy_mod_scripting_core = { workspace = true } diff --git a/crates/languages/bevy_mod_scripting_lua/Cargo.toml b/crates/languages/bevy_mod_scripting_lua/Cargo.toml index a7ebc3ac63..feac6b0d4d 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.0-alpha.9" +version = "0.9.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" @@ -45,7 +45,7 @@ parking_lot = "0.12.1" uuid = "1.1" smol_str = "0.2.2" smallvec = "1.13" -profiling = {workspace = true} +profiling = { workspace = true } [dev-dependencies] script_integration_test_harness = { workspace = true } diff --git a/crates/languages/bevy_mod_scripting_rhai/Cargo.toml b/crates/languages/bevy_mod_scripting_rhai/Cargo.toml index d307642255..5b9af84fb9 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.0-alpha.9" +version = "0.9.0" authors = ["Maksymilian Mozolewski "] edition = "2021" license = "MIT OR Apache-2.0" From 7465e97d645aff34a92a7b058617fb9d507ff211 Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Sat, 1 Feb 2025 15:54:47 +0000 Subject: [PATCH 02/10] Add release notes draft --- release-notes/0.9.0.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 release-notes/0.9.0.md diff --git a/release-notes/0.9.0.md b/release-notes/0.9.0.md new file mode 100644 index 0000000000..3c4a346dbf --- /dev/null +++ b/release-notes/0.9.0.md @@ -0,0 +1,22 @@ +# [`bevy_mod_scripting`](https://github.com/makspll/bevy_mod_scripting/) 0.9.0 is out! + +## Summary +- The entire crate was completely re-written +- We cut down the number of crates, moving most common functionality into the core crate and removing all the horrible macros +- All of the systems have been made more robust and testable +- The crate is now completely panic free! +- The script lifecycle is automatically tied to script assets, loading and unloading assets and placing `ScriptComponent`'s on entities is all you need to do to manage the complexities of creating, updating, deleting and hot-loading script state. +- A new `ScriptValue` abstraction allows us to centrally define and register dynamic script functions which automatically register their type dependencies with the `AppTypeRegistry` +- New language implementations do not need to re-implement all of the bevy bindings, they simply need to provide a dynamic calling mechanism, and dispatch operators to the right functions +- Bevy bindings generation is completely decoupled from `mlua`, in fact the BMS crate gets injected into the process of compiling `bevy` and in doing so we can look for types which implement `IntoScript` and `FromScript`, allowing us to react to changes in those trait implementations in picking which functions to generate registrations for. +- We now publish a brand new [book](https://makspll.github.io/bevy_mod_scripting/), which should help onboard new consumers and make the crate much easier to use! +- The entire dev experience has been transformed thanks to the `xtask` pattern, contributing to `BMS` has never been easier! + +## Removed +- We removed `tealr` and the `teal` integration, meaning interacting with Lua is much simpler. + +## On pause +- We put documentation generation features as well as `rune` support on pause, to accelerate going forward. But there is nothing stopping us from re-implementing those features, and in fact generating documentation will be infinitely easier given we have trait level access to all dynamic functions! + +## Migration Guide +I am not publishing a migration guide, simply because the easiest way to migrate to 0.9.0 is to start from scratch! EVERYTHING is different, and hence I'd reccomend walking through the docs, and re-implenenting the crate. From 9f71fb619901273f543a102182b153210a70ebe4 Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Sat, 1 Feb 2025 15:58:37 +0000 Subject: [PATCH 03/10] add changelog link --- release-notes/0.9.0.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release-notes/0.9.0.md b/release-notes/0.9.0.md index 3c4a346dbf..ac1df82a66 100644 --- a/release-notes/0.9.0.md +++ b/release-notes/0.9.0.md @@ -20,3 +20,6 @@ ## Migration Guide I am not publishing a migration guide, simply because the easiest way to migrate to 0.9.0 is to start from scratch! EVERYTHING is different, and hence I'd reccomend walking through the docs, and re-implenenting the crate. + +## Changelog +See a detailed changelog [here](https://github.com/makspll/bevy_mod_scripting/blob/main/CHANGELOG.md) From 720c30b8a635c716b82fa737a9add147a5f15c5c Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Sat, 1 Feb 2025 16:00:24 +0000 Subject: [PATCH 04/10] add image --- release-notes/0.9.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release-notes/0.9.0.md b/release-notes/0.9.0.md index ac1df82a66..9f85705b5e 100644 --- a/release-notes/0.9.0.md +++ b/release-notes/0.9.0.md @@ -1,5 +1,7 @@ # [`bevy_mod_scripting`](https://github.com/makspll/bevy_mod_scripting/) 0.9.0 is out! +![image](https://github.com/user-attachments/assets/6ae0f927-ea1b-4d90-a809-4cc513e49b18) + ## Summary - The entire crate was completely re-written - We cut down the number of crates, moving most common functionality into the core crate and removing all the horrible macros From 61248c6e0d2800451b541c624aa69e8ffa286cdd Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Sat, 1 Feb 2025 16:02:23 +0000 Subject: [PATCH 05/10] Update 0.9.0.md --- release-notes/0.9.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release-notes/0.9.0.md b/release-notes/0.9.0.md index 9f85705b5e..7c65019d2c 100644 --- a/release-notes/0.9.0.md +++ b/release-notes/0.9.0.md @@ -11,6 +11,7 @@ - A new `ScriptValue` abstraction allows us to centrally define and register dynamic script functions which automatically register their type dependencies with the `AppTypeRegistry` - New language implementations do not need to re-implement all of the bevy bindings, they simply need to provide a dynamic calling mechanism, and dispatch operators to the right functions - Bevy bindings generation is completely decoupled from `mlua`, in fact the BMS crate gets injected into the process of compiling `bevy` and in doing so we can look for types which implement `IntoScript` and `FromScript`, allowing us to react to changes in those trait implementations in picking which functions to generate registrations for. +- The `APIProvider` traits as well as the `API` terminology were gotten rid of in favour of configuration resources with stored function pointers, as well as more specific `bindings` terminology - We now publish a brand new [book](https://makspll.github.io/bevy_mod_scripting/), which should help onboard new consumers and make the crate much easier to use! - The entire dev experience has been transformed thanks to the `xtask` pattern, contributing to `BMS` has never been easier! From 24b7fd9dd9d45b9d49f09ef09658370e7f66dc1e Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 1 Feb 2025 16:33:16 +0000 Subject: [PATCH 06/10] fix coverage badge workflow --- .github/workflows/bevy_mod_scripting.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index f4f74b82d4..0cb03bfc10 100644 --- a/.github/workflows/bevy_mod_scripting.yml +++ b/.github/workflows/bevy_mod_scripting.yml @@ -52,6 +52,7 @@ jobs: permissions: pull-requests: write contents: write + issues: write name: Check - ${{ matrix.run_args.name }} runs-on: ${{ matrix.run_args.os }} # container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest @@ -94,7 +95,9 @@ jobs: - name: Update coverage badge if: ${{ matrix.run_args.generates_coverage && github.ref == 'refs/heads/main' }} + continue-on-error: true run: | + git checkout -b chore/_update-coverage-badge || git checkout chore/_update-coverage-badge cp target/coverage/html/badges/for_the_badge.svg badges/coverage.svg git config user.name "github-actions[bot]" @@ -104,6 +107,10 @@ jobs: if [[ -n $(git status -s) ]]; then git commit -m "chore(badge): Update coverage badge" -m "[skip ci]" git push + gh pr create --title "chore: Update coverage badge" --body "Updates coverage badge based on test results" --base main --head chore/_update-coverage-badge > pr.txt + sed -n 's/.*pull\/\([0-9]*\).*/\1/p' pr.txt > pr_number.txt + PRNUMBER=$(cat pr_number.txt) + gh pr merge $PRNUMBER --squash fi generate_bindings: name: Bindings - Synchronise From 5449ddab546789916fd720c304356ee87ab89a08 Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 1 Feb 2025 16:34:25 +0000 Subject: [PATCH 07/10] make this work on branches --- .github/workflows/bevy_mod_scripting.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index 0cb03bfc10..76df161d66 100644 --- a/.github/workflows/bevy_mod_scripting.yml +++ b/.github/workflows/bevy_mod_scripting.yml @@ -94,7 +94,7 @@ jobs: path: target/coverage/html/ - name: Update coverage badge - if: ${{ matrix.run_args.generates_coverage && github.ref == 'refs/heads/main' }} + if: ${{ matrix.run_args.generates_coverage }} continue-on-error: true run: | git checkout -b chore/_update-coverage-badge || git checkout chore/_update-coverage-badge @@ -107,7 +107,7 @@ jobs: if [[ -n $(git status -s) ]]; then git commit -m "chore(badge): Update coverage badge" -m "[skip ci]" git push - gh pr create --title "chore: Update coverage badge" --body "Updates coverage badge based on test results" --base main --head chore/_update-coverage-badge > pr.txt + gh pr create --title "chore: Update coverage badge" --body "Updates coverage badge based on test results" --base ${{ github.ref }} --head chore/_update-coverage-badge > pr.txt sed -n 's/.*pull\/\([0-9]*\).*/\1/p' pr.txt > pr_number.txt PRNUMBER=$(cat pr_number.txt) gh pr merge $PRNUMBER --squash From 1035edf81f0f0fe5b92cd8672640f6f540654473 Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 1 Feb 2025 16:53:54 +0000 Subject: [PATCH 08/10] add script functions plugin as default installation instructions --- docs/src/Summary/installation.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/src/Summary/installation.md b/docs/src/Summary/installation.md index 0d134682fe..61b98be41f 100644 --- a/docs/src/Summary/installation.md +++ b/docs/src/Summary/installation.md @@ -16,7 +16,10 @@ Choose the language features you wish enabled and add them to the features block The next step is to add the BMS plugin to your application, on top of any other extras you want included in your app: ```rust,ignore -app.add_plugins(LuaScriptingPlugin::default()); +app.add_plugins(( + LuaScriptingPlugin::default(), + ScriptFunctionsPlugin +)); ``` The above is how you'd setup BMS for Lua, if you want to use another language, simply use a corresponding plugin from the integration crate. From 5647cdce32b01a942cf77021586f876afa82a691 Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 1 Feb 2025 17:18:24 +0000 Subject: [PATCH 09/10] fix coverage badge issue --- .github/workflows/bevy_mod_scripting.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index 76df161d66..98bbec5ce1 100644 --- a/.github/workflows/bevy_mod_scripting.yml +++ b/.github/workflows/bevy_mod_scripting.yml @@ -102,11 +102,12 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global push.autoSetupRemote true git add badges/coverage.svg if [[ -n $(git status -s) ]]; then git commit -m "chore(badge): Update coverage badge" -m "[skip ci]" - git push + git push -f gh pr create --title "chore: Update coverage badge" --body "Updates coverage badge based on test results" --base ${{ github.ref }} --head chore/_update-coverage-badge > pr.txt sed -n 's/.*pull\/\([0-9]*\).*/\1/p' pr.txt > pr_number.txt PRNUMBER=$(cat pr_number.txt) From 55da73005bc450ec649589612ead14657e014ed9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:40:16 +0000 Subject: [PATCH 10/10] chore(badge): Update coverage badge [skip ci] --- badges/coverage.svg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/badges/coverage.svg b/badges/coverage.svg index f51bd67218..82deedd462 100644 --- a/badges/coverage.svg +++ b/badges/coverage.svg @@ -1,13 +1,13 @@ - COVERAGE: 00% + xmlns:xlink="http://www.w3.org/1999/xlink" width="142.5" height="28" role="img" aria-label="COVERAGE: 72%"> + COVERAGE: 72% COVERAGE - 53% + 72% \ No newline at end of file