@vercel/build-utils 14.1.1 → 14.2.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 +6 -0
- package/build.mjs +3 -11
- package/dist/index.d.ts +0 -1
- package/dist/index.js +293 -311
- package/dist/types.d.ts +15 -6
- package/package.json +2 -3
- package/turbo.json +43 -7
- package/dist/python.d.ts +0 -10
- package/dist/python.js +0 -52
package/dist/types.d.ts
CHANGED
|
@@ -738,7 +738,7 @@ export interface Chain {
|
|
|
738
738
|
*/
|
|
739
739
|
headers: Record<string, string>;
|
|
740
740
|
}
|
|
741
|
-
interface
|
|
741
|
+
interface QueueTriggerEventBase {
|
|
742
742
|
/** Name of the queue topic to consume from (REQUIRED) */
|
|
743
743
|
topic: string;
|
|
744
744
|
/**
|
|
@@ -770,7 +770,7 @@ interface TriggerEventBase {
|
|
|
770
770
|
* Queue trigger input event for v1beta (from vercel.json config).
|
|
771
771
|
* Requires explicit consumer name.
|
|
772
772
|
*/
|
|
773
|
-
export interface
|
|
773
|
+
export interface QueueTriggerEventInputV1 extends QueueTriggerEventBase {
|
|
774
774
|
/** Event type - must be "queue/v1beta" (REQUIRED) */
|
|
775
775
|
type: 'queue/v1beta';
|
|
776
776
|
/** Name of the consumer group for this trigger (REQUIRED) */
|
|
@@ -781,25 +781,34 @@ export interface TriggerEventInputV1 extends TriggerEventBase {
|
|
|
781
781
|
* Consumer name is implicitly derived from the function path.
|
|
782
782
|
* Only one trigger per function is allowed.
|
|
783
783
|
*/
|
|
784
|
-
export interface
|
|
784
|
+
export interface QueueTriggerEventInputV2 extends QueueTriggerEventBase {
|
|
785
785
|
/** Event type - must be "queue/v2beta" (REQUIRED) */
|
|
786
786
|
type: 'queue/v2beta';
|
|
787
787
|
}
|
|
788
|
+
export interface ScheduleTriggerEventInputV1 {
|
|
789
|
+
/** Event type - must be "schedule/v1beta" (REQUIRED) */
|
|
790
|
+
type: 'schedule/v1beta';
|
|
791
|
+
}
|
|
788
792
|
/**
|
|
789
|
-
* Queue trigger input event from vercel.json config.
|
|
793
|
+
* Queue or Schedule trigger input event from vercel.json config.
|
|
790
794
|
* v1beta requires explicit consumer, v2beta derives consumer from function path.
|
|
791
795
|
*/
|
|
792
|
-
export type TriggerEventInput =
|
|
796
|
+
export type TriggerEventInput = QueueTriggerEventInputV1 | QueueTriggerEventInputV2 | ScheduleTriggerEventInputV1;
|
|
793
797
|
/**
|
|
794
798
|
* Processed queue trigger event for Lambda.
|
|
795
799
|
* Consumer is always present (explicitly provided for v1beta, derived for v2beta).
|
|
796
800
|
*/
|
|
797
|
-
export interface
|
|
801
|
+
export interface QueueTriggerEvent extends QueueTriggerEventBase {
|
|
798
802
|
/** Event type */
|
|
799
803
|
type: 'queue/v1beta' | 'queue/v2beta';
|
|
800
804
|
/** Name of the consumer group for this trigger (always present in processed output) */
|
|
801
805
|
consumer: string;
|
|
802
806
|
}
|
|
807
|
+
/**
|
|
808
|
+
* Schedule trigger event is the same as the input event.
|
|
809
|
+
*/
|
|
810
|
+
export type ScheduleTriggerEvent = ScheduleTriggerEventInputV1;
|
|
811
|
+
export type TriggerEvent = QueueTriggerEvent | ScheduleTriggerEvent;
|
|
803
812
|
export type ServiceRuntime = 'node' | 'python' | 'go' | 'rust' | 'ruby' | 'container';
|
|
804
813
|
export type ServiceType = 'web' | 'cron' | 'worker' | 'job';
|
|
805
814
|
export interface ExperimentalServiceMount {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/build-utils",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.js",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"cjs-module-lexer": "1.2.3",
|
|
15
|
-
"es-module-lexer": "1.5.0"
|
|
16
|
-
"@vercel/python-analysis": "0.13.2"
|
|
15
|
+
"es-module-lexer": "1.5.0"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
19
18
|
"@types/async-retry": "^1.2.1",
|
package/turbo.json
CHANGED
|
@@ -3,51 +3,87 @@
|
|
|
3
3
|
"extends": ["//"],
|
|
4
4
|
"tasks": {
|
|
5
5
|
"test": {
|
|
6
|
-
"dependsOn": ["build"]
|
|
6
|
+
"dependsOn": ["build", "//#generate:cache-keys"]
|
|
7
7
|
},
|
|
8
8
|
"test-unit": {
|
|
9
|
-
"dependsOn": ["build"]
|
|
9
|
+
"dependsOn": ["build", "//#generate:cache-keys"]
|
|
10
10
|
},
|
|
11
11
|
"test-e2e": {
|
|
12
12
|
"command": ["node", "-e", "process.exit(0)"],
|
|
13
|
-
"dependsOn": [
|
|
13
|
+
"dependsOn": [
|
|
14
|
+
"test-e2e:1",
|
|
15
|
+
"test-e2e:2",
|
|
16
|
+
"test-e2e:3",
|
|
17
|
+
"test-e2e:4",
|
|
18
|
+
"//#generate:cache-keys"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"test-e2e-artifacts": {
|
|
22
|
+
"command": ["node", "-e", "process.exit(0)"],
|
|
23
|
+
"dependsOn": [
|
|
24
|
+
"test-e2e:1",
|
|
25
|
+
"test-e2e:2",
|
|
26
|
+
"test-e2e:3",
|
|
27
|
+
"test-e2e:4",
|
|
28
|
+
"//#generate:cache-keys"
|
|
29
|
+
]
|
|
14
30
|
},
|
|
15
31
|
"test-e2e:1": {
|
|
16
32
|
"command": ["node", "test/run-integration-group.mjs", "1"],
|
|
17
|
-
"dependsOn": ["build"],
|
|
33
|
+
"dependsOn": ["build", "//#generate:cache-keys"],
|
|
18
34
|
"inputs": [
|
|
19
35
|
"$TURBO_DEFAULT$",
|
|
20
36
|
"$TURBO_ROOT$/test/lib/**",
|
|
37
|
+
{
|
|
38
|
+
"mode": "dependencyOutputs",
|
|
39
|
+
"globs": ["turbo-platform-cache-key.json"],
|
|
40
|
+
"from": ["//#generate:cache-keys"]
|
|
41
|
+
},
|
|
21
42
|
"$TURBO_ROOT$/vitest.config.mts"
|
|
22
43
|
],
|
|
23
44
|
"outputLogs": "new-only"
|
|
24
45
|
},
|
|
25
46
|
"test-e2e:2": {
|
|
26
47
|
"command": ["node", "test/run-integration-group.mjs", "2"],
|
|
27
|
-
"dependsOn": ["build"],
|
|
48
|
+
"dependsOn": ["build", "//#generate:cache-keys"],
|
|
28
49
|
"inputs": [
|
|
29
50
|
"$TURBO_DEFAULT$",
|
|
30
51
|
"$TURBO_ROOT$/test/lib/**",
|
|
52
|
+
{
|
|
53
|
+
"mode": "dependencyOutputs",
|
|
54
|
+
"globs": ["turbo-platform-cache-key.json"],
|
|
55
|
+
"from": ["//#generate:cache-keys"]
|
|
56
|
+
},
|
|
31
57
|
"$TURBO_ROOT$/vitest.config.mts"
|
|
32
58
|
],
|
|
33
59
|
"outputLogs": "new-only"
|
|
34
60
|
},
|
|
35
61
|
"test-e2e:3": {
|
|
36
62
|
"command": ["node", "test/run-integration-group.mjs", "3"],
|
|
37
|
-
"dependsOn": ["build"],
|
|
63
|
+
"dependsOn": ["build", "//#generate:cache-keys"],
|
|
38
64
|
"inputs": [
|
|
39
65
|
"$TURBO_DEFAULT$",
|
|
40
66
|
"$TURBO_ROOT$/test/lib/**",
|
|
67
|
+
{
|
|
68
|
+
"mode": "dependencyOutputs",
|
|
69
|
+
"globs": ["turbo-platform-cache-key.json"],
|
|
70
|
+
"from": ["//#generate:cache-keys"]
|
|
71
|
+
},
|
|
41
72
|
"$TURBO_ROOT$/vitest.config.mts"
|
|
42
73
|
],
|
|
43
74
|
"outputLogs": "new-only"
|
|
44
75
|
},
|
|
45
76
|
"test-e2e:4": {
|
|
46
77
|
"command": ["node", "test/run-integration-group.mjs", "4"],
|
|
47
|
-
"dependsOn": ["build"],
|
|
78
|
+
"dependsOn": ["build", "//#generate:cache-keys"],
|
|
48
79
|
"inputs": [
|
|
49
80
|
"$TURBO_DEFAULT$",
|
|
50
81
|
"$TURBO_ROOT$/test/lib/**",
|
|
82
|
+
{
|
|
83
|
+
"mode": "dependencyOutputs",
|
|
84
|
+
"globs": ["turbo-platform-cache-key.json"],
|
|
85
|
+
"from": ["//#generate:cache-keys"]
|
|
86
|
+
},
|
|
51
87
|
"$TURBO_ROOT$/vitest.config.mts"
|
|
52
88
|
],
|
|
53
89
|
"outputLogs": "new-only"
|
package/dist/python.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import FileFsRef from './file-fs-ref';
|
|
2
|
-
/**
|
|
3
|
-
* Check if a Python file is a valid entrypoint by detecting:
|
|
4
|
-
* - A top-level 'app' callable (Flask, FastAPI, Sanic, WSGI/ASGI, etc.)
|
|
5
|
-
* - A top-level 'application' callable (Django)
|
|
6
|
-
* - A top-level 'handler' class (BaseHTTPRequestHandler subclass)
|
|
7
|
-
*/
|
|
8
|
-
export declare function isPythonEntrypoint(file: FileFsRef | {
|
|
9
|
-
fsPath?: string;
|
|
10
|
-
}): Promise<boolean>;
|
package/dist/python.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var python_exports = {};
|
|
30
|
-
__export(python_exports, {
|
|
31
|
-
isPythonEntrypoint: () => isPythonEntrypoint
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(python_exports);
|
|
34
|
-
var import_fs = __toESM(require("fs"));
|
|
35
|
-
var import_python_analysis = require("@vercel/python-analysis");
|
|
36
|
-
var import_debug = __toESM(require("./debug"));
|
|
37
|
-
async function isPythonEntrypoint(file) {
|
|
38
|
-
try {
|
|
39
|
-
const fsPath = file.fsPath;
|
|
40
|
-
if (!fsPath)
|
|
41
|
-
return false;
|
|
42
|
-
const content = await import_fs.default.promises.readFile(fsPath, "utf-8");
|
|
43
|
-
return await (0, import_python_analysis.findAppOrHandler)(content) !== null;
|
|
44
|
-
} catch (err) {
|
|
45
|
-
(0, import_debug.default)(`Failed to check Python entrypoint: ${err}`);
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
isPythonEntrypoint
|
|
52
|
-
});
|