@vltpkg/graph 1.3.0 → 1.3.1

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 (2) hide show
  1. package/dist/node.js +12 -10
  2. package/package.json +21 -21
package/dist/node.js CHANGED
@@ -304,20 +304,22 @@ export class Node {
304
304
  const spec = hydrateTuple(tuple, this.#name, this.#options);
305
305
  const dist = this.manifest?.dist;
306
306
  const tarball = dist?.tarball || spec.conventionalRegistryTarball;
307
+ // Use the manifest's own reference if there is one. Otherwise build
308
+ // the URL the way the registry names these: the same stem as the
309
+ // `.tgz` with a different extension. Relying on that convention is
310
+ // what lets a lockfile node, which has no manifest, store one flag
311
+ // bit instead of a second URL.
312
+ const alt = this.#brotli ? brotliAlternate(dist) : undefined;
307
313
  const brotli = this.#brotli ?
308
- // the manifest's own reference when there is one, and otherwise
309
- // the registry's naming for it: same stem as the `.tgz`, a
310
- // different extension. That convention is what lets a lockfile
311
- // node -- which has no manifest -- spend one flag bit rather
312
- // than a second URL.
313
- (brotliAlternate(dist) ??
314
- (tarball && brotliTarballName(tarball)))
314
+ (alt?.tarball ?? (tarball && brotliTarballName(tarball)))
315
315
  : undefined;
316
316
  if (brotli) {
317
317
  this.resolved = brotli;
318
- // `dist.integrity` describes the `.tgz`. The `.tar.br` is a
319
- // different artifact with a different hash, pinned by its own
320
- // `Repr-Digest` on the install that first fetches it.
318
+ // `dist.integrity` belongs to the `.tgz`, so never copy it here.
319
+ // Use the alternate's own hash if the registry sent one. If not,
320
+ // the first fetch learns it from the Repr-Digest header.
321
+ if (alt?.integrity)
322
+ this.integrity ??= alt.integrity;
321
323
  return;
322
324
  }
323
325
  this.resolved = tarball;
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.3.0",
4
+ "version": "1.3.1",
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.3.0",
17
- "@vltpkg/dep-id": "1.3.0",
18
- "@vltpkg/dss-breadcrumb": "1.3.0",
19
- "@vltpkg/error-cause": "1.3.0",
20
- "@vltpkg/fast-split": "1.3.0",
21
- "@vltpkg/graph-run": "1.3.0",
22
- "@vltpkg/init": "1.3.0",
23
- "@vltpkg/output": "1.3.0",
24
- "@vltpkg/package-info": "1.3.0",
25
- "@vltpkg/package-json": "1.3.0",
26
- "@vltpkg/pick-manifest": "1.3.0",
27
- "@vltpkg/query": "1.3.0",
28
- "@vltpkg/rollback-remove": "1.3.0",
29
- "@vltpkg/run": "1.3.0",
30
- "@vltpkg/satisfies": "1.3.0",
31
- "@vltpkg/security-archive": "1.3.0",
32
- "@vltpkg/spec": "1.3.0",
33
- "@vltpkg/types": "1.3.0",
34
- "@vltpkg/vlt-json": "1.3.0",
35
- "@vltpkg/workspaces": "1.3.0",
16
+ "@vltpkg/cmd-shim": "1.3.1",
17
+ "@vltpkg/dep-id": "1.3.1",
18
+ "@vltpkg/dss-breadcrumb": "1.3.1",
19
+ "@vltpkg/error-cause": "1.3.1",
20
+ "@vltpkg/fast-split": "1.3.1",
21
+ "@vltpkg/graph-run": "1.3.1",
22
+ "@vltpkg/init": "1.3.1",
23
+ "@vltpkg/output": "1.3.1",
24
+ "@vltpkg/package-info": "1.3.1",
25
+ "@vltpkg/package-json": "1.3.1",
26
+ "@vltpkg/pick-manifest": "1.3.1",
27
+ "@vltpkg/query": "1.3.1",
28
+ "@vltpkg/rollback-remove": "1.3.1",
29
+ "@vltpkg/run": "1.3.1",
30
+ "@vltpkg/satisfies": "1.3.1",
31
+ "@vltpkg/security-archive": "1.3.1",
32
+ "@vltpkg/spec": "1.3.1",
33
+ "@vltpkg/types": "1.3.1",
34
+ "@vltpkg/vlt-json": "1.3.1",
35
+ "@vltpkg/workspaces": "1.3.1",
36
36
  "path-scurry": "^2.0.1",
37
37
  "promise-call-limit": "^3.0.2"
38
38
  },