Skip to main content

concinnity_dev/
lib.rs

1//! concinnity-dev: the dev tooling library.
2//!
3//! Everything the `concinnity` binary does, minus the argv it does it from:
4//! the world authoring / in-memory build code, the implementations behind each
5//! subcommand, the asset-reference generator, bundle packaging, the in-engine
6//! editor HUD, the localhost debug server, and the interpreted (`cn debug`) run
7//! loop.
8//!
9//! The binary is the clap command tree and nothing else. Everything it dispatches
10//! into is here, which is what lets the same entry points serve an out-of-tree
11//! host that has no argv at all.
12
13// Bridge: re-export the runtime/core modules the authoring, editor, and debug
14// code names under crate::* so their `crate::<module>` import paths resolve.
15// world.jsonl I/O lives in the compiler (concinnity-cook), not core.
16pub(crate) use concinnity_cook::authoring::world;
17pub(crate) use concinnity_engine::{app, blob, components, ecs, gfx, jobs, resource};
18
19/// The shader platform `cn` cooks worlds for: the backend the runtime linked
20/// into this same binary consumes, so a world built here plays here.
21pub fn cook_platform() -> concinnity_core::platform::Platform {
22    concinnity_engine::platform::current()
23}
24
25// Authoring / in-memory build. Its exports below are the surface the
26// out-of-tree Swift app's FFI crate embeds; the `cn` binary uses only part of
27// it, so some entry points have no in-workspace caller.
28mod authoring;
29
30// The in-engine editor HUD, the localhost debug server, the interpreted run
31// loop, and animation clip hot-reload.
32mod anim_reload;
33mod debug;
34mod debug_hook;
35mod editor;
36mod run;
37
38/// The implementations behind each `cn` subcommand, and the only place in this
39/// crate that writes to stdout.
40pub mod command;
41/// The asset reference pages, generated from the engine's own schema sources.
42pub mod docs;
43/// Packaging a built world into a distributable bundle.
44pub mod export;
45/// The project a dev session works on: the one state tree its builds, runs, and
46/// editor sessions address, opened by the binary at startup.
47pub mod project;
48
49// Process-global test serialization lock; test builds only.
50#[cfg(test)]
51mod test_support;
52
53// Dev-session entry points, consumed by the `concinnity` binary: the debug
54// server + interpreted run (`cn debug`), the in-engine editor (`cn editor`),
55// and the debug-server WebSocket client (`cn debug send/screenshot/...`).
56pub use debug::{WatchTarget, client as debug_client};
57pub use editor::run_editor;
58pub use run::run_debug;
59
60// The authoring API
61pub use authoring::{
62    add_to_path, arg_value_to_json, build_world_from_path, build_world_from_str,
63    build_world_to_disk, check_at_path, check_from_str, rm_at_path, spec_args, spec_to_value,
64    world_from_loaded, world_template_entries,
65};
66pub use concinnity_cook::authoring::world::{parse_world_jsonl, write_world_jsonl};
67pub use concinnity_cook::{build_pipeline_from_str, validate_asset, validate_world_jsonl};