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 to deployment artifact transpilation for LightShuttle.
//!
//! # Position in the crate graph
//!
//! `lightshuttle-export` sits above `lightshuttle-manifest` (the parsed
//! YAML representation) and `lightshuttle-spec` (the canonical resource
//! specification). It depends on both; the CLI crate depends on this one
//! to write the produced files to disk.
//!
//! # Pipeline: manifest -> IR -> artifacts
//!
//! The export pipeline follows a compiler shape:
//!
//! 1. **Lowering** ([`lower`]): a [`lightshuttle_manifest::Manifest`] is
//! lowered into a target-agnostic [`ExportModel`] (the IR). Every
//! resource is resolved through `lightshuttle-spec` so the model
//! inherits the same image, port, environment, and healthcheck defaults
//! that the runtime applies - no drift between `lightshuttle up` and
//! `lightshuttle export`.
//! 2. **Emission** ([`Emitter`]): a target-specific emitter consumes the
//! [`ExportModel`] and produces [`ExportArtifacts`], a list of named
//! files whose textual contents are ready to write. Three emitters ship
//! out of the box: [`ComposeEmitter`], [`KubernetesEmitter`], and
//! [`HelmEmitter`].
//! 3. **Resolution** ([`resolve`]): pure helpers that turn the optional
//! `export:` manifest section into concrete per-target values (namespace,
//! replica count, image pull policy, chart name). All emitters share
//! this module so defaults are defined and tested in one place.
//!
//! # No daemon dependency
//!
//! This crate carries no container daemon dependency. It only reads the
//! manifest and the resolved specification, so it transpiles identically
//! on a developer machine or in CI without Docker.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use lightshuttle_export::{lower, ComposeEmitter, Emitter};
//! use lightshuttle_manifest::Manifest;
//!
//! # fn main() -> lightshuttle_export::Result<()> {
//! // Load a manifest from disk (I/O, so no_run).
//! let manifest: Manifest = todo!("parse from YAML");
//!
//! // Lower the manifest into the neutral IR.
//! let model = lower(&manifest)?;
//!
//! // Emit Docker Compose artifacts.
//! let emitter = ComposeEmitter;
//! let artifacts = emitter.emit(&model)?;
//!
//! for file in &artifacts.files {
//! println!("{}: {} bytes", file.path.display(), file.contents.len());
//! }
//! # Ok(())
//! # }
//! ```
pub use crateEmitter;
pub use crate;
pub use crate;
pub use cratelower;
pub use crate;