@vercel/build-utils 7.8.0 → 7.9.1

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,17 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 7.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Export `getSupportedNodeVersion` ([#11277](https://github.com/vercel/vercel/pull/11277))
8
+
9
+ ## 7.9.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Add `base` parameter to `scanParentDirs()` ([#11261](https://github.com/vercel/vercel/pull/11261))
14
+
3
15
  ## 7.8.0
4
16
 
5
17
  ### Minor Changes
@@ -75,7 +75,7 @@ export declare function getNodeBinPaths({ start, base, }: TraverseUpDirectoriesP
75
75
  export declare function runShellScript(fsPath: string, args?: string[], spawnOpts?: SpawnOptions): Promise<boolean>;
76
76
  export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
77
77
  export declare function getNodeVersion(destPath: string, nodeVersionFallback?: string | undefined, config?: Config, meta?: Meta, availableVersions?: number[]): Promise<NodeVersion>;
78
- export declare function scanParentDirs(destPath: string, readPackageJson?: boolean): Promise<ScanParentDirsResult>;
78
+ export declare function scanParentDirs(destPath: string, readPackageJson?: boolean, base?: string): Promise<ScanParentDirsResult>;
79
79
  export declare function walkParentDirs({ base, start, filename, }: WalkParentDirsProps): Promise<string | null>;
80
80
  export declare function runNpmInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta, nodeVersion?: NodeVersion): Promise<boolean>;
81
81
  /**
@@ -200,16 +200,16 @@ async function getNodeVersion(destPath, nodeVersionFallback = process.env.VERCEL
200
200
  }
201
201
  return (0, import_node_version.getSupportedNodeVersion)(nodeVersion, isAuto, availableVersions);
202
202
  }
203
- async function scanParentDirs(destPath, readPackageJson = false) {
203
+ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
204
204
  (0, import_assert.default)(import_path.default.isAbsolute(destPath));
205
205
  const pkgJsonPath = await walkParentDirs({
206
- base: "/",
206
+ base,
207
207
  start: destPath,
208
208
  filename: "package.json"
209
209
  });
210
210
  const packageJson = readPackageJson && pkgJsonPath ? JSON.parse(await import_fs_extra.default.readFile(pkgJsonPath, "utf8")) : void 0;
211
211
  const [yarnLockPath, npmLockPath, pnpmLockPath, bunLockPath] = await walkParentDirsMulti({
212
- base: "/",
212
+ base,
213
213
  start: destPath,
214
214
  filenames: [
215
215
  "yarn.lock",
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import getWriteableDirectory from './fs/get-writable-directory';
9
9
  import glob, { GlobOptions } from './fs/glob';
10
10
  import rename from './fs/rename';
11
11
  import { spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getSpawnOptions, getNodeBinPath, getNodeBinPaths, scanParentDirs, traverseUpDirectories } from './fs/run-user-scripts';
12
- import { getLatestNodeVersion, getDiscontinuedNodeVersions } from './fs/node-version';
12
+ import { getLatestNodeVersion, getDiscontinuedNodeVersions, getSupportedNodeVersion } from './fs/node-version';
13
13
  import streamToBuffer from './fs/stream-to-buffer';
14
14
  import debug from './debug';
15
15
  import getIgnoreFilter from './get-ignore-filter';
@@ -18,7 +18,7 @@ import { getPrefixedEnvVars } from './get-prefixed-env-vars';
18
18
  import { cloneEnv } from './clone-env';
19
19
  import { hardLinkDir } from './hard-link-dir';
20
20
  import { validateNpmrc } from './validate-npmrc';
21
- export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, };
21
+ 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, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, };
22
22
  export { EdgeFunction } from './edge-function';
23
23
  export { readConfigFile } from './fs/read-config-file';
24
24
  export { normalizePath } from './fs/normalize-path';
package/dist/index.js CHANGED
@@ -20740,6 +20740,7 @@ __export(src_exports, {
20740
20740
  getPrettyError: () => getPrettyError,
20741
20741
  getScriptName: () => getScriptName,
20742
20742
  getSpawnOptions: () => getSpawnOptions,
20743
+ getSupportedNodeVersion: () => getSupportedNodeVersion,
20743
20744
  getWriteableDirectory: () => getWritableDirectory,
20744
20745
  glob: () => glob,
20745
20746
  hardLinkDir: () => hardLinkDir,
@@ -21919,16 +21920,16 @@ async function getNodeVersion(destPath, nodeVersionFallback = process.env.VERCEL
21919
21920
  }
21920
21921
  return getSupportedNodeVersion(nodeVersion, isAuto, availableVersions);
21921
21922
  }
21922
- async function scanParentDirs(destPath, readPackageJson = false) {
21923
+ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
21923
21924
  (0, import_assert6.default)(import_path5.default.isAbsolute(destPath));
21924
21925
  const pkgJsonPath = await walkParentDirs({
21925
- base: "/",
21926
+ base,
21926
21927
  start: destPath,
21927
21928
  filename: "package.json"
21928
21929
  });
21929
21930
  const packageJson = readPackageJson && pkgJsonPath ? JSON.parse(await import_fs_extra7.default.readFile(pkgJsonPath, "utf8")) : void 0;
21930
21931
  const [yarnLockPath, npmLockPath, pnpmLockPath, bunLockPath] = await walkParentDirsMulti({
21931
- base: "/",
21932
+ base,
21932
21933
  start: destPath,
21933
21934
  filenames: [
21934
21935
  "yarn.lock",
@@ -22582,6 +22583,7 @@ var buildsSchema = {
22582
22583
  getPrettyError,
22583
22584
  getScriptName,
22584
22585
  getSpawnOptions,
22586
+ getSupportedNodeVersion,
22585
22587
  getWriteableDirectory,
22586
22588
  glob,
22587
22589
  hardLinkDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "7.8.0",
3
+ "version": "7.9.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",