Skip to content

Commit 432b91b

Browse files
authored
refactor!: refactor dependencies, point at bevy subcrates directly (#463)
1 parent 6c17d8a commit 432b91b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+38640
-70411
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
crates/bevy_script_api/providers/*.rs linguist-generated
2-
crates/bevy_script_api/providers/*.rs -diff -merge
1+
crates/bevy_mod_scripting_functions/src/bevy_bindings/*.rs linguist-generated
2+
crates/bevy_mod_scripting_functions/src/bevy_gindings/*.rs -diff -merge

Cargo.toml

Lines changed: 90 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,45 +67,110 @@ rhai = ["bevy_mod_scripting_rhai", "bevy_mod_scripting_functions/rhai_bindings"]
6767
# rune = ["bevy_mod_scripting_rune"]
6868

6969
### Profiling
70-
profile_with_tracy = ["bevy/trace_tracy"]
70+
profile_with_tracy = ["bevy?/trace_tracy", "dep:bevy"]
7171

7272
[dependencies]
73-
bevy = { workspace = true }
74-
bevy_math = { workspace = true }
75-
bevy_reflect = { workspace = true }
73+
bevy = { workspace = true, optional = true }
74+
bevy_app = { workspace = true }
7675
bevy_mod_scripting_core = { workspace = true }
77-
bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.15.1", optional = true }
78-
bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.15.1", optional = true }
79-
# bevy_mod_scripting_rune = { path = "crates/languages/bevy_mod_scripting_rune", version = "0.9.0-alpha.2", optional = true }
76+
bevy_mod_scripting_lua = { workspace = true, optional = true }
77+
bevy_mod_scripting_rhai = { workspace = true, optional = true }
8078
bevy_mod_scripting_functions = { workspace = true }
8179
bevy_mod_scripting_derive = { workspace = true }
8280

8381
[workspace.dependencies]
84-
profiling = { version = "1.0" }
85-
86-
bevy = { version = "0.16.0", default-features = false }
87-
bevy_math = { version = "0.16.0" }
88-
bevy_reflect = { version = "0.16.0" }
89-
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.15.1" }
82+
# local crates
83+
script_integration_test_harness = { path = "crates/testing_crates/script_integration_test_harness" }
84+
test_utils = { path = "crates/testing_crates/test_utils" }
9085
bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.15.1", default-features = false }
9186
bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.15.1" }
87+
bevy_system_reflection = { path = "crates/bevy_system_reflection", version = "0.2.0", default-features = false }
88+
ladfile = { path = "crates/ladfile", version = "0.5.0" }
89+
ladfile_builder = { path = "crates/ladfile_builder", version = "0.5.1" }
90+
bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.15.1", default-features = false }
91+
bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.15.1", default-features = false }
92+
# bevy
9293

93-
# test utilities
94-
script_integration_test_harness = { path = "crates/testing_crates/script_integration_test_harness" }
95-
test_utils = { path = "crates/testing_crates/test_utils" }
94+
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.15.1" }
95+
bevy = { version = "0.16.0", default-features = false }
96+
bevy_math = { version = "0.16.0", default-features = false, features = ["std"] }
97+
bevy_transform = { version = "0.16.0", default-features = false }
98+
bevy_reflect = { version = "0.16.0", default-features = false }
99+
bevy_ecs = { version = "0.16.0", default-features = false }
100+
bevy_asset = { version = "0.16.0", default-features = false }
101+
bevy_app = { version = "0.16.0", default-features = false }
102+
bevy_log = { version = "0.16.0", default-features = false }
103+
bevy_internal = { version = "0.16.0", default-features = false }
104+
bevy_diagnostic = { version = "0.16.0", default-features = false }
105+
bevy_platform = { version = "0.16.0", default-features = false }
106+
bevy_time = { version = "0.16.0", default-features = false }
107+
bevy_input = { version = "0.16.0", default-features = false }
108+
glam = { version = "0.29.3", default-features = false }
109+
uuid = { version = "1.11", default-features = false }
110+
smol_str = { version = "0.2.0", default-features = false }
111+
112+
# other
113+
serde_json = { version = "1.0", default-features = false }
114+
indexmap = { version = "2.7", default-features = false, features = ["std"] }
115+
profiling = { version = "1.0", default-features = false, features = [
116+
"procmacros",
117+
] }
118+
regex = { version = "1.11", default-features = false }
119+
serde = { version = "1.0", default-features = false }
120+
dot-writer = { version = "0.1.4", default-features = false }
121+
parking_lot = { version = "0.12.1", default-features = false }
122+
strum = { version = "0.26", default-features = false }
123+
rhai = { version = "1.21", default-features = false }
124+
mlua = { version = "0.10", default-features = false }
125+
log = { version = "0.4", default-features = false }
126+
env_logger = { version = "0.11", default-features = false }
127+
clap = { version = "4", default-features = false }
128+
mdbook = { version = "0.4", default-features = false }
129+
quote = { version = "1.0", default-features = false }
130+
syn = { version = "2.0", default-features = false }
131+
proc-macro2 = { version = "1.0", default-features = false }
132+
smallvec = { version = "1.11", default-features = false }
133+
itertools = { version = "0.14", default-features = false }
134+
fixedbitset = { version = "0.5", default-features = false }
135+
variadics_please = { version = "1.1.0", default-features = false }
136+
anyhow = { version = "1.0", default-features = false }
137+
138+
139+
# development and testing
140+
141+
pretty_assertions = { version = "1.4", default-features = false, features = [
142+
"std",
143+
] }
144+
manifest-dir-macros = { version = "0.1.18", default-features = false }
145+
assert_cmd = { version = "2.0", default-features = false }
146+
tokio = { version = "1", default-features = false }
147+
bevy_console = { version = "0.14", default-features = false }
148+
tracing-tracy = { version = "0.11", default-features = false }
149+
libtest-mimic = { version = "0.8", default-features = false }
150+
criterion = { version = "0.5", default-features = false }
151+
rand = { version = "0.9", default-features = false }
152+
rand_chacha = { version = "0.9", default-features = false }
96153

97154
[dev-dependencies]
98-
bevy = { workspace = true, default-features = true, features = ["std"] }
99-
clap = { version = "4.1", features = ["derive"] }
100-
rand = "0.9.1"
101-
criterion = { version = "0.5" }
102-
ladfile_builder = { path = "crates/ladfile_builder", version = "0.5.1" }
155+
bevy = { workspace = true, features = [
156+
"bevy_render",
157+
"bevy_window",
158+
"bevy_asset",
159+
"bevy_core_pipeline",
160+
"bevy_sprite",
161+
] }
162+
bevy_platform = { workspace = true }
163+
clap = { workspace = true, features = ["derive"] }
164+
rand = { workspace = true, features = ["thread_rng"] }
165+
criterion = { workspace = true }
166+
ladfile_builder = { workspace = true }
103167
script_integration_test_harness = { workspace = true }
104168
test_utils = { workspace = true }
105-
libtest-mimic = "0.8"
106-
tracing-tracy = "0.11"
107-
regex = "1.11"
108-
bevy_console = "0.14"
169+
libtest-mimic = { workspace = true }
170+
tracing-tracy = { workspace = true }
171+
regex = { workspace = true }
172+
bevy_console = { workspace = true }
173+
109174

110175
[workspace]
111176
members = [

benches/benchmarks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
extern crate bevy_mod_scripting;
22
extern crate script_integration_test_harness;
33
extern crate test_utils;
4-
use std::{collections::HashMap, path::PathBuf, sync::LazyLock, time::Duration};
4+
use bevy_platform::collections::HashMap;
5+
use std::{path::PathBuf, sync::LazyLock, time::Duration};
56

67
use bevy::{
78
log::{

codegen/templates/footer.tera

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ impl {{item.import_path}} {
5252
}
5353
{% endfor %}
5454

55-
impl ::bevy::app::Plugin for {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_camel")}} {
56-
fn build(&self, app: &mut ::bevy::prelude::App) {
55+
impl Plugin for {{ "ScriptingPlugin" | prefix_cratename | convert_case(case="upper_camel")}} {
56+
fn build(&self, app: &mut App) {
5757
let mut world = app.world_mut();
5858

5959
{% for item in items %}

codegen/templates/header.tera

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use bevy_mod_scripting_core::{
88
function::{from::{Ref, Mut, Val}, namespace::{NamespaceBuilder}}
99
}
1010
};
11+
use bevy_ecs::{prelude::*};
12+
1113

1214
use bevy_mod_scripting_derive::script_bindings;
1315

codegen/templates/import.tera

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
{%- if import is starting_with("bevy_") -%}
2-
bevy::{{- import | substring(start=5) -}}
3-
{%- elif import is starting_with("glam::") -%}
4-
bevy::math::{{- import | substring(start=6) -}}
5-
{%- else -%}
6-
::{{import}}
7-
{%- endif -%}
1+
::{{import}}

codegen/templates/macros.tera

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn index(_self: Self, idx: usize, lua: &tealr::mlu::mlua::Lua) -> Result<tealr::
2525
_ => "unknown_axis"
2626
};
2727

28-
let parsed_path = ::bevy::reflect::ParsedPath::parse_static(path).expect("invariant");
28+
let parsed_path = ::bevy_reflect::ParsedPath::parse_static(path).expect("invariant");
2929
curr_ref.index_path(bevy_mod_scripting_core::bindings::ReflectionPathElem::new_reflection(parsed_path));
3030
crate::bindings::reference::LuaReflectReference(curr_ref).to_lua_proxy(lua)
3131
}

crates/bevy_mod_scripting_core/Cargo.toml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,32 @@ mlua_impls = ["mlua"]
2525
rhai_impls = ["rhai"]
2626

2727
[dependencies]
28-
mlua = { version = "0.10", default-features = false, optional = true }
29-
rhai = { version = "1.21", default-features = false, features = [
30-
"sync",
31-
], optional = true }
32-
bevy = { workspace = true, default-features = false, features = [
33-
"bevy_asset",
34-
"std",
35-
] }
36-
parking_lot = "0.12.1"
37-
smallvec = "1.11"
38-
itertools = "0.14"
28+
mlua = { workspace = true, optional = true }
29+
rhai = { workspace = true, features = ["sync"], optional = true }
30+
31+
bevy_reflect = { workspace = true, default-features = false, features = [] }
32+
bevy_ecs = { workspace = true, default-features = false, features = [] }
33+
bevy_app = { workspace = true, default-features = false, features = [] }
34+
bevy_log = { workspace = true, default-features = false, features = [] }
35+
bevy_asset = { workspace = true, default-features = false, features = [] }
36+
bevy_diagnostic = { workspace = true, default-features = false, features = [] }
37+
bevy_platform = { workspace = true, default-features = false, features = [] }
38+
39+
parking_lot = { workspace = true }
40+
smallvec = { workspace = true }
41+
itertools = { workspace = true }
3942
profiling = { workspace = true }
4043
bevy_mod_scripting_derive = { workspace = true }
41-
fixedbitset = "0.5"
42-
bevy_system_reflection = { path = "../bevy_system_reflection", version = "0.2.0" }
43-
serde = { version = "1.0", features = ["derive"] }
44-
uuid = "1.11"
45-
variadics_please = "1.1.0"
44+
fixedbitset = { workspace = true }
45+
bevy_system_reflection = { workspace = true }
46+
serde = { workspace = true, features = ["derive"] }
47+
uuid = { workspace = true }
48+
variadics_please = { workspace = true }
4649

4750
[dev-dependencies]
4851
test_utils = { workspace = true }
49-
tokio = { version = "1", features = ["rt", "macros"] }
50-
pretty_assertions = "1.4"
52+
tokio = { workspace = true, features = ["rt", "macros"] }
53+
pretty_assertions = { workspace = true, features = ["alloc"] }
5154

5255
[lints]
5356
workspace = true

0 commit comments

Comments
 (0)