@pnpm/deps.graph-builder 1100.0.9 → 1100.0.11

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.
@@ -1,10 +1,21 @@
1
1
  import path from 'node:path';
2
- import { calcGraphNodeHash, iterateHashedGraphNodes, iteratePkgMeta, lockfileToDepGraph, } from '@pnpm/deps.graph-hasher';
2
+ import { calcGraphNodeHash, findRuntimeNodeVersion, iterateHashedGraphNodes, iteratePkgMeta, lockfileToDepGraph, } from '@pnpm/deps.graph-hasher';
3
3
  import * as dp from '@pnpm/deps.path';
4
4
  import { nameVerFromPkgSnapshot, } from '@pnpm/lockfile.utils';
5
5
  export function* iteratePkgsForVirtualStore(lockfile, opts) {
6
+ // Resolve the project's pinned runtime Node version once per
7
+ // invocation — the result drives every snapshot's GVS hash (or
8
+ // the side-effects-cache key prefix in the non-GVS runtime
9
+ // branch). `undefined` when no `engines.runtime` / `devEngines.runtime`
10
+ // pin reached the lockfile, in which case the hasher falls through
11
+ // to the host-detected Node.
12
+ const nodeVersion = findRuntimeNodeVersion(Object.keys(lockfile.packages ?? {}));
6
13
  if (opts.enableGlobalVirtualStore) {
7
- for (const { hash, pkgMeta } of hashDependencyPaths(lockfile, opts.allowBuild, opts.supportedArchitectures)) {
14
+ for (const { hash, pkgMeta } of hashDependencyPaths(lockfile, {
15
+ allowBuild: opts.allowBuild,
16
+ supportedArchitectures: opts.supportedArchitectures,
17
+ nodeVersion,
18
+ })) {
8
19
  yield {
9
20
  dirInVirtualStore: path.join(opts.globalVirtualStoreDir, hash),
10
21
  pkgMeta,
@@ -32,6 +43,7 @@ export function* iteratePkgsForVirtualStore(lockfile, opts) {
32
43
  cache: {},
33
44
  graph: lockfileToDepGraph(lockfile, opts.supportedArchitectures),
34
45
  supportedArchitectures: opts.supportedArchitectures,
46
+ nodeVersion,
35
47
  };
36
48
  const hash = calcGraphNodeHash(graphNodeHashOpts, pkgMeta);
37
49
  dirInVirtualStore = path.join(opts.globalVirtualStoreDir, hash);
@@ -46,8 +58,8 @@ export function* iteratePkgsForVirtualStore(lockfile, opts) {
46
58
  }
47
59
  }
48
60
  }
49
- function hashDependencyPaths(lockfile, allowBuild, supportedArchitectures) {
61
+ function hashDependencyPaths(lockfile, { allowBuild, supportedArchitectures, nodeVersion, }) {
50
62
  const graph = lockfileToDepGraph(lockfile, supportedArchitectures);
51
- return iterateHashedGraphNodes(graph, iteratePkgMeta(lockfile, graph), allowBuild, supportedArchitectures);
63
+ return iterateHashedGraphNodes(graph, iteratePkgMeta(lockfile, graph), allowBuild, supportedArchitectures, nodeVersion);
52
64
  }
53
65
  //# sourceMappingURL=iteratePkgsForVirtualStore.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/deps.graph-builder",
3
- "version": "1100.0.9",
3
+ "version": "1100.0.11",
4
4
  "description": "A package for building a dependency graph from a lockfile",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -26,26 +26,26 @@
26
26
  "dependencies": {
27
27
  "path-exists": "^5.0.0",
28
28
  "ramda": "npm:@pnpm/ramda@0.28.1",
29
- "@pnpm/config.package-is-installable": "1100.0.4",
30
- "@pnpm/core-loggers": "1100.0.2",
31
- "@pnpm/deps.graph-hasher": "1100.1.5",
32
- "@pnpm/deps.path": "1100.0.3",
33
- "@pnpm/installing.modules-yaml": "1100.0.4",
34
- "@pnpm/lockfile.utils": "1100.0.7",
35
- "@pnpm/lockfile.fs": "1100.0.8",
36
- "@pnpm/patching.config": "1100.0.3",
37
- "@pnpm/hooks.types": "1100.0.6",
29
+ "@pnpm/config.package-is-installable": "1100.0.6",
30
+ "@pnpm/constants": "1100.0.0",
31
+ "@pnpm/core-loggers": "1100.1.1",
32
+ "@pnpm/deps.graph-hasher": "1100.2.1",
33
+ "@pnpm/deps.path": "1100.0.4",
34
+ "@pnpm/hooks.types": "1100.0.8",
35
+ "@pnpm/lockfile.utils": "1100.0.9",
36
+ "@pnpm/lockfile.fs": "1100.1.1",
37
+ "@pnpm/installing.modules-yaml": "1100.0.5",
38
+ "@pnpm/patching.config": "1100.0.4",
38
39
  "@pnpm/patching.types": "1100.0.0",
39
- "@pnpm/store.controller-types": "1100.0.7",
40
- "@pnpm/types": "1101.1.0",
41
- "@pnpm/constants": "1100.0.0"
40
+ "@pnpm/store.controller-types": "1100.1.1",
41
+ "@pnpm/types": "1101.1.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@pnpm/logger": ">=1001.0.0 <1002.0.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/ramda": "0.31.1",
48
- "@pnpm/deps.graph-builder": "1100.0.9",
48
+ "@pnpm/deps.graph-builder": "1100.0.11",
49
49
  "@pnpm/logger": "1100.0.0"
50
50
  },
51
51
  "engines": {