@vltpkg/graph 1.6.0 → 1.6.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.
package/dist/install.js CHANGED
@@ -47,7 +47,10 @@ export const install = async (options, add) => {
47
47
  }
48
48
  catch (err) {
49
49
  if (asError(err).message === 'Could not read package.json file') {
50
- await init({ cwd: options.projectRoot });
50
+ await init({
51
+ cwd: options.projectRoot,
52
+ packageJson: options.packageJson,
53
+ });
51
54
  mainManifest = options.packageJson.read(options.projectRoot, {
52
55
  reload: true,
53
56
  });
@@ -1,7 +1,6 @@
1
1
  import { error } from '@vltpkg/error-cause';
2
2
  import { asDepID, splitDepID, splitExtra, } from '@vltpkg/dep-id/browser';
3
3
  import { getBooleanFlagsFromNum, getBuildStateFromNum, } from "./types.js";
4
- import { tarballFormat } from '@vltpkg/types';
5
4
  export const loadNodes = (graph, nodes, options, actual, throwOnMissingManifest) => {
6
5
  const entries = Object.entries(nodes);
7
6
  const nodeCount = entries.length;
@@ -76,16 +75,12 @@ export const loadNodes = (graph, nodes, options, actual, throwOnMissingManifest)
76
75
  // before setResolved(), which needs it to pick the extension for a
77
76
  // node whose `resolved` the lockfile left out
78
77
  node.brotli = brotli;
79
- node.integrity = integrity ?? referenceNode?.integrity;
80
78
  // `integrity` is the hash of the artifact `resolved` points at, so a
81
- // reference url only stands in for an elided one when it names the
82
- // kind of tarball the flag bit says the lockfile's own hash is for
83
- const refResolved = referenceNode?.resolved;
84
- const refResolvedUsable = !integrity ||
85
- !refResolved ||
86
- (tarballFormat(refResolved) === 'brotli') === brotli;
79
+ // reference node only fills in for the kind the flag bit names
80
+ const ref = !!referenceNode?.brotli === brotli ? referenceNode : undefined;
81
+ node.integrity = integrity ?? ref?.integrity;
87
82
  node.resolved =
88
- type === 'remote' ? filepath : ((resolved ?? (refResolvedUsable ? refResolved : undefined)));
83
+ type === 'remote' ? filepath : (resolved ?? ref?.resolved);
89
84
  node.resolvedFromLockfile = !!(node.integrity && node.resolved);
90
85
  node.projectRoot = graph.projectRoot;
91
86
  if (!node.resolved)
package/dist/node.js CHANGED
@@ -371,6 +371,12 @@ export class Node {
371
371
  case 'registry':
372
372
  this.#registryNodeResolved(tuple);
373
373
  break;
374
+ case 'git':
375
+ // a hosted git committish is fetched as the host's tarball
376
+ this.resolved =
377
+ hydrateTuple(tuple, this.#name, this.#options).final
378
+ .remoteURL ?? resolved;
379
+ break;
374
380
  default:
375
381
  this.resolved = resolved;
376
382
  break;
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.6.0",
4
+ "version": "1.6.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.6.0",
17
- "@vltpkg/dep-id": "1.6.0",
18
- "@vltpkg/dss-breadcrumb": "1.6.0",
19
- "@vltpkg/error-cause": "1.6.0",
20
- "@vltpkg/fast-split": "1.6.0",
21
- "@vltpkg/graph-run": "1.6.0",
22
- "@vltpkg/init": "1.6.0",
23
- "@vltpkg/output": "1.6.0",
24
- "@vltpkg/package-info": "1.6.0",
25
- "@vltpkg/package-json": "1.6.0",
26
- "@vltpkg/pick-manifest": "1.6.0",
27
- "@vltpkg/query": "1.6.0",
28
- "@vltpkg/rollback-remove": "1.6.0",
29
- "@vltpkg/run": "1.6.0",
30
- "@vltpkg/satisfies": "1.6.0",
31
- "@vltpkg/security-archive": "1.6.0",
32
- "@vltpkg/spec": "1.6.0",
33
- "@vltpkg/types": "1.6.0",
34
- "@vltpkg/vlt-json": "1.6.0",
35
- "@vltpkg/workspaces": "1.6.0",
16
+ "@vltpkg/cmd-shim": "1.6.1",
17
+ "@vltpkg/dep-id": "1.6.1",
18
+ "@vltpkg/dss-breadcrumb": "1.6.1",
19
+ "@vltpkg/error-cause": "1.6.1",
20
+ "@vltpkg/fast-split": "1.6.1",
21
+ "@vltpkg/graph-run": "1.6.1",
22
+ "@vltpkg/init": "1.6.1",
23
+ "@vltpkg/output": "1.6.1",
24
+ "@vltpkg/package-info": "1.6.1",
25
+ "@vltpkg/package-json": "1.6.1",
26
+ "@vltpkg/pick-manifest": "1.6.1",
27
+ "@vltpkg/query": "1.6.1",
28
+ "@vltpkg/rollback-remove": "1.6.1",
29
+ "@vltpkg/run": "1.6.1",
30
+ "@vltpkg/satisfies": "1.6.1",
31
+ "@vltpkg/security-archive": "1.6.1",
32
+ "@vltpkg/spec": "1.6.1",
33
+ "@vltpkg/types": "1.6.1",
34
+ "@vltpkg/vlt-json": "1.6.1",
35
+ "@vltpkg/workspaces": "1.6.1",
36
36
  "path-scurry": "^2.0.1",
37
37
  "promise-call-limit": "^3.0.2"
38
38
  },