Skip to main content

bake/
lib.rs

1// Released under the MIT License.
2// Copyright, 2026, by Samuel Williams.
3
4//! Composable development tasks with typed arguments and shared context.
5//!
6//! Task attributes generate a sibling `function_task()` descriptor while
7//! preserving the original function for ordinary Rust calls. Register those
8//! descriptors explicitly and call [`Registry::run`] from your task binary.
9extern crate self as bake;
10
11mod arguments;
12mod context;
13mod error;
14mod output;
15mod registry;
16mod task;
17
18#[doc(hidden)]
19pub mod __private {
20    pub use crate::registry::{TASK_REGISTRATIONS, TaskRegistration};
21    pub use linkme;
22}
23
24pub use arguments::{Arguments, Parameter};
25pub use bake_macros::task;
26pub use context::Context;
27pub use error::{Error, Result};
28pub use output::Format;
29pub use registry::Registry;
30pub use serde_json::Value;
31pub use task::Task;
32
33/// Convert a task's output into the shared, serializable result format.
34pub fn value(output: impl serde::Serialize) -> Result<Value> {
35    serde_json::to_value(output).map_err(Error::from)
36}