vercel 51.5.0 → 51.6.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/dist/chunks/{add-RNQLGEYS.js → add-JALB3DKU.js} +6 -6
- package/dist/chunks/{chunk-DKFFXOHJ.js → chunk-34IM6J7A.js} +5 -2
- package/dist/chunks/{chunk-D2D4FJ6S.js → chunk-3N3AYMMW.js} +33 -18
- package/dist/chunks/{chunk-SG4QOQTF.js → chunk-4X7GBE5B.js} +101 -53
- package/dist/chunks/{chunk-5VKKTHMP.js → chunk-553A6UFX.js} +10 -6
- package/dist/chunks/{chunk-6C33Y3DC.js → chunk-5KFTN63Q.js} +8 -8
- package/dist/chunks/{chunk-TAOVG4PS.js → chunk-7L4XVUFK.js} +2 -2
- package/dist/chunks/{chunk-4DR2FV6O.js → chunk-BBW6EGBQ.js} +1 -1
- package/dist/chunks/{chunk-LDXYSGPZ.js → chunk-C7UTFMYF.js} +2 -2
- package/dist/chunks/chunk-CHUU7VXC.js +2314 -0
- package/dist/chunks/{chunk-BHDZCUTT.js → chunk-DAOAZ2VQ.js} +1 -1
- package/dist/chunks/{chunk-CRZM5WM2.js → chunk-DED5G3HZ.js} +1 -1
- package/dist/chunks/{chunk-G6RXZLQ2.js → chunk-DF4AVQY3.js} +2 -2
- package/dist/chunks/{chunk-HNU5CXW4.js → chunk-FH2OHGXG.js} +2 -2
- package/dist/chunks/{chunk-7MF47FW3.js → chunk-FY3TMBQS.js} +1 -1
- package/dist/chunks/{chunk-5NTBJ33M.js → chunk-HUPHOH2F.js} +1 -1
- package/dist/chunks/{chunk-DVQ4SIWF.js → chunk-LUCCJW67.js} +1 -1
- package/dist/chunks/{chunk-NKJC5SI4.js → chunk-LUJPLXGG.js} +2 -2
- package/dist/chunks/{chunk-VGWGLBUC.js → chunk-MCTAPJSL.js} +1 -1
- package/dist/chunks/{chunk-L2JUC7NX.js → chunk-MGJMZIIT.js} +1 -1
- package/dist/chunks/{chunk-FBY3IEDZ.js → chunk-MUJZV257.js} +8 -8
- package/dist/chunks/{chunk-BJQTGP42.js → chunk-PVZBM6NU.js} +1 -1
- package/dist/chunks/{chunk-BRQBLRFB.js → chunk-QFP6FEBN.js} +1 -1
- package/dist/chunks/{chunk-7ZDERWUW.js → chunk-QHXUBID6.js} +2 -2
- package/dist/chunks/{chunk-HQXVCOH6.js → chunk-RW7LIX2Y.js} +1 -1
- package/dist/chunks/{chunk-AUSDBXUD.js → chunk-U73MZTAR.js} +2 -2
- package/dist/chunks/{chunk-537JTK2U.js → chunk-UG4457SI.js} +260 -102
- package/dist/chunks/{chunk-RFMC2QXQ.js → chunk-VDM5O3P6.js} +3 -3
- package/dist/chunks/{chunk-GE6G37P4.js → chunk-WCTFUOSJ.js} +1 -1
- package/dist/chunks/chunk-WYRFA4PX.js +692 -0
- package/dist/chunks/{chunk-UWKTUK3W.js → chunk-XLKXWNRG.js} +1 -1
- package/dist/chunks/{chunk-P56KWLXY.js → chunk-Z66S4G43.js} +1 -1
- package/dist/chunks/{compile-vercel-config-ZVY7LBE3.js → compile-vercel-config-V2SHBZFW.js} +2 -2
- package/dist/chunks/{delete-SKTJMJNP.js → delete-5RI2PRIT.js} +4 -4
- package/dist/chunks/{disable-AG7I6DPV.js → disable-JPKO7VCV.js} +4 -4
- package/dist/chunks/{discard-LUK6LBLT.js → discard-KXGXXDNX.js} +4 -4
- package/dist/chunks/{edit-3BR5HP3U.js → edit-VFUE5PVU.js} +5 -5
- package/dist/chunks/{enable-4JNLOKSM.js → enable-V2AX2FXX.js} +4 -4
- package/dist/chunks/{export-YLZ6QSHG.js → export-BG3TOT6G.js} +4 -4
- package/dist/chunks/{inspect-HUJLUQAV.js → inspect-3QVCZVKV.js} +6 -6
- package/dist/chunks/{list-RMA56KYZ.js → list-CWTYXKB5.js} +7 -7
- package/dist/chunks/{list-EPU4SB3E.js → list-Y2YMJWEY.js} +4 -4
- package/dist/chunks/{ls-7HHDYE6F.js → ls-SY2CP56I.js} +6 -6
- package/dist/chunks/{publish-6YE4OUDI.js → publish-75IJ4PZS.js} +4 -4
- package/dist/chunks/{query-X6Q4ZSZO.js → query-MLMGNGL2.js} +5 -5
- package/dist/chunks/{reorder-VFM23ESC.js → reorder-757V4BF5.js} +4 -4
- package/dist/chunks/{restore-VX34SXVF.js → restore-KV44XHFS.js} +4 -4
- package/dist/chunks/{rm-5KXF2PY3.js → rm-3EGKFLKW.js} +6 -6
- package/dist/chunks/{rule-inspect-JG7AE5TI.js → rule-inspect-AYUGCLVJ.js} +6 -6
- package/dist/chunks/{rules-XRJBT22L.js → rules-FUFDJOIP.js} +6 -6
- package/dist/chunks/{schema-IMD4VV73.js → schema-CI2XUYTW.js} +6 -6
- package/dist/chunks/{types-QNN5CDCB.js → types-M7LVCA3E.js} +3 -3
- package/dist/chunks/{update-4FMWTIJK.js → update-6EM4XIDW.js} +6 -6
- package/dist/commands/build/index.js +57 -34
- package/dist/commands/deploy/index.js +23 -24
- package/dist/commands/dev/index.js +56 -31
- package/dist/commands/env/index.js +36 -22
- package/dist/commands/link/index.js +21 -21
- package/dist/commands/list/index.js +7 -7
- package/dist/commands-bulk.js +1671 -2533
- package/dist/index.js +41 -21
- package/dist/version.mjs +1 -1
- package/package.json +19 -19
- package/dist/chunks/chunk-6CWW4JIG.js +0 -310
- package/dist/chunks/chunk-O7SQKNIT.js +0 -247
- package/dist/chunks/chunk-RJD5NYGF.js +0 -149
|
@@ -10,35 +10,35 @@ import {
|
|
|
10
10
|
isLambda,
|
|
11
11
|
staticFiles,
|
|
12
12
|
writeBuildResult
|
|
13
|
-
} from "../../chunks/chunk-
|
|
13
|
+
} from "../../chunks/chunk-34IM6J7A.js";
|
|
14
14
|
import {
|
|
15
15
|
require_semver
|
|
16
16
|
} from "../../chunks/chunk-IB5L4LKZ.js";
|
|
17
17
|
import {
|
|
18
18
|
pullCommandLogic
|
|
19
|
-
} from "../../chunks/chunk-
|
|
19
|
+
} from "../../chunks/chunk-553A6UFX.js";
|
|
20
20
|
import {
|
|
21
21
|
pickOverrides,
|
|
22
22
|
readProjectSettings
|
|
23
|
-
} from "../../chunks/chunk-
|
|
24
|
-
import {
|
|
25
|
-
AGENT_REASON,
|
|
26
|
-
AGENT_STATUS
|
|
27
|
-
} from "../../chunks/chunk-E3NE4SKN.js";
|
|
23
|
+
} from "../../chunks/chunk-QFP6FEBN.js";
|
|
28
24
|
import {
|
|
29
25
|
ua_default
|
|
30
26
|
} from "../../chunks/chunk-4PQA6H63.js";
|
|
31
|
-
import "../../chunks/chunk-
|
|
32
|
-
import "../../chunks/chunk-
|
|
33
|
-
import "../../chunks/chunk-
|
|
34
|
-
import "../../chunks/chunk-
|
|
27
|
+
import "../../chunks/chunk-FY3TMBQS.js";
|
|
28
|
+
import "../../chunks/chunk-U73MZTAR.js";
|
|
29
|
+
import "../../chunks/chunk-3N3AYMMW.js";
|
|
30
|
+
import "../../chunks/chunk-LUJPLXGG.js";
|
|
35
31
|
import {
|
|
36
32
|
buildCommand
|
|
37
|
-
} from "../../chunks/chunk-
|
|
33
|
+
} from "../../chunks/chunk-WYRFA4PX.js";
|
|
34
|
+
import {
|
|
35
|
+
AGENT_REASON,
|
|
36
|
+
AGENT_STATUS
|
|
37
|
+
} from "../../chunks/chunk-E3NE4SKN.js";
|
|
38
38
|
import {
|
|
39
39
|
help
|
|
40
|
-
} from "../../chunks/chunk-
|
|
41
|
-
import "../../chunks/chunk-
|
|
40
|
+
} from "../../chunks/chunk-C7UTFMYF.js";
|
|
41
|
+
import "../../chunks/chunk-WCTFUOSJ.js";
|
|
42
42
|
import {
|
|
43
43
|
DEFAULT_VERCEL_CONFIG_FILENAME,
|
|
44
44
|
VERCEL_DIR,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
require_minimatch,
|
|
59
59
|
resolveProjectCwd,
|
|
60
60
|
validateConfig
|
|
61
|
-
} from "../../chunks/chunk-
|
|
61
|
+
} from "../../chunks/chunk-UG4457SI.js";
|
|
62
62
|
import {
|
|
63
63
|
TelemetryClient
|
|
64
64
|
} from "../../chunks/chunk-U3WLEFHU.js";
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
parseArguments,
|
|
75
75
|
printError,
|
|
76
76
|
toEnumerableError
|
|
77
|
-
} from "../../chunks/chunk-
|
|
77
|
+
} from "../../chunks/chunk-VDM5O3P6.js";
|
|
78
78
|
import {
|
|
79
79
|
CantParseJSONFile,
|
|
80
80
|
cmd,
|
|
@@ -124,8 +124,11 @@ import {
|
|
|
124
124
|
Span,
|
|
125
125
|
validateNpmrc,
|
|
126
126
|
glob,
|
|
127
|
-
|
|
127
|
+
getInternalServiceCronPath,
|
|
128
|
+
getServiceQueueTopicConfigs,
|
|
128
129
|
isBackendBuilder,
|
|
130
|
+
isQueueTriggeredService,
|
|
131
|
+
isScheduleTriggeredService,
|
|
129
132
|
downloadFile
|
|
130
133
|
} from "@vercel/build-utils";
|
|
131
134
|
|
|
@@ -934,7 +937,8 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
934
937
|
const diagnostics = {};
|
|
935
938
|
const packageManifests = [];
|
|
936
939
|
const hasDetectedServices = detectedServices !== void 0 && detectedServices.length > 0;
|
|
937
|
-
const
|
|
940
|
+
const hasQueueServices = hasDetectedServices && detectedServices.some(isQueueTriggeredService);
|
|
941
|
+
const synthesizedServiceCrons = [];
|
|
938
942
|
const serviceByBuilder = /* @__PURE__ */ new Map();
|
|
939
943
|
if (hasDetectedServices) {
|
|
940
944
|
for (const service of detectedServices) {
|
|
@@ -997,7 +1001,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
997
1001
|
if (service) {
|
|
998
1002
|
buildConfig = {
|
|
999
1003
|
...build.config,
|
|
1000
|
-
...
|
|
1004
|
+
...hasQueueServices ? { hasWorkerServices: true } : void 0,
|
|
1001
1005
|
// Override project-level settings with service-specific ones.
|
|
1002
1006
|
// The project-level framework is "services" which must NOT be
|
|
1003
1007
|
// propagated to individual builders.
|
|
@@ -1053,6 +1057,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1053
1057
|
service: {
|
|
1054
1058
|
name: service.name,
|
|
1055
1059
|
type: service.type,
|
|
1060
|
+
trigger: service.trigger,
|
|
1056
1061
|
routePrefix: typeof serviceRoutePrefix === "string" ? serviceRoutePrefix : void 0,
|
|
1057
1062
|
workspace: typeof serviceWorkspace === "string" ? serviceWorkspace : void 0,
|
|
1058
1063
|
schedule: service.schedule
|
|
@@ -1192,14 +1197,26 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1192
1197
|
allServices: detectedServices
|
|
1193
1198
|
});
|
|
1194
1199
|
}
|
|
1195
|
-
if (service
|
|
1196
|
-
|
|
1200
|
+
if (service && isQueueTriggeredService(service) && "output" in buildResult) {
|
|
1201
|
+
attachQueueServiceTrigger(buildResult.output, service);
|
|
1197
1202
|
}
|
|
1198
|
-
if (service
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
+
if (service && isScheduleTriggeredService(service) && !("crons" in buildResult && buildResult.crons?.length)) {
|
|
1204
|
+
if (typeof service.runtime === "string" && typeof service.schedule === "string" && service.schedule !== "<dynamic>") {
|
|
1205
|
+
const cronEntrypoint = service.entrypoint || service.builder.src || "index";
|
|
1206
|
+
synthesizedServiceCrons.push({
|
|
1207
|
+
path: getInternalServiceCronPath(
|
|
1208
|
+
service.name,
|
|
1209
|
+
cronEntrypoint,
|
|
1210
|
+
service.handlerFunction || "cron"
|
|
1211
|
+
),
|
|
1212
|
+
schedule: service.schedule
|
|
1213
|
+
});
|
|
1214
|
+
} else {
|
|
1215
|
+
throw new NowBuildError2({
|
|
1216
|
+
code: "CRON_SERVICE_NO_CRONS",
|
|
1217
|
+
message: `Scheduled service "${service.name}" did not produce any cron entries. The builder "${builderPkg.name}" may not support scheduled services.`
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1203
1220
|
}
|
|
1204
1221
|
let mergedBuildResult = buildResult;
|
|
1205
1222
|
if ("buildOutputPath" in buildResult) {
|
|
@@ -1396,7 +1413,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
|
|
|
1396
1413
|
});
|
|
1397
1414
|
const mergedImages = mergeImages(localConfig.images, buildResults.values());
|
|
1398
1415
|
const mergedCrons = mergeCrons(
|
|
1399
|
-
localConfig.crons || [],
|
|
1416
|
+
[...localConfig.crons || [], ...synthesizedServiceCrons],
|
|
1400
1417
|
buildResults.values()
|
|
1401
1418
|
);
|
|
1402
1419
|
const mergedWildcard = mergeWildcard(buildResults.values());
|
|
@@ -1767,27 +1784,33 @@ function getServicesMergeEntrypoint(service, buildSrc) {
|
|
|
1767
1784
|
const sortKey = String(1e4 - normalized.length).padStart(5, "0");
|
|
1768
1785
|
return `svc:${sortKey}:${normalized}:${service.name}:${buildSrc}`;
|
|
1769
1786
|
}
|
|
1770
|
-
function
|
|
1771
|
-
const topics =
|
|
1787
|
+
function attachQueueServiceTrigger(buildOutput, service) {
|
|
1788
|
+
const topics = getServiceQueueTopicConfigs(service);
|
|
1772
1789
|
const consumer = service.consumer || "default";
|
|
1773
|
-
for (const
|
|
1790
|
+
for (const topicConfig of topics) {
|
|
1774
1791
|
const trigger = {
|
|
1775
1792
|
type: "queue/v1beta",
|
|
1776
|
-
topic,
|
|
1793
|
+
topic: topicConfig.topic,
|
|
1777
1794
|
consumer
|
|
1778
1795
|
};
|
|
1796
|
+
if (topicConfig.retryAfterSeconds !== void 0) {
|
|
1797
|
+
trigger.retryAfterSeconds = topicConfig.retryAfterSeconds;
|
|
1798
|
+
}
|
|
1799
|
+
if (topicConfig.initialDelaySeconds !== void 0) {
|
|
1800
|
+
trigger.initialDelaySeconds = topicConfig.initialDelaySeconds;
|
|
1801
|
+
}
|
|
1779
1802
|
if (isLambda(buildOutput)) {
|
|
1780
|
-
|
|
1803
|
+
appendQueueTrigger(buildOutput, trigger);
|
|
1781
1804
|
} else {
|
|
1782
1805
|
for (const output of Object.values(buildOutput)) {
|
|
1783
1806
|
if (isLambda(output)) {
|
|
1784
|
-
|
|
1807
|
+
appendQueueTrigger(output, trigger);
|
|
1785
1808
|
}
|
|
1786
1809
|
}
|
|
1787
1810
|
}
|
|
1788
1811
|
}
|
|
1789
1812
|
}
|
|
1790
|
-
function
|
|
1813
|
+
function appendQueueTrigger(lambda, trigger) {
|
|
1791
1814
|
const existingTriggers = Array.isArray(lambda.experimentalTriggers) ? lambda.experimentalTriggers : [];
|
|
1792
1815
|
const alreadyConfigured = existingTriggers.some(
|
|
1793
1816
|
(existing) => existing.type === trigger.type && existing.topic === trigger.topic && existing.consumer === trigger.consumer
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
purchaseDomainIfAvailable,
|
|
15
15
|
require_cjs,
|
|
16
16
|
setupDomain
|
|
17
|
-
} from "../../chunks/chunk-
|
|
17
|
+
} from "../../chunks/chunk-MUJZV257.js";
|
|
18
18
|
import {
|
|
19
19
|
readLocalConfig
|
|
20
|
-
} from "../../chunks/chunk-
|
|
20
|
+
} from "../../chunks/chunk-5KFTN63Q.js";
|
|
21
21
|
import {
|
|
22
22
|
highlight
|
|
23
23
|
} from "../../chunks/chunk-V5P25P7F.js";
|
|
@@ -29,11 +29,10 @@ import {
|
|
|
29
29
|
getDeployment,
|
|
30
30
|
mapCertError
|
|
31
31
|
} from "../../chunks/chunk-N45K6NXC.js";
|
|
32
|
-
import "../../chunks/chunk-
|
|
32
|
+
import "../../chunks/chunk-MGJMZIIT.js";
|
|
33
33
|
import {
|
|
34
34
|
validateJsonOutput
|
|
35
35
|
} from "../../chunks/chunk-XPKWKPWA.js";
|
|
36
|
-
import "../../chunks/chunk-O7SQKNIT.js";
|
|
37
36
|
import {
|
|
38
37
|
getSubcommand
|
|
39
38
|
} from "../../chunks/chunk-YPQSDAEW.js";
|
|
@@ -43,34 +42,34 @@ import {
|
|
|
43
42
|
deprecatedArchiveSplitTgz,
|
|
44
43
|
getCommandAliases,
|
|
45
44
|
initSubcommand
|
|
46
|
-
} from "../../chunks/chunk-
|
|
47
|
-
import "../../chunks/chunk-
|
|
48
|
-
import "../../chunks/chunk-
|
|
49
|
-
import "../../chunks/chunk-
|
|
50
|
-
import "../../chunks/chunk-
|
|
51
|
-
import "../../chunks/chunk-
|
|
52
|
-
import "../../chunks/chunk-
|
|
53
|
-
import "../../chunks/chunk-
|
|
45
|
+
} from "../../chunks/chunk-4X7GBE5B.js";
|
|
46
|
+
import "../../chunks/chunk-DED5G3HZ.js";
|
|
47
|
+
import "../../chunks/chunk-DAOAZ2VQ.js";
|
|
48
|
+
import "../../chunks/chunk-PVZBM6NU.js";
|
|
49
|
+
import "../../chunks/chunk-XLKXWNRG.js";
|
|
50
|
+
import "../../chunks/chunk-7L4XVUFK.js";
|
|
51
|
+
import "../../chunks/chunk-LUCCJW67.js";
|
|
52
|
+
import "../../chunks/chunk-MCTAPJSL.js";
|
|
54
53
|
import {
|
|
55
54
|
pickOverrides
|
|
56
|
-
} from "../../chunks/chunk-
|
|
57
|
-
import {
|
|
58
|
-
AGENT_STATUS
|
|
59
|
-
} from "../../chunks/chunk-E3NE4SKN.js";
|
|
55
|
+
} from "../../chunks/chunk-QFP6FEBN.js";
|
|
60
56
|
import "../../chunks/chunk-4PQA6H63.js";
|
|
61
57
|
import {
|
|
62
58
|
ensureLink
|
|
63
|
-
} from "../../chunks/chunk-
|
|
59
|
+
} from "../../chunks/chunk-U73MZTAR.js";
|
|
64
60
|
import {
|
|
65
61
|
validatePaths,
|
|
66
62
|
validateRootDirectory
|
|
67
|
-
} from "../../chunks/chunk-
|
|
68
|
-
import "../../chunks/chunk-
|
|
69
|
-
import "../../chunks/chunk-
|
|
63
|
+
} from "../../chunks/chunk-3N3AYMMW.js";
|
|
64
|
+
import "../../chunks/chunk-LUJPLXGG.js";
|
|
65
|
+
import "../../chunks/chunk-WYRFA4PX.js";
|
|
66
|
+
import {
|
|
67
|
+
AGENT_STATUS
|
|
68
|
+
} from "../../chunks/chunk-E3NE4SKN.js";
|
|
70
69
|
import {
|
|
71
70
|
help
|
|
72
|
-
} from "../../chunks/chunk-
|
|
73
|
-
import "../../chunks/chunk-
|
|
71
|
+
} from "../../chunks/chunk-C7UTFMYF.js";
|
|
72
|
+
import "../../chunks/chunk-WCTFUOSJ.js";
|
|
74
73
|
import {
|
|
75
74
|
compileVercelConfig,
|
|
76
75
|
createGitMeta,
|
|
@@ -79,7 +78,7 @@ import {
|
|
|
79
78
|
parseTarget,
|
|
80
79
|
require_dist as require_dist2,
|
|
81
80
|
require_lib
|
|
82
|
-
} from "../../chunks/chunk-
|
|
81
|
+
} from "../../chunks/chunk-UG4457SI.js";
|
|
83
82
|
import {
|
|
84
83
|
TelemetryClient
|
|
85
84
|
} from "../../chunks/chunk-U3WLEFHU.js";
|
|
@@ -95,7 +94,7 @@ import {
|
|
|
95
94
|
getFlagsSpecification,
|
|
96
95
|
parseArguments,
|
|
97
96
|
printError
|
|
98
|
-
} from "../../chunks/chunk-
|
|
97
|
+
} from "../../chunks/chunk-VDM5O3P6.js";
|
|
99
98
|
import {
|
|
100
99
|
AliasDomainConfigured,
|
|
101
100
|
BuildError,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "../../chunks/chunk-2HSQ7YUK.js";
|
|
10
10
|
import {
|
|
11
11
|
getUpdateCommand
|
|
12
|
-
} from "../../chunks/chunk-
|
|
12
|
+
} from "../../chunks/chunk-BBW6EGBQ.js";
|
|
13
13
|
import {
|
|
14
14
|
highlight
|
|
15
15
|
} from "../../chunks/chunk-V5P25P7F.js";
|
|
@@ -18,31 +18,31 @@ import {
|
|
|
18
18
|
} from "../../chunks/chunk-YPQSDAEW.js";
|
|
19
19
|
import {
|
|
20
20
|
devCommand
|
|
21
|
-
} from "../../chunks/chunk-
|
|
21
|
+
} from "../../chunks/chunk-PVZBM6NU.js";
|
|
22
22
|
import {
|
|
23
23
|
OUTPUT_DIR,
|
|
24
24
|
importBuilders,
|
|
25
25
|
require_mime_types,
|
|
26
26
|
require_npa,
|
|
27
27
|
staticFiles
|
|
28
|
-
} from "../../chunks/chunk-
|
|
28
|
+
} from "../../chunks/chunk-34IM6J7A.js";
|
|
29
29
|
import "../../chunks/chunk-IB5L4LKZ.js";
|
|
30
30
|
import {
|
|
31
31
|
pickOverrides
|
|
32
|
-
} from "../../chunks/chunk-
|
|
33
|
-
import "../../chunks/chunk-
|
|
32
|
+
} from "../../chunks/chunk-QFP6FEBN.js";
|
|
33
|
+
import "../../chunks/chunk-FY3TMBQS.js";
|
|
34
34
|
import {
|
|
35
35
|
displayDetectedServices,
|
|
36
36
|
readConfig,
|
|
37
37
|
setupAndLink
|
|
38
|
-
} from "../../chunks/chunk-
|
|
38
|
+
} from "../../chunks/chunk-3N3AYMMW.js";
|
|
39
39
|
import {
|
|
40
40
|
getLocalPathConfig
|
|
41
|
-
} from "../../chunks/chunk-
|
|
41
|
+
} from "../../chunks/chunk-LUJPLXGG.js";
|
|
42
42
|
import {
|
|
43
43
|
help
|
|
44
|
-
} from "../../chunks/chunk-
|
|
45
|
-
import "../../chunks/chunk-
|
|
44
|
+
} from "../../chunks/chunk-C7UTFMYF.js";
|
|
45
|
+
import "../../chunks/chunk-WCTFUOSJ.js";
|
|
46
46
|
import {
|
|
47
47
|
VERCEL_DIR,
|
|
48
48
|
getLinkedProject,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
resolveProjectCwd,
|
|
67
67
|
tryDetectServices,
|
|
68
68
|
validateConfig
|
|
69
|
-
} from "../../chunks/chunk-
|
|
69
|
+
} from "../../chunks/chunk-UG4457SI.js";
|
|
70
70
|
import {
|
|
71
71
|
TelemetryClient
|
|
72
72
|
} from "../../chunks/chunk-U3WLEFHU.js";
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
getFlagsSpecification,
|
|
82
82
|
parseArguments,
|
|
83
83
|
printError
|
|
84
|
-
} from "../../chunks/chunk-
|
|
84
|
+
} from "../../chunks/chunk-VDM5O3P6.js";
|
|
85
85
|
import {
|
|
86
86
|
CantParseJSONFile,
|
|
87
87
|
LambdaSizeExceededError,
|
|
@@ -16792,6 +16792,7 @@ var import_frameworks2 = __toESM(require_frameworks(), 1);
|
|
|
16792
16792
|
import {
|
|
16793
16793
|
cloneEnv as cloneEnv2,
|
|
16794
16794
|
getNodeBinPaths as getNodeBinPaths2,
|
|
16795
|
+
isQueueTriggeredService as isQueueTriggeredService3,
|
|
16795
16796
|
FileFsRef as FileFsRef2,
|
|
16796
16797
|
spawnCommand as spawnCommand2,
|
|
16797
16798
|
shouldUseExperimentalBackends
|
|
@@ -17695,6 +17696,8 @@ function getNextCronDelay(expression, now = /* @__PURE__ */ new Date()) {
|
|
|
17695
17696
|
|
|
17696
17697
|
// src/util/dev/services-orchestrator.ts
|
|
17697
17698
|
import {
|
|
17699
|
+
isQueueTriggeredService,
|
|
17700
|
+
isScheduleTriggeredService,
|
|
17698
17701
|
cloneEnv,
|
|
17699
17702
|
getNodeBinPaths,
|
|
17700
17703
|
spawnCommand,
|
|
@@ -17770,13 +17773,16 @@ function createServiceLogger(serviceName, colorIndex, maxNameLength) {
|
|
|
17770
17773
|
return { stdout, stderr, cleanup };
|
|
17771
17774
|
}
|
|
17772
17775
|
function getServiceRoutePrefixes(service) {
|
|
17773
|
-
if (service
|
|
17776
|
+
if (isQueueTriggeredService(service)) {
|
|
17774
17777
|
return [(0, import_fs_detectors2.getInternalServiceWorkerPathPrefix)(service.name)];
|
|
17775
17778
|
}
|
|
17776
|
-
if (service
|
|
17779
|
+
if (isScheduleTriggeredService(service)) {
|
|
17777
17780
|
return [(0, import_fs_detectors2.getInternalServiceCronPathPrefix)(service.name)];
|
|
17778
17781
|
}
|
|
17779
|
-
|
|
17782
|
+
if (service.type === "web") {
|
|
17783
|
+
return [service.routePrefix || "/"];
|
|
17784
|
+
}
|
|
17785
|
+
return [];
|
|
17780
17786
|
}
|
|
17781
17787
|
var ServicesOrchestrator = class {
|
|
17782
17788
|
constructor(options) {
|
|
@@ -17793,7 +17799,7 @@ var ServicesOrchestrator = class {
|
|
|
17793
17799
|
this.pythonServiceCount = options.services.filter(
|
|
17794
17800
|
(s) => s.runtime === "python"
|
|
17795
17801
|
).length;
|
|
17796
|
-
this.
|
|
17802
|
+
this.hasQueueServices = options.services.some(isQueueTriggeredService);
|
|
17797
17803
|
}
|
|
17798
17804
|
async startAll() {
|
|
17799
17805
|
output_manager_default.debug(`Starting ${this.services.length} services`);
|
|
@@ -17917,10 +17923,13 @@ var ServicesOrchestrator = class {
|
|
|
17917
17923
|
serviceUrlEnvVars
|
|
17918
17924
|
);
|
|
17919
17925
|
env.VERCEL_SERVICE_TYPE = service.type;
|
|
17920
|
-
if (
|
|
17926
|
+
if (service.trigger) {
|
|
17927
|
+
env.VERCEL_SERVICE_TRIGGER = service.trigger;
|
|
17928
|
+
}
|
|
17929
|
+
if (this.hasQueueServices && service.runtime === "python" && env.VERCEL_HAS_WORKER_SERVICES === void 0) {
|
|
17921
17930
|
env.VERCEL_HAS_WORKER_SERVICES = "1";
|
|
17922
17931
|
}
|
|
17923
|
-
if (this.
|
|
17932
|
+
if (this.hasQueueServices) {
|
|
17924
17933
|
env.VERCEL_QUEUE_BASE_URL = `${this.proxyOrigin}/_svc/_queues`;
|
|
17925
17934
|
env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
|
|
17926
17935
|
}
|
|
@@ -17988,6 +17997,7 @@ var ServicesOrchestrator = class {
|
|
|
17988
17997
|
service: {
|
|
17989
17998
|
name: service.name,
|
|
17990
17999
|
type: service.type,
|
|
18000
|
+
trigger: service.trigger,
|
|
17991
18001
|
routePrefix: service.routePrefix,
|
|
17992
18002
|
subdomain: service.subdomain,
|
|
17993
18003
|
workspace: service.workspace,
|
|
@@ -18190,11 +18200,22 @@ var ServicesOrchestrator = class {
|
|
|
18190
18200
|
}
|
|
18191
18201
|
startCronSchedulers() {
|
|
18192
18202
|
for (const [name, managed] of this.managedServices) {
|
|
18193
|
-
|
|
18203
|
+
const service = this.services.find((candidate) => candidate.name === name);
|
|
18204
|
+
const crons = managed.crons && managed.crons.length > 0 ? managed.crons : service && isScheduleTriggeredService(service) && service.schedule && service.schedule !== "<dynamic>" ? [
|
|
18205
|
+
{
|
|
18206
|
+
path: (0, import_fs_detectors2.getInternalServiceCronPath)(
|
|
18207
|
+
name,
|
|
18208
|
+
service.entrypoint || service.builder.src || "index",
|
|
18209
|
+
service.handlerFunction || "cron"
|
|
18210
|
+
),
|
|
18211
|
+
schedule: service.schedule
|
|
18212
|
+
}
|
|
18213
|
+
] : [];
|
|
18214
|
+
if (crons.length === 0)
|
|
18194
18215
|
continue;
|
|
18195
|
-
for (const cron of
|
|
18216
|
+
for (const cron of crons) {
|
|
18196
18217
|
output_manager_default.debug(
|
|
18197
|
-
`Scheduling
|
|
18218
|
+
`Scheduling job service ${import_chalk.default.bold(name)} (${import_chalk.default.cyan(cron.schedule)})`
|
|
18198
18219
|
);
|
|
18199
18220
|
this.scheduleCronTrigger(name, cron.path, cron.schedule, managed);
|
|
18200
18221
|
}
|
|
@@ -18212,7 +18233,7 @@ var ServicesOrchestrator = class {
|
|
|
18212
18233
|
if (this.stopping)
|
|
18213
18234
|
return;
|
|
18214
18235
|
output_manager_default.debug(
|
|
18215
|
-
`Triggering
|
|
18236
|
+
`Triggering scheduled job ${import_chalk.default.bold(serviceName)} (schedule: ${import_chalk.default.cyan(schedule)})`
|
|
18216
18237
|
);
|
|
18217
18238
|
try {
|
|
18218
18239
|
const url3 = `http://${managed.host}:${managed.port}${cronPath}`;
|
|
@@ -18235,7 +18256,10 @@ var ServicesOrchestrator = class {
|
|
|
18235
18256
|
var import_ms3 = __toESM(require_ms(), 1);
|
|
18236
18257
|
var import_node_fetch = __toESM(require_lib2(), 1);
|
|
18237
18258
|
import { randomBytes } from "crypto";
|
|
18238
|
-
import {
|
|
18259
|
+
import {
|
|
18260
|
+
getServiceQueueTopicConfigs,
|
|
18261
|
+
isQueueTriggeredService as isQueueTriggeredService2
|
|
18262
|
+
} from "@vercel/build-utils";
|
|
18239
18263
|
var DEFAULT_RETRY_AFTER = (0, import_ms3.default)("1m");
|
|
18240
18264
|
var DEFAULT_MAX_DELIVERIES = 32;
|
|
18241
18265
|
var DEFAULT_INITIAL_DELAY = 0;
|
|
@@ -18253,10 +18277,11 @@ var QueueBroker = class {
|
|
|
18253
18277
|
this.consumerGroups = [];
|
|
18254
18278
|
this.deliveryState = /* @__PURE__ */ new Map();
|
|
18255
18279
|
for (const service of services) {
|
|
18256
|
-
if (service
|
|
18280
|
+
if (!isQueueTriggeredService2(service))
|
|
18257
18281
|
continue;
|
|
18258
|
-
const
|
|
18259
|
-
for (const
|
|
18282
|
+
const topicConfigs = getServiceQueueTopicConfigs(service);
|
|
18283
|
+
for (const topicConfig of topicConfigs) {
|
|
18284
|
+
const topicPattern = topicConfig.topic;
|
|
18260
18285
|
const id = `${service.name}::${topicPattern}`;
|
|
18261
18286
|
const group = {
|
|
18262
18287
|
id,
|
|
@@ -18264,9 +18289,9 @@ var QueueBroker = class {
|
|
|
18264
18289
|
topicPattern,
|
|
18265
18290
|
topicRegex: topicPatternToRegex(topicPattern),
|
|
18266
18291
|
serviceOriginFn: () => this.getServiceOrigin(service.name),
|
|
18267
|
-
retryAfterMs: DEFAULT_RETRY_AFTER,
|
|
18292
|
+
retryAfterMs: topicConfig.retryAfterSeconds !== void 0 ? topicConfig.retryAfterSeconds * 1e3 : DEFAULT_RETRY_AFTER,
|
|
18268
18293
|
maxDeliveries: DEFAULT_MAX_DELIVERIES,
|
|
18269
|
-
initialDelayMs: DEFAULT_INITIAL_DELAY
|
|
18294
|
+
initialDelayMs: topicConfig.initialDelaySeconds !== void 0 ? topicConfig.initialDelaySeconds * 1e3 : DEFAULT_INITIAL_DELAY
|
|
18270
18295
|
};
|
|
18271
18296
|
this.consumerGroups.push(group);
|
|
18272
18297
|
this.deliveryState.set(group.id, /* @__PURE__ */ new Map());
|
|
@@ -19827,7 +19852,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
19827
19852
|
return void 0;
|
|
19828
19853
|
}
|
|
19829
19854
|
async _getVercelConfig() {
|
|
19830
|
-
const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-
|
|
19855
|
+
const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-V2SHBZFW.js");
|
|
19831
19856
|
await compileVercelConfig(this.cwd);
|
|
19832
19857
|
const configPath = getLocalPathConfig(this.cwd);
|
|
19833
19858
|
const [
|
|
@@ -20115,10 +20140,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
20115
20140
|
});
|
|
20116
20141
|
devCommandPromise = this.orchestrator.startAll();
|
|
20117
20142
|
this.devProcessOrigin = void 0;
|
|
20118
|
-
const
|
|
20119
|
-
|
|
20143
|
+
const queueServices = (this.services || []).filter(
|
|
20144
|
+
isQueueTriggeredService3
|
|
20120
20145
|
);
|
|
20121
|
-
if (
|
|
20146
|
+
if (queueServices.length > 0) {
|
|
20122
20147
|
this.queueBroker = new QueueBroker(
|
|
20123
20148
|
this.services || [],
|
|
20124
20149
|
(name) => this.orchestrator.getServiceOrigin(name)
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
} from "../../chunks/chunk-C5YP6KFI.js";
|
|
13
13
|
import {
|
|
14
14
|
formatTable
|
|
15
|
-
} from "../../chunks/chunk-
|
|
15
|
+
} from "../../chunks/chunk-DF4AVQY3.js";
|
|
16
16
|
import {
|
|
17
17
|
suggestNextCommands
|
|
18
18
|
} from "../../chunks/chunk-LOS7HHU3.js";
|
|
19
19
|
import {
|
|
20
20
|
formatEnvironment,
|
|
21
21
|
validateLsArgs
|
|
22
|
-
} from "../../chunks/chunk-
|
|
22
|
+
} from "../../chunks/chunk-Z66S4G43.js";
|
|
23
23
|
import {
|
|
24
24
|
validateJsonOutput
|
|
25
25
|
} from "../../chunks/chunk-XPKWKPWA.js";
|
|
@@ -28,22 +28,25 @@ import {
|
|
|
28
28
|
} from "../../chunks/chunk-YPQSDAEW.js";
|
|
29
29
|
import {
|
|
30
30
|
getCommandAliases
|
|
31
|
-
} from "../../chunks/chunk-
|
|
32
|
-
import "../../chunks/chunk-
|
|
33
|
-
import "../../chunks/chunk-
|
|
34
|
-
import "../../chunks/chunk-
|
|
35
|
-
import "../../chunks/chunk-
|
|
36
|
-
import "../../chunks/chunk-
|
|
37
|
-
import "../../chunks/chunk-
|
|
38
|
-
import "../../chunks/chunk-
|
|
31
|
+
} from "../../chunks/chunk-4X7GBE5B.js";
|
|
32
|
+
import "../../chunks/chunk-DED5G3HZ.js";
|
|
33
|
+
import "../../chunks/chunk-DAOAZ2VQ.js";
|
|
34
|
+
import "../../chunks/chunk-PVZBM6NU.js";
|
|
35
|
+
import "../../chunks/chunk-XLKXWNRG.js";
|
|
36
|
+
import "../../chunks/chunk-7L4XVUFK.js";
|
|
37
|
+
import "../../chunks/chunk-LUCCJW67.js";
|
|
38
|
+
import "../../chunks/chunk-MCTAPJSL.js";
|
|
39
39
|
import {
|
|
40
40
|
require_execa
|
|
41
|
-
} from "../../chunks/chunk-
|
|
42
|
-
import
|
|
41
|
+
} from "../../chunks/chunk-FY3TMBQS.js";
|
|
42
|
+
import {
|
|
43
|
+
autoInstallVercelPlugin
|
|
44
|
+
} from "../../chunks/chunk-WYRFA4PX.js";
|
|
45
|
+
import "../../chunks/chunk-E3NE4SKN.js";
|
|
43
46
|
import {
|
|
44
47
|
help
|
|
45
|
-
} from "../../chunks/chunk-
|
|
46
|
-
import "../../chunks/chunk-
|
|
48
|
+
} from "../../chunks/chunk-C7UTFMYF.js";
|
|
49
|
+
import "../../chunks/chunk-WCTFUOSJ.js";
|
|
47
50
|
import {
|
|
48
51
|
STANDARD_ENVIRONMENTS,
|
|
49
52
|
addSubcommand,
|
|
@@ -63,7 +66,7 @@ import {
|
|
|
63
66
|
require_frameworks,
|
|
64
67
|
runSubcommand,
|
|
65
68
|
updateSubcommand
|
|
66
|
-
} from "../../chunks/chunk-
|
|
69
|
+
} from "../../chunks/chunk-UG4457SI.js";
|
|
67
70
|
import {
|
|
68
71
|
TelemetryClient,
|
|
69
72
|
require_dist as require_dist2
|
|
@@ -87,7 +90,7 @@ import {
|
|
|
87
90
|
getFlagsSpecification,
|
|
88
91
|
parseArguments,
|
|
89
92
|
printError
|
|
90
|
-
} from "../../chunks/chunk-
|
|
93
|
+
} from "../../chunks/chunk-VDM5O3P6.js";
|
|
91
94
|
import {
|
|
92
95
|
getCommandName,
|
|
93
96
|
getCommandNamePlain,
|
|
@@ -2094,6 +2097,7 @@ async function main(client) {
|
|
|
2094
2097
|
help(command, { parent: envCommand, columns: client.stderr.columns })
|
|
2095
2098
|
);
|
|
2096
2099
|
}
|
|
2100
|
+
let exitCode;
|
|
2097
2101
|
switch (subcommand) {
|
|
2098
2102
|
case "ls":
|
|
2099
2103
|
if (needHelp) {
|
|
@@ -2102,7 +2106,8 @@ async function main(client) {
|
|
|
2102
2106
|
return 2;
|
|
2103
2107
|
}
|
|
2104
2108
|
telemetry.trackCliSubcommandList(subcommandOriginal);
|
|
2105
|
-
|
|
2109
|
+
exitCode = await ls(client, args);
|
|
2110
|
+
break;
|
|
2106
2111
|
case "add":
|
|
2107
2112
|
if (needHelp) {
|
|
2108
2113
|
telemetry.trackCliFlagHelp("env", subcommandOriginal);
|
|
@@ -2110,7 +2115,8 @@ async function main(client) {
|
|
|
2110
2115
|
return 2;
|
|
2111
2116
|
}
|
|
2112
2117
|
telemetry.trackCliSubcommandAdd(subcommandOriginal);
|
|
2113
|
-
|
|
2118
|
+
exitCode = await add(client, args);
|
|
2119
|
+
break;
|
|
2114
2120
|
case "rm":
|
|
2115
2121
|
if (needHelp) {
|
|
2116
2122
|
telemetry.trackCliFlagHelp("env", subcommandOriginal);
|
|
@@ -2118,7 +2124,8 @@ async function main(client) {
|
|
|
2118
2124
|
return 2;
|
|
2119
2125
|
}
|
|
2120
2126
|
telemetry.trackCliSubcommandRemove(subcommandOriginal);
|
|
2121
|
-
|
|
2127
|
+
exitCode = await rm(client, args);
|
|
2128
|
+
break;
|
|
2122
2129
|
case "pull":
|
|
2123
2130
|
if (needHelp) {
|
|
2124
2131
|
telemetry.trackCliFlagHelp("env", subcommandOriginal);
|
|
@@ -2126,7 +2133,8 @@ async function main(client) {
|
|
|
2126
2133
|
return 2;
|
|
2127
2134
|
}
|
|
2128
2135
|
telemetry.trackCliSubcommandPull(subcommandOriginal);
|
|
2129
|
-
|
|
2136
|
+
exitCode = await pull(client, args);
|
|
2137
|
+
break;
|
|
2130
2138
|
case "run":
|
|
2131
2139
|
if (needsHelpForRun(client)) {
|
|
2132
2140
|
telemetry.trackCliFlagHelp("env", subcommandOriginal);
|
|
@@ -2134,7 +2142,8 @@ async function main(client) {
|
|
|
2134
2142
|
return 2;
|
|
2135
2143
|
}
|
|
2136
2144
|
telemetry.trackCliSubcommandRun(subcommandOriginal);
|
|
2137
|
-
|
|
2145
|
+
exitCode = await run(client);
|
|
2146
|
+
break;
|
|
2138
2147
|
case "update":
|
|
2139
2148
|
if (needHelp) {
|
|
2140
2149
|
telemetry.trackCliFlagHelp("env", subcommandOriginal);
|
|
@@ -2142,12 +2151,17 @@ async function main(client) {
|
|
|
2142
2151
|
return 2;
|
|
2143
2152
|
}
|
|
2144
2153
|
telemetry.trackCliSubcommandUpdate(subcommandOriginal);
|
|
2145
|
-
|
|
2154
|
+
exitCode = await update(client, args);
|
|
2155
|
+
break;
|
|
2146
2156
|
default:
|
|
2147
2157
|
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG));
|
|
2148
2158
|
output_manager_default.print(help(envCommand, { columns: client.stderr.columns }));
|
|
2149
2159
|
return 2;
|
|
2150
2160
|
}
|
|
2161
|
+
if (exitCode === 0) {
|
|
2162
|
+
await autoInstallVercelPlugin(client);
|
|
2163
|
+
}
|
|
2164
|
+
return exitCode;
|
|
2151
2165
|
}
|
|
2152
2166
|
export {
|
|
2153
2167
|
main as default
|