@vercel/build-utils 13.1.0 → 13.1.2

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
+ ## 13.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Support `runtimeLanguage` in build-utils ([#14344](https://github.com/vercel/vercel/pull/14344))
8
+
9
+ ## 13.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Only run introspection when isExperimentalBackendsWithoutIntrospectionEnabled is truthy ([#14336](https://github.com/vercel/vercel/pull/14336))
14
+
3
15
  ## 13.1.0
4
16
 
5
17
  ### Minor Changes
@@ -9,9 +9,7 @@ export type BackendFramework = (typeof BACKEND_FRAMEWORKS)[number];
9
9
  * Checks if the given framework is a backend framework
10
10
  */
11
11
  export declare function isBackendFramework(framework: string | null | undefined): framework is BackendFramework;
12
- /**
13
- * Checks if experimental backends are enabled via environment variable
14
- */
12
+ export declare function isExperimentalBackendsWithoutIntrospectionEnabled(): boolean;
15
13
  export declare function isExperimentalBackendsEnabled(): boolean;
16
14
  export declare function isBackendBuilder(builder: Builder | null | undefined): boolean;
17
15
  /**
@@ -23,6 +23,7 @@ __export(framework_helpers_exports, {
23
23
  isBackendBuilder: () => isBackendBuilder,
24
24
  isBackendFramework: () => isBackendFramework,
25
25
  isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
26
+ isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
26
27
  shouldUseExperimentalBackends: () => shouldUseExperimentalBackends
27
28
  });
28
29
  module.exports = __toCommonJS(framework_helpers_exports);
@@ -47,8 +48,11 @@ function isBackendFramework(framework) {
47
48
  return false;
48
49
  return BACKEND_FRAMEWORKS.includes(framework);
49
50
  }
51
+ function isExperimentalBackendsWithoutIntrospectionEnabled() {
52
+ return process.env.VERCEL_BACKENDS_BUILDS === "1";
53
+ }
50
54
  function isExperimentalBackendsEnabled() {
51
- return process.env.VERCEL_EXPERIMENTAL_BACKENDS === "1" || // Previously used for experimental express and hono builds
55
+ return isExperimentalBackendsWithoutIntrospectionEnabled() || process.env.VERCEL_EXPERIMENTAL_BACKENDS === "1" || // Previously used for experimental express and hono builds
52
56
  process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" || process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1";
53
57
  }
54
58
  function isBackendBuilder(builder) {
@@ -67,5 +71,6 @@ function shouldUseExperimentalBackends(framework) {
67
71
  isBackendBuilder,
68
72
  isBackendFramework,
69
73
  isExperimentalBackendsEnabled,
74
+ isExperimentalBackendsWithoutIntrospectionEnabled,
70
75
  shouldUseExperimentalBackends
71
76
  });
package/dist/index.d.ts CHANGED
@@ -32,4 +32,4 @@ export { NODE_VERSIONS } from './fs/node-version';
32
32
  export { getInstalledPackageVersion } from './get-installed-package-version';
33
33
  export { defaultCachePathGlob } from './default-cache-path-glob';
34
34
  export { generateNodeBuilderFunctions } from './generate-node-builder-functions';
35
- export { BACKEND_FRAMEWORKS, BackendFramework, isBackendFramework, isBackendBuilder, isExperimentalBackendsEnabled, shouldUseExperimentalBackends, } from './framework-helpers';
35
+ export { BACKEND_FRAMEWORKS, BackendFramework, isBackendFramework, isBackendBuilder, isExperimentalBackendsEnabled, isExperimentalBackendsWithoutIntrospectionEnabled, shouldUseExperimentalBackends, } from './framework-helpers';
package/dist/index.js CHANGED
@@ -21872,6 +21872,7 @@ __export(src_exports, {
21872
21872
  isBunVersion: () => isBunVersion,
21873
21873
  isDirectory: () => isDirectory,
21874
21874
  isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
21875
+ isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
21875
21876
  isSymbolicLink: () => isSymbolicLink,
21876
21877
  normalizePath: () => normalizePath,
21877
21878
  readConfigFile: () => readConfigFile,
@@ -22400,6 +22401,7 @@ var Lambda = class {
22400
22401
  const {
22401
22402
  handler,
22402
22403
  runtime,
22404
+ runtimeLanguage,
22403
22405
  maxDuration,
22404
22406
  architecture,
22405
22407
  memory,
@@ -22430,6 +22432,9 @@ var Lambda = class {
22430
22432
  '"architecture" must be either "x86_64" or "arm64"'
22431
22433
  );
22432
22434
  }
22435
+ if (runtimeLanguage !== void 0) {
22436
+ (0, import_assert4.default)(runtimeLanguage === "rust", '"runtimeLanguage" must be "rust"');
22437
+ }
22433
22438
  if ("experimentalAllowBundling" in opts && opts.experimentalAllowBundling !== void 0) {
22434
22439
  (0, import_assert4.default)(
22435
22440
  typeof opts.experimentalAllowBundling === "boolean",
@@ -22553,6 +22558,7 @@ var Lambda = class {
22553
22558
  this.files = "files" in opts ? opts.files : void 0;
22554
22559
  this.handler = handler;
22555
22560
  this.runtime = runtime;
22561
+ this.runtimeLanguage = runtimeLanguage;
22556
22562
  this.architecture = getDefaultLambdaArchitecture(architecture);
22557
22563
  this.memory = memory;
22558
22564
  this.maxDuration = maxDuration;
@@ -24796,8 +24802,11 @@ function isBackendFramework(framework) {
24796
24802
  return false;
24797
24803
  return BACKEND_FRAMEWORKS.includes(framework);
24798
24804
  }
24805
+ function isExperimentalBackendsWithoutIntrospectionEnabled() {
24806
+ return process.env.VERCEL_BACKENDS_BUILDS === "1";
24807
+ }
24799
24808
  function isExperimentalBackendsEnabled() {
24800
- return process.env.VERCEL_EXPERIMENTAL_BACKENDS === "1" || // Previously used for experimental express and hono builds
24809
+ return isExperimentalBackendsWithoutIntrospectionEnabled() || process.env.VERCEL_EXPERIMENTAL_BACKENDS === "1" || // Previously used for experimental express and hono builds
24801
24810
  process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" || process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1";
24802
24811
  }
24803
24812
  function isBackendBuilder(builder) {
@@ -24866,6 +24875,7 @@ function shouldUseExperimentalBackends(framework) {
24866
24875
  isBunVersion,
24867
24876
  isDirectory,
24868
24877
  isExperimentalBackendsEnabled,
24878
+ isExperimentalBackendsWithoutIntrospectionEnabled,
24869
24879
  isSymbolicLink,
24870
24880
  normalizePath,
24871
24881
  readConfigFile,
package/dist/lambda.d.ts CHANGED
@@ -2,10 +2,12 @@
2
2
  import type { Config, Env, Files, FunctionFramework, TriggerEvent } from './types';
3
3
  export type { TriggerEvent };
4
4
  export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
5
+ export type LambdaExecutableRuntimeLanguages = 'rust';
5
6
  export type LambdaArchitecture = 'x86_64' | 'arm64';
6
7
  export interface LambdaOptionsBase {
7
8
  handler: string;
8
9
  runtime: string;
10
+ runtimeLanguage?: LambdaExecutableRuntimeLanguages;
9
11
  architecture?: LambdaArchitecture;
10
12
  memory?: number;
11
13
  maxDuration?: number;
@@ -70,6 +72,11 @@ export declare class Lambda {
70
72
  files?: Files;
71
73
  handler: string;
72
74
  runtime: string;
75
+ /**
76
+ * When using a generic runtime such as "executable" or "provided" (custom runtimes),
77
+ * this field can be used to specify the language the executable was compiled with.
78
+ */
79
+ runtimeLanguage?: LambdaExecutableRuntimeLanguages;
73
80
  architecture: LambdaArchitecture;
74
81
  memory?: number;
75
82
  maxDuration?: number;
package/dist/lambda.js CHANGED
@@ -60,6 +60,7 @@ class Lambda {
60
60
  const {
61
61
  handler,
62
62
  runtime,
63
+ runtimeLanguage,
63
64
  maxDuration,
64
65
  architecture,
65
66
  memory,
@@ -90,6 +91,9 @@ class Lambda {
90
91
  '"architecture" must be either "x86_64" or "arm64"'
91
92
  );
92
93
  }
94
+ if (runtimeLanguage !== void 0) {
95
+ (0, import_assert.default)(runtimeLanguage === "rust", '"runtimeLanguage" must be "rust"');
96
+ }
93
97
  if ("experimentalAllowBundling" in opts && opts.experimentalAllowBundling !== void 0) {
94
98
  (0, import_assert.default)(
95
99
  typeof opts.experimentalAllowBundling === "boolean",
@@ -213,6 +217,7 @@ class Lambda {
213
217
  this.files = "files" in opts ? opts.files : void 0;
214
218
  this.handler = handler;
215
219
  this.runtime = runtime;
220
+ this.runtimeLanguage = runtimeLanguage;
216
221
  this.architecture = getDefaultLambdaArchitecture(architecture);
217
222
  this.memory = memory;
218
223
  this.maxDuration = maxDuration;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.1.0",
3
+ "version": "13.1.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -27,7 +27,7 @@
27
27
  "@types/semver": "6.0.0",
28
28
  "@types/yazl": "2.4.2",
29
29
  "@vercel/error-utils": "2.0.3",
30
- "@vercel/routing-utils": "5.2.2",
30
+ "@vercel/routing-utils": "5.3.0",
31
31
  "aggregate-error": "3.0.1",
32
32
  "async-retry": "1.2.3",
33
33
  "async-sema": "2.1.4",