#[non_exhaustive]pub enum Lockfile {
V9 {
importers: HashMap<String, Importer>,
snapshots: HashMap<String, Snapshot>,
},
}Expand description
A subset of the pnpm-lock.yaml file format.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V9
Only supports version 9.0 currently, though apparently versions are backwards compatible? https://github.com/orgs/pnpm/discussions/6857
Fields
importers: HashMap<String, Importer>Importers describe the packages in the workspace and their resolved dependencies.
The key is a relative path to the directory containing the package.json, e.g.: “packages/foo”, or “.” for the workspace root.
snapshots: HashMap<String, Snapshot>Snapshots describe the packages in the store (e.g. from the registry) and their resolved dependencies.
The key is the package name and qualified version, e.g.: “foo@1.2.3”, “bar@4.5.6(peer@7.8.9)”, and so on (pnpm code refers to this as the “depPath”).
Note that this key also currently serves as the directory entry in the virtual store, e.g. “node_modules/.pnpm/{key}”, see: https://pnpm.io/how-peers-are-resolved
Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn read_from_workspace_dir(workspace_dir: &Path) -> Result<Self>
pub fn read_from_workspace_dir(workspace_dir: &Path) -> Result<Self>
Read the content of a pnpm-lock.yaml file.
§Errors
Error::ReadLockfile, if thepnpm-lock.yamlfile cannot be read from the provided workspace directory.Error::ParseLockfile, if the data cannot be parsed as aLockfile.
Sourcepub fn from_slice(data: &[u8]) -> Result<Self>
pub fn from_slice(data: &[u8]) -> Result<Self>
Parse the content of a pnpm-lock.yaml file.
§Errors
Error::ParseLockfile, if the data cannot be parsed as aLockfile.