@vltpkg/graph 1.0.0-rc.2 → 1.0.0-rc.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -22
- package/package.json +51 -63
- package/dist/esm/actual/load.d.ts +0 -100
- package/dist/esm/actual/load.d.ts.map +0 -1
- package/dist/esm/actual/load.js +0 -304
- package/dist/esm/actual/load.js.map +0 -1
- package/dist/esm/browser.d.ts +0 -15
- package/dist/esm/browser.d.ts.map +0 -1
- package/dist/esm/browser.js +0 -17
- package/dist/esm/browser.js.map +0 -1
- package/dist/esm/build.d.ts +0 -29
- package/dist/esm/build.d.ts.map +0 -1
- package/dist/esm/build.js +0 -79
- package/dist/esm/build.js.map +0 -1
- package/dist/esm/dependencies.d.ts +0 -66
- package/dist/esm/dependencies.d.ts.map +0 -1
- package/dist/esm/dependencies.js +0 -112
- package/dist/esm/dependencies.js.map +0 -1
- package/dist/esm/diff.d.ts +0 -116
- package/dist/esm/diff.d.ts.map +0 -1
- package/dist/esm/diff.js +0 -148
- package/dist/esm/diff.js.map +0 -1
- package/dist/esm/edge.d.ts +0 -46
- package/dist/esm/edge.d.ts.map +0 -1
- package/dist/esm/edge.js +0 -74
- package/dist/esm/edge.js.map +0 -1
- package/dist/esm/graph.d.ts +0 -133
- package/dist/esm/graph.d.ts.map +0 -1
- package/dist/esm/graph.js +0 -407
- package/dist/esm/graph.js.map +0 -1
- package/dist/esm/ideal/add-nodes.d.ts +0 -34
- package/dist/esm/ideal/add-nodes.d.ts.map +0 -1
- package/dist/esm/ideal/add-nodes.js +0 -39
- package/dist/esm/ideal/add-nodes.js.map +0 -1
- package/dist/esm/ideal/append-nodes.d.ts +0 -19
- package/dist/esm/ideal/append-nodes.d.ts.map +0 -1
- package/dist/esm/ideal/append-nodes.js +0 -289
- package/dist/esm/ideal/append-nodes.js.map +0 -1
- package/dist/esm/ideal/build-ideal-from-starting-graph.d.ts +0 -15
- package/dist/esm/ideal/build-ideal-from-starting-graph.d.ts.map +0 -1
- package/dist/esm/ideal/build-ideal-from-starting-graph.js +0 -55
- package/dist/esm/ideal/build-ideal-from-starting-graph.js.map +0 -1
- package/dist/esm/ideal/build.d.ts +0 -41
- package/dist/esm/ideal/build.d.ts.map +0 -1
- package/dist/esm/ideal/build.js +0 -48
- package/dist/esm/ideal/build.js.map +0 -1
- package/dist/esm/ideal/get-importer-specs.d.ts +0 -14
- package/dist/esm/ideal/get-importer-specs.d.ts.map +0 -1
- package/dist/esm/ideal/get-importer-specs.js +0 -106
- package/dist/esm/ideal/get-importer-specs.js.map +0 -1
- package/dist/esm/ideal/remove-nodes.d.ts +0 -7
- package/dist/esm/ideal/remove-nodes.d.ts.map +0 -1
- package/dist/esm/ideal/remove-nodes.js +0 -19
- package/dist/esm/ideal/remove-nodes.js.map +0 -1
- package/dist/esm/ideal/remove-satisfied-specs.d.ts +0 -8
- package/dist/esm/ideal/remove-satisfied-specs.d.ts.map +0 -1
- package/dist/esm/ideal/remove-satisfied-specs.js +0 -35
- package/dist/esm/ideal/remove-satisfied-specs.js.map +0 -1
- package/dist/esm/ideal/types.d.ts +0 -35
- package/dist/esm/ideal/types.d.ts.map +0 -1
- package/dist/esm/ideal/types.js +0 -2
- package/dist/esm/ideal/types.js.map +0 -1
- package/dist/esm/index.d.ts +0 -38
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -32
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/install.d.ts +0 -19
- package/dist/esm/install.d.ts.map +0 -1
- package/dist/esm/install.js +0 -173
- package/dist/esm/install.js.map +0 -1
- package/dist/esm/lockfile/load-edges.d.ts +0 -12
- package/dist/esm/lockfile/load-edges.d.ts.map +0 -1
- package/dist/esm/lockfile/load-edges.js +0 -105
- package/dist/esm/lockfile/load-edges.js.map +0 -1
- package/dist/esm/lockfile/load-nodes.d.ts +0 -5
- package/dist/esm/lockfile/load-nodes.d.ts.map +0 -1
- package/dist/esm/lockfile/load-nodes.js +0 -95
- package/dist/esm/lockfile/load-nodes.js.map +0 -1
- package/dist/esm/lockfile/load.d.ts +0 -50
- package/dist/esm/lockfile/load.d.ts.map +0 -1
- package/dist/esm/lockfile/load.js +0 -89
- package/dist/esm/lockfile/load.js.map +0 -1
- package/dist/esm/lockfile/save.d.ts +0 -31
- package/dist/esm/lockfile/save.d.ts.map +0 -1
- package/dist/esm/lockfile/save.js +0 -173
- package/dist/esm/lockfile/save.js.map +0 -1
- package/dist/esm/lockfile/types.d.ts +0 -89
- package/dist/esm/lockfile/types.d.ts.map +0 -1
- package/dist/esm/lockfile/types.js +0 -44
- package/dist/esm/lockfile/types.js.map +0 -1
- package/dist/esm/modifiers.d.ts +0 -189
- package/dist/esm/modifiers.d.ts.map +0 -1
- package/dist/esm/modifiers.js +0 -330
- package/dist/esm/modifiers.js.map +0 -1
- package/dist/esm/node.d.ts +0 -219
- package/dist/esm/node.d.ts.map +0 -1
- package/dist/esm/node.js +0 -368
- package/dist/esm/node.js.map +0 -1
- package/dist/esm/non-empty-list.d.ts +0 -3
- package/dist/esm/non-empty-list.d.ts.map +0 -1
- package/dist/esm/non-empty-list.js +0 -3
- package/dist/esm/non-empty-list.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/reify/add-edge.d.ts +0 -10
- package/dist/esm/reify/add-edge.d.ts.map +0 -1
- package/dist/esm/reify/add-edge.js +0 -65
- package/dist/esm/reify/add-edge.js.map +0 -1
- package/dist/esm/reify/add-edges.d.ts +0 -5
- package/dist/esm/reify/add-edges.d.ts.map +0 -1
- package/dist/esm/reify/add-edges.js +0 -12
- package/dist/esm/reify/add-edges.js.map +0 -1
- package/dist/esm/reify/add-nodes.d.ts +0 -7
- package/dist/esm/reify/add-nodes.d.ts.map +0 -1
- package/dist/esm/reify/add-nodes.js +0 -17
- package/dist/esm/reify/add-nodes.js.map +0 -1
- package/dist/esm/reify/bin-chmod.d.ts +0 -11
- package/dist/esm/reify/bin-chmod.d.ts.map +0 -1
- package/dist/esm/reify/bin-chmod.js +0 -39
- package/dist/esm/reify/bin-chmod.js.map +0 -1
- package/dist/esm/reify/build.d.ts +0 -14
- package/dist/esm/reify/build.d.ts.map +0 -1
- package/dist/esm/reify/build.js +0 -103
- package/dist/esm/reify/build.js.map +0 -1
- package/dist/esm/reify/calculate-save-value.d.ts +0 -3
- package/dist/esm/reify/calculate-save-value.d.ts.map +0 -1
- package/dist/esm/reify/calculate-save-value.js +0 -45
- package/dist/esm/reify/calculate-save-value.js.map +0 -1
- package/dist/esm/reify/check-needed-build.d.ts +0 -25
- package/dist/esm/reify/check-needed-build.d.ts.map +0 -1
- package/dist/esm/reify/check-needed-build.js +0 -50
- package/dist/esm/reify/check-needed-build.js.map +0 -1
- package/dist/esm/reify/delete-edge.d.ts +0 -5
- package/dist/esm/reify/delete-edge.d.ts.map +0 -1
- package/dist/esm/reify/delete-edge.js +0 -28
- package/dist/esm/reify/delete-edge.js.map +0 -1
- package/dist/esm/reify/delete-edges.d.ts +0 -5
- package/dist/esm/reify/delete-edges.d.ts.map +0 -1
- package/dist/esm/reify/delete-edges.js +0 -14
- package/dist/esm/reify/delete-edges.js.map +0 -1
- package/dist/esm/reify/delete-nodes.d.ts +0 -5
- package/dist/esm/reify/delete-nodes.d.ts.map +0 -1
- package/dist/esm/reify/delete-nodes.js +0 -16
- package/dist/esm/reify/delete-nodes.js.map +0 -1
- package/dist/esm/reify/extract-node.d.ts +0 -24
- package/dist/esm/reify/extract-node.d.ts.map +0 -1
- package/dist/esm/reify/extract-node.js +0 -76
- package/dist/esm/reify/extract-node.js.map +0 -1
- package/dist/esm/reify/index.d.ts +0 -34
- package/dist/esm/reify/index.d.ts.map +0 -1
- package/dist/esm/reify/index.js +0 -161
- package/dist/esm/reify/index.js.map +0 -1
- package/dist/esm/reify/internal-hoist.d.ts +0 -9
- package/dist/esm/reify/internal-hoist.d.ts.map +0 -1
- package/dist/esm/reify/internal-hoist.js +0 -134
- package/dist/esm/reify/internal-hoist.js.map +0 -1
- package/dist/esm/reify/optional-fail.d.ts +0 -16
- package/dist/esm/reify/optional-fail.d.ts.map +0 -1
- package/dist/esm/reify/optional-fail.js +0 -16
- package/dist/esm/reify/optional-fail.js.map +0 -1
- package/dist/esm/reify/rollback.d.ts +0 -5
- package/dist/esm/reify/rollback.d.ts.map +0 -1
- package/dist/esm/reify/rollback.js +0 -24
- package/dist/esm/reify/rollback.js.map +0 -1
- package/dist/esm/reify/update-importers-package-json.d.ts +0 -36
- package/dist/esm/reify/update-importers-package-json.d.ts.map +0 -1
- package/dist/esm/reify/update-importers-package-json.js +0 -120
- package/dist/esm/reify/update-importers-package-json.js.map +0 -1
- package/dist/esm/remove-optional-subgraph.d.ts +0 -34
- package/dist/esm/remove-optional-subgraph.d.ts.map +0 -1
- package/dist/esm/remove-optional-subgraph.js +0 -48
- package/dist/esm/remove-optional-subgraph.js.map +0 -1
- package/dist/esm/resolve-save-type.d.ts +0 -6
- package/dist/esm/resolve-save-type.d.ts.map +0 -1
- package/dist/esm/resolve-save-type.js +0 -5
- package/dist/esm/resolve-save-type.js.map +0 -1
- package/dist/esm/stringify-node.d.ts +0 -3
- package/dist/esm/stringify-node.d.ts.map +0 -1
- package/dist/esm/stringify-node.js +0 -24
- package/dist/esm/stringify-node.js.map +0 -1
- package/dist/esm/transfer-data/load.d.ts +0 -44
- package/dist/esm/transfer-data/load.d.ts.map +0 -1
- package/dist/esm/transfer-data/load.js +0 -176
- package/dist/esm/transfer-data/load.js.map +0 -1
- package/dist/esm/uninstall.d.ts +0 -15
- package/dist/esm/uninstall.d.ts.map +0 -1
- package/dist/esm/uninstall.js +0 -58
- package/dist/esm/uninstall.js.map +0 -1
- package/dist/esm/update.d.ts +0 -13
- package/dist/esm/update.d.ts.map +0 -1
- package/dist/esm/update.js +0 -63
- package/dist/esm/update.js.map +0 -1
- package/dist/esm/virtual-root.d.ts +0 -16
- package/dist/esm/virtual-root.d.ts.map +0 -1
- package/dist/esm/virtual-root.js +0 -79
- package/dist/esm/virtual-root.js.map +0 -1
- package/dist/esm/visualization/human-readable-output.d.ts +0 -27
- package/dist/esm/visualization/human-readable-output.d.ts.map +0 -1
- package/dist/esm/visualization/human-readable-output.js +0 -159
- package/dist/esm/visualization/human-readable-output.js.map +0 -1
- package/dist/esm/visualization/json-output.d.ts +0 -41
- package/dist/esm/visualization/json-output.d.ts.map +0 -1
- package/dist/esm/visualization/json-output.js +0 -51
- package/dist/esm/visualization/json-output.js.map +0 -1
- package/dist/esm/visualization/mermaid-output.d.ts +0 -17
- package/dist/esm/visualization/mermaid-output.d.ts.map +0 -1
- package/dist/esm/visualization/mermaid-output.js +0 -123
- package/dist/esm/visualization/mermaid-output.js.map +0 -1
- package/dist/esm/visualization/object-like-output.d.ts +0 -3
- package/dist/esm/visualization/object-like-output.d.ts.map +0 -1
- package/dist/esm/visualization/object-like-output.js +0 -48
- package/dist/esm/visualization/object-like-output.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '@vltpkg/graph'
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|

|
|
2
6
|
|
|
3
7
|
# @vltpkg/graph
|
|
@@ -41,57 +45,87 @@ At a glance:
|
|
|
41
45
|
`node_modules/.vlt-lock.json` mirroring the current on-disk state to
|
|
42
46
|
accelerate subsequent loads of the Actual graph.
|
|
43
47
|
- Modifiers: Configuration for selectively altering dependency
|
|
44
|
-
resolution
|
|
45
|
-
|
|
48
|
+
resolution via DSS queries in `vlt.json`.
|
|
49
|
+
- Peer Contexts: Isolation mechanism for peer dependencies that allows
|
|
50
|
+
multiple versions of the same package when peer requirements differ.
|
|
46
51
|
|
|
47
52
|
## API
|
|
48
53
|
|
|
49
|
-
### `actual.load(
|
|
54
|
+
### `actual.load(options): Graph`
|
|
50
55
|
|
|
51
56
|
Recursively loads the `node_modules` folder found at `projectRoot` in
|
|
52
57
|
order to create a graph representation of the current installed
|
|
53
58
|
packages.
|
|
54
59
|
|
|
55
|
-
### `
|
|
60
|
+
### `ideal.build(options): Promise<Graph>`
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
local file system.
|
|
62
|
+
Builds the ideal dependency graph by loading from lockfile (preferred)
|
|
63
|
+
or actual graph, then expanding dependencies by fetching manifests.
|
|
64
|
+
Requires `packageInfo` and `remover` in addition to standard options.
|
|
61
65
|
|
|
62
|
-
### `lockfile.load(
|
|
66
|
+
### `lockfile.load(options): Graph`
|
|
63
67
|
|
|
64
68
|
Loads the lockfile file found at `projectRoot` and returns the graph.
|
|
65
69
|
|
|
66
|
-
### `
|
|
70
|
+
### `lockfile.save(options): void`
|
|
71
|
+
|
|
72
|
+
Saves the graph to `vlt-lock.json`.
|
|
73
|
+
|
|
74
|
+
### `reify(options): Promise<ReifyResult>`
|
|
67
75
|
|
|
68
76
|
Computes a `Diff` between the Actual and Ideal graphs and applies the
|
|
69
77
|
minimal filesystem changes (creating/deleting links, writing
|
|
70
78
|
lockfiles, hoisting, lifecycle scripts) to make the on-disk install
|
|
71
|
-
match the Ideal graph.
|
|
79
|
+
match the Ideal graph. Returns `{ diff, buildQueue }`.
|
|
80
|
+
|
|
81
|
+
### `install(options, add?): Promise<{ graph, diff, buildQueue }>`
|
|
82
|
+
|
|
83
|
+
High-level install orchestration that handles graph building, reify,
|
|
84
|
+
and lockfile management. Supports `--frozen-lockfile`,
|
|
85
|
+
`--clean-install`, and `--lockfile-only` modes.
|
|
86
|
+
|
|
87
|
+
### `mermaidOutput(graph): string`
|
|
88
|
+
|
|
89
|
+
Generates Mermaid flowchart syntax from graph data.
|
|
90
|
+
|
|
91
|
+
### `humanReadableOutput(graph, options): string`
|
|
92
|
+
|
|
93
|
+
Generates ASCII tree output with optional colors. Used in `vlt ls`.
|
|
94
|
+
|
|
95
|
+
### `jsonOutput(graph): JSONOutputItem[]`
|
|
96
|
+
|
|
97
|
+
Returns array of `{name, fromID, spec, type, to, overridden}` items.
|
|
72
98
|
|
|
73
99
|
## Usage
|
|
74
100
|
|
|
75
|
-
|
|
76
|
-
method to build a graph representation of the install defined at the
|
|
77
|
-
`projectRoot` directory.
|
|
101
|
+
### High-Level Install
|
|
78
102
|
|
|
79
|
-
```
|
|
80
|
-
import {
|
|
103
|
+
```ts
|
|
104
|
+
import { install } from '@vltpkg/graph'
|
|
81
105
|
|
|
82
|
-
const graph = await
|
|
106
|
+
const { graph, diff, buildQueue } = await install({
|
|
107
|
+
projectRoot: process.cwd(),
|
|
108
|
+
packageInfo,
|
|
109
|
+
packageJson,
|
|
110
|
+
scurry,
|
|
111
|
+
allowScripts: '*',
|
|
112
|
+
})
|
|
83
113
|
```
|
|
84
114
|
|
|
85
115
|
### Load Actual Graph and Reify
|
|
86
116
|
|
|
87
117
|
```ts
|
|
88
118
|
import { actual, ideal, reify } from '@vltpkg/graph'
|
|
119
|
+
import { RollbackRemove } from '@vltpkg/rollback-remove'
|
|
120
|
+
|
|
121
|
+
const remover = new RollbackRemove()
|
|
89
122
|
|
|
90
123
|
// Load current on-disk state
|
|
91
124
|
const from = actual.load({
|
|
92
125
|
projectRoot: process.cwd(),
|
|
93
126
|
packageJson,
|
|
94
127
|
scurry,
|
|
128
|
+
loadManifests: true,
|
|
95
129
|
})
|
|
96
130
|
|
|
97
131
|
// Build intended end state (may start from lockfile or actual)
|
|
@@ -100,15 +134,18 @@ const to = await ideal.build({
|
|
|
100
134
|
packageInfo,
|
|
101
135
|
packageJson,
|
|
102
136
|
scurry,
|
|
137
|
+
remover,
|
|
103
138
|
})
|
|
104
139
|
|
|
105
140
|
// Apply minimal changes to match Ideal
|
|
106
|
-
await reify({
|
|
141
|
+
const { diff, buildQueue } = await reify({
|
|
107
142
|
graph: to,
|
|
108
143
|
actual: from,
|
|
109
144
|
packageInfo,
|
|
110
145
|
packageJson,
|
|
111
146
|
scurry,
|
|
147
|
+
remover,
|
|
148
|
+
allowScripts: '*',
|
|
112
149
|
})
|
|
113
150
|
```
|
|
114
151
|
|
|
@@ -118,15 +155,48 @@ await reify({
|
|
|
118
155
|
import { lockfile } from '@vltpkg/graph'
|
|
119
156
|
|
|
120
157
|
// Load virtual graph from vlt-lock.json
|
|
121
|
-
const
|
|
158
|
+
const graph = lockfile.load({
|
|
122
159
|
projectRoot,
|
|
123
160
|
mainManifest,
|
|
124
161
|
packageJson,
|
|
125
|
-
scurry,
|
|
126
162
|
})
|
|
127
163
|
|
|
128
|
-
// Save
|
|
129
|
-
lockfile.save({ graph
|
|
164
|
+
// Save to vlt-lock.json
|
|
165
|
+
lockfile.save({ graph })
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Graph Visualization
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
import {
|
|
172
|
+
mermaidOutput,
|
|
173
|
+
humanReadableOutput,
|
|
174
|
+
jsonOutput,
|
|
175
|
+
} from '@vltpkg/graph'
|
|
176
|
+
|
|
177
|
+
// Mermaid flowchart (for docs, dashboards)
|
|
178
|
+
const mermaid = mermaidOutput({
|
|
179
|
+
edges: [...graph.edges],
|
|
180
|
+
nodes: [...graph.nodes.values()],
|
|
181
|
+
importers: graph.importers,
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
// ASCII tree with colors (used in `vlt ls`)
|
|
185
|
+
const tree = humanReadableOutput(
|
|
186
|
+
{
|
|
187
|
+
edges: [...graph.edges],
|
|
188
|
+
nodes: [...graph.nodes.values()],
|
|
189
|
+
importers: graph.importers,
|
|
190
|
+
},
|
|
191
|
+
{ colors: true },
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
// JSON array of dependency items
|
|
195
|
+
const json = jsonOutput({
|
|
196
|
+
edges: [...graph.edges],
|
|
197
|
+
nodes: [...graph.nodes.values()],
|
|
198
|
+
importers: graph.importers,
|
|
199
|
+
})
|
|
130
200
|
```
|
|
131
201
|
|
|
132
202
|
## Architecture
|
|
@@ -137,6 +207,7 @@ Graph construction modes supported by the library:
|
|
|
137
207
|
- Load and save via `src/lockfile/load.ts` and
|
|
138
208
|
`src/lockfile/save.ts`
|
|
139
209
|
- Hidden lockfile: `node_modules/.vlt-lock.json` for faster loads
|
|
210
|
+
- 📖 [Lockfile README](./src/lockfile/README.md)
|
|
140
211
|
|
|
141
212
|
- Actual Graphs (filesystem-based)
|
|
142
213
|
- Loaded by traversing `node_modules` via `src/actual/load.ts`
|
|
@@ -150,20 +221,28 @@ Graph construction modes supported by the library:
|
|
|
150
221
|
`src/ideal/get-importer-specs.ts`
|
|
151
222
|
- Fetches and expands manifests using `@vltpkg/package-info`, reuses
|
|
152
223
|
existing nodes that satisfy specs
|
|
224
|
+
- 📖 [Ideal README](./src/ideal/README.md)
|
|
153
225
|
|
|
154
226
|
Finally, `src/diff.ts` computes changes and `src/reify/` applies them
|
|
155
227
|
to the filesystem.
|
|
156
228
|
|
|
229
|
+
- 📖 [Reify README](./src/reify/README.md)
|
|
230
|
+
- 📖 [Architecture Guide](./ARCHITECTURE.md)
|
|
231
|
+
|
|
157
232
|
## Related Workspaces
|
|
158
233
|
|
|
159
234
|
- `@vltpkg/dep-id`: Unique IDs for packages, ensuring `Node` identity
|
|
160
235
|
- `@vltpkg/spec`: Parse/normalize dependency specifiers and registry
|
|
161
236
|
semantics
|
|
162
237
|
- `@vltpkg/semver`: Semantic version parsing/comparison
|
|
238
|
+
- `@vltpkg/satisfies`: Check if a DepID satisfies a Spec
|
|
163
239
|
- `@vltpkg/package-info`: Fetch remote manifests and artifacts
|
|
164
240
|
(registry, git, tarball)
|
|
165
241
|
- `@vltpkg/package-json`: Read and cache local `package.json` files
|
|
166
242
|
- `@vltpkg/workspaces`: Monorepo workspace discovery and grouping
|
|
243
|
+
- `@vltpkg/rollback-remove`: Safe file removal with rollback
|
|
244
|
+
capability
|
|
245
|
+
- `@vltpkg/vlt-json`: Load `vlt.json` configuration (modifiers, etc.)
|
|
167
246
|
|
|
168
247
|
## References
|
|
169
248
|
|
package/package.json
CHANGED
|
@@ -1,99 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/graph",
|
|
3
3
|
"description": "A library that helps understanding & expressing what happens on an install",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.22",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
8
8
|
"directory": "src/graph"
|
|
9
9
|
},
|
|
10
|
-
"author":
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"liveDev": true,
|
|
14
|
-
"dialects": [
|
|
15
|
-
"esm"
|
|
16
|
-
],
|
|
17
|
-
"exports": {
|
|
18
|
-
"./package.json": "./package.json",
|
|
19
|
-
".": "./src/index.ts",
|
|
20
|
-
"./browser": "./src/browser.ts"
|
|
21
|
-
}
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "vlt technology inc.",
|
|
12
|
+
"email": "support@vlt.sh"
|
|
22
13
|
},
|
|
23
14
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"@vltpkg/
|
|
28
|
-
"@vltpkg/
|
|
29
|
-
"@vltpkg/
|
|
30
|
-
"@vltpkg/
|
|
31
|
-
"@vltpkg/
|
|
32
|
-
"@vltpkg/package-info": "1.0.0-rc.
|
|
33
|
-
"@vltpkg/
|
|
34
|
-
"@vltpkg/
|
|
35
|
-
"@vltpkg/
|
|
36
|
-
"@vltpkg/
|
|
37
|
-
"@vltpkg/
|
|
38
|
-
"@vltpkg/
|
|
39
|
-
"@vltpkg/
|
|
40
|
-
"@vltpkg/
|
|
41
|
-
"@vltpkg/
|
|
42
|
-
"@vltpkg/
|
|
43
|
-
"@vltpkg/
|
|
44
|
-
"
|
|
45
|
-
"
|
|
15
|
+
"@vltpkg/cmd-shim": "1.0.0-rc.22",
|
|
16
|
+
"@vltpkg/dep-id": "1.0.0-rc.22",
|
|
17
|
+
"@vltpkg/dss-breadcrumb": "1.0.0-rc.22",
|
|
18
|
+
"@vltpkg/error-cause": "1.0.0-rc.22",
|
|
19
|
+
"@vltpkg/fast-split": "1.0.0-rc.22",
|
|
20
|
+
"@vltpkg/graph-run": "1.0.0-rc.22",
|
|
21
|
+
"@vltpkg/init": "1.0.0-rc.22",
|
|
22
|
+
"@vltpkg/output": "1.0.0-rc.22",
|
|
23
|
+
"@vltpkg/package-info": "1.0.0-rc.22",
|
|
24
|
+
"@vltpkg/package-json": "1.0.0-rc.22",
|
|
25
|
+
"@vltpkg/pick-manifest": "1.0.0-rc.22",
|
|
26
|
+
"@vltpkg/query": "1.0.0-rc.22",
|
|
27
|
+
"@vltpkg/rollback-remove": "1.0.0-rc.22",
|
|
28
|
+
"@vltpkg/run": "1.0.0-rc.22",
|
|
29
|
+
"@vltpkg/satisfies": "1.0.0-rc.22",
|
|
30
|
+
"@vltpkg/security-archive": "1.0.0-rc.22",
|
|
31
|
+
"@vltpkg/spec": "1.0.0-rc.22",
|
|
32
|
+
"@vltpkg/types": "1.0.0-rc.22",
|
|
33
|
+
"@vltpkg/vlt-json": "1.0.0-rc.22",
|
|
34
|
+
"@vltpkg/workspaces": "1.0.0-rc.22",
|
|
35
|
+
"path-scurry": "^2.0.1",
|
|
36
|
+
"promise-call-limit": "^3.0.2"
|
|
46
37
|
},
|
|
47
38
|
"devDependencies": {
|
|
48
|
-
"@eslint/js": "^9.
|
|
49
|
-
"@types/node": "^22.
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
39
|
+
"@eslint/js": "^9.39.1",
|
|
40
|
+
"@types/node": "^22.19.2",
|
|
41
|
+
"@vltpkg/vlt-json": "1.0.0-rc.22",
|
|
42
|
+
"eslint": "^9.39.1",
|
|
43
|
+
"prettier": "^3.7.4",
|
|
44
|
+
"tap": "^21.5.0",
|
|
45
|
+
"tar": "^7.5.2",
|
|
55
46
|
"typedoc": "~0.27.9",
|
|
56
47
|
"typescript": "5.7.3",
|
|
57
|
-
"typescript-eslint": "^8.
|
|
58
|
-
"@vltpkg/vlt-json": "1.0.0-rc.2"
|
|
48
|
+
"typescript-eslint": "^8.49.0"
|
|
59
49
|
},
|
|
60
50
|
"license": "BSD-2-Clause-Patent",
|
|
61
51
|
"engines": {
|
|
62
|
-
"node": ">=22"
|
|
52
|
+
"node": ">=22.22.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
|
|
56
|
+
"format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
|
|
57
|
+
"lint": "eslint . --fix",
|
|
58
|
+
"lint:check": "eslint .",
|
|
59
|
+
"prepack": "tsc -p tsconfig.publish.json && ../../scripts/update-dist-exports.ts",
|
|
60
|
+
"snap": "tap",
|
|
61
|
+
"test": "tap",
|
|
62
|
+
"posttest": "tsc --noEmit",
|
|
63
|
+
"typecheck": "tsc --noEmit"
|
|
63
64
|
},
|
|
64
65
|
"tap": {
|
|
65
66
|
"extends": "../../tap-config.yaml"
|
|
66
67
|
},
|
|
67
68
|
"prettier": "../../.prettierrc.js",
|
|
68
|
-
"module": "./
|
|
69
|
+
"module": "./src/index.ts",
|
|
69
70
|
"type": "module",
|
|
70
71
|
"exports": {
|
|
71
72
|
"./package.json": "./package.json",
|
|
72
73
|
".": {
|
|
73
74
|
"import": {
|
|
74
|
-
"
|
|
75
|
-
"default": "./dist/esm/index.js"
|
|
75
|
+
"default": "./src/index.ts"
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"./browser": {
|
|
79
79
|
"import": {
|
|
80
|
-
"
|
|
81
|
-
"default": "./dist/esm/browser.js"
|
|
80
|
+
"default": "./src/browser.ts"
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
},
|
|
85
84
|
"files": [
|
|
86
85
|
"dist"
|
|
87
|
-
]
|
|
88
|
-
|
|
89
|
-
"format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
|
|
90
|
-
"format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
|
|
91
|
-
"lint": "eslint . --fix",
|
|
92
|
-
"lint:check": "eslint .",
|
|
93
|
-
"snap": "tap",
|
|
94
|
-
"test": "tap",
|
|
95
|
-
"posttest": "tsc --noEmit",
|
|
96
|
-
"tshy": "tshy",
|
|
97
|
-
"typecheck": "tsc --noEmit"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { Spec } from '@vltpkg/spec';
|
|
2
|
-
import { Graph } from '../graph.ts';
|
|
3
|
-
import type { DepID } from '@vltpkg/dep-id';
|
|
4
|
-
import type { PackageJson } from '@vltpkg/package-json';
|
|
5
|
-
import type { SpecOptions } from '@vltpkg/spec';
|
|
6
|
-
import type { NormalizedManifest } from '@vltpkg/types';
|
|
7
|
-
import type { Monorepo } from '@vltpkg/workspaces';
|
|
8
|
-
import type { Path, PathScurry } from 'path-scurry';
|
|
9
|
-
import type { GraphModifier } from '../modifiers.ts';
|
|
10
|
-
export type LoadOptions = SpecOptions & {
|
|
11
|
-
/**
|
|
12
|
-
* The project root dirname.
|
|
13
|
-
*/
|
|
14
|
-
projectRoot: string;
|
|
15
|
-
/**
|
|
16
|
-
* The project root manifest.
|
|
17
|
-
*/
|
|
18
|
-
mainManifest?: NormalizedManifest;
|
|
19
|
-
/**
|
|
20
|
-
* The graph modifiers helper object.
|
|
21
|
-
*/
|
|
22
|
-
modifiers?: GraphModifier;
|
|
23
|
-
/**
|
|
24
|
-
* A {@link Monorepo} object, for managing workspaces
|
|
25
|
-
*/
|
|
26
|
-
monorepo?: Monorepo;
|
|
27
|
-
/**
|
|
28
|
-
* A {@link PackageJson} object, for sharing manifest caches
|
|
29
|
-
*/
|
|
30
|
-
packageJson: PackageJson;
|
|
31
|
-
/**
|
|
32
|
-
* A {@link PathScurry} object, for use in globs
|
|
33
|
-
*/
|
|
34
|
-
scurry: PathScurry;
|
|
35
|
-
/**
|
|
36
|
-
* If set to `false`, `actual.load` will not load any `package.json`
|
|
37
|
-
* files while traversing the file system.
|
|
38
|
-
*
|
|
39
|
-
* The resulting {@link Graph} from loading with `loadManifests=false`
|
|
40
|
-
* has no information on dependency types or the specs defined and
|
|
41
|
-
* no information on missing and extraneous dependencies.
|
|
42
|
-
*/
|
|
43
|
-
loadManifests?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* If set to `true`, then do not shortcut the process by reading the
|
|
46
|
-
* hidden lockfile at `node_modules/.vlt-lock.json`
|
|
47
|
-
*/
|
|
48
|
-
skipHiddenLockfile?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Load only importers into the graph if the modifiers have changed.
|
|
51
|
-
*/
|
|
52
|
-
skipLoadingNodesOnModifiersChange?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* If set to `true`, fail if lockfile is missing or out of date.
|
|
55
|
-
* Used by ci command to enforce lockfile integrity.
|
|
56
|
-
*/
|
|
57
|
-
expectLockfile?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* If set to `true`, fail if lockfile is missing or out of sync with package.json.
|
|
60
|
-
* Prevents any lockfile modifications and is stricter than expectLockfile.
|
|
61
|
-
*/
|
|
62
|
-
frozenLockfile?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* If set to `true`, only update the lockfile without performing any node_modules
|
|
65
|
-
* operations. Skips package extraction, filesystem operations, and hidden lockfile saves.
|
|
66
|
-
*/
|
|
67
|
-
lockfileOnly?: boolean;
|
|
68
|
-
};
|
|
69
|
-
export type ReadEntry = {
|
|
70
|
-
alias: string;
|
|
71
|
-
name: string;
|
|
72
|
-
realpath: Path;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* The configuration object type as it is saved in the `.vlt/vlt.json`
|
|
76
|
-
*/
|
|
77
|
-
export type StoreConfigObject = {
|
|
78
|
-
modifiers: Record<string, string> | undefined;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Checks if a given object is a {@link StoreConfigObject}.
|
|
82
|
-
*/
|
|
83
|
-
export declare const isStoreConfigObject: (obj: unknown) => obj is StoreConfigObject;
|
|
84
|
-
/**
|
|
85
|
-
* Returns a {@link StoreConfigObject} from a given object.
|
|
86
|
-
* Throws a TypeError if the object can't be converted.
|
|
87
|
-
*/
|
|
88
|
-
export declare const asStoreConfigObject: (obj: unknown) => StoreConfigObject;
|
|
89
|
-
/**
|
|
90
|
-
* Returns a {@link DepID} for a given spec and path, if the spec is
|
|
91
|
-
* path-based or a registry spec, otherwise returns `undefined`.
|
|
92
|
-
*/
|
|
93
|
-
export declare const getPathBasedId: (spec: Spec, path: Path) => DepID | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Read the file system looking for `node_modules` folders and
|
|
96
|
-
* returns a new {@link Graph} that represents the relationship
|
|
97
|
-
* between the dependencies found.
|
|
98
|
-
*/
|
|
99
|
-
export declare const load: (options: LoadOptions) => Graph;
|
|
100
|
-
//# sourceMappingURL=load.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/actual/load.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAQnC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAGnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEnD,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,iBAAiB,CAAA;AAGxB,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAA;IACxB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAA;IAClB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,iCAAiC,CAAC,EAAE,OAAO,CAAA;IAE3C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,IAAI,CAAA;CACf,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;CAC9C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,QACzB,OAAO,KACX,GAAG,IAAI,iBAGe,CAAA;AAEzB;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QACzB,OAAO,KACX,iBAKF,CAAA;AAUD;;;GAGG;AACH,eAAO,MAAM,cAAc,SACnB,IAAI,QACJ,IAAI,KACT,KAAK,GAAG,SAGQ,CAAA;AA2RnB;;;;GAIG;AACH,eAAO,MAAM,IAAI,YAAa,WAAW,KAAG,KAkG3C,CAAA"}
|