//! FHIR Package assembler — builds conformant FHIR Packages from a source directory.
//!
//! This crate provides the core logic for `rh package`, turning a flat source directory of
//! FHIR resources, markdown narrative, and CQL files into a FHIR Package Spec-conformant
//! `.tgz` tarball and expanded output directory.
//!
//! # Source Directory Layout
//!
//! ```text
//! my-package/
//!   package.json              # FHIR package manifest (required)
//!   packager.toml            # Hook configuration (optional)
//!   ImplementationGuide.json  # ImplementationGuide resource (required)
//!   StructureDefinition-foo.json
//!   ValueSet-bar.json
//!   StructureDefinition-foo.md  # Narrative embedded into matching resource
//!   fsh/
//!     MyProfile.fsh             # FSH source (processed by fsh hook)
//!   cql/
//!     MyLibrary.cql             # CQL source (processed by cql hook)
//!   examples/
//!     Patient-example.json      # Example resources → package/examples/
//!   docs/
//!     overview.md               # Standalone narrative → package/other/
//!     introduction.md
//!   fhir-lock.json            # Canonical version pins (generated by rh package lock)
//! ```

pub mod config;
pub mod context;
pub mod error;
pub mod hooks;
pub mod ig_populate;
pub mod ig_sync;
pub mod index;
pub mod init;
pub mod loader;
pub mod lock;
pub mod manifest;
pub mod narrative;
pub mod pack;
pub mod pipeline;
pub mod processors;
pub mod utils;

pub use config::PublisherConfig;
pub use context::PublishContext;
pub use error::{PublisherError, Result};
pub use init::{init_package, name_from_canonical, InitOptions};
pub use lock::{CanonicalRef, LockReport};
pub use manifest::PackageJson;
pub use pipeline::{build, check, check_lock, lock as lock_package, pack_dir};
