Skip to content

Commit 6ec6a55

Browse files
BD103MrGVSV
andauthored
Unify crate-level preludes (#15080)
# Objective - Crate-level prelude modules, such as `bevy_ecs::prelude`, are plagued with inconsistency! Let's fix it! ## Solution Format all preludes based on the following rules: 1. All preludes should have brief documentation in the format of: > The _name_ prelude. > > This includes the most common types in this crate, re-exported for your convenience. 2. All documentation should be outer, not inner. (`///` instead of `//!`.) 3. No prelude modules should be annotated with `#[doc(hidden)]`. (Items within them may, though I'm not sure why this was done.) ## Testing - I manually searched for the term `mod prelude` and updated all occurrences by hand. 🫠 --------- Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
1 parent b738f08 commit 6ec6a55

File tree

30 files changed

+91
-24
lines changed

30 files changed

+91
-24
lines changed

crates/bevy_animation/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ use serde::{Deserialize, Serialize};
3939
use thread_local::ThreadLocal;
4040
use uuid::Uuid;
4141

42-
#[allow(missing_docs)]
42+
/// The animation prelude.
43+
///
44+
/// This includes the most common types in this crate, re-exported for your convenience.
4345
pub mod prelude {
4446
#[doc(hidden)]
4547
pub use crate::{

crates/bevy_app/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ pub use sub_app::*;
2727
#[cfg(not(target_arch = "wasm32"))]
2828
pub use terminal_ctrl_c_handler::*;
2929

30-
#[allow(missing_docs)]
30+
/// The app prelude.
31+
///
32+
/// This includes the most common types in this crate, re-exported for your convenience.
3133
pub mod prelude {
3234
#[doc(hidden)]
3335
pub use crate::{

crates/bevy_asset/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pub mod processor;
1212
pub mod saver;
1313
pub mod transformer;
1414

15+
/// The asset prelude.
16+
///
17+
/// This includes the most common types in this crate, re-exported for your convenience.
1518
pub mod prelude {
1619
#[doc(hidden)]
1720
pub use crate::{

crates/bevy_audio/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ mod audio_source;
3333
mod pitch;
3434
mod sinks;
3535

36-
#[allow(missing_docs)]
36+
/// The audio prelude.
37+
///
38+
/// This includes the most common types in this crate, re-exported for your convenience.
3739
pub mod prelude {
3840
#[doc(hidden)]
3941
pub use crate::{

crates/bevy_color/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ mod test_colors;
111111
mod testing;
112112
mod xyza;
113113

114-
/// Commonly used color types and traits.
114+
/// The color prelude.
115+
///
116+
/// This includes the most common types in this crate, re-exported for your convenience.
115117
pub mod prelude {
116118
pub use crate::color::*;
117119
pub use crate::color_ops::*;

crates/bevy_core/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ use bevy_ecs::system::Resource;
1616
pub use name::*;
1717
pub use task_pool_options::*;
1818

19+
/// The core prelude.
20+
///
21+
/// This includes the most common types in this crate, re-exported for your convenience.
1922
pub mod prelude {
20-
//! The Bevy Core Prelude.
2123
#[doc(hidden)]
2224
pub use crate::{
2325
FrameCountPlugin, Name, NameOrEntity, TaskPoolOptions, TaskPoolPlugin,

crates/bevy_core_pipeline/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pub mod experimental {
4141
}
4242
}
4343

44+
/// The core pipeline prelude.
45+
///
46+
/// This includes the most common types in this crate, re-exported for your convenience.
4447
pub mod prelude {
4548
#[doc(hidden)]
4649
pub use crate::{

crates/bevy_ecs/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ pub mod world;
3636

3737
pub use bevy_ptr as ptr;
3838

39-
/// Most commonly used re-exported types.
39+
/// The ECS prelude.
40+
///
41+
/// This includes the most common types in this crate, re-exported for your convenience.
4042
pub mod prelude {
4143
#[doc(hidden)]
4244
#[cfg(feature = "reflect_functions")]

crates/bevy_gizmos/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ mod pipeline_2d;
5151
#[cfg(all(feature = "bevy_pbr", feature = "bevy_render"))]
5252
mod pipeline_3d;
5353

54-
/// The `bevy_gizmos` prelude.
54+
/// The gizmos prelude.
55+
///
56+
/// This includes the most common types in this crate, re-exported for your convenience.
5557
pub mod prelude {
5658
#[cfg(feature = "bevy_render")]
5759
pub use crate::aabb::{AabbGizmoConfigGroup, ShowAabbGizmo};

crates/bevy_gltf/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ use bevy_render::{
115115
};
116116
use bevy_scene::Scene;
117117

118-
/// The `bevy_gltf` prelude.
118+
/// The glTF prelude.
119+
///
120+
/// This includes the most common types in this crate, re-exported for your convenience.
119121
pub mod prelude {
120122
#[doc(hidden)]
121123
pub use crate::{Gltf, GltfAssetLabel, GltfExtras};

0 commit comments

Comments
 (0)