@vltpkg/graph
Classes
Diff
Defined in: graph/src/diff.ts:25
A Diff object is a representation of a set of changes from one graph to another, typically from the actual graph as it is reified on disk, to an intended ideal graph.
The naming convention can get a bit confusing here, because it’s a set of directed changes from one set of directed objects to another.
Within the context the Diff object, from is the Graph we’re coming
from, and to is the Graph we’re trying to create.
Constructors
new Diff()
new Diff(from, to): DiffDefined in: graph/src/diff.ts:66
Parameters
from
to
Returns
Properties
edges
edges: objectDefined in: graph/src/diff.ts:50
Collection of nodes to add and delete
add
add: Set<Edge>Edges in the to graph that are not found in the from graph
delete
delete: Set<Edge>;Edges in the from graph that are not found in the to graph
from
from: GraphDefined in: graph/src/diff.ts:26
hadOptionalFailures
hadOptionalFailures: boolean = falseDefined in: graph/src/diff.ts:35
If changes need to be made later for failures of optional nodes, set this flag so that we know to call graph.gc() at the appropriate time.
nodes
nodes: objectDefined in: graph/src/diff.ts:40
Collection of nodes to add and delete
add
add: Set<Node>Nodes in the to graph that are not in the from graph
delete
delete: Set<Node>;Nodes in the from graph that are not in the to graph
optionalOnly
optionalOnly: boolean = trueDefined in: graph/src/diff.ts:60
True if the diff only contains optional nodes (computed during construction)
projectRoot
projectRoot: stringDefined in: graph/src/diff.ts:29
to
to: GraphDefined in: graph/src/diff.ts:27
Accessors
[toStringTag]
Get Signature
get toStringTag: stringDefined in: graph/src/diff.ts:62
Returns
string
Methods
[kCustomInspect]()
kCustomInspect: stringDefined in: graph/src/diff.ts:110
Parameters
_
number
options?
InspectOptions
Returns
string
hasChanges()
hasChanges(): booleanDefined in: graph/src/diff.ts:150
Returns
boolean
toJSON()
toJSON(): objectDefined in: graph/src/diff.ts:159
Returns
object
edges
edges: objectedges.add
edges.add: object[];edges.delete
edges.delete: object[];nodes
nodes: objectnodes.add
nodes.add: object[];nodes.delete
nodes.delete: object[];Edge
Defined in: graph/src/edge.ts:10
Implements
Constructors
new Edge()
new Edge( type, spec, from, to?): EdgeDefined in: graph/src/edge.ts:48
Parameters
type
spec
from
to?
Returns
Properties
from
from: NodeDefined in: graph/src/edge.ts:31
The Node this Edge is connecting from, this is usually the dependent.
Implementation of
EdgeLike.fromspec
spec: SpecDefined in: graph/src/edge.ts:46
The defined spec value for to as parsed from the dependent metadata.
Implementation of
EdgeLike.specto?
optional to: Node;Defined in: graph/src/edge.ts:36
The node this Edge is connecting to, this is usually a direct dependency.
Implementation of
EdgeLike.totype
type: DependencyTypeShortDefined in: graph/src/edge.ts:41
What type of dependency relationship from and to nodes have.
Implementation of
EdgeLike.typeAccessors
[toStringTag]
Get Signature
get toStringTag: stringDefined in: graph/src/edge.ts:11
Returns
string
dev
Get Signature
get dev(): booleanDefined in: graph/src/edge.ts:70
This edge was defined as part of a devDependencies in package.json
Returns
boolean
name
Get Signature
get name(): stringDefined in: graph/src/edge.ts:63
The name of the dependency to as defined in the dependent metadata.
Returns
string
Implementation of
EdgeLike.nameoptional
Get Signature
get optional(): booleanDefined in: graph/src/edge.ts:74
Returns
boolean
Implementation of
EdgeLike.optionalpeer
Get Signature
get peer(): booleanDefined in: graph/src/edge.ts:78
Returns
boolean
Implementation of
EdgeLike.peerpeerOptional
Get Signature
get peerOptional(): booleanDefined in: graph/src/edge.ts:82
Returns
boolean
Methods
[kCustomInspect]()
kCustomInspect: stringDefined in: graph/src/edge.ts:15
Parameters
_
number
options
InspectOptions
Returns
string
toJSON()
toJSON(): objectDefined in: graph/src/edge.ts:97
Returns
object
from
from: DepIDspec
spec: stringto
to: undefined | DepIDtype
type: DependencyTypeShortvalid()
valid(): booleanDefined in: graph/src/edge.ts:86
Returns
boolean
Graph
Defined in: graph/src/graph.ts:79
Implements
Constructors
new Graph()
new Graph(options): GraphDefined in: graph/src/graph.ts:143
Parameters
options
Returns
Properties
edges
edges: Set<Edge>Defined in: graph/src/graph.ts:101
A set of all edges in this graph.
Implementation of
GraphLike.edgesextraneousDependencies
extraneousDependencies: Set<Edge>Defined in: graph/src/graph.ts:136
A set of extraneous dependencies found when building the graph.
importers
importers: Set<Node>Defined in: graph/src/graph.ts:126
A set of importer nodes in this graph.
Implementation of
GraphLike.importersmainImporter
mainImporter: NodeDefined in: graph/src/graph.ts:131
The Node that represents the project root package.json.
Implementation of
GraphLike.mainImportermanifests
manifests: ManifestInventoryDefined in: graph/src/graph.ts:96
An inventory with all manifests related to an install.
monorepo?
optional monorepo: Monorepo;Defined in: graph/src/graph.ts:91
A Monorepo instance, used for managing workspaces.
nodes
nodes: Map<DepID, Node>Defined in: graph/src/graph.ts:106
Map registered dep ids to the node that represent them in the graph.
Implementation of
GraphLike.nodesnodesByName
nodesByName: Map<string, Set<Node>>Defined in: graph/src/graph.ts:111
Map of nodes by their name
Implementation of
GraphLike.nodesByNameprojectRoot
projectRoot: stringDefined in: graph/src/graph.ts:141
The root of the project this graph represents
Implementation of
GraphLike.projectRootresolutions
resolutions: Map<string, Node>Defined in: graph/src/graph.ts:116
Cached resolutions for spec lookups
resolutionsReverse
resolutionsReverse: Map<Node, Set<string>>Defined in: graph/src/graph.ts:121
Reverse map of resolutions
Accessors
[toStringTag]
Get Signature
get toStringTag: stringDefined in: graph/src/graph.ts:80
Returns
string
Methods
[kCustomInspect]()
kCustomInspect: stringDefined in: graph/src/graph.ts:558
Parameters
_
number
options
InspectOptions
Returns
string
addEdge()
addEdge( type, spec, from, to?): EdgeDefined in: graph/src/graph.ts:237
Create a new edge between two nodes of the graph in case both exist, in case the destination node does not exists, then a dangling edge, pointing to nothing will be created to represent that missing dependency.
Parameters
type
spec
from
to?
Returns
Implementation of
GraphLike.addEdgeaddNode()
addNode( id?, manifest?, spec?, name?, version?): NodeDefined in: graph/src/graph.ts:318
Create a new node in the graph.
Parameters
id?
manifest?
Override<Manifest,
NormalizedFields>
spec?
name?
string
version?
string
Returns
Implementation of
GraphLike.addNodefindResolution()
findResolution( spec, fromNode, queryModifier): undefined | NodeDefined in: graph/src/graph.ts:286
Find an existing node to satisfy a dependency
Parameters
spec
fromNode
queryModifier
string = ''
Returns
undefined | Node
gc()
gc(): Map<DepID, Node>Defined in: graph/src/graph.ts:208
Delete all nodes and edges that are unreachable from the importers. The collection of deleted nodes is returned.
NOTE: This can be extremely slow for large graphs, and is almost always unnecessary! Only call when it is known that some unreachable nodes may have been created, for example when deleting the unneeded subgraph when an optional node fails to resolve/install.
Returns
placePackage()
placePackage( fromNode, depType, spec, manifest?, id?, extra?): undefined | NodeDefined in: graph/src/graph.ts:351
Place a new package into the graph representation, creating the new edges and possibly new nodes that are to be expected when traversing the graph in a top-down direction, e.g: from importers to leafs.
For different uses that are not a direct top-down traversal of the
graph consider using addNode() and addEdge() instead.
Parameters
fromNode
depType
spec
manifest?
Override<Manifest,
NormalizedFields>
id?
extra?
string
Returns
undefined | Node
removeEdgeResolution()
removeEdgeResolution(edge, queryModifier): voidDefined in: graph/src/graph.ts:487
Removes the resolved node of a given edge.
Parameters
edge
queryModifier
string = ''
Returns
void
removeNode()
removeNode( node, replacement?, keepEdges?): voidDefined in: graph/src/graph.ts:449
Removes a node and its relevant edges from the graph.
Use the keepEdges option to keep the edges that were pointing to
this node and only removes their to property value.
If a replacement is provided, then any edges that were previously pointing to the removed node will be directed to the replacement, if it is valid to do so.
Parameters
node
replacement?
keepEdges?
boolean
Returns
void
Implementation of
GraphLike.removeNoderesetResolution()
resetResolution(): voidDefined in: graph/src/graph.ts:509
Reset resolution cache data.
Returns
void
toJSON()
toJSON(): LockfileDataDefined in: graph/src/graph.ts:550
Returns
GraphModifier
Defined in: graph/src/modifiers.ts:128
Class representing loaded modifiers configuration for a project.
Instances of this class can be used as a helper to modify the graph during the graph build ideal traversal time.
const modifier = new GraphModifier(options)modifier.load(options)The tryImporter method can be used to register the initial importer
node along with any modifier that includes an importer selector, e.g:
modifier.tryImporter(graph.mainImporter)
When traversing the graph, use the tryNewDependency method to check
if a given dependency spec to the current traversed node has matching
registered modifiers, e.g:
const entries = modifier.tryNewDependency(fromNode, depSpec)
Use updateActiveEntry to update a given active modifier entry state
with the current node of the graph being traversed. e.g:
for (const entry of entries) modifier.updateActiveEntry(fromNode, entry)Constructors
new GraphModifier()
new GraphModifier(options): GraphModifierDefined in: graph/src/modifiers.ts:162
Parameters
options
Returns
Properties
activeModifiers
activeModifiers: Set<ModifierActiveEntry>Defined in: graph/src/modifiers.ts:158
A set of currently active modifiers, which are being parsed.
modifierNames
modifierNames: Set<string>Defined in: graph/src/modifiers.ts:160
A set of all modifier string values loaded from vlt.json
Accessors
config
Get Signature
get config(): GraphModifierConfigObjectDefined in: graph/src/modifiers.ts:170
Load the modifiers definitions from vlt.json, converting the result into a GraphModifierConfigObject
Returns
Methods
deregisterModifier()
deregisterModifier(modifier): voidDefined in: graph/src/modifiers.ts:414
Removes a previously registered modifier from the active entries.
Parameters
modifier
Returns
void
load()
load(options): voidDefined in: graph/src/modifiers.ts:179
Loads the modifiers defined in vlt.json into memory.
Parameters
options
Returns
void
newModifier()
newModifier(from, modifier): ModifierActiveEntryDefined in: graph/src/modifiers.ts:400
Creates a new active modifier.
Parameters
from
modifier
Returns
rollbackActiveEntries()
rollbackActiveEntries(): voidDefined in: graph/src/modifiers.ts:441
Operates in previously registered nodes and edges in order to put back in place any of the original edges that were referenced to in active (ongoing) breadcrumb parsing entries that were never completed.
This method can be used to easily rollback any pending operations once the graph traversal is done.
Returns
void
tryDependencies()
tryDependencies(from, dependencies): Map<string, ModifierActiveEntry>Defined in: graph/src/modifiers.ts:349
Returns the set of ModifierActiveEntry instances that matches the provided Dependency specs for a given node.
This method is mostly a helper to GraphModifier.tryNewDependency that handles the registered modifiers traversal lookup.
Parameters
from
dependencies
Dependency[] | Edge[]
Returns
Map<string, ModifierActiveEntry>
tryImporter()
tryImporter(importer): voidDefined in: graph/src/modifiers.ts:234
Try matching the provided node against the top-level selectors. In case a match is found it will also register the active entry modifier and update the active entry to the current importer node.
Parameters
importer
Returns
void
tryNewDependency()
tryNewDependency(from, spec): | undefined | ModifierActiveEntryDefined in: graph/src/modifiers.ts:274
Try matching the provided node and spec to the current active parsing modifier entries along with possible starting-level modifiers.
Any entries in which the breachcrumb have already reached its last
element will be prioritized, along with checking for specificity, the
complete entry with the highest specificity will be returned or just
the entry with the highest specificity if no complete entry is found.
Returns undefined if no matching entry is found.
This method works with the assumption that it’s going to be called during a graph traversal, such that any ascendent has been checked and the active modifier entry state has been updated in the previous iteration.
Parameters
from
spec
Returns
| undefined | ModifierActiveEntry
updateActiveEntry()
updateActiveEntry(from, active): voidDefined in: graph/src/modifiers.ts:368
Updates an active entry state keeping track of items in the multi-level active entries map. If the current breadcrumb state shows there’s no more items left, then we deregister the modifier.
Parameters
from
active
Returns
void
load()
static load(options): GraphModifierDefined in: graph/src/modifiers.ts:470
Convenience method to instantiate and load in one call. Throws if called on a directory that does not have a vlt.json file.
Parameters
options
Returns
maybeLoad()
static maybeLoad(options): undefined | GraphModifierDefined in: graph/src/modifiers.ts:460
Convenience method to instantiate and load in one call. Returns undefined if the project does not have a vlt.json file, otherwise returns the loaded Modifiers instance.
Parameters
options
Returns
undefined | GraphModifier
Node
Defined in: graph/src/node.ts:30
Implements
Constructors
new Node()
new Node( options, id?, manifest?, spec?, name?, version?): NodeDefined in: graph/src/node.ts:265
Parameters
options
id?
manifest?
Override<Manifest,
NormalizedFields>
spec?
name?
string
version?
string
Returns
Properties
bins?
optional bins: Record<string, string>;Defined in: graph/src/node.ts:206
Record of binary names to their paths in the package, if any.
Implementation of
NodeLike.binsbuildState
buildState: "none" | "needed" | "built" | "failed" = 'none';Defined in: graph/src/node.ts:220
Build state of this node - tracks whether it needs building, has been built, or failed.
- ‘none’: No build state (default)
- ‘needed’: Node needs to be built
- ‘built’: Node has been successfully built
- ‘failed’: Node build has failed
Implementation of
NodeLike.buildStatebuilt
built: boolean = falseDefined in: graph/src/node.ts:211
True if this node has been built as part of the reify step.
confused
confused: boolean = falseDefined in: graph/src/node.ts:93
True if there’s a manifest-confused package name.
Implementation of
NodeLike.confusededgesIn
edgesIn: Set<Edge>Defined in: graph/src/node.ts:103
List of edges coming into this node.
Implementation of
NodeLike.edgesInedgesOut
edgesOut: Map<string, Edge>Defined in: graph/src/node.ts:109
List of edges from this node into other nodes. This usually represents that the connected node is a direct dependency of this node.
Implementation of
NodeLike.edgesOutextracted
extracted: boolean = falseDefined in: graph/src/node.ts:98
True if this node has been extracted to the file system.
graph
graph: GraphDefined in: graph/src/node.ts:135
A reference to the graph this node is a part of.
Implementation of
NodeLike.graphid
id: DepIDDefined in: graph/src/node.ts:120
A reference to the DepID this node represents in the graph.
Implementation of
NodeLike.idimporter
importer: boolean = falseDefined in: graph/src/node.ts:125
True if this node is an importer node.
Implementation of
NodeLike.importerintegrity?
optional integrity: `sha512-${string}`;Defined in: graph/src/node.ts:140
The manifest integrity value.
Implementation of
NodeLike.integritymainImporter
mainImporter: boolean = falseDefined in: graph/src/node.ts:130
True if this node is the project root node.
Implementation of
NodeLike.mainImportermanifest?
optional manifest: Override<Manifest, NormalizedFields>;Defined in: graph/src/node.ts:145
The manifest this node represents in the graph.
Implementation of
NodeLike.manifestmodifier
modifier: undefined | stringDefined in: graph/src/node.ts:164
If this node has been modified as part of applying a
GraphModifier then this field will contain the
modifier query that was applied. Otherwise, it will be undefined.
Implementation of
NodeLike.modifierplatform?
optional platform: object;Defined in: graph/src/node.ts:197
Platform requirements (engines, os, cpu) extracted from manifest. Stored separately for optional dependencies to enable platform checks when manifest is not loaded.
cpu?
optional cpu: string | string[];engines?
optional engines: Record<string, string>;os?
optional os: string | string[];Implementation of
NodeLike.platformprojectRoot
projectRoot: stringDefined in: graph/src/node.ts:150
Project where this node resides
Implementation of
NodeLike.projectRootregistry?
optional registry: string;Defined in: graph/src/node.ts:157
For registry nodes, this is the registry we fetched them from. Needed because their un-prefixed dependencies need to come from the same registry, if it’s not the default.
Implementation of
NodeLike.registryresolved?
optional resolved: string;Defined in: graph/src/node.ts:190
An address PackageInfoClient may use to extract this package.
Implementation of
NodeLike.resolvedversion?
optional version: string;Defined in: graph/src/node.ts:185
The version of the package represented by this node, this is usually
equivalent to manifest.version but in a few ways it may differ such
as nodes loaded from a lockfile that lacks a loaded manifest. This
field should be used to retrieve package versions instead.
Implementation of
NodeLike.versionworkspaces
workspaces: undefined | Map<string, Edge>Defined in: graph/src/node.ts:115
A mainImporter node may have workspace connected to it, equivalent
to its edgesOut linked deps.
Implementation of
NodeLike.workspacesAccessors
[toStringTag]
Get Signature
get toStringTag: stringDefined in: graph/src/node.ts:31
Returns
string
dev
Get Signature
get dev(): booleanDefined in: graph/src/node.ts:72
True if a node is only reachable via dev edges from any importer.
Setting this to false, if previously set to true, will also unset the flag on any dev-flagged non-dev dependencies.
Returns
boolean
Set Signature
set dev(dev): voidDefined in: graph/src/node.ts:75
Parameters
dev
boolean
Returns
void
Implementation of
NodeLike.devlocation
Get Signature
get location(): stringDefined in: graph/src/node.ts:225
The file system location for this node.
Returns
string
Set Signature
set location(location): voidDefined in: graph/src/node.ts:235
Parameters
location
string
Returns
void
Implementation of
NodeLike.locationname
Get Signature
get name(): stringDefined in: graph/src/node.ts:173
Returns
string
Implementation of
NodeLike.nameoptional
Get Signature
get optional(): booleanDefined in: graph/src/node.ts:47
True if a node is only reachable via optional or peerOptional edges from any importer.
Setting this to false, if previously set to true, will also unset the flag on any optional-flagged non-optional dependencies.
Returns
boolean
Set Signature
set optional(optional): voidDefined in: graph/src/node.ts:50
Parameters
optional
boolean
Returns
void
Implementation of
NodeLike.optionaloptions
Get Signature
get options(): SpecOptionsDefined in: graph/src/node.ts:318
Returns
Set Signature
set options(_opts): voidDefined in: graph/src/node.ts:323
Parameters
_opts
Returns
void
Implementation of
NodeLike.optionsrawManifest
Get Signature
get rawManifest(): | undefined| Override<Manifest, NormalizedFields>Defined in: graph/src/node.ts:386
The raw manifest before any modifications. If not set, falls back to the current manifest.
Returns
| undefined |
Override<Manifest,
NormalizedFields>
Implementation of
NodeLike.rawManifestMethods
addEdgesTo()
addEdgesTo( type, spec, node?): EdgeDefined in: graph/src/node.ts:375
Add an edge from this node connecting it to a direct dependency.
Parameters
type
spec
node?
Returns
equals()
equals(other): booleanDefined in: graph/src/node.ts:325
Parameters
other
Returns
boolean
inVltStore()
inVltStore(): booleanDefined in: graph/src/node.ts:300
return true if this node is located in the vlt store memoized the first time it’s called, since the store location doesn’t change within the context of a single operation.
Returns
boolean
isDev()
isDev(): this is Node & { dev: true }Defined in: graph/src/node.ts:86
Returns
this is Node & { dev: true }
isOptional()
isOptional(): this is Node & { optional: true }Defined in: graph/src/node.ts:61
Returns
this is Node & { optional: true }
maybeSetConfusedManifest()
maybeSetConfusedManifest(spec, confused?): voidDefined in: graph/src/node.ts:406
Sets this node as having a manifest-confused manifest.
Parameters
spec
confused?
Override<Manifest,
NormalizedFields>
Returns
void
Implementation of
NodeLike.maybeSetConfusedManifestnodeModules()
nodeModules(scurry): stringDefined in: graph/src/node.ts:258
The location of the node_modules folder where this node’s edgesOut should be linked into. For nodes in the store, this is the parent directory, since they’re extracted into a node_modules folder side by side with links to their deps. For nodes outside of the store (ie, importers and arbitrary link deps) this is the node_modules folder directly inside the node’s directory.
Parameters
scurry
Returns
string
resolvedLocation()
resolvedLocation(scurry): stringDefined in: graph/src/node.ts:246
The resolved location of the node in the file system.
Parameters
scurry
Returns
string
setConfusedManifest()
setConfusedManifest(fixed, confused?): voidDefined in: graph/src/node.ts:393
Sets this node as having a manifest-confused manifest.
Parameters
fixed
confused?
Override<Manifest,
NormalizedFields>
Returns
void
Implementation of
NodeLike.setConfusedManifestsetDefaultLocation()
setDefaultLocation(): voidDefined in: graph/src/node.ts:358
Returns
void
setImporterLocation()
setImporterLocation(location): voidDefined in: graph/src/node.ts:332
Sets the node as an importer along with its location.
Parameters
location
string
Returns
void
setResolved()
setResolved(): voidDefined in: graph/src/node.ts:342
Sets the appropriate resolve / integrity value for this node. Note that other places might also set these values, like for example the lockfile that might have already have this info.
Returns
void
Implementation of
NodeLike.setResolvedtoJSON()
toJSON(): objectDefined in: graph/src/node.ts:421
Returns
object
buildState
buildState: 'none' | 'needed' | 'built' | 'failed'confused
confused: booleandev
dev: booleanid
id: DepIDimporter
importer: booleanintegrity
integrity: undefined | `sha512-${string}`location
location: stringmanifest
manifest: | undefined| Override<Manifest, NormalizedFields>;modifier
modifier: undefined | stringname
name: stringoptional
optional: booleanplatform
platform: | undefined | { cpu: string | string[]; engines: Record<string, string>; os: string | string[];};projectRoot
projectRoot: stringrawManifest?
optional rawManifest: Override<Manifest, NormalizedFields>;resolved
resolved: undefined | stringversion
version: undefined | stringImplementation of
NodeLike.toJSONtoString()
toString(): stringDefined in: graph/src/node.ts:446
Returns
string
Implementation of
NodeLike.toStringInterfaces
BuildOptions
Defined in: graph/src/build.ts:17
Options for the build process
Extends
Properties
catalog?
optional catalog: Record<string, string>;Defined in: spec/src/types.ts:22
Inherited from
LoadOptions.catalogcatalogs?
optional catalogs: Record<string, Record<string, string>>;Defined in: spec/src/types.ts:23
Inherited from
LoadOptions.catalogsexpectLockfile?
optional expectLockfile: boolean;Defined in: graph/src/actual/load.ts:73
If set to true, fail if lockfile is missing or out of date. Used by
ci command to enforce lockfile integrity.
Inherited from
LoadOptions.expectLockfilefrozenLockfile?
optional frozenLockfile: boolean;Defined in: graph/src/actual/load.ts:78
If set to true, fail if lockfile is missing or out of sync with
package.json. Prevents any lockfile modifications and is stricter than
expectLockfile.
Inherited from
LoadOptions.frozenLockfilegit-host-archives?
optional git-host-archives: Record<string, string>;Defined in: spec/src/types.ts:17
tarball hosting services for hosts listed in git-hosts
Inherited from
LoadOptions.git - host - archivesgit-hosts?
optional git-hosts: Record<string, string>;Defined in: spec/src/types.ts:15
shorthand prefix names for known git hosts
Inherited from
LoadOptions.git - hostsjsr-registries?
optional jsr-registries: Record<string, string>;Defined in: spec/src/types.ts:21
registries that work like https://npm.jsr.io
Inherited from
LoadOptions.jsr - registriesloadManifests?
optional loadManifests: boolean;Defined in: graph/src/actual/load.ts:58
If set to false, actual.load will not load any package.json
files while traversing the file system.
The resulting Graph from loading with loadManifests=false
has no information on dependency types or the specs defined and no
information on missing and extraneous dependencies.
Inherited from
LoadOptions.loadManifestslockfileOnly?
optional lockfileOnly: boolean;Defined in: graph/src/actual/load.ts:83
If set to true, only update the lockfile without performing any
node_modules operations. Skips package extraction, filesystem
operations, and hidden lockfile saves.
Inherited from
LoadOptions.lockfileOnlymainManifest?
optional mainManifest: Override<Manifest, NormalizedFields>;Defined in: graph/src/actual/load.ts:33
The project root manifest.
Inherited from
LoadOptions.mainManifestmodifiers?
optional modifiers: GraphModifier;Defined in: graph/src/actual/load.ts:37
The graph modifiers helper object.
Inherited from
LoadOptions.modifiersmonorepo?
optional monorepo: Monorepo;Defined in: graph/src/build.ts:21
Optional monorepo configuration. If not provided, will attempt to load from project.
Overrides
LoadOptions.monorepopackageJson
packageJson: PackageJsonDefined in: graph/src/actual/load.ts:45
A PackageJson object, for sharing manifest caches
Inherited from
LoadOptions.packageJsonprojectRoot
projectRoot: stringDefined in: graph/src/actual/load.ts:29
The project root dirname.
Inherited from
LoadOptions.projectRootregistries?
optional registries: Record<string, string>;Defined in: spec/src/types.ts:13
shorthand prefix names for known registries
Inherited from
LoadOptions.registriesregistry?
optional registry: string;Defined in: spec/src/types.ts:11
the registry where a spec should be resolved against
Inherited from
LoadOptions.registryscope-registries?
optional scope-registries: Record<`@${string}`, string>;Defined in: spec/src/types.ts:19
registries mapped to a @scope
Inherited from
LoadOptions.scope - registriesscurry
scurry: PathScurryDefined in: graph/src/actual/load.ts:49
A PathScurry object, for use in globs
Inherited from
LoadOptions.scurryskipHiddenLockfile?
optional skipHiddenLockfile: boolean;Defined in: graph/src/actual/load.ts:63
If set to true, then do not shortcut the process by reading the
hidden lockfile at node_modules/.vlt-lock.json
Inherited from
LoadOptions.skipHiddenLockfileskipLoadingNodesOnModifiersChange?
optional skipLoadingNodesOnModifiersChange: boolean;Defined in: graph/src/actual/load.ts:67
Load only importers into the graph if the modifiers have changed.
Inherited from
LoadOptions.skipLoadingNodesOnModifiersChangetarget
target: stringDefined in: graph/src/build.ts:25
DSS query string to filter which nodes to build.
Type Aliases
ActualLoadOptions
type ActualLoadOptions = SpecOptions & objectDefined in: graph/src/actual/load.ts:25
Type declaration
expectLockfile?
optional expectLockfile: boolean;If set to true, fail if lockfile is missing or out of date. Used by
ci command to enforce lockfile integrity.
frozenLockfile?
optional frozenLockfile: boolean;If set to true, fail if lockfile is missing or out of sync with
package.json. Prevents any lockfile modifications and is stricter than
expectLockfile.
loadManifests?
optional loadManifests: boolean;If set to false, actual.load will not load any package.json
files while traversing the file system.
The resulting Graph from loading with loadManifests=false
has no information on dependency types or the specs defined and no
information on missing and extraneous dependencies.
lockfileOnly?
optional lockfileOnly: boolean;If set to true, only update the lockfile without performing any
node_modules operations. Skips package extraction, filesystem
operations, and hidden lockfile saves.
mainManifest?
optional mainManifest: NormalizedManifest;The project root manifest.
modifiers?
optional modifiers: GraphModifier;The graph modifiers helper object.
monorepo?
optional monorepo: Monorepo;A Monorepo object, for managing workspaces
packageJson
packageJson: PackageJsonA PackageJson object, for sharing manifest caches
projectRoot
projectRoot: stringThe project root dirname.
scurry
scurry: PathScurryA PathScurry object, for use in globs
skipHiddenLockfile?
optional skipHiddenLockfile: boolean;If set to true, then do not shortcut the process by reading the
hidden lockfile at node_modules/.vlt-lock.json
skipLoadingNodesOnModifiersChange?
optional skipLoadingNodesOnModifiersChange: boolean;Load only importers into the graph if the modifiers have changed.
AddImportersDependenciesMap
type AddImportersDependenciesMap = Map< DepID, Map<string, Dependency>> & objectDefined in: graph/src/dependencies.ts:75
A Map in which keys are DepID
linking to another Map in which keys are the dependency names and
values are Dependency. This structure represents
dependencies that need to be added to the importer represented by
DepID.
The modifiedDependencies property can be used to indicate that there
are added dependencies to any of the importer nodes.
Type declaration
modifiedDependencies
modifiedDependencies: booleanBaseModifierEntry
type BaseModifierEntry = objectDefined in: graph/src/modifiers.ts:39
Info needed to define a graph modifier.
Type declaration
breadcrumb
breadcrumb: ModifierBreadcrumbquery
query: stringrefs
refs: Set<{ from: Node name: string}>type
type: 'edge' | 'node'value
value: | string | NormalizedManifest;BuildIdealOptions
type BuildIdealOptions = ActualLoadOptions & objectDefined in: graph/src/ideal/build.ts:19
Type declaration
actual?
optional actual: Graph;An actual graph
add?
optional add: AddImportersDependenciesMap;A Map in which keys are DepID
linking to another Map in which keys are the dependency names and
values are Dependency. This structure represents
dependencies that need to be added to the importer represented by
DepID.
packageInfo
packageInfo: PackageInfoClientA PackageInfoClient instance to read manifest info from.
remove?
optional remove: RemoveImportersDependenciesMap;A Map object representing nodes to be removed from the ideal graph.
Each DepID key represents an
importer node and the Set of dependency names to be removed from its
dependency list.
remover
remover: RollbackRemoveA RollbackRemove instance to handle extraction rollbacks
BuildResult
type BuildResult = objectDefined in: graph/src/reify/build.ts:19
Returns an object mapping registries to the names of the packages built.
Type declaration
failure
failure: Node[];success
success: Node[];Dependency
type Dependency = objectDefined in: graph/src/dependencies.ts:54
Parsed dependency entries info.
Type declaration
spec
spec: SpecThe parsed Spec object describing the dependency requirements.
type
type: DependencySaveTypeThe DependencySaveType, describing the way this dependency should be saved back to the manifest.
EdgeMap
type EdgeMap = Map<NodeLike | undefined, TreeItem>Defined in: graph/src/visualization/human-readable-output.ts:39
EdgeModifierEntry
type EdgeModifierEntry = BaseModifierEntry & objectDefined in: graph/src/modifiers.ts:53
Extra info to define specifically a graph edge modifier.
Type declaration
spec
spec: Spectype
type: 'edge'value
value: stringGraphModifierConfigObject
type GraphModifierConfigObject = Record<string, string>Defined in: graph/src/modifiers.ts:34
Type definition for the modifiers configuration object
GraphModifierLoadedConfig
type GraphModifierLoadedConfig = objectDefined in: graph/src/modifiers.ts:26
Loaded modifiers configuration as described in the vlt.json file.
Type declaration
modifiers
modifiers: GraphModifierConfigObjectGraphOptions
type GraphOptions = SpecOptions & objectDefined in: graph/src/graph.ts:60
Type declaration
mainManifest
mainManifest: NormalizedManifestThe main importer manifest info.
manifests?
optional manifests: ManifestInventory;An inventory of seen manifests.
monorepo?
optional monorepo: Monorepo;A Monorepo object, for managing workspaces
projectRoot
projectRoot: stringRoot of the project this graph represents
HumanReadableOutputGraph
type HumanReadableOutputGraph = objectDefined in: graph/src/visualization/human-readable-output.ts:32
Type declaration
edges
edges: EdgeLike[];highlightSelection?
optional highlightSelection: boolean;importers
importers: Set<NodeLike>nodes
nodes: NodeLike[];InstallOptions
type InstallOptions = ActualLoadOptions & objectDefined in: graph/src/install.ts:25
Type declaration
allowScripts
allowScripts: stringcleanInstall?
optional cleanInstall: boolean;packageInfo
packageInfo: PackageInfoClientJSONOutputGraph
type JSONOutputGraph = objectDefined in: graph/src/visualization/json-output.ts:35
Type declaration
edges
edges: EdgeLike[];importers
importers: Set<NodeLike>JSONOutputItem
type JSONOutputItem = objectDefined in: graph/src/visualization/json-output.ts:8
A JSON output item describes a package that is present in the install graph. It represents an edge plus it’s linking Node.
Type declaration
fromID?
optional fromID: DepID;A reference to the id of the Node that this package is linked from.
name
name: stringThe name of the package.
overridden
overridden: booleanWhether this edge was overridden by a graph modifier.
spec?
optional spec: string;The dependency spec definition for this package.
to?
optional to: NodeLike;A representation of the package object that fulfills this dependency.
type?
optional type: EdgeLike["type"];The package type.
LockfileBuildState
type LockfileBuildState = undefined | 1 | 2 | 3Defined in: graph/src/lockfile/types.ts:70
Build state for a node - tracks whether it needs building, has been built, or failed
LockfileData
type LockfileData = objectDefined in: graph/src/lockfile/types.ts:26
This is the main type definition for the contents of the
vlt-lock.json file.
The nodes and edges information from the lockfile are used to reconstruct a Graph representing a previous install.
Type declaration
edges
edges: LockfileEdgeslockfileVersion
lockfileVersion: numbernodes
nodes: Record<DepID, LockfileNode>options
options: SpecOptions & objectType declaration
modifiers?
optional modifiers: Record<string, string>;LockfileEdgeKey
type LockfileEdgeKey = `${DepID} ${string}`Defined in: graph/src/lockfile/types.ts:132
${from} ${dep name}
LockfileEdges
type LockfileEdges = objectDefined in: graph/src/lockfile/types.ts:127
Lockfile edges are stored as a record object where the key is
${from.id} ${spec.name} and the value is
${type} ${spec.bareSpec} ${to.id | 'MISSING'}
Storing them in a record like this means that we are guaranteed to
never end up with duplicates, and a standard JSON.stringify() will
nicely print them out one line per edge.
Index Signature
[key: | `·${string}·${string}·${string} ${string}` | `git·${string}·${string}·${string} ${string}` | `·${string}·${string} ${string}` | `git·${string}·${string} ${string}` | `file·${string}·${string} ${string}` | `remote·${string}·${string} ${string}` | `workspace·${string}·${string} ${string}` | `file·${string} ${string}` | `remote·${string} ${string}` | `workspace·${string} ${string}`]: | `dev ${string} ·${string}·${string}·${string}` | `dev ${string} git·${string}·${string}·${string}` | `dev ${string} ·${string}·${string}` | `dev ${string} git·${string}·${string}` | `dev ${string} file·${string}·${string}` | `dev ${string} remote·${string}·${string}` | `dev ${string} workspace·${string}·${string}` | `dev ${string} file·${string}` | `dev ${string} remote·${string}` | `dev ${string} workspace·${string}` | `dev ${string} MISSING` | `optional ${string} ·${string}·${string}·${string}` | `optional ${string} git·${string}·${string}·${string}` | `optional ${string} ·${string}·${string}` | `optional ${string} git·${string}·${string}` | `optional ${string} file·${string}·${string}` | `optional ${string} remote·${string}·${string}` | `optional ${string} workspace·${string}·${string}` | `optional ${string} file·${string}` | `optional ${string} remote·${string}` | `optional ${string} workspace·${string}` | `optional ${string} MISSING` | `peer ${string} ·${string}·${string}·${string}` | `peer ${string} git·${string}·${string}·${string}` | `peer ${string} ·${string}·${string}` | `peer ${string} git·${string}·${string}` | `peer ${string} file·${string}·${string}` | `peer ${string} remote·${string}·${string}` | `peer ${string} workspace·${string}·${string}` | `peer ${string} file·${string}` | `peer ${string} remote·${string}` | `peer ${string} workspace·${string}` | `peer ${string} MISSING` | `peerOptional ${string} ·${string}·${string}·${string}` | `peerOptional ${string} git·${string}·${string}·${string}` | `peerOptional ${string} ·${string}·${string}` | `peerOptional ${string} git·${string}·${string}` | `peerOptional ${string} file·${string}·${string}` | `peerOptional ${string} remote·${string}·${string}` | `peerOptional ${string} workspace·${string}·${string}` | `peerOptional ${string} file·${string}` | `peerOptional ${string} remote·${string}` | `peerOptional ${string} workspace·${string}` | `peerOptional ${string} MISSING` | `prod ${string} ·${string}·${string}·${string}` | `prod ${string} git·${string}·${string}·${string}` | `prod ${string} ·${string}·${string}` | `prod ${string} git·${string}·${string}` | `prod ${string} file·${string}·${string}` | `prod ${string} remote·${string}·${string}` | `prod ${string} workspace·${string}·${string}` | `prod ${string} file·${string}` | `prod ${string} remote·${string}` | `prod ${string} workspace·${string}` | `prod ${string} MISSING`LockfileEdgeValue
type LockfileEdgeValue = `${DependencyTypeShort} ${Spec['bareSpec']} ${DepID | 'MISSING'}`Defined in: graph/src/lockfile/types.ts:135
${type} ${spec} ${to}
LockfileLoadOptions
type LockfileLoadOptions = SpecOptions & objectDefined in: graph/src/lockfile/load.ts:14
Type declaration
actual?
optional actual: Graph;An optional Graph object to hydrate extra data from.
mainManifest
mainManifest: NormalizedManifestThe project root manifest.
modifiers?
optional modifiers: GraphModifier;The graph modifiers helper object.
monorepo?
optional monorepo: Monorepo;A Monorepo object, for managing workspaces
packageJson?
optional packageJson: PackageJson;A PackageJson object, for sharing manifest caches
projectRoot
projectRoot: stringThe project root dirname.
scurry?
optional scurry: PathScurry;A PathScurry object, for use in globs
skipLoadingNodesOnModifiersChange?
optional skipLoadingNodesOnModifiersChange: boolean;Load only importers into the graph if the modifiers have changed.
LockfileNode
type LockfileNode = [ LockfileNodeFlags, string | null, Integrity | null, string | null, string | null, NormalizedManifest | null, NormalizedManifest | null, LockfilePlatform | null, Record<string, string> | null, LockfileBuildState | null,]Defined in: graph/src/lockfile/types.ts:105
Lockfile representation of a node from the install graph.
LockfileNodeFlags
type LockfileNodeFlags = 0 | 1 | 2 | 3Defined in: graph/src/lockfile/types.ts:57
Bit flags indicating whether a node is optional and/or dev.
LockfilePlatform
type LockfilePlatform = objectDefined in: graph/src/lockfile/types.ts:13
Platform requirements for a lockfile node
Type declaration
cpu?
optional cpu: string[] | string;engines?
optional engines: Record<string, string>;os?
optional os: string[] | string;ManifestInventory
type ManifestInventory = Map<DepID, NormalizedManifest>Defined in: graph/src/graph.ts:30
MermaidOutputGraph
type MermaidOutputGraph = objectDefined in: graph/src/visualization/mermaid-output.ts:6
Type declaration
edges
edges: EdgeLike[];importers
importers: Set<NodeLike>nodes
nodes: NodeLike[];ModifierActiveEntry
type ModifierActiveEntry = objectDefined in: graph/src/modifiers.ts:78
An object to track modifiers that have matched an initial part of the breadcrumb. It holds pointers to both nodes and edges matched in the current traversed graph on top of the modifier info and the breadcrumb state that is used to track the current state of the parsing.
Type declaration
interactiveBreadcrumb
interactiveBreadcrumb: ModifierInteractiveBreadcrumbThe breadcrumb that is used to track the current state of the parsing.
modifiedEdge?
optional modifiedEdge: Edge;The modified edge that is being used to replace the original edge.
modifier
modifier: ModifierEntryThe modifier this active entry is working with.
originalEdge?
optional originalEdge: Edge;The original edge that is being replaced with this entry.
originalFrom
originalFrom: NodeThe first node to be affected by this modifier.
ModifierEntry
type ModifierEntry = EdgeModifierEntry | NodeModifierEntryDefined in: graph/src/modifiers.ts:70
A graph modifier entry, which can be either an edge or a node modifier.
NodeModifierEntry
type NodeModifierEntry = BaseModifierEntry & objectDefined in: graph/src/modifiers.ts:62
Extra info to define the graph node modifier.
Type declaration
manifest
manifest: NormalizedManifesttype
type: 'node'NodeOptions
type NodeOptions = SpecOptions & objectDefined in: graph/src/node.ts:25
Type declaration
graph
graph: GraphLikeprojectRoot
projectRoot: stringRawDependency
type RawDependency = objectDefined in: graph/src/dependencies.ts:44
Dependency entries info as defined in a package.json file.
Type declaration
bareSpec
bareSpec: stringname
name: stringregistry?
optional registry: string;type
type: DependencyTypeLongReifyOptions
type ReifyOptions = ActualLoadOptions & objectDefined in: graph/src/reify/index.ts:89
Type declaration
actual?
optional actual: Graph;add?
optional add: AddImportersDependenciesMap;allowScripts
allowScripts: stringgraph
graph: Graphmodifiers?
optional modifiers: GraphModifier;packageInfo
packageInfo: PackageInfoClientremove?
optional remove: RemoveImportersDependenciesMap;remover
remover: RollbackRemoveRemoveImportersDependenciesMap
type RemoveImportersDependenciesMap = Map<DepID, Set<string>> & objectDefined in: graph/src/dependencies.ts:88
A Map object representing nodes to be removed from the ideal graph.
Each DepID key represents an
importer node and the Set of dependency names to be removed from its
dependency list.
The modifiedDependencies property can be used to indicate that there
are added dependencies to any of the importer nodes.
Type declaration
modifiedDependencies
modifiedDependencies: booleanSaveOptions
type SaveOptions = SpecOptions & objectDefined in: graph/src/lockfile/save.ts:31
Type declaration
graph
graph: GraphThe graph to be stored in the lockfile.
modifiers?
optional modifiers: GraphModifier;The graph modifiers helper object.
saveBuildData?
optional saveBuildData: boolean;Should it save build state data in the lockfile?
saveManifests?
optional saveManifests: boolean;Should it save manifest data in the lockfile?
TreeItem
type TreeItem = objectDefined in: graph/src/visualization/human-readable-output.ts:20
Type declaration
edge
edge: EdgeLike | undefinedhasSibling
hasSibling: booleaninclude
include: booleanname?
optional name: string | null;node
node: NodeLike | undefinedpadding
padding: stringparent
parent: TreeItem | undefinedprefix
prefix: stringseen
seen: booleanTreeMap
type TreeMap = Map<EdgeLike | undefined, EdgeMap>Defined in: graph/src/visualization/human-readable-output.ts:41
UninstallOptions
type UninstallOptions = ActualLoadOptions & objectDefined in: graph/src/uninstall.ts:12
Type declaration
allowScripts
allowScripts: stringpackageInfo
packageInfo: PackageInfoClientUpdateOptions
type UpdateOptions = ActualLoadOptions & objectDefined in: graph/src/update.ts:14
Type declaration
allowScripts
allowScripts: stringpackageInfo
packageInfo: PackageInfoClientVariables
actual
const actual: objectDefined in: graph/src/index.ts:20
Type declaration
load()
load: options => (Graph = actualLoad)Read the file system looking for node_modules folders and returns a
new Graph that represents the relationship between the
dependencies found.
Parameters
options
Returns
BuildStateBuilt
const BuildStateBuilt: 2 = 2Defined in: graph/src/lockfile/types.ts:64
BuildStateFailed
const BuildStateFailed: 3 = 3Defined in: graph/src/lockfile/types.ts:65
BuildStateNeeded
const BuildStateNeeded: 1 = 1Defined in: graph/src/lockfile/types.ts:63
BuildStateNone
const BuildStateNone: undefined = undefinedDefined in: graph/src/lockfile/types.ts:62
Build state constants for lockfile nodes
ideal
const ideal: objectDefined in: graph/src/index.ts:40
Type declaration
build()
build: options => Promise<Graph>Builds an ideal Graph representing the dependencies that
should be present in order to fulfill the requirements defined by the
package.json and vlt-lock.json files using either the virtual or
actual graph as a starting point. Also add / remove any dependencies
listed in the add and remove properties.
Parameters
options
Returns
Promise<Graph>
lockfile
const lockfile: objectDefined in: graph/src/index.ts:27
Type declaration
load()
load: options => (Graph = lockfileLoad)Parameters
options
Returns
loadEdges()
loadEdges: (graph, edges, options) => void;Parameters
graph
edges
options
Returns
void
loadNodes()
loadNodes: (graph, nodes, options, actual?) => void;Parameters
graph
nodes
Record<DepID,
LockfileNode>
options
actual?
Returns
void
save()
save: (options) => void;Parameters
options
Omit<SaveOptions, "saveManifests">
Returns
void
LockfileNodeFlagDev
const LockfileNodeFlagDev: 2 = 2Defined in: graph/src/lockfile/types.ts:51
LockfileNodeFlagDevOptional
const LockfileNodeFlagDevOptional: 3 = 3Defined in: graph/src/lockfile/types.ts:52
LockfileNodeFlagNone
const LockfileNodeFlagNone: 0 = 0Defined in: graph/src/lockfile/types.ts:49
LockfileNodeFlagOptional
const LockfileNodeFlagOptional: 1 = 1Defined in: graph/src/lockfile/types.ts:50
VIRTUAL_ROOT_ID
const VIRTUAL_ROOT_ID: DepIDDefined in: graph/src/virtual-root.ts:9
An unique DepID to identify the virtual root node.
Functions
asDependency()
function asDependency(obj): DependencyDefined in: graph/src/dependencies.ts:104
Parameters
obj
unknown
Returns
asDependencyTypeShort()
function asDependencyTypeShort(obj): DependencyTypeShortDefined in: graph/src/dependencies.ts:29
Parameters
obj
unknown
Returns
asNode()
function asNode(value): NodeDefined in: graph/src/node.ts:461
Parameters
value
unknown
Returns
build()
function build(options): Promise<BuildResult>Defined in: graph/src/build.ts:73
Build the project based on actual graph state and build state from lockfile
This function:
- Loads the actual graph from node_modules
- Loads build data from lockfile and transfers it to the actual graph
- Constructs a Diff object representing what needs to be built
- Filters nodes based on buildState === ‘needed’
- Calls the reify build process with the constructed diff
- Persists build results to lockfile
Parameters
options
Returns
Promise<BuildResult>
createVirtualRoot()
function createVirtualRoot( name, options, mainImporters,): undefined | NodeLikeDefined in: graph/src/virtual-root.ts:22
A virtual root used to aggregate multiple importers into a single graph.
This is meant to be used with visual tools that want a single root node starting point to represent the graph.
Returns undefined if a virtual root is not needed.
Parameters
name
string = 'virtual-root'
options
mainImporters
NodeLike[]
Returns
undefined | NodeLike
generateShortId()
function generateShortId(index): stringDefined in: graph/src/visualization/mermaid-output.ts:24
Generates a short identifier for a given index following the pattern: 0 -> a, 1 -> b, …, 25 -> z, 26 -> A, …, 51 -> Z, 52 -> aa, 53 -> ab, etc. This implements a bijective base-52 numbering system where a-z = 0-25, A-Z = 26-51
Parameters
index
number
Returns
string
getBooleanFlagsFromNum()
function getBooleanFlagsFromNum(flags): objectDefined in: graph/src/lockfile/types.ts:44
Parameters
flags
Returns
object
dev
dev: booleanoptional
optional: booleangetBuildStateFromNode()
function getBuildStateFromNode(node): LockfileBuildStateDefined in: graph/src/lockfile/types.ts:72
Parameters
node
buildState?
"none" | "needed" | "built" | "failed"
Returns
getBuildStateFromNum()
function getBuildStateFromNum( state,): 'none' | 'needed' | 'built' | 'failed'Defined in: graph/src/lockfile/types.ts:87
Parameters
state
Returns
"none" | "needed" | "built" | "failed"
getDependencies()
function getDependencies(node, options): Map<string, Dependency>Defined in: graph/src/dependencies.ts:192
Retrieves a map of all dependencies, of all types, that can be inferred from a given node manifest, including missing dependencies.
Parameters
node
options
Returns
Map<string, Dependency>
getFlagNumFromNode()
function getFlagNumFromNode(node): 0 | 1 | 2 | 3Defined in: graph/src/lockfile/types.ts:35
Parameters
node
dev?
boolean
optional?
boolean
Returns
0 | 1 | 2 | 3
getRawDependencies()
function getRawDependencies(node): Map<string, RawDependency>Defined in: graph/src/dependencies.ts:145
Parameters
node
Returns
Map<string, RawDependency>
humanReadableOutput()
function humanReadableOutput(options, __namedParameters): stringDefined in: graph/src/visualization/human-readable-output.ts:112
Returns a human-readable output of the graph.
Parameters
options
__namedParameters
colors?
boolean
Returns
string
install()
function install( options, add?,): Promise< | { buildQueue: undefined diff: undefined graph: Graph } | { buildQueue: undefined | DepID[] diff: Diff graph: Graph }>Defined in: graph/src/install.ts:31
Parameters
options
add?
Returns
Promise< | { buildQueue: undefined; diff: undefined;
graph: Graph; } | { buildQueue: undefined |
DepID[]; diff: Diff;
graph: Graph; }>
isDependency()
function isDependency(o): o is DependencyDefined in: graph/src/dependencies.ts:97
Parameters
o
unknown
Returns
o is Dependency
isDependencySaveType()
function isDependencySaveType(obj): obj is DependencyTypeShortDefined in: graph/src/dependencies.ts:23
Parameters
obj
unknown
Returns
obj is DependencyTypeShort
isDependencyTypeShort()
function isDependencyTypeShort(obj): obj is DependencyTypeShortDefined in: graph/src/dependencies.ts:18
Parameters
obj
unknown
Returns
obj is DependencyTypeShort
isNode()
function isNode(value): value is NodeDefined in: graph/src/node.ts:451
Parameters
value
unknown
Returns
value is Node
jsonOutput()
function jsonOutput(__namedParameters): JSONOutputItem[]Defined in: graph/src/visualization/json-output.ts:43
Returns a JSON string representation of the graph.
Parameters
__namedParameters
Returns
mermaidOutput()
function mermaidOutput(__namedParameters): stringDefined in: graph/src/visualization/mermaid-output.ts:132
Returns a mermaid string representation of the graph.
Parameters
__namedParameters
Returns
string
reify()
function reify(options): Promise<ReifyResult>Defined in: graph/src/reify/index.ts:115
Make the current project match the supplied graph.
Parameters
options
Returns
Promise<ReifyResult>
shorten()
function shorten(typeLong, name?, manifest?): DependencyTypeShortDefined in: graph/src/dependencies.ts:114
Get the DependencyTypeShort from a DependencyTypeLong.
Parameters
typeLong
name?
string
manifest?
null | Pick<Manifest,
"peerDependenciesMeta">
Returns
stringifyNode()
function stringifyNode(node?): stringDefined in: graph/src/stringify-node.ts:4
Parameters
node?
Returns
string
uninstall()
function uninstall( options, remove?,): Promise< | { diff: undefined graph: Graph } | { diff: ReifyResult graph: Graph }>Defined in: graph/src/uninstall.ts:17
Parameters
options
remove?
RemoveImportersDependenciesMap
Returns
Promise< | { diff: undefined; graph: Graph; }
| { diff: ReifyResult; graph: Graph; }>
update()
function update(options): Promise<{ buildQueue: undefined | DepID[] diff: Diff graph: Graph}>Defined in: graph/src/update.ts:19
Parameters
options
Returns
Promise<{ buildQueue: undefined |
DepID[]; diff: Diff;
graph: Graph; }>