@vercel/build-utils
Advanced tools
| /** | ||
| * List of backend frameworks supported by the experimental backends feature | ||
| */ | ||
| export declare const BACKEND_FRAMEWORKS: readonly ["express", "hono", "h3", "nestjs", "fastify"]; | ||
| export type BackendFramework = (typeof BACKEND_FRAMEWORKS)[number]; | ||
| /** | ||
| * Checks if the given framework is a backend framework | ||
| */ | ||
| export declare function isBackendFramework(framework: string | null | undefined): framework is BackendFramework; | ||
| /** | ||
| * Checks if experimental backends are enabled via environment variable | ||
| */ | ||
| export declare function isExperimentalBackendsEnabled(): boolean; | ||
| /** | ||
| * Checks if experimental backends are enabled AND the framework is a backend framework | ||
| */ | ||
| export declare function shouldUseExperimentalBackends(framework: string | null | undefined): boolean; |
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| var framework_helpers_exports = {}; | ||
| __export(framework_helpers_exports, { | ||
| BACKEND_FRAMEWORKS: () => BACKEND_FRAMEWORKS, | ||
| isBackendFramework: () => isBackendFramework, | ||
| isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled, | ||
| shouldUseExperimentalBackends: () => shouldUseExperimentalBackends | ||
| }); | ||
| module.exports = __toCommonJS(framework_helpers_exports); | ||
| const BACKEND_FRAMEWORKS = [ | ||
| "express", | ||
| "hono", | ||
| "h3", | ||
| "nestjs", | ||
| "fastify" | ||
| ]; | ||
| function isBackendFramework(framework) { | ||
| if (!framework) | ||
| return false; | ||
| return BACKEND_FRAMEWORKS.includes(framework); | ||
| } | ||
| function isExperimentalBackendsEnabled() { | ||
| return process.env.VERCEL_EXPERIMENTAL_BACKENDS === "1" || // Previously used for experimental express and hono builds | ||
| process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" || process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1"; | ||
| } | ||
| function shouldUseExperimentalBackends(framework) { | ||
| return isExperimentalBackendsEnabled() && isBackendFramework(framework); | ||
| } | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| BACKEND_FRAMEWORKS, | ||
| isBackendFramework, | ||
| isExperimentalBackendsEnabled, | ||
| shouldUseExperimentalBackends | ||
| }); |
+6
-0
| # @vercel/build-utils | ||
| ## 12.2.1 | ||
| ### Patch Changes | ||
| - Add backend util helpers ([#14152](https://github.com/vercel/vercel/pull/14152)) | ||
| ## 12.2.0 | ||
@@ -4,0 +10,0 @@ |
+1
-0
@@ -35,1 +35,2 @@ import FileBlob from './file-blob'; | ||
| export { generateNodeBuilderFunctions } from './generate-node-builder-functions'; | ||
| export { BACKEND_FRAMEWORKS, BackendFramework, isBackendFramework, isExperimentalBackendsEnabled, shouldUseExperimentalBackends, } from './framework-helpers'; |
+2
-2
| { | ||
| "name": "@vercel/build-utils", | ||
| "version": "12.2.0", | ||
| "version": "12.2.1", | ||
| "license": "Apache-2.0", | ||
@@ -30,3 +30,3 @@ "main": "./dist/index.js", | ||
| "@vercel/error-utils": "2.0.3", | ||
| "@vercel/routing-utils": "5.2.0", | ||
| "@vercel/routing-utils": "5.2.1", | ||
| "aggregate-error": "3.0.1", | ||
@@ -33,0 +33,0 @@ "async-retry": "1.2.3", |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 9 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
1362738
0.3%86
2.38%31172
0.32%38
8.57%