@vercel/build-utils
Advanced tools
+11
-0
| # @vercel/build-utils | ||
| ## 13.26.1 | ||
| ### Patch Changes | ||
| - fa25cb7: Fix config.framework in deserializeBuildOutput | ||
| - 972cc84: Support workflow-triggered job services in queue infrastructure | ||
| Add `isWorkflowTriggeredService()` and `isQueueBackedService()` helpers so workflow services | ||
| are recognized by the queue broker, dev server, and build pipeline. Update Python runtime to | ||
| bootstrap workflow services as queue-backed workers. | ||
| ## 13.26.0 | ||
@@ -4,0 +15,0 @@ |
@@ -38,3 +38,3 @@ import type FileFsRef from '../file-fs-ref'; | ||
| export type InspectSerializedLambda = (path: string, config: SerializedLambda | SerializedNodejsLambda, repoRootPath: string, hasServerActions: boolean) => Promise<boolean>; | ||
| export interface DeserializeBuildOutputOptions<TResult extends DeserializeBuildOutputResult = DeserializeBuildOutputResult, TLambda extends Lambda = Lambda> { | ||
| export interface DeserializeBuildOutputOptions<TMeta = unknown, TLambda extends Lambda = Lambda> { | ||
| outputDir: string; | ||
@@ -51,5 +51,3 @@ repoRootPath: string; | ||
| includeDeploymentId?: boolean; | ||
| getMeta?: (hasServerActions: boolean) => TResult extends { | ||
| meta?: infer TMeta; | ||
| } ? TMeta : never; | ||
| getMeta?: (hasServerActions: boolean) => TMeta; | ||
| } | ||
@@ -56,0 +54,0 @@ export type DeserializeBuildOutputFiles = BuildResultV2Typical['output']; |
| import type { Lambda } from '../lambda'; | ||
| import type { DeserializeBuildOutputConfig, DeserializeBuildOutputOptions, DeserializeBuildOutputResult } from './deserialize-build-output-types'; | ||
| import type { DeserializeBuildOutputOptions, DeserializeBuildOutputResult } from './deserialize-build-output-types'; | ||
| export declare function validateDeploymentId(deploymentId?: string): void; | ||
| export declare function deserializeBuildOutput<TConfig extends DeserializeBuildOutputConfig = DeserializeBuildOutputConfig, TResult extends DeserializeBuildOutputResult = DeserializeBuildOutputResult, TLambda extends Lambda = Lambda>(options: DeserializeBuildOutputOptions<TResult, TLambda>): Promise<TResult>; | ||
| export declare function deserializeBuildOutput<TFlags = unknown, TMeta = unknown, TLambda extends Lambda = Lambda>(options: DeserializeBuildOutputOptions<TMeta, TLambda>): Promise<DeserializeBuildOutputResult<TFlags, TMeta>>; |
@@ -189,5 +189,3 @@ "use strict"; | ||
| validateDeploymentId(config.deploymentId); | ||
| const flags = await (0, import_maybe_read_json.maybeReadJSON)( | ||
| (0, import_path.join)(outputDir, "flags.json") | ||
| ); | ||
| const flags = await (0, import_maybe_read_json.maybeReadJSON)((0, import_path.join)(outputDir, "flags.json")); | ||
| const staticDir = (0, import_path.join)(outputDir, "static"); | ||
@@ -280,3 +278,3 @@ const output = await (0, import_glob.default)("**", { | ||
| applyGroupedLambdas(output, groupedLambdas); | ||
| const framework = (0, import_validate_framework_version.validateFrameworkVersion)(config?.framework?.version); | ||
| const framework = (0, import_validate_framework_version.validateFrameworkVersion)(config?.framework); | ||
| const meta = getMeta?.(hasServerActions); | ||
@@ -283,0 +281,0 @@ return { |
| type FrameworkMeta = { | ||
| slug: string; | ||
| version: string; | ||
| }; | ||
| export declare function validateFrameworkVersion(frameworkVersion: string | undefined): FrameworkMeta | undefined; | ||
| export declare function validateFrameworkVersion(framework: FrameworkMeta | undefined): FrameworkMeta | undefined; | ||
| export {}; |
@@ -25,15 +25,27 @@ "use strict"; | ||
| var import_errors = require("../errors"); | ||
| const MAX_SLUG_LENGTH = 50; | ||
| const MAX_FRAMEWORK_VERSION_LENGTH = 50; | ||
| function validateFrameworkVersion(frameworkVersion) { | ||
| if (!frameworkVersion) { | ||
| function validateFrameworkVersion(framework) { | ||
| if (!framework) { | ||
| return void 0; | ||
| } | ||
| if (typeof frameworkVersion !== "string") { | ||
| const { slug, version } = framework; | ||
| if (typeof slug !== "string") { | ||
| return void 0; | ||
| } | ||
| if (typeof version !== "string") { | ||
| throw new import_errors.NowBuildError({ | ||
| message: `Invalid config.json: "framework.version" type "${typeof frameworkVersion}" should be "string"`, | ||
| message: `Invalid config.json: "version" type "${typeof version}" should be "string"`, | ||
| code: "VC_BUILD_INVALID_CONFIG_JSON_FRAMEWORK_VERSION_TYPE" | ||
| }); | ||
| } | ||
| if (frameworkVersion.length > MAX_FRAMEWORK_VERSION_LENGTH) { | ||
| const trimmedFrameworkVersion = frameworkVersion.slice( | ||
| if (slug.length > MAX_SLUG_LENGTH) { | ||
| const trimmedFrameworkSlug = slug.slice(0, MAX_SLUG_LENGTH); | ||
| throw new import_errors.NowBuildError({ | ||
| message: `Invalid config.json: "framework.slug" length ${slug.length} > ${MAX_SLUG_LENGTH}. "${trimmedFrameworkSlug}..."`, | ||
| code: "VC_BUILD_INVALID_CONFIG_JSON_FRAMEWORK_SLUG_LENGTH" | ||
| }); | ||
| } | ||
| if (version.length > MAX_FRAMEWORK_VERSION_LENGTH) { | ||
| const trimmedFrameworkVersion = version.slice( | ||
| 0, | ||
@@ -43,9 +55,7 @@ MAX_FRAMEWORK_VERSION_LENGTH | ||
| throw new import_errors.NowBuildError({ | ||
| message: `Invalid config.json: "framework.version" length ${frameworkVersion.length} > ${MAX_FRAMEWORK_VERSION_LENGTH}. "${trimmedFrameworkVersion}..."`, | ||
| message: `Invalid config.json: "framework.version" length ${version.length} > ${MAX_FRAMEWORK_VERSION_LENGTH}. "${trimmedFrameworkVersion}..."`, | ||
| code: "VC_BUILD_INVALID_CONFIG_JSON_FRAMEWORK_VERSION_LENGTH" | ||
| }); | ||
| } | ||
| return { | ||
| version: frameworkVersion | ||
| }; | ||
| return framework; | ||
| } | ||
@@ -52,0 +62,0 @@ // Annotate the CommonJS export names for ESM import in node: |
+9
-0
@@ -553,2 +553,11 @@ import type FileRef from './file-ref'; | ||
| }): boolean; | ||
| export declare function isWorkflowTriggeredService(service: { | ||
| type?: ServiceType; | ||
| trigger?: JobTrigger; | ||
| }): boolean; | ||
| /** Returns true for any service that consumes queue messages (worker, queue-triggered job, workflow-triggered job). */ | ||
| export declare function isQueueBackedService(service: { | ||
| type?: ServiceType; | ||
| trigger?: JobTrigger; | ||
| }): boolean; | ||
| export type ReportedServiceType = 'web' | 'schedule' | 'queue' | 'workflow'; | ||
@@ -555,0 +564,0 @@ export declare function getReportedServiceType(service: { |
+12
-2
@@ -28,4 +28,6 @@ "use strict"; | ||
| getServiceQueueTopics: () => getServiceQueueTopics, | ||
| isQueueBackedService: () => isQueueBackedService, | ||
| isQueueTriggeredService: () => isQueueTriggeredService, | ||
| isScheduleTriggeredService: () => isScheduleTriggeredService | ||
| isScheduleTriggeredService: () => isScheduleTriggeredService, | ||
| isWorkflowTriggeredService: () => isWorkflowTriggeredService | ||
| }); | ||
@@ -73,2 +75,8 @@ module.exports = __toCommonJS(types_exports); | ||
| } | ||
| function isWorkflowTriggeredService(service) { | ||
| return service.type === "job" && service.trigger === "workflow"; | ||
| } | ||
| function isQueueBackedService(service) { | ||
| return isQueueTriggeredService(service) || isWorkflowTriggeredService(service); | ||
| } | ||
| function getReportedServiceType(service) { | ||
@@ -103,4 +111,6 @@ switch (service.type) { | ||
| getServiceQueueTopics, | ||
| isQueueBackedService, | ||
| isQueueTriggeredService, | ||
| isScheduleTriggeredService | ||
| isScheduleTriggeredService, | ||
| isWorkflowTriggeredService | ||
| }); |
+3
-3
| { | ||
| "name": "@vercel/build-utils", | ||
| "version": "13.26.0", | ||
| "version": "13.26.1", | ||
| "license": "Apache-2.0", | ||
@@ -58,4 +58,4 @@ "main": "./dist/index.js", | ||
| "yazl": "2.5.1", | ||
| "@vercel/error-utils": "2.1.0", | ||
| "@vercel/routing-utils": "6.2.0" | ||
| "@vercel/routing-utils": "6.2.0", | ||
| "@vercel/error-utils": "2.1.0" | ||
| }, | ||
@@ -62,0 +62,0 @@ "scripts": { |
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
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 11 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
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 11 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
2001826
0.1%51351
0.08%