vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • index
    • LockfileDiffTypes
  • Type Aliases
  • Consumer
  • ContentChange
  • ContentField
  • ContentMember
  • Inconsistency
  • LockfileSide
  • Movement
  • PackageChange
  • PackageKind
  • PackageRef
  • Replacement
  • Side
  • SlotChange
  • SlotMove
  • SlotSide
  • Totals
  • Unclassified
  • VersionEntry
  • WorkspaceChange
  • WorkspaceSlot
  • References
  • LockfileDiff
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/graph
  6. /
  7. Index
  8. /
  9. Namespaces
  10. /
  11. LockfileDiffTypes

LockfileDiffTypes

Type Aliases

Consumer

TypeScript
type Consumer = PackageRef & object;

Defined in: graph/src/lockfile-diff/types.ts:269

A package whose dependency slot moved with a move.

Type declaration

NameTypeDescription
as?stringthe slot name, when it is not the package's name
outside?trueits spec is a range the new version does not satisfy
peer?truethe slot is a peer dependency on both sides
was?stringits own version on base, when it moved too

ContentChange

TypeScript
type ContentChange = object;

Defined in: graph/src/lockfile-diff/types.ts:179

One cause of content changes at ids on both sides, or between two instances of a version, and the records it changed. origin, format, dev, optional and flags groups hold their values once; any other field's values are on each member. A value is left out when its side has none, and objects have their keys sorted. Sorted by field, change, values, then storedOnly; members by id (or base), then head.

Type declaration

NameTypeDescription
change"added" | "removed" | "changed"-
fieldContentField-
from?unknown-
membersContentMember[]-
storedOnly?trueThe files differ and both load to the same value: an explicit resolved equal to the rebuilt one, a typeTarget equal to the derived one, or bin paths equal but for a leading ./.
to?unknown-

ContentField

TypeScript
type ContentField = 
  | "name"
  | "integrity"
  | "origin"
  | "format"
  | "resolved"
  | "commit"
  | "dev"
  | "optional"
  | "flags"
  | "location"
  | "platform"
  | "bins"
  | "typeTarget";

Defined in: graph/src/lockfile-diff/types.ts:145

What a content change is about:

  • a slot of the record, as stored: name, integrity, location, platform, bins, typeTarget, and flags for any other bit, or flags that are not a number
  • a flag bit: dev, optional, and format (the Brotli bit: the artifact is the tar.br tarball, else the tgz one)
  • the url the record loads to (the stored one, else the one rebuilt from the id and that side's options): origin, the part of a registry url before the package's own part; resolved, the url, when it differs in more than its origin and an extension that follows format; commit, the commit a git url pins

ContentMember

TypeScript
type ContentMember = PackageRef & 
  | {
  id: DepID;
 }
  | {
  base: DepID;
  head: DepID;
 } & object;

Defined in: graph/src/lockfile-diff/types.ts:164

A record whose content changed, with its own values if any: one id on both sides, or two instances of one version under other ids.

Type declaration

NameType
from?unknown
to?unknown

Inconsistency

TypeScript
type Inconsistency = object;

Defined in: graph/src/lockfile-diff/types.ts:199

Something one lockfile says that does not agree with itself:

  • name: a registry record stores a name (found) that is not the name in its id Sorted by side, then id.

Type declaration

NameType
foundstring
idDepID
kind"name"
packagePackageRef
side"base" | "head"

LockfileSide

TypeScript
type LockfileSide = object;

Defined in: graph/src/lockfile-diff/types.ts:11

One side of the comparison: a parsed lockfile and its graph.

Type declaration

NameType
dataLockfileData
graphGraph

Movement

TypeScript
type Movement = object;

Defined in: graph/src/lockfile-diff/types.ts:233

How two versions of one package relate.

Type declaration

NameTypeDescription
direction"up" | "down" | "other"other when the two are not registry semver versions
releaseType?ReleaseTypediff() of the two versions
withinCaret?booleanthe higher version satisfies ^<the lower one>

PackageChange

TypeScript
type PackageChange = object;

Defined in: graph/src/lockfile-diff/types.ts:308

Everything the diff says about one package: its kind and name, read from its ids. Sorted by kind (registry first), then name.

Type declaration

NameTypeDescription
kind?Exclude<PackageKind, "registry">left out for a registry package
label?stringnot a registry package: the name the lockfile stores for it
moves?SlotMove[]-
namestringthe package name; for git the remote, else the path or url
rekeyed?string[]Versions whose instances are under other ids and nothing else: as many of them, the same records, the same dependencies. Sorted by version, code-unit order.
replacements?Replacement[]-
versions?VersionEntry[]More or fewer peer variants are versions on both sides with another number of instances.

PackageKind

TypeScript
type PackageKind = "registry" | "git" | "file" | "remote" | "workspace";

Defined in: graph/src/lockfile-diff/types.ts:80

Where a package comes from, as its id says.


PackageRef

TypeScript
type PackageRef = object;

Defined in: graph/src/lockfile-diff/types.ts:90

A package at a version, read from its id. kind is left out for registry packages. name is the package name, the remote of a git package, else the path or url. version is the commit a git package is locked to (else its committish), and empty for directories, tarball urls and workspaces.

Type declaration

NameType
kind?Exclude<PackageKind, "registry">
namestring
versionstring

Replacement

TypeScript
type Replacement = Movement & object;

Defined in: graph/src/lockfile-diff/types.ts:262

A version that left, replaced by one that came. Among the versions on base only and on head only, the pair with the most dependency slots moving from one to the other pairs first, each version once (pairedBy: 'slot'); a single version left on each side then pairs only when the new one is inside the caret range of the old one (pairedBy: 'name'). Sorted by from.

Type declaration

NameType
fromstring
pairedBy"slot" | "name"
tostring

Side

TypeScript
type Side = object;

Defined in: graph/src/lockfile-diff/types.ts:20

What one side of the diff is. Filled in by whoever read the side: the diff only copies it.

Type declaration

NameTypeDescription
absentbooleanthere is no lockfile there: the side is an empty lockfile
argstringthe argument as typed, empty for a side that was implied
commit?stringthe commit a revision resolved to
kind"revision" | "worktree" | "index" | "file"- revision: the lockfile of a commit - worktree: the project's own lockfile on disk - index: a stage of the lockfile in the git index - file: a lockfile at a path
mergeBase?truethe commit is the merge base of an a...b range
path?stringa file side: the path as typed
stage?numberthe index stage, 0 to 3

SlotChange

TypeScript
type SlotChange = object;

Defined in: graph/src/lockfile-diff/types.ts:226

A dependency slot that differs between two instances: only from, removed; only to, added; both, its type, spec or target changed.

Type declaration

NameType
from?SlotSide
namestring
to?SlotSide

SlotMove

TypeScript
type SlotMove = object;

Defined in: graph/src/lockfile-diff/types.ts:289

Two instances of the package where the head one takes the place of the base one, under another id, and the dependency slots that led there. base and head are the two ids, each left out when the version entry lists one instance on that side. A move between two instances of one version is listed only when the two differ in their dependencies, or when it says which of several instances a consumer went to. Sorted by from, to, then the ids.

Type declaration

NameTypeDescription
base?DepID-
consumers?Consumer[]the packages whose slot moved, sorted by name, then version
dependencies?SlotChange[]how the two instances' own dependencies differ, sorted by name
fromstring-
head?DepID-
importers?numberindex into sets: the importers whose slot moved
movement?Movementfor two versions that are not a replacement
tostring-

SlotSide

TypeScript
type SlotSide = object;

Defined in: graph/src/lockfile-diff/types.ts:208

One side of a dependency slot.

Type declaration

NameTypeDescription
specstringthe spec as the lockfile stores it
target?PackageRefWhat the slot resolves to. Left out when both sides resolve to the same package: its version or instance change is then a move of that package, which names this slot's package as a consumer.
typeDependencyTypeShort-
unresolved?truethe lockfile records no target for it

Totals

TypeScript
type Totals = object;

Defined in: graph/src/lockfile-diff/types.ts:67

Record counts of each side, and package counts in name@version units: changed is a version replaced by another, or a version on both sides whose content changed; added and removed are the versions that entered or left and are not an end of a replacement.

Type declaration

NameTypeDescription
addednumber-
changednumber-
edgesobjectlockfile edge records
edges.basenumber-
edges.headnumber-
entriesobjectlockfile node records
entries.basenumber-
entries.headnumber-
importersobjectimporters, 0 for an absent side
importers.basenumber-
importers.headnumber-
removednumber-

Unclassified

TypeScript
type Unclassified = object;

Defined in: graph/src/lockfile-diff/types.ts:47

A difference between the two lockfiles that no entry of the result names, with the raw values. A value is left out when its side has none.

Type declaration

NameTypeDescription
base?string-
head?string-
keystringThe raw key: a top-level key, an option path (section, section key or catalogs <catalog> <dep>), a node id, a slot of a node (<id> <field>, <id> slot <i> past the known slots, or <id> padding for null slots that one side leaves out), an edge key or an importer id.
kind"lockfile" | "option" | "node" | "tuple" | "edge" | "importer"-

VersionEntry

TypeScript
type VersionEntry = object;

Defined in: graph/src/lockfile-diff/types.ts:247

A version with an instance (a lockfile record, one per peer context or modifier) on one side only, with every instance id of that version on each side, sorted. Sorted by version.

Type declaration

NameType
base?DepID[]
head?DepID[]
on"base" | "head" | "both"
versionstring

WorkspaceChange

TypeScript
type WorkspaceChange = 
  | {
  change: "added" | "removed";
  name: string;
  path: string;
  slots: WorkspaceSlot[];
 }
  | {
  change: "moved";
  from: string;
  inferred: true;
  name: string;
  slots: WorkspaceSlot[];
  to: string;
};

Defined in: graph/src/lockfile-diff/types.ts:116

An importer on one side only, or a removed and an added importer taken to be one workspace that moved. A move is inferred: the two have the same dependencies, and no other removed or added importer does. name is the importer's name when it has one other than the last segment of its path (for a move, when both sides agree on it). Sorted by path, a move by to.


WorkspaceSlot

TypeScript
type WorkspaceSlot = object;

Defined in: graph/src/lockfile-diff/types.ts:97

A dependency of an importer.

Type declaration

NameTypeDescription
namestring-
specstringthe spec as the lockfile stores it
target?PackageRefwhat the dependency resolves to
typeDependencyTypeShort-
unresolved?truethe lockfile records no target for it

References

LockfileDiff

Re-exports LockfileDiff


Previous: indexPrevious pageNext: @vltpkg/graph-runNext page

On this page

  • Type Aliases
  • Consumer
  • ContentChange
  • ContentField
  • ContentMember
  • Inconsistency
  • LockfileSide
  • Movement
  • PackageChange
  • PackageKind
  • PackageRef
  • Replacement
  • Side
  • SlotChange
  • SlotMove
  • SlotSide
  • Totals
  • Unclassified
  • VersionEntry
  • WorkspaceChange
  • WorkspaceSlot
  • References
  • LockfileDiff

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now