use aube_lockfile::graph_hash::GraphHashes;
use aube_store::Store;
use std::path::PathBuf;
#[cfg(test)]
use aube_store::PackageIndex;
#[cfg(test)]
use std::collections::BTreeMap;
#[cfg(test)]
use std::path::Path;
mod builder;
mod error;
mod hoisted;
mod link;
mod materialize;
mod patches;
mod pool;
mod sweep;
pub mod sys;
#[cfg(test)]
mod public_hoist_tests;
#[cfg(test)]
mod tests;
pub use error::Error;
pub use hoisted::HoistedPlacements;
pub use link::build_nested_link_targets;
pub(crate) use materialize::{
invalidate_stale_index_for_package, validate_index_key, validate_package_link_name,
};
pub use patches::Patches;
pub(crate) use patches::apply_multi_file_patch;
pub use pool::default_linker_parallelism;
pub use sweep::{is_physical_importer, mkdirp, remove_dir_all_with_retry, sweep_stale_tmp_dirs};
pub(crate) use sweep::{sweep_stale_top_level_entries, try_remove_entry};
pub use sys::{
BinShimOptions, create_bin_shim, create_dir_link, normalize_path, parse_posix_shim_target,
remove_bin_shim, validate_bin_name, validate_bin_target,
};
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, strum::EnumString)]
#[strum(serialize_all = "lowercase", ascii_case_insensitive)]
pub enum NodeLinker {
#[default]
Isolated,
Hoisted,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub enum HoistingLimits {
#[default]
None,
Workspaces,
Dependencies,
}
pub struct Linker {
virtual_store: PathBuf,
pub(crate) store: Store,
use_global_virtual_store: bool,
strategy: LinkStrategy,
pub(crate) patches: Patches,
hashes: Option<GraphHashes>,
virtual_store_dir_max_length: usize,
shamefully_hoist: bool,
public_hoist_patterns: Vec<glob::Pattern>,
public_hoist_negations: Vec<glob::Pattern>,
hoist: bool,
hoist_patterns: Vec<glob::Pattern>,
hoist_negations: Vec<glob::Pattern>,
hoist_workspace_packages: bool,
pub(crate) hoisting_limits: HoistingLimits,
dedupe_direct_deps: bool,
pub(crate) node_linker: NodeLinker,
pub(crate) modules_dir_name: String,
pub(crate) aube_dir_override: Option<std::path::PathBuf>,
link_concurrency: Option<usize>,
virtual_store_only: bool,
}
#[derive(Debug, Clone, Copy)]
pub enum LinkStrategy {
Reflink,
ReflinkAuto,
Hardlink,
Copy,
}
#[derive(Debug, Default)]
pub struct LinkStats {
pub packages_linked: usize,
pub packages_cached: usize,
pub files_linked: usize,
pub top_level_linked: usize,
pub hoisted_placements: Option<HoistedPlacements>,
}