cabin_publish/lib.rs
1//! Publish-workflow orchestration for Cabin.
2//!
3//! Two paths share a single staging step:
4//!
5//! - [`dry_run()`] / [`DryRunRequest`] stage the package and write
6//! The archive + canonical metadata to an output directory
7//! Without touching any registry.
8//! - [`publish_to_file_registry`] /
9//! [`dry_run_against_file_registry`] call into
10//! `cabin-registry-file` to actually mutate (or validate without
11//! Mutating) a local file registry.
12//!
13//! Crate boundaries:
14//! - this crate must not implement HTTP / sparse / OCI publish;
15//! - it must not implement server-side functionality;
16//! - file-registry layout, atomic-ish writes, and the lock file all
17//! Live in `cabin-registry-file`;
18//! - this crate is the layer where staging meets writing. Nothing
19//! Higher-level (CLI flag handling, output formatting) belongs
20//! Here.
21
22// `PublishError` aggregates package, registry-file, and dry-run
23// errors. The union crosses clippy's default
24// `result_large_err` threshold once `cabin_package::PackageError`
25// (which flows in via `?`) gains its own larger variants.
26// Boxing the enum at every call site would be churny; we accept
27// the larger `Result` instead.
28
29pub mod dry_run;
30pub mod error;
31pub mod registry;
32
33pub use dry_run::{DryRunReport, DryRunRequest, dry_run};
34pub use error::PublishError;
35pub use registry::{
36 RegistryPublishReport, RegistryPublishWorkflow, dry_run_against_file_registry,
37 publish_to_file_registry,
38};