pub struct VersionMetadata {Show 20 fields
pub name: String,
pub version: String,
pub dependencies: BTreeMap<String, String>,
pub dev_dependencies: BTreeMap<String, String>,
pub peer_dependencies: BTreeMap<String, String>,
pub peer_dependencies_meta: BTreeMap<String, PeerDepMeta>,
pub optional_dependencies: BTreeMap<String, String>,
pub bundled_dependencies: Option<BundledDependencies>,
pub dist: Option<Dist>,
pub os: Vec<String>,
pub cpu: Vec<String>,
pub libc: Vec<String>,
pub engines: BTreeMap<String, String>,
pub license: Option<String>,
pub funding_url: Option<String>,
pub bin: BTreeMap<String, String>,
pub has_install_script: bool,
pub deprecated: Option<String>,
pub approver: Option<Value>,
pub npm_user: Option<NpmUser>,
}Expand description
Metadata for a specific version of a package.
Deserializes via VersionMetadataRaw (#[serde(from = ...)]) so
that publishes carrying both bundledDependencies (canonical) and
bundleDependencies (deprecated alias) parse cleanly. serde’s plain
#[serde(alias = ...)] rejects that as a duplicate field, which
blocks installs of every version of every package that ships both
keys (e.g. @lingui/message-utils@>=5.2.0).
Fields§
§name: String§version: String§dependencies: BTreeMap<String, String>§dev_dependencies: BTreeMap<String, String>§peer_dependencies: BTreeMap<String, String>§peer_dependencies_meta: BTreeMap<String, PeerDepMeta>§optional_dependencies: BTreeMap<String, String>§bundled_dependencies: Option<BundledDependencies>bundledDependencies from the packument. Either a list of dep
names or true (meaning “bundle every dependencies entry”).
Packages listed here are shipped inside the parent tarball, so
the resolver must not recurse into them. npm serializes this
under both bundledDependencies and bundleDependencies; on
deserialize we accept either, and prefer the canonical when both
are present (handled in VersionMetadataRaw).
dist: Option<Dist>§os: Vec<String>§cpu: Vec<String>§libc: Vec<String>§engines: BTreeMap<String, String>engines: from the package manifest (e.g. {node: ">=8"}).
Round-tripped into the lockfile so pnpm-compatible output can
emit engines: {node: '>=8'} on package entries without a
packument re-fetch.
Uses aube_manifest::engines_tolerant so the legacy pre-npm-2.x
array shape (e.g. madge@0.0.1 and html-entities@1.x ship
"engines": ["node >= 0.8.0"]) doesn’t blow up the whole
packument — one such version would otherwise block install of
any range that touches the packument, even when the user’s
selector doesn’t pick that version. Array normalizes to an
empty map, matching the manifest and lockfile parsers.
license: Option<String>license: field from the package manifest. npm’s lockfile
keeps this per-package; other formats don’t. Stored as
Option<String> because packuments can emit a bare string
("MIT"), an SPDX object, or nothing at all — we only keep
the simple case for lockfile round-trip. Non-string shapes
degrade to None rather than failing to parse the packument.
funding_url: Option<String>funding: URL extracted from the manifest’s funding field.
The field is documented as a string or an object with a
url: key or an array of either — npm’s lockfile
normalizes to {url: …}, so we only keep the URL and let
the writer emit the wrapping object. Serde rename because
rename_all = "camelCase" would otherwise look for
fundingUrl in the JSON.
bin: BTreeMap<String, String>bin: map from the packument, normalized to name → path.
npm records bin in two shapes on a manifest: a string
("bin": "cli.js" — implicitly named after the package) or a
map ("bin": {"foo": "cli.js"} — explicitly named). We
normalize to the map form at parse time so downstream callers
don’t have to branch: an empty map means “no bins”.
pnpm collapses this to hasBin: true on its package entries;
bun preserves the full map on its per-package meta. Keeping
the map lets us feed both writers without an extra
tarball-level re-parse.
has_install_script: bool§deprecated: Option<String>Deprecation message from the registry, if this version is deprecated.
approver: Option<Value>npm staged-publish approval metadata. When present, the resolver treats it as the strongest trust evidence because the publish went through a registry-side approval flow.
npm_user: Option<NpmUser>_npmUser block from the packument, when present. The
trust-policy check reads _npmUser.trustedPublisher as the
strongest trust-evidence signal (npm’s “trusted publishers”
feature, OIDC-backed). Some old packuments emit _npmUser as
a "name <email>" string rather than an object — that shape
degrades to None instead of failing the whole packument.
Trait Implementations§
Source§impl Clone for VersionMetadata
impl Clone for VersionMetadata
Source§fn clone(&self) -> VersionMetadata
fn clone(&self) -> VersionMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VersionMetadata
impl Debug for VersionMetadata
Source§impl<'de> Deserialize<'de> for VersionMetadata
impl<'de> Deserialize<'de> for VersionMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for VersionMetadata
impl RefUnwindSafe for VersionMetadata
impl Send for VersionMetadata
impl Sync for VersionMetadata
impl Unpin for VersionMetadata
impl UnsafeUnpin for VersionMetadata
impl UnwindSafe for VersionMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more