euv-cli 0.51.0

Cross-platform CLI tool for the euv native UI framework supporting run, build, check, fmt, doctor, new, and Hyperlane SSE dynamic updates across all supported platforms.
Documentation
use super::*;

/// Default multi-platform build pipeline configuration rooted at the current working directory.
impl Default for BuildPipelineConfig {
    /// Constructs a `BuildPipelineConfig` targeting the current working directory with safe defaults.
    ///
    /// # Returns
    ///
    /// - `Self` - Default pipeline configuration.
    fn default() -> Self {
        Self {
            workspace_root: PathBuf::from("."),
            targets: Vec::new(),
            all: false,
            package: None,
            out_dir: None,
            out_file: None,
            archive: None,
            base: None,
            skip_unavailable: false,
            parallel: false,
            jobs: None,
            manifest: false,
            verify: false,
            raw_wasm: false,
            skip_wasm_opt: false,
            theme_variants: false,
            no_launch: false,
            install: false,
            smoke: false,
            include_cli: false,
            version: None,
            abis: Vec::new(),
            features: Vec::new(),
            device: None,
            icon: None,
            form_factor: HarmonyFormFactorArg::Phone,
            render: None,
            release: false,
        }
    }
}

/// Badge and display helpers on `TargetBuildStatus`.
impl TargetBuildStatus {
    /// Maps this build status to its terminal `StatusBadge`.
    ///
    /// # Returns
    ///
    /// - `StatusBadge` - Corresponding terminal badge token.
    #[must_use]
    pub const fn badge(self) -> StatusBadge {
        match self {
            Self::Passed => StatusBadge::Pass,
            Self::SkippedUnavailable => StatusBadge::Skip,
            Self::Failed => StatusBadge::Fail,
        }
    }

    /// Returns the short uppercase status label (`PASS`, `SKIP`, or `FAIL`).
    ///
    /// # Returns
    ///
    /// - `&'static str` - Canonical uppercase status token.
    #[must_use]
    pub const fn label(self) -> &'static str {
        match self {
            Self::Passed => PIPELINE_STATUS_PASSED,
            Self::SkippedUnavailable => PIPELINE_STATUS_SKIPPED,
            Self::Failed => PIPELINE_STATUS_FAILED,
        }
    }
}

/// Aggregate result helpers on `BuildPipelineReport`.
impl BuildPipelineReport {
    /// Returns `true` when zero targets failed during this pipeline execution.
    ///
    /// # Returns
    ///
    /// - `bool` - Whether all non-skipped targets succeeded.
    #[must_use]
    pub fn all_succeeded(&self) -> bool {
        self.get_failed_count() == 0
    }
}