vercel 59.5.0 → 59.7.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/dist/chunks/{add-Z5FM6TFI.js → add-7O4TM33A.js} +12 -12
- package/dist/chunks/{add-MH3WV6PV.js → add-UT6ZPA4F.js} +11 -11
- package/dist/chunks/{add-W3FFMTX4.js → add-UVMFKSSY.js} +11 -11
- package/dist/chunks/{build-VYYFBJL7.js → build-SKKT3DIB.js} +11 -11
- package/dist/chunks/{chunk-LLM3ZNXJ.js → chunk-2EH6SZRG.js} +2 -2
- package/dist/chunks/{chunk-UUVMIXT4.js → chunk-2T3IZZTJ.js} +4 -4
- package/dist/chunks/{chunk-RZ5NP6HN.js → chunk-2YRAWYGE.js} +1 -1
- package/dist/chunks/{chunk-TDXNNIZ6.js → chunk-3PA7LXYM.js} +2 -2
- package/dist/chunks/{chunk-KQRVZWJU.js → chunk-3T7WSWZH.js} +1 -1
- package/dist/chunks/{chunk-R6IGDGX3.js → chunk-5XECIWME.js} +1 -1
- package/dist/chunks/{chunk-PBHBX6UL.js → chunk-63OX2DER.js} +3 -3
- package/dist/chunks/{chunk-V4YLY44R.js → chunk-67IIZBBY.js} +2 -2
- package/dist/chunks/{chunk-AWSLWAOC.js → chunk-6JPVTPTU.js} +3 -3
- package/dist/chunks/{chunk-HT2XWSAJ.js → chunk-7AEEQOD4.js} +2 -29
- package/dist/chunks/{chunk-QG4PCM45.js → chunk-7HE63HCR.js} +102 -15
- package/dist/chunks/{chunk-FA3MO56Q.js → chunk-7IDPPWDN.js} +5 -5
- package/dist/chunks/{chunk-MRMNMFMD.js → chunk-7KSICC3A.js} +1 -1
- package/dist/chunks/{chunk-XBN2O34P.js → chunk-7ST552E3.js} +17 -4
- package/dist/chunks/{chunk-TAZ5ZAKG.js → chunk-AFKB6VMO.js} +2 -2
- package/dist/chunks/{chunk-CV4S27SS.js → chunk-ASBP32T6.js} +1 -1
- package/dist/chunks/{chunk-CQJRLNTX.js → chunk-AYLY3ZVL.js} +2 -2
- package/dist/chunks/{chunk-AWCID36T.js → chunk-BMKU5KEL.js} +1 -1
- package/dist/chunks/{chunk-E6LFKMI2.js → chunk-BQG777JE.js} +794 -124
- package/dist/chunks/{chunk-VWYNSJXI.js → chunk-CBHLLOGZ.js} +8 -8
- package/dist/chunks/{chunk-CSCSGSQG.js → chunk-CMRZ4KI4.js} +5 -5
- package/dist/chunks/{chunk-TIWAL2YU.js → chunk-DG6IMLCF.js} +6 -6
- package/dist/chunks/{chunk-YIHOS3ZF.js → chunk-FRAXI2WT.js} +1 -1
- package/dist/chunks/{chunk-7XX4ZEOV.js → chunk-FWKSJYDV.js} +1 -1
- package/dist/chunks/{chunk-OHER4DGX.js → chunk-FXD67VN5.js} +25 -9
- package/dist/chunks/{chunk-GUWPUX2Y.js → chunk-GK3RE3AC.js} +4 -4
- package/dist/chunks/{chunk-JNU3DTEV.js → chunk-IFNCPWH5.js} +9 -9
- package/dist/chunks/{chunk-PIMIKY4X.js → chunk-IJ4X426J.js} +1 -1
- package/dist/chunks/{chunk-NSU2BTRS.js → chunk-KD2N44NG.js} +4 -4
- package/dist/chunks/{chunk-TVXCXIRO.js → chunk-L3UXB2CW.js} +1 -1
- package/dist/chunks/{chunk-JJQP3PYM.js → chunk-MHCGKUI7.js} +5 -5
- package/dist/chunks/{chunk-47VQ6H2S.js → chunk-MUMITVZP.js} +2 -2
- package/dist/chunks/{chunk-L7CEMAJG.js → chunk-NGGLYKNU.js} +27 -5
- package/dist/chunks/{chunk-ZKUHCL6O.js → chunk-NJCM5JJN.js} +5 -5
- package/dist/chunks/{chunk-5LX2JDZP.js → chunk-O75LSD3C.js} +1 -1
- package/dist/chunks/{chunk-OX7KI3LF.js → chunk-QFAS4OVW.js} +18 -0
- package/dist/chunks/{chunk-4JTF6RD7.js → chunk-SSBYESJ5.js} +4 -4
- package/dist/chunks/{chunk-G75NFPIT.js → chunk-WNAKOXGK.js} +1 -1
- package/dist/chunks/{chunk-PPUWG2UB.js → chunk-WVPMR7XV.js} +58 -25
- package/dist/chunks/{chunk-CYNB6LL4.js → chunk-XNFHNTS2.js} +1 -1
- package/dist/chunks/{chunk-M3OSDZPY.js → chunk-XSYZDMUP.js} +16 -7
- package/dist/chunks/{chunk-VLPLCJZC.js → chunk-ZSFEACZU.js} +1 -1
- package/dist/chunks/{clear-TNGRDA7D.js → clear-X7M4WGBC.js} +11 -11
- package/dist/chunks/{compile-vercel-config-ERLXKKWW.js → compile-vercel-config-FBOZBWJC.js} +7 -7
- package/dist/chunks/{config-7EDKML5Q.js → config-KGW667XC.js} +9 -9
- package/dist/chunks/{config-H22EE765.js → config-RYPSCAR7.js} +11 -11
- package/dist/chunks/{delete-LORYIZHY.js → delete-OXYXXPHR.js} +8 -8
- package/dist/chunks/{delete-Q4S5F2AI.js → delete-VK6FTDBI.js} +9 -9
- package/dist/chunks/{disable-HKWCBDJC.js → disable-XRJTKNX4.js} +8 -8
- package/dist/chunks/{discard-UCCRF2JQ.js → discard-NAPSPR6Y.js} +8 -8
- package/dist/chunks/{edit-AWL35PYQ.js → edit-34GDLPQG.js} +10 -10
- package/dist/chunks/{edit-6IM6VRBR.js → edit-WLG4GLU3.js} +10 -10
- package/dist/chunks/{enable-GN3D3L3V.js → enable-IDKKVXKB.js} +8 -8
- package/dist/chunks/{exec-CNBOV577.js → exec-XH4K34JM.js} +3 -3
- package/dist/chunks/{export-HHRVFALV.js → export-MPMU3FYY.js} +8 -8
- package/dist/chunks/{image-4DCU4VPP.js → image-RZ2A4FWP.js} +6 -6
- package/dist/chunks/{import-builders-DVG3HOTF.js → import-builders-GZPE5N44.js} +9 -9
- package/dist/chunks/{inspect-B3OWUFLH.js → inspect-56S2DKPO.js} +11 -11
- package/dist/chunks/{inspect-VPME6UC7.js → inspect-EVDBNPP4.js} +11 -11
- package/dist/chunks/{inspect-TGOJDKIT.js → inspect-KGEMHV2T.js} +9 -9
- package/dist/chunks/{inspect-VLGKNHJW.js → inspect-OOV2ORKD.js} +11 -11
- package/dist/chunks/{inspect-TUW67CFZ.js → inspect-X2Y5FDKR.js} +10 -10
- package/dist/chunks/{list-K552ITMK.js → list-FWLSZYMO.js} +9 -9
- package/dist/chunks/{list-2DPKDHRV.js → list-H357CF7M.js} +10 -10
- package/dist/chunks/{list-TK2JO7BK.js → list-TWSOAQRB.js} +8 -8
- package/dist/chunks/{login-HRWEKW5P.js → login-54OPNB5E.js} +21 -12
- package/dist/chunks/{ls-JSV2WZVF.js → ls-6JHFSJBJ.js} +11 -11
- package/dist/chunks/{ls-O2WYF5UL.js → ls-DU3S2GBJ.js} +11 -11
- package/dist/chunks/{ls-IOXGXEY4.js → ls-VDFNIR5H.js} +10 -10
- package/dist/chunks/{ls-M5TYGFP5.js → ls-WFMTVJOO.js} +11 -11
- package/dist/chunks/{ls-YIF3KLF3.js → ls-WGIRTAVM.js} +11 -11
- package/dist/chunks/{ls-TM6NTZEB.js → ls-ZMR5RMU4.js} +9 -9
- package/dist/chunks/{open-FWAVEWGU.js → open-RCSCNKHF.js} +9 -9
- package/dist/chunks/{permissions-DPFYL47Z.js → permissions-XNN37R4N.js} +7 -7
- package/dist/chunks/{publish-63CGFKQR.js → publish-PLXEACYY.js} +8 -8
- package/dist/chunks/{push-T5ZTBW3P.js → push-EFYSB52Q.js} +11 -11
- package/dist/chunks/{query-B6O3EMEV.js → query-EKTXDOL7.js} +11 -11
- package/dist/chunks/{reorder-ANV4NMKH.js → reorder-OSA7D2RG.js} +8 -8
- package/dist/chunks/{reply-C73KGOCG.js → reply-6M2IYKLK.js} +10 -10
- package/dist/chunks/{resolve-IHSIVPEE.js → resolve-MCX5STKN.js} +9 -9
- package/dist/chunks/{restore-GSUNXP2O.js → restore-52OEP3NL.js} +8 -8
- package/dist/chunks/{rm-M7IJC2WZ.js → rm-2VAJFK25.js} +11 -11
- package/dist/chunks/{rm-RV5SQFQA.js → rm-4BJN2LJX.js} +11 -13
- package/dist/chunks/{rm-4O74PS4Q.js → rm-IYEDZOMN.js} +11 -11
- package/dist/chunks/{rm-PRINF4OU.js → rm-QW35WHSK.js} +11 -11
- package/dist/chunks/{rm-YDTK5ESZ.js → rm-TXV4GB4L.js} +10 -10
- package/dist/chunks/{routes-SZI2G4SE.js → routes-2OLIBRYX.js} +3 -3
- package/dist/chunks/{rule-inspect-ZZC53FLP.js → rule-inspect-WOBAN3Y2.js} +10 -10
- package/dist/chunks/{rules-SAOSSGFI.js → rules-CUJRAZYO.js} +10 -10
- package/dist/chunks/{schema-23ZFAKDU.js → schema-45SJNY5L.js} +4 -4
- package/dist/chunks/{schema-2Q3QRMRO.js → schema-VCGEJAOG.js} +9 -9
- package/dist/chunks/{set-L47ZCZBJ.js → set-2QSXMDVF.js} +9 -9
- package/dist/chunks/{tags-2TWLM77N.js → tags-NHX2VQ7E.js} +5 -5
- package/dist/chunks/{types-G3PEUIJH.js → types-JGANJ5EQ.js} +3 -3
- package/dist/chunks/{update-SZH2VBD6.js → update-EOHXTT4N.js} +12 -12
- package/dist/commands/build/builder-worker.cjs +281 -0
- package/dist/commands/build/index.js +798 -236
- package/dist/commands/deploy/index.js +103 -31
- package/dist/commands/dev/index.js +983 -176
- package/dist/commands/env/index.js +1167 -542
- package/dist/commands/link/index.js +10 -10
- package/dist/commands/list/index.js +10 -10
- package/dist/commands-bulk.js +2002 -962
- package/dist/index.js +16 -16
- package/dist/version.mjs +1 -1
- package/package.json +48 -48
- package/dist/chunks/chunk-HGRWPPYB.js +0 -18
|
@@ -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-2EH6SZRG.js";
|
|
13
13
|
import {
|
|
14
14
|
getGlobalPathConfig,
|
|
15
15
|
highlight
|
|
@@ -26,19 +26,19 @@ import {
|
|
|
26
26
|
require_get_files,
|
|
27
27
|
require_mime_types,
|
|
28
28
|
require_service_schedules
|
|
29
|
-
} from "../../chunks/chunk-
|
|
29
|
+
} from "../../chunks/chunk-AFKB6VMO.js";
|
|
30
30
|
import {
|
|
31
31
|
importBuilders,
|
|
32
32
|
require_npa
|
|
33
|
-
} from "../../chunks/chunk-
|
|
33
|
+
} from "../../chunks/chunk-MHCGKUI7.js";
|
|
34
34
|
import "../../chunks/chunk-IB5L4LKZ.js";
|
|
35
35
|
import {
|
|
36
36
|
pickOverrides
|
|
37
|
-
} from "../../chunks/chunk-
|
|
38
|
-
import "../../chunks/chunk-
|
|
37
|
+
} from "../../chunks/chunk-3PA7LXYM.js";
|
|
38
|
+
import "../../chunks/chunk-5XECIWME.js";
|
|
39
39
|
import {
|
|
40
40
|
help
|
|
41
|
-
} from "../../chunks/chunk-
|
|
41
|
+
} from "../../chunks/chunk-2YRAWYGE.js";
|
|
42
42
|
import {
|
|
43
43
|
VERCEL_DIR,
|
|
44
44
|
VERCEL_OIDC_TOKEN,
|
|
@@ -69,21 +69,21 @@ import {
|
|
|
69
69
|
setupAndLink,
|
|
70
70
|
tryDetectServices,
|
|
71
71
|
validateConfig
|
|
72
|
-
} from "../../chunks/chunk-
|
|
73
|
-
import "../../chunks/chunk-
|
|
72
|
+
} from "../../chunks/chunk-BQG777JE.js";
|
|
73
|
+
import "../../chunks/chunk-FXD67VN5.js";
|
|
74
74
|
import {
|
|
75
75
|
TelemetryClient
|
|
76
|
-
} from "../../chunks/chunk-
|
|
76
|
+
} from "../../chunks/chunk-XNFHNTS2.js";
|
|
77
77
|
import {
|
|
78
78
|
buildCommandWithYes,
|
|
79
79
|
outputActionRequired
|
|
80
|
-
} from "../../chunks/chunk-
|
|
80
|
+
} from "../../chunks/chunk-NGGLYKNU.js";
|
|
81
81
|
import {
|
|
82
82
|
require_ms
|
|
83
83
|
} from "../../chunks/chunk-GGP5R3FU.js";
|
|
84
84
|
import {
|
|
85
85
|
printError
|
|
86
|
-
} from "../../chunks/chunk-
|
|
86
|
+
} from "../../chunks/chunk-AYLY3ZVL.js";
|
|
87
87
|
import {
|
|
88
88
|
parseArguments
|
|
89
89
|
} from "../../chunks/chunk-57RHXXXG.js";
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
MissingDotenvVarsError,
|
|
95
95
|
NowError,
|
|
96
96
|
require_bytes
|
|
97
|
-
} from "../../chunks/chunk-
|
|
97
|
+
} from "../../chunks/chunk-BMKU5KEL.js";
|
|
98
98
|
import {
|
|
99
99
|
cmd,
|
|
100
100
|
getCommandName,
|
|
@@ -114,7 +114,7 @@ import {
|
|
|
114
114
|
link_default,
|
|
115
115
|
output_manager_default,
|
|
116
116
|
require_dist
|
|
117
|
-
} from "../../chunks/chunk-
|
|
117
|
+
} from "../../chunks/chunk-QFAS4OVW.js";
|
|
118
118
|
import {
|
|
119
119
|
require_source,
|
|
120
120
|
require_supports_color
|
|
@@ -4495,11 +4495,11 @@ var require_raw_body = __commonJS({
|
|
|
4495
4495
|
if (done) {
|
|
4496
4496
|
return readStream(stream, encoding, length, limit, done);
|
|
4497
4497
|
}
|
|
4498
|
-
return new Promise(function executor(
|
|
4498
|
+
return new Promise(function executor(resolve3, reject) {
|
|
4499
4499
|
readStream(stream, encoding, length, limit, function onRead(err, buf) {
|
|
4500
4500
|
if (err)
|
|
4501
4501
|
return reject(err);
|
|
4502
|
-
|
|
4502
|
+
resolve3(buf);
|
|
4503
4503
|
});
|
|
4504
4504
|
});
|
|
4505
4505
|
}
|
|
@@ -5133,32 +5133,32 @@ var require_ms2 = __commonJS({
|
|
|
5133
5133
|
return void 0;
|
|
5134
5134
|
}
|
|
5135
5135
|
}
|
|
5136
|
-
function fmtShort(
|
|
5137
|
-
if (
|
|
5138
|
-
return Math.round(
|
|
5136
|
+
function fmtShort(ms8) {
|
|
5137
|
+
if (ms8 >= d) {
|
|
5138
|
+
return Math.round(ms8 / d) + "d";
|
|
5139
5139
|
}
|
|
5140
|
-
if (
|
|
5141
|
-
return Math.round(
|
|
5140
|
+
if (ms8 >= h) {
|
|
5141
|
+
return Math.round(ms8 / h) + "h";
|
|
5142
5142
|
}
|
|
5143
|
-
if (
|
|
5144
|
-
return Math.round(
|
|
5143
|
+
if (ms8 >= m) {
|
|
5144
|
+
return Math.round(ms8 / m) + "m";
|
|
5145
5145
|
}
|
|
5146
|
-
if (
|
|
5147
|
-
return Math.round(
|
|
5146
|
+
if (ms8 >= s) {
|
|
5147
|
+
return Math.round(ms8 / s) + "s";
|
|
5148
5148
|
}
|
|
5149
|
-
return
|
|
5149
|
+
return ms8 + "ms";
|
|
5150
5150
|
}
|
|
5151
|
-
function fmtLong(
|
|
5152
|
-
return plural3(
|
|
5151
|
+
function fmtLong(ms8) {
|
|
5152
|
+
return plural3(ms8, d, "day") || plural3(ms8, h, "hour") || plural3(ms8, m, "minute") || plural3(ms8, s, "second") || ms8 + " ms";
|
|
5153
5153
|
}
|
|
5154
|
-
function plural3(
|
|
5155
|
-
if (
|
|
5154
|
+
function plural3(ms8, n, name) {
|
|
5155
|
+
if (ms8 < n) {
|
|
5156
5156
|
return;
|
|
5157
5157
|
}
|
|
5158
|
-
if (
|
|
5159
|
-
return Math.floor(
|
|
5158
|
+
if (ms8 < n * 1.5) {
|
|
5159
|
+
return Math.floor(ms8 / n) + " " + name;
|
|
5160
5160
|
}
|
|
5161
|
-
return Math.ceil(
|
|
5161
|
+
return Math.ceil(ms8 / n) + " " + name + "s";
|
|
5162
5162
|
}
|
|
5163
5163
|
}
|
|
5164
5164
|
});
|
|
@@ -5191,8 +5191,8 @@ var require_debug = __commonJS({
|
|
|
5191
5191
|
return;
|
|
5192
5192
|
var self = debug;
|
|
5193
5193
|
var curr = +/* @__PURE__ */ new Date();
|
|
5194
|
-
var
|
|
5195
|
-
self.diff =
|
|
5194
|
+
var ms8 = curr - (prevTime || curr);
|
|
5195
|
+
self.diff = ms8;
|
|
5196
5196
|
self.prev = prevTime;
|
|
5197
5197
|
self.curr = curr;
|
|
5198
5198
|
prevTime = curr;
|
|
@@ -5661,7 +5661,7 @@ var require_debug2 = __commonJS({
|
|
|
5661
5661
|
var require_follow_redirects = __commonJS({
|
|
5662
5662
|
"../../node_modules/.pnpm/follow-redirects@1.16.0_debug@3.1.0/node_modules/follow-redirects/index.js"(exports2, module2) {
|
|
5663
5663
|
var url4 = __require("url");
|
|
5664
|
-
var
|
|
5664
|
+
var URL3 = url4.URL;
|
|
5665
5665
|
var http2 = __require("http");
|
|
5666
5666
|
var https = __require("https");
|
|
5667
5667
|
var Writable2 = __require("stream").Writable;
|
|
@@ -5677,7 +5677,7 @@ var require_follow_redirects = __commonJS({
|
|
|
5677
5677
|
})();
|
|
5678
5678
|
var useNativeURL = false;
|
|
5679
5679
|
try {
|
|
5680
|
-
assert(new
|
|
5680
|
+
assert(new URL3(""));
|
|
5681
5681
|
} catch (error2) {
|
|
5682
5682
|
useNativeURL = error2.code === "ERR_INVALID_URL";
|
|
5683
5683
|
}
|
|
@@ -5988,7 +5988,7 @@ var require_follow_redirects = __commonJS({
|
|
|
5988
5988
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
5989
5989
|
}
|
|
5990
5990
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
5991
|
-
var currentUrlParts =
|
|
5991
|
+
var currentUrlParts = parseUrl2(this._currentUrl);
|
|
5992
5992
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
5993
5993
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url4.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
5994
5994
|
var redirectUrl = resolveUrl(location, currentUrl);
|
|
@@ -6027,7 +6027,7 @@ var require_follow_redirects = __commonJS({
|
|
|
6027
6027
|
if (isURL2(input)) {
|
|
6028
6028
|
input = spreadUrlObject(input);
|
|
6029
6029
|
} else if (isString(input)) {
|
|
6030
|
-
input = spreadUrlObject(
|
|
6030
|
+
input = spreadUrlObject(parseUrl2(input));
|
|
6031
6031
|
} else {
|
|
6032
6032
|
callback = options;
|
|
6033
6033
|
options = validateUrl(input);
|
|
@@ -6063,10 +6063,10 @@ var require_follow_redirects = __commonJS({
|
|
|
6063
6063
|
}
|
|
6064
6064
|
function noop() {
|
|
6065
6065
|
}
|
|
6066
|
-
function
|
|
6066
|
+
function parseUrl2(input) {
|
|
6067
6067
|
var parsed;
|
|
6068
6068
|
if (useNativeURL) {
|
|
6069
|
-
parsed = new
|
|
6069
|
+
parsed = new URL3(input);
|
|
6070
6070
|
} else {
|
|
6071
6071
|
parsed = validateUrl(url4.parse(input));
|
|
6072
6072
|
if (!isString(parsed.protocol)) {
|
|
@@ -6075,8 +6075,8 @@ var require_follow_redirects = __commonJS({
|
|
|
6075
6075
|
}
|
|
6076
6076
|
return parsed;
|
|
6077
6077
|
}
|
|
6078
|
-
function resolveUrl(
|
|
6079
|
-
return useNativeURL ? new
|
|
6078
|
+
function resolveUrl(relative4, base) {
|
|
6079
|
+
return useNativeURL ? new URL3(relative4, base) : parseUrl2(url4.resolve(base, relative4));
|
|
6080
6080
|
}
|
|
6081
6081
|
function validateUrl(input) {
|
|
6082
6082
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -6158,7 +6158,7 @@ var require_follow_redirects = __commonJS({
|
|
|
6158
6158
|
return typeof value === "object" && "length" in value;
|
|
6159
6159
|
}
|
|
6160
6160
|
function isURL2(value) {
|
|
6161
|
-
return
|
|
6161
|
+
return URL3 && value instanceof URL3;
|
|
6162
6162
|
}
|
|
6163
6163
|
function escapeRegex(regex) {
|
|
6164
6164
|
return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
|
|
@@ -6660,8 +6660,8 @@ var require_urlparser = __commonJS({
|
|
|
6660
6660
|
this.query = Url.queryString.parse(search);
|
|
6661
6661
|
}
|
|
6662
6662
|
};
|
|
6663
|
-
Url.prototype.resolve = function Url$resolve(
|
|
6664
|
-
return this.resolveObject(Url.parse(
|
|
6663
|
+
Url.prototype.resolve = function Url$resolve(relative4) {
|
|
6664
|
+
return this.resolveObject(Url.parse(relative4, false, true)).format();
|
|
6665
6665
|
};
|
|
6666
6666
|
Url.prototype.format = function Url$format() {
|
|
6667
6667
|
var auth = this.auth || "";
|
|
@@ -6712,61 +6712,61 @@ var require_urlparser = __commonJS({
|
|
|
6712
6712
|
search = escapeSearch(search);
|
|
6713
6713
|
return scheme + (host === false ? "" : host) + pathname + search + hash;
|
|
6714
6714
|
};
|
|
6715
|
-
Url.prototype.resolveObject = function Url$resolveObject(
|
|
6716
|
-
if (typeof
|
|
6717
|
-
|
|
6715
|
+
Url.prototype.resolveObject = function Url$resolveObject(relative4) {
|
|
6716
|
+
if (typeof relative4 === "string")
|
|
6717
|
+
relative4 = Url.parse(relative4, false, true);
|
|
6718
6718
|
var result = this._clone();
|
|
6719
|
-
result.hash =
|
|
6720
|
-
if (!
|
|
6719
|
+
result.hash = relative4.hash;
|
|
6720
|
+
if (!relative4.href) {
|
|
6721
6721
|
result._href = "";
|
|
6722
6722
|
return result;
|
|
6723
6723
|
}
|
|
6724
|
-
if (
|
|
6725
|
-
|
|
6724
|
+
if (relative4.slashes && !relative4._protocol) {
|
|
6725
|
+
relative4._copyPropsTo(result, true);
|
|
6726
6726
|
if (slashProtocols[result._protocol] && result.hostname && !result.pathname) {
|
|
6727
6727
|
result.pathname = "/";
|
|
6728
6728
|
}
|
|
6729
6729
|
result._href = "";
|
|
6730
6730
|
return result;
|
|
6731
6731
|
}
|
|
6732
|
-
if (
|
|
6733
|
-
if (!slashProtocols[
|
|
6734
|
-
|
|
6732
|
+
if (relative4._protocol && relative4._protocol !== result._protocol) {
|
|
6733
|
+
if (!slashProtocols[relative4._protocol]) {
|
|
6734
|
+
relative4._copyPropsTo(result, false);
|
|
6735
6735
|
result._href = "";
|
|
6736
6736
|
return result;
|
|
6737
6737
|
}
|
|
6738
|
-
result._protocol =
|
|
6739
|
-
if (!
|
|
6740
|
-
var relPath = (
|
|
6741
|
-
while (relPath.length && !(
|
|
6738
|
+
result._protocol = relative4._protocol;
|
|
6739
|
+
if (!relative4.host && relative4._protocol !== "javascript") {
|
|
6740
|
+
var relPath = (relative4.pathname || "").split("/");
|
|
6741
|
+
while (relPath.length && !(relative4.host = relPath.shift()))
|
|
6742
6742
|
;
|
|
6743
|
-
if (!
|
|
6744
|
-
|
|
6745
|
-
if (!
|
|
6746
|
-
|
|
6743
|
+
if (!relative4.host)
|
|
6744
|
+
relative4.host = "";
|
|
6745
|
+
if (!relative4.hostname)
|
|
6746
|
+
relative4.hostname = "";
|
|
6747
6747
|
if (relPath[0] !== "")
|
|
6748
6748
|
relPath.unshift("");
|
|
6749
6749
|
if (relPath.length < 2)
|
|
6750
6750
|
relPath.unshift("");
|
|
6751
6751
|
result.pathname = relPath.join("/");
|
|
6752
6752
|
} else {
|
|
6753
|
-
result.pathname =
|
|
6754
|
-
}
|
|
6755
|
-
result.search =
|
|
6756
|
-
result.host =
|
|
6757
|
-
result.auth =
|
|
6758
|
-
result.hostname =
|
|
6759
|
-
result._port =
|
|
6760
|
-
result.slashes = result.slashes ||
|
|
6753
|
+
result.pathname = relative4.pathname;
|
|
6754
|
+
}
|
|
6755
|
+
result.search = relative4.search;
|
|
6756
|
+
result.host = relative4.host || "";
|
|
6757
|
+
result.auth = relative4.auth;
|
|
6758
|
+
result.hostname = relative4.hostname || relative4.host;
|
|
6759
|
+
result._port = relative4._port;
|
|
6760
|
+
result.slashes = result.slashes || relative4.slashes;
|
|
6761
6761
|
result._href = "";
|
|
6762
6762
|
return result;
|
|
6763
6763
|
}
|
|
6764
6764
|
var isSourceAbs = result.pathname && result.pathname.charCodeAt(0) === 47;
|
|
6765
|
-
var isRelAbs =
|
|
6766
|
-
var mustEndAbs = isRelAbs || isSourceAbs || result.host &&
|
|
6765
|
+
var isRelAbs = relative4.host || relative4.pathname && relative4.pathname.charCodeAt(0) === 47;
|
|
6766
|
+
var mustEndAbs = isRelAbs || isSourceAbs || result.host && relative4.pathname;
|
|
6767
6767
|
var removeAllDots = mustEndAbs;
|
|
6768
6768
|
var srcPath = result.pathname && result.pathname.split("/") || [];
|
|
6769
|
-
var relPath =
|
|
6769
|
+
var relPath = relative4.pathname && relative4.pathname.split("/") || [];
|
|
6770
6770
|
var psychotic = result._protocol && !slashProtocols[result._protocol];
|
|
6771
6771
|
if (psychotic) {
|
|
6772
6772
|
result.hostname = "";
|
|
@@ -6778,31 +6778,31 @@ var require_urlparser = __commonJS({
|
|
|
6778
6778
|
srcPath.unshift(result.host);
|
|
6779
6779
|
}
|
|
6780
6780
|
result.host = "";
|
|
6781
|
-
if (
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
if (
|
|
6781
|
+
if (relative4._protocol) {
|
|
6782
|
+
relative4.hostname = "";
|
|
6783
|
+
relative4._port = -1;
|
|
6784
|
+
if (relative4.host) {
|
|
6785
6785
|
if (relPath[0] === "")
|
|
6786
|
-
relPath[0] =
|
|
6786
|
+
relPath[0] = relative4.host;
|
|
6787
6787
|
else
|
|
6788
|
-
relPath.unshift(
|
|
6788
|
+
relPath.unshift(relative4.host);
|
|
6789
6789
|
}
|
|
6790
|
-
|
|
6790
|
+
relative4.host = "";
|
|
6791
6791
|
}
|
|
6792
6792
|
mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "");
|
|
6793
6793
|
}
|
|
6794
6794
|
if (isRelAbs) {
|
|
6795
|
-
result.host =
|
|
6796
|
-
result.hostname =
|
|
6797
|
-
result.search =
|
|
6795
|
+
result.host = relative4.host ? relative4.host : result.host;
|
|
6796
|
+
result.hostname = relative4.hostname ? relative4.hostname : result.hostname;
|
|
6797
|
+
result.search = relative4.search;
|
|
6798
6798
|
srcPath = relPath;
|
|
6799
6799
|
} else if (relPath.length) {
|
|
6800
6800
|
if (!srcPath)
|
|
6801
6801
|
srcPath = [];
|
|
6802
6802
|
srcPath.pop();
|
|
6803
6803
|
srcPath = srcPath.concat(relPath);
|
|
6804
|
-
result.search =
|
|
6805
|
-
} else if (
|
|
6804
|
+
result.search = relative4.search;
|
|
6805
|
+
} else if (relative4.search) {
|
|
6806
6806
|
if (psychotic) {
|
|
6807
6807
|
result.hostname = result.host = srcPath.shift();
|
|
6808
6808
|
var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
|
|
@@ -6811,7 +6811,7 @@ var require_urlparser = __commonJS({
|
|
|
6811
6811
|
result.host = result.hostname = authInHost.shift();
|
|
6812
6812
|
}
|
|
6813
6813
|
}
|
|
6814
|
-
result.search =
|
|
6814
|
+
result.search = relative4.search;
|
|
6815
6815
|
result._href = "";
|
|
6816
6816
|
return result;
|
|
6817
6817
|
}
|
|
@@ -6821,7 +6821,7 @@ var require_urlparser = __commonJS({
|
|
|
6821
6821
|
return result;
|
|
6822
6822
|
}
|
|
6823
6823
|
var last = srcPath.slice(-1)[0];
|
|
6824
|
-
var hasTrailingSlash = (result.host ||
|
|
6824
|
+
var hasTrailingSlash = (result.host || relative4.host) && (last === "." || last === "..") || last === "";
|
|
6825
6825
|
var up = 0;
|
|
6826
6826
|
for (var i2 = srcPath.length; i2 >= 0; i2--) {
|
|
6827
6827
|
last = srcPath[i2];
|
|
@@ -6846,9 +6846,9 @@ var require_urlparser = __commonJS({
|
|
|
6846
6846
|
if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") {
|
|
6847
6847
|
srcPath.push("");
|
|
6848
6848
|
}
|
|
6849
|
-
var
|
|
6849
|
+
var isAbsolute4 = srcPath[0] === "" || srcPath[0] && srcPath[0].charCodeAt(0) === 47;
|
|
6850
6850
|
if (psychotic) {
|
|
6851
|
-
result.hostname = result.host =
|
|
6851
|
+
result.hostname = result.host = isAbsolute4 ? "" : srcPath.length ? srcPath.shift() : "";
|
|
6852
6852
|
var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
|
|
6853
6853
|
if (authInHost) {
|
|
6854
6854
|
result.auth = authInHost.shift();
|
|
@@ -6856,12 +6856,12 @@ var require_urlparser = __commonJS({
|
|
|
6856
6856
|
}
|
|
6857
6857
|
}
|
|
6858
6858
|
mustEndAbs = mustEndAbs || result.host && srcPath.length;
|
|
6859
|
-
if (mustEndAbs && !
|
|
6859
|
+
if (mustEndAbs && !isAbsolute4) {
|
|
6860
6860
|
srcPath.unshift("");
|
|
6861
6861
|
}
|
|
6862
6862
|
result.pathname = srcPath.length === 0 ? null : srcPath.join("/");
|
|
6863
|
-
result.auth =
|
|
6864
|
-
result.slashes = result.slashes ||
|
|
6863
|
+
result.auth = relative4.auth || result.auth;
|
|
6864
|
+
result.slashes = result.slashes || relative4.slashes;
|
|
6865
6865
|
result._href = "";
|
|
6866
6866
|
return result;
|
|
6867
6867
|
};
|
|
@@ -7254,13 +7254,13 @@ var require_urlparser = __commonJS({
|
|
|
7254
7254
|
}
|
|
7255
7255
|
return obj.format();
|
|
7256
7256
|
};
|
|
7257
|
-
Url.resolve = function Url$Resolve(source,
|
|
7258
|
-
return Url.parse(source, false, true).resolve(
|
|
7257
|
+
Url.resolve = function Url$Resolve(source, relative4) {
|
|
7258
|
+
return Url.parse(source, false, true).resolve(relative4);
|
|
7259
7259
|
};
|
|
7260
|
-
Url.resolveObject = function Url$ResolveObject(source,
|
|
7260
|
+
Url.resolveObject = function Url$ResolveObject(source, relative4) {
|
|
7261
7261
|
if (!source)
|
|
7262
|
-
return
|
|
7263
|
-
return Url.parse(source, false, true).resolveObject(
|
|
7262
|
+
return relative4;
|
|
7263
|
+
return Url.parse(source, false, true).resolveObject(relative4);
|
|
7264
7264
|
};
|
|
7265
7265
|
function _escapePath(pathname) {
|
|
7266
7266
|
return pathname.replace(/[?#]/g, function(match) {
|
|
@@ -15348,7 +15348,7 @@ var require_mime_types2 = __commonJS({
|
|
|
15348
15348
|
"../../node_modules/.pnpm/mime-types@2.1.18/node_modules/mime-types/index.js"(exports2) {
|
|
15349
15349
|
"use strict";
|
|
15350
15350
|
var db = require_mime_db();
|
|
15351
|
-
var
|
|
15351
|
+
var extname3 = __require("path").extname;
|
|
15352
15352
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
15353
15353
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
15354
15354
|
exports2.charset = charset;
|
|
@@ -15403,7 +15403,7 @@ var require_mime_types2 = __commonJS({
|
|
|
15403
15403
|
if (!path6 || typeof path6 !== "string") {
|
|
15404
15404
|
return false;
|
|
15405
15405
|
}
|
|
15406
|
-
var extension2 =
|
|
15406
|
+
var extension2 = extname3("x." + path6).toLowerCase().substr(1);
|
|
15407
15407
|
if (!extension2) {
|
|
15408
15408
|
return false;
|
|
15409
15409
|
}
|
|
@@ -15790,7 +15790,7 @@ var require_src2 = __commonJS({
|
|
|
15790
15790
|
var { promisify } = __require("util");
|
|
15791
15791
|
var path6 = __require("path");
|
|
15792
15792
|
var { createHash } = __require("crypto");
|
|
15793
|
-
var { realpath, lstat, createReadStream, readdir } = __require("fs");
|
|
15793
|
+
var { realpath, lstat: lstat2, createReadStream, readdir: readdir2 } = __require("fs");
|
|
15794
15794
|
var url4 = require_urlparser();
|
|
15795
15795
|
var slasher = require_glob_slash();
|
|
15796
15796
|
var minimatch3 = require_minimatch2();
|
|
@@ -15803,7 +15803,7 @@ var require_src2 = __commonJS({
|
|
|
15803
15803
|
var directoryTemplate2 = require_directory();
|
|
15804
15804
|
var errorTemplate = require_error();
|
|
15805
15805
|
var etags = /* @__PURE__ */ new Map();
|
|
15806
|
-
var calculateSha = (handlers, absolutePath) => new Promise((
|
|
15806
|
+
var calculateSha = (handlers, absolutePath) => new Promise((resolve3, reject) => {
|
|
15807
15807
|
const hash = createHash("sha1");
|
|
15808
15808
|
hash.update(path6.extname(absolutePath));
|
|
15809
15809
|
hash.update("-");
|
|
@@ -15812,7 +15812,7 @@ var require_src2 = __commonJS({
|
|
|
15812
15812
|
rs.on("data", (buf) => hash.update(buf));
|
|
15813
15813
|
rs.on("end", () => {
|
|
15814
15814
|
const sha = hash.digest("hex");
|
|
15815
|
-
|
|
15815
|
+
resolve3(sha);
|
|
15816
15816
|
});
|
|
15817
15817
|
});
|
|
15818
15818
|
var sourceMatches = (source, requestPath, allowSegments) => {
|
|
@@ -16096,12 +16096,12 @@ var require_src2 = __commonJS({
|
|
|
16096
16096
|
}).filter(Boolean);
|
|
16097
16097
|
if (toRoot.length > 0) {
|
|
16098
16098
|
const directoryPath = [...pathParts].slice(1);
|
|
16099
|
-
const
|
|
16099
|
+
const relative4 = path6.join("/", ...directoryPath, "..", slashSuffix);
|
|
16100
16100
|
files.unshift({
|
|
16101
16101
|
type: "directory",
|
|
16102
16102
|
base: "..",
|
|
16103
|
-
relative:
|
|
16104
|
-
title:
|
|
16103
|
+
relative: relative4,
|
|
16104
|
+
title: relative4,
|
|
16105
16105
|
ext: ""
|
|
16106
16106
|
});
|
|
16107
16107
|
}
|
|
@@ -16182,10 +16182,10 @@ var require_src2 = __commonJS({
|
|
|
16182
16182
|
return sendError(...args2);
|
|
16183
16183
|
};
|
|
16184
16184
|
var getHandlers = (methods) => Object.assign({
|
|
16185
|
-
lstat: promisify(
|
|
16185
|
+
lstat: promisify(lstat2),
|
|
16186
16186
|
realpath: promisify(realpath),
|
|
16187
16187
|
createReadStream,
|
|
16188
|
-
readdir: promisify(
|
|
16188
|
+
readdir: promisify(readdir2),
|
|
16189
16189
|
sendError
|
|
16190
16190
|
}, methods);
|
|
16191
16191
|
module2.exports = async (request, response, config = {}, methods = {}) => {
|
|
@@ -16450,7 +16450,7 @@ var require_dist7 = __commonJS({
|
|
|
16450
16450
|
(function(once3) {
|
|
16451
16451
|
function spread(emitter, name) {
|
|
16452
16452
|
let c = null;
|
|
16453
|
-
const p = new Promise((
|
|
16453
|
+
const p = new Promise((resolve3, reject) => {
|
|
16454
16454
|
function cancel() {
|
|
16455
16455
|
emitter.removeListener(name, onEvent);
|
|
16456
16456
|
emitter.removeListener("error", onError);
|
|
@@ -16458,7 +16458,7 @@ var require_dist7 = __commonJS({
|
|
|
16458
16458
|
}
|
|
16459
16459
|
function onEvent(...args2) {
|
|
16460
16460
|
cancel();
|
|
16461
|
-
|
|
16461
|
+
resolve3(args2);
|
|
16462
16462
|
}
|
|
16463
16463
|
function onError(err) {
|
|
16464
16464
|
cancel();
|
|
@@ -16496,14 +16496,14 @@ var require_get_port = __commonJS({
|
|
|
16496
16496
|
};
|
|
16497
16497
|
var releaseOldLockedPortsIntervalMs = 1e3 * 15;
|
|
16498
16498
|
var interval;
|
|
16499
|
-
var getAvailablePort = (options) => new Promise((
|
|
16499
|
+
var getAvailablePort = (options) => new Promise((resolve3, reject) => {
|
|
16500
16500
|
const server = net.createServer();
|
|
16501
16501
|
server.unref();
|
|
16502
16502
|
server.on("error", reject);
|
|
16503
16503
|
server.listen(options, () => {
|
|
16504
16504
|
const { port } = server.address();
|
|
16505
16505
|
server.close(() => {
|
|
16506
|
-
|
|
16506
|
+
resolve3(port);
|
|
16507
16507
|
});
|
|
16508
16508
|
});
|
|
16509
16509
|
});
|
|
@@ -16575,7 +16575,7 @@ var require_is_port_reachable = __commonJS({
|
|
|
16575
16575
|
"use strict";
|
|
16576
16576
|
var net = __require("net");
|
|
16577
16577
|
module2.exports = async (port, { timeout = 1e3, host } = {}) => {
|
|
16578
|
-
const promise = new Promise((
|
|
16578
|
+
const promise = new Promise((resolve3, reject) => {
|
|
16579
16579
|
const socket = new net.Socket();
|
|
16580
16580
|
const onError = () => {
|
|
16581
16581
|
socket.destroy();
|
|
@@ -16586,7 +16586,7 @@ var require_is_port_reachable = __commonJS({
|
|
|
16586
16586
|
socket.once("timeout", onError);
|
|
16587
16587
|
socket.connect(port, host, () => {
|
|
16588
16588
|
socket.end();
|
|
16589
|
-
|
|
16589
|
+
resolve3();
|
|
16590
16590
|
});
|
|
16591
16591
|
});
|
|
16592
16592
|
try {
|
|
@@ -16758,17 +16758,17 @@ import path5 from "path";
|
|
|
16758
16758
|
|
|
16759
16759
|
// src/commands/dev/dev.ts
|
|
16760
16760
|
var import_chalk3 = __toESM(require_source(), 1);
|
|
16761
|
-
var
|
|
16761
|
+
var import_ms7 = __toESM(require_ms(), 1);
|
|
16762
16762
|
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
16763
16763
|
var import_fs_detectors3 = __toESM(require_dist3(), 1);
|
|
16764
16764
|
var import_frameworks3 = __toESM(require_frameworks(), 1);
|
|
16765
|
-
import { resolve, join as
|
|
16765
|
+
import { resolve as resolve2, join as join6 } from "path";
|
|
16766
16766
|
|
|
16767
16767
|
// src/util/dev/server.ts
|
|
16768
16768
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
16769
|
-
var
|
|
16769
|
+
var import_ms5 = __toESM(require_ms(), 1);
|
|
16770
16770
|
var import_chalk2 = __toESM(require_source(), 1);
|
|
16771
|
-
import url3, { URL } from "url";
|
|
16771
|
+
import url3, { URL as URL2 } from "url";
|
|
16772
16772
|
import http from "http";
|
|
16773
16773
|
var import_pluralize2 = __toESM(require_pluralize(), 1);
|
|
16774
16774
|
var import_raw_body = __toESM(require_raw_body(), 1);
|
|
@@ -16784,12 +16784,12 @@ var import_get_port2 = __toESM(require_get_port(), 1);
|
|
|
16784
16784
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
16785
16785
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
16786
16786
|
import { watch } from "chokidar";
|
|
16787
|
-
import path4, { isAbsolute as
|
|
16787
|
+
import path4, { isAbsolute as isAbsolute3, basename, dirname as dirname3, extname as extname2, join as join4, sep as sep2 } from "path";
|
|
16788
16788
|
|
|
16789
16789
|
// src/util/dev/port-utils.ts
|
|
16790
16790
|
var import_is_port_reachable = __toESM(require_is_port_reachable(), 1);
|
|
16791
|
-
function sleep(
|
|
16792
|
-
return new Promise((
|
|
16791
|
+
function sleep(ms8) {
|
|
16792
|
+
return new Promise((resolve3) => setTimeout(resolve3, ms8));
|
|
16793
16793
|
}
|
|
16794
16794
|
async function getReachableHostOnPort(port) {
|
|
16795
16795
|
const optsIpv4 = { host: "127.0.0.1" };
|
|
@@ -17479,12 +17479,12 @@ import {
|
|
|
17479
17479
|
// src/util/tree-kill.ts
|
|
17480
17480
|
var import_tree_kill = __toESM(require_tree_kill(), 1);
|
|
17481
17481
|
function treeKill(pid, signal = "SIGTERM") {
|
|
17482
|
-
return new Promise((
|
|
17482
|
+
return new Promise((resolve3, reject) => {
|
|
17483
17483
|
(0, import_tree_kill.default)(pid, signal, (err) => {
|
|
17484
17484
|
if (err)
|
|
17485
17485
|
reject(err);
|
|
17486
17486
|
else
|
|
17487
|
-
|
|
17487
|
+
resolve3();
|
|
17488
17488
|
});
|
|
17489
17489
|
});
|
|
17490
17490
|
}
|
|
@@ -17550,12 +17550,12 @@ async function createBuildProcess(match, envConfigs, workPath) {
|
|
|
17550
17550
|
);
|
|
17551
17551
|
match.buildProcess = void 0;
|
|
17552
17552
|
});
|
|
17553
|
-
return new Promise((
|
|
17553
|
+
return new Promise((resolve3, reject) => {
|
|
17554
17554
|
buildProcess.once("message", (data) => {
|
|
17555
17555
|
if (data !== null && typeof data === "object" && data.type !== "ready") {
|
|
17556
17556
|
reject(new Error('Did not get "ready" event from builder'));
|
|
17557
17557
|
} else {
|
|
17558
|
-
|
|
17558
|
+
resolve3(buildProcess);
|
|
17559
17559
|
}
|
|
17560
17560
|
});
|
|
17561
17561
|
});
|
|
@@ -17615,12 +17615,12 @@ async function executeBuild(vercelConfig, devServer, files, match, requestPath,
|
|
|
17615
17615
|
requirePath,
|
|
17616
17616
|
buildOptions
|
|
17617
17617
|
});
|
|
17618
|
-
buildResultOrOutputs = await new Promise((
|
|
17618
|
+
buildResultOrOutputs = await new Promise((resolve3, reject) => {
|
|
17619
17619
|
function onMessage({ type, result: result2, error: error2 }) {
|
|
17620
17620
|
cleanup();
|
|
17621
17621
|
if (type === "buildResult") {
|
|
17622
17622
|
if (result2) {
|
|
17623
|
-
|
|
17623
|
+
resolve3(result2);
|
|
17624
17624
|
} else if (error2) {
|
|
17625
17625
|
reject(Object.assign(new Error(), error2));
|
|
17626
17626
|
}
|
|
@@ -17849,6 +17849,13 @@ async function getBuildMatches(vercelConfig, cwd, devServer, fileList) {
|
|
|
17849
17849
|
mapToEntrypoint.set(src, originalSrc);
|
|
17850
17850
|
}
|
|
17851
17851
|
}
|
|
17852
|
+
if (buildConfig.config?.framework === "rust" && src === "src/main.rs" && !fileList.includes(src)) {
|
|
17853
|
+
const originalSrc = src;
|
|
17854
|
+
if (fileList.includes("Cargo.toml")) {
|
|
17855
|
+
src = "Cargo.toml";
|
|
17856
|
+
mapToEntrypoint.set(src, originalSrc);
|
|
17857
|
+
}
|
|
17858
|
+
}
|
|
17852
17859
|
if (buildConfig.config?.framework === "container" && !fileList.includes(src)) {
|
|
17853
17860
|
const originalSrc = src;
|
|
17854
17861
|
const dockerfileCandidates = [
|
|
@@ -18053,7 +18060,7 @@ function redirect(it) {
|
|
|
18053
18060
|
}
|
|
18054
18061
|
|
|
18055
18062
|
// src/util/dev/services-orchestrator.ts
|
|
18056
|
-
var
|
|
18063
|
+
var import_ms3 = __toESM(require_ms(), 1);
|
|
18057
18064
|
var import_get_port = __toESM(require_get_port(), 1);
|
|
18058
18065
|
var import_chalk = __toESM(require_source(), 1);
|
|
18059
18066
|
var import_frameworks = __toESM(require_frameworks(), 1);
|
|
@@ -18311,8 +18318,100 @@ function prependNodeRequireOption(nodeOptions, requirePath) {
|
|
|
18311
18318
|
return nodeOptions ? `${requireOption} ${nodeOptions}` : requireOption;
|
|
18312
18319
|
}
|
|
18313
18320
|
|
|
18321
|
+
// src/util/dev/runtime-cache.ts
|
|
18322
|
+
var import_ms2 = __toESM(require_ms(), 1);
|
|
18323
|
+
var DEV_RUNTIME_CACHE_PREFIX = "/_svc/_cache/";
|
|
18324
|
+
var DEV_RUNTIME_CACHE_ITEM_PREFIX = `${DEV_RUNTIME_CACHE_PREFIX}v1/suspense-cache/`;
|
|
18325
|
+
var HEADER_CACHE_STATE = "x-vercel-cache-state";
|
|
18326
|
+
var HEADER_CACHE_TAGS = "x-vercel-cache-tags";
|
|
18327
|
+
var HEADER_REVALIDATE = "x-vercel-revalidate";
|
|
18328
|
+
var HEADER_CACHE_ITEM_NAME = "x-vercel-cache-item-name";
|
|
18329
|
+
var TICK_INTERVAL = (0, import_ms2.default)("1m");
|
|
18330
|
+
function getDevRuntimeCacheEnv(origin) {
|
|
18331
|
+
return {
|
|
18332
|
+
RUNTIME_CACHE_ENDPOINT: `${origin}${DEV_RUNTIME_CACHE_ITEM_PREFIX}`,
|
|
18333
|
+
RUNTIME_CACHE_HEADERS: JSON.stringify({
|
|
18334
|
+
authorization: "Bearer vc-dev-token"
|
|
18335
|
+
})
|
|
18336
|
+
};
|
|
18337
|
+
}
|
|
18338
|
+
var RuntimeCacheStore = class {
|
|
18339
|
+
constructor() {
|
|
18340
|
+
this.entries = /* @__PURE__ */ new Map();
|
|
18341
|
+
/** Tag name to the mutation counter of its last expiry. */
|
|
18342
|
+
this.tagExpirations = /* @__PURE__ */ new Map();
|
|
18343
|
+
this.sequence = 0;
|
|
18344
|
+
this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL);
|
|
18345
|
+
this.tickTimer.unref();
|
|
18346
|
+
}
|
|
18347
|
+
get(key) {
|
|
18348
|
+
const entry = this.entries.get(key);
|
|
18349
|
+
if (!entry)
|
|
18350
|
+
return null;
|
|
18351
|
+
if (this.isStale(entry)) {
|
|
18352
|
+
this.entries.delete(key);
|
|
18353
|
+
return null;
|
|
18354
|
+
}
|
|
18355
|
+
return {
|
|
18356
|
+
value: entry.value,
|
|
18357
|
+
tags: entry.tags,
|
|
18358
|
+
ageSeconds: Math.floor((Date.now() - entry.lastModified) / 1e3)
|
|
18359
|
+
};
|
|
18360
|
+
}
|
|
18361
|
+
set(key, value, options = {}) {
|
|
18362
|
+
const ttlSeconds = options.ttlSeconds;
|
|
18363
|
+
this.entries.set(key, {
|
|
18364
|
+
value,
|
|
18365
|
+
tags: options.tags ?? [],
|
|
18366
|
+
ttlMs: ttlSeconds && ttlSeconds > 0 ? ttlSeconds * 1e3 : null,
|
|
18367
|
+
lastModified: Date.now(),
|
|
18368
|
+
sequence: ++this.sequence
|
|
18369
|
+
});
|
|
18370
|
+
}
|
|
18371
|
+
delete(key) {
|
|
18372
|
+
this.entries.delete(key);
|
|
18373
|
+
}
|
|
18374
|
+
/**
|
|
18375
|
+
* Mark tags as expired. Entries written before the expiration miss on their
|
|
18376
|
+
* next read; entries written after it stay fresh, matching how tag
|
|
18377
|
+
* revalidation works in a deployment.
|
|
18378
|
+
*/
|
|
18379
|
+
expireTags(tags) {
|
|
18380
|
+
const sequence = ++this.sequence;
|
|
18381
|
+
for (const tag of tags) {
|
|
18382
|
+
this.tagExpirations.set(tag, sequence);
|
|
18383
|
+
}
|
|
18384
|
+
}
|
|
18385
|
+
size() {
|
|
18386
|
+
return this.entries.size;
|
|
18387
|
+
}
|
|
18388
|
+
stop() {
|
|
18389
|
+
clearInterval(this.tickTimer);
|
|
18390
|
+
}
|
|
18391
|
+
isStale(entry) {
|
|
18392
|
+
if (entry.ttlMs !== null && entry.lastModified + entry.ttlMs <= Date.now()) {
|
|
18393
|
+
return true;
|
|
18394
|
+
}
|
|
18395
|
+
for (const tag of entry.tags) {
|
|
18396
|
+
const expiredAt = this.tagExpirations.get(tag);
|
|
18397
|
+
if (expiredAt !== void 0 && expiredAt > entry.sequence) {
|
|
18398
|
+
return true;
|
|
18399
|
+
}
|
|
18400
|
+
}
|
|
18401
|
+
return false;
|
|
18402
|
+
}
|
|
18403
|
+
/** Drop stale entries so their values don't accumulate over a dev session. */
|
|
18404
|
+
tick() {
|
|
18405
|
+
for (const [key, entry] of this.entries) {
|
|
18406
|
+
if (this.isStale(entry)) {
|
|
18407
|
+
this.entries.delete(key);
|
|
18408
|
+
}
|
|
18409
|
+
}
|
|
18410
|
+
}
|
|
18411
|
+
};
|
|
18412
|
+
|
|
18314
18413
|
// src/util/dev/services-orchestrator.ts
|
|
18315
|
-
var STARTUP_TIMEOUT = (0,
|
|
18414
|
+
var STARTUP_TIMEOUT = (0, import_ms3.default)("5m");
|
|
18316
18415
|
var ServiceStartError = class extends Error {
|
|
18317
18416
|
constructor(failures) {
|
|
18318
18417
|
const dedupeErrorCodes = /* @__PURE__ */ new Set(["PYTHON_EXTERNAL_VENV_DETECTED"]);
|
|
@@ -18429,7 +18528,7 @@ function waitForExit(pid, proc, timeoutMs) {
|
|
|
18429
18528
|
if (!isProcessAlive(pid)) {
|
|
18430
18529
|
return Promise.resolve(true);
|
|
18431
18530
|
}
|
|
18432
|
-
return new Promise((
|
|
18531
|
+
return new Promise((resolve3) => {
|
|
18433
18532
|
let settled = false;
|
|
18434
18533
|
const finish = (died) => {
|
|
18435
18534
|
if (settled)
|
|
@@ -18439,7 +18538,7 @@ function waitForExit(pid, proc, timeoutMs) {
|
|
|
18439
18538
|
clearTimeout(deadline);
|
|
18440
18539
|
if (proc)
|
|
18441
18540
|
proc.removeListener("exit", onExit);
|
|
18442
|
-
|
|
18541
|
+
resolve3(died);
|
|
18443
18542
|
};
|
|
18444
18543
|
const onExit = () => finish(true);
|
|
18445
18544
|
if (proc)
|
|
@@ -18576,13 +18675,13 @@ var ServicesOrchestrator = class {
|
|
|
18576
18675
|
this.cronTimers = [];
|
|
18577
18676
|
let timedOut = false;
|
|
18578
18677
|
let timeoutHandle;
|
|
18579
|
-
const timeout = new Promise((
|
|
18678
|
+
const timeout = new Promise((resolve3) => {
|
|
18580
18679
|
timeoutHandle = setTimeout(() => {
|
|
18581
18680
|
timedOut = true;
|
|
18582
18681
|
output_manager_default.debug(
|
|
18583
18682
|
`stopAll timed out after ${STOP_ALL_TIMEOUT_MS}ms; remaining processes will be SIGKILLed on exit`
|
|
18584
18683
|
);
|
|
18585
|
-
|
|
18684
|
+
resolve3();
|
|
18586
18685
|
}, STOP_ALL_TIMEOUT_MS);
|
|
18587
18686
|
});
|
|
18588
18687
|
try {
|
|
@@ -18714,6 +18813,17 @@ var ServicesOrchestrator = class {
|
|
|
18714
18813
|
port
|
|
18715
18814
|
});
|
|
18716
18815
|
}
|
|
18816
|
+
/**
|
|
18817
|
+
* Every service shares the dev server's Runtime Cache store, so a value one
|
|
18818
|
+
* service writes is readable by the others, like in a deployment. A cache
|
|
18819
|
+
* endpoint the developer configured themselves takes precedence.
|
|
18820
|
+
*/
|
|
18821
|
+
applyRuntimeCacheEnv(env) {
|
|
18822
|
+
if (env.RUNTIME_CACHE_ENDPOINT) {
|
|
18823
|
+
return;
|
|
18824
|
+
}
|
|
18825
|
+
Object.assign(env, getDevRuntimeCacheEnv(this.proxyOrigin));
|
|
18826
|
+
}
|
|
18717
18827
|
getV1StartSpec(service) {
|
|
18718
18828
|
const framework = import_frameworks.frameworkList.find((f) => f.slug === service.framework);
|
|
18719
18829
|
const effectiveProcessEnv = cloneEnv(this.envFilesValues, process.env);
|
|
@@ -18755,6 +18865,7 @@ var ServicesOrchestrator = class {
|
|
|
18755
18865
|
env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
|
|
18756
18866
|
env.VERCEL_REGION = "dev1";
|
|
18757
18867
|
}
|
|
18868
|
+
this.applyRuntimeCacheEnv(env);
|
|
18758
18869
|
if (service.routePrefix && service.routePrefix !== "/") {
|
|
18759
18870
|
env.VERCEL_SERVICE_ROUTE_PREFIX = service.routePrefix;
|
|
18760
18871
|
env.VERCEL_SERVICE_ROUTE_PREFIX_STRIP = "1";
|
|
@@ -18818,6 +18929,7 @@ var ServicesOrchestrator = class {
|
|
|
18818
18929
|
env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
|
|
18819
18930
|
env.VERCEL_REGION = "dev1";
|
|
18820
18931
|
}
|
|
18932
|
+
this.applyRuntimeCacheEnv(env);
|
|
18821
18933
|
const root = service.root || ".";
|
|
18822
18934
|
return {
|
|
18823
18935
|
rootPath: path2.join(this.cwd, root),
|
|
@@ -19037,7 +19149,7 @@ var ServicesOrchestrator = class {
|
|
|
19037
19149
|
}
|
|
19038
19150
|
async runInstallCommand(command, workspacePath, logger) {
|
|
19039
19151
|
await this.runBuffered(logger, (stdout, stderr) => {
|
|
19040
|
-
return new Promise((
|
|
19152
|
+
return new Promise((resolve3, reject) => {
|
|
19041
19153
|
output_manager_default.debug(
|
|
19042
19154
|
`Running install command: "${command}" in ${workspacePath}`
|
|
19043
19155
|
);
|
|
@@ -19050,7 +19162,7 @@ var ServicesOrchestrator = class {
|
|
|
19050
19162
|
child.on("error", reject);
|
|
19051
19163
|
child.on("exit", (code, signal) => {
|
|
19052
19164
|
if (code === 0) {
|
|
19053
|
-
|
|
19165
|
+
resolve3();
|
|
19054
19166
|
} else {
|
|
19055
19167
|
reject(
|
|
19056
19168
|
new NowBuildError({
|
|
@@ -19135,18 +19247,18 @@ var ServicesOrchestrator = class {
|
|
|
19135
19247
|
};
|
|
19136
19248
|
|
|
19137
19249
|
// src/util/dev/queue-broker.ts
|
|
19138
|
-
var
|
|
19250
|
+
var import_ms4 = __toESM(require_ms(), 1);
|
|
19139
19251
|
import { randomBytes } from "crypto";
|
|
19140
19252
|
import {
|
|
19141
19253
|
getServiceQueueTopicConfigs,
|
|
19142
19254
|
isQueueBackedService as isQueueBackedService2
|
|
19143
19255
|
} from "@vercel/build-utils";
|
|
19144
|
-
var DEFAULT_RETRY_AFTER = (0,
|
|
19256
|
+
var DEFAULT_RETRY_AFTER = (0, import_ms4.default)("1m");
|
|
19145
19257
|
var DEFAULT_MAX_DELIVERIES = 32;
|
|
19146
19258
|
var DEFAULT_INITIAL_DELAY = 0;
|
|
19147
|
-
var DEFAULT_VISIBILITY_TIMEOUT = (0,
|
|
19148
|
-
var DEFAULT_RETENTION = (0,
|
|
19149
|
-
var
|
|
19259
|
+
var DEFAULT_VISIBILITY_TIMEOUT = (0, import_ms4.default)("1m");
|
|
19260
|
+
var DEFAULT_RETENTION = (0, import_ms4.default)("1h");
|
|
19261
|
+
var TICK_INTERVAL2 = (0, import_ms4.default)("1s");
|
|
19150
19262
|
function topicPatternToRegex(pattern) {
|
|
19151
19263
|
const parts = pattern.split("*").map((s) => s.replace(/-/g, "\\-"));
|
|
19152
19264
|
return new RegExp(`^${parts.join("[A-Za-z0-9_\\-]*")}$`);
|
|
@@ -19187,7 +19299,7 @@ var QueueBroker = class {
|
|
|
19187
19299
|
this.deliveryState.set(group.id, /* @__PURE__ */ new Map());
|
|
19188
19300
|
}
|
|
19189
19301
|
}
|
|
19190
|
-
this.tickTimer = setInterval(() => this.tick(),
|
|
19302
|
+
this.tickTimer = setInterval(() => this.tick(), TICK_INTERVAL2);
|
|
19191
19303
|
this.tickTimer.unref();
|
|
19192
19304
|
}
|
|
19193
19305
|
/**
|
|
@@ -19766,9 +19878,463 @@ function replaceLocalhost(address) {
|
|
|
19766
19878
|
return address.replace("[::]", "localhost").replace("0.0.0.0", "localhost");
|
|
19767
19879
|
}
|
|
19768
19880
|
|
|
19881
|
+
// src/util/dev/bulk-redirects.ts
|
|
19882
|
+
import { lstat, readdir, readFile, stat } from "fs/promises";
|
|
19883
|
+
import { extname, isAbsolute as isAbsolute2, join as join3, relative as relative3, resolve } from "path";
|
|
19884
|
+
import { parse as parseUrl } from "url";
|
|
19885
|
+
var MAX_REDIRECTS = 1e6;
|
|
19886
|
+
var MAX_FILES = 100;
|
|
19887
|
+
var MAX_URL_LENGTH = 2048;
|
|
19888
|
+
var VALID_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
19889
|
+
var SUPPORTED_EXTENSIONS = /* @__PURE__ */ new Set([".csv", ".json", ".jsonl"]);
|
|
19890
|
+
var BulkRedirectTable = class {
|
|
19891
|
+
constructor() {
|
|
19892
|
+
this.caseSensitiveByHostPath = /* @__PURE__ */ new Map();
|
|
19893
|
+
this.caseInsensitiveByHostPath = /* @__PURE__ */ new Map();
|
|
19894
|
+
this.caseSensitiveByPath = /* @__PURE__ */ new Map();
|
|
19895
|
+
this.caseInsensitiveByPath = /* @__PURE__ */ new Map();
|
|
19896
|
+
}
|
|
19897
|
+
get size() {
|
|
19898
|
+
return this.caseSensitiveByHostPath.size + this.caseInsensitiveByHostPath.size + this.caseSensitiveByPath.size + this.caseInsensitiveByPath.size;
|
|
19899
|
+
}
|
|
19900
|
+
add(redirect2) {
|
|
19901
|
+
const { host, pathname } = parseSource(redirect2.source);
|
|
19902
|
+
const stored = {
|
|
19903
|
+
destination: redirect2.destination,
|
|
19904
|
+
statusCode: redirect2.statusCode,
|
|
19905
|
+
preserveQueryParams: redirect2.preserveQueryParams
|
|
19906
|
+
};
|
|
19907
|
+
if (host) {
|
|
19908
|
+
const key = hostPathKey(host, pathname);
|
|
19909
|
+
if (redirect2.caseSensitive) {
|
|
19910
|
+
this.caseSensitiveByHostPath.set(key, stored);
|
|
19911
|
+
} else {
|
|
19912
|
+
this.caseInsensitiveByHostPath.set(key.toLowerCase(), stored);
|
|
19913
|
+
}
|
|
19914
|
+
return;
|
|
19915
|
+
}
|
|
19916
|
+
if (redirect2.caseSensitive) {
|
|
19917
|
+
this.caseSensitiveByPath.set(pathname, stored);
|
|
19918
|
+
} else {
|
|
19919
|
+
this.caseInsensitiveByPath.set(pathname.toLowerCase(), stored);
|
|
19920
|
+
}
|
|
19921
|
+
}
|
|
19922
|
+
lookup(pathname, host) {
|
|
19923
|
+
const hostname = host ? hostnameFromHostHeader(host) : "";
|
|
19924
|
+
if (hostname) {
|
|
19925
|
+
const hostKey = hostPathKey(hostname, pathname);
|
|
19926
|
+
const hostMatch = this.caseSensitiveByHostPath.get(hostKey) || this.caseInsensitiveByHostPath.get(hostKey.toLowerCase());
|
|
19927
|
+
if (hostMatch) {
|
|
19928
|
+
return hostMatch;
|
|
19929
|
+
}
|
|
19930
|
+
}
|
|
19931
|
+
return this.caseSensitiveByPath.get(pathname) || this.caseInsensitiveByPath.get(pathname.toLowerCase());
|
|
19932
|
+
}
|
|
19933
|
+
};
|
|
19934
|
+
async function getBulkRedirectsSignature(cwd, bulkRedirectsPath) {
|
|
19935
|
+
if (!bulkRedirectsPath) {
|
|
19936
|
+
return "";
|
|
19937
|
+
}
|
|
19938
|
+
const resolved = resolveBulkRedirectsPath(cwd, bulkRedirectsPath);
|
|
19939
|
+
if (!resolved) {
|
|
19940
|
+
return `invalid:${bulkRedirectsPath}`;
|
|
19941
|
+
}
|
|
19942
|
+
try {
|
|
19943
|
+
const stats = await stat(resolved);
|
|
19944
|
+
if (stats.isFile()) {
|
|
19945
|
+
return `file:${resolved}:${stats.mtimeMs}:${stats.size}`;
|
|
19946
|
+
}
|
|
19947
|
+
if (!stats.isDirectory()) {
|
|
19948
|
+
return `other:${resolved}:${stats.mtimeMs}`;
|
|
19949
|
+
}
|
|
19950
|
+
const files = await listRedirectFiles(resolved);
|
|
19951
|
+
const parts = await Promise.all(
|
|
19952
|
+
files.map(async (file) => {
|
|
19953
|
+
try {
|
|
19954
|
+
const fileStats = await stat(file);
|
|
19955
|
+
return `${file}:${fileStats.mtimeMs}:${fileStats.size}`;
|
|
19956
|
+
} catch {
|
|
19957
|
+
return `${file}:missing`;
|
|
19958
|
+
}
|
|
19959
|
+
})
|
|
19960
|
+
);
|
|
19961
|
+
return `dir:${resolved}:${parts.join("|")}`;
|
|
19962
|
+
} catch {
|
|
19963
|
+
return `missing:${resolved}`;
|
|
19964
|
+
}
|
|
19965
|
+
}
|
|
19966
|
+
async function loadBulkRedirects(cwd, bulkRedirectsPath) {
|
|
19967
|
+
const warnings = [];
|
|
19968
|
+
const table = new BulkRedirectTable();
|
|
19969
|
+
const resolved = resolveBulkRedirectsPath(cwd, bulkRedirectsPath);
|
|
19970
|
+
if (!resolved) {
|
|
19971
|
+
warnings.push(
|
|
19972
|
+
`Skipping bulk redirects path "${bulkRedirectsPath}" because it resolves outside the project directory.`
|
|
19973
|
+
);
|
|
19974
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
19975
|
+
}
|
|
19976
|
+
let files;
|
|
19977
|
+
try {
|
|
19978
|
+
const stats = await stat(resolved);
|
|
19979
|
+
if (stats.isDirectory()) {
|
|
19980
|
+
files = await listRedirectFiles(resolved);
|
|
19981
|
+
if (files.length > MAX_FILES) {
|
|
19982
|
+
warnings.push(
|
|
19983
|
+
`Bulk redirects directory "${bulkRedirectsPath}" has ${files.length} files; only the first ${MAX_FILES} will be used.`
|
|
19984
|
+
);
|
|
19985
|
+
files = files.slice(0, MAX_FILES);
|
|
19986
|
+
}
|
|
19987
|
+
} else if (stats.isFile()) {
|
|
19988
|
+
const ext = extname(resolved).toLowerCase();
|
|
19989
|
+
if (!SUPPORTED_EXTENSIONS.has(ext)) {
|
|
19990
|
+
warnings.push(
|
|
19991
|
+
`Bulk redirects file "${bulkRedirectsPath}" must be a .csv, .json, or .jsonl file.`
|
|
19992
|
+
);
|
|
19993
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
19994
|
+
}
|
|
19995
|
+
files = [resolved];
|
|
19996
|
+
} else {
|
|
19997
|
+
warnings.push(
|
|
19998
|
+
`Bulk redirects path "${bulkRedirectsPath}" is not a file or directory.`
|
|
19999
|
+
);
|
|
20000
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
20001
|
+
}
|
|
20002
|
+
} catch (err) {
|
|
20003
|
+
if (isNotFound(err)) {
|
|
20004
|
+
warnings.push(
|
|
20005
|
+
`Bulk redirects path "${bulkRedirectsPath}" was not found.`
|
|
20006
|
+
);
|
|
20007
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
20008
|
+
}
|
|
20009
|
+
throw err;
|
|
20010
|
+
}
|
|
20011
|
+
let redirectCount = 0;
|
|
20012
|
+
for (const file of files) {
|
|
20013
|
+
if (redirectCount >= MAX_REDIRECTS) {
|
|
20014
|
+
warnings.push(
|
|
20015
|
+
`Bulk redirects limit of ${MAX_REDIRECTS} reached; remaining entries were skipped.`
|
|
20016
|
+
);
|
|
20017
|
+
break;
|
|
20018
|
+
}
|
|
20019
|
+
const remaining = MAX_REDIRECTS - redirectCount;
|
|
20020
|
+
const parsed = await parseRedirectFile(file, remaining, warnings, cwd);
|
|
20021
|
+
for (const redirect2 of parsed) {
|
|
20022
|
+
table.add(redirect2);
|
|
20023
|
+
redirectCount++;
|
|
20024
|
+
}
|
|
20025
|
+
}
|
|
20026
|
+
const duplicateCount = redirectCount - table.size;
|
|
20027
|
+
if (duplicateCount > 0) {
|
|
20028
|
+
warnings.push(
|
|
20029
|
+
`Bulk redirects contain ${duplicateCount} duplicate ${duplicateCount === 1 ? "source" : "sources"}; the last occurrence wins.`
|
|
20030
|
+
);
|
|
20031
|
+
}
|
|
20032
|
+
return {
|
|
20033
|
+
table,
|
|
20034
|
+
redirectCount,
|
|
20035
|
+
fileCount: files.length,
|
|
20036
|
+
warnings
|
|
20037
|
+
};
|
|
20038
|
+
}
|
|
20039
|
+
function resolveBulkRedirect(table, reqUrl, host) {
|
|
20040
|
+
const parsed = parseUrl(reqUrl);
|
|
20041
|
+
const match = table.lookup(parsed.pathname || "/", host);
|
|
20042
|
+
if (!match) {
|
|
20043
|
+
return void 0;
|
|
20044
|
+
}
|
|
20045
|
+
let location = match.destination;
|
|
20046
|
+
if (match.preserveQueryParams && parsed.search) {
|
|
20047
|
+
location = appendQueryParams(location, parsed.search);
|
|
20048
|
+
}
|
|
20049
|
+
return { location, statusCode: match.statusCode };
|
|
20050
|
+
}
|
|
20051
|
+
function appendQueryParams(destination, search) {
|
|
20052
|
+
const query = search.startsWith("?") ? search.slice(1) : search;
|
|
20053
|
+
if (!query) {
|
|
20054
|
+
return destination;
|
|
20055
|
+
}
|
|
20056
|
+
return destination.includes("?") ? `${destination}&${query}` : `${destination}?${query}`;
|
|
20057
|
+
}
|
|
20058
|
+
function resolveBulkRedirectsPath(cwd, bulkRedirectsPath) {
|
|
20059
|
+
const projectRoot = resolve(cwd);
|
|
20060
|
+
const resolved = resolve(projectRoot, bulkRedirectsPath);
|
|
20061
|
+
const relativeFromRoot = relative3(projectRoot, resolved);
|
|
20062
|
+
if (relativeFromRoot.startsWith("..") || isAbsolute2(relativeFromRoot)) {
|
|
20063
|
+
return null;
|
|
20064
|
+
}
|
|
20065
|
+
return resolved;
|
|
20066
|
+
}
|
|
20067
|
+
async function listRedirectFiles(dir) {
|
|
20068
|
+
const files = [];
|
|
20069
|
+
await walk(dir, files);
|
|
20070
|
+
files.sort();
|
|
20071
|
+
return files;
|
|
20072
|
+
}
|
|
20073
|
+
async function walk(dir, files) {
|
|
20074
|
+
const entries = await readdir(dir);
|
|
20075
|
+
for (const entry of entries) {
|
|
20076
|
+
const fullPath = join3(dir, entry);
|
|
20077
|
+
const stats = await lstat(fullPath);
|
|
20078
|
+
if (stats.isDirectory()) {
|
|
20079
|
+
await walk(fullPath, files);
|
|
20080
|
+
} else if (stats.isFile() && SUPPORTED_EXTENSIONS.has(extname(fullPath).toLowerCase())) {
|
|
20081
|
+
files.push(fullPath);
|
|
20082
|
+
}
|
|
20083
|
+
}
|
|
20084
|
+
}
|
|
20085
|
+
async function parseRedirectFile(file, remaining, warnings, cwd) {
|
|
20086
|
+
const rel = relative3(cwd, file) || file;
|
|
20087
|
+
const ext = extname(file).toLowerCase();
|
|
20088
|
+
let content;
|
|
20089
|
+
try {
|
|
20090
|
+
content = stripBom(await readFile(file, "utf8"));
|
|
20091
|
+
} catch (err) {
|
|
20092
|
+
warnings.push(
|
|
20093
|
+
`Failed to read bulk redirects file "${rel}": ${errorMessage(err)}`
|
|
20094
|
+
);
|
|
20095
|
+
return [];
|
|
20096
|
+
}
|
|
20097
|
+
try {
|
|
20098
|
+
if (ext === ".csv") {
|
|
20099
|
+
return parseCsvRedirects(content, remaining, warnings, rel);
|
|
20100
|
+
}
|
|
20101
|
+
if (ext === ".jsonl") {
|
|
20102
|
+
return parseJsonlRedirects(content, remaining, warnings, rel);
|
|
20103
|
+
}
|
|
20104
|
+
return parseJsonRedirects(content, remaining, warnings, rel);
|
|
20105
|
+
} catch (err) {
|
|
20106
|
+
warnings.push(
|
|
20107
|
+
`Failed to parse bulk redirects file "${rel}": ${errorMessage(err)}`
|
|
20108
|
+
);
|
|
20109
|
+
return [];
|
|
20110
|
+
}
|
|
20111
|
+
}
|
|
20112
|
+
function parseJsonRedirects(content, remaining, warnings, rel) {
|
|
20113
|
+
const parsed = JSON.parse(content);
|
|
20114
|
+
if (!Array.isArray(parsed)) {
|
|
20115
|
+
warnings.push(
|
|
20116
|
+
`Bulk redirects file "${rel}" must contain a JSON array of redirects.`
|
|
20117
|
+
);
|
|
20118
|
+
return [];
|
|
20119
|
+
}
|
|
20120
|
+
return normalizeRedirects(parsed, remaining, warnings, rel);
|
|
20121
|
+
}
|
|
20122
|
+
function parseJsonlRedirects(content, remaining, warnings, rel) {
|
|
20123
|
+
const rows = [];
|
|
20124
|
+
const lines = content.split(/\r?\n/);
|
|
20125
|
+
for (let i = 0; i < lines.length; i++) {
|
|
20126
|
+
const line = lines[i].trim();
|
|
20127
|
+
if (!line) {
|
|
20128
|
+
continue;
|
|
20129
|
+
}
|
|
20130
|
+
try {
|
|
20131
|
+
rows.push(JSON.parse(line));
|
|
20132
|
+
} catch {
|
|
20133
|
+
warnings.push(`Skipping invalid JSONL in "${rel}" at line ${i + 1}.`);
|
|
20134
|
+
}
|
|
20135
|
+
}
|
|
20136
|
+
return normalizeRedirects(rows, remaining, warnings, rel);
|
|
20137
|
+
}
|
|
20138
|
+
var CSV_HEADER_ALIASES = {
|
|
20139
|
+
source: "source",
|
|
20140
|
+
destination: "destination",
|
|
20141
|
+
permanent: "permanent",
|
|
20142
|
+
statuscode: "statusCode",
|
|
20143
|
+
casesensitive: "caseSensitive",
|
|
20144
|
+
preservequeryparams: "preserveQueryParams"
|
|
20145
|
+
};
|
|
20146
|
+
function parseCsvRedirects(content, remaining, warnings, rel) {
|
|
20147
|
+
const lines = content.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
20148
|
+
if (lines.length === 0) {
|
|
20149
|
+
warnings.push(`Bulk redirects CSV "${rel}" is empty.`);
|
|
20150
|
+
return [];
|
|
20151
|
+
}
|
|
20152
|
+
const headers = parseCsvLine(lines[0]).map(
|
|
20153
|
+
(header) => CSV_HEADER_ALIASES[header.trim().toLowerCase()]
|
|
20154
|
+
);
|
|
20155
|
+
if (!headers.includes("source") || !headers.includes("destination")) {
|
|
20156
|
+
warnings.push(
|
|
20157
|
+
`Bulk redirects CSV "${rel}" must have "source" and "destination" columns.`
|
|
20158
|
+
);
|
|
20159
|
+
return [];
|
|
20160
|
+
}
|
|
20161
|
+
const rows = [];
|
|
20162
|
+
for (let i = 1; i < lines.length; i++) {
|
|
20163
|
+
const values = parseCsvLine(lines[i]);
|
|
20164
|
+
const row = {};
|
|
20165
|
+
for (let col = 0; col < headers.length; col++) {
|
|
20166
|
+
const header = headers[col];
|
|
20167
|
+
if (header) {
|
|
20168
|
+
row[header] = values[col] ?? "";
|
|
20169
|
+
}
|
|
20170
|
+
}
|
|
20171
|
+
rows.push(row);
|
|
20172
|
+
}
|
|
20173
|
+
return normalizeRedirects(rows, remaining, warnings, rel);
|
|
20174
|
+
}
|
|
20175
|
+
function normalizeRedirects(rows, remaining, warnings, rel) {
|
|
20176
|
+
const redirects = [];
|
|
20177
|
+
for (let i = 0; i < rows.length; i++) {
|
|
20178
|
+
if (redirects.length >= remaining) {
|
|
20179
|
+
warnings.push(
|
|
20180
|
+
`Bulk redirects limit of ${MAX_REDIRECTS} reached while reading "${rel}"; remaining entries were skipped.`
|
|
20181
|
+
);
|
|
20182
|
+
break;
|
|
20183
|
+
}
|
|
20184
|
+
const row = rows[i];
|
|
20185
|
+
if (!row || typeof row !== "object") {
|
|
20186
|
+
warnings.push(`Skipping invalid redirect in "${rel}" at index ${i}.`);
|
|
20187
|
+
continue;
|
|
20188
|
+
}
|
|
20189
|
+
const record = row;
|
|
20190
|
+
const source = asTrimmedString(record.source);
|
|
20191
|
+
const destination = asTrimmedString(record.destination);
|
|
20192
|
+
if (!source || !destination) {
|
|
20193
|
+
warnings.push(
|
|
20194
|
+
`Skipping redirect in "${rel}" at index ${i}: source and destination are required.`
|
|
20195
|
+
);
|
|
20196
|
+
continue;
|
|
20197
|
+
}
|
|
20198
|
+
if (source.length > MAX_URL_LENGTH || destination.length > MAX_URL_LENGTH) {
|
|
20199
|
+
warnings.push(
|
|
20200
|
+
`Skipping redirect in "${rel}" at index ${i}: source and destination must be at most ${MAX_URL_LENGTH} characters.`
|
|
20201
|
+
);
|
|
20202
|
+
continue;
|
|
20203
|
+
}
|
|
20204
|
+
let statusCode;
|
|
20205
|
+
if (record.statusCode !== void 0 && record.statusCode !== "") {
|
|
20206
|
+
const parsedStatus = parseStatusCode(record.statusCode);
|
|
20207
|
+
if (parsedStatus === void 0) {
|
|
20208
|
+
warnings.push(
|
|
20209
|
+
`Skipping redirect in "${rel}" at index ${i}: statusCode must be one of ${[...VALID_STATUS_CODES].join(", ")}.`
|
|
20210
|
+
);
|
|
20211
|
+
continue;
|
|
20212
|
+
}
|
|
20213
|
+
statusCode = parsedStatus;
|
|
20214
|
+
} else {
|
|
20215
|
+
const permanent = parseBoolean(record.permanent) ?? false;
|
|
20216
|
+
statusCode = permanent ? 308 : 307;
|
|
20217
|
+
}
|
|
20218
|
+
redirects.push({
|
|
20219
|
+
source,
|
|
20220
|
+
destination,
|
|
20221
|
+
statusCode,
|
|
20222
|
+
caseSensitive: parseBoolean(record.caseSensitive) ?? false,
|
|
20223
|
+
preserveQueryParams: parseBoolean(record.preserveQueryParams) ?? false
|
|
20224
|
+
});
|
|
20225
|
+
}
|
|
20226
|
+
return redirects;
|
|
20227
|
+
}
|
|
20228
|
+
function parseSource(source) {
|
|
20229
|
+
if (/^https?:\/\//i.test(source)) {
|
|
20230
|
+
try {
|
|
20231
|
+
const parsed = new URL(source);
|
|
20232
|
+
return {
|
|
20233
|
+
host: parsed.hostname.toLowerCase(),
|
|
20234
|
+
pathname: parsed.pathname || "/"
|
|
20235
|
+
};
|
|
20236
|
+
} catch {
|
|
20237
|
+
return { host: null, pathname: source };
|
|
20238
|
+
}
|
|
20239
|
+
}
|
|
20240
|
+
return { host: null, pathname: source || "/" };
|
|
20241
|
+
}
|
|
20242
|
+
function hostPathKey(host, pathname) {
|
|
20243
|
+
return `${host}\0${pathname}`;
|
|
20244
|
+
}
|
|
20245
|
+
function hostnameFromHostHeader(hostHeader) {
|
|
20246
|
+
const trimmed = hostHeader.trim();
|
|
20247
|
+
if (!trimmed) {
|
|
20248
|
+
return "";
|
|
20249
|
+
}
|
|
20250
|
+
if (trimmed.startsWith("[")) {
|
|
20251
|
+
const end = trimmed.indexOf("]");
|
|
20252
|
+
return end === -1 ? trimmed.toLowerCase() : trimmed.slice(1, end).toLowerCase();
|
|
20253
|
+
}
|
|
20254
|
+
const colon = trimmed.lastIndexOf(":");
|
|
20255
|
+
if (colon !== -1 && trimmed.indexOf(":") === colon) {
|
|
20256
|
+
return trimmed.slice(0, colon).toLowerCase();
|
|
20257
|
+
}
|
|
20258
|
+
return trimmed.toLowerCase();
|
|
20259
|
+
}
|
|
20260
|
+
function parseBoolean(value) {
|
|
20261
|
+
if (typeof value === "boolean") {
|
|
20262
|
+
return value;
|
|
20263
|
+
}
|
|
20264
|
+
if (typeof value === "number") {
|
|
20265
|
+
if (value === 1)
|
|
20266
|
+
return true;
|
|
20267
|
+
if (value === 0)
|
|
20268
|
+
return false;
|
|
20269
|
+
return void 0;
|
|
20270
|
+
}
|
|
20271
|
+
if (typeof value !== "string") {
|
|
20272
|
+
return void 0;
|
|
20273
|
+
}
|
|
20274
|
+
const normalized = value.trim().toLowerCase();
|
|
20275
|
+
if (normalized === "t" || normalized === "true") {
|
|
20276
|
+
return true;
|
|
20277
|
+
}
|
|
20278
|
+
if (normalized === "f" || normalized === "false") {
|
|
20279
|
+
return false;
|
|
20280
|
+
}
|
|
20281
|
+
return void 0;
|
|
20282
|
+
}
|
|
20283
|
+
function parseStatusCode(value) {
|
|
20284
|
+
const n = typeof value === "number" ? value : typeof value === "string" ? Number(value.trim()) : NaN;
|
|
20285
|
+
return VALID_STATUS_CODES.has(n) ? n : void 0;
|
|
20286
|
+
}
|
|
20287
|
+
function asTrimmedString(value) {
|
|
20288
|
+
if (typeof value !== "string") {
|
|
20289
|
+
return void 0;
|
|
20290
|
+
}
|
|
20291
|
+
const trimmed = value.trim();
|
|
20292
|
+
return trimmed ? trimmed : void 0;
|
|
20293
|
+
}
|
|
20294
|
+
function parseCsvLine(line) {
|
|
20295
|
+
const fields = [];
|
|
20296
|
+
let current = "";
|
|
20297
|
+
let inQuotes = false;
|
|
20298
|
+
for (let i = 0; i < line.length; i++) {
|
|
20299
|
+
const char = line[i];
|
|
20300
|
+
if (inQuotes) {
|
|
20301
|
+
if (char === '"') {
|
|
20302
|
+
if (line[i + 1] === '"') {
|
|
20303
|
+
current += '"';
|
|
20304
|
+
i++;
|
|
20305
|
+
} else {
|
|
20306
|
+
inQuotes = false;
|
|
20307
|
+
}
|
|
20308
|
+
} else {
|
|
20309
|
+
current += char;
|
|
20310
|
+
}
|
|
20311
|
+
} else if (char === '"') {
|
|
20312
|
+
inQuotes = true;
|
|
20313
|
+
} else if (char === ",") {
|
|
20314
|
+
fields.push(current);
|
|
20315
|
+
current = "";
|
|
20316
|
+
} else {
|
|
20317
|
+
current += char;
|
|
20318
|
+
}
|
|
20319
|
+
}
|
|
20320
|
+
fields.push(current);
|
|
20321
|
+
return fields;
|
|
20322
|
+
}
|
|
20323
|
+
function stripBom(content) {
|
|
20324
|
+
return content.charCodeAt(0) === 65279 ? content.slice(1) : content;
|
|
20325
|
+
}
|
|
20326
|
+
function isNotFound(err) {
|
|
20327
|
+
return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
|
|
20328
|
+
}
|
|
20329
|
+
function errorMessage(err) {
|
|
20330
|
+
return err instanceof Error ? err.message : String(err);
|
|
20331
|
+
}
|
|
20332
|
+
|
|
19769
20333
|
// src/util/dev/server.ts
|
|
19770
|
-
var DEV_SERVER_PORT_BIND_TIMEOUT = (0,
|
|
20334
|
+
var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms5.default)("5m");
|
|
19771
20335
|
var DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS = 60;
|
|
20336
|
+
var DEV_RUNTIME_CACHE_MAX_ITEM_SIZE = 2 * 1024 * 1024;
|
|
20337
|
+
var DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS = 31536e3;
|
|
19772
20338
|
var frameworkRuntimeSet = new Set(
|
|
19773
20339
|
import_frameworks2.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
|
|
19774
20340
|
);
|
|
@@ -19807,7 +20373,7 @@ var DevServer = class {
|
|
|
19807
20373
|
this.getVercelConfigPromise = null;
|
|
19808
20374
|
};
|
|
19809
20375
|
this.getExtensionlessFile = (path6) => {
|
|
19810
|
-
const ext =
|
|
20376
|
+
const ext = extname2(path6);
|
|
19811
20377
|
if (this.apiDir && path6.startsWith(this.apiDir + "/") && this.apiExtensions.has(ext)) {
|
|
19812
20378
|
return path6.slice(0, -ext.length);
|
|
19813
20379
|
}
|
|
@@ -20051,6 +20617,146 @@ ${partHeaders}\r
|
|
|
20051
20617
|
res.writeHead(404);
|
|
20052
20618
|
res.end("Not Found");
|
|
20053
20619
|
};
|
|
20620
|
+
/**
|
|
20621
|
+
* Handle `/_svc/_cache/*` routes for the dev Runtime Cache store, which mimics
|
|
20622
|
+
* the Runtime Cache API so `getCache()` works unchanged in `vc dev` and is
|
|
20623
|
+
* shared by every service instead of being process-local.
|
|
20624
|
+
*/
|
|
20625
|
+
this.handleRuntimeCacheRoute = async (req, res, pathname) => {
|
|
20626
|
+
const store = this.runtimeCache;
|
|
20627
|
+
if (!store) {
|
|
20628
|
+
res.writeHead(503);
|
|
20629
|
+
res.end("Runtime Cache not initialized");
|
|
20630
|
+
return;
|
|
20631
|
+
}
|
|
20632
|
+
if (!pathname.startsWith(DEV_RUNTIME_CACHE_ITEM_PREFIX)) {
|
|
20633
|
+
res.writeHead(404);
|
|
20634
|
+
res.end("Not Found");
|
|
20635
|
+
return;
|
|
20636
|
+
}
|
|
20637
|
+
const itemPath = pathname.slice(DEV_RUNTIME_CACHE_ITEM_PREFIX.length);
|
|
20638
|
+
const searchParams = new URL2(req.url || "/", "http://localhost").searchParams;
|
|
20639
|
+
if (itemPath === "revalidate") {
|
|
20640
|
+
if (req.method !== "POST") {
|
|
20641
|
+
res.writeHead(405);
|
|
20642
|
+
res.end("Method Not Allowed");
|
|
20643
|
+
return;
|
|
20644
|
+
}
|
|
20645
|
+
const tags = (searchParams.get("tags") || "").split(",").map((tag) => tag.trim()).filter(Boolean);
|
|
20646
|
+
const itemId = searchParams.get("itemId") || void 0;
|
|
20647
|
+
if (tags.length === 0 && !itemId) {
|
|
20648
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
20649
|
+
res.end(JSON.stringify({ error: "No tags or itemId provided" }));
|
|
20650
|
+
return;
|
|
20651
|
+
}
|
|
20652
|
+
if (tags.length > 0) {
|
|
20653
|
+
store.expireTags(tags);
|
|
20654
|
+
output_manager_default.debug(`runtime cache: expired tags "${tags.join(",")}"`);
|
|
20655
|
+
}
|
|
20656
|
+
if (itemId) {
|
|
20657
|
+
store.delete(itemId);
|
|
20658
|
+
output_manager_default.debug(`runtime cache: expired item "${itemId}"`);
|
|
20659
|
+
}
|
|
20660
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
20661
|
+
res.end(JSON.stringify({ revalidated: true }));
|
|
20662
|
+
return;
|
|
20663
|
+
}
|
|
20664
|
+
let key;
|
|
20665
|
+
try {
|
|
20666
|
+
key = decodeURIComponent(itemPath);
|
|
20667
|
+
} catch {
|
|
20668
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
20669
|
+
res.end(JSON.stringify({ error: "Invalid cache key" }));
|
|
20670
|
+
return;
|
|
20671
|
+
}
|
|
20672
|
+
if (!key) {
|
|
20673
|
+
res.writeHead(404);
|
|
20674
|
+
res.end("Not Found");
|
|
20675
|
+
return;
|
|
20676
|
+
}
|
|
20677
|
+
if (req.method === "GET") {
|
|
20678
|
+
const hit = store.get(key);
|
|
20679
|
+
if (!hit) {
|
|
20680
|
+
output_manager_default.debug(`runtime cache: MISS "${key}"`);
|
|
20681
|
+
res.writeHead(404);
|
|
20682
|
+
res.end("Not Found");
|
|
20683
|
+
return;
|
|
20684
|
+
}
|
|
20685
|
+
output_manager_default.debug(`runtime cache: HIT "${key}"`);
|
|
20686
|
+
const headers = {
|
|
20687
|
+
"Content-Type": "application/json",
|
|
20688
|
+
"Content-Length": hit.value.length,
|
|
20689
|
+
[HEADER_CACHE_STATE]: "fresh",
|
|
20690
|
+
Age: String(hit.ageSeconds)
|
|
20691
|
+
};
|
|
20692
|
+
if (hit.tags.length > 0) {
|
|
20693
|
+
headers[HEADER_CACHE_TAGS] = hit.tags.join(",");
|
|
20694
|
+
}
|
|
20695
|
+
res.writeHead(200, headers);
|
|
20696
|
+
res.end(hit.value);
|
|
20697
|
+
return;
|
|
20698
|
+
}
|
|
20699
|
+
if (req.method === "POST") {
|
|
20700
|
+
const revalidateHeader = req.headers[HEADER_REVALIDATE];
|
|
20701
|
+
let ttlSeconds;
|
|
20702
|
+
if (revalidateHeader) {
|
|
20703
|
+
if (revalidateHeader === "Infinity" || ["false", "False", "FALSE", "f", "F"].includes(revalidateHeader)) {
|
|
20704
|
+
ttlSeconds = DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS;
|
|
20705
|
+
} else if (/^[+-]?\d+$/.test(revalidateHeader)) {
|
|
20706
|
+
const parsedRevalidate = Number(revalidateHeader);
|
|
20707
|
+
if (!Number.isSafeInteger(parsedRevalidate) || parsedRevalidate < 0) {
|
|
20708
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
20709
|
+
res.end(JSON.stringify({ error: "Invalid revalidate value" }));
|
|
20710
|
+
return;
|
|
20711
|
+
}
|
|
20712
|
+
if (parsedRevalidate === 0) {
|
|
20713
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
20714
|
+
res.end(JSON.stringify({ success: true }));
|
|
20715
|
+
return;
|
|
20716
|
+
}
|
|
20717
|
+
ttlSeconds = parsedRevalidate;
|
|
20718
|
+
} else {
|
|
20719
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
20720
|
+
res.end(JSON.stringify({ error: "Invalid revalidate value" }));
|
|
20721
|
+
return;
|
|
20722
|
+
}
|
|
20723
|
+
}
|
|
20724
|
+
let value;
|
|
20725
|
+
try {
|
|
20726
|
+
value = await (0, import_raw_body.default)(req, {
|
|
20727
|
+
limit: DEV_RUNTIME_CACHE_MAX_ITEM_SIZE
|
|
20728
|
+
});
|
|
20729
|
+
} catch (err) {
|
|
20730
|
+
if (err.statusCode === 413) {
|
|
20731
|
+
res.writeHead(413, { "Content-Type": "application/json" });
|
|
20732
|
+
res.end(JSON.stringify({ error: "Cache item is too large" }));
|
|
20733
|
+
return;
|
|
20734
|
+
}
|
|
20735
|
+
throw err;
|
|
20736
|
+
}
|
|
20737
|
+
const tagsHeader = req.headers[HEADER_CACHE_TAGS];
|
|
20738
|
+
store.set(key, value, {
|
|
20739
|
+
ttlSeconds,
|
|
20740
|
+
tags: (tagsHeader || "").split(",").map((tag) => tag.trim()).filter(Boolean)
|
|
20741
|
+
});
|
|
20742
|
+
const name = req.headers[HEADER_CACHE_ITEM_NAME];
|
|
20743
|
+
output_manager_default.debug(
|
|
20744
|
+
`runtime cache: SET "${key}"${name ? ` (${name})` : ""} ${value.length} bytes`
|
|
20745
|
+
);
|
|
20746
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
20747
|
+
res.end(JSON.stringify({ success: true }));
|
|
20748
|
+
return;
|
|
20749
|
+
}
|
|
20750
|
+
if (req.method === "DELETE") {
|
|
20751
|
+
store.delete(key);
|
|
20752
|
+
output_manager_default.debug(`runtime cache: DELETE "${key}"`);
|
|
20753
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
20754
|
+
res.end(JSON.stringify({ success: true }));
|
|
20755
|
+
return;
|
|
20756
|
+
}
|
|
20757
|
+
res.writeHead(405);
|
|
20758
|
+
res.end("Method Not Allowed");
|
|
20759
|
+
};
|
|
20054
20760
|
/**
|
|
20055
20761
|
* Serve project directory as a v2 deployment.
|
|
20056
20762
|
*/
|
|
@@ -20076,6 +20782,33 @@ ${partHeaders}\r
|
|
|
20076
20782
|
return;
|
|
20077
20783
|
}
|
|
20078
20784
|
}
|
|
20785
|
+
if (callLevel === 0) {
|
|
20786
|
+
const pathname = parsed.pathname || "/";
|
|
20787
|
+
if (pathname.startsWith(DEV_RUNTIME_CACHE_PREFIX)) {
|
|
20788
|
+
await this.handleRuntimeCacheRoute(req, res, pathname);
|
|
20789
|
+
return;
|
|
20790
|
+
}
|
|
20791
|
+
}
|
|
20792
|
+
if (callLevel === 0 && this.bulkRedirects) {
|
|
20793
|
+
const bulkMatch = resolveBulkRedirect(
|
|
20794
|
+
this.bulkRedirects,
|
|
20795
|
+
req.url || "/",
|
|
20796
|
+
typeof req.headers.host === "string" ? req.headers.host : void 0
|
|
20797
|
+
);
|
|
20798
|
+
if (bulkMatch) {
|
|
20799
|
+
debug(
|
|
20800
|
+
`Bulk redirect ${bulkMatch.statusCode}: ${req.url} -> ${bulkMatch.location}`
|
|
20801
|
+
);
|
|
20802
|
+
await this.sendRedirect(
|
|
20803
|
+
req,
|
|
20804
|
+
res,
|
|
20805
|
+
requestId,
|
|
20806
|
+
bulkMatch.location,
|
|
20807
|
+
bulkMatch.statusCode
|
|
20808
|
+
);
|
|
20809
|
+
return;
|
|
20810
|
+
}
|
|
20811
|
+
}
|
|
20079
20812
|
if (callLevel === 0 && this.orchestrator) {
|
|
20080
20813
|
const pathname = parsed.pathname || "/";
|
|
20081
20814
|
const service = this.orchestrator.getServiceForRoute(pathname);
|
|
@@ -20139,7 +20872,11 @@ ${partHeaders}\r
|
|
|
20139
20872
|
entrypoint: middleware.entrypoint,
|
|
20140
20873
|
workPath,
|
|
20141
20874
|
repoRootPath: this.repoRoot,
|
|
20142
|
-
|
|
20875
|
+
// `projectSettings.createdAt` decides the default middleware runtime.
|
|
20876
|
+
config: {
|
|
20877
|
+
projectSettings: this.projectSettings,
|
|
20878
|
+
...middleware.config
|
|
20879
|
+
},
|
|
20143
20880
|
meta: {
|
|
20144
20881
|
isDev: true,
|
|
20145
20882
|
devCacheDir,
|
|
@@ -20224,7 +20961,7 @@ ${partHeaders}\r
|
|
|
20224
20961
|
prevUrl = rewritePath;
|
|
20225
20962
|
const beforeRewriteUrl = req.url || "/";
|
|
20226
20963
|
if (isURL(rewritePath)) {
|
|
20227
|
-
const rewriteUrlParsed = new
|
|
20964
|
+
const rewriteUrlParsed = new URL2(rewritePath);
|
|
20228
20965
|
if (this.address.origin === rewriteUrlParsed.origin) {
|
|
20229
20966
|
req.url = rewritePath.slice(rewriteUrlParsed.origin.length) || "/";
|
|
20230
20967
|
prevUrl = req.url;
|
|
@@ -20771,11 +21508,16 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
20771
21508
|
this.stopping = false;
|
|
20772
21509
|
this.buildMatches = /* @__PURE__ */ new Map();
|
|
20773
21510
|
this.inProgressBuilds = /* @__PURE__ */ new Map();
|
|
20774
|
-
this.devCacheDir =
|
|
21511
|
+
this.devCacheDir = join4(getVercelDirectory(cwd), "cache");
|
|
20775
21512
|
this.vercelConfigWarning = false;
|
|
20776
21513
|
this.getVercelConfigPromise = null;
|
|
20777
21514
|
this.blockingBuildsPromise = null;
|
|
20778
21515
|
this.startPromise = null;
|
|
21516
|
+
this.bulkRedirects = null;
|
|
21517
|
+
this.bulkRedirectsSignature = null;
|
|
21518
|
+
this.bulkRedirectsLastPath = null;
|
|
21519
|
+
this.bulkRedirectsResolvedPath = null;
|
|
21520
|
+
this.bulkRedirectsDirty = true;
|
|
20779
21521
|
this.watchAggregationId = null;
|
|
20780
21522
|
this.watchAggregationEvents = [];
|
|
20781
21523
|
this.watchAggregationTimeout = 500;
|
|
@@ -20806,6 +21548,23 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
20806
21548
|
VERCEL_REGION: "dev1"
|
|
20807
21549
|
};
|
|
20808
21550
|
}
|
|
21551
|
+
/**
|
|
21552
|
+
* Point Runtime Cache clients at the dev server's store, unless the developer
|
|
21553
|
+
* already configured a cache endpoint of their own (in their shell or env
|
|
21554
|
+
* files).
|
|
21555
|
+
*/
|
|
21556
|
+
getDevRuntimeCacheEnv(env) {
|
|
21557
|
+
if (!this._address || env.RUNTIME_CACHE_ENDPOINT) {
|
|
21558
|
+
return {};
|
|
21559
|
+
}
|
|
21560
|
+
if (process.env.RUNTIME_CACHE_ENDPOINT) {
|
|
21561
|
+
return {
|
|
21562
|
+
RUNTIME_CACHE_ENDPOINT: process.env.RUNTIME_CACHE_ENDPOINT,
|
|
21563
|
+
...process.env.RUNTIME_CACHE_HEADERS ? { RUNTIME_CACHE_HEADERS: process.env.RUNTIME_CACHE_HEADERS } : {}
|
|
21564
|
+
};
|
|
21565
|
+
}
|
|
21566
|
+
return getDevRuntimeCacheEnv(this.address.origin);
|
|
21567
|
+
}
|
|
20809
21568
|
getSidecarDevMeta(match) {
|
|
20810
21569
|
const serviceCount = (this.sidecars ?? []).filter((sidecar) => {
|
|
20811
21570
|
if (sidecar.builder.use !== match.use)
|
|
@@ -20865,6 +21624,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
20865
21624
|
process.exit(code);
|
|
20866
21625
|
}
|
|
20867
21626
|
enqueueFsEvent(type, path6) {
|
|
21627
|
+
if (this.bulkRedirectsResolvedPath && (path6 === this.bulkRedirectsResolvedPath || path6.startsWith(this.bulkRedirectsResolvedPath + sep2))) {
|
|
21628
|
+
this.bulkRedirectsDirty = true;
|
|
21629
|
+
}
|
|
20868
21630
|
this.watchAggregationEvents.push({ type, path: path6 });
|
|
20869
21631
|
if (this.watchAggregationId === null) {
|
|
20870
21632
|
this.watchAggregationId = setTimeout(() => {
|
|
@@ -21068,7 +21830,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21068
21830
|
);
|
|
21069
21831
|
}
|
|
21070
21832
|
async getLocalEnv(fileName, base) {
|
|
21071
|
-
const filePath =
|
|
21833
|
+
const filePath = join4(this.cwd, fileName);
|
|
21072
21834
|
let env = {};
|
|
21073
21835
|
try {
|
|
21074
21836
|
const dotenv = await import_fs_extra.default.readFile(filePath, "utf8");
|
|
@@ -21122,7 +21884,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21122
21884
|
return void 0;
|
|
21123
21885
|
}
|
|
21124
21886
|
async _getVercelConfig() {
|
|
21125
|
-
const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-
|
|
21887
|
+
const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-FBOZBWJC.js");
|
|
21126
21888
|
await compileVercelConfig(this.cwd);
|
|
21127
21889
|
const configPath = getLocalPathConfig(this.cwd);
|
|
21128
21890
|
const [
|
|
@@ -21216,7 +21978,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21216
21978
|
vercelConfig.routes = routes;
|
|
21217
21979
|
} else if (hasResolvedServices && vercelConfig.proxy) {
|
|
21218
21980
|
const { entrypoint } = vercelConfig.proxy;
|
|
21219
|
-
if (!await import_fs_extra.default.pathExists(
|
|
21981
|
+
if (!await import_fs_extra.default.pathExists(join4(this.cwd, entrypoint))) {
|
|
21220
21982
|
output_manager_default.error(
|
|
21221
21983
|
`The proxy entrypoint \`${entrypoint}\` does not exist. Set \`proxy.entrypoint\` to an existing \`.js\` or \`.ts\` file.`
|
|
21222
21984
|
);
|
|
@@ -21297,20 +22059,59 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21297
22059
|
if (this.hasSubscribers()) {
|
|
21298
22060
|
Object.assign(runEnv, this.getDevQueueEnv());
|
|
21299
22061
|
}
|
|
22062
|
+
Object.assign(runEnv, this.getDevRuntimeCacheEnv(runEnv));
|
|
21300
22063
|
this.envConfigs = { buildEnv, runEnv, allEnv };
|
|
21301
22064
|
if (this.initialDevCommandStarted) {
|
|
21302
22065
|
await this.runDevCommand();
|
|
21303
22066
|
}
|
|
22067
|
+
await this.refreshBulkRedirects(vercelConfig.bulkRedirectsPath);
|
|
21304
22068
|
return vercelConfig;
|
|
21305
22069
|
}
|
|
22070
|
+
async refreshBulkRedirects(bulkRedirectsPath) {
|
|
22071
|
+
const configPath = bulkRedirectsPath ?? null;
|
|
22072
|
+
if (configPath === this.bulkRedirectsLastPath && !this.bulkRedirectsDirty) {
|
|
22073
|
+
return;
|
|
22074
|
+
}
|
|
22075
|
+
this.bulkRedirectsLastPath = configPath;
|
|
22076
|
+
this.bulkRedirectsDirty = false;
|
|
22077
|
+
this.bulkRedirectsResolvedPath = configPath ? resolveBulkRedirectsPath(this.cwd, configPath) : null;
|
|
22078
|
+
if (!configPath) {
|
|
22079
|
+
this.bulkRedirects = null;
|
|
22080
|
+
this.bulkRedirectsSignature = null;
|
|
22081
|
+
return;
|
|
22082
|
+
}
|
|
22083
|
+
const signature = await getBulkRedirectsSignature(this.cwd, configPath);
|
|
22084
|
+
if (signature === this.bulkRedirectsSignature) {
|
|
22085
|
+
return;
|
|
22086
|
+
}
|
|
22087
|
+
this.bulkRedirectsSignature = signature;
|
|
22088
|
+
try {
|
|
22089
|
+
const result = await loadBulkRedirects(this.cwd, configPath);
|
|
22090
|
+
this.bulkRedirects = result.table;
|
|
22091
|
+
for (const warning of result.warnings) {
|
|
22092
|
+
output_manager_default.warn(warning);
|
|
22093
|
+
}
|
|
22094
|
+
const count = result.table.size;
|
|
22095
|
+
if (count > 0) {
|
|
22096
|
+
output_manager_default.log(
|
|
22097
|
+
`Loaded ${count} bulk ${(0, import_pluralize2.default)("redirect", count)} from ${configPath}`
|
|
22098
|
+
);
|
|
22099
|
+
}
|
|
22100
|
+
} catch (err) {
|
|
22101
|
+
this.bulkRedirects = null;
|
|
22102
|
+
output_manager_default.warn(
|
|
22103
|
+
`Failed to load bulk redirects from "${configPath}": ${(0, import_error_utils.errorToString)(err)}`
|
|
22104
|
+
);
|
|
22105
|
+
}
|
|
22106
|
+
}
|
|
21306
22107
|
async readJsonFile(filePath) {
|
|
21307
22108
|
let rel, abs;
|
|
21308
|
-
if (
|
|
22109
|
+
if (isAbsolute3(filePath)) {
|
|
21309
22110
|
rel = path4.relative(this.cwd, filePath);
|
|
21310
22111
|
abs = filePath;
|
|
21311
22112
|
} else {
|
|
21312
22113
|
rel = filePath;
|
|
21313
|
-
abs =
|
|
22114
|
+
abs = join4(this.cwd, filePath);
|
|
21314
22115
|
}
|
|
21315
22116
|
output_manager_default.debug(`Reading \`${rel}\` file`);
|
|
21316
22117
|
try {
|
|
@@ -21455,7 +22256,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21455
22256
|
}
|
|
21456
22257
|
}
|
|
21457
22258
|
}
|
|
21458
|
-
this._address = new
|
|
22259
|
+
this._address = new URL2(replaceLocalhost(address));
|
|
22260
|
+
this.runtimeCache = new RuntimeCacheStore();
|
|
21459
22261
|
const vercelConfig = await this.getVercelConfig();
|
|
21460
22262
|
let devCommandPromise;
|
|
21461
22263
|
const startDevCommand = () => {
|
|
@@ -21679,6 +22481,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21679
22481
|
if (this.queueBroker) {
|
|
21680
22482
|
this.queueBroker.stop();
|
|
21681
22483
|
}
|
|
22484
|
+
if (this.runtimeCache) {
|
|
22485
|
+
this.runtimeCache.stop();
|
|
22486
|
+
this.runtimeCache = void 0;
|
|
22487
|
+
}
|
|
21682
22488
|
ops.push(close(this.server));
|
|
21683
22489
|
if (this.watcher) {
|
|
21684
22490
|
debug(`Closing file watcher`);
|
|
@@ -21725,7 +22531,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21725
22531
|
this.setResponseHeaders(res, requestId, headers);
|
|
21726
22532
|
const http_status_description = generateHttpStatusDescription(statusCode);
|
|
21727
22533
|
const error_code = errorCode || http_status_description;
|
|
21728
|
-
const
|
|
22534
|
+
const errorMessage2 = generateErrorMessage(statusCode, error_code);
|
|
21729
22535
|
let body;
|
|
21730
22536
|
const { accept = "text/plain" } = req.headers;
|
|
21731
22537
|
if (accept.includes("json")) {
|
|
@@ -21733,7 +22539,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21733
22539
|
const json = JSON.stringify({
|
|
21734
22540
|
error: {
|
|
21735
22541
|
code: statusCode,
|
|
21736
|
-
message:
|
|
22542
|
+
message: errorMessage2.title
|
|
21737
22543
|
}
|
|
21738
22544
|
});
|
|
21739
22545
|
body = `${json}
|
|
@@ -21743,7 +22549,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21743
22549
|
let view;
|
|
21744
22550
|
if (statusCode === 404) {
|
|
21745
22551
|
view = error_404({
|
|
21746
|
-
...
|
|
22552
|
+
...errorMessage2,
|
|
21747
22553
|
http_status_code: statusCode,
|
|
21748
22554
|
http_status_description,
|
|
21749
22555
|
error_code,
|
|
@@ -21751,7 +22557,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21751
22557
|
});
|
|
21752
22558
|
} else if (statusCode === 502) {
|
|
21753
22559
|
view = error_502({
|
|
21754
|
-
...
|
|
22560
|
+
...errorMessage2,
|
|
21755
22561
|
http_status_code: statusCode,
|
|
21756
22562
|
http_status_description,
|
|
21757
22563
|
error_code,
|
|
@@ -21772,7 +22578,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21772
22578
|
});
|
|
21773
22579
|
} else {
|
|
21774
22580
|
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
21775
|
-
body = `${
|
|
22581
|
+
body = `${errorMessage2.title}
|
|
21776
22582
|
|
|
21777
22583
|
${error_code}
|
|
21778
22584
|
`;
|
|
@@ -22061,7 +22867,7 @@ ${error_code}
|
|
|
22061
22867
|
base = rel.split("/")[0];
|
|
22062
22868
|
href = `/${prefix}${base}/`;
|
|
22063
22869
|
} else {
|
|
22064
|
-
ext =
|
|
22870
|
+
ext = extname2(p).substring(1);
|
|
22065
22871
|
href = `/${prefix}${base}`;
|
|
22066
22872
|
}
|
|
22067
22873
|
return {
|
|
@@ -22148,6 +22954,7 @@ ${error_code}
|
|
|
22148
22954
|
PORT: `${port}`
|
|
22149
22955
|
}
|
|
22150
22956
|
);
|
|
22957
|
+
Object.assign(env, this.getDevRuntimeCacheEnv(env));
|
|
22151
22958
|
const nodeBinPaths = getNodeBinPaths2({ base: this.repoRoot, start: cwd });
|
|
22152
22959
|
const nodeBinPath = nodeBinPaths.join(path4.delimiter);
|
|
22153
22960
|
env.PATH = `${nodeBinPath}${path4.delimiter}${env.PATH}`;
|
|
@@ -22228,12 +23035,12 @@ function serveStaticFile(req, res, cwd, opts) {
|
|
|
22228
23035
|
});
|
|
22229
23036
|
}
|
|
22230
23037
|
function close(server) {
|
|
22231
|
-
return new Promise((
|
|
23038
|
+
return new Promise((resolve3, reject) => {
|
|
22232
23039
|
server.close((err) => {
|
|
22233
23040
|
if (err) {
|
|
22234
23041
|
reject(err);
|
|
22235
23042
|
} else {
|
|
22236
|
-
|
|
23043
|
+
resolve3();
|
|
22237
23044
|
}
|
|
22238
23045
|
});
|
|
22239
23046
|
});
|
|
@@ -22265,7 +23072,7 @@ async function findBuildMatch(matches, files, requestPath, devServer, vercelConf
|
|
|
22265
23072
|
if (!isIndex(match.src)) {
|
|
22266
23073
|
return match;
|
|
22267
23074
|
} else {
|
|
22268
|
-
if (
|
|
23075
|
+
if (extname2(match.src) === ".html") {
|
|
22269
23076
|
return match;
|
|
22270
23077
|
}
|
|
22271
23078
|
bestIndexMatch = match;
|
|
@@ -22357,7 +23164,7 @@ function dirnameWithoutDot(path6) {
|
|
|
22357
23164
|
return dir;
|
|
22358
23165
|
}
|
|
22359
23166
|
function isIndex(path6) {
|
|
22360
|
-
const ext =
|
|
23167
|
+
const ext = extname2(path6);
|
|
22361
23168
|
const name = basename(path6, ext);
|
|
22362
23169
|
return name === "index";
|
|
22363
23170
|
}
|
|
@@ -22395,21 +23202,21 @@ function buildMatchEquals(a, b) {
|
|
|
22395
23202
|
}
|
|
22396
23203
|
|
|
22397
23204
|
// src/util/env/refresh-oidc-token.ts
|
|
22398
|
-
var
|
|
23205
|
+
var import_ms6 = __toESM(require_ms(), 1);
|
|
22399
23206
|
import { setTimeout as setTimeout2 } from "timers/promises";
|
|
22400
23207
|
import { decodeJwt } from "jose";
|
|
22401
23208
|
import { performance } from "perf_hooks";
|
|
22402
23209
|
var REFRESH_BEFORE_EXPIRY_MILLIS = getMs(
|
|
22403
|
-
(0,
|
|
23210
|
+
(0, import_ms6.default)("15m"),
|
|
22404
23211
|
process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS
|
|
22405
23212
|
);
|
|
22406
23213
|
var THROTTLE_MILLIS = getMs(
|
|
22407
|
-
(0,
|
|
23214
|
+
(0, import_ms6.default)("1m"),
|
|
22408
23215
|
process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS
|
|
22409
23216
|
);
|
|
22410
23217
|
function getMs(defaultValue, overrideValue) {
|
|
22411
23218
|
if (overrideValue) {
|
|
22412
|
-
const result = (0,
|
|
23219
|
+
const result = (0, import_ms6.default)(overrideValue);
|
|
22413
23220
|
if (Number.isFinite(result) && result > 0)
|
|
22414
23221
|
return result;
|
|
22415
23222
|
}
|
|
@@ -22494,8 +23301,8 @@ function millisToSecs(millis) {
|
|
|
22494
23301
|
}
|
|
22495
23302
|
|
|
22496
23303
|
// src/util/dev/dev-lock.ts
|
|
22497
|
-
import { join as
|
|
22498
|
-
import { mkdir, open, unlink, readFile } from "fs/promises";
|
|
23304
|
+
import { join as join5 } from "path";
|
|
23305
|
+
import { mkdir, open, unlink, readFile as readFile2 } from "fs/promises";
|
|
22499
23306
|
import { unlinkSync as unlinkSync2, constants } from "fs";
|
|
22500
23307
|
var DEV_LOCK_FILE = "dev.lock";
|
|
22501
23308
|
function isProcessRunning(pid) {
|
|
@@ -22524,15 +23331,15 @@ async function tryCreateLockFile(lockPath, content) {
|
|
|
22524
23331
|
}
|
|
22525
23332
|
async function tryReadLockFile(lockPath) {
|
|
22526
23333
|
try {
|
|
22527
|
-
const content = await
|
|
23334
|
+
const content = await readFile2(lockPath, "utf8");
|
|
22528
23335
|
return JSON.parse(content);
|
|
22529
23336
|
} catch {
|
|
22530
23337
|
return null;
|
|
22531
23338
|
}
|
|
22532
23339
|
}
|
|
22533
23340
|
async function acquireDevLock(projectRoot, port) {
|
|
22534
|
-
const vercelDir =
|
|
22535
|
-
const lockPath =
|
|
23341
|
+
const vercelDir = join5(projectRoot, VERCEL_DIR);
|
|
23342
|
+
const lockPath = join5(vercelDir, DEV_LOCK_FILE);
|
|
22536
23343
|
await mkdir(vercelDir, { recursive: true });
|
|
22537
23344
|
const lockData = {
|
|
22538
23345
|
pid: process.pid,
|
|
@@ -22580,7 +23387,7 @@ async function acquireDevLock(projectRoot, port) {
|
|
|
22580
23387
|
};
|
|
22581
23388
|
}
|
|
22582
23389
|
function releaseDevLock(projectRoot) {
|
|
22583
|
-
const lockPath =
|
|
23390
|
+
const lockPath = join5(projectRoot, VERCEL_DIR, DEV_LOCK_FILE);
|
|
22584
23391
|
try {
|
|
22585
23392
|
unlinkSync2(lockPath);
|
|
22586
23393
|
} catch (err) {
|
|
@@ -22591,7 +23398,7 @@ function releaseDevLock(projectRoot) {
|
|
|
22591
23398
|
// src/commands/dev/dev.ts
|
|
22592
23399
|
async function dev(client, opts, args2, telemetry, localConfig) {
|
|
22593
23400
|
const [dir = "."] = args2;
|
|
22594
|
-
let cwd =
|
|
23401
|
+
let cwd = resolve2(dir);
|
|
22595
23402
|
const listen2 = parseListen(opts["--listen"] || "3000");
|
|
22596
23403
|
cwd = await resolveProjectCwd(cwd);
|
|
22597
23404
|
const projectNameOrId = opts["--project"];
|
|
@@ -22678,7 +23485,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
|
|
|
22678
23485
|
projectId = project.id;
|
|
22679
23486
|
orgId = org.id;
|
|
22680
23487
|
if (project.rootDirectory) {
|
|
22681
|
-
cwd =
|
|
23488
|
+
cwd = join6(cwd, project.rootDirectory);
|
|
22682
23489
|
}
|
|
22683
23490
|
envValues = (await pullEnvRecords(client, project.id, "vercel-cli:dev")).env;
|
|
22684
23491
|
}
|
|
@@ -22719,7 +23526,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
|
|
|
22719
23526
|
);
|
|
22720
23527
|
if (lockResult.existingLock) {
|
|
22721
23528
|
const { existingLock } = lockResult;
|
|
22722
|
-
const startTime = (0,
|
|
23529
|
+
const startTime = (0, import_ms7.default)(Date.now() - existingLock.startedAt);
|
|
22723
23530
|
output_manager_default.print(` Port: ${import_chalk3.default.cyan(existingLock.port)}
|
|
22724
23531
|
`);
|
|
22725
23532
|
output_manager_default.print(` PID: ${import_chalk3.default.cyan(existingLock.pid)}
|
|
@@ -22814,7 +23621,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
|
|
|
22814
23621
|
process.on("SIGINT", async () => await cleanup("SIGINT"));
|
|
22815
23622
|
process.on("SIGHUP", async () => await cleanup("SIGHUP"));
|
|
22816
23623
|
if (!devServer.devCommand) {
|
|
22817
|
-
const outputDir =
|
|
23624
|
+
const outputDir = join6(cwd, import_write_build_result.OUTPUT_DIR);
|
|
22818
23625
|
if (await import_fs_extra2.default.pathExists(outputDir)) {
|
|
22819
23626
|
output_manager_default.log(`Removing ${import_write_build_result.OUTPUT_DIR}`);
|
|
22820
23627
|
await import_fs_extra2.default.remove(outputDir);
|