@vercel/build-utils 5.0.7 → 5.0.8

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.
@@ -67,6 +67,20 @@ async function download(files, basePath, meta) {
67
67
  if (Array.isArray(filesChanged) && !filesChanged.includes(name)) {
68
68
  return;
69
69
  }
70
+ // Some builders resolve symlinks and return both
71
+ // a file, node_modules/<symlink>/package.json, and
72
+ // node_modules/<symlink>, a symlink.
73
+ // Removing the file matches how the yazl lambda zip
74
+ // behaves so we can use download() with `vercel build`.
75
+ const parts = name.split('/');
76
+ for (let i = 1; i < parts.length; i++) {
77
+ const dir = parts.slice(0, i).join('/');
78
+ const parent = files[dir];
79
+ if (parent && isSymbolicLink(parent.mode)) {
80
+ console.warn(`Warning: file "${name}" is within a symlinked directory "${dir}" and will be ignored`);
81
+ return;
82
+ }
83
+ }
70
84
  const file = files[name];
71
85
  const fsPath = path_1.default.join(basePath, name);
72
86
  files2[name] = await downloadFile(file, fsPath);
package/dist/index.js CHANGED
@@ -30535,6 +30535,20 @@ async function download(files, basePath, meta) {
30535
30535
  if (Array.isArray(filesChanged) && !filesChanged.includes(name)) {
30536
30536
  return;
30537
30537
  }
30538
+ // Some builders resolve symlinks and return both
30539
+ // a file, node_modules/<symlink>/package.json, and
30540
+ // node_modules/<symlink>, a symlink.
30541
+ // Removing the file matches how the yazl lambda zip
30542
+ // behaves so we can use download() with `vercel build`.
30543
+ const parts = name.split('/');
30544
+ for (let i = 1; i < parts.length; i++) {
30545
+ const dir = parts.slice(0, i).join('/');
30546
+ const parent = files[dir];
30547
+ if (parent && isSymbolicLink(parent.mode)) {
30548
+ console.warn(`Warning: file "${name}" is within a symlinked directory "${dir}" and will be ignored`);
30549
+ return;
30550
+ }
30551
+ }
30538
30552
  const file = files[name];
30539
30553
  const fsPath = path_1.default.join(basePath, name);
30540
30554
  files2[name] = await downloadFile(file, fsPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "5.0.7",
3
+ "version": "5.0.8",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -48,5 +48,5 @@
48
48
  "typescript": "4.3.4",
49
49
  "yazl": "2.5.1"
50
50
  },
51
- "gitHead": "e8c7db59cf2746422f1f7e14cc6b7f901c243d50"
51
+ "gitHead": "543ffdfe5ccfb59c9c455fc50df3bb8ed1eaf567"
52
52
  }