1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Manifest types, parser, interpolation, and JSON Schema generation for
//! LightShuttle.
//!
//! This crate is the **leaf layer** of the LightShuttle workspace: it carries
//! zero internal dependencies and is consumed by every other crate in the
//! graph (`lightshuttle-spec`, `lightshuttle-runtime`, `lightshuttle-export`,
//! and the facade `lightshuttle`). Any type that appears in a
//! `lightshuttle.yml` manifest is defined here.
//!
//! # What this crate provides
//!
//! - A strongly-typed model of `lightshuttle.yml` rooted at [`Manifest`].
//! The model is `serde`-annotated for both serialisation and JSON Schema
//! generation via `schemars`.
//! - [`Manifest::parse`]: one-shot YAML parsing combined with semantic
//! validation (naming rules, dependency cycle detection, reference
//! checking). Returns a [`ManifestError`] on the first problem found.
//! - [`Manifest::to_yaml`]: lossless round-trip serialisation back to YAML.
//! - [`Manifest::validate`]: the semantic validation pass in isolation,
//! callable after building a manifest programmatically.
//! - [`Manifest::resolve_host_volume_paths`]: rewrites relative `src` paths
//! in volume mappings to absolute paths anchored on the manifest directory.
//! - [`Interpolator`] + [`InterpolationContext`]: resolution of `${...}`
//! expressions in string fields, supporting `${env.NAME}` and
//! `${resources.name.property}` references.
//! - [`schema`]: generates the JSON Schema consumed by editor tooling and
//! the `cargo xtask schema` subcommand.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use lightshuttle_manifest::Manifest;
//!
//! let yaml = r#"
//! project:
//! name: my-app
//! resources:
//! db:
//! postgres:
//! version: "16"
//! "#;
//!
//! let manifest = Manifest::parse(yaml).expect("valid manifest");
//! assert_eq!(manifest.project.name, "my-app");
//! ```
//!
//! See the [`Manifest`], [`ResourceKind`], and [`interpolate`] module for
//! detailed documentation.
//!
//! # Specification
//!
//! The YAML format this crate implements is described in
//! `docs/spec/manifest-v0.md` in the main repository.
pub use crate;
pub use crate;
pub use crate;
pub use crateschema;
/// Substitution engine for `${...}` interpolations in manifest string values.
/// Strongly-typed model of a `lightshuttle.yml` manifest.