@vltpkg/graph 1.0.0-rc.29 → 1.0.0-rc.30

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.
@@ -180,7 +180,10 @@ const parseDir = (options, scurry, packageJson, depsFound, graph, fromNode, curr
180
180
  const depType = shorten(type, alias, fromNode.manifest);
181
181
  let spec = Spec.parse(alias, bareSpec, {
182
182
  ...options,
183
- registry: fromNode.registry,
183
+ // fall back to options.registry (which the lockfile merges into)
184
+ // so importer-level edges don't silently revert to the default
185
+ // npm registry. see vltpkg/vltpkg#1580.
186
+ registry: fromNode.registry ?? options.registry,
184
187
  });
185
188
  // Check for active modifiers and replace spec if a modifier is complete
186
189
  const { spec: modifiedSpec, queryModifier } = maybeApplyModifierToSpec(spec, alias, modifierRefs);
@@ -239,7 +242,7 @@ const parseDir = (options, scurry, packageJson, depsFound, graph, fromNode, curr
239
242
  const depType = shorten(type, name, fromNode.manifest);
240
243
  let spec = Spec.parse(name, bareSpec, {
241
244
  ...options,
242
- registry: fromNode.registry,
245
+ registry: fromNode.registry ?? options.registry,
243
246
  });
244
247
  // Check for active modifiers and replace spec for missing dependencies
245
248
  const { spec: modifiedSpec, queryModifier } = maybeApplyModifierToSpec(spec, name, modifierRefs);
package/dist/install.js CHANGED
@@ -165,8 +165,13 @@ export const install = async (options, add) => {
165
165
  });
166
166
  // If lockfileOnly is enabled, skip reify and only save the lockfile
167
167
  if (options.lockfileOnly) {
168
- // Save only the main lockfile, skip all filesystem operations
169
- lockfile.save({ graph, modifiers });
168
+ // Save only the main lockfile, skip all filesystem operations.
169
+ // Spread `options` so that spec-level config (registry,
170
+ // scoped-registries, git-hosts, catalogs, etc.) round-trips
171
+ // through the lockfile - otherwise subsequent installs lose
172
+ // the configured registry and rewrite node/edge DepIDs back
173
+ // to the default npm registry. (See vltpkg/vltpkg#1580.)
174
+ lockfile.save({ ...options, graph, modifiers });
170
175
  const saveImportersPackageJson =
171
176
  /* c8 ignore next */
172
177
  add?.modifiedDependencies || remove.modifiedDependencies ?
@@ -78,11 +78,14 @@ export const loadEdges = (graph, edges, options) => {
78
78
  toNode = graph.nodes.get(asDepID(toId));
79
79
  }
80
80
  }
81
- // Parse spec once we know the nodes are valid
82
- const spec = Spec.parse(specName, valRest.substring(0, vrSplit), {
83
- ...options,
84
- registry: fromNode.registry,
85
- });
81
+ // Use the merged options directly they already carry the
82
+ // correct registry from the lockfile's `options` + caller config.
83
+ // `fromNode.registry` is not populated yet at this point (the
84
+ // post-load hydration loop in load.ts sets it *after* edges are
85
+ // loaded), so overriding here would always inject `undefined`
86
+ // and silently revert to the default npm registry.
87
+ // See vltpkg/vltpkg#1580.
88
+ const spec = Spec.parse(specName, valRest.substring(0, vrSplit), options);
86
89
  if (useOptimizations) {
87
90
  edgeProcessingQueue.push({
88
91
  fromNode,
package/dist/uninstall.js CHANGED
@@ -34,8 +34,11 @@ export const uninstall = async (options, remove) => {
34
34
  });
35
35
  // If lockfileOnly is enabled, skip reify and only save the lockfile
36
36
  if (options.lockfileOnly) {
37
- // Save only the main lockfile, skip all filesystem operations
38
- lockfile.save({ graph, modifiers });
37
+ // Save only the main lockfile, skip all filesystem operations.
38
+ // Spread `options` so that spec-level config (registry,
39
+ // scoped-registries, git-hosts, catalogs, etc.) round-trips
40
+ // through the lockfile. See vltpkg/vltpkg#1580.
41
+ lockfile.save({ ...options, graph, modifiers });
39
42
  const saveImportersPackageJson =
40
43
  /* c8 ignore next */
41
44
  remove?.modifiedDependencies ?
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.29",
4
+ "version": "1.0.0-rc.30",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,26 +13,26 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/cmd-shim": "1.0.0-rc.29",
17
- "@vltpkg/dep-id": "1.0.0-rc.29",
18
- "@vltpkg/dss-breadcrumb": "1.0.0-rc.29",
19
- "@vltpkg/error-cause": "1.0.0-rc.29",
20
- "@vltpkg/fast-split": "1.0.0-rc.29",
21
- "@vltpkg/graph-run": "1.0.0-rc.29",
22
- "@vltpkg/init": "1.0.0-rc.29",
23
- "@vltpkg/output": "1.0.0-rc.29",
24
- "@vltpkg/package-info": "1.0.0-rc.29",
25
- "@vltpkg/package-json": "1.0.0-rc.29",
26
- "@vltpkg/pick-manifest": "1.0.0-rc.29",
27
- "@vltpkg/query": "1.0.0-rc.29",
28
- "@vltpkg/rollback-remove": "1.0.0-rc.29",
29
- "@vltpkg/run": "1.0.0-rc.29",
30
- "@vltpkg/satisfies": "1.0.0-rc.29",
31
- "@vltpkg/security-archive": "1.0.0-rc.29",
32
- "@vltpkg/spec": "1.0.0-rc.29",
33
- "@vltpkg/types": "1.0.0-rc.29",
34
- "@vltpkg/vlt-json": "1.0.0-rc.29",
35
- "@vltpkg/workspaces": "1.0.0-rc.29",
16
+ "@vltpkg/cmd-shim": "1.0.0-rc.30",
17
+ "@vltpkg/dep-id": "1.0.0-rc.30",
18
+ "@vltpkg/dss-breadcrumb": "1.0.0-rc.30",
19
+ "@vltpkg/error-cause": "1.0.0-rc.30",
20
+ "@vltpkg/fast-split": "1.0.0-rc.30",
21
+ "@vltpkg/graph-run": "1.0.0-rc.30",
22
+ "@vltpkg/init": "1.0.0-rc.30",
23
+ "@vltpkg/output": "1.0.0-rc.30",
24
+ "@vltpkg/package-info": "1.0.0-rc.30",
25
+ "@vltpkg/package-json": "1.0.0-rc.30",
26
+ "@vltpkg/pick-manifest": "1.0.0-rc.30",
27
+ "@vltpkg/query": "1.0.0-rc.30",
28
+ "@vltpkg/rollback-remove": "1.0.0-rc.30",
29
+ "@vltpkg/run": "1.0.0-rc.30",
30
+ "@vltpkg/satisfies": "1.0.0-rc.30",
31
+ "@vltpkg/security-archive": "1.0.0-rc.30",
32
+ "@vltpkg/spec": "1.0.0-rc.30",
33
+ "@vltpkg/types": "1.0.0-rc.30",
34
+ "@vltpkg/vlt-json": "1.0.0-rc.30",
35
+ "@vltpkg/workspaces": "1.0.0-rc.30",
36
36
  "path-scurry": "^2.0.1",
37
37
  "promise-call-limit": "^3.0.2"
38
38
  },