@pnpm/installing.linking.real-hoist 1100.1.14 → 1100.1.16

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,20 @@
1
1
  # @pnpm/real-hoist
2
2
 
3
+ ## 1100.1.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @pnpm/deps.path@1101.0.1
9
+ - @pnpm/lockfile.types@1100.1.0
10
+ - @pnpm/lockfile.utils@1102.1.0
11
+
12
+ ## 1100.1.15
13
+
14
+ ### Patch Changes
15
+
16
+ - Under `nodeLinker: hoisted`, peer-resolution variants of an injected directory dependency (a `file:` snapshot) are materialized as separate copies again instead of collapsing onto the first-seen variant. Each copy keeps its own peer-resolved dependency set, so a project pinning one peer version no longer resolves another project's variant — Bit root components with conflicting peers across injected copies rely on this.
17
+
3
18
  ## 1100.1.14
4
19
 
5
20
  ### Patch Changes
package/lib/index.d.ts CHANGED
@@ -31,6 +31,16 @@ export type { HoisterResult };
31
31
  * `(alias, depPath)`, so an alias exposing a package under a second
32
32
  * name gets a node, and a directory, of its own. An index over the
33
33
  * result holds the list and resolves an edge to its first entry.
34
+ *
35
+ * An injected directory dependency (a `directory` resolution) keeps
36
+ * its peer suffix: every variant of it is a separate on-disk copy of
37
+ * the local package, materialized with its own peer-resolved
38
+ * dependency set, so collapsing the variants would rewire every
39
+ * dependent of the losing one onto the survivor's children (Bit's
40
+ * root components pin conflicting peers across such copies on
41
+ * purpose). The registry collapse exists to stop peer-variant
42
+ * explosion on large lockfiles; directory snapshots are one per
43
+ * injected workspace package and cannot explode that way.
34
44
  */
35
45
  export declare function getHoisterPkgId(depPath: string, pkgSnapshot: PackageSnapshot): string;
36
46
  /**
package/lib/index.js CHANGED
@@ -18,8 +18,25 @@ import { hoist as _hoist, HoisterDependencyKind } from '@yarnpkg/nm/hoist';
18
18
  * `(alias, depPath)`, so an alias exposing a package under a second
19
19
  * name gets a node, and a directory, of its own. An index over the
20
20
  * result holds the list and resolves an edge to its first entry.
21
+ *
22
+ * An injected directory dependency (a `directory` resolution) keeps
23
+ * its peer suffix: every variant of it is a separate on-disk copy of
24
+ * the local package, materialized with its own peer-resolved
25
+ * dependency set, so collapsing the variants would rewire every
26
+ * dependent of the losing one onto the survivor's children (Bit's
27
+ * root components pin conflicting peers across such copies on
28
+ * purpose). The registry collapse exists to stop peer-variant
29
+ * explosion on large lockfiles; directory snapshots are one per
30
+ * injected workspace package and cannot explode that way.
21
31
  */
22
32
  export function getHoisterPkgId(depPath, pkgSnapshot) {
33
+ // `resolution` is typed as required, but the lockfile is parsed from
34
+ // untyped YAML — guard so a malformed snapshot degrades to the
35
+ // collapsed identity instead of a TypeError here.
36
+ const resolution = pkgSnapshot.resolution;
37
+ if (resolution != null && 'directory' in resolution && resolution.directory != null) {
38
+ return depPath;
39
+ }
23
40
  const { name, version } = nameVerFromPkgSnapshot(depPath, pkgSnapshot);
24
41
  return `${name}@${version}`;
25
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/installing.linking.real-hoist",
3
- "version": "1100.1.14",
3
+ "version": "1100.1.16",
4
4
  "description": "Hoists dependencies in a node_modules created by pnpm",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,18 +27,18 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
- "@pnpm/deps.path": "1101.0.0",
30
+ "@pnpm/deps.path": "1101.0.1",
31
31
  "@pnpm/error": "1100.1.3",
32
- "@pnpm/lockfile.types": "1100.0.20",
33
- "@pnpm/lockfile.utils": "1102.0.0",
32
+ "@pnpm/lockfile.types": "1100.1.0",
33
+ "@pnpm/lockfile.utils": "1102.1.0",
34
34
  "@yarnpkg/nm": "4.1.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@jest/globals": "30.4.1",
38
- "@pnpm/installing.linking.real-hoist": "1100.1.14",
39
- "@pnpm/lockfile.fs": "1100.2.3",
38
+ "@pnpm/installing.linking.real-hoist": "1100.1.16",
39
+ "@pnpm/lockfile.fs": "1100.2.5",
40
40
  "@pnpm/test-fixtures": "1100.0.1",
41
- "@pnpm/types": "1102.0.0"
41
+ "@pnpm/types": "1102.1.0"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=22.13"