Update for bevy 0.18 (#73)
Some checks failed
Book / test (push) Has been cancelled
Deploy book / deploy (push) Has been cancelled
Rust / build (3.4.4, map[os:ubuntu-latest]) (push) Has been cancelled

* Update for bevy 0.18
This commit is contained in:
Jarosław Konik 2026-03-07 12:22:06 +00:00 committed by GitHub
parent 7fac9f7cfc
commit 4fc2b47834
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 36 additions and 31 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "bevy_scriptum"
authors = ["Jaroslaw Konik <konikjar@gmail.com>"]
version = "0.10.0"
version = "0.11.0"
edition = "2024"
license = "MIT OR Apache-2.0"
readme = "README.md"
@ -16,7 +16,7 @@ rhai = ["dep:rhai"]
ruby = ["dep:magnus", "dep:rb-sys"]
[dependencies]
bevy = { default-features = false, version = "0.17", features = ["bevy_asset", "bevy_log"] }
bevy = { default-features = false, version = "0.18", features = ["bevy_asset", "bevy_log"] }
serde = "1.0.162"
rhai = { version = "1.14.0", features = [
"sync",

View file

@ -5,11 +5,11 @@
bevy_scriptum is a a plugin for [Bevy](https://bevyengine.org/) that allows you to write some of your game or application logic in a scripting language.
### Supported scripting languages/runtimes
| language/runtime | cargo feature | documentation chapter |
| ------------------------------------------ | ------------- | --------------------------------------------------------------- |
| 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
| 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
| 💎 Ruby(currently only supported on Linux) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
| language/runtime | cargo feature | documentation chapter |
| ---------------------------------------------------- | ------------- | --------------------------------------------------------------- |
| 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
| 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
| 💎 Ruby(currently only supported on Linux and MacOS) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
Documentation book is available [here](https://jarkonik.github.io/bevy_scriptum/) 📖
@ -98,7 +98,7 @@ Add the following to your `Cargo.toml`:
```toml
[dependencies]
bevy_scriptum = { version = "0.10", features = ["lua"] }
bevy_scriptum = { version = "0.11", features = ["lua"] }
```
or execute `cargo add bevy_scriptum --features lua` from your project directory.
@ -167,6 +167,7 @@ The examples live in `examples` directory and their corresponding scripts live i
| bevy version | bevy_scriptum version |
|--------------|-----------------------|
| 0.18 | 0.11 |
| 0.17 | 0.10 |
| 0.16 | 0.8-0.9 |
| 0.15 | 0.7 |

View file

@ -7,7 +7,7 @@ currently being supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 0.10 | :white_check_mark: |
| 0.11 | :white_check_mark: |
## Reporting a Vulnerability

View file

@ -2,6 +2,7 @@
| bevy version | bevy_scriptum version |
| ------------ | --------------------- |
| 0.18 | 0.11 |
| 0.17 | 0.10 |
| 0.16 | 0.8-0.9 |
| 0.15 | 0.7 |

View file

@ -120,7 +120,7 @@ Add the following to your `Cargo.toml`:
```toml
[dependencies]
bevy_scriptum = { version = "0.10", features = ["lua"] }
bevy_scriptum = { version = "0.11", features = ["lua"] }
```
or execute `cargo add bevy_scriptum --features lua` from your project directory.

View file

@ -4,8 +4,8 @@ Add the following to your `Cargo.toml`:
```toml
[dependencies]
bevy = "0.17"
bevy_scriptum = { version = "0.10", features = ["lua"] }
bevy = "0.18"
bevy_scriptum = { version = "0.11", features = ["lua"] }
```
If you need a different version of bevy you need to use a matching bevy_scriptum

View file

@ -4,8 +4,8 @@ Add the following to your `Cargo.toml`:
```toml
[dependencies]
bevy = "0.17"
bevy_scriptum = { version = "0.10", features = ["rhai"] }
bevy = "0.18"
bevy_scriptum = { version = "0.11", features = ["rhai"] }
```
If you need a different version of bevy you need to use a matching bevy_scriptum

View file

@ -1,6 +1,6 @@
# Installation
Ruby is currently only supported on Linux.
Ruby is currently only supported on Linux ana MacOS.
## Ruby
@ -45,8 +45,8 @@ Add the following to your `Cargo.toml`:
```toml
[dependencies]
bevy = "0.17"
bevy_scriptum = { version = "0.10", features = ["ruby"] }
bevy = "0.18"
bevy_scriptum = { version = "0.11", features = ["ruby"] }
```
If you need a different version of bevy you need to use a matching bevy_scriptum

View file

@ -6,7 +6,7 @@ To enable live reload it should be enough to enable `file-watcher` feature
within bevy dependency in `Cargo.toml`
```toml
bevy = { version = "0.17", features = ["file_watcher"] }
bevy = { version = "0.18", features = ["file_watcher"] }
```
## Init-teardown pattern

View file

@ -3,9 +3,11 @@ use std::marker::PhantomData;
use bevy::{
asset::{io::Reader, Asset, AssetLoader, LoadContext},
tasks::ConditionalSendFuture,
reflect::TypePath,
};
/// A loader for script assets.
#[derive(TypePath)]
pub struct ScriptLoader<A: Asset + From<String>> {
_phantom_data: PhantomData<A>,
}

View file

@ -4,11 +4,11 @@
//! ## Supported scripting languages/runtimes
//!
//! | language/runtime | cargo feature | documentation chapter |
//! | ------------------------------------------ | ------------- | --------------------------------------------------------------- |
//! | 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
//! | 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
//! | 💎 Ruby(currently only supported on Linux) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
//! | language/runtime | cargo feature | documentation chapter |
//! | ---------------------------------------------------- | ------------- | --------------------------------------------------------------- |
//! | 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
//! | 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
//! | 💎 Ruby(currently only supported on Linux and MacOS) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
//!
//! Documentation book is available [here](https://jarkonik.github.io/bevy_scriptum/) 📖
//!
@ -103,7 +103,7 @@
//!
//! ```toml
//! [dependencies]
//! bevy_scriptum = { version = "0.10", features = ["lua"] }
//! bevy_scriptum = { version = "0.11", features = ["lua"] }
//! ```
//!
//! or execute `cargo add bevy_scriptum --features lua` from your project directory.
@ -176,6 +176,7 @@
//!
//! | bevy version | bevy_scriptum version |
//! |--------------|-----------------------|
//! | 0.18 | 0.11 |
//! | 0.17 | 0.10 |
//! | 0.16 | 0.8-0.9 |
//! | 0.15 | 0.7 |

View file

@ -43,7 +43,7 @@ pub struct BevyEntity(pub Entity);
impl BevyEntity {
pub fn index(&self) -> u32 {
self.0.index()
self.0.index_u32()
}
}
@ -104,7 +104,7 @@ impl Default for LuaRuntime {
let engine = engine.lock().expect("Failed to lock engine");
engine
.register_userdata_type::<BevyEntity>(|typ| {
typ.add_field_method_get("index", |_, entity| Ok(entity.0.index()));
typ.add_field_method_get("index", |_, entity| Ok(entity.index()));
})
.expect("Failed to register BevyEntity userdata type");

View file

@ -55,7 +55,7 @@ pub struct BevyEntity(pub Entity);
impl BevyEntity {
pub fn index(&self) -> u32 {
self.0.index()
self.0.index_u32()
}
}

View file

@ -180,7 +180,7 @@ pub struct BevyEntity(pub Entity);
impl BevyEntity {
pub fn index(&self) -> u32 {
self.0.index()
self.0.index_u32()
}
}

View file

@ -441,7 +441,7 @@ macro_rules! scripting_tests {
assert_eq!(
app.world().get_resource::<State>().unwrap().index,
entity.index()
entity.index_u32()
);
}
@ -473,7 +473,7 @@ macro_rules! scripting_tests {
assert_eq!(
app.world().get_resource::<State>().unwrap().index,
Some(entity.index())
Some(entity.index_u32())
);
}
@ -505,7 +505,7 @@ macro_rules! scripting_tests {
assert_eq!(
app.world().get_resource::<State>().unwrap().index,
Some(entity.index())
Some(entity.index_u32())
);
}