LockfileDiffTypes
Type Aliases
Consumer
type Consumer = PackageRef & object;Defined in: graph/src/lockfile-diff/types.ts:269
A package whose dependency slot moved with a move.
Type declaration
| Name | Type | Description |
|---|---|---|
as? | string | the slot name, when it is not the package's name |
outside? | true | its spec is a range the new version does not satisfy |
peer? | true | the slot is a peer dependency on both sides |
was? | string | its own version on base, when it moved too |
ContentChange
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
| Name | Type | Description |
|---|---|---|
change | "added" | "removed" | "changed" | - |
field | ContentField | - |
from? | unknown | - |
members | ContentMember[] | - |
storedOnly? | true | The 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
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, andflagsfor any other bit, or flags that are not a number - a flag bit:
dev,optional, andformat(the Brotli bit: the artifact is thetar.brtarball, else thetgzone) - 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 followsformat;commit, the commit a git url pins
ContentMember
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
| Name | Type |
|---|---|
from? | unknown |
to? | unknown |
Inconsistency
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 byside, thenid.
Type declaration
| Name | Type |
|---|---|
found | string |
id | DepID |
kind | "name" |
package | PackageRef |
side | "base" | "head" |
LockfileSide
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
| Name | Type |
|---|---|
data | LockfileData |
graph | Graph |
Movement
type Movement = object;Defined in: graph/src/lockfile-diff/types.ts:233
How two versions of one package relate.
Type declaration
| Name | Type | Description |
|---|---|---|
direction | "up" | "down" | "other" | other when the two are not registry semver versions |
releaseType? | ReleaseType | diff() of the two versions |
withinCaret? | boolean | the higher version satisfies ^<the lower one> |
PackageChange
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
| Name | Type | Description |
|---|---|---|
kind? | Exclude<PackageKind, "registry"> | left out for a registry package |
label? | string | not a registry package: the name the lockfile stores for it |
moves? | SlotMove[] | - |
name | string | the 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
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
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
| Name | Type |
|---|---|
kind? | Exclude<PackageKind, "registry"> |
name | string |
version | string |
Replacement
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
| Name | Type |
|---|---|
from | string |
pairedBy | "slot" | "name" |
to | string |
Side
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
| Name | Type | Description |
|---|---|---|
absent | boolean | there is no lockfile there: the side is an empty lockfile |
arg | string | the argument as typed, empty for a side that was implied |
commit? | string | the 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? | true | the commit is the merge base of an a...b range |
path? | string | a file side: the path as typed |
stage? | number | the index stage, 0 to 3 |
SlotChange
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
SlotMove
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
| Name | Type | Description |
|---|---|---|
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 |
from | string | - |
head? | DepID | - |
importers? | number | index into sets: the importers whose slot moved |
movement? | Movement | for two versions that are not a replacement |
to | string | - |
SlotSide
type SlotSide = object;Defined in: graph/src/lockfile-diff/types.ts:208
One side of a dependency slot.
Type declaration
| Name | Type | Description |
|---|---|---|
spec | string | the spec as the lockfile stores it |
target? | PackageRef | What 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. |
type | DependencyTypeShort | - |
unresolved? | true | the lockfile records no target for it |
Totals
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
| Name | Type | Description |
|---|---|---|
added | number | - |
changed | number | - |
edges | object | lockfile edge records |
edges.base | number | - |
edges.head | number | - |
entries | object | lockfile node records |
entries.base | number | - |
entries.head | number | - |
importers | object | importers, 0 for an absent side |
importers.base | number | - |
importers.head | number | - |
removed | number | - |
Unclassified
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
| Name | Type | Description |
|---|---|---|
base? | string | - |
head? | string | - |
key | string | The 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
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
WorkspaceChange
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
type WorkspaceSlot = object;Defined in: graph/src/lockfile-diff/types.ts:97
A dependency of an importer.
Type declaration
| Name | Type | Description |
|---|---|---|
name | string | - |
spec | string | the spec as the lockfile stores it |
target? | PackageRef | what the dependency resolves to |
type | DependencyTypeShort | - |
unresolved? | true | the lockfile records no target for it |
References
LockfileDiff
Re-exports LockfileDiff