pub enum Hooks {
Active(HookRunner),
Noop,
}Expand description
Hook system — either active (with a running Node.js worker) or no-op.
Variants§
Active(HookRunner)
Hooks are active — .pnpmfile.cjs is loaded in a child process.
Noop
No hooks configured — all calls are no-ops.
Implementations§
Source§impl Hooks
impl Hooks
Sourcepub fn detect(project_root: &Path, pnpmfile_config: Option<&str>) -> Self
pub fn detect(project_root: &Path, pnpmfile_config: Option<&str>) -> Self
Detect and initialize hooks for a project.
- If
pnpmfile_configisSome("false"), hooks are disabled. - If
pnpmfile_configisSome(path), that path is used. - If
pnpmfile_configisNone, auto-detects.pnpmfile.cjsinproject_root.
Sourcepub fn read_package(&mut self, pkg: HookPackage) -> Result<HookPackage>
pub fn read_package(&mut self, pkg: HookPackage) -> Result<HookPackage>
Run readPackage hook on a package’s metadata.
Returns the (possibly modified) package metadata.
Sourcepub fn after_all_resolved(&mut self, lockfile: &str) -> Result<String>
pub fn after_all_resolved(&mut self, lockfile: &str) -> Result<String>
Run afterAllResolved hook on the lockfile content.
Returns the (possibly modified) lockfile string.
Auto Trait Implementations§
impl Freeze for Hooks
impl RefUnwindSafe for Hooks
impl Send for Hooks
impl Sync for Hooks
impl Unpin for Hooks
impl UnsafeUnpin for Hooks
impl UnwindSafe for Hooks
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