pub struct BuildPolicy { /* private fields */ }Expand description
Resolved policy for deciding whether a package may run its lifecycle scripts.
Implementations§
Source§impl BuildPolicy
impl BuildPolicy
Sourcepub fn allow_all() -> Self
pub fn allow_all() -> Self
A policy that allows every package, regardless of the map.
Corresponds to --dangerously-allow-all-builds.
Sourcepub fn from_config(
allow_builds: &BTreeMap<String, AllowBuildRaw>,
only_built: &[String],
never_built: &[String],
dangerously_allow_all: bool,
) -> (Self, Vec<BuildPolicyError>)
pub fn from_config( allow_builds: &BTreeMap<String, AllowBuildRaw>, only_built: &[String], never_built: &[String], dangerously_allow_all: bool, ) -> (Self, Vec<BuildPolicyError>)
Build from a raw allowBuilds map plus pnpm’s canonical
onlyBuiltDependencies / neverBuiltDependencies flat lists,
plus the dangerouslyAllowAllBuilds flag.
All three sources merge into one allow/deny set — pnpm uses the
flat lists in most real-world projects, and aube’s allowBuilds
map is the superset format. Unrecognized allowBuilds value
shapes are collected in the returned warnings vec so the
caller can surface them through the progress UI.
Sourcepub fn decide(&self, name: &str, version: &str) -> AllowDecision
pub fn decide(&self, name: &str, version: &str) -> AllowDecision
Decide whether (name, version) may run lifecycle scripts.
Explicit denies always win over allows (mirrors pnpm).
Sourcepub fn has_any_allow_rule(&self) -> bool
pub fn has_any_allow_rule(&self) -> bool
True when the policy would allow something — any rule at all, or allow-all mode. Lets callers cheaply skip the whole dep-script phase when nothing could possibly run.
Trait Implementations§
Source§impl Clone for BuildPolicy
impl Clone for BuildPolicy
Source§fn clone(&self) -> BuildPolicy
fn clone(&self) -> BuildPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more