@pnpm/fs.indexed-pkg-importer 1100.0.37 → 1100.0.39

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,19 @@
1
1
  # @pnpm/fs.indexed-pkg-importer
2
2
 
3
+ ## 1100.0.39
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @pnpm/fs.graceful-fs@1100.2.6
9
+ - @pnpm/store.controller-types@1101.3.6
10
+
11
+ ## 1100.0.38
12
+
13
+ ### Patch Changes
14
+
15
+ - `pnpm deploy` now keeps a symlink in the project whose target is missing from the source, such as a link into a `node_modules` directory that was removed after the build. Deploy used to fail with `ENOENT` on such a link [#17571](https://github.com/pnpm/pnpm/issues/17571).
16
+
3
17
  ## 1100.0.37
4
18
 
5
19
  ### Patch Changes
@@ -17,9 +17,10 @@ export function copyInternalSymlink(src, dest, links) {
17
17
  if (escapesDir(links.writtenDir, resolved))
18
18
  return false;
19
19
  if (!links.imported.has(path.relative(links.writtenDir, resolved).split(path.sep).join('/'))) {
20
- const isDir = isDirectory(src);
21
- if (links.symlinkTargets !== 'internal' || !isDir)
22
- return isDir;
20
+ if (targetKind(src) === 'other')
21
+ return false;
22
+ if (links.symlinkTargets !== 'internal')
23
+ return true;
23
24
  }
24
25
  if (process.platform !== 'win32') {
25
26
  fs.symlinkSync(target, dest);
@@ -29,7 +30,9 @@ export function copyInternalSymlink(src, dest, links) {
29
30
  }
30
31
  function copyInternalSymlinkWindows(opts) {
31
32
  const { dest, links, resolved, src, target } = opts;
32
- const isDir = isDirectory(src);
33
+ // A missing target is linked as a directory: under `internal` it is typically
34
+ // a directory the deploy installs, such as `node_modules/<pkg>`.
35
+ const isDir = targetKind(src) !== 'other';
33
36
  try {
34
37
  fs.symlinkSync(target, dest, isDir ? 'dir' : 'file');
35
38
  return true;
@@ -53,13 +56,13 @@ function realpathOrSelf(file) {
53
56
  throw err;
54
57
  }
55
58
  }
56
- function isDirectory(file) {
59
+ function targetKind(file) {
57
60
  try {
58
- return fs.statSync(file).isDirectory();
61
+ return fs.statSync(file).isDirectory() ? 'directory' : 'other';
59
62
  }
60
63
  catch (err) {
61
64
  if (isError(err) && 'code' in err && err.code === 'ENOENT')
62
- return false;
65
+ return 'missing';
63
66
  throw err;
64
67
  }
65
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/fs.indexed-pkg-importer",
3
- "version": "1100.0.37",
3
+ "version": "1100.0.39",
4
4
  "description": "Replicates indexed directories using hard links, copies, or cloning",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -39,8 +39,8 @@
39
39
  "dependencies": {
40
40
  "@pnpm/core-loggers": "1101.0.4",
41
41
  "@pnpm/error": "1100.2.2",
42
- "@pnpm/fs.graceful-fs": "1100.2.5",
43
- "@pnpm/store.controller-types": "1101.3.5",
42
+ "@pnpm/fs.graceful-fs": "1100.2.6",
43
+ "@pnpm/store.controller-types": "1101.3.6",
44
44
  "@pnpm/text.sanitize": "1100.0.1",
45
45
  "@reflink/reflink": "0.1.19",
46
46
  "@zkochan/rimraf": "^4.0.0",
@@ -49,16 +49,16 @@
49
49
  "p-limit": "^7.3.3",
50
50
  "path-temp": "^3.0.0",
51
51
  "rename-overwrite": "^7.0.1",
52
- "sanitize-filename": "^1.6.4"
52
+ "sanitize-filename": "^1.6.5"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@pnpm/logger": "^1100.0.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@jest/globals": "30.4.1",
59
- "@pnpm/fs.indexed-pkg-importer": "1100.0.37",
59
+ "@pnpm/fs.indexed-pkg-importer": "1100.0.39",
60
60
  "@pnpm/logger": "1100.0.0",
61
- "@pnpm/prepare": "1100.0.39",
61
+ "@pnpm/prepare": "1100.0.40",
62
62
  "@types/fs-extra": "^11.0.4"
63
63
  },
64
64
  "engines": {