pub struct Linker { /* private fields */ }Implementations§
Source§impl Linker
impl Linker
pub fn new(cache: Arc<ContentCache>, project_root: PathBuf) -> Self
pub fn with_config( cache: Arc<ContentCache>, project_root: PathBuf, shamefully_hoist: bool, hoist: bool, hoist_pattern: Vec<String>, public_hoist_pattern: Vec<String>, ) -> Self
Sourcepub async fn link(
&self,
graph: &DependencyGraph,
direct_deps: &[String],
) -> Result<LinkStats>
pub async fn link( &self, graph: &DependencyGraph, direct_deps: &[String], ) -> Result<LinkStats>
Link packages from cache to node_modules using pnpm-style layout
Sourcepub async fn link_with_progress(
&self,
graph: &DependencyGraph,
direct_deps: &[String],
progress: Option<Arc<LinkProgress>>,
) -> Result<LinkStats>
pub async fn link_with_progress( &self, graph: &DependencyGraph, direct_deps: &[String], progress: Option<Arc<LinkProgress>>, ) -> Result<LinkStats>
Link packages with optional progress tracking.
Sourcepub async fn link_workspace(
&self,
graph: &DependencyGraph,
workspace: &Workspace,
) -> Result<LinkStats>
pub async fn link_workspace( &self, graph: &DependencyGraph, workspace: &Workspace, ) -> Result<LinkStats>
Link packages in a workspace layout.
- Hardlinks all external packages from cache into
root/node_modules/.dnx/. - Symlinks all workspace members at
root/node_modules/<member_name>. - For each member, creates
<member>/node_modules/with symlinks to workspace siblings and external deps.
pub async fn link_workspace_with_progress( &self, graph: &DependencyGraph, workspace: &Workspace, progress: Option<Arc<LinkProgress>>, ) -> Result<LinkStats>
Sourcepub fn write_state(&self, lockfile_hash: &str) -> Result<()>
pub fn write_state(&self, lockfile_hash: &str) -> Result<()>
Write link state file so subsequent installs can skip linking if the lockfile hasn’t changed.
Sourcepub fn check_state(&self, lockfile_hash: &str) -> bool
pub fn check_state(&self, lockfile_hash: &str) -> bool
Check if the link state matches the given lockfile hash.
Sourcepub fn run_install_scripts(&self, graph: &DependencyGraph) -> ScriptStats
pub fn run_install_scripts(&self, graph: &DependencyGraph) -> ScriptStats
Run install scripts (preinstall, install, postinstall) for packages that declare them. Uses rayon for parallel execution across packages, but runs scripts sequentially per package.
Sourcepub fn hoist_packages(
&self,
graph: &DependencyGraph,
direct_deps: &[String],
) -> Result<usize>
pub fn hoist_packages( &self, graph: &DependencyGraph, direct_deps: &[String], ) -> Result<usize>
Hoist packages according to configuration.
- shamefully_hoist: hoist ALL packages to root node_modules (flat layout like npm)
- hoist: hoist matching packages to node_modules/.dnx/node_modules (hidden hoisting)
- public_hoist_pattern: hoist matching packages to root node_modules
Auto Trait Implementations§
impl Freeze for Linker
impl RefUnwindSafe for Linker
impl Send for Linker
impl Sync for Linker
impl Unpin for Linker
impl UnsafeUnpin for Linker
impl UnwindSafe for Linker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more