@vercel/build-utils
Advanced tools
+6
-0
| # @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 @@ |
@@ -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>; |
+31
-1
@@ -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'; |
+1
-1
| { | ||
| "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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2003530
0.12%51403
0.12%