Skip to main content

semver_analyzer_ts/worktree/
mod.rs

1//! Git worktree management with RAII cleanup.
2//!
3//! Manages temporary worktrees for checking out git refs, installing
4//! dependencies, and running tsc. Ensures cleanup on drop, panic, or SIGINT.
5
6mod error;
7mod guard;
8mod package_manager;
9mod tsc;
10
11pub use error::WorktreeError;
12pub use guard::WorktreeGuard;
13pub use package_manager::PackageManager;
14
15/// Non-fatal issues encountered during worktree setup.
16///
17/// These are captured on [`WorktreeGuard`] via `guard.warnings()` and
18/// propagated to the `DegradationTracker` by the caller of `extract()`.
19/// The per-package tsc failures stay as `tracing::warn!` for `--log-file`
20/// visibility; only the aggregate outcome is captured here.
21#[derive(Debug, Clone)]
22pub enum ExtractionWarning {
23    /// tsc partially succeeded — some packages compiled, others failed.
24    /// The project build fallback also failed.
25    PartialTscBuildFailed {
26        succeeded: usize,
27        failed: usize,
28        build_error: String,
29    },
30
31    /// tsc completely failed but the project build succeeded as fallback.
32    TscFailedBuildSucceeded { tsc_error: String },
33}