pakx-core 0.1.10

pakx core — manifest, lockfile, resolver, installer logic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Serialise a [`Manifest`] back to YAML with stable field order for
//! diff-friendly output.

use super::schema::Manifest;

/// Render a manifest to YAML.
///
/// Key order is fixed by the field order in [`Manifest`] (name → version →
/// agents → dependencies). Empty/`None` collections are skipped via
/// `skip_serializing_if`. Output ends with a single trailing newline.
pub fn write_manifest(manifest: &Manifest) -> String {
    let mut out = serde_yaml_ng::to_string(manifest).expect("Manifest serializes infallibly");
    if !out.ends_with('\n') {
        out.push('\n');
    }
    out
}