aster/foundation/mod.rs
1//! Project discovery, configuration, and validated layout.
2//!
3//! This layer defines Aster's stable project model. It does not depend on the
4//! engine, build, or CLI layers; build-time filesystem state belongs to the
5//! build layer instead.
6
7use std::path::{Path, PathBuf};
8
9pub mod config;
10mod project;
11
12pub use config::{
13 AssetsConfig, AsterConfig, CssConfig, FontConfig, HighlightConfig, ImageConfig, OutputConfig,
14 PathsConfig, PostprocessConfig, Themes, TypstConfig, WatchConfig,
15};
16pub use project::{Project, ProjectLayout};
17
18/// A filesystem input observed or explicitly configured for the current build.
19#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
20pub enum FilesystemDependency {
21 /// A file whose contents were accessed or whose path was configured.
22 File(PathBuf),
23 /// A directory whose recursive membership was accessed or configured.
24 Tree(PathBuf),
25}
26
27impl FilesystemDependency {
28 /// Return the dependency's filesystem path.
29 pub fn path(&self) -> &Path {
30 match self {
31 Self::File(path) | Self::Tree(path) => path,
32 }
33 }
34}