Skip to main content

fret_framework/
lib.rs

1//! Fret's kernel facade crate.
2//!
3//! This crate is intended to be the small, memorable entry point for **manual/advanced assembly**
4//! and integrations. It re-exports selected workspace crates behind opt-in feature flags, without
5//! pulling ecosystem defaults (components, policies, tooling) into `crates/*`.
6//!
7//! For the batteries-included desktop-first experience, prefer:
8//! - `fret` (ecosystem meta crate; app entry points)
9//! - `fretboard` (dev tooling)
10//!
11//! See ADR 0109: `docs/adr/0109-user-facing-crate-surfaces-and-golden-path.md`.
12//!
13//! Default features are intentionally minimal (`core` only). Enable additional feature bundles
14//! explicitly, or use `fret` for the batteries-included golden path.
15
16#[cfg(feature = "core")]
17pub mod core {
18    pub use fret_core::*;
19}
20
21#[cfg(feature = "app")]
22pub mod app {
23    pub use fret_app::*;
24}
25
26#[cfg(feature = "ui")]
27pub mod ui {
28    pub use fret_ui::*;
29}
30
31#[cfg(feature = "runtime")]
32pub mod runtime {
33    pub use fret_runtime::*;
34}
35
36#[cfg(feature = "render")]
37pub mod render {
38    pub use fret_render::*;
39}
40
41#[cfg(feature = "fonts")]
42pub mod fonts {
43    pub use fret_fonts::*;
44}
45
46#[cfg(feature = "platform-contracts")]
47pub mod platform {
48    pub use fret_platform::*;
49}
50
51#[cfg(feature = "platform-native")]
52pub mod platform_native {
53    pub use fret_platform_native::*;
54}
55
56#[cfg(feature = "platform-web")]
57pub mod platform_web {
58    pub use fret_platform_web::*;
59}
60
61#[cfg(feature = "runner-winit")]
62pub mod runner_winit {
63    pub use fret_runner_winit::*;
64}
65
66#[cfg(feature = "runner-web")]
67pub mod runner_web {
68    pub use fret_runner_web::*;
69}
70
71#[cfg(feature = "launch")]
72pub mod launch {
73    //! Curated launch-facing exports for manual assembly.
74    //!
75    //! This module intentionally exposes the core launch/builder/driver contract used by advanced
76    //! assembly code while avoiding a full mirror of `fret_launch::*`.
77    //!
78    //! Prefer depending on `fret-launch` directly when you need specialized interop/media helpers,
79    //! compatibility-only runner traits such as `WinitAppDriver`, or when runner-facing naming
80    //! itself is part of your public API.
81    pub use fret_launch::{
82        EngineFrameKeepalive, EngineFrameUpdate, FnDriver, FnDriverHooks, RunnerError, WgpuInit,
83        WindowCreateSpec, WindowLogicalSize, WindowPhysicalPosition, WindowPosition,
84        WinitCommandContext, WinitEventContext, WinitGlobalContext, WinitHotReloadContext,
85        WinitRenderContext, WinitRunnerConfig, WinitWindowContext,
86    };
87
88    #[cfg(not(target_arch = "wasm32"))]
89    pub use fret_launch::{WinitAppBuilder, run_app, run_app_with_event_loop};
90
91    #[cfg(target_arch = "wasm32")]
92    pub use fret_launch::{WebRunnerHandle, run_app_with_handle};
93}
94
95pub mod prelude {
96    #[cfg(feature = "app")]
97    pub use fret_app::{App, Effect};
98
99    #[cfg(feature = "core")]
100    pub use fret_core::{AppWindowId, CursorIcon, Event, Point, Px, Rect, Scene, Size};
101
102    #[cfg(feature = "runtime")]
103    pub use fret_runtime::{
104        CommandId, Effect as RuntimeEffect, GlobalsHost, PlatformCapabilities, PlatformCompletion,
105        TickId, UiHost,
106    };
107
108    #[cfg(feature = "ui")]
109    pub use fret_ui::{ElementContext, ElementRuntime, UiTree};
110}