Skip to main content

delvewright_dsl/
lib.rs

1//! Delvewright DSL: serde types, validation, canonical serialization and JSON
2//! Schema export for the staged campaign DSL (spec-0001).
3//!
4//! Entry points:
5//! - [`parse_campaign`] / [`check_campaign`]: parse the six raw stage documents.
6//! - [`validate_campaign`]: run all spec-0001 v0.2 rule groups on a parsed
7//!   [`Campaign`], returning [`Diagnostic`]s (spec-0002 `--json` shape).
8//! - [`to_canonical_string`]: the single canonical writer — pretty JSON put
9//!   through [`fmt`], so what the compiler WRITES is what `delvec fmt --check`
10//!   accepts. One canonical form, one implementation.
11//! - [`fmt`]: that canonical form as a grammar-level formatter over any
12//!   authored JSON (stage documents, l10n sidecars, prefab metadata).
13//! - [`stage_schema`]: export a stage's JSON Schema.
14//!
15//! Each stage type lives in the module of the object it declares (ADR-0031), and
16//! the root re-exports every module's public items through one glob per module.
17//! Every stage struct is `deny_unknown_fields`; reserved enum values a campaign's
18//! `dsl_version` is too low for parse and are refused by [`validate`].
19//!
20//! Determinism (ADR-0006): all iteration is over `BTreeMap`/`BTreeSet` or slices;
21//! nothing depends on hash order, wall-clock, or absolute paths.
22
23pub mod actor;
24pub mod ambush;
25pub mod assembly;
26pub mod blocks;
27pub mod blockshape;
28pub mod body;
29pub mod canonical;
30pub mod cast;
31pub mod celestial;
32pub mod chrome;
33pub mod class;
34pub mod color;
35pub mod cutscene;
36pub mod design;
37pub mod detailplan;
38pub mod diagnostic;
39pub mod dialogue;
40pub mod economy;
41pub mod effects;
42pub mod envelope;
43pub mod equipment;
44pub mod fight;
45pub mod firework;
46/// **What a cell does when there is fluid beside it** — block knowledge, so it
47/// lives beside [`blocks`] and [`blockshape`] rather than beside any one reader
48/// of it. `delvewright_schem::fluid` re-exports it, and the prefab generators
49/// reach it through their dependency on this crate: they may not depend on
50/// `delvec`, and this is the crate every reader of a block fact can reach.
51pub mod fluid;
52pub mod fmt;
53pub mod gate;
54pub mod healthbar;
55pub mod ids;
56pub mod l10n;
57pub mod layout;
58pub mod lethal;
59pub mod license;
60pub mod lightning;
61pub mod r#loop;
62pub mod loot;
63pub mod mark;
64pub mod mclang;
65pub mod metrics;
66pub mod npc;
67pub mod onkill;
68pub mod perception;
69pub mod placement;
70pub mod prefab;
71pub mod quest;
72pub mod quest_plan;
73pub mod registry;
74pub mod rig;
75pub mod schema;
76mod serde_fields;
77pub mod shortcut;
78pub mod siteplan;
79pub mod split;
80pub mod state;
81pub mod stealth;
82pub mod timed_gate;
83pub mod trap;
84pub mod trigger;
85pub mod validate;
86pub mod viewdistance;
87pub mod wave;
88pub mod world;
89pub mod world_edits;
90
91pub use actor::*;
92pub use ambush::*;
93pub use assembly::*;
94pub use body::*;
95pub use canonical::*;
96pub use cast::*;
97pub use celestial::*;
98pub use chrome::*;
99pub use class::*;
100pub use cutscene::*;
101pub use design::*;
102pub use detailplan::*;
103pub use diagnostic::*;
104pub use dialogue::*;
105pub use economy::*;
106pub use effects::*;
107pub use envelope::*;
108pub use equipment::*;
109pub use fight::*;
110pub use firework::*;
111pub use gate::*;
112pub use healthbar::*;
113pub use ids::*;
114pub use l10n::*;
115pub use layout::*;
116pub use lethal::*;
117pub use r#loop::*;
118pub use loot::*;
119pub use mark::*;
120pub use mclang::*;
121pub use npc::*;
122pub use onkill::*;
123pub use placement::*;
124pub use prefab::*;
125pub use quest::*;
126pub use quest_plan::*;
127pub use registry::*;
128pub use schema::*;
129pub use shortcut::*;
130pub use siteplan::*;
131pub use state::*;
132pub use stealth::*;
133pub use timed_gate::*;
134pub use trap::*;
135pub use trigger::*;
136pub use validate::*;
137pub use wave::*;
138pub use world::*;
139pub use world_edits::*;