mk_lib/lib.rs
1//! # mk-lib
2//!
3//! `mk-lib` is a library for parsing and running tasks defined in a YAML file.
4//!
5//! ## Data formats
6//!
7//! The following data formats are supported:
8//!
9//! - [YAML], a self-proclaimed human-friendly configuration language that ain't
10//! markup language.
11//!
12//! [YAML]: https://github.com/dtolnay/serde-yaml
13
14/// Task execution cache helpers
15pub mod cache;
16
17/// The defaults module contains the default values for the library
18pub mod defaults;
19
20/// The file module contains the file path handling functions
21pub mod file;
22
23/// The schema module contains the data structures used to represent the tasks
24pub mod schema;
25
26/// Shared secret vault helpers used by the CLI and task execution
27pub mod secrets;
28
29/// The version module contains the version information for the library
30pub mod version;
31
32/// The macros module contains the custom macros used in the library
33#[macro_use]
34pub mod macros;
35
36/// The utils module contains the utility functions used in the library
37pub mod utils;
38
39/// Shared task execution state types
40pub use schema::{
41 ActiveTasks,
42 CompletedTasks,
43};
44
45/// Generate the JSON Schema for the task configuration file as a pretty-printed JSON string.
46pub fn generate_schema() -> anyhow::Result<String> {
47 let schema = schemars::schema_for!(schema::TaskRoot);
48 Ok(serde_json::to_string_pretty(&schema)?)
49}