@vercel/build-utils 7.9.0 → 7.10.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,17 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 7.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Allow environment variables to be specified for `EdgeFunction` ([#11029](https://github.com/vercel/vercel/pull/11029))
8
+
9
+ ## 7.9.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Export `getSupportedNodeVersion` ([#11277](https://github.com/vercel/vercel/pull/11277))
14
+
3
15
  ## 7.9.0
4
16
 
5
17
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import type { Files, FunctionFramework } from './types';
1
+ import type { Env, Files, FunctionFramework } from './types';
2
2
  /**
3
3
  * An Edge Functions output
4
4
  */
@@ -18,6 +18,10 @@ export declare class EdgeFunction {
18
18
  * The entrypoint for the edge function.
19
19
  */
20
20
  entrypoint: string;
21
+ /**
22
+ * Environment variables for the edge function to use at runtime.
23
+ */
24
+ environment?: Env;
21
25
  /**
22
26
  * The list of files to be included in the edge function bundle.
23
27
  */
@@ -31,6 +31,7 @@ class EdgeFunction {
31
31
  this.assets = params.assets;
32
32
  this.regions = params.regions;
33
33
  this.framework = params.framework;
34
+ this.environment = params.environment;
34
35
  }
35
36
  }
36
37
  // Annotate the CommonJS export names for ESM import in node:
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,
@@ -22465,6 +22466,7 @@ var EdgeFunction = class {
22465
22466
  this.assets = params.assets;
22466
22467
  this.regions = params.regions;
22467
22468
  this.framework = params.framework;
22469
+ this.environment = params.environment;
22468
22470
  }
22469
22471
  };
22470
22472
 
@@ -22582,6 +22584,7 @@ var buildsSchema = {
22582
22584
  getPrettyError,
22583
22585
  getScriptName,
22584
22586
  getSpawnOptions,
22587
+ getSupportedNodeVersion,
22585
22588
  getWriteableDirectory,
22586
22589
  glob,
22587
22590
  hardLinkDir,
package/dist/lambda.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  /// <reference types="node" />
2
- import type { Files, Config, FunctionFramework } from './types';
3
- interface Environment {
4
- [key: string]: string;
5
- }
2
+ import type { Config, Env, Files, FunctionFramework } from './types';
6
3
  export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
7
4
  export type LambdaArchitecture = 'x86_64' | 'arm64';
8
5
  export interface LambdaOptionsBase {
@@ -11,7 +8,7 @@ export interface LambdaOptionsBase {
11
8
  architecture?: LambdaArchitecture;
12
9
  memory?: number;
13
10
  maxDuration?: number;
14
- environment?: Environment;
11
+ environment?: Env;
15
12
  allowQuery?: string[];
16
13
  regions?: string[];
17
14
  supportsMultiPayloads?: boolean;
@@ -55,7 +52,7 @@ export declare class Lambda {
55
52
  architecture?: LambdaArchitecture;
56
53
  memory?: number;
57
54
  maxDuration?: number;
58
- environment: Environment;
55
+ environment: Env;
59
56
  allowQuery?: string[];
60
57
  regions?: string[];
61
58
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "7.9.0",
3
+ "version": "7.10.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",