@vltpkg/graph 1.0.0-rc.2 → 1.0.0-rc.23

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.
Files changed (211) hide show
  1. package/README.md +101 -22
  2. package/package.json +51 -63
  3. package/dist/esm/actual/load.d.ts +0 -100
  4. package/dist/esm/actual/load.d.ts.map +0 -1
  5. package/dist/esm/actual/load.js +0 -304
  6. package/dist/esm/actual/load.js.map +0 -1
  7. package/dist/esm/browser.d.ts +0 -15
  8. package/dist/esm/browser.d.ts.map +0 -1
  9. package/dist/esm/browser.js +0 -17
  10. package/dist/esm/browser.js.map +0 -1
  11. package/dist/esm/build.d.ts +0 -29
  12. package/dist/esm/build.d.ts.map +0 -1
  13. package/dist/esm/build.js +0 -79
  14. package/dist/esm/build.js.map +0 -1
  15. package/dist/esm/dependencies.d.ts +0 -66
  16. package/dist/esm/dependencies.d.ts.map +0 -1
  17. package/dist/esm/dependencies.js +0 -112
  18. package/dist/esm/dependencies.js.map +0 -1
  19. package/dist/esm/diff.d.ts +0 -116
  20. package/dist/esm/diff.d.ts.map +0 -1
  21. package/dist/esm/diff.js +0 -148
  22. package/dist/esm/diff.js.map +0 -1
  23. package/dist/esm/edge.d.ts +0 -46
  24. package/dist/esm/edge.d.ts.map +0 -1
  25. package/dist/esm/edge.js +0 -74
  26. package/dist/esm/edge.js.map +0 -1
  27. package/dist/esm/graph.d.ts +0 -133
  28. package/dist/esm/graph.d.ts.map +0 -1
  29. package/dist/esm/graph.js +0 -407
  30. package/dist/esm/graph.js.map +0 -1
  31. package/dist/esm/ideal/add-nodes.d.ts +0 -34
  32. package/dist/esm/ideal/add-nodes.d.ts.map +0 -1
  33. package/dist/esm/ideal/add-nodes.js +0 -39
  34. package/dist/esm/ideal/add-nodes.js.map +0 -1
  35. package/dist/esm/ideal/append-nodes.d.ts +0 -19
  36. package/dist/esm/ideal/append-nodes.d.ts.map +0 -1
  37. package/dist/esm/ideal/append-nodes.js +0 -289
  38. package/dist/esm/ideal/append-nodes.js.map +0 -1
  39. package/dist/esm/ideal/build-ideal-from-starting-graph.d.ts +0 -15
  40. package/dist/esm/ideal/build-ideal-from-starting-graph.d.ts.map +0 -1
  41. package/dist/esm/ideal/build-ideal-from-starting-graph.js +0 -55
  42. package/dist/esm/ideal/build-ideal-from-starting-graph.js.map +0 -1
  43. package/dist/esm/ideal/build.d.ts +0 -41
  44. package/dist/esm/ideal/build.d.ts.map +0 -1
  45. package/dist/esm/ideal/build.js +0 -48
  46. package/dist/esm/ideal/build.js.map +0 -1
  47. package/dist/esm/ideal/get-importer-specs.d.ts +0 -14
  48. package/dist/esm/ideal/get-importer-specs.d.ts.map +0 -1
  49. package/dist/esm/ideal/get-importer-specs.js +0 -106
  50. package/dist/esm/ideal/get-importer-specs.js.map +0 -1
  51. package/dist/esm/ideal/remove-nodes.d.ts +0 -7
  52. package/dist/esm/ideal/remove-nodes.d.ts.map +0 -1
  53. package/dist/esm/ideal/remove-nodes.js +0 -19
  54. package/dist/esm/ideal/remove-nodes.js.map +0 -1
  55. package/dist/esm/ideal/remove-satisfied-specs.d.ts +0 -8
  56. package/dist/esm/ideal/remove-satisfied-specs.d.ts.map +0 -1
  57. package/dist/esm/ideal/remove-satisfied-specs.js +0 -35
  58. package/dist/esm/ideal/remove-satisfied-specs.js.map +0 -1
  59. package/dist/esm/ideal/types.d.ts +0 -35
  60. package/dist/esm/ideal/types.d.ts.map +0 -1
  61. package/dist/esm/ideal/types.js +0 -2
  62. package/dist/esm/ideal/types.js.map +0 -1
  63. package/dist/esm/index.d.ts +0 -38
  64. package/dist/esm/index.d.ts.map +0 -1
  65. package/dist/esm/index.js +0 -32
  66. package/dist/esm/index.js.map +0 -1
  67. package/dist/esm/install.d.ts +0 -19
  68. package/dist/esm/install.d.ts.map +0 -1
  69. package/dist/esm/install.js +0 -173
  70. package/dist/esm/install.js.map +0 -1
  71. package/dist/esm/lockfile/load-edges.d.ts +0 -12
  72. package/dist/esm/lockfile/load-edges.d.ts.map +0 -1
  73. package/dist/esm/lockfile/load-edges.js +0 -105
  74. package/dist/esm/lockfile/load-edges.js.map +0 -1
  75. package/dist/esm/lockfile/load-nodes.d.ts +0 -5
  76. package/dist/esm/lockfile/load-nodes.d.ts.map +0 -1
  77. package/dist/esm/lockfile/load-nodes.js +0 -95
  78. package/dist/esm/lockfile/load-nodes.js.map +0 -1
  79. package/dist/esm/lockfile/load.d.ts +0 -50
  80. package/dist/esm/lockfile/load.d.ts.map +0 -1
  81. package/dist/esm/lockfile/load.js +0 -89
  82. package/dist/esm/lockfile/load.js.map +0 -1
  83. package/dist/esm/lockfile/save.d.ts +0 -31
  84. package/dist/esm/lockfile/save.d.ts.map +0 -1
  85. package/dist/esm/lockfile/save.js +0 -173
  86. package/dist/esm/lockfile/save.js.map +0 -1
  87. package/dist/esm/lockfile/types.d.ts +0 -89
  88. package/dist/esm/lockfile/types.d.ts.map +0 -1
  89. package/dist/esm/lockfile/types.js +0 -44
  90. package/dist/esm/lockfile/types.js.map +0 -1
  91. package/dist/esm/modifiers.d.ts +0 -189
  92. package/dist/esm/modifiers.d.ts.map +0 -1
  93. package/dist/esm/modifiers.js +0 -330
  94. package/dist/esm/modifiers.js.map +0 -1
  95. package/dist/esm/node.d.ts +0 -219
  96. package/dist/esm/node.d.ts.map +0 -1
  97. package/dist/esm/node.js +0 -368
  98. package/dist/esm/node.js.map +0 -1
  99. package/dist/esm/non-empty-list.d.ts +0 -3
  100. package/dist/esm/non-empty-list.d.ts.map +0 -1
  101. package/dist/esm/non-empty-list.js +0 -3
  102. package/dist/esm/non-empty-list.js.map +0 -1
  103. package/dist/esm/package.json +0 -3
  104. package/dist/esm/reify/add-edge.d.ts +0 -10
  105. package/dist/esm/reify/add-edge.d.ts.map +0 -1
  106. package/dist/esm/reify/add-edge.js +0 -65
  107. package/dist/esm/reify/add-edge.js.map +0 -1
  108. package/dist/esm/reify/add-edges.d.ts +0 -5
  109. package/dist/esm/reify/add-edges.d.ts.map +0 -1
  110. package/dist/esm/reify/add-edges.js +0 -12
  111. package/dist/esm/reify/add-edges.js.map +0 -1
  112. package/dist/esm/reify/add-nodes.d.ts +0 -7
  113. package/dist/esm/reify/add-nodes.d.ts.map +0 -1
  114. package/dist/esm/reify/add-nodes.js +0 -17
  115. package/dist/esm/reify/add-nodes.js.map +0 -1
  116. package/dist/esm/reify/bin-chmod.d.ts +0 -11
  117. package/dist/esm/reify/bin-chmod.d.ts.map +0 -1
  118. package/dist/esm/reify/bin-chmod.js +0 -39
  119. package/dist/esm/reify/bin-chmod.js.map +0 -1
  120. package/dist/esm/reify/build.d.ts +0 -14
  121. package/dist/esm/reify/build.d.ts.map +0 -1
  122. package/dist/esm/reify/build.js +0 -103
  123. package/dist/esm/reify/build.js.map +0 -1
  124. package/dist/esm/reify/calculate-save-value.d.ts +0 -3
  125. package/dist/esm/reify/calculate-save-value.d.ts.map +0 -1
  126. package/dist/esm/reify/calculate-save-value.js +0 -45
  127. package/dist/esm/reify/calculate-save-value.js.map +0 -1
  128. package/dist/esm/reify/check-needed-build.d.ts +0 -25
  129. package/dist/esm/reify/check-needed-build.d.ts.map +0 -1
  130. package/dist/esm/reify/check-needed-build.js +0 -50
  131. package/dist/esm/reify/check-needed-build.js.map +0 -1
  132. package/dist/esm/reify/delete-edge.d.ts +0 -5
  133. package/dist/esm/reify/delete-edge.d.ts.map +0 -1
  134. package/dist/esm/reify/delete-edge.js +0 -28
  135. package/dist/esm/reify/delete-edge.js.map +0 -1
  136. package/dist/esm/reify/delete-edges.d.ts +0 -5
  137. package/dist/esm/reify/delete-edges.d.ts.map +0 -1
  138. package/dist/esm/reify/delete-edges.js +0 -14
  139. package/dist/esm/reify/delete-edges.js.map +0 -1
  140. package/dist/esm/reify/delete-nodes.d.ts +0 -5
  141. package/dist/esm/reify/delete-nodes.d.ts.map +0 -1
  142. package/dist/esm/reify/delete-nodes.js +0 -16
  143. package/dist/esm/reify/delete-nodes.js.map +0 -1
  144. package/dist/esm/reify/extract-node.d.ts +0 -24
  145. package/dist/esm/reify/extract-node.d.ts.map +0 -1
  146. package/dist/esm/reify/extract-node.js +0 -76
  147. package/dist/esm/reify/extract-node.js.map +0 -1
  148. package/dist/esm/reify/index.d.ts +0 -34
  149. package/dist/esm/reify/index.d.ts.map +0 -1
  150. package/dist/esm/reify/index.js +0 -161
  151. package/dist/esm/reify/index.js.map +0 -1
  152. package/dist/esm/reify/internal-hoist.d.ts +0 -9
  153. package/dist/esm/reify/internal-hoist.d.ts.map +0 -1
  154. package/dist/esm/reify/internal-hoist.js +0 -134
  155. package/dist/esm/reify/internal-hoist.js.map +0 -1
  156. package/dist/esm/reify/optional-fail.d.ts +0 -16
  157. package/dist/esm/reify/optional-fail.d.ts.map +0 -1
  158. package/dist/esm/reify/optional-fail.js +0 -16
  159. package/dist/esm/reify/optional-fail.js.map +0 -1
  160. package/dist/esm/reify/rollback.d.ts +0 -5
  161. package/dist/esm/reify/rollback.d.ts.map +0 -1
  162. package/dist/esm/reify/rollback.js +0 -24
  163. package/dist/esm/reify/rollback.js.map +0 -1
  164. package/dist/esm/reify/update-importers-package-json.d.ts +0 -36
  165. package/dist/esm/reify/update-importers-package-json.d.ts.map +0 -1
  166. package/dist/esm/reify/update-importers-package-json.js +0 -120
  167. package/dist/esm/reify/update-importers-package-json.js.map +0 -1
  168. package/dist/esm/remove-optional-subgraph.d.ts +0 -34
  169. package/dist/esm/remove-optional-subgraph.d.ts.map +0 -1
  170. package/dist/esm/remove-optional-subgraph.js +0 -48
  171. package/dist/esm/remove-optional-subgraph.js.map +0 -1
  172. package/dist/esm/resolve-save-type.d.ts +0 -6
  173. package/dist/esm/resolve-save-type.d.ts.map +0 -1
  174. package/dist/esm/resolve-save-type.js +0 -5
  175. package/dist/esm/resolve-save-type.js.map +0 -1
  176. package/dist/esm/stringify-node.d.ts +0 -3
  177. package/dist/esm/stringify-node.d.ts.map +0 -1
  178. package/dist/esm/stringify-node.js +0 -24
  179. package/dist/esm/stringify-node.js.map +0 -1
  180. package/dist/esm/transfer-data/load.d.ts +0 -44
  181. package/dist/esm/transfer-data/load.d.ts.map +0 -1
  182. package/dist/esm/transfer-data/load.js +0 -176
  183. package/dist/esm/transfer-data/load.js.map +0 -1
  184. package/dist/esm/uninstall.d.ts +0 -15
  185. package/dist/esm/uninstall.d.ts.map +0 -1
  186. package/dist/esm/uninstall.js +0 -58
  187. package/dist/esm/uninstall.js.map +0 -1
  188. package/dist/esm/update.d.ts +0 -13
  189. package/dist/esm/update.d.ts.map +0 -1
  190. package/dist/esm/update.js +0 -63
  191. package/dist/esm/update.js.map +0 -1
  192. package/dist/esm/virtual-root.d.ts +0 -16
  193. package/dist/esm/virtual-root.d.ts.map +0 -1
  194. package/dist/esm/virtual-root.js +0 -79
  195. package/dist/esm/virtual-root.js.map +0 -1
  196. package/dist/esm/visualization/human-readable-output.d.ts +0 -27
  197. package/dist/esm/visualization/human-readable-output.d.ts.map +0 -1
  198. package/dist/esm/visualization/human-readable-output.js +0 -159
  199. package/dist/esm/visualization/human-readable-output.js.map +0 -1
  200. package/dist/esm/visualization/json-output.d.ts +0 -41
  201. package/dist/esm/visualization/json-output.d.ts.map +0 -1
  202. package/dist/esm/visualization/json-output.js +0 -51
  203. package/dist/esm/visualization/json-output.js.map +0 -1
  204. package/dist/esm/visualization/mermaid-output.d.ts +0 -17
  205. package/dist/esm/visualization/mermaid-output.d.ts.map +0 -1
  206. package/dist/esm/visualization/mermaid-output.js +0 -123
  207. package/dist/esm/visualization/mermaid-output.js.map +0 -1
  208. package/dist/esm/visualization/object-like-output.d.ts +0 -3
  209. package/dist/esm/visualization/object-like-output.d.ts.map +0 -1
  210. package/dist/esm/visualization/object-like-output.js +0 -48
  211. 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
  ![graph](https://github.com/user-attachments/assets/dfbed9e0-8ef0-4a43-993d-d3e5d1e5ae1d)
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; Ideal/Actual builders support skipping node loads when
45
- modifiers change.
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({ projectRoot: string }): Graph`
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
- ### `async ideal.build({ projectRoot: string }): Promise<Graph>`
60
+ ### `ideal.build(options): Promise<Graph>`
56
61
 
57
- This method returns a new `Graph` object, reading from the
58
- `package.json` file located at `projectRoot` dir and building up the
59
- graph representation of nodes and edges from the files read from the
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({ mainManifest: Manifest, projectRoot: string }): Graph`
66
+ ### `lockfile.load(options): Graph`
63
67
 
64
68
  Loads the lockfile file found at `projectRoot` and returns the graph.
65
69
 
66
- ### `reify(options): Promise<Diff>`
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
- Here's a quick example of how to use the `@vltpkg/graph.ideal.build`
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 { ideal } from '@vltpkg/graph'
103
+ ```ts
104
+ import { install } from '@vltpkg/graph'
81
105
 
82
- const graph = await ideal.build({ projectRoot: process.cwd() })
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 g = lockfile.load({
158
+ const graph = lockfile.load({
122
159
  projectRoot,
123
160
  mainManifest,
124
161
  packageJson,
125
- scurry,
126
162
  })
127
163
 
128
- // Save both lockfile formats
129
- lockfile.save({ graph: g, projectRoot, packageJson, scurry })
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.2",
4
+ "version": "1.0.0-rc.23",
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": "vlt technology inc. <support@vlt.sh> (http://vlt.sh)",
11
- "tshy": {
12
- "selfLink": false,
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
- "graph-run": "^1.1.0",
25
- "path-scurry": "^2.0.0",
26
- "promise-call-limit": "^3.0.2",
27
- "@vltpkg/cmd-shim": "1.0.0-rc.2",
28
- "@vltpkg/dss-breadcrumb": "1.0.0-rc.2",
29
- "@vltpkg/dep-id": "1.0.0-rc.2",
30
- "@vltpkg/fast-split": "1.0.0-rc.2",
31
- "@vltpkg/error-cause": "1.0.0-rc.2",
32
- "@vltpkg/package-info": "1.0.0-rc.2",
33
- "@vltpkg/init": "1.0.0-rc.2",
34
- "@vltpkg/package-json": "1.0.0-rc.2",
35
- "@vltpkg/pick-manifest": "1.0.0-rc.2",
36
- "@vltpkg/query": "1.0.0-rc.2",
37
- "@vltpkg/output": "1.0.0-rc.2",
38
- "@vltpkg/rollback-remove": "1.0.0-rc.2",
39
- "@vltpkg/run": "1.0.0-rc.2",
40
- "@vltpkg/satisfies": "1.0.0-rc.2",
41
- "@vltpkg/security-archive": "1.0.0-rc.2",
42
- "@vltpkg/spec": "1.0.0-rc.2",
43
- "@vltpkg/types": "1.0.0-rc.2",
44
- "@vltpkg/vlt-json": "1.0.0-rc.2",
45
- "@vltpkg/workspaces": "1.0.0-rc.2"
15
+ "@vltpkg/cmd-shim": "1.0.0-rc.23",
16
+ "@vltpkg/dep-id": "1.0.0-rc.23",
17
+ "@vltpkg/dss-breadcrumb": "1.0.0-rc.23",
18
+ "@vltpkg/error-cause": "1.0.0-rc.23",
19
+ "@vltpkg/fast-split": "1.0.0-rc.23",
20
+ "@vltpkg/graph-run": "1.0.0-rc.23",
21
+ "@vltpkg/init": "1.0.0-rc.23",
22
+ "@vltpkg/output": "1.0.0-rc.23",
23
+ "@vltpkg/package-info": "1.0.0-rc.23",
24
+ "@vltpkg/package-json": "1.0.0-rc.23",
25
+ "@vltpkg/pick-manifest": "1.0.0-rc.23",
26
+ "@vltpkg/query": "1.0.0-rc.23",
27
+ "@vltpkg/rollback-remove": "1.0.0-rc.23",
28
+ "@vltpkg/run": "1.0.0-rc.23",
29
+ "@vltpkg/satisfies": "1.0.0-rc.23",
30
+ "@vltpkg/security-archive": "1.0.0-rc.23",
31
+ "@vltpkg/spec": "1.0.0-rc.23",
32
+ "@vltpkg/types": "1.0.0-rc.23",
33
+ "@vltpkg/vlt-json": "1.0.0-rc.23",
34
+ "@vltpkg/workspaces": "1.0.0-rc.23",
35
+ "path-scurry": "^2.0.1",
36
+ "promise-call-limit": "^3.0.2"
46
37
  },
47
38
  "devDependencies": {
48
- "@eslint/js": "^9.34.0",
49
- "@types/node": "^22.17.2",
50
- "eslint": "^9.34.0",
51
- "prettier": "^3.6.2",
52
- "tap": "^21.1.0",
53
- "tar": "^7.4.3",
54
- "tshy": "^3.0.2",
39
+ "@eslint/js": "^9.39.1",
40
+ "@types/node": "^22.19.2",
41
+ "@vltpkg/vlt-json": "1.0.0-rc.23",
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.40.0",
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": "./dist/esm/index.js",
69
+ "module": "./dist/index.js",
69
70
  "type": "module",
70
71
  "exports": {
71
72
  "./package.json": "./package.json",
72
73
  ".": {
73
74
  "import": {
74
- "types": "./dist/esm/index.d.ts",
75
- "default": "./dist/esm/index.js"
75
+ "default": "./dist/index.js"
76
76
  }
77
77
  },
78
78
  "./browser": {
79
79
  "import": {
80
- "types": "./dist/esm/browser.d.ts",
81
- "default": "./dist/esm/browser.js"
80
+ "default": "./dist/browser.js"
82
81
  }
83
82
  }
84
83
  },
85
84
  "files": [
86
85
  "dist"
87
- ],
88
- "scripts": {
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"}