vercel 59.5.0 → 59.6.2
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-W3FFMTX4.js → add-4GQZ22ZN.js} +11 -11
- package/dist/chunks/{add-MH3WV6PV.js → add-HJSEM4YJ.js} +11 -11
- package/dist/chunks/{add-Z5FM6TFI.js → add-SIGUSM3Y.js} +12 -12
- package/dist/chunks/{build-VYYFBJL7.js → build-XOMJDX4M.js} +11 -11
- package/dist/chunks/{chunk-NSU2BTRS.js → chunk-2O5J3KMT.js} +4 -4
- package/dist/chunks/{chunk-RZ5NP6HN.js → chunk-2YRAWYGE.js} +1 -1
- package/dist/chunks/{chunk-JNU3DTEV.js → chunk-37V5P4VO.js} +9 -9
- package/dist/chunks/{chunk-LLM3ZNXJ.js → chunk-3F5EGINT.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-AWSLWAOC.js → chunk-6JPVTPTU.js} +3 -3
- package/dist/chunks/{chunk-M3OSDZPY.js → chunk-6M2KZUED.js} +16 -7
- 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-V4YLY44R.js → chunk-7R6M3BHM.js} +2 -2
- package/dist/chunks/{chunk-XBN2O34P.js → chunk-7ST552E3.js} +17 -4
- 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-UUVMIXT4.js → chunk-DE7MBNHQ.js} +4 -4
- package/dist/chunks/{chunk-YIHOS3ZF.js → chunk-FRAXI2WT.js} +1 -1
- package/dist/chunks/{chunk-FA3MO56Q.js → chunk-FRZULOVH.js} +5 -5
- 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-TIWAL2YU.js → chunk-GISTGGBO.js} +6 -6
- package/dist/chunks/{chunk-CSCSGSQG.js → chunk-GZQQNLF5.js} +5 -5
- package/dist/chunks/{chunk-PIMIKY4X.js → chunk-IJ4X426J.js} +1 -1
- package/dist/chunks/{chunk-TDXNNIZ6.js → chunk-JH4WQRIU.js} +2 -2
- package/dist/chunks/{chunk-TVXCXIRO.js → chunk-L3UXB2CW.js} +1 -1
- package/dist/chunks/{chunk-4JTF6RD7.js → chunk-LXZVOR6F.js} +4 -4
- package/dist/chunks/{chunk-L7CEMAJG.js → chunk-NGGLYKNU.js} +27 -5
- package/dist/chunks/{chunk-VWYNSJXI.js → chunk-NGNN6WF2.js} +8 -8
- package/dist/chunks/{chunk-GGPE5377.js → chunk-O26N2UPI.js} +1 -1
- package/dist/chunks/{chunk-5LX2JDZP.js → chunk-O75LSD3C.js} +1 -1
- package/dist/chunks/{chunk-MRMNMFMD.js → chunk-PRH6KRUT.js} +1 -1
- package/dist/chunks/{chunk-OX7KI3LF.js → chunk-QFAS4OVW.js} +18 -0
- package/dist/chunks/{chunk-PBHBX6UL.js → chunk-R5PULMHT.js} +3 -3
- package/dist/chunks/{chunk-PPUWG2UB.js → chunk-SF3AYAIF.js} +58 -25
- package/dist/chunks/{chunk-TAZ5ZAKG.js → chunk-SWI6F4X3.js} +2 -2
- package/dist/chunks/{chunk-ZKUHCL6O.js → chunk-V3MDDR2X.js} +5 -5
- package/dist/chunks/{chunk-E6LFKMI2.js → chunk-VJ5NAOWB.js} +791 -122
- package/dist/chunks/{chunk-G75NFPIT.js → chunk-WNAKOXGK.js} +1 -1
- package/dist/chunks/{chunk-JJQP3PYM.js → chunk-WZ2S3A2A.js} +5 -5
- package/dist/chunks/{chunk-CYNB6LL4.js → chunk-XNFHNTS2.js} +1 -1
- package/dist/chunks/{chunk-47VQ6H2S.js → chunk-YJKZQEHS.js} +2 -2
- package/dist/chunks/{chunk-GUWPUX2Y.js → chunk-ZNMTDLYH.js} +4 -4
- package/dist/chunks/{chunk-VLPLCJZC.js → chunk-ZSFEACZU.js} +1 -1
- package/dist/chunks/{clear-TNGRDA7D.js → clear-BWT2FJY4.js} +11 -11
- package/dist/chunks/{compile-vercel-config-ERLXKKWW.js → compile-vercel-config-DGM4NISW.js} +7 -7
- package/dist/chunks/{config-H22EE765.js → config-NJAN3RMU.js} +11 -11
- package/dist/chunks/{config-7EDKML5Q.js → config-RSE6Z4LB.js} +9 -9
- package/dist/chunks/{constants-YMCRE6IG.js → constants-WEQVJSYS.js} +1 -1
- package/dist/chunks/{delete-Q4S5F2AI.js → delete-LROBRBAH.js} +9 -9
- package/dist/chunks/{delete-LORYIZHY.js → delete-SSL2PK2F.js} +8 -8
- package/dist/chunks/{disable-HKWCBDJC.js → disable-ASG5JDZR.js} +8 -8
- package/dist/chunks/{discard-UCCRF2JQ.js → discard-PV47B6IL.js} +8 -8
- package/dist/chunks/{edit-AWL35PYQ.js → edit-5ATYIOLX.js} +10 -10
- package/dist/chunks/{edit-6IM6VRBR.js → edit-REI7HXGG.js} +10 -10
- package/dist/chunks/{enable-GN3D3L3V.js → enable-LZXL7XAG.js} +8 -8
- package/dist/chunks/{exec-CNBOV577.js → exec-XH4K34JM.js} +3 -3
- package/dist/chunks/{export-HHRVFALV.js → export-ZAZFQU2E.js} +8 -8
- package/dist/chunks/{image-4DCU4VPP.js → image-QPHN5V7L.js} +6 -6
- package/dist/chunks/{import-builders-DVG3HOTF.js → import-builders-W3YE2V6A.js} +9 -9
- package/dist/chunks/{inspect-TUW67CFZ.js → inspect-BFGK72WY.js} +10 -10
- package/dist/chunks/{inspect-TGOJDKIT.js → inspect-FRXJRM6T.js} +9 -9
- package/dist/chunks/{inspect-B3OWUFLH.js → inspect-RDMC2Z3Q.js} +11 -11
- package/dist/chunks/{inspect-VPME6UC7.js → inspect-SJEZVGPK.js} +11 -11
- package/dist/chunks/{inspect-VLGKNHJW.js → inspect-SSOM3FXS.js} +11 -11
- package/dist/chunks/{list-K552ITMK.js → list-2HTR7Q3J.js} +9 -9
- package/dist/chunks/{list-TK2JO7BK.js → list-PHDUZVMR.js} +8 -8
- package/dist/chunks/{list-2DPKDHRV.js → list-W33GXKDA.js} +10 -10
- package/dist/chunks/{login-HRWEKW5P.js → login-JWAFHVDG.js} +21 -12
- package/dist/chunks/{ls-M5TYGFP5.js → ls-3AN2DZHN.js} +11 -11
- package/dist/chunks/{ls-YIF3KLF3.js → ls-3MH2OCP3.js} +11 -11
- package/dist/chunks/{ls-TM6NTZEB.js → ls-D2POUHI7.js} +9 -9
- package/dist/chunks/{ls-JSV2WZVF.js → ls-KDFU224B.js} +11 -11
- package/dist/chunks/{ls-IOXGXEY4.js → ls-KX2VBOGV.js} +10 -10
- package/dist/chunks/{ls-O2WYF5UL.js → ls-RWKNJQNT.js} +11 -11
- package/dist/chunks/{open-FWAVEWGU.js → open-IEYRB6RL.js} +9 -9
- package/dist/chunks/{permissions-DPFYL47Z.js → permissions-ZWZUMEHR.js} +7 -7
- package/dist/chunks/{publish-63CGFKQR.js → publish-UWZYBDHK.js} +8 -8
- package/dist/chunks/{push-T5ZTBW3P.js → push-IAEQ3FBF.js} +11 -11
- package/dist/chunks/{query-B6O3EMEV.js → query-NNOZYSED.js} +11 -11
- package/dist/chunks/{reorder-ANV4NMKH.js → reorder-TKBM244W.js} +8 -8
- package/dist/chunks/{reply-C73KGOCG.js → reply-FLBSBMTW.js} +10 -10
- package/dist/chunks/{resolve-IHSIVPEE.js → resolve-GJYPMWUE.js} +9 -9
- package/dist/chunks/{restore-GSUNXP2O.js → restore-PNI3TM3U.js} +8 -8
- package/dist/chunks/{rm-4O74PS4Q.js → rm-76CSSSSV.js} +11 -11
- package/dist/chunks/{rm-M7IJC2WZ.js → rm-FN7LTIIL.js} +11 -11
- package/dist/chunks/{rm-YDTK5ESZ.js → rm-FTE33UHE.js} +10 -10
- package/dist/chunks/{rm-RV5SQFQA.js → rm-FXA5DLXQ.js} +11 -13
- package/dist/chunks/{rm-PRINF4OU.js → rm-PGJ4KR6U.js} +11 -11
- package/dist/chunks/{routes-SZI2G4SE.js → routes-2OLIBRYX.js} +3 -3
- package/dist/chunks/{rule-inspect-ZZC53FLP.js → rule-inspect-LJIGPTWS.js} +10 -10
- package/dist/chunks/{rules-SAOSSGFI.js → rules-6BMNO6M5.js} +10 -10
- package/dist/chunks/{schema-23ZFAKDU.js → schema-45SJNY5L.js} +4 -4
- package/dist/chunks/{schema-2Q3QRMRO.js → schema-HATXEQDP.js} +9 -9
- package/dist/chunks/{set-L47ZCZBJ.js → set-C3UQUQ42.js} +9 -9
- package/dist/chunks/{tags-2TWLM77N.js → tags-BTVDROFG.js} +5 -5
- package/dist/chunks/{types-G3PEUIJH.js → types-JGANJ5EQ.js} +3 -3
- package/dist/chunks/{update-SZH2VBD6.js → update-B6PSOHUW.js} +12 -12
- package/dist/commands/build/builder-worker.cjs +281 -0
- package/dist/commands/build/index.js +690 -235
- package/dist/commands/deploy/index.js +103 -31
- package/dist/commands/dev/index.js +669 -140
- 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 +1978 -953
- package/dist/index.js +18 -18
- package/dist/version.mjs +1 -1
- package/package.json +47 -47
- 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-3F5EGINT.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-SWI6F4X3.js";
|
|
30
30
|
import {
|
|
31
31
|
importBuilders,
|
|
32
32
|
require_npa
|
|
33
|
-
} from "../../chunks/chunk-
|
|
33
|
+
} from "../../chunks/chunk-WZ2S3A2A.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-JH4WQRIU.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-VJ5NAOWB.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
|
}
|
|
@@ -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 {
|
|
@@ -16762,13 +16762,13 @@ var import_ms6 = __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
16769
|
var import_ms4 = __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
16791
|
function sleep(ms7) {
|
|
16792
|
-
return new Promise((
|
|
16792
|
+
return new Promise((resolve3) => setTimeout(resolve3, ms7));
|
|
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 = [
|
|
@@ -18429,7 +18436,7 @@ function waitForExit(pid, proc, timeoutMs) {
|
|
|
18429
18436
|
if (!isProcessAlive(pid)) {
|
|
18430
18437
|
return Promise.resolve(true);
|
|
18431
18438
|
}
|
|
18432
|
-
return new Promise((
|
|
18439
|
+
return new Promise((resolve3) => {
|
|
18433
18440
|
let settled = false;
|
|
18434
18441
|
const finish = (died) => {
|
|
18435
18442
|
if (settled)
|
|
@@ -18439,7 +18446,7 @@ function waitForExit(pid, proc, timeoutMs) {
|
|
|
18439
18446
|
clearTimeout(deadline);
|
|
18440
18447
|
if (proc)
|
|
18441
18448
|
proc.removeListener("exit", onExit);
|
|
18442
|
-
|
|
18449
|
+
resolve3(died);
|
|
18443
18450
|
};
|
|
18444
18451
|
const onExit = () => finish(true);
|
|
18445
18452
|
if (proc)
|
|
@@ -18576,13 +18583,13 @@ var ServicesOrchestrator = class {
|
|
|
18576
18583
|
this.cronTimers = [];
|
|
18577
18584
|
let timedOut = false;
|
|
18578
18585
|
let timeoutHandle;
|
|
18579
|
-
const timeout = new Promise((
|
|
18586
|
+
const timeout = new Promise((resolve3) => {
|
|
18580
18587
|
timeoutHandle = setTimeout(() => {
|
|
18581
18588
|
timedOut = true;
|
|
18582
18589
|
output_manager_default.debug(
|
|
18583
18590
|
`stopAll timed out after ${STOP_ALL_TIMEOUT_MS}ms; remaining processes will be SIGKILLed on exit`
|
|
18584
18591
|
);
|
|
18585
|
-
|
|
18592
|
+
resolve3();
|
|
18586
18593
|
}, STOP_ALL_TIMEOUT_MS);
|
|
18587
18594
|
});
|
|
18588
18595
|
try {
|
|
@@ -19037,7 +19044,7 @@ var ServicesOrchestrator = class {
|
|
|
19037
19044
|
}
|
|
19038
19045
|
async runInstallCommand(command, workspacePath, logger) {
|
|
19039
19046
|
await this.runBuffered(logger, (stdout, stderr) => {
|
|
19040
|
-
return new Promise((
|
|
19047
|
+
return new Promise((resolve3, reject) => {
|
|
19041
19048
|
output_manager_default.debug(
|
|
19042
19049
|
`Running install command: "${command}" in ${workspacePath}`
|
|
19043
19050
|
);
|
|
@@ -19050,7 +19057,7 @@ var ServicesOrchestrator = class {
|
|
|
19050
19057
|
child.on("error", reject);
|
|
19051
19058
|
child.on("exit", (code, signal) => {
|
|
19052
19059
|
if (code === 0) {
|
|
19053
|
-
|
|
19060
|
+
resolve3();
|
|
19054
19061
|
} else {
|
|
19055
19062
|
reject(
|
|
19056
19063
|
new NowBuildError({
|
|
@@ -19766,6 +19773,458 @@ function replaceLocalhost(address) {
|
|
|
19766
19773
|
return address.replace("[::]", "localhost").replace("0.0.0.0", "localhost");
|
|
19767
19774
|
}
|
|
19768
19775
|
|
|
19776
|
+
// src/util/dev/bulk-redirects.ts
|
|
19777
|
+
import { lstat, readdir, readFile, stat } from "fs/promises";
|
|
19778
|
+
import { extname, isAbsolute as isAbsolute2, join as join3, relative as relative3, resolve } from "path";
|
|
19779
|
+
import { parse as parseUrl } from "url";
|
|
19780
|
+
var MAX_REDIRECTS = 1e6;
|
|
19781
|
+
var MAX_FILES = 100;
|
|
19782
|
+
var MAX_URL_LENGTH = 2048;
|
|
19783
|
+
var VALID_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
19784
|
+
var SUPPORTED_EXTENSIONS = /* @__PURE__ */ new Set([".csv", ".json", ".jsonl"]);
|
|
19785
|
+
var BulkRedirectTable = class {
|
|
19786
|
+
constructor() {
|
|
19787
|
+
this.caseSensitiveByHostPath = /* @__PURE__ */ new Map();
|
|
19788
|
+
this.caseInsensitiveByHostPath = /* @__PURE__ */ new Map();
|
|
19789
|
+
this.caseSensitiveByPath = /* @__PURE__ */ new Map();
|
|
19790
|
+
this.caseInsensitiveByPath = /* @__PURE__ */ new Map();
|
|
19791
|
+
}
|
|
19792
|
+
get size() {
|
|
19793
|
+
return this.caseSensitiveByHostPath.size + this.caseInsensitiveByHostPath.size + this.caseSensitiveByPath.size + this.caseInsensitiveByPath.size;
|
|
19794
|
+
}
|
|
19795
|
+
add(redirect2) {
|
|
19796
|
+
const { host, pathname } = parseSource(redirect2.source);
|
|
19797
|
+
const stored = {
|
|
19798
|
+
destination: redirect2.destination,
|
|
19799
|
+
statusCode: redirect2.statusCode,
|
|
19800
|
+
preserveQueryParams: redirect2.preserveQueryParams
|
|
19801
|
+
};
|
|
19802
|
+
if (host) {
|
|
19803
|
+
const key = hostPathKey(host, pathname);
|
|
19804
|
+
if (redirect2.caseSensitive) {
|
|
19805
|
+
this.caseSensitiveByHostPath.set(key, stored);
|
|
19806
|
+
} else {
|
|
19807
|
+
this.caseInsensitiveByHostPath.set(key.toLowerCase(), stored);
|
|
19808
|
+
}
|
|
19809
|
+
return;
|
|
19810
|
+
}
|
|
19811
|
+
if (redirect2.caseSensitive) {
|
|
19812
|
+
this.caseSensitiveByPath.set(pathname, stored);
|
|
19813
|
+
} else {
|
|
19814
|
+
this.caseInsensitiveByPath.set(pathname.toLowerCase(), stored);
|
|
19815
|
+
}
|
|
19816
|
+
}
|
|
19817
|
+
lookup(pathname, host) {
|
|
19818
|
+
const hostname = host ? hostnameFromHostHeader(host) : "";
|
|
19819
|
+
if (hostname) {
|
|
19820
|
+
const hostKey = hostPathKey(hostname, pathname);
|
|
19821
|
+
const hostMatch = this.caseSensitiveByHostPath.get(hostKey) || this.caseInsensitiveByHostPath.get(hostKey.toLowerCase());
|
|
19822
|
+
if (hostMatch) {
|
|
19823
|
+
return hostMatch;
|
|
19824
|
+
}
|
|
19825
|
+
}
|
|
19826
|
+
return this.caseSensitiveByPath.get(pathname) || this.caseInsensitiveByPath.get(pathname.toLowerCase());
|
|
19827
|
+
}
|
|
19828
|
+
};
|
|
19829
|
+
async function getBulkRedirectsSignature(cwd, bulkRedirectsPath) {
|
|
19830
|
+
if (!bulkRedirectsPath) {
|
|
19831
|
+
return "";
|
|
19832
|
+
}
|
|
19833
|
+
const resolved = resolveBulkRedirectsPath(cwd, bulkRedirectsPath);
|
|
19834
|
+
if (!resolved) {
|
|
19835
|
+
return `invalid:${bulkRedirectsPath}`;
|
|
19836
|
+
}
|
|
19837
|
+
try {
|
|
19838
|
+
const stats = await stat(resolved);
|
|
19839
|
+
if (stats.isFile()) {
|
|
19840
|
+
return `file:${resolved}:${stats.mtimeMs}:${stats.size}`;
|
|
19841
|
+
}
|
|
19842
|
+
if (!stats.isDirectory()) {
|
|
19843
|
+
return `other:${resolved}:${stats.mtimeMs}`;
|
|
19844
|
+
}
|
|
19845
|
+
const files = await listRedirectFiles(resolved);
|
|
19846
|
+
const parts = await Promise.all(
|
|
19847
|
+
files.map(async (file) => {
|
|
19848
|
+
try {
|
|
19849
|
+
const fileStats = await stat(file);
|
|
19850
|
+
return `${file}:${fileStats.mtimeMs}:${fileStats.size}`;
|
|
19851
|
+
} catch {
|
|
19852
|
+
return `${file}:missing`;
|
|
19853
|
+
}
|
|
19854
|
+
})
|
|
19855
|
+
);
|
|
19856
|
+
return `dir:${resolved}:${parts.join("|")}`;
|
|
19857
|
+
} catch {
|
|
19858
|
+
return `missing:${resolved}`;
|
|
19859
|
+
}
|
|
19860
|
+
}
|
|
19861
|
+
async function loadBulkRedirects(cwd, bulkRedirectsPath) {
|
|
19862
|
+
const warnings = [];
|
|
19863
|
+
const table = new BulkRedirectTable();
|
|
19864
|
+
const resolved = resolveBulkRedirectsPath(cwd, bulkRedirectsPath);
|
|
19865
|
+
if (!resolved) {
|
|
19866
|
+
warnings.push(
|
|
19867
|
+
`Skipping bulk redirects path "${bulkRedirectsPath}" because it resolves outside the project directory.`
|
|
19868
|
+
);
|
|
19869
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
19870
|
+
}
|
|
19871
|
+
let files;
|
|
19872
|
+
try {
|
|
19873
|
+
const stats = await stat(resolved);
|
|
19874
|
+
if (stats.isDirectory()) {
|
|
19875
|
+
files = await listRedirectFiles(resolved);
|
|
19876
|
+
if (files.length > MAX_FILES) {
|
|
19877
|
+
warnings.push(
|
|
19878
|
+
`Bulk redirects directory "${bulkRedirectsPath}" has ${files.length} files; only the first ${MAX_FILES} will be used.`
|
|
19879
|
+
);
|
|
19880
|
+
files = files.slice(0, MAX_FILES);
|
|
19881
|
+
}
|
|
19882
|
+
} else if (stats.isFile()) {
|
|
19883
|
+
const ext = extname(resolved).toLowerCase();
|
|
19884
|
+
if (!SUPPORTED_EXTENSIONS.has(ext)) {
|
|
19885
|
+
warnings.push(
|
|
19886
|
+
`Bulk redirects file "${bulkRedirectsPath}" must be a .csv, .json, or .jsonl file.`
|
|
19887
|
+
);
|
|
19888
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
19889
|
+
}
|
|
19890
|
+
files = [resolved];
|
|
19891
|
+
} else {
|
|
19892
|
+
warnings.push(
|
|
19893
|
+
`Bulk redirects path "${bulkRedirectsPath}" is not a file or directory.`
|
|
19894
|
+
);
|
|
19895
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
19896
|
+
}
|
|
19897
|
+
} catch (err) {
|
|
19898
|
+
if (isNotFound(err)) {
|
|
19899
|
+
warnings.push(
|
|
19900
|
+
`Bulk redirects path "${bulkRedirectsPath}" was not found.`
|
|
19901
|
+
);
|
|
19902
|
+
return { table, redirectCount: 0, fileCount: 0, warnings };
|
|
19903
|
+
}
|
|
19904
|
+
throw err;
|
|
19905
|
+
}
|
|
19906
|
+
let redirectCount = 0;
|
|
19907
|
+
for (const file of files) {
|
|
19908
|
+
if (redirectCount >= MAX_REDIRECTS) {
|
|
19909
|
+
warnings.push(
|
|
19910
|
+
`Bulk redirects limit of ${MAX_REDIRECTS} reached; remaining entries were skipped.`
|
|
19911
|
+
);
|
|
19912
|
+
break;
|
|
19913
|
+
}
|
|
19914
|
+
const remaining = MAX_REDIRECTS - redirectCount;
|
|
19915
|
+
const parsed = await parseRedirectFile(file, remaining, warnings, cwd);
|
|
19916
|
+
for (const redirect2 of parsed) {
|
|
19917
|
+
table.add(redirect2);
|
|
19918
|
+
redirectCount++;
|
|
19919
|
+
}
|
|
19920
|
+
}
|
|
19921
|
+
const duplicateCount = redirectCount - table.size;
|
|
19922
|
+
if (duplicateCount > 0) {
|
|
19923
|
+
warnings.push(
|
|
19924
|
+
`Bulk redirects contain ${duplicateCount} duplicate ${duplicateCount === 1 ? "source" : "sources"}; the last occurrence wins.`
|
|
19925
|
+
);
|
|
19926
|
+
}
|
|
19927
|
+
return {
|
|
19928
|
+
table,
|
|
19929
|
+
redirectCount,
|
|
19930
|
+
fileCount: files.length,
|
|
19931
|
+
warnings
|
|
19932
|
+
};
|
|
19933
|
+
}
|
|
19934
|
+
function resolveBulkRedirect(table, reqUrl, host) {
|
|
19935
|
+
const parsed = parseUrl(reqUrl);
|
|
19936
|
+
const match = table.lookup(parsed.pathname || "/", host);
|
|
19937
|
+
if (!match) {
|
|
19938
|
+
return void 0;
|
|
19939
|
+
}
|
|
19940
|
+
let location = match.destination;
|
|
19941
|
+
if (match.preserveQueryParams && parsed.search) {
|
|
19942
|
+
location = appendQueryParams(location, parsed.search);
|
|
19943
|
+
}
|
|
19944
|
+
return { location, statusCode: match.statusCode };
|
|
19945
|
+
}
|
|
19946
|
+
function appendQueryParams(destination, search) {
|
|
19947
|
+
const query = search.startsWith("?") ? search.slice(1) : search;
|
|
19948
|
+
if (!query) {
|
|
19949
|
+
return destination;
|
|
19950
|
+
}
|
|
19951
|
+
return destination.includes("?") ? `${destination}&${query}` : `${destination}?${query}`;
|
|
19952
|
+
}
|
|
19953
|
+
function resolveBulkRedirectsPath(cwd, bulkRedirectsPath) {
|
|
19954
|
+
const projectRoot = resolve(cwd);
|
|
19955
|
+
const resolved = resolve(projectRoot, bulkRedirectsPath);
|
|
19956
|
+
const relativeFromRoot = relative3(projectRoot, resolved);
|
|
19957
|
+
if (relativeFromRoot.startsWith("..") || isAbsolute2(relativeFromRoot)) {
|
|
19958
|
+
return null;
|
|
19959
|
+
}
|
|
19960
|
+
return resolved;
|
|
19961
|
+
}
|
|
19962
|
+
async function listRedirectFiles(dir) {
|
|
19963
|
+
const files = [];
|
|
19964
|
+
await walk(dir, files);
|
|
19965
|
+
files.sort();
|
|
19966
|
+
return files;
|
|
19967
|
+
}
|
|
19968
|
+
async function walk(dir, files) {
|
|
19969
|
+
const entries = await readdir(dir);
|
|
19970
|
+
for (const entry of entries) {
|
|
19971
|
+
const fullPath = join3(dir, entry);
|
|
19972
|
+
const stats = await lstat(fullPath);
|
|
19973
|
+
if (stats.isDirectory()) {
|
|
19974
|
+
await walk(fullPath, files);
|
|
19975
|
+
} else if (stats.isFile() && SUPPORTED_EXTENSIONS.has(extname(fullPath).toLowerCase())) {
|
|
19976
|
+
files.push(fullPath);
|
|
19977
|
+
}
|
|
19978
|
+
}
|
|
19979
|
+
}
|
|
19980
|
+
async function parseRedirectFile(file, remaining, warnings, cwd) {
|
|
19981
|
+
const rel = relative3(cwd, file) || file;
|
|
19982
|
+
const ext = extname(file).toLowerCase();
|
|
19983
|
+
let content;
|
|
19984
|
+
try {
|
|
19985
|
+
content = stripBom(await readFile(file, "utf8"));
|
|
19986
|
+
} catch (err) {
|
|
19987
|
+
warnings.push(
|
|
19988
|
+
`Failed to read bulk redirects file "${rel}": ${errorMessage(err)}`
|
|
19989
|
+
);
|
|
19990
|
+
return [];
|
|
19991
|
+
}
|
|
19992
|
+
try {
|
|
19993
|
+
if (ext === ".csv") {
|
|
19994
|
+
return parseCsvRedirects(content, remaining, warnings, rel);
|
|
19995
|
+
}
|
|
19996
|
+
if (ext === ".jsonl") {
|
|
19997
|
+
return parseJsonlRedirects(content, remaining, warnings, rel);
|
|
19998
|
+
}
|
|
19999
|
+
return parseJsonRedirects(content, remaining, warnings, rel);
|
|
20000
|
+
} catch (err) {
|
|
20001
|
+
warnings.push(
|
|
20002
|
+
`Failed to parse bulk redirects file "${rel}": ${errorMessage(err)}`
|
|
20003
|
+
);
|
|
20004
|
+
return [];
|
|
20005
|
+
}
|
|
20006
|
+
}
|
|
20007
|
+
function parseJsonRedirects(content, remaining, warnings, rel) {
|
|
20008
|
+
const parsed = JSON.parse(content);
|
|
20009
|
+
if (!Array.isArray(parsed)) {
|
|
20010
|
+
warnings.push(
|
|
20011
|
+
`Bulk redirects file "${rel}" must contain a JSON array of redirects.`
|
|
20012
|
+
);
|
|
20013
|
+
return [];
|
|
20014
|
+
}
|
|
20015
|
+
return normalizeRedirects(parsed, remaining, warnings, rel);
|
|
20016
|
+
}
|
|
20017
|
+
function parseJsonlRedirects(content, remaining, warnings, rel) {
|
|
20018
|
+
const rows = [];
|
|
20019
|
+
const lines = content.split(/\r?\n/);
|
|
20020
|
+
for (let i = 0; i < lines.length; i++) {
|
|
20021
|
+
const line = lines[i].trim();
|
|
20022
|
+
if (!line) {
|
|
20023
|
+
continue;
|
|
20024
|
+
}
|
|
20025
|
+
try {
|
|
20026
|
+
rows.push(JSON.parse(line));
|
|
20027
|
+
} catch {
|
|
20028
|
+
warnings.push(`Skipping invalid JSONL in "${rel}" at line ${i + 1}.`);
|
|
20029
|
+
}
|
|
20030
|
+
}
|
|
20031
|
+
return normalizeRedirects(rows, remaining, warnings, rel);
|
|
20032
|
+
}
|
|
20033
|
+
var CSV_HEADER_ALIASES = {
|
|
20034
|
+
source: "source",
|
|
20035
|
+
destination: "destination",
|
|
20036
|
+
permanent: "permanent",
|
|
20037
|
+
statuscode: "statusCode",
|
|
20038
|
+
casesensitive: "caseSensitive",
|
|
20039
|
+
preservequeryparams: "preserveQueryParams"
|
|
20040
|
+
};
|
|
20041
|
+
function parseCsvRedirects(content, remaining, warnings, rel) {
|
|
20042
|
+
const lines = content.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
20043
|
+
if (lines.length === 0) {
|
|
20044
|
+
warnings.push(`Bulk redirects CSV "${rel}" is empty.`);
|
|
20045
|
+
return [];
|
|
20046
|
+
}
|
|
20047
|
+
const headers = parseCsvLine(lines[0]).map(
|
|
20048
|
+
(header) => CSV_HEADER_ALIASES[header.trim().toLowerCase()]
|
|
20049
|
+
);
|
|
20050
|
+
if (!headers.includes("source") || !headers.includes("destination")) {
|
|
20051
|
+
warnings.push(
|
|
20052
|
+
`Bulk redirects CSV "${rel}" must have "source" and "destination" columns.`
|
|
20053
|
+
);
|
|
20054
|
+
return [];
|
|
20055
|
+
}
|
|
20056
|
+
const rows = [];
|
|
20057
|
+
for (let i = 1; i < lines.length; i++) {
|
|
20058
|
+
const values = parseCsvLine(lines[i]);
|
|
20059
|
+
const row = {};
|
|
20060
|
+
for (let col = 0; col < headers.length; col++) {
|
|
20061
|
+
const header = headers[col];
|
|
20062
|
+
if (header) {
|
|
20063
|
+
row[header] = values[col] ?? "";
|
|
20064
|
+
}
|
|
20065
|
+
}
|
|
20066
|
+
rows.push(row);
|
|
20067
|
+
}
|
|
20068
|
+
return normalizeRedirects(rows, remaining, warnings, rel);
|
|
20069
|
+
}
|
|
20070
|
+
function normalizeRedirects(rows, remaining, warnings, rel) {
|
|
20071
|
+
const redirects = [];
|
|
20072
|
+
for (let i = 0; i < rows.length; i++) {
|
|
20073
|
+
if (redirects.length >= remaining) {
|
|
20074
|
+
warnings.push(
|
|
20075
|
+
`Bulk redirects limit of ${MAX_REDIRECTS} reached while reading "${rel}"; remaining entries were skipped.`
|
|
20076
|
+
);
|
|
20077
|
+
break;
|
|
20078
|
+
}
|
|
20079
|
+
const row = rows[i];
|
|
20080
|
+
if (!row || typeof row !== "object") {
|
|
20081
|
+
warnings.push(`Skipping invalid redirect in "${rel}" at index ${i}.`);
|
|
20082
|
+
continue;
|
|
20083
|
+
}
|
|
20084
|
+
const record = row;
|
|
20085
|
+
const source = asTrimmedString(record.source);
|
|
20086
|
+
const destination = asTrimmedString(record.destination);
|
|
20087
|
+
if (!source || !destination) {
|
|
20088
|
+
warnings.push(
|
|
20089
|
+
`Skipping redirect in "${rel}" at index ${i}: source and destination are required.`
|
|
20090
|
+
);
|
|
20091
|
+
continue;
|
|
20092
|
+
}
|
|
20093
|
+
if (source.length > MAX_URL_LENGTH || destination.length > MAX_URL_LENGTH) {
|
|
20094
|
+
warnings.push(
|
|
20095
|
+
`Skipping redirect in "${rel}" at index ${i}: source and destination must be at most ${MAX_URL_LENGTH} characters.`
|
|
20096
|
+
);
|
|
20097
|
+
continue;
|
|
20098
|
+
}
|
|
20099
|
+
let statusCode;
|
|
20100
|
+
if (record.statusCode !== void 0 && record.statusCode !== "") {
|
|
20101
|
+
const parsedStatus = parseStatusCode(record.statusCode);
|
|
20102
|
+
if (parsedStatus === void 0) {
|
|
20103
|
+
warnings.push(
|
|
20104
|
+
`Skipping redirect in "${rel}" at index ${i}: statusCode must be one of ${[...VALID_STATUS_CODES].join(", ")}.`
|
|
20105
|
+
);
|
|
20106
|
+
continue;
|
|
20107
|
+
}
|
|
20108
|
+
statusCode = parsedStatus;
|
|
20109
|
+
} else {
|
|
20110
|
+
const permanent = parseBoolean(record.permanent) ?? false;
|
|
20111
|
+
statusCode = permanent ? 308 : 307;
|
|
20112
|
+
}
|
|
20113
|
+
redirects.push({
|
|
20114
|
+
source,
|
|
20115
|
+
destination,
|
|
20116
|
+
statusCode,
|
|
20117
|
+
caseSensitive: parseBoolean(record.caseSensitive) ?? false,
|
|
20118
|
+
preserveQueryParams: parseBoolean(record.preserveQueryParams) ?? false
|
|
20119
|
+
});
|
|
20120
|
+
}
|
|
20121
|
+
return redirects;
|
|
20122
|
+
}
|
|
20123
|
+
function parseSource(source) {
|
|
20124
|
+
if (/^https?:\/\//i.test(source)) {
|
|
20125
|
+
try {
|
|
20126
|
+
const parsed = new URL(source);
|
|
20127
|
+
return {
|
|
20128
|
+
host: parsed.hostname.toLowerCase(),
|
|
20129
|
+
pathname: parsed.pathname || "/"
|
|
20130
|
+
};
|
|
20131
|
+
} catch {
|
|
20132
|
+
return { host: null, pathname: source };
|
|
20133
|
+
}
|
|
20134
|
+
}
|
|
20135
|
+
return { host: null, pathname: source || "/" };
|
|
20136
|
+
}
|
|
20137
|
+
function hostPathKey(host, pathname) {
|
|
20138
|
+
return `${host}\0${pathname}`;
|
|
20139
|
+
}
|
|
20140
|
+
function hostnameFromHostHeader(hostHeader) {
|
|
20141
|
+
const trimmed = hostHeader.trim();
|
|
20142
|
+
if (!trimmed) {
|
|
20143
|
+
return "";
|
|
20144
|
+
}
|
|
20145
|
+
if (trimmed.startsWith("[")) {
|
|
20146
|
+
const end = trimmed.indexOf("]");
|
|
20147
|
+
return end === -1 ? trimmed.toLowerCase() : trimmed.slice(1, end).toLowerCase();
|
|
20148
|
+
}
|
|
20149
|
+
const colon = trimmed.lastIndexOf(":");
|
|
20150
|
+
if (colon !== -1 && trimmed.indexOf(":") === colon) {
|
|
20151
|
+
return trimmed.slice(0, colon).toLowerCase();
|
|
20152
|
+
}
|
|
20153
|
+
return trimmed.toLowerCase();
|
|
20154
|
+
}
|
|
20155
|
+
function parseBoolean(value) {
|
|
20156
|
+
if (typeof value === "boolean") {
|
|
20157
|
+
return value;
|
|
20158
|
+
}
|
|
20159
|
+
if (typeof value === "number") {
|
|
20160
|
+
if (value === 1)
|
|
20161
|
+
return true;
|
|
20162
|
+
if (value === 0)
|
|
20163
|
+
return false;
|
|
20164
|
+
return void 0;
|
|
20165
|
+
}
|
|
20166
|
+
if (typeof value !== "string") {
|
|
20167
|
+
return void 0;
|
|
20168
|
+
}
|
|
20169
|
+
const normalized = value.trim().toLowerCase();
|
|
20170
|
+
if (normalized === "t" || normalized === "true") {
|
|
20171
|
+
return true;
|
|
20172
|
+
}
|
|
20173
|
+
if (normalized === "f" || normalized === "false") {
|
|
20174
|
+
return false;
|
|
20175
|
+
}
|
|
20176
|
+
return void 0;
|
|
20177
|
+
}
|
|
20178
|
+
function parseStatusCode(value) {
|
|
20179
|
+
const n = typeof value === "number" ? value : typeof value === "string" ? Number(value.trim()) : NaN;
|
|
20180
|
+
return VALID_STATUS_CODES.has(n) ? n : void 0;
|
|
20181
|
+
}
|
|
20182
|
+
function asTrimmedString(value) {
|
|
20183
|
+
if (typeof value !== "string") {
|
|
20184
|
+
return void 0;
|
|
20185
|
+
}
|
|
20186
|
+
const trimmed = value.trim();
|
|
20187
|
+
return trimmed ? trimmed : void 0;
|
|
20188
|
+
}
|
|
20189
|
+
function parseCsvLine(line) {
|
|
20190
|
+
const fields = [];
|
|
20191
|
+
let current = "";
|
|
20192
|
+
let inQuotes = false;
|
|
20193
|
+
for (let i = 0; i < line.length; i++) {
|
|
20194
|
+
const char = line[i];
|
|
20195
|
+
if (inQuotes) {
|
|
20196
|
+
if (char === '"') {
|
|
20197
|
+
if (line[i + 1] === '"') {
|
|
20198
|
+
current += '"';
|
|
20199
|
+
i++;
|
|
20200
|
+
} else {
|
|
20201
|
+
inQuotes = false;
|
|
20202
|
+
}
|
|
20203
|
+
} else {
|
|
20204
|
+
current += char;
|
|
20205
|
+
}
|
|
20206
|
+
} else if (char === '"') {
|
|
20207
|
+
inQuotes = true;
|
|
20208
|
+
} else if (char === ",") {
|
|
20209
|
+
fields.push(current);
|
|
20210
|
+
current = "";
|
|
20211
|
+
} else {
|
|
20212
|
+
current += char;
|
|
20213
|
+
}
|
|
20214
|
+
}
|
|
20215
|
+
fields.push(current);
|
|
20216
|
+
return fields;
|
|
20217
|
+
}
|
|
20218
|
+
function stripBom(content) {
|
|
20219
|
+
return content.charCodeAt(0) === 65279 ? content.slice(1) : content;
|
|
20220
|
+
}
|
|
20221
|
+
function isNotFound(err) {
|
|
20222
|
+
return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
|
|
20223
|
+
}
|
|
20224
|
+
function errorMessage(err) {
|
|
20225
|
+
return err instanceof Error ? err.message : String(err);
|
|
20226
|
+
}
|
|
20227
|
+
|
|
19769
20228
|
// src/util/dev/server.ts
|
|
19770
20229
|
var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms4.default)("5m");
|
|
19771
20230
|
var DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS = 60;
|
|
@@ -19807,7 +20266,7 @@ var DevServer = class {
|
|
|
19807
20266
|
this.getVercelConfigPromise = null;
|
|
19808
20267
|
};
|
|
19809
20268
|
this.getExtensionlessFile = (path6) => {
|
|
19810
|
-
const ext =
|
|
20269
|
+
const ext = extname2(path6);
|
|
19811
20270
|
if (this.apiDir && path6.startsWith(this.apiDir + "/") && this.apiExtensions.has(ext)) {
|
|
19812
20271
|
return path6.slice(0, -ext.length);
|
|
19813
20272
|
}
|
|
@@ -20076,6 +20535,26 @@ ${partHeaders}\r
|
|
|
20076
20535
|
return;
|
|
20077
20536
|
}
|
|
20078
20537
|
}
|
|
20538
|
+
if (callLevel === 0 && this.bulkRedirects) {
|
|
20539
|
+
const bulkMatch = resolveBulkRedirect(
|
|
20540
|
+
this.bulkRedirects,
|
|
20541
|
+
req.url || "/",
|
|
20542
|
+
typeof req.headers.host === "string" ? req.headers.host : void 0
|
|
20543
|
+
);
|
|
20544
|
+
if (bulkMatch) {
|
|
20545
|
+
debug(
|
|
20546
|
+
`Bulk redirect ${bulkMatch.statusCode}: ${req.url} -> ${bulkMatch.location}`
|
|
20547
|
+
);
|
|
20548
|
+
await this.sendRedirect(
|
|
20549
|
+
req,
|
|
20550
|
+
res,
|
|
20551
|
+
requestId,
|
|
20552
|
+
bulkMatch.location,
|
|
20553
|
+
bulkMatch.statusCode
|
|
20554
|
+
);
|
|
20555
|
+
return;
|
|
20556
|
+
}
|
|
20557
|
+
}
|
|
20079
20558
|
if (callLevel === 0 && this.orchestrator) {
|
|
20080
20559
|
const pathname = parsed.pathname || "/";
|
|
20081
20560
|
const service = this.orchestrator.getServiceForRoute(pathname);
|
|
@@ -20139,7 +20618,11 @@ ${partHeaders}\r
|
|
|
20139
20618
|
entrypoint: middleware.entrypoint,
|
|
20140
20619
|
workPath,
|
|
20141
20620
|
repoRootPath: this.repoRoot,
|
|
20142
|
-
|
|
20621
|
+
// `projectSettings.createdAt` decides the default middleware runtime.
|
|
20622
|
+
config: {
|
|
20623
|
+
projectSettings: this.projectSettings,
|
|
20624
|
+
...middleware.config
|
|
20625
|
+
},
|
|
20143
20626
|
meta: {
|
|
20144
20627
|
isDev: true,
|
|
20145
20628
|
devCacheDir,
|
|
@@ -20224,7 +20707,7 @@ ${partHeaders}\r
|
|
|
20224
20707
|
prevUrl = rewritePath;
|
|
20225
20708
|
const beforeRewriteUrl = req.url || "/";
|
|
20226
20709
|
if (isURL(rewritePath)) {
|
|
20227
|
-
const rewriteUrlParsed = new
|
|
20710
|
+
const rewriteUrlParsed = new URL2(rewritePath);
|
|
20228
20711
|
if (this.address.origin === rewriteUrlParsed.origin) {
|
|
20229
20712
|
req.url = rewritePath.slice(rewriteUrlParsed.origin.length) || "/";
|
|
20230
20713
|
prevUrl = req.url;
|
|
@@ -20771,11 +21254,16 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
20771
21254
|
this.stopping = false;
|
|
20772
21255
|
this.buildMatches = /* @__PURE__ */ new Map();
|
|
20773
21256
|
this.inProgressBuilds = /* @__PURE__ */ new Map();
|
|
20774
|
-
this.devCacheDir =
|
|
21257
|
+
this.devCacheDir = join4(getVercelDirectory(cwd), "cache");
|
|
20775
21258
|
this.vercelConfigWarning = false;
|
|
20776
21259
|
this.getVercelConfigPromise = null;
|
|
20777
21260
|
this.blockingBuildsPromise = null;
|
|
20778
21261
|
this.startPromise = null;
|
|
21262
|
+
this.bulkRedirects = null;
|
|
21263
|
+
this.bulkRedirectsSignature = null;
|
|
21264
|
+
this.bulkRedirectsLastPath = null;
|
|
21265
|
+
this.bulkRedirectsResolvedPath = null;
|
|
21266
|
+
this.bulkRedirectsDirty = true;
|
|
20779
21267
|
this.watchAggregationId = null;
|
|
20780
21268
|
this.watchAggregationEvents = [];
|
|
20781
21269
|
this.watchAggregationTimeout = 500;
|
|
@@ -20865,6 +21353,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
20865
21353
|
process.exit(code);
|
|
20866
21354
|
}
|
|
20867
21355
|
enqueueFsEvent(type, path6) {
|
|
21356
|
+
if (this.bulkRedirectsResolvedPath && (path6 === this.bulkRedirectsResolvedPath || path6.startsWith(this.bulkRedirectsResolvedPath + sep2))) {
|
|
21357
|
+
this.bulkRedirectsDirty = true;
|
|
21358
|
+
}
|
|
20868
21359
|
this.watchAggregationEvents.push({ type, path: path6 });
|
|
20869
21360
|
if (this.watchAggregationId === null) {
|
|
20870
21361
|
this.watchAggregationId = setTimeout(() => {
|
|
@@ -21068,7 +21559,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21068
21559
|
);
|
|
21069
21560
|
}
|
|
21070
21561
|
async getLocalEnv(fileName, base) {
|
|
21071
|
-
const filePath =
|
|
21562
|
+
const filePath = join4(this.cwd, fileName);
|
|
21072
21563
|
let env = {};
|
|
21073
21564
|
try {
|
|
21074
21565
|
const dotenv = await import_fs_extra.default.readFile(filePath, "utf8");
|
|
@@ -21122,7 +21613,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21122
21613
|
return void 0;
|
|
21123
21614
|
}
|
|
21124
21615
|
async _getVercelConfig() {
|
|
21125
|
-
const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-
|
|
21616
|
+
const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-DGM4NISW.js");
|
|
21126
21617
|
await compileVercelConfig(this.cwd);
|
|
21127
21618
|
const configPath = getLocalPathConfig(this.cwd);
|
|
21128
21619
|
const [
|
|
@@ -21216,7 +21707,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21216
21707
|
vercelConfig.routes = routes;
|
|
21217
21708
|
} else if (hasResolvedServices && vercelConfig.proxy) {
|
|
21218
21709
|
const { entrypoint } = vercelConfig.proxy;
|
|
21219
|
-
if (!await import_fs_extra.default.pathExists(
|
|
21710
|
+
if (!await import_fs_extra.default.pathExists(join4(this.cwd, entrypoint))) {
|
|
21220
21711
|
output_manager_default.error(
|
|
21221
21712
|
`The proxy entrypoint \`${entrypoint}\` does not exist. Set \`proxy.entrypoint\` to an existing \`.js\` or \`.ts\` file.`
|
|
21222
21713
|
);
|
|
@@ -21301,16 +21792,54 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21301
21792
|
if (this.initialDevCommandStarted) {
|
|
21302
21793
|
await this.runDevCommand();
|
|
21303
21794
|
}
|
|
21795
|
+
await this.refreshBulkRedirects(vercelConfig.bulkRedirectsPath);
|
|
21304
21796
|
return vercelConfig;
|
|
21305
21797
|
}
|
|
21798
|
+
async refreshBulkRedirects(bulkRedirectsPath) {
|
|
21799
|
+
const configPath = bulkRedirectsPath ?? null;
|
|
21800
|
+
if (configPath === this.bulkRedirectsLastPath && !this.bulkRedirectsDirty) {
|
|
21801
|
+
return;
|
|
21802
|
+
}
|
|
21803
|
+
this.bulkRedirectsLastPath = configPath;
|
|
21804
|
+
this.bulkRedirectsDirty = false;
|
|
21805
|
+
this.bulkRedirectsResolvedPath = configPath ? resolveBulkRedirectsPath(this.cwd, configPath) : null;
|
|
21806
|
+
if (!configPath) {
|
|
21807
|
+
this.bulkRedirects = null;
|
|
21808
|
+
this.bulkRedirectsSignature = null;
|
|
21809
|
+
return;
|
|
21810
|
+
}
|
|
21811
|
+
const signature = await getBulkRedirectsSignature(this.cwd, configPath);
|
|
21812
|
+
if (signature === this.bulkRedirectsSignature) {
|
|
21813
|
+
return;
|
|
21814
|
+
}
|
|
21815
|
+
this.bulkRedirectsSignature = signature;
|
|
21816
|
+
try {
|
|
21817
|
+
const result = await loadBulkRedirects(this.cwd, configPath);
|
|
21818
|
+
this.bulkRedirects = result.table;
|
|
21819
|
+
for (const warning of result.warnings) {
|
|
21820
|
+
output_manager_default.warn(warning);
|
|
21821
|
+
}
|
|
21822
|
+
const count = result.table.size;
|
|
21823
|
+
if (count > 0) {
|
|
21824
|
+
output_manager_default.log(
|
|
21825
|
+
`Loaded ${count} bulk ${(0, import_pluralize2.default)("redirect", count)} from ${configPath}`
|
|
21826
|
+
);
|
|
21827
|
+
}
|
|
21828
|
+
} catch (err) {
|
|
21829
|
+
this.bulkRedirects = null;
|
|
21830
|
+
output_manager_default.warn(
|
|
21831
|
+
`Failed to load bulk redirects from "${configPath}": ${(0, import_error_utils.errorToString)(err)}`
|
|
21832
|
+
);
|
|
21833
|
+
}
|
|
21834
|
+
}
|
|
21306
21835
|
async readJsonFile(filePath) {
|
|
21307
21836
|
let rel, abs;
|
|
21308
|
-
if (
|
|
21837
|
+
if (isAbsolute3(filePath)) {
|
|
21309
21838
|
rel = path4.relative(this.cwd, filePath);
|
|
21310
21839
|
abs = filePath;
|
|
21311
21840
|
} else {
|
|
21312
21841
|
rel = filePath;
|
|
21313
|
-
abs =
|
|
21842
|
+
abs = join4(this.cwd, filePath);
|
|
21314
21843
|
}
|
|
21315
21844
|
output_manager_default.debug(`Reading \`${rel}\` file`);
|
|
21316
21845
|
try {
|
|
@@ -21455,7 +21984,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21455
21984
|
}
|
|
21456
21985
|
}
|
|
21457
21986
|
}
|
|
21458
|
-
this._address = new
|
|
21987
|
+
this._address = new URL2(replaceLocalhost(address));
|
|
21459
21988
|
const vercelConfig = await this.getVercelConfig();
|
|
21460
21989
|
let devCommandPromise;
|
|
21461
21990
|
const startDevCommand = () => {
|
|
@@ -21725,7 +22254,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21725
22254
|
this.setResponseHeaders(res, requestId, headers);
|
|
21726
22255
|
const http_status_description = generateHttpStatusDescription(statusCode);
|
|
21727
22256
|
const error_code = errorCode || http_status_description;
|
|
21728
|
-
const
|
|
22257
|
+
const errorMessage2 = generateErrorMessage(statusCode, error_code);
|
|
21729
22258
|
let body;
|
|
21730
22259
|
const { accept = "text/plain" } = req.headers;
|
|
21731
22260
|
if (accept.includes("json")) {
|
|
@@ -21733,7 +22262,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21733
22262
|
const json = JSON.stringify({
|
|
21734
22263
|
error: {
|
|
21735
22264
|
code: statusCode,
|
|
21736
|
-
message:
|
|
22265
|
+
message: errorMessage2.title
|
|
21737
22266
|
}
|
|
21738
22267
|
});
|
|
21739
22268
|
body = `${json}
|
|
@@ -21743,7 +22272,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21743
22272
|
let view;
|
|
21744
22273
|
if (statusCode === 404) {
|
|
21745
22274
|
view = error_404({
|
|
21746
|
-
...
|
|
22275
|
+
...errorMessage2,
|
|
21747
22276
|
http_status_code: statusCode,
|
|
21748
22277
|
http_status_description,
|
|
21749
22278
|
error_code,
|
|
@@ -21751,7 +22280,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21751
22280
|
});
|
|
21752
22281
|
} else if (statusCode === 502) {
|
|
21753
22282
|
view = error_502({
|
|
21754
|
-
...
|
|
22283
|
+
...errorMessage2,
|
|
21755
22284
|
http_status_code: statusCode,
|
|
21756
22285
|
http_status_description,
|
|
21757
22286
|
error_code,
|
|
@@ -21772,7 +22301,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
21772
22301
|
});
|
|
21773
22302
|
} else {
|
|
21774
22303
|
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
21775
|
-
body = `${
|
|
22304
|
+
body = `${errorMessage2.title}
|
|
21776
22305
|
|
|
21777
22306
|
${error_code}
|
|
21778
22307
|
`;
|
|
@@ -22061,7 +22590,7 @@ ${error_code}
|
|
|
22061
22590
|
base = rel.split("/")[0];
|
|
22062
22591
|
href = `/${prefix}${base}/`;
|
|
22063
22592
|
} else {
|
|
22064
|
-
ext =
|
|
22593
|
+
ext = extname2(p).substring(1);
|
|
22065
22594
|
href = `/${prefix}${base}`;
|
|
22066
22595
|
}
|
|
22067
22596
|
return {
|
|
@@ -22228,12 +22757,12 @@ function serveStaticFile(req, res, cwd, opts) {
|
|
|
22228
22757
|
});
|
|
22229
22758
|
}
|
|
22230
22759
|
function close(server) {
|
|
22231
|
-
return new Promise((
|
|
22760
|
+
return new Promise((resolve3, reject) => {
|
|
22232
22761
|
server.close((err) => {
|
|
22233
22762
|
if (err) {
|
|
22234
22763
|
reject(err);
|
|
22235
22764
|
} else {
|
|
22236
|
-
|
|
22765
|
+
resolve3();
|
|
22237
22766
|
}
|
|
22238
22767
|
});
|
|
22239
22768
|
});
|
|
@@ -22265,7 +22794,7 @@ async function findBuildMatch(matches, files, requestPath, devServer, vercelConf
|
|
|
22265
22794
|
if (!isIndex(match.src)) {
|
|
22266
22795
|
return match;
|
|
22267
22796
|
} else {
|
|
22268
|
-
if (
|
|
22797
|
+
if (extname2(match.src) === ".html") {
|
|
22269
22798
|
return match;
|
|
22270
22799
|
}
|
|
22271
22800
|
bestIndexMatch = match;
|
|
@@ -22357,7 +22886,7 @@ function dirnameWithoutDot(path6) {
|
|
|
22357
22886
|
return dir;
|
|
22358
22887
|
}
|
|
22359
22888
|
function isIndex(path6) {
|
|
22360
|
-
const ext =
|
|
22889
|
+
const ext = extname2(path6);
|
|
22361
22890
|
const name = basename(path6, ext);
|
|
22362
22891
|
return name === "index";
|
|
22363
22892
|
}
|
|
@@ -22494,8 +23023,8 @@ function millisToSecs(millis) {
|
|
|
22494
23023
|
}
|
|
22495
23024
|
|
|
22496
23025
|
// src/util/dev/dev-lock.ts
|
|
22497
|
-
import { join as
|
|
22498
|
-
import { mkdir, open, unlink, readFile } from "fs/promises";
|
|
23026
|
+
import { join as join5 } from "path";
|
|
23027
|
+
import { mkdir, open, unlink, readFile as readFile2 } from "fs/promises";
|
|
22499
23028
|
import { unlinkSync as unlinkSync2, constants } from "fs";
|
|
22500
23029
|
var DEV_LOCK_FILE = "dev.lock";
|
|
22501
23030
|
function isProcessRunning(pid) {
|
|
@@ -22524,15 +23053,15 @@ async function tryCreateLockFile(lockPath, content) {
|
|
|
22524
23053
|
}
|
|
22525
23054
|
async function tryReadLockFile(lockPath) {
|
|
22526
23055
|
try {
|
|
22527
|
-
const content = await
|
|
23056
|
+
const content = await readFile2(lockPath, "utf8");
|
|
22528
23057
|
return JSON.parse(content);
|
|
22529
23058
|
} catch {
|
|
22530
23059
|
return null;
|
|
22531
23060
|
}
|
|
22532
23061
|
}
|
|
22533
23062
|
async function acquireDevLock(projectRoot, port) {
|
|
22534
|
-
const vercelDir =
|
|
22535
|
-
const lockPath =
|
|
23063
|
+
const vercelDir = join5(projectRoot, VERCEL_DIR);
|
|
23064
|
+
const lockPath = join5(vercelDir, DEV_LOCK_FILE);
|
|
22536
23065
|
await mkdir(vercelDir, { recursive: true });
|
|
22537
23066
|
const lockData = {
|
|
22538
23067
|
pid: process.pid,
|
|
@@ -22580,7 +23109,7 @@ async function acquireDevLock(projectRoot, port) {
|
|
|
22580
23109
|
};
|
|
22581
23110
|
}
|
|
22582
23111
|
function releaseDevLock(projectRoot) {
|
|
22583
|
-
const lockPath =
|
|
23112
|
+
const lockPath = join5(projectRoot, VERCEL_DIR, DEV_LOCK_FILE);
|
|
22584
23113
|
try {
|
|
22585
23114
|
unlinkSync2(lockPath);
|
|
22586
23115
|
} catch (err) {
|
|
@@ -22591,7 +23120,7 @@ function releaseDevLock(projectRoot) {
|
|
|
22591
23120
|
// src/commands/dev/dev.ts
|
|
22592
23121
|
async function dev(client, opts, args2, telemetry, localConfig) {
|
|
22593
23122
|
const [dir = "."] = args2;
|
|
22594
|
-
let cwd =
|
|
23123
|
+
let cwd = resolve2(dir);
|
|
22595
23124
|
const listen2 = parseListen(opts["--listen"] || "3000");
|
|
22596
23125
|
cwd = await resolveProjectCwd(cwd);
|
|
22597
23126
|
const projectNameOrId = opts["--project"];
|
|
@@ -22678,7 +23207,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
|
|
|
22678
23207
|
projectId = project.id;
|
|
22679
23208
|
orgId = org.id;
|
|
22680
23209
|
if (project.rootDirectory) {
|
|
22681
|
-
cwd =
|
|
23210
|
+
cwd = join6(cwd, project.rootDirectory);
|
|
22682
23211
|
}
|
|
22683
23212
|
envValues = (await pullEnvRecords(client, project.id, "vercel-cli:dev")).env;
|
|
22684
23213
|
}
|
|
@@ -22814,7 +23343,7 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
|
|
|
22814
23343
|
process.on("SIGINT", async () => await cleanup("SIGINT"));
|
|
22815
23344
|
process.on("SIGHUP", async () => await cleanup("SIGHUP"));
|
|
22816
23345
|
if (!devServer.devCommand) {
|
|
22817
|
-
const outputDir =
|
|
23346
|
+
const outputDir = join6(cwd, import_write_build_result.OUTPUT_DIR);
|
|
22818
23347
|
if (await import_fs_extra2.default.pathExists(outputDir)) {
|
|
22819
23348
|
output_manager_default.log(`Removing ${import_write_build_result.OUTPUT_DIR}`);
|
|
22820
23349
|
await import_fs_extra2.default.remove(outputDir);
|