Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@vercel/build-utils

Package Overview
Dependencies
Maintainers
4
Versions
436
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/build-utils - npm Package Compare versions

Comparing version
13.26.2
to
13.26.3
+6
-0
CHANGELOG.md
# @vercel/build-utils
## 13.26.3
### Patch Changes
- b66bd3e: Fix prebuilt deployments failing with "invalid relative path" when using the `--standalone` flag in pnpm monorepos by skipping external node_modules symlinks and copying traced files at their logical paths instead.
## 13.26.2

@@ -4,0 +10,0 @@

+3
-0

@@ -8,3 +8,6 @@ import FileFsRef from '../file-fs-ref';

export declare function isSymbolicLink(mode: number): boolean;
export declare function isExternalSymlinkTarget(target: string): boolean;
export declare function getSymlinkTarget(file: File): string | null;
export declare function isExternalSymlink(file: File): boolean;
export declare function downloadFile(file: File, fsPath: string): Promise<FileFsRef>;
export default function download(files: Files, basePath: string, meta?: Meta): Promise<DownloadedFiles>;

@@ -33,3 +33,6 @@ "use strict";

downloadFile: () => downloadFile,
getSymlinkTarget: () => getSymlinkTarget,
isDirectory: () => isDirectory,
isExternalSymlink: () => isExternalSymlink,
isExternalSymlinkTarget: () => isExternalSymlinkTarget,
isSymbolicLink: () => isSymbolicLink

@@ -52,2 +55,26 @@ });

}
function isExternalSymlinkTarget(target) {
return target.startsWith("../") || target.startsWith("..\\") || import_path.default.isAbsolute(target);
}
function getSymlinkTarget(file) {
if (!isSymbolicLink(file.mode)) {
return null;
}
if (file.type === "FileFsRef") {
try {
return (0, import_fs_extra.readlinkSync)(file.fsPath);
} catch {
return null;
}
}
if (file.type === "FileBlob") {
const { data } = file;
return typeof data === "string" ? data : data.toString("utf8");
}
return null;
}
function isExternalSymlink(file) {
const target = getSymlinkTarget(file);
return target !== null && isExternalSymlinkTarget(target);
}
async function prepareSymlinkTarget(file, fsPath) {

@@ -129,3 +156,3 @@ const mkdirPromise = (0, import_fs_extra.mkdirp)(import_path.default.dirname(fsPath));

const parent = files[dir];
if (parent && isSymbolicLink(parent.mode)) {
if (parent && isSymbolicLink(parent.mode) && !isExternalSymlink(parent)) {
console.warn(

@@ -149,4 +176,7 @@ `Warning: file "${name}" is within a symlinked directory "${dir}" and will be ignored`

downloadFile,
getSymlinkTarget,
isDirectory,
isExternalSymlink,
isExternalSymlinkTarget,
isSymbolicLink
});
+2
-2

@@ -7,3 +7,3 @@ import FileBlob from './file-blob';

import { Prerender } from './prerender';
import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory } from './fs/download';
import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory, isExternalSymlink, isExternalSymlinkTarget, getSymlinkTarget } from './fs/download';
import getWriteableDirectory from './fs/get-writable-directory';

@@ -24,3 +24,3 @@ import glob, { GlobOptions } from './fs/glob';

export type { NodejsLambdaOptions };
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion, detectPackageManager, runNpmInstall, NpmInstallOutput, runBundleInstall, runPipInstall, PipInstallResult, runShellScript, runCustomInstallCommand, resetCustomInstallCommandSet, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, getServiceUrlEnvVars, getExperimentalServiceUrlEnvVars, streamToBuffer, streamToBufferChunks, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, sanitizeConsumerName, scanParentDirs, findPackageJson, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, };
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion, detectPackageManager, runNpmInstall, NpmInstallOutput, runBundleInstall, runPipInstall, PipInstallResult, runShellScript, runCustomInstallCommand, resetCustomInstallCommandSet, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, getServiceUrlEnvVars, getExperimentalServiceUrlEnvVars, streamToBuffer, streamToBufferChunks, debug, isSymbolicLink, isDirectory, isExternalSymlink, isExternalSymlinkTarget, getSymlinkTarget, getLambdaOptionsFromFunction, sanitizeConsumerName, scanParentDirs, findPackageJson, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, };
export { EdgeFunction } from './edge-function';

@@ -27,0 +27,0 @@ export { readConfigFile, getPackageJson } from './fs/read-config-file';

{
"name": "@vercel/build-utils",
"version": "13.26.2",
"version": "13.26.3",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is too big to display