diff --git a/.github/workflows/bevy_mod_scripting.yml b/.github/workflows/bevy_mod_scripting.yml index f4f74b82d4..98bbec5ce1 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 @@ -93,17 +94,24 @@ 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 cp target/coverage/html/badges/for_the_badge.svg badges/coverage.svg 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) + gh pr merge $PRNUMBER --squash fi generate_bindings: name: Bindings - Synchronise 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/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 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" 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. diff --git a/release-notes/0.9.0.md b/release-notes/0.9.0.md new file mode 100644 index 0000000000..7c65019d2c --- /dev/null +++ b/release-notes/0.9.0.md @@ -0,0 +1,28 @@ +# [`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 +- 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. +- 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! + +## 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. + +## Changelog +See a detailed changelog [here](https://github.com/makspll/bevy_mod_scripting/blob/main/CHANGELOG.md)