Skip to main content

forge/
lib.rs

1//! FORGE - The Rust Full-Stack Framework
2//!
3//! A batteries-included framework for building full-stack web applications
4//! with a Rust backend and generated SvelteKit or Dioxus frontends.
5
6mod auto_register;
7#[cfg(feature = "embedded-frontend")]
8mod embedded;
9mod runtime;
10
11// Re-export forge_core for macro-generated code
12#[doc(hidden)]
13pub use forge_core;
14
15// Re-export inventory for macro-generated auto-registration
16#[doc(hidden)]
17pub use inventory;
18
19// Re-export auto-registration types for macro-generated code
20#[doc(hidden)]
21pub use auto_register::{
22    AutoCron, AutoDaemon, AutoJob, AutoMcpTool, AutoMutation, AutoQuery, AutoWebhook, AutoWorkflow,
23};
24
25// Re-export embedded frontend handler
26#[cfg(feature = "embedded-frontend")]
27pub use embedded::serve_embedded_assets;
28
29// Re-export proc macros at crate root
30pub use forge_macros::{
31    cron, daemon, forge_enum, job, mcp_tool, model, mutation, query, webhook, workflow,
32};
33
34// Re-export Migration type for programmatic migrations
35pub use forge_runtime::migrations::Migration;
36
37// Re-export testing utilities
38pub use forge_core::testing;
39
40// Re-export testing assertion macros
41pub use forge_core::{
42    assert_err, assert_err_variant, assert_http_called, assert_http_not_called,
43    assert_job_dispatched, assert_job_not_dispatched, assert_ok, assert_workflow_not_started,
44    assert_workflow_started,
45};
46
47/// All internal FORGE schema SQL concatenated.
48///
49/// For tests: apply before user migrations. In production, migration runner handles versioning.
50pub fn get_internal_sql() -> String {
51    forge_runtime::migrations::get_all_system_sql()
52}
53
54pub use runtime::prelude;
55pub use runtime::{Forge, ForgeBuilder};