@vercel/build-utils 13.21.0 → 13.22.1

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.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f0d7d32: Disable response streaming for lambdas with `awsLambdaHandler` set inside `getLambdaSupportsStreaming`. This closes a gap where non-Node builders (e.g. `@vercel/redwood`) constructed `NodejsLambda` with `awsLambdaHandler` but no explicit `supportsResponseStreaming`, causing `finalizeLambda` to silently flip streaming on for AWS custom handlers. With the gate now enforced centrally in `finalizeLambda`, the equivalent `@vercel/node` build-time check from #16266 is consolidated away — all builders go through the same gate.
8
+
9
+ ## 13.22.0
10
+
11
+ ### Minor Changes
12
+
13
+ - e53dd86: Add service type to project manifest.
14
+
3
15
  ## 13.21.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.js CHANGED
@@ -28319,6 +28319,7 @@ __export(src_exports, {
28319
28319
  getPrerenderChain: () => getPrerenderChain,
28320
28320
  getPrettyError: () => getPrettyError,
28321
28321
  getProvidedRuntime: () => getProvidedRuntime,
28322
+ getReportedServiceType: () => getReportedServiceType,
28322
28323
  getScriptName: () => getScriptName,
28323
28324
  getServiceQueueTopicConfigs: () => getServiceQueueTopicConfigs,
28324
28325
  getServiceQueueTopics: () => getServiceQueueTopics,
@@ -29579,6 +29580,26 @@ function isQueueTriggeredService(service) {
29579
29580
  function isScheduleTriggeredService(service) {
29580
29581
  return service.type === "cron" || service.type === "job" && service.trigger === "schedule";
29581
29582
  }
29583
+ function getReportedServiceType(service) {
29584
+ switch (service.type) {
29585
+ case "web":
29586
+ return "web";
29587
+ case "cron":
29588
+ return "schedule";
29589
+ case "worker":
29590
+ return "queue";
29591
+ case "job":
29592
+ if (service.trigger === "schedule")
29593
+ return "schedule";
29594
+ if (service.trigger === "queue")
29595
+ return "queue";
29596
+ if (service.trigger === "workflow")
29597
+ return "workflow";
29598
+ return void 0;
29599
+ default:
29600
+ return void 0;
29601
+ }
29602
+ }
29582
29603
 
29583
29604
  // src/fs/node-version.ts
29584
29605
  var NODE_VERSIONS = [
@@ -32053,6 +32074,10 @@ var packageManifestSchema = {
32053
32074
  type: "string",
32054
32075
  description: 'Detected framework slug, e.g. "fastapi", "flask", "hono".'
32055
32076
  },
32077
+ serviceType: {
32078
+ type: "string",
32079
+ description: 'Service type: one of "web", "schedule", "queue", "workflow".'
32080
+ },
32056
32081
  runtimeVersion: {
32057
32082
  type: "object",
32058
32083
  additionalProperties: false,
@@ -32579,6 +32604,9 @@ function getLambdaEnvironment(lambda, buffer, options) {
32579
32604
 
32580
32605
  // src/process-serverless/get-lambda-supports-streaming.ts
32581
32606
  async function getLambdaSupportsStreaming(lambda, forceStreamingRuntime) {
32607
+ if (lambda.awsLambdaHandler) {
32608
+ return { supportsStreaming: false };
32609
+ }
32582
32610
  if (forceStreamingRuntime) {
32583
32611
  return { supportsStreaming: true };
32584
32612
  }
@@ -33611,6 +33639,7 @@ function getExtendedPayload({
33611
33639
  getPrerenderChain,
33612
33640
  getPrettyError,
33613
33641
  getProvidedRuntime,
33642
+ getReportedServiceType,
33614
33643
  getScriptName,
33615
33644
  getServiceQueueTopicConfigs,
33616
33645
  getServiceQueueTopics,
@@ -12,6 +12,7 @@ export interface PackageManifest {
12
12
  version?: string;
13
13
  runtime: string;
14
14
  framework?: string;
15
+ serviceType?: string;
15
16
  runtimeVersion?: {
16
17
  requested?: string;
17
18
  requestedSource?: string;
@@ -1,4 +1,5 @@
1
1
  interface LambdaLike {
2
+ awsLambdaHandler?: string;
2
3
  handler: string;
3
4
  launcherType?: string;
4
5
  runtime: string;
@@ -12,9 +13,17 @@ export interface SupportsStreamingResult {
12
13
  };
13
14
  }
14
15
  /**
15
- * Determines if a Lambda should have streaming enabled. If
16
- * `forceStreamingRuntime` is true, streaming is always enabled. If the
17
- * setting is defined it will be honored. Enabled by default for Node.js.
16
+ * Determines if a Lambda should have streaming enabled.
17
+ *
18
+ * AWS custom handlers cannot stream the handler contract returns a
19
+ * response object, not a stream — so they always resolve to `false`,
20
+ * even when `forceStreamingRuntime` is set. This mirrors
21
+ * `deserializeLambda`, which also refuses to force streaming on lambdas
22
+ * with an `awsLambdaHandler` set.
23
+ *
24
+ * Otherwise: if `forceStreamingRuntime` is true, streaming is always
25
+ * enabled. If the setting is defined it will be honored. Enabled by
26
+ * default for Node.js.
18
27
  */
19
28
  export declare function getLambdaSupportsStreaming(lambda: LambdaLike, forceStreamingRuntime: boolean): Promise<SupportsStreamingResult>;
20
29
  export {};
@@ -22,6 +22,9 @@ __export(get_lambda_supports_streaming_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(get_lambda_supports_streaming_exports);
24
24
  async function getLambdaSupportsStreaming(lambda, forceStreamingRuntime) {
25
+ if (lambda.awsLambdaHandler) {
26
+ return { supportsStreaming: false };
27
+ }
25
28
  if (forceStreamingRuntime) {
26
29
  return { supportsStreaming: true };
27
30
  }
package/dist/schemas.d.ts CHANGED
@@ -144,6 +144,10 @@ export declare const packageManifestSchema: {
144
144
  readonly type: "string";
145
145
  readonly description: "Detected framework slug, e.g. \"fastapi\", \"flask\", \"hono\".";
146
146
  };
147
+ readonly serviceType: {
148
+ readonly type: "string";
149
+ readonly description: "Service type: one of \"web\", \"schedule\", \"queue\", \"workflow\".";
150
+ };
147
151
  readonly runtimeVersion: {
148
152
  readonly type: "object";
149
153
  readonly additionalProperties: false;
package/dist/schemas.js CHANGED
@@ -191,6 +191,10 @@ const packageManifestSchema = {
191
191
  type: "string",
192
192
  description: 'Detected framework slug, e.g. "fastapi", "flask", "hono".'
193
193
  },
194
+ serviceType: {
195
+ type: "string",
196
+ description: 'Service type: one of "web", "schedule", "queue", "workflow".'
197
+ },
194
198
  runtimeVersion: {
195
199
  type: "object",
196
200
  additionalProperties: false,
package/dist/types.d.ts CHANGED
@@ -537,6 +537,11 @@ export declare function isScheduleTriggeredService(service: {
537
537
  type?: ServiceType;
538
538
  trigger?: JobTrigger;
539
539
  }): boolean;
540
+ export type ReportedServiceType = 'web' | 'schedule' | 'queue' | 'workflow';
541
+ export declare function getReportedServiceType(service: {
542
+ type?: ServiceType;
543
+ trigger?: JobTrigger;
544
+ }): ReportedServiceType | undefined;
540
545
  /** The framework which created the function */
541
546
  export interface FunctionFramework {
542
547
  slug: string;
package/dist/types.js CHANGED
@@ -22,6 +22,7 @@ __export(types_exports, {
22
22
  JOB_TRIGGERS: () => JOB_TRIGGERS,
23
23
  NodeVersion: () => NodeVersion,
24
24
  Version: () => Version,
25
+ getReportedServiceType: () => getReportedServiceType,
25
26
  getServiceQueueTopicConfigs: () => getServiceQueueTopicConfigs,
26
27
  getServiceQueueTopics: () => getServiceQueueTopics,
27
28
  isQueueTriggeredService: () => isQueueTriggeredService,
@@ -68,12 +69,33 @@ function isQueueTriggeredService(service) {
68
69
  function isScheduleTriggeredService(service) {
69
70
  return service.type === "cron" || service.type === "job" && service.trigger === "schedule";
70
71
  }
72
+ function getReportedServiceType(service) {
73
+ switch (service.type) {
74
+ case "web":
75
+ return "web";
76
+ case "cron":
77
+ return "schedule";
78
+ case "worker":
79
+ return "queue";
80
+ case "job":
81
+ if (service.trigger === "schedule")
82
+ return "schedule";
83
+ if (service.trigger === "queue")
84
+ return "queue";
85
+ if (service.trigger === "workflow")
86
+ return "workflow";
87
+ return void 0;
88
+ default:
89
+ return void 0;
90
+ }
91
+ }
71
92
  // Annotate the CommonJS export names for ESM import in node:
72
93
  0 && (module.exports = {
73
94
  BunVersion,
74
95
  JOB_TRIGGERS,
75
96
  NodeVersion,
76
97
  Version,
98
+ getReportedServiceType,
77
99
  getServiceQueueTopicConfigs,
78
100
  getServiceQueueTopics,
79
101
  isQueueTriggeredService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.21.0",
3
+ "version": "13.22.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -16,15 +16,12 @@
16
16
  "@vercel/python-analysis": "0.11.1"
17
17
  },
18
18
  "devDependencies": {
19
- "bytes": "3.1.2",
20
- "smol-toml": "1.5.2",
21
19
  "@types/async-retry": "^1.2.1",
22
20
  "@types/bytes": "3.1.1",
23
21
  "@types/cross-spawn": "6.0.0",
24
22
  "@types/end-of-stream": "^1.4.0",
25
23
  "@types/fs-extra": "9.0.13",
26
24
  "@types/glob": "7.2.0",
27
- "@types/jest": "27.4.1",
28
25
  "@types/js-yaml": "3.12.1",
29
26
  "@types/mime-types": "2.1.0",
30
27
  "@types/minimatch": "^5.1.2",
@@ -37,6 +34,7 @@
37
34
  "aggregate-error": "3.0.1",
38
35
  "async-retry": "1.2.3",
39
36
  "async-sema": "2.1.4",
37
+ "bytes": "3.1.2",
40
38
  "cross-spawn": "6.0.5",
41
39
  "end-of-stream": "1.4.1",
42
40
  "execa": "3.2.0",
@@ -44,23 +42,23 @@
44
42
  "glob": "8.0.3",
45
43
  "ignore": "4.0.6",
46
44
  "into-stream": "5.0.0",
47
- "jest-junit": "16.0.0",
48
45
  "js-yaml": "3.13.1",
46
+ "json5": "2.2.3",
49
47
  "mime-types": "2.1.28",
50
48
  "minimatch": "3.1.2",
51
49
  "ms": "2.1.3",
52
50
  "multistream": "2.1.1",
53
51
  "node-fetch": "2.6.7",
54
52
  "semver": "6.3.1",
55
- "yazl": "2.5.1",
53
+ "smol-toml": "1.5.2",
56
54
  "vitest": "2.0.1",
57
- "json5": "2.2.3",
55
+ "yazl": "2.5.1",
58
56
  "@vercel/error-utils": "2.1.0",
59
57
  "@vercel/routing-utils": "6.2.0"
60
58
  },
61
59
  "scripts": {
62
60
  "build": "node build.mjs",
63
- "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
61
+ "test": "vitest run --config ../../vitest.config.mts",
64
62
  "vitest-run": "vitest -c ../../vitest.config.mts",
65
63
  "vitest-unit": "glob --absolute 'test/unit.*test.ts'",
66
64
  "vitest-e2e": "glob --absolute 'test/integration*.test.ts'",