Skip to main content

alba_core/
lib.rs

1//! Core domain model for beams and Beamfiles.
2//!
3//! `alba-core` takes the AST `alba-syntax` produces and evaluates it into
4//! the typed [`Project`] model the execution engine schedules: resolving
5//! `let` bindings and `{expr}` interpolation, checking the small type
6//! system (strings and booleans), and running the built-in `env()`/`glob()`
7//! functions. See [`render_template`] and [`eval_expr`] for the
8//! load-time-vs-schedule-time rendering split between a beam's fields.
9//!
10//! Multi-file loading (`import "path" as alias`, namespaced beam ids) is
11//! [`load_project`]'s job, which also validates the resulting dependency
12//! graph (unknown `needs` targets, `needs`-cycles) via [`validate_graph`]
13//! before returning it. [`execution_subgraph`] extracts the transitive
14//! closure of a target beam, for whichever engine schedules and runs it.
15//! [`git`] wraps the `git` CLI, the only place in the workspace that spawns it.
16
17mod error;
18mod eval;
19mod files;
20pub mod git;
21mod graph;
22mod loader;
23mod model;
24
25pub use error::CoreError;
26pub use eval::{Scope, eval_expr, render_template, suggest};
27pub use files::{anchor_pattern, expand_globs, outputs_satisfied, pattern_dir};
28pub use graph::{execution_subgraph, validate_graph};
29pub use loader::{LoadError, SourceMap, load_project};
30pub use model::{Beam, BeamId, ExecutorKind, Hook, OptionValue, Project, SourceId, Value};
31
32#[doc(hidden)]
33pub use eval::load_str;