@pnpm/deps.graph-builder 1100.0.26 → 1100.1.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @pnpm/deps.graph-builder
2
2
 
3
+ ## 1100.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Fixed an installed optional dependency being left without one of its own required dependencies. When a package reached through `optionalDependencies` is installable on the current system but one of its regular `dependencies` is not, a lockfile-based install skipped that dependency and installed the parent anyway, so importing the parent failed with `MODULE_NOT_FOUND`. The dependency is now installed, and an install-check warning reports the incompatibility. A dependency is still only skipped when every path to it is optional, or when the package that pulls it in was itself skipped [#13286](https://github.com/pnpm/pnpm/issues/13286).
8
+
9
+ ### Patch Changes
10
+
11
+ - Installing a local `file:` directory dependency with the global virtual store enabled no longer fails with `TypeError: Cannot read properties of undefined (reading 'split')` [#13335](https://github.com/pnpm/pnpm/issues/13335).
12
+
13
+ Local directory dependencies — `file:` directories and injected workspace packages — now get a global-virtual-store slot of their own per project. They used to share one slot across every project that depended on a directory of the same name, so a project could end up linked to another project's copy of the dependency.
14
+
15
+ - Updated dependencies:
16
+ - @pnpm/config.package-is-installable@1100.1.0
17
+ - @pnpm/core-loggers@1100.3.0
18
+ - @pnpm/deps.graph-hasher@1100.2.13
19
+ - @pnpm/deps.path@1100.0.12
20
+ - @pnpm/fs.symlink-dependency@1100.0.15
21
+ - @pnpm/hooks.types@1100.2.4
22
+ - @pnpm/installing.modules-yaml@1100.0.13
23
+ - @pnpm/lockfile.fs@1100.1.15
24
+ - @pnpm/lockfile.utils@1100.1.6
25
+ - @pnpm/patching.config@1100.0.13
26
+ - @pnpm/store.controller-types@1100.1.11
27
+ - @pnpm/types@1101.7.0
28
+
3
29
  ## 1100.0.26
4
30
 
5
31
  ### Patch Changes
@@ -8,6 +8,7 @@ interface PkgSnapshotWithLocation {
8
8
  export declare function iteratePkgsForVirtualStore(lockfile: LockfileObject, opts: {
9
9
  allowBuild?: AllowBuild;
10
10
  enableGlobalVirtualStore?: boolean;
11
+ lockfileDir: string;
11
12
  virtualStoreDirMaxLength: number;
12
13
  virtualStoreDir: string;
13
14
  globalVirtualStoreDir: string;
@@ -15,6 +15,7 @@ export function* iteratePkgsForVirtualStore(lockfile, opts) {
15
15
  allowBuild: opts.allowBuild,
16
16
  supportedArchitectures: opts.supportedArchitectures,
17
17
  nodeVersion,
18
+ lockfileDir: opts.lockfileDir,
18
19
  })) {
19
20
  yield {
20
21
  dirInVirtualStore: path.join(opts.globalVirtualStoreDir, hash),
@@ -44,6 +45,7 @@ export function* iteratePkgsForVirtualStore(lockfile, opts) {
44
45
  graph: lockfileToDepGraph(lockfile, opts.supportedArchitectures),
45
46
  supportedArchitectures: opts.supportedArchitectures,
46
47
  nodeVersion,
48
+ lockfileDir: opts.lockfileDir,
47
49
  };
48
50
  const hash = calcGraphNodeHash(graphNodeHashOpts, pkgMeta);
49
51
  dirInVirtualStore = path.join(opts.globalVirtualStoreDir, hash);
@@ -58,8 +60,8 @@ export function* iteratePkgsForVirtualStore(lockfile, opts) {
58
60
  }
59
61
  }
60
62
  }
61
- function hashDependencyPaths(lockfile, { allowBuild, supportedArchitectures, nodeVersion, }) {
62
- const graph = lockfileToDepGraph(lockfile, supportedArchitectures);
63
- return iterateHashedGraphNodes(graph, iteratePkgMeta(lockfile, graph), allowBuild, supportedArchitectures, nodeVersion);
63
+ function hashDependencyPaths(lockfile, opts) {
64
+ const graph = lockfileToDepGraph(lockfile, opts.supportedArchitectures);
65
+ return iterateHashedGraphNodes(graph, iteratePkgMeta(lockfile, graph), opts);
64
66
  }
65
67
  //# sourceMappingURL=iteratePkgsForVirtualStore.js.map
@@ -49,6 +49,12 @@ export interface LockfileToDepGraphOptions {
49
49
  pnpmVersion: string;
50
50
  patchedDependencies?: PatchGroupRecord;
51
51
  registries: Registries;
52
+ /**
53
+ * The dep paths a non-optional edge reaches, as classified by
54
+ * `filterLockfileByImportersAndEngine`. Installability is evaluated as
55
+ * optional for everything outside this set.
56
+ */
57
+ requiredDepPaths: Set<DepPath>;
52
58
  sideEffectsCacheRead: boolean;
53
59
  skipped: Set<DepPath>;
54
60
  storeController: StoreController;
@@ -81,10 +81,13 @@ async function buildGraphFromPackages(lockfile, currentLockfile, opts) {
81
81
  };
82
82
  const packageId = packageIdFromSnapshot(depPath, pkgSnapshot);
83
83
  if (!opts.force && packageIsInstallable(packageId, pkg, {
84
- engineStrict: opts.engineStrict,
84
+ // An incompatibility inside an `optionalDependencies` subtree is
85
+ // reported, not fatal — see `filterLockfileByImportersAndEngine`,
86
+ // which classifies these dep paths.
87
+ engineStrict: opts.engineStrict && pkgSnapshot.optional !== true,
85
88
  lockfileDir: opts.lockfileDir,
86
89
  nodeVersion: opts.nodeVersion,
87
- optional: pkgSnapshot.optional === true,
90
+ optional: !opts.requiredDepPaths.has(depPath),
88
91
  supportedArchitectures: opts.supportedArchitectures,
89
92
  }) === false) {
90
93
  opts.skipped.add(depPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/deps.graph-builder",
3
- "version": "1100.0.26",
3
+ "version": "1100.1.0",
4
4
  "description": "A package for building a dependency graph from a lockfile",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,20 +27,20 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
- "@pnpm/config.package-is-installable": "1100.0.16",
30
+ "@pnpm/config.package-is-installable": "1100.1.0",
31
31
  "@pnpm/constants": "1100.0.1",
32
- "@pnpm/core-loggers": "1100.2.5",
33
- "@pnpm/deps.graph-hasher": "1100.2.12",
34
- "@pnpm/deps.path": "1100.0.11",
35
- "@pnpm/fs.symlink-dependency": "1100.0.14",
36
- "@pnpm/hooks.types": "1100.2.3",
37
- "@pnpm/installing.modules-yaml": "1100.0.12",
38
- "@pnpm/lockfile.fs": "1100.1.14",
39
- "@pnpm/lockfile.utils": "1100.1.5",
40
- "@pnpm/patching.config": "1100.0.12",
32
+ "@pnpm/core-loggers": "1100.3.0",
33
+ "@pnpm/deps.graph-hasher": "1100.2.13",
34
+ "@pnpm/deps.path": "1100.0.12",
35
+ "@pnpm/fs.symlink-dependency": "1100.0.15",
36
+ "@pnpm/hooks.types": "1100.2.4",
37
+ "@pnpm/installing.modules-yaml": "1100.0.13",
38
+ "@pnpm/lockfile.fs": "1100.1.15",
39
+ "@pnpm/lockfile.utils": "1100.1.6",
40
+ "@pnpm/patching.config": "1100.0.13",
41
41
  "@pnpm/patching.types": "1100.0.1",
42
- "@pnpm/store.controller-types": "1100.1.10",
43
- "@pnpm/types": "1101.6.0",
42
+ "@pnpm/store.controller-types": "1100.1.11",
43
+ "@pnpm/types": "1101.7.0",
44
44
  "path-exists": "^5.0.0",
45
45
  "ramda": "npm:@pnpm/ramda@0.28.1"
46
46
  },
@@ -49,9 +49,9 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@jest/globals": "30.4.1",
52
- "@pnpm/deps.graph-builder": "1100.0.26",
52
+ "@pnpm/deps.graph-builder": "1100.1.0",
53
53
  "@pnpm/logger": "1100.0.0",
54
- "@types/ramda": "0.31.1"
54
+ "@types/ramda": "0.32.0"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=22.13"