@vercel/build-utils 12.2.4 → 13.0.0

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,11 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 13.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Remove getSpawnOptions ([#14176](https://github.com/vercel/vercel/pull/14176))
8
+
3
9
  ## 12.2.4
4
10
 
5
11
  ### Patch Changes
@@ -84,7 +84,6 @@ export declare function getNodeBinPath({ cwd, }: {
84
84
  }): Promise<string>;
85
85
  export declare function getNodeBinPaths({ start, base, }: TraverseUpDirectoriesProps): string[];
86
86
  export declare function runShellScript(fsPath: string, args?: string[], spawnOpts?: SpawnOptions): Promise<boolean>;
87
- export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
88
87
  export declare function getNodeVersion(destPath: string, fallbackVersion?: string | undefined, config?: Config, meta?: Meta, availableVersions?: number[]): Promise<NodeVersion | BunVersion>;
89
88
  export declare function scanParentDirs(destPath: string, readPackageJson?: boolean, base?: string): Promise<ScanParentDirsResult>;
90
89
  export declare function turboVersionSpecifierSupportsCorepack(turboVersionSpecifier: string): boolean;
@@ -38,7 +38,6 @@ __export(run_user_scripts_exports, {
38
38
  getPathForPackageManager: () => getPathForPackageManager,
39
39
  getPathOverrideForPackageManager: () => getPathOverrideForPackageManager,
40
40
  getScriptName: () => getScriptName,
41
- getSpawnOptions: () => getSpawnOptions,
42
41
  installDependencies: () => installDependencies,
43
42
  runBundleInstall: () => runBundleInstall,
44
43
  runCustomInstallCommand: () => runCustomInstallCommand,
@@ -178,30 +177,6 @@ async function runShellScript(fsPath, args = [], spawnOpts) {
178
177
  });
179
178
  return true;
180
179
  }
181
- function getSpawnOptions(meta, nodeVersion) {
182
- const opts = {
183
- env: (0, import_clone_env.cloneEnv)(process.env)
184
- };
185
- if ((0, import_node_version.isBunVersion)(nodeVersion)) {
186
- return opts;
187
- }
188
- if (!meta.isDev) {
189
- let found = false;
190
- const oldPath = opts.env.PATH || process.env.PATH || "";
191
- const pathSegments = oldPath.split(import_path.default.delimiter).map((segment) => {
192
- if (/^\/node[0-9]+\/bin/.test(segment)) {
193
- found = true;
194
- return `/node${nodeVersion.major}/bin`;
195
- }
196
- return segment;
197
- });
198
- if (!found) {
199
- pathSegments.unshift(`/node${nodeVersion.major}/bin`);
200
- }
201
- opts.env.PATH = pathSegments.filter(Boolean).join(import_path.default.delimiter);
202
- }
203
- return opts;
204
- }
205
180
  async function getNodeVersion(destPath, fallbackVersion = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION, config = {}, meta = {}, availableVersions = (0, import_node_version.getAvailableNodeVersions)()) {
206
181
  if (config.bunVersion) {
207
182
  return (0, import_node_version.getSupportedBunVersion)(config.bunVersion);
@@ -1069,7 +1044,6 @@ const installDependencies = (0, import_util.deprecate)(
1069
1044
  getPathForPackageManager,
1070
1045
  getPathOverrideForPackageManager,
1071
1046
  getScriptName,
1072
- getSpawnOptions,
1073
1047
  installDependencies,
1074
1048
  runBundleInstall,
1075
1049
  runCustomInstallCommand,
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory }
8
8
  import getWriteableDirectory from './fs/get-writable-directory';
9
9
  import glob, { GlobOptions } from './fs/glob';
10
10
  import rename from './fs/rename';
11
- import { spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, detectPackageManager, getSpawnOptions, getNodeBinPath, getNodeBinPaths, scanParentDirs, traverseUpDirectories } from './fs/run-user-scripts';
11
+ import { spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, detectPackageManager, getNodeBinPath, getNodeBinPaths, scanParentDirs, traverseUpDirectories } from './fs/run-user-scripts';
12
12
  import { getLatestNodeVersion, getDiscontinuedNodeVersions, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion } from './fs/node-version';
13
13
  import streamToBuffer, { streamToBufferChunks } from './fs/stream-to-buffer';
14
14
  import debug from './debug';
@@ -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, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion, detectPackageManager, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, streamToBufferChunks, 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, isBunVersion, getSupportedBunVersion, detectPackageManager, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, streamToBufferChunks, 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
@@ -21860,7 +21860,6 @@ __export(src_exports, {
21860
21860
  getPrettyError: () => getPrettyError,
21861
21861
  getProvidedRuntime: () => getProvidedRuntime,
21862
21862
  getScriptName: () => getScriptName,
21863
- getSpawnOptions: () => getSpawnOptions,
21864
21863
  getSupportedBunVersion: () => getSupportedBunVersion,
21865
21864
  getSupportedNodeVersion: () => getSupportedNodeVersion,
21866
21865
  getWriteableDirectory: () => getWritableDirectory,
@@ -23301,30 +23300,6 @@ async function runShellScript(fsPath, args = [], spawnOpts) {
23301
23300
  });
23302
23301
  return true;
23303
23302
  }
23304
- function getSpawnOptions(meta, nodeVersion) {
23305
- const opts = {
23306
- env: cloneEnv(process.env)
23307
- };
23308
- if (isBunVersion(nodeVersion)) {
23309
- return opts;
23310
- }
23311
- if (!meta.isDev) {
23312
- let found = false;
23313
- const oldPath = opts.env.PATH || process.env.PATH || "";
23314
- const pathSegments = oldPath.split(import_path5.default.delimiter).map((segment) => {
23315
- if (/^\/node[0-9]+\/bin/.test(segment)) {
23316
- found = true;
23317
- return `/node${nodeVersion.major}/bin`;
23318
- }
23319
- return segment;
23320
- });
23321
- if (!found) {
23322
- pathSegments.unshift(`/node${nodeVersion.major}/bin`);
23323
- }
23324
- opts.env.PATH = pathSegments.filter(Boolean).join(import_path5.default.delimiter);
23325
- }
23326
- return opts;
23327
- }
23328
23303
  async function getNodeVersion(destPath, fallbackVersion = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION, config = {}, meta = {}, availableVersions = getAvailableNodeVersions()) {
23329
23304
  if (config.bunVersion) {
23330
23305
  return getSupportedBunVersion(config.bunVersion);
@@ -24857,7 +24832,6 @@ function shouldUseExperimentalBackends(framework) {
24857
24832
  getPrettyError,
24858
24833
  getProvidedRuntime,
24859
24834
  getScriptName,
24860
- getSpawnOptions,
24861
24835
  getSupportedBunVersion,
24862
24836
  getSupportedNodeVersion,
24863
24837
  getWriteableDirectory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "12.2.4",
3
+ "version": "13.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",