vercel 54.6.0 → 54.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-4JTZ2IN2.js → add-ACM2FI4N.js} +8 -8
- package/dist/chunks/{chunk-3TDGMELF.js → chunk-2R5WYHZW.js} +2 -2
- package/dist/chunks/{chunk-YP423QYK.js → chunk-3EOZ4ZDJ.js} +2 -2
- package/dist/chunks/{chunk-V23PMSXG.js → chunk-5K6XFQBY.js} +45 -777
- package/dist/chunks/{chunk-6PVIXIDG.js → chunk-6PSM4YC3.js} +3 -3
- package/dist/chunks/{chunk-TM2USC5N.js → chunk-7HAY2TY5.js} +3 -3
- package/dist/chunks/{chunk-ULXHXZCZ.js → chunk-7OUZIPHA.js} +1 -1
- package/dist/chunks/{chunk-KNTWCQDY.js → chunk-7Q62DZEF.js} +9 -7
- package/dist/chunks/{chunk-SRVNEJVN.js → chunk-CMQXECHW.js} +2 -2
- package/dist/chunks/{chunk-5EKBCYHA.js → chunk-CPWI2SWV.js} +2 -2
- package/dist/chunks/{chunk-XFSFHTAB.js → chunk-DDORH57D.js} +2 -2
- package/dist/chunks/{chunk-B43F7BHW.js → chunk-ERQAMRRQ.js} +2 -2
- package/dist/chunks/{chunk-LT7RPFRM.js → chunk-FO7QBAVZ.js} +4 -4
- package/dist/chunks/{chunk-TPCECDGK.js → chunk-FQ2EU7QM.js} +7 -7
- package/dist/chunks/{chunk-NYJXGEIR.js → chunk-FV5RQPKY.js} +1 -1
- package/dist/chunks/{chunk-JD4N3RDP.js → chunk-HW6MMF4G.js} +4 -4
- package/dist/chunks/{chunk-UGXBNJMO.js → chunk-IDFKAJW3.js} +1 -0
- package/dist/chunks/{chunk-7O3VXZBW.js → chunk-K5ISROJF.js} +1 -1
- package/dist/chunks/{chunk-MOA7PCJA.js → chunk-KFVFRVDK.js} +2 -2
- package/dist/chunks/{chunk-IZ6WAFPZ.js → chunk-L552VUSW.js} +2 -2
- package/dist/chunks/{chunk-TTOZFGDX.js → chunk-LOQRUMOE.js} +2 -2
- package/dist/chunks/{chunk-DJA3IN2X.js → chunk-O7SEN4RY.js} +2 -2
- package/dist/chunks/{chunk-PKUYGVBJ.js → chunk-QAHIBMRJ.js} +1513 -172
- package/dist/chunks/chunk-RKLHR2YE.js +152 -0
- package/dist/chunks/{chunk-XR64AS27.js → chunk-T4I25SRE.js} +66 -10
- package/dist/chunks/{chunk-C2V6DCWN.js → chunk-TIJBJ7EO.js} +2 -2
- package/dist/chunks/{chunk-YAOSNCGO.js → chunk-TJQZGB6S.js} +2 -2
- package/dist/chunks/{chunk-BT4S267X.js → chunk-TSUZWPXS.js} +4 -4
- package/dist/chunks/{chunk-C7WFNC2H.js → chunk-TVXUA533.js} +2 -2
- package/dist/chunks/{chunk-KSWKCPMW.js → chunk-UOYAPQ6P.js} +10 -14
- package/dist/chunks/{chunk-AQMLIXGD.js → chunk-WAGY7TO7.js} +1 -1
- package/dist/chunks/{chunk-ZINNI4TC.js → chunk-WWLVPUED.js} +1 -1
- package/dist/chunks/{chunk-OLXE4TRH.js → chunk-XC4VCXLN.js} +7 -7
- package/dist/chunks/{chunk-H33IJ7OP.js → chunk-XQUJUKTN.js} +1 -1
- package/dist/chunks/{chunk-OM5Z2KO5.js → chunk-ZTHVV4KB.js} +1 -1
- package/dist/chunks/{compile-vercel-config-TJYP77GR.js → compile-vercel-config-UMMPRYHE.js} +4 -4
- package/dist/chunks/{delete-KMJUZ2FR.js → delete-ZIUHVZKU.js} +6 -6
- package/dist/chunks/{disable-JNVD32GK.js → disable-3I6Y3PMB.js} +6 -6
- package/dist/chunks/{discard-IHJUBIIP.js → discard-P4QEYWQI.js} +6 -6
- package/dist/chunks/{edit-SHG24GD3.js → edit-C7W4II4F.js} +7 -7
- package/dist/chunks/{enable-BPPOFBS5.js → enable-YLFEOJHC.js} +6 -6
- package/dist/chunks/{export-NXMANIFJ.js → export-AEWPAFG5.js} +6 -6
- package/dist/chunks/{inspect-3QUNVUYY.js → inspect-UTKNO4PH.js} +8 -8
- package/dist/chunks/{list-DIFVR5IT.js → list-G2JFMLAP.js} +6 -6
- package/dist/chunks/{list-3EEABCQ5.js → list-K6T37XX7.js} +9 -9
- package/dist/chunks/{ls-W3EW6GXH.js → ls-SDUUITFJ.js} +8 -8
- package/dist/chunks/{publish-MJWCDLBZ.js → publish-CVDJGN4U.js} +6 -6
- package/dist/chunks/{query-C6RJSZM3.js → query-NZR7YNV5.js} +8 -8
- package/dist/chunks/{reorder-PPF7SVNU.js → reorder-XXHIOZ4E.js} +6 -6
- package/dist/chunks/{restore-EOJNTA2T.js → restore-SCM6T5BD.js} +6 -6
- package/dist/chunks/{rm-WEZ4K7UG.js → rm-I24CJRZY.js} +8 -8
- package/dist/chunks/{rule-inspect-PXCF73V3.js → rule-inspect-3K5RYFGG.js} +8 -8
- package/dist/chunks/{rules-DF7IFF4R.js → rules-T2VAUOFG.js} +8 -8
- package/dist/chunks/{schema-3UFDQZFG.js → schema-F6W32I35.js} +9 -9
- package/dist/chunks/{types-V6KTYGWP.js → types-LU2G5DD3.js} +4 -4
- package/dist/chunks/{update-FNAEWCUN.js → update-ZYQWTTCL.js} +8 -8
- package/dist/commands/build/index.js +534 -394
- package/dist/commands/deploy/index.js +23 -24
- package/dist/commands/dev/index.js +14 -14
- package/dist/commands/env/index.js +160 -95
- package/dist/commands/link/index.js +20 -21
- package/dist/commands/list/index.js +10 -10
- package/dist/commands-bulk.js +1503 -1277
- package/dist/index.js +20 -21
- package/dist/version.mjs +1 -1
- package/package.json +17 -17
- package/dist/chunks/chunk-76ZNZKIN.js +0 -17
- package/dist/chunks/chunk-HXXKDZQ6.js +0 -680
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getPreservedArgsForEnvPull,
|
|
15
15
|
outputActionRequired,
|
|
16
16
|
outputAgentError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7OUZIPHA.js";
|
|
18
18
|
import {
|
|
19
19
|
require_ms,
|
|
20
20
|
stamp_default
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
require_string_width,
|
|
35
35
|
require_strip_ansi,
|
|
36
36
|
yesOption
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-XQUJUKTN.js";
|
|
38
38
|
import {
|
|
39
39
|
APIError,
|
|
40
40
|
CantParseJSONFile,
|
|
@@ -49,7 +49,10 @@ import {
|
|
|
49
49
|
isAPIError,
|
|
50
50
|
packageName,
|
|
51
51
|
require_lib
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-IDFKAJW3.js";
|
|
53
|
+
import {
|
|
54
|
+
pkg_default
|
|
55
|
+
} from "./chunk-P4QNYOFB.js";
|
|
53
56
|
import {
|
|
54
57
|
emoji,
|
|
55
58
|
eraseLines,
|
|
@@ -2677,7 +2680,7 @@ var require_formats = __commonJS({
|
|
|
2677
2680
|
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
2678
2681
|
var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
2679
2682
|
var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
|
|
2680
|
-
var
|
|
2683
|
+
var URL3 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
|
|
2681
2684
|
var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
2682
2685
|
var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
2683
2686
|
var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
|
|
@@ -2697,7 +2700,7 @@ var require_formats = __commonJS({
|
|
|
2697
2700
|
uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
2698
2701
|
"uri-reference": /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
2699
2702
|
"uri-template": URITEMPLATE,
|
|
2700
|
-
url:
|
|
2703
|
+
url: URL3,
|
|
2701
2704
|
// email (sources from jsen validator):
|
|
2702
2705
|
// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
|
|
2703
2706
|
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
|
|
@@ -2724,7 +2727,7 @@ var require_formats = __commonJS({
|
|
|
2724
2727
|
uri,
|
|
2725
2728
|
"uri-reference": URIREF,
|
|
2726
2729
|
"uri-template": URITEMPLATE,
|
|
2727
|
-
url:
|
|
2730
|
+
url: URL3,
|
|
2728
2731
|
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
2729
2732
|
hostname: HOSTNAME,
|
|
2730
2733
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
|
@@ -8001,7 +8004,7 @@ var require_jsonfile = __commonJS({
|
|
|
8001
8004
|
}
|
|
8002
8005
|
return obj;
|
|
8003
8006
|
}
|
|
8004
|
-
var
|
|
8007
|
+
var readFile7 = universalify.fromPromise(_readFile);
|
|
8005
8008
|
function readFileSync(file, options = {}) {
|
|
8006
8009
|
if (typeof options === "string") {
|
|
8007
8010
|
options = { encoding: options };
|
|
@@ -8026,16 +8029,16 @@ var require_jsonfile = __commonJS({
|
|
|
8026
8029
|
const str = stringify(obj, options);
|
|
8027
8030
|
await universalify.fromCallback(fs5.writeFile)(file, str, options);
|
|
8028
8031
|
}
|
|
8029
|
-
var
|
|
8032
|
+
var writeFile6 = universalify.fromPromise(_writeFile);
|
|
8030
8033
|
function writeFileSync(file, obj, options = {}) {
|
|
8031
8034
|
const fs5 = options.fs || _fs;
|
|
8032
8035
|
const str = stringify(obj, options);
|
|
8033
8036
|
return fs5.writeFileSync(file, str, options);
|
|
8034
8037
|
}
|
|
8035
8038
|
var jsonfile = {
|
|
8036
|
-
readFile:
|
|
8039
|
+
readFile: readFile7,
|
|
8037
8040
|
readFileSync,
|
|
8038
|
-
writeFile:
|
|
8041
|
+
writeFile: writeFile6,
|
|
8039
8042
|
writeFileSync
|
|
8040
8043
|
};
|
|
8041
8044
|
module.exports = jsonfile;
|
|
@@ -8427,14 +8430,14 @@ var require_templates = __commonJS({
|
|
|
8427
8430
|
}
|
|
8428
8431
|
return results;
|
|
8429
8432
|
}
|
|
8430
|
-
function buildStyle(
|
|
8433
|
+
function buildStyle(chalk15, styles) {
|
|
8431
8434
|
const enabled = {};
|
|
8432
8435
|
for (const layer of styles) {
|
|
8433
8436
|
for (const style of layer.styles) {
|
|
8434
8437
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
8435
8438
|
}
|
|
8436
8439
|
}
|
|
8437
|
-
let current =
|
|
8440
|
+
let current = chalk15;
|
|
8438
8441
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
8439
8442
|
if (!Array.isArray(styles2)) {
|
|
8440
8443
|
continue;
|
|
@@ -8446,7 +8449,7 @@ var require_templates = __commonJS({
|
|
|
8446
8449
|
}
|
|
8447
8450
|
return current;
|
|
8448
8451
|
}
|
|
8449
|
-
module.exports = (
|
|
8452
|
+
module.exports = (chalk15, temporary) => {
|
|
8450
8453
|
const styles = [];
|
|
8451
8454
|
const chunks = [];
|
|
8452
8455
|
let chunk = [];
|
|
@@ -8456,13 +8459,13 @@ var require_templates = __commonJS({
|
|
|
8456
8459
|
} else if (style) {
|
|
8457
8460
|
const string = chunk.join("");
|
|
8458
8461
|
chunk = [];
|
|
8459
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
8462
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk15, styles)(string));
|
|
8460
8463
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
8461
8464
|
} else if (close) {
|
|
8462
8465
|
if (styles.length === 0) {
|
|
8463
8466
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
8464
8467
|
}
|
|
8465
|
-
chunks.push(buildStyle(
|
|
8468
|
+
chunks.push(buildStyle(chalk15, styles)(chunk.join("")));
|
|
8466
8469
|
chunk = [];
|
|
8467
8470
|
styles.pop();
|
|
8468
8471
|
} else {
|
|
@@ -8510,16 +8513,16 @@ var require_source2 = __commonJS({
|
|
|
8510
8513
|
}
|
|
8511
8514
|
};
|
|
8512
8515
|
var chalkFactory = (options) => {
|
|
8513
|
-
const
|
|
8514
|
-
applyOptions(
|
|
8515
|
-
|
|
8516
|
-
Object.setPrototypeOf(
|
|
8517
|
-
Object.setPrototypeOf(
|
|
8518
|
-
|
|
8516
|
+
const chalk16 = {};
|
|
8517
|
+
applyOptions(chalk16, options);
|
|
8518
|
+
chalk16.template = (...arguments_) => chalkTag(chalk16.template, ...arguments_);
|
|
8519
|
+
Object.setPrototypeOf(chalk16, Chalk.prototype);
|
|
8520
|
+
Object.setPrototypeOf(chalk16.template, chalk16);
|
|
8521
|
+
chalk16.template.constructor = () => {
|
|
8519
8522
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
8520
8523
|
};
|
|
8521
|
-
|
|
8522
|
-
return
|
|
8524
|
+
chalk16.template.Instance = ChalkClass;
|
|
8525
|
+
return chalk16.template;
|
|
8523
8526
|
};
|
|
8524
8527
|
function Chalk(options) {
|
|
8525
8528
|
return chalkFactory(options);
|
|
@@ -8577,18 +8580,18 @@ var require_source2 = __commonJS({
|
|
|
8577
8580
|
}
|
|
8578
8581
|
}
|
|
8579
8582
|
});
|
|
8580
|
-
var createStyler = (
|
|
8583
|
+
var createStyler = (open2, close, parent) => {
|
|
8581
8584
|
let openAll;
|
|
8582
8585
|
let closeAll;
|
|
8583
8586
|
if (parent === void 0) {
|
|
8584
|
-
openAll =
|
|
8587
|
+
openAll = open2;
|
|
8585
8588
|
closeAll = close;
|
|
8586
8589
|
} else {
|
|
8587
|
-
openAll = parent.openAll +
|
|
8590
|
+
openAll = parent.openAll + open2;
|
|
8588
8591
|
closeAll = close + parent.closeAll;
|
|
8589
8592
|
}
|
|
8590
8593
|
return {
|
|
8591
|
-
open,
|
|
8594
|
+
open: open2,
|
|
8592
8595
|
close,
|
|
8593
8596
|
openAll,
|
|
8594
8597
|
closeAll,
|
|
@@ -8630,7 +8633,7 @@ var require_source2 = __commonJS({
|
|
|
8630
8633
|
return openAll + string + closeAll;
|
|
8631
8634
|
};
|
|
8632
8635
|
var template;
|
|
8633
|
-
var chalkTag = (
|
|
8636
|
+
var chalkTag = (chalk16, ...strings) => {
|
|
8634
8637
|
const [firstString] = strings;
|
|
8635
8638
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
8636
8639
|
return strings.join(" ");
|
|
@@ -8646,14 +8649,14 @@ var require_source2 = __commonJS({
|
|
|
8646
8649
|
if (template === void 0) {
|
|
8647
8650
|
template = require_templates();
|
|
8648
8651
|
}
|
|
8649
|
-
return template(
|
|
8652
|
+
return template(chalk16, parts.join(""));
|
|
8650
8653
|
};
|
|
8651
8654
|
Object.defineProperties(Chalk.prototype, styles);
|
|
8652
|
-
var
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
module.exports =
|
|
8655
|
+
var chalk15 = Chalk();
|
|
8656
|
+
chalk15.supportsColor = stdoutColor;
|
|
8657
|
+
chalk15.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
8658
|
+
chalk15.stderr.supportsColor = stderrColor;
|
|
8659
|
+
module.exports = chalk15;
|
|
8657
8660
|
}
|
|
8658
8661
|
});
|
|
8659
8662
|
|
|
@@ -13730,10 +13733,10 @@ var require_read_config_file = __commonJS({
|
|
|
13730
13733
|
var import_smol_toml3 = __require("smol-toml");
|
|
13731
13734
|
var import_fs4 = __require("fs");
|
|
13732
13735
|
var import_error_utils5 = require_dist();
|
|
13733
|
-
var { readFile:
|
|
13736
|
+
var { readFile: readFile7 } = import_fs4.promises;
|
|
13734
13737
|
async function readFileOrNull(file) {
|
|
13735
13738
|
try {
|
|
13736
|
-
const data = await
|
|
13739
|
+
const data = await readFile7(file);
|
|
13737
13740
|
return data;
|
|
13738
13741
|
} catch (error) {
|
|
13739
13742
|
if (!(0, import_error_utils5.isErrnoException)(error)) {
|
|
@@ -13820,7 +13823,7 @@ var require_frameworks = __commonJS({
|
|
|
13820
13823
|
var import_fs4 = __require("fs");
|
|
13821
13824
|
var import_read_config_file = require_read_config_file();
|
|
13822
13825
|
__reExport(frameworks_exports, require_types(), module.exports);
|
|
13823
|
-
var { readdir, readFile:
|
|
13826
|
+
var { readdir, readFile: readFile7, unlink: unlink2 } = import_fs4.promises;
|
|
13824
13827
|
var frameworks = [
|
|
13825
13828
|
{
|
|
13826
13829
|
name: "Blitz.js (Legacy)",
|
|
@@ -13948,7 +13951,7 @@ var require_frameworks = __commonJS({
|
|
|
13948
13951
|
"public",
|
|
13949
13952
|
"__now_routes_g4t5bY.json"
|
|
13950
13953
|
);
|
|
13951
|
-
const content = await
|
|
13954
|
+
const content = await readFile7(nowRoutesPath, "utf8");
|
|
13952
13955
|
const nowRoutes = JSON.parse(content);
|
|
13953
13956
|
try {
|
|
13954
13957
|
await unlink2(nowRoutesPath);
|
|
@@ -18239,11 +18242,11 @@ var require_brace_expansion = __commonJS({
|
|
|
18239
18242
|
if (pad) {
|
|
18240
18243
|
var need = width - c.length;
|
|
18241
18244
|
if (need > 0) {
|
|
18242
|
-
var
|
|
18245
|
+
var z2 = new Array(need + 1).join("0");
|
|
18243
18246
|
if (i < 0)
|
|
18244
|
-
c = "-" +
|
|
18247
|
+
c = "-" + z2 + c.slice(1);
|
|
18245
18248
|
else
|
|
18246
|
-
c =
|
|
18249
|
+
c = z2 + c;
|
|
18247
18250
|
}
|
|
18248
18251
|
}
|
|
18249
18252
|
}
|
|
@@ -20195,8 +20198,8 @@ var require_dist3 = __commonJS({
|
|
|
20195
20198
|
result.push(path);
|
|
20196
20199
|
path = "";
|
|
20197
20200
|
}
|
|
20198
|
-
var
|
|
20199
|
-
if (
|
|
20201
|
+
var open2 = tryConsume("OPEN");
|
|
20202
|
+
if (open2) {
|
|
20200
20203
|
var prefix = consumeText();
|
|
20201
20204
|
var name_1 = tryConsume("NAME") || "";
|
|
20202
20205
|
var pattern_1 = tryConsume("PATTERN") || "";
|
|
@@ -20583,8 +20586,8 @@ var require_dist4 = __commonJS({
|
|
|
20583
20586
|
result.push(path);
|
|
20584
20587
|
path = "";
|
|
20585
20588
|
}
|
|
20586
|
-
var
|
|
20587
|
-
if (
|
|
20589
|
+
var open2 = tryConsume("OPEN");
|
|
20590
|
+
if (open2) {
|
|
20588
20591
|
var prefix = consumeText();
|
|
20589
20592
|
var name_1 = tryConsume("NAME") || "";
|
|
20590
20593
|
var pattern_1 = tryConsume("PATTERN") || "";
|
|
@@ -21124,10 +21127,10 @@ var require_superstatic = __commonJS({
|
|
|
21124
21127
|
delete parsedDestination.path;
|
|
21125
21128
|
delete parsedDestination.search;
|
|
21126
21129
|
delete parsedDestination.host;
|
|
21127
|
-
let { pathname, hash, query, hostname, ...rest } = parsedDestination;
|
|
21130
|
+
let { pathname, hash, query, hostname: hostname2, ...rest } = parsedDestination;
|
|
21128
21131
|
pathname = unescapeSegments(pathname || "");
|
|
21129
21132
|
hash = unescapeSegments(hash || "");
|
|
21130
|
-
|
|
21133
|
+
hostname2 = unescapeSegments(hostname2 || "");
|
|
21131
21134
|
let destParams = /* @__PURE__ */ new Set();
|
|
21132
21135
|
const pathnameKeys = [];
|
|
21133
21136
|
const hashKeys = [];
|
|
@@ -21135,7 +21138,7 @@ var require_superstatic = __commonJS({
|
|
|
21135
21138
|
try {
|
|
21136
21139
|
pathToRegexp("528", pathname, pathnameKeys);
|
|
21137
21140
|
pathToRegexp("834", hash || "", hashKeys);
|
|
21138
|
-
pathToRegexp("712",
|
|
21141
|
+
pathToRegexp("712", hostname2 || "", hostnameKeys);
|
|
21139
21142
|
} catch (_) {
|
|
21140
21143
|
}
|
|
21141
21144
|
destParams = new Set(
|
|
@@ -21143,7 +21146,7 @@ var require_superstatic = __commonJS({
|
|
|
21143
21146
|
);
|
|
21144
21147
|
pathname = safelyCompile(pathname, indexes, true);
|
|
21145
21148
|
hash = hash ? safelyCompile(hash, indexes, true) : null;
|
|
21146
|
-
|
|
21149
|
+
hostname2 = hostname2 ? safelyCompile(hostname2, indexes, true) : null;
|
|
21147
21150
|
for (const [key, strOrArray] of Object.entries(query)) {
|
|
21148
21151
|
if (Array.isArray(strOrArray)) {
|
|
21149
21152
|
query[key] = strOrArray.map(
|
|
@@ -21173,7 +21176,7 @@ var require_superstatic = __commonJS({
|
|
|
21173
21176
|
}
|
|
21174
21177
|
destination = (0, import_url4.format)({
|
|
21175
21178
|
...rest,
|
|
21176
|
-
hostname,
|
|
21179
|
+
hostname: hostname2,
|
|
21177
21180
|
pathname,
|
|
21178
21181
|
query,
|
|
21179
21182
|
hash
|
|
@@ -22370,8 +22373,8 @@ var require_dist5 = __commonJS({
|
|
|
22370
22373
|
}
|
|
22371
22374
|
if (destination) {
|
|
22372
22375
|
try {
|
|
22373
|
-
const { hostname, pathname, query } = (0, import_url4.parse)(destination, true);
|
|
22374
|
-
(0, import_superstatic.sourceToRegex)(
|
|
22376
|
+
const { hostname: hostname2, pathname, query } = (0, import_url4.parse)(destination, true);
|
|
22377
|
+
(0, import_superstatic.sourceToRegex)(hostname2 || "").segments.forEach(
|
|
22375
22378
|
(name) => destinationSegments.add(name)
|
|
22376
22379
|
);
|
|
22377
22380
|
(0, import_superstatic.sourceToRegex)(pathname || "").segments.forEach(
|
|
@@ -27956,7 +27959,13 @@ var require_detect_services = __commonJS({
|
|
|
27956
27959
|
return inferredConfig;
|
|
27957
27960
|
}
|
|
27958
27961
|
async function detectServices3(options) {
|
|
27959
|
-
const {
|
|
27962
|
+
const {
|
|
27963
|
+
fs: fs5,
|
|
27964
|
+
workPath,
|
|
27965
|
+
detectEntrypoint,
|
|
27966
|
+
configuredServices: providedConfiguredServices,
|
|
27967
|
+
configuredServicesType
|
|
27968
|
+
} = options;
|
|
27960
27969
|
const scopedFs = workPath ? fs5.chdir(workPath) : fs5;
|
|
27961
27970
|
const { config: vercelConfig, error: configError } = await (0, import_utils4.readVercelConfig)(scopedFs);
|
|
27962
27971
|
if (configError) {
|
|
@@ -27969,8 +27978,9 @@ var require_detect_services = __commonJS({
|
|
|
27969
27978
|
warnings: []
|
|
27970
27979
|
});
|
|
27971
27980
|
}
|
|
27972
|
-
const
|
|
27973
|
-
const
|
|
27981
|
+
const hasProvidedConfiguredServices = providedConfiguredServices && Object.keys(providedConfiguredServices).length > 0;
|
|
27982
|
+
const hasNonEmptyPublicServicesConfig = hasProvidedConfiguredServices && configuredServicesType === "services" || !hasProvidedConfiguredServices && vercelConfig?.services && Object.keys(vercelConfig.services).length > 0;
|
|
27983
|
+
const configuredServices = hasProvidedConfiguredServices ? providedConfiguredServices : hasNonEmptyPublicServicesConfig ? vercelConfig?.services : vercelConfig?.experimentalServices;
|
|
27974
27984
|
const hasConfiguredServices = configuredServices && Object.keys(configuredServices).length > 0;
|
|
27975
27985
|
if (!hasConfiguredServices) {
|
|
27976
27986
|
const detectors = [
|
|
@@ -28338,7 +28348,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28338
28348
|
LocalFileSystemDetector: () => LocalFileSystemDetector4
|
|
28339
28349
|
});
|
|
28340
28350
|
module.exports = __toCommonJS2(local_file_system_detector_exports);
|
|
28341
|
-
var
|
|
28351
|
+
var import_promises6 = __toESM2(__require("fs/promises"));
|
|
28342
28352
|
var import_path12 = __require("path");
|
|
28343
28353
|
var import_filesystem = require_filesystem();
|
|
28344
28354
|
var import_error_utils5 = require_dist();
|
|
@@ -28349,7 +28359,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28349
28359
|
}
|
|
28350
28360
|
async _hasPath(name) {
|
|
28351
28361
|
try {
|
|
28352
|
-
await
|
|
28362
|
+
await import_promises6.default.stat(this.getFilePath(name));
|
|
28353
28363
|
return true;
|
|
28354
28364
|
} catch (err) {
|
|
28355
28365
|
if ((0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT") {
|
|
@@ -28359,15 +28369,15 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28359
28369
|
}
|
|
28360
28370
|
}
|
|
28361
28371
|
_readFile(name) {
|
|
28362
|
-
return
|
|
28372
|
+
return import_promises6.default.readFile(this.getFilePath(name));
|
|
28363
28373
|
}
|
|
28364
28374
|
async _isFile(name) {
|
|
28365
|
-
const stat2 = await
|
|
28375
|
+
const stat2 = await import_promises6.default.stat(this.getFilePath(name));
|
|
28366
28376
|
return stat2.isFile();
|
|
28367
28377
|
}
|
|
28368
28378
|
async _readdir(dir) {
|
|
28369
28379
|
const dirPath = this.getFilePath(dir);
|
|
28370
|
-
const entries = await
|
|
28380
|
+
const entries = await import_promises6.default.readdir(dirPath, { withFileTypes: true });
|
|
28371
28381
|
const result = [];
|
|
28372
28382
|
for (const entry of entries) {
|
|
28373
28383
|
let type;
|
|
@@ -28432,7 +28442,12 @@ var require_get_services_builders = __commonJS({
|
|
|
28432
28442
|
return env === "1" || env?.toLowerCase() === "true";
|
|
28433
28443
|
}
|
|
28434
28444
|
async function getServicesBuilders2(options) {
|
|
28435
|
-
const {
|
|
28445
|
+
const {
|
|
28446
|
+
workPath,
|
|
28447
|
+
configuredServices,
|
|
28448
|
+
configuredServicesType,
|
|
28449
|
+
projectFramework
|
|
28450
|
+
} = options;
|
|
28436
28451
|
const hasServiceDefinitions = configuredServices != null && Object.keys(configuredServices).length > 0;
|
|
28437
28452
|
if (projectFramework === "services" && !hasServiceDefinitions && !isExperimentalServicesAutoDetectionEnabled()) {
|
|
28438
28453
|
return {
|
|
@@ -28471,7 +28486,11 @@ var require_get_services_builders = __commonJS({
|
|
|
28471
28486
|
};
|
|
28472
28487
|
}
|
|
28473
28488
|
const fs5 = new import_local_file_system_detector.LocalFileSystemDetector(workPath);
|
|
28474
|
-
const result = await (0, import_detect_services2.detectServices)({
|
|
28489
|
+
const result = await (0, import_detect_services2.detectServices)({
|
|
28490
|
+
fs: fs5,
|
|
28491
|
+
configuredServices,
|
|
28492
|
+
configuredServicesType
|
|
28493
|
+
});
|
|
28475
28494
|
const warningResponses = result.warnings.map((w) => ({
|
|
28476
28495
|
code: w.code,
|
|
28477
28496
|
message: w.message
|
|
@@ -28632,11 +28651,13 @@ var require_detect_builders = __commonJS({
|
|
|
28632
28651
|
const { services, experimentalServices, projectSettings = {} } = options;
|
|
28633
28652
|
const { framework } = projectSettings;
|
|
28634
28653
|
const configuredServices = services ?? experimentalServices;
|
|
28654
|
+
const configuredServicesType = services != null ? "services" : "experimentalServices";
|
|
28635
28655
|
const hasServicesConfig = configuredServices != null && typeof configuredServices === "object";
|
|
28636
28656
|
if (hasServicesConfig || framework === "services") {
|
|
28637
28657
|
return (0, import_get_services_builders.getServicesBuilders)({
|
|
28638
28658
|
workPath: options.workPath,
|
|
28639
28659
|
configuredServices,
|
|
28660
|
+
configuredServicesType,
|
|
28640
28661
|
projectFramework: framework
|
|
28641
28662
|
});
|
|
28642
28663
|
}
|
|
@@ -30221,11 +30242,11 @@ var require_brace_expansion2 = __commonJS({
|
|
|
30221
30242
|
if (pad) {
|
|
30222
30243
|
var need = width - c.length;
|
|
30223
30244
|
if (need > 0) {
|
|
30224
|
-
var
|
|
30245
|
+
var z2 = new Array(need + 1).join("0");
|
|
30225
30246
|
if (i < 0)
|
|
30226
|
-
c = "-" +
|
|
30247
|
+
c = "-" + z2 + c.slice(1);
|
|
30227
30248
|
else
|
|
30228
|
-
c =
|
|
30249
|
+
c = z2 + c;
|
|
30229
30250
|
}
|
|
30230
30251
|
}
|
|
30231
30252
|
}
|
|
@@ -33943,6 +33964,330 @@ var require_json_parse_better_errors = __commonJS({
|
|
|
33943
33964
|
}
|
|
33944
33965
|
});
|
|
33945
33966
|
|
|
33967
|
+
// ../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js
|
|
33968
|
+
var require_is_docker = __commonJS({
|
|
33969
|
+
"../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports, module) {
|
|
33970
|
+
"use strict";
|
|
33971
|
+
var fs5 = __require("fs");
|
|
33972
|
+
var isDocker;
|
|
33973
|
+
function hasDockerEnv() {
|
|
33974
|
+
try {
|
|
33975
|
+
fs5.statSync("/.dockerenv");
|
|
33976
|
+
return true;
|
|
33977
|
+
} catch (_) {
|
|
33978
|
+
return false;
|
|
33979
|
+
}
|
|
33980
|
+
}
|
|
33981
|
+
function hasDockerCGroup() {
|
|
33982
|
+
try {
|
|
33983
|
+
return fs5.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
33984
|
+
} catch (_) {
|
|
33985
|
+
return false;
|
|
33986
|
+
}
|
|
33987
|
+
}
|
|
33988
|
+
module.exports = () => {
|
|
33989
|
+
if (isDocker === void 0) {
|
|
33990
|
+
isDocker = hasDockerEnv() || hasDockerCGroup();
|
|
33991
|
+
}
|
|
33992
|
+
return isDocker;
|
|
33993
|
+
};
|
|
33994
|
+
}
|
|
33995
|
+
});
|
|
33996
|
+
|
|
33997
|
+
// ../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js
|
|
33998
|
+
var require_is_wsl = __commonJS({
|
|
33999
|
+
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports, module) {
|
|
34000
|
+
"use strict";
|
|
34001
|
+
var os3 = __require("os");
|
|
34002
|
+
var fs5 = __require("fs");
|
|
34003
|
+
var isDocker = require_is_docker();
|
|
34004
|
+
var isWsl = () => {
|
|
34005
|
+
if (process.platform !== "linux") {
|
|
34006
|
+
return false;
|
|
34007
|
+
}
|
|
34008
|
+
if (os3.release().toLowerCase().includes("microsoft")) {
|
|
34009
|
+
if (isDocker()) {
|
|
34010
|
+
return false;
|
|
34011
|
+
}
|
|
34012
|
+
return true;
|
|
34013
|
+
}
|
|
34014
|
+
try {
|
|
34015
|
+
return fs5.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
|
|
34016
|
+
} catch (_) {
|
|
34017
|
+
return false;
|
|
34018
|
+
}
|
|
34019
|
+
};
|
|
34020
|
+
if (process.env.__IS_WSL_TEST__) {
|
|
34021
|
+
module.exports = isWsl;
|
|
34022
|
+
} else {
|
|
34023
|
+
module.exports = isWsl();
|
|
34024
|
+
}
|
|
34025
|
+
}
|
|
34026
|
+
});
|
|
34027
|
+
|
|
34028
|
+
// ../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js
|
|
34029
|
+
var require_define_lazy_prop = __commonJS({
|
|
34030
|
+
"../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js"(exports, module) {
|
|
34031
|
+
"use strict";
|
|
34032
|
+
module.exports = (object, propertyName, fn) => {
|
|
34033
|
+
const define2 = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
|
|
34034
|
+
Object.defineProperty(object, propertyName, {
|
|
34035
|
+
configurable: true,
|
|
34036
|
+
enumerable: true,
|
|
34037
|
+
get() {
|
|
34038
|
+
const result = fn();
|
|
34039
|
+
define2(result);
|
|
34040
|
+
return result;
|
|
34041
|
+
},
|
|
34042
|
+
set(value) {
|
|
34043
|
+
define2(value);
|
|
34044
|
+
}
|
|
34045
|
+
});
|
|
34046
|
+
return object;
|
|
34047
|
+
};
|
|
34048
|
+
}
|
|
34049
|
+
});
|
|
34050
|
+
|
|
34051
|
+
// ../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js
|
|
34052
|
+
var require_open = __commonJS({
|
|
34053
|
+
"../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js"(exports, module) {
|
|
34054
|
+
var path = __require("path");
|
|
34055
|
+
var childProcess = __require("child_process");
|
|
34056
|
+
var { promises: fs5, constants: fsConstants } = __require("fs");
|
|
34057
|
+
var isWsl = require_is_wsl();
|
|
34058
|
+
var isDocker = require_is_docker();
|
|
34059
|
+
var defineLazyProperty = require_define_lazy_prop();
|
|
34060
|
+
var localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
34061
|
+
var { platform, arch } = process;
|
|
34062
|
+
var getWslDrivesMountPoint = (() => {
|
|
34063
|
+
const defaultMountPoint = "/mnt/";
|
|
34064
|
+
let mountPoint;
|
|
34065
|
+
return async function() {
|
|
34066
|
+
if (mountPoint) {
|
|
34067
|
+
return mountPoint;
|
|
34068
|
+
}
|
|
34069
|
+
const configFilePath = "/etc/wsl.conf";
|
|
34070
|
+
let isConfigFileExists = false;
|
|
34071
|
+
try {
|
|
34072
|
+
await fs5.access(configFilePath, fsConstants.F_OK);
|
|
34073
|
+
isConfigFileExists = true;
|
|
34074
|
+
} catch {
|
|
34075
|
+
}
|
|
34076
|
+
if (!isConfigFileExists) {
|
|
34077
|
+
return defaultMountPoint;
|
|
34078
|
+
}
|
|
34079
|
+
const configContent = await fs5.readFile(configFilePath, { encoding: "utf8" });
|
|
34080
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
34081
|
+
if (!configMountPoint) {
|
|
34082
|
+
return defaultMountPoint;
|
|
34083
|
+
}
|
|
34084
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
34085
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
34086
|
+
return mountPoint;
|
|
34087
|
+
};
|
|
34088
|
+
})();
|
|
34089
|
+
var pTryEach = async (array, mapper) => {
|
|
34090
|
+
let latestError;
|
|
34091
|
+
for (const item of array) {
|
|
34092
|
+
try {
|
|
34093
|
+
return await mapper(item);
|
|
34094
|
+
} catch (error) {
|
|
34095
|
+
latestError = error;
|
|
34096
|
+
}
|
|
34097
|
+
}
|
|
34098
|
+
throw latestError;
|
|
34099
|
+
};
|
|
34100
|
+
var baseOpen = async (options) => {
|
|
34101
|
+
options = {
|
|
34102
|
+
wait: false,
|
|
34103
|
+
background: false,
|
|
34104
|
+
newInstance: false,
|
|
34105
|
+
allowNonzeroExitCode: false,
|
|
34106
|
+
...options
|
|
34107
|
+
};
|
|
34108
|
+
if (Array.isArray(options.app)) {
|
|
34109
|
+
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
34110
|
+
...options,
|
|
34111
|
+
app: singleApp
|
|
34112
|
+
}));
|
|
34113
|
+
}
|
|
34114
|
+
let { name: app, arguments: appArguments = [] } = options.app || {};
|
|
34115
|
+
appArguments = [...appArguments];
|
|
34116
|
+
if (Array.isArray(app)) {
|
|
34117
|
+
return pTryEach(app, (appName) => baseOpen({
|
|
34118
|
+
...options,
|
|
34119
|
+
app: {
|
|
34120
|
+
name: appName,
|
|
34121
|
+
arguments: appArguments
|
|
34122
|
+
}
|
|
34123
|
+
}));
|
|
34124
|
+
}
|
|
34125
|
+
let command;
|
|
34126
|
+
const cliArguments = [];
|
|
34127
|
+
const childProcessOptions = {};
|
|
34128
|
+
if (platform === "darwin") {
|
|
34129
|
+
command = "open";
|
|
34130
|
+
if (options.wait) {
|
|
34131
|
+
cliArguments.push("--wait-apps");
|
|
34132
|
+
}
|
|
34133
|
+
if (options.background) {
|
|
34134
|
+
cliArguments.push("--background");
|
|
34135
|
+
}
|
|
34136
|
+
if (options.newInstance) {
|
|
34137
|
+
cliArguments.push("--new");
|
|
34138
|
+
}
|
|
34139
|
+
if (app) {
|
|
34140
|
+
cliArguments.push("-a", app);
|
|
34141
|
+
}
|
|
34142
|
+
} else if (platform === "win32" || isWsl && !isDocker()) {
|
|
34143
|
+
const mountPoint = await getWslDrivesMountPoint();
|
|
34144
|
+
command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
34145
|
+
cliArguments.push(
|
|
34146
|
+
"-NoProfile",
|
|
34147
|
+
"-NonInteractive",
|
|
34148
|
+
"\u2013ExecutionPolicy",
|
|
34149
|
+
"Bypass",
|
|
34150
|
+
"-EncodedCommand"
|
|
34151
|
+
);
|
|
34152
|
+
if (!isWsl) {
|
|
34153
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
34154
|
+
}
|
|
34155
|
+
const encodedArguments = ["Start"];
|
|
34156
|
+
if (options.wait) {
|
|
34157
|
+
encodedArguments.push("-Wait");
|
|
34158
|
+
}
|
|
34159
|
+
if (app) {
|
|
34160
|
+
encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
|
|
34161
|
+
if (options.target) {
|
|
34162
|
+
appArguments.unshift(options.target);
|
|
34163
|
+
}
|
|
34164
|
+
} else if (options.target) {
|
|
34165
|
+
encodedArguments.push(`"${options.target}"`);
|
|
34166
|
+
}
|
|
34167
|
+
if (appArguments.length > 0) {
|
|
34168
|
+
appArguments = appArguments.map((arg) => `"\`"${arg}\`""`);
|
|
34169
|
+
encodedArguments.push(appArguments.join(","));
|
|
34170
|
+
}
|
|
34171
|
+
options.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
34172
|
+
} else {
|
|
34173
|
+
if (app) {
|
|
34174
|
+
command = app;
|
|
34175
|
+
} else {
|
|
34176
|
+
const isBundled = !__dirname || __dirname === "/";
|
|
34177
|
+
let exeLocalXdgOpen = false;
|
|
34178
|
+
try {
|
|
34179
|
+
await fs5.access(localXdgOpenPath, fsConstants.X_OK);
|
|
34180
|
+
exeLocalXdgOpen = true;
|
|
34181
|
+
} catch {
|
|
34182
|
+
}
|
|
34183
|
+
const useSystemXdgOpen = process.versions.electron || platform === "android" || isBundled || !exeLocalXdgOpen;
|
|
34184
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
34185
|
+
}
|
|
34186
|
+
if (appArguments.length > 0) {
|
|
34187
|
+
cliArguments.push(...appArguments);
|
|
34188
|
+
}
|
|
34189
|
+
if (!options.wait) {
|
|
34190
|
+
childProcessOptions.stdio = "ignore";
|
|
34191
|
+
childProcessOptions.detached = true;
|
|
34192
|
+
}
|
|
34193
|
+
}
|
|
34194
|
+
if (options.target) {
|
|
34195
|
+
cliArguments.push(options.target);
|
|
34196
|
+
}
|
|
34197
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
34198
|
+
cliArguments.push("--args", ...appArguments);
|
|
34199
|
+
}
|
|
34200
|
+
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
34201
|
+
if (options.wait) {
|
|
34202
|
+
return new Promise((resolve4, reject) => {
|
|
34203
|
+
subprocess.once("error", reject);
|
|
34204
|
+
subprocess.once("close", (exitCode) => {
|
|
34205
|
+
if (options.allowNonzeroExitCode && exitCode > 0) {
|
|
34206
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
34207
|
+
return;
|
|
34208
|
+
}
|
|
34209
|
+
resolve4(subprocess);
|
|
34210
|
+
});
|
|
34211
|
+
});
|
|
34212
|
+
}
|
|
34213
|
+
subprocess.unref();
|
|
34214
|
+
return subprocess;
|
|
34215
|
+
};
|
|
34216
|
+
var open2 = (target, options) => {
|
|
34217
|
+
if (typeof target !== "string") {
|
|
34218
|
+
throw new TypeError("Expected a `target`");
|
|
34219
|
+
}
|
|
34220
|
+
return baseOpen({
|
|
34221
|
+
...options,
|
|
34222
|
+
target
|
|
34223
|
+
});
|
|
34224
|
+
};
|
|
34225
|
+
var openApp = (name, options) => {
|
|
34226
|
+
if (typeof name !== "string") {
|
|
34227
|
+
throw new TypeError("Expected a `name`");
|
|
34228
|
+
}
|
|
34229
|
+
const { arguments: appArguments = [] } = options || {};
|
|
34230
|
+
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
|
|
34231
|
+
throw new TypeError("Expected `appArguments` as Array type");
|
|
34232
|
+
}
|
|
34233
|
+
return baseOpen({
|
|
34234
|
+
...options,
|
|
34235
|
+
app: {
|
|
34236
|
+
name,
|
|
34237
|
+
arguments: appArguments
|
|
34238
|
+
}
|
|
34239
|
+
});
|
|
34240
|
+
};
|
|
34241
|
+
function detectArchBinary(binary) {
|
|
34242
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
34243
|
+
return binary;
|
|
34244
|
+
}
|
|
34245
|
+
const { [arch]: archBinary } = binary;
|
|
34246
|
+
if (!archBinary) {
|
|
34247
|
+
throw new Error(`${arch} is not supported`);
|
|
34248
|
+
}
|
|
34249
|
+
return archBinary;
|
|
34250
|
+
}
|
|
34251
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
34252
|
+
if (wsl && isWsl) {
|
|
34253
|
+
return detectArchBinary(wsl);
|
|
34254
|
+
}
|
|
34255
|
+
if (!platformBinary) {
|
|
34256
|
+
throw new Error(`${platform} is not supported`);
|
|
34257
|
+
}
|
|
34258
|
+
return detectArchBinary(platformBinary);
|
|
34259
|
+
}
|
|
34260
|
+
var apps = {};
|
|
34261
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
34262
|
+
darwin: "google chrome",
|
|
34263
|
+
win32: "chrome",
|
|
34264
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
34265
|
+
}, {
|
|
34266
|
+
wsl: {
|
|
34267
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
34268
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
34269
|
+
}
|
|
34270
|
+
}));
|
|
34271
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
34272
|
+
darwin: "firefox",
|
|
34273
|
+
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
|
|
34274
|
+
linux: "firefox"
|
|
34275
|
+
}, {
|
|
34276
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
34277
|
+
}));
|
|
34278
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
34279
|
+
darwin: "microsoft edge",
|
|
34280
|
+
win32: "msedge",
|
|
34281
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
34282
|
+
}, {
|
|
34283
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
34284
|
+
}));
|
|
34285
|
+
open2.apps = apps;
|
|
34286
|
+
open2.openApp = openApp;
|
|
34287
|
+
module.exports = open2;
|
|
34288
|
+
}
|
|
34289
|
+
});
|
|
34290
|
+
|
|
33946
34291
|
// ../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js
|
|
33947
34292
|
var require_universalify2 = __commonJS({
|
|
33948
34293
|
"../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js"(exports) {
|
|
@@ -34222,11 +34567,11 @@ var require_utimes2 = __commonJS({
|
|
|
34222
34567
|
"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
|
|
34223
34568
|
"use strict";
|
|
34224
34569
|
var fs5 = require_graceful_fs();
|
|
34225
|
-
var
|
|
34570
|
+
var os3 = __require("os");
|
|
34226
34571
|
var path = __require("path");
|
|
34227
34572
|
function hasMillisResSync() {
|
|
34228
34573
|
let tmpfile = path.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
|
|
34229
|
-
tmpfile = path.join(
|
|
34574
|
+
tmpfile = path.join(os3.tmpdir(), tmpfile);
|
|
34230
34575
|
const d = /* @__PURE__ */ new Date(1435410243862);
|
|
34231
34576
|
fs5.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
|
|
34232
34577
|
const fd = fs5.openSync(tmpfile, "r+");
|
|
@@ -34236,7 +34581,7 @@ var require_utimes2 = __commonJS({
|
|
|
34236
34581
|
}
|
|
34237
34582
|
function hasMillisRes(callback) {
|
|
34238
34583
|
let tmpfile = path.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
|
|
34239
|
-
tmpfile = path.join(
|
|
34584
|
+
tmpfile = path.join(os3.tmpdir(), tmpfile);
|
|
34240
34585
|
const d = /* @__PURE__ */ new Date(1435410243862);
|
|
34241
34586
|
fs5.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
|
|
34242
34587
|
if (err)
|
|
@@ -35534,7 +35879,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
35534
35879
|
} catch (_) {
|
|
35535
35880
|
_fs = __require("fs");
|
|
35536
35881
|
}
|
|
35537
|
-
function
|
|
35882
|
+
function readFile7(file, options, callback) {
|
|
35538
35883
|
if (callback == null) {
|
|
35539
35884
|
callback = options;
|
|
35540
35885
|
options = {};
|
|
@@ -35603,7 +35948,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
35603
35948
|
var str = JSON.stringify(obj, options ? options.replacer : null, spaces);
|
|
35604
35949
|
return str.replace(/\n/g, EOL) + EOL;
|
|
35605
35950
|
}
|
|
35606
|
-
function
|
|
35951
|
+
function writeFile6(file, obj, options, callback) {
|
|
35607
35952
|
if (callback == null) {
|
|
35608
35953
|
callback = options;
|
|
35609
35954
|
options = {};
|
|
@@ -35633,9 +35978,9 @@ var require_jsonfile3 = __commonJS({
|
|
|
35633
35978
|
return content;
|
|
35634
35979
|
}
|
|
35635
35980
|
var jsonfile = {
|
|
35636
|
-
readFile:
|
|
35981
|
+
readFile: readFile7,
|
|
35637
35982
|
readFileSync,
|
|
35638
|
-
writeFile:
|
|
35983
|
+
writeFile: writeFile6,
|
|
35639
35984
|
writeFileSync
|
|
35640
35985
|
};
|
|
35641
35986
|
module.exports = jsonfile;
|
|
@@ -38533,9 +38878,9 @@ var require_path2 = __commonJS({
|
|
|
38533
38878
|
"use strict";
|
|
38534
38879
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38535
38880
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
38536
|
-
var
|
|
38881
|
+
var os3 = __require("os");
|
|
38537
38882
|
var path = __require("path");
|
|
38538
|
-
var IS_WINDOWS_PLATFORM =
|
|
38883
|
+
var IS_WINDOWS_PLATFORM = os3.platform() === "win32";
|
|
38539
38884
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
38540
38885
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
38541
38886
|
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
@@ -38667,9 +39012,9 @@ var require_is_glob = __commonJS({
|
|
|
38667
39012
|
}
|
|
38668
39013
|
}
|
|
38669
39014
|
if (str[index] === "\\") {
|
|
38670
|
-
var
|
|
39015
|
+
var open2 = str[index + 1];
|
|
38671
39016
|
index += 2;
|
|
38672
|
-
var close = chars[
|
|
39017
|
+
var close = chars[open2];
|
|
38673
39018
|
if (close) {
|
|
38674
39019
|
var n = str.indexOf(close, index);
|
|
38675
39020
|
if (n !== -1) {
|
|
@@ -38695,9 +39040,9 @@ var require_is_glob = __commonJS({
|
|
|
38695
39040
|
return true;
|
|
38696
39041
|
}
|
|
38697
39042
|
if (str[index] === "\\") {
|
|
38698
|
-
var
|
|
39043
|
+
var open2 = str[index + 1];
|
|
38699
39044
|
index += 2;
|
|
38700
|
-
var close = chars[
|
|
39045
|
+
var close = chars[open2];
|
|
38701
39046
|
if (close) {
|
|
38702
39047
|
var n = str.indexOf(close, index);
|
|
38703
39048
|
if (n !== -1) {
|
|
@@ -39685,7 +40030,7 @@ var require_parse2 = __commonJS({
|
|
|
39685
40030
|
continue;
|
|
39686
40031
|
}
|
|
39687
40032
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
39688
|
-
const
|
|
40033
|
+
const open2 = value;
|
|
39689
40034
|
let next;
|
|
39690
40035
|
if (options.keepQuotes !== true) {
|
|
39691
40036
|
value = "";
|
|
@@ -39695,7 +40040,7 @@ var require_parse2 = __commonJS({
|
|
|
39695
40040
|
value += next + advance();
|
|
39696
40041
|
continue;
|
|
39697
40042
|
}
|
|
39698
|
-
if (next ===
|
|
40043
|
+
if (next === open2) {
|
|
39699
40044
|
if (options.keepQuotes === true)
|
|
39700
40045
|
value += next;
|
|
39701
40046
|
break;
|
|
@@ -39739,8 +40084,8 @@ var require_parse2 = __commonJS({
|
|
|
39739
40084
|
if (value === CHAR_COMMA && depth > 0) {
|
|
39740
40085
|
if (block.ranges > 0) {
|
|
39741
40086
|
block.ranges = 0;
|
|
39742
|
-
const
|
|
39743
|
-
block.nodes = [
|
|
40087
|
+
const open2 = block.nodes.shift();
|
|
40088
|
+
block.nodes = [open2, { type: "text", value: stringify(block) }];
|
|
39744
40089
|
}
|
|
39745
40090
|
push({ type: "comma", value });
|
|
39746
40091
|
block.commas++;
|
|
@@ -40843,15 +41188,15 @@ var require_parse3 = __commonJS({
|
|
|
40843
41188
|
}
|
|
40844
41189
|
if (value === "{" && opts.nobrace !== true) {
|
|
40845
41190
|
increment("braces");
|
|
40846
|
-
const
|
|
41191
|
+
const open2 = {
|
|
40847
41192
|
type: "brace",
|
|
40848
41193
|
value,
|
|
40849
41194
|
output: "(",
|
|
40850
41195
|
outputIndex: state.output.length,
|
|
40851
41196
|
tokensIndex: state.tokens.length
|
|
40852
41197
|
};
|
|
40853
|
-
braces.push(
|
|
40854
|
-
push(
|
|
41198
|
+
braces.push(open2);
|
|
41199
|
+
push(open2);
|
|
40855
41200
|
continue;
|
|
40856
41201
|
}
|
|
40857
41202
|
if (value === "}") {
|
|
@@ -43854,8 +44199,8 @@ var require_settings4 = __commonJS({
|
|
|
43854
44199
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43855
44200
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
43856
44201
|
var fs5 = __require("fs");
|
|
43857
|
-
var
|
|
43858
|
-
var CPU_COUNT = Math.max(
|
|
44202
|
+
var os3 = __require("os");
|
|
44203
|
+
var CPU_COUNT = Math.max(os3.cpus().length, 1);
|
|
43859
44204
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
43860
44205
|
lstat: fs5.lstat,
|
|
43861
44206
|
lstatSync: fs5.lstatSync,
|
|
@@ -44046,14 +44391,14 @@ var require_utils8 = __commonJS({
|
|
|
44046
44391
|
});
|
|
44047
44392
|
module.exports = __toCommonJS2(utils_exports);
|
|
44048
44393
|
var import_node_fs2 = __toESM2(__require("fs"), 1);
|
|
44049
|
-
var
|
|
44394
|
+
var import_node_path3 = __require("path");
|
|
44050
44395
|
var CONFIGURATION_FILENAMES = [
|
|
44051
44396
|
"microfrontends.jsonc",
|
|
44052
44397
|
"microfrontends.json"
|
|
44053
44398
|
];
|
|
44054
44399
|
function findConfig({ dir }) {
|
|
44055
44400
|
for (const filename of CONFIGURATION_FILENAMES) {
|
|
44056
|
-
const maybeConfig = (0,
|
|
44401
|
+
const maybeConfig = (0, import_node_path3.join)(dir, filename);
|
|
44057
44402
|
if (import_node_fs2.default.existsSync(maybeConfig)) {
|
|
44058
44403
|
return maybeConfig;
|
|
44059
44404
|
}
|
|
@@ -44273,11 +44618,11 @@ var require_utils9 = __commonJS({
|
|
|
44273
44618
|
prepareFiles: () => prepareFiles
|
|
44274
44619
|
});
|
|
44275
44620
|
module.exports = __toCommonJS2(utils_exports);
|
|
44276
|
-
var
|
|
44621
|
+
var import_node_fetch2 = __toESM2(require_lib2());
|
|
44277
44622
|
var import_path12 = __require("path");
|
|
44278
44623
|
var import_url4 = __require("url");
|
|
44279
44624
|
var import_ignore = __toESM2(require_ignore());
|
|
44280
|
-
var
|
|
44625
|
+
var import_pkg2 = require_pkg();
|
|
44281
44626
|
var import_build_utils6 = __require("@vercel/build-utils");
|
|
44282
44627
|
var import_async_sema = require_lib7();
|
|
44283
44628
|
var import_fs_extra9 = require_lib6();
|
|
@@ -44546,17 +44891,17 @@ ${clearRelative(ignoreFile)}`);
|
|
|
44546
44891
|
url = parsedUrl.toString();
|
|
44547
44892
|
delete opts.teamId;
|
|
44548
44893
|
}
|
|
44549
|
-
const
|
|
44894
|
+
const userAgent2 = opts.userAgent || `client-v${import_pkg2.pkgVersion}`;
|
|
44550
44895
|
delete opts.userAgent;
|
|
44551
44896
|
opts.headers = {
|
|
44552
44897
|
...opts.headers,
|
|
44553
44898
|
authorization: `Bearer ${token}`,
|
|
44554
44899
|
accept: "application/json",
|
|
44555
|
-
"user-agent":
|
|
44900
|
+
"user-agent": userAgent2
|
|
44556
44901
|
};
|
|
44557
44902
|
debug(`${opts.method || "GET"} ${url}`);
|
|
44558
44903
|
time = Date.now();
|
|
44559
|
-
const res = await (0,
|
|
44904
|
+
const res = await (0, import_node_fetch2.default)(url, opts);
|
|
44560
44905
|
debug(`DONE in ${Date.now() - time}ms: ${opts.method || "GET"} ${url}`);
|
|
44561
44906
|
semaphore.release();
|
|
44562
44907
|
return res;
|
|
@@ -44722,7 +45067,7 @@ var require_check_deployment_status = __commonJS({
|
|
|
44722
45067
|
}
|
|
44723
45068
|
}
|
|
44724
45069
|
async function* checkDeploymentStatus2(deployment, clientOptions) {
|
|
44725
|
-
const { token, teamId, apiUrl, userAgent } = clientOptions;
|
|
45070
|
+
const { token, teamId, apiUrl, userAgent: userAgent2 } = clientOptions;
|
|
44726
45071
|
const debug = (0, import_utils22.createDebug)(clientOptions.debug);
|
|
44727
45072
|
let deploymentState = deployment;
|
|
44728
45073
|
const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)();
|
|
@@ -44742,7 +45087,7 @@ var require_check_deployment_status = __commonJS({
|
|
|
44742
45087
|
deploymentResponse = await (0, import_utils4.fetchApi)(
|
|
44743
45088
|
`${apiDeployments}/${deployment.id || deployment.deploymentId}${teamId ? `?teamId=${teamId}` : ""}`,
|
|
44744
45089
|
token,
|
|
44745
|
-
{ apiUrl, userAgent, agent: clientOptions.agent }
|
|
45090
|
+
{ apiUrl, userAgent: userAgent2, agent: clientOptions.agent }
|
|
44746
45091
|
);
|
|
44747
45092
|
retriesLeft--;
|
|
44748
45093
|
if (retriesLeft == 0) {
|
|
@@ -45955,7 +46300,7 @@ var require_BufferList = __commonJS({
|
|
|
45955
46300
|
this.head = this.tail = null;
|
|
45956
46301
|
this.length = 0;
|
|
45957
46302
|
};
|
|
45958
|
-
BufferList.prototype.join = function
|
|
46303
|
+
BufferList.prototype.join = function join12(s) {
|
|
45959
46304
|
if (this.length === 0)
|
|
45960
46305
|
return "";
|
|
45961
46306
|
var p = this.head;
|
|
@@ -49184,8 +49529,8 @@ var require_tar_fs = __commonJS({
|
|
|
49184
49529
|
var mkdirp = require_mkdirp();
|
|
49185
49530
|
var fs5 = __require("fs");
|
|
49186
49531
|
var path = __require("path");
|
|
49187
|
-
var
|
|
49188
|
-
var win32 =
|
|
49532
|
+
var os3 = __require("os");
|
|
49533
|
+
var win32 = os3.platform() === "win32";
|
|
49189
49534
|
var noop = function() {
|
|
49190
49535
|
};
|
|
49191
49536
|
var echo = function(name) {
|
|
@@ -49545,7 +49890,7 @@ var require_archive = __commonJS({
|
|
|
49545
49890
|
createTgzFiles: () => createTgzFiles
|
|
49546
49891
|
});
|
|
49547
49892
|
module.exports = __toCommonJS2(archive_exports);
|
|
49548
|
-
var
|
|
49893
|
+
var import_node_path3 = __require("path");
|
|
49549
49894
|
var import_node_zlib = __require("zlib");
|
|
49550
49895
|
var import_build_utils6 = __require("@vercel/build-utils");
|
|
49551
49896
|
var import_tar_fs = __toESM2(require_tar_fs());
|
|
@@ -49554,7 +49899,7 @@ var require_archive = __commonJS({
|
|
|
49554
49899
|
const filesToArchive = exclude ? fileList.filter((file) => !exclude.includes(file)) : fileList;
|
|
49555
49900
|
debug?.("Packing tarball");
|
|
49556
49901
|
const tarStream = import_tar_fs.default.pack(workPath, {
|
|
49557
|
-
entries: filesToArchive.map((file) => (0,
|
|
49902
|
+
entries: filesToArchive.map((file) => (0, import_node_path3.relative)(workPath, file))
|
|
49558
49903
|
}).pipe((0, import_node_zlib.createGzip)());
|
|
49559
49904
|
const chunkedTarBuffers = await (0, import_build_utils6.streamToBufferChunks)(tarStream);
|
|
49560
49905
|
debug?.(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
|
|
@@ -49562,7 +49907,7 @@ var require_archive = __commonJS({
|
|
|
49562
49907
|
chunkedTarBuffers.map((chunk, index) => [
|
|
49563
49908
|
(0, import_hashes.hash)(chunk),
|
|
49564
49909
|
{
|
|
49565
|
-
names: [(0,
|
|
49910
|
+
names: [(0, import_node_path3.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
|
|
49566
49911
|
data: chunk,
|
|
49567
49912
|
mode: 438
|
|
49568
49913
|
}
|
|
@@ -50029,8 +50374,8 @@ var require_dist7 = __commonJS({
|
|
|
50029
50374
|
|
|
50030
50375
|
// src/util/compile-vercel-config.ts
|
|
50031
50376
|
var import_dotenv = __toESM(require_main(), 1);
|
|
50032
|
-
import { mkdir, readFile as
|
|
50033
|
-
import { join as
|
|
50377
|
+
import { mkdir, readFile as readFile6, writeFile as writeFile5, unlink, access as access2 } from "fs/promises";
|
|
50378
|
+
import { join as join11, basename as basename3 } from "path";
|
|
50034
50379
|
import { fork } from "child_process";
|
|
50035
50380
|
import { parse as tomlParse2 } from "smol-toml";
|
|
50036
50381
|
|
|
@@ -50038,7 +50383,7 @@ import { parse as tomlParse2 } from "smol-toml";
|
|
|
50038
50383
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
50039
50384
|
var import_fs_extra8 = __toESM(require_lib3(), 1);
|
|
50040
50385
|
import fs4 from "fs";
|
|
50041
|
-
import { join as
|
|
50386
|
+
import { join as join10, relative } from "path";
|
|
50042
50387
|
import { promisify } from "util";
|
|
50043
50388
|
|
|
50044
50389
|
// src/util/projects/get-project-by-id-or-name.ts
|
|
@@ -51786,7 +52131,7 @@ function repoInfoToUrl(info) {
|
|
|
51786
52131
|
|
|
51787
52132
|
// src/util/git/connect-git-provider.ts
|
|
51788
52133
|
var import_chalk5 = __toESM(require_source(), 1);
|
|
51789
|
-
import { URL } from "url";
|
|
52134
|
+
import { URL as URL2 } from "url";
|
|
51790
52135
|
|
|
51791
52136
|
// ../../node_modules/.pnpm/@inquirer+select@2.2.2/node_modules/@inquirer/select/dist/esm/index.mjs
|
|
51792
52137
|
var import_chalk4 = __toESM(require_source2(), 1);
|
|
@@ -52057,12 +52402,12 @@ function buildRepoUrl(provider, org, repo) {
|
|
|
52057
52402
|
function getURL(input) {
|
|
52058
52403
|
let url = null;
|
|
52059
52404
|
try {
|
|
52060
|
-
url = new
|
|
52405
|
+
url = new URL2(input);
|
|
52061
52406
|
} catch {
|
|
52062
52407
|
}
|
|
52063
52408
|
if (!url) {
|
|
52064
52409
|
try {
|
|
52065
|
-
url = new
|
|
52410
|
+
url = new URL2(`ssh://${input.replace(":", "/")}`);
|
|
52066
52411
|
} catch {
|
|
52067
52412
|
}
|
|
52068
52413
|
}
|
|
@@ -52131,7 +52476,7 @@ async function selectAndParseRemoteUrl(client, remoteUrls) {
|
|
|
52131
52476
|
}
|
|
52132
52477
|
async function checkExistsAndConnect({
|
|
52133
52478
|
client,
|
|
52134
|
-
confirm,
|
|
52479
|
+
confirm: confirm2,
|
|
52135
52480
|
org,
|
|
52136
52481
|
project,
|
|
52137
52482
|
gitProviderLink,
|
|
@@ -52168,7 +52513,7 @@ async function checkExistsAndConnect({
|
|
|
52168
52513
|
}
|
|
52169
52514
|
const shouldReplaceRepo = await confirmRepoConnect(
|
|
52170
52515
|
client,
|
|
52171
|
-
|
|
52516
|
+
confirm2,
|
|
52172
52517
|
connectedProvider,
|
|
52173
52518
|
connectedRepoPath
|
|
52174
52519
|
);
|
|
@@ -52686,7 +53031,7 @@ function findProjectsFromPath(projects, path) {
|
|
|
52686
53031
|
}
|
|
52687
53032
|
|
|
52688
53033
|
// src/commands/env/pull.ts
|
|
52689
|
-
var
|
|
53034
|
+
var import_chalk13 = __toESM(require_source(), 1);
|
|
52690
53035
|
var import_fs_extra5 = __toESM(require_lib3(), 1);
|
|
52691
53036
|
import { closeSync, openSync, readSync } from "fs";
|
|
52692
53037
|
import { resolve as resolve3 } from "path";
|
|
@@ -53285,6 +53630,944 @@ function parseTarget({
|
|
|
53285
53630
|
return void 0;
|
|
53286
53631
|
}
|
|
53287
53632
|
|
|
53633
|
+
// src/commands/login/future.ts
|
|
53634
|
+
var import_chalk12 = __toESM(require_source(), 1);
|
|
53635
|
+
var open = __toESM(require_open(), 1);
|
|
53636
|
+
var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
|
53637
|
+
import readline3 from "readline";
|
|
53638
|
+
import { KNOWN_AGENTS as KNOWN_AGENTS2 } from "@vercel/detect-agent";
|
|
53639
|
+
|
|
53640
|
+
// src/util/agent/auto-install-agentic.ts
|
|
53641
|
+
var import_chalk11 = __toESM(require_source(), 1);
|
|
53642
|
+
import { readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
|
|
53643
|
+
import { access } from "fs/promises";
|
|
53644
|
+
import { join as join6 } from "path";
|
|
53645
|
+
import { homedir as homedir3 } from "os";
|
|
53646
|
+
import { spawn } from "child_process";
|
|
53647
|
+
import { KNOWN_AGENTS } from "@vercel/detect-agent";
|
|
53648
|
+
import { z } from "zod";
|
|
53649
|
+
var PREFS_FILE = "agent-preferences.json";
|
|
53650
|
+
var CLAUDE_LEGACY_PLUGIN_ID = "vercel-plugin@vercel";
|
|
53651
|
+
var CLAUDE_OFFICIAL_PLUGIN_ID = "vercel@claude-plugins-official";
|
|
53652
|
+
var VERCEL_PLUGIN_VERSION_URL = "https://raw.githubusercontent.com/vercel/vercel-plugin/main/.claude-plugin/plugin.json";
|
|
53653
|
+
var AGENT_TO_TARGET = {
|
|
53654
|
+
[KNOWN_AGENTS.CLAUDE]: "claude-code",
|
|
53655
|
+
[KNOWN_AGENTS.COWORK]: "claude-code"
|
|
53656
|
+
};
|
|
53657
|
+
function getPluginTargetForAgent(agentName) {
|
|
53658
|
+
if (!agentName) {
|
|
53659
|
+
return void 0;
|
|
53660
|
+
}
|
|
53661
|
+
if (agentName === KNOWN_AGENTS.CLAUDE || agentName.startsWith("claude-code") || agentName === KNOWN_AGENTS.COWORK) {
|
|
53662
|
+
return "claude-code";
|
|
53663
|
+
}
|
|
53664
|
+
return AGENT_TO_TARGET[agentName];
|
|
53665
|
+
}
|
|
53666
|
+
var promptedAtSchema = z.codec(
|
|
53667
|
+
z.union([z.iso.date(), z.iso.datetime()]),
|
|
53668
|
+
z.date(),
|
|
53669
|
+
{
|
|
53670
|
+
decode: (value) => new Date(value),
|
|
53671
|
+
encode: (value) => value.toISOString()
|
|
53672
|
+
}
|
|
53673
|
+
);
|
|
53674
|
+
var agentPreferencesSchema = z.object({
|
|
53675
|
+
pluginDeclined: z.boolean().optional(),
|
|
53676
|
+
lastPromptedAt: promptedAtSchema.optional()
|
|
53677
|
+
});
|
|
53678
|
+
async function fileExists(filePath) {
|
|
53679
|
+
try {
|
|
53680
|
+
await access(filePath);
|
|
53681
|
+
return true;
|
|
53682
|
+
} catch {
|
|
53683
|
+
return false;
|
|
53684
|
+
}
|
|
53685
|
+
}
|
|
53686
|
+
async function readPrefs(client) {
|
|
53687
|
+
return await client.maybeReadConfig(PREFS_FILE, agentPreferencesSchema) ?? {};
|
|
53688
|
+
}
|
|
53689
|
+
async function writePrefs(client, prefs) {
|
|
53690
|
+
try {
|
|
53691
|
+
await client.writeConfig(PREFS_FILE, agentPreferencesSchema, prefs);
|
|
53692
|
+
} catch {
|
|
53693
|
+
}
|
|
53694
|
+
}
|
|
53695
|
+
async function getPluginTargets(agentName) {
|
|
53696
|
+
const targetForAgent = getPluginTargetForAgent(agentName);
|
|
53697
|
+
if (targetForAgent) {
|
|
53698
|
+
return [targetForAgent];
|
|
53699
|
+
}
|
|
53700
|
+
if (agentName) {
|
|
53701
|
+
return [];
|
|
53702
|
+
}
|
|
53703
|
+
const home2 = homedir3();
|
|
53704
|
+
const targets = [];
|
|
53705
|
+
if (await fileExists(join6(home2, ".claude"))) {
|
|
53706
|
+
targets.push("claude-code");
|
|
53707
|
+
}
|
|
53708
|
+
return targets;
|
|
53709
|
+
}
|
|
53710
|
+
async function readClaudeInstalledPluginsFromRegistry() {
|
|
53711
|
+
try {
|
|
53712
|
+
const raw = await readFile3(
|
|
53713
|
+
getClaudeInstalledPluginsRegistryPath(),
|
|
53714
|
+
"utf-8"
|
|
53715
|
+
);
|
|
53716
|
+
const data = JSON.parse(raw);
|
|
53717
|
+
const plugins = data?.plugins ?? {};
|
|
53718
|
+
const entries = [];
|
|
53719
|
+
for (const [id, installs] of Object.entries(plugins)) {
|
|
53720
|
+
if (!Array.isArray(installs))
|
|
53721
|
+
continue;
|
|
53722
|
+
for (const install of installs) {
|
|
53723
|
+
if (!install || typeof install !== "object")
|
|
53724
|
+
continue;
|
|
53725
|
+
entries.push({
|
|
53726
|
+
id,
|
|
53727
|
+
...install,
|
|
53728
|
+
enabled: true
|
|
53729
|
+
});
|
|
53730
|
+
}
|
|
53731
|
+
}
|
|
53732
|
+
return entries;
|
|
53733
|
+
} catch {
|
|
53734
|
+
return [];
|
|
53735
|
+
}
|
|
53736
|
+
}
|
|
53737
|
+
function getClaudeInstalledPluginsRegistryPath() {
|
|
53738
|
+
return join6(homedir3(), ".claude", "plugins", "installed_plugins.json");
|
|
53739
|
+
}
|
|
53740
|
+
async function markStaleClaudePluginInstalls(plugins) {
|
|
53741
|
+
return Promise.all(
|
|
53742
|
+
plugins.map(async (plugin) => {
|
|
53743
|
+
if (plugin.installPath && !await fileExists(plugin.installPath)) {
|
|
53744
|
+
return { ...plugin, stale: true };
|
|
53745
|
+
}
|
|
53746
|
+
return plugin;
|
|
53747
|
+
})
|
|
53748
|
+
);
|
|
53749
|
+
}
|
|
53750
|
+
async function removeClaudePluginFromRegistry(pluginId) {
|
|
53751
|
+
try {
|
|
53752
|
+
const registryPath = getClaudeInstalledPluginsRegistryPath();
|
|
53753
|
+
const raw = await readFile3(registryPath, "utf-8");
|
|
53754
|
+
const data = JSON.parse(raw);
|
|
53755
|
+
if (!data.plugins || !(pluginId in data.plugins)) {
|
|
53756
|
+
return false;
|
|
53757
|
+
}
|
|
53758
|
+
delete data.plugins[pluginId];
|
|
53759
|
+
await writeFile2(
|
|
53760
|
+
registryPath,
|
|
53761
|
+
`${JSON.stringify(data, null, 2)}
|
|
53762
|
+
`,
|
|
53763
|
+
"utf-8"
|
|
53764
|
+
);
|
|
53765
|
+
return true;
|
|
53766
|
+
} catch (err) {
|
|
53767
|
+
output_manager_default.debug(`Failed to remove Claude plugin registry entry: ${err}`);
|
|
53768
|
+
return false;
|
|
53769
|
+
}
|
|
53770
|
+
}
|
|
53771
|
+
async function isPluginInstalledForTarget(target) {
|
|
53772
|
+
if (target === "claude-code") {
|
|
53773
|
+
const status = await getClaudePluginStatus();
|
|
53774
|
+
return status.state === "official-only";
|
|
53775
|
+
}
|
|
53776
|
+
return false;
|
|
53777
|
+
}
|
|
53778
|
+
async function confirm(client, message) {
|
|
53779
|
+
if (!client.stdin.isTTY) {
|
|
53780
|
+
return false;
|
|
53781
|
+
}
|
|
53782
|
+
return client.input.confirm(message, true);
|
|
53783
|
+
}
|
|
53784
|
+
function isSameDay(left, right) {
|
|
53785
|
+
return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate();
|
|
53786
|
+
}
|
|
53787
|
+
function wasPromptedToday(prefs) {
|
|
53788
|
+
return prefs.lastPromptedAt ? isSameDay(prefs.lastPromptedAt, /* @__PURE__ */ new Date()) : false;
|
|
53789
|
+
}
|
|
53790
|
+
async function markPromptedToday(client, prefs) {
|
|
53791
|
+
prefs.lastPromptedAt = /* @__PURE__ */ new Date();
|
|
53792
|
+
await writePrefs(client, prefs);
|
|
53793
|
+
}
|
|
53794
|
+
async function runCommand(command, args) {
|
|
53795
|
+
return await new Promise((resolve4) => {
|
|
53796
|
+
const child = spawn(command, args, { stdio: "pipe" });
|
|
53797
|
+
let stdout = "";
|
|
53798
|
+
let stderr = "";
|
|
53799
|
+
child.stdout.on("data", (chunk) => {
|
|
53800
|
+
stdout += chunk.toString();
|
|
53801
|
+
});
|
|
53802
|
+
child.stderr.on("data", (chunk) => {
|
|
53803
|
+
stderr += chunk.toString();
|
|
53804
|
+
});
|
|
53805
|
+
child.on("close", (code2) => {
|
|
53806
|
+
resolve4({ exitCode: code2 ?? 1, stdout, stderr });
|
|
53807
|
+
});
|
|
53808
|
+
child.on("error", (err) => {
|
|
53809
|
+
resolve4({ exitCode: 1, stdout, stderr: `${stderr}${String(err)}` });
|
|
53810
|
+
});
|
|
53811
|
+
});
|
|
53812
|
+
}
|
|
53813
|
+
async function getClaudeInstalledPlugins() {
|
|
53814
|
+
const result = await runCommand("claude", ["plugins", "list", "--json"]);
|
|
53815
|
+
if (result.exitCode === 0) {
|
|
53816
|
+
try {
|
|
53817
|
+
const parsed = JSON.parse(result.stdout);
|
|
53818
|
+
if (Array.isArray(parsed)) {
|
|
53819
|
+
return markStaleClaudePluginInstalls(parsed);
|
|
53820
|
+
}
|
|
53821
|
+
} catch (err) {
|
|
53822
|
+
output_manager_default.debug(`Failed to parse Claude plugin list JSON: ${err}`);
|
|
53823
|
+
}
|
|
53824
|
+
} else if (result.stderr.trim().length > 0) {
|
|
53825
|
+
output_manager_default.debug(
|
|
53826
|
+
`Failed to run 'claude plugins list --json': ${result.stderr}`
|
|
53827
|
+
);
|
|
53828
|
+
}
|
|
53829
|
+
return markStaleClaudePluginInstalls(
|
|
53830
|
+
await readClaudeInstalledPluginsFromRegistry()
|
|
53831
|
+
);
|
|
53832
|
+
}
|
|
53833
|
+
async function fetchLatestVercelPluginVersion() {
|
|
53834
|
+
try {
|
|
53835
|
+
const response = await fetch(VERCEL_PLUGIN_VERSION_URL);
|
|
53836
|
+
if (!response.ok) {
|
|
53837
|
+
output_manager_default.debug(
|
|
53838
|
+
`Failed to fetch latest Vercel plugin version: ${response.status}`
|
|
53839
|
+
);
|
|
53840
|
+
return void 0;
|
|
53841
|
+
}
|
|
53842
|
+
const manifest = await response.json();
|
|
53843
|
+
return typeof manifest.version === "string" ? manifest.version : void 0;
|
|
53844
|
+
} catch (err) {
|
|
53845
|
+
output_manager_default.debug(`Failed to fetch latest Vercel plugin version: ${err}`);
|
|
53846
|
+
return void 0;
|
|
53847
|
+
}
|
|
53848
|
+
}
|
|
53849
|
+
function comparePluginVersions(a, b) {
|
|
53850
|
+
if (!a && !b)
|
|
53851
|
+
return 0;
|
|
53852
|
+
if (!a)
|
|
53853
|
+
return -1;
|
|
53854
|
+
if (!b)
|
|
53855
|
+
return 1;
|
|
53856
|
+
const parse3 = (value) => value.split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
53857
|
+
const left = parse3(a);
|
|
53858
|
+
const right = parse3(b);
|
|
53859
|
+
const maxLength = Math.max(left.length, right.length);
|
|
53860
|
+
for (let i = 0; i < maxLength; i++) {
|
|
53861
|
+
const l = left[i] ?? 0;
|
|
53862
|
+
const r = right[i] ?? 0;
|
|
53863
|
+
if (l > r)
|
|
53864
|
+
return 1;
|
|
53865
|
+
if (l < r)
|
|
53866
|
+
return -1;
|
|
53867
|
+
}
|
|
53868
|
+
return 0;
|
|
53869
|
+
}
|
|
53870
|
+
function buildClaudePluginStatus(installedPlugins, latestVersion) {
|
|
53871
|
+
const legacy = installedPlugins.find(
|
|
53872
|
+
(plugin) => plugin.id === CLAUDE_LEGACY_PLUGIN_ID
|
|
53873
|
+
);
|
|
53874
|
+
const official = installedPlugins.find(
|
|
53875
|
+
(plugin) => plugin.id === CLAUDE_OFFICIAL_PLUGIN_ID
|
|
53876
|
+
);
|
|
53877
|
+
let state = "none";
|
|
53878
|
+
if (legacy && official)
|
|
53879
|
+
state = "both";
|
|
53880
|
+
else if (legacy)
|
|
53881
|
+
state = "legacy-only";
|
|
53882
|
+
else if (official)
|
|
53883
|
+
state = "official-only";
|
|
53884
|
+
return {
|
|
53885
|
+
state,
|
|
53886
|
+
legacy,
|
|
53887
|
+
official,
|
|
53888
|
+
latestVersion
|
|
53889
|
+
};
|
|
53890
|
+
}
|
|
53891
|
+
function buildClaudePluginMigrationPlan(status) {
|
|
53892
|
+
const plan = {
|
|
53893
|
+
installOfficial: false,
|
|
53894
|
+
updateOfficial: false,
|
|
53895
|
+
removeLegacy: false,
|
|
53896
|
+
removeLegacyMarketplace: false
|
|
53897
|
+
};
|
|
53898
|
+
switch (status.state) {
|
|
53899
|
+
case "none":
|
|
53900
|
+
plan.installOfficial = true;
|
|
53901
|
+
break;
|
|
53902
|
+
case "legacy-only":
|
|
53903
|
+
plan.installOfficial = true;
|
|
53904
|
+
plan.removeLegacy = true;
|
|
53905
|
+
plan.removeLegacyMarketplace = true;
|
|
53906
|
+
break;
|
|
53907
|
+
case "both":
|
|
53908
|
+
plan.removeLegacy = true;
|
|
53909
|
+
plan.removeLegacyMarketplace = true;
|
|
53910
|
+
break;
|
|
53911
|
+
case "official-only":
|
|
53912
|
+
break;
|
|
53913
|
+
}
|
|
53914
|
+
if (status.official?.version && status.latestVersion && comparePluginVersions(status.official.version, status.latestVersion) < 0) {
|
|
53915
|
+
plan.updateOfficial = true;
|
|
53916
|
+
}
|
|
53917
|
+
return plan;
|
|
53918
|
+
}
|
|
53919
|
+
function hasClaudeMigrationActions(plan) {
|
|
53920
|
+
return plan.installOfficial || plan.updateOfficial || plan.removeLegacy || plan.removeLegacyMarketplace;
|
|
53921
|
+
}
|
|
53922
|
+
function buildClaudePromptCopy(status, plan) {
|
|
53923
|
+
if (plan.installOfficial && status.state === "none") {
|
|
53924
|
+
return {
|
|
53925
|
+
message: "",
|
|
53926
|
+
confirm: "Working with Vercel is easier with the Vercel Plugin for Claude Code. Would you like to install it?"
|
|
53927
|
+
};
|
|
53928
|
+
}
|
|
53929
|
+
if (plan.installOfficial && status.state === "legacy-only") {
|
|
53930
|
+
return {
|
|
53931
|
+
message: "",
|
|
53932
|
+
confirm: "Working with Vercel is easier with the latest Vercel Plugin for Claude Code. Would you like to update it?"
|
|
53933
|
+
};
|
|
53934
|
+
}
|
|
53935
|
+
if (status.state === "both" && plan.removeLegacy) {
|
|
53936
|
+
return {
|
|
53937
|
+
message: "",
|
|
53938
|
+
confirm: "Working with Vercel is easier with the latest Vercel Plugin for Claude Code. Would you like to update it?"
|
|
53939
|
+
};
|
|
53940
|
+
}
|
|
53941
|
+
if (plan.updateOfficial) {
|
|
53942
|
+
const fromVersion = status.official?.version ?? "your current version";
|
|
53943
|
+
const toVersion = status.latestVersion ?? "the latest version";
|
|
53944
|
+
return {
|
|
53945
|
+
message: "",
|
|
53946
|
+
confirm: `Working with Vercel is easier with the latest Vercel Plugin for Claude Code. Would you like to update from ${fromVersion} to ${toVersion}?`
|
|
53947
|
+
};
|
|
53948
|
+
}
|
|
53949
|
+
return {
|
|
53950
|
+
message: "The Vercel plugin needs attention in Claude Code before your agent harness is fully up to date.",
|
|
53951
|
+
confirm: "Apply the Vercel plugin changes for Claude Code?"
|
|
53952
|
+
};
|
|
53953
|
+
}
|
|
53954
|
+
async function runClaudeCommand(spinnerMessage, successMessage, failureMessage, args, options) {
|
|
53955
|
+
output_manager_default.spinner(spinnerMessage);
|
|
53956
|
+
const result = await runCommand("claude", args);
|
|
53957
|
+
output_manager_default.stopSpinner();
|
|
53958
|
+
if (result.exitCode === 0) {
|
|
53959
|
+
if (!options?.quietSuccess) {
|
|
53960
|
+
output_manager_default.success(successMessage);
|
|
53961
|
+
}
|
|
53962
|
+
return true;
|
|
53963
|
+
}
|
|
53964
|
+
output_manager_default.warn(failureMessage);
|
|
53965
|
+
output_manager_default.debug(
|
|
53966
|
+
`Claude command failed: claude ${args.join(" ")}
|
|
53967
|
+
${result.stderr || result.stdout}`
|
|
53968
|
+
);
|
|
53969
|
+
return false;
|
|
53970
|
+
}
|
|
53971
|
+
async function removeStaleLegacyClaudePlugin(removeMarketplace) {
|
|
53972
|
+
output_manager_default.spinner("Removing the stale legacy Vercel Claude plugin...");
|
|
53973
|
+
const removedRegistryEntry = await removeClaudePluginFromRegistry(
|
|
53974
|
+
CLAUDE_LEGACY_PLUGIN_ID
|
|
53975
|
+
);
|
|
53976
|
+
output_manager_default.stopSpinner();
|
|
53977
|
+
if (!removedRegistryEntry) {
|
|
53978
|
+
output_manager_default.warn(
|
|
53979
|
+
"Could not remove the stale legacy Vercel Claude plugin registry entry."
|
|
53980
|
+
);
|
|
53981
|
+
return false;
|
|
53982
|
+
}
|
|
53983
|
+
output_manager_default.success("Removed the stale legacy Vercel Claude plugin");
|
|
53984
|
+
if (removeMarketplace) {
|
|
53985
|
+
const removedMarketplace = await runClaudeCommand(
|
|
53986
|
+
"Removing the legacy Vercel marketplace...",
|
|
53987
|
+
"Removed the legacy Vercel marketplace",
|
|
53988
|
+
"Removed the stale legacy Vercel plugin, but could not remove the legacy marketplace.",
|
|
53989
|
+
["plugins", "marketplace", "remove", "vercel"],
|
|
53990
|
+
{ quietSuccess: true }
|
|
53991
|
+
);
|
|
53992
|
+
if (!removedMarketplace) {
|
|
53993
|
+
output_manager_default.log("Cleanup command: claude plugins marketplace remove vercel");
|
|
53994
|
+
}
|
|
53995
|
+
}
|
|
53996
|
+
return true;
|
|
53997
|
+
}
|
|
53998
|
+
async function runClaudeMigration(plan) {
|
|
53999
|
+
let removedStaleLegacy = false;
|
|
54000
|
+
if (plan.removeLegacy) {
|
|
54001
|
+
const statusBeforeInstall = await getClaudePluginStatus();
|
|
54002
|
+
if (statusBeforeInstall.legacy?.stale) {
|
|
54003
|
+
removedStaleLegacy = await removeStaleLegacyClaudePlugin(
|
|
54004
|
+
plan.removeLegacyMarketplace
|
|
54005
|
+
);
|
|
54006
|
+
}
|
|
54007
|
+
}
|
|
54008
|
+
if (plan.installOfficial) {
|
|
54009
|
+
const installed = await runClaudeCommand(
|
|
54010
|
+
"Installing the official Vercel Claude plugin...",
|
|
54011
|
+
"Updated the Vercel plugin",
|
|
54012
|
+
"Failed to install the official Vercel Claude plugin.",
|
|
54013
|
+
["plugins", "install", CLAUDE_OFFICIAL_PLUGIN_ID]
|
|
54014
|
+
);
|
|
54015
|
+
if (!installed) {
|
|
54016
|
+
return;
|
|
54017
|
+
}
|
|
54018
|
+
} else if (plan.updateOfficial) {
|
|
54019
|
+
await runClaudeCommand(
|
|
54020
|
+
"Updating the official Vercel Claude plugin...",
|
|
54021
|
+
"Updated the Vercel plugin",
|
|
54022
|
+
"Failed to update the official Vercel Claude plugin.",
|
|
54023
|
+
["plugins", "update", CLAUDE_OFFICIAL_PLUGIN_ID]
|
|
54024
|
+
);
|
|
54025
|
+
}
|
|
54026
|
+
const statusAfterInstall = await getClaudePluginStatus();
|
|
54027
|
+
if (!statusAfterInstall.official) {
|
|
54028
|
+
output_manager_default.warn(
|
|
54029
|
+
"Skipping Claude cleanup because the official Vercel plugin is not installed."
|
|
54030
|
+
);
|
|
54031
|
+
return;
|
|
54032
|
+
}
|
|
54033
|
+
if (plan.removeLegacy && statusAfterInstall.legacy) {
|
|
54034
|
+
const removedLegacy = await runClaudeCommand(
|
|
54035
|
+
"Removing the legacy Vercel Claude plugin...",
|
|
54036
|
+
"Removed the legacy Vercel Claude plugin",
|
|
54037
|
+
"Installed the official Vercel Claude plugin, but could not remove the legacy install.",
|
|
54038
|
+
["plugins", "uninstall", CLAUDE_LEGACY_PLUGIN_ID],
|
|
54039
|
+
{ quietSuccess: true }
|
|
54040
|
+
);
|
|
54041
|
+
if (!removedLegacy) {
|
|
54042
|
+
output_manager_default.log(
|
|
54043
|
+
`Cleanup command: claude plugins uninstall ${CLAUDE_LEGACY_PLUGIN_ID}`
|
|
54044
|
+
);
|
|
54045
|
+
return;
|
|
54046
|
+
}
|
|
54047
|
+
}
|
|
54048
|
+
if (plan.removeLegacyMarketplace && !removedStaleLegacy) {
|
|
54049
|
+
const finalStatus = await getClaudePluginStatus();
|
|
54050
|
+
if (!finalStatus.legacy) {
|
|
54051
|
+
const removedMarketplace = await runClaudeCommand(
|
|
54052
|
+
"Removing the legacy Vercel marketplace...",
|
|
54053
|
+
"Removed the legacy Vercel marketplace",
|
|
54054
|
+
"Removed the legacy Vercel plugin, but could not remove the legacy marketplace.",
|
|
54055
|
+
["plugins", "marketplace", "remove", "vercel"],
|
|
54056
|
+
{ quietSuccess: true }
|
|
54057
|
+
);
|
|
54058
|
+
if (!removedMarketplace) {
|
|
54059
|
+
output_manager_default.log("Cleanup command: claude plugins marketplace remove vercel");
|
|
54060
|
+
}
|
|
54061
|
+
}
|
|
54062
|
+
}
|
|
54063
|
+
}
|
|
54064
|
+
async function getClaudePluginStatus() {
|
|
54065
|
+
const [installedPlugins, latestVersion] = await Promise.all([
|
|
54066
|
+
getClaudeInstalledPlugins(),
|
|
54067
|
+
fetchLatestVercelPluginVersion()
|
|
54068
|
+
]);
|
|
54069
|
+
return buildClaudePluginStatus(installedPlugins, latestVersion);
|
|
54070
|
+
}
|
|
54071
|
+
async function applyPluginActions(targets, claudePlan) {
|
|
54072
|
+
for (const target of targets) {
|
|
54073
|
+
if (target === "claude-code" && claudePlan) {
|
|
54074
|
+
await runClaudeMigration(claudePlan);
|
|
54075
|
+
} else {
|
|
54076
|
+
output_manager_default.debug(`Skipping unsupported plugin target: ${target}`);
|
|
54077
|
+
}
|
|
54078
|
+
}
|
|
54079
|
+
}
|
|
54080
|
+
async function autoInstallVercelPlugin(client, options) {
|
|
54081
|
+
try {
|
|
54082
|
+
const prefs = await readPrefs(client);
|
|
54083
|
+
const applyMode = options?.mode === "apply";
|
|
54084
|
+
if (!prefs.pluginDeclined || applyMode) {
|
|
54085
|
+
const targets = await getPluginTargets(client.agentName);
|
|
54086
|
+
const uninstalledTargets = [];
|
|
54087
|
+
const claudeStatus = targets.includes("claude-code") ? await getClaudePluginStatus() : void 0;
|
|
54088
|
+
const claudePlan = claudeStatus ? buildClaudePluginMigrationPlan(claudeStatus) : void 0;
|
|
54089
|
+
for (const target of targets) {
|
|
54090
|
+
if (target === "claude-code") {
|
|
54091
|
+
if (claudePlan && hasClaudeMigrationActions(claudePlan)) {
|
|
54092
|
+
uninstalledTargets.push(target);
|
|
54093
|
+
}
|
|
54094
|
+
continue;
|
|
54095
|
+
}
|
|
54096
|
+
if (!await isPluginInstalledForTarget(target)) {
|
|
54097
|
+
uninstalledTargets.push(target);
|
|
54098
|
+
}
|
|
54099
|
+
}
|
|
54100
|
+
if (uninstalledTargets.length > 0) {
|
|
54101
|
+
if (!applyMode && wasPromptedToday(prefs)) {
|
|
54102
|
+
return;
|
|
54103
|
+
}
|
|
54104
|
+
if (applyMode) {
|
|
54105
|
+
prefs.pluginDeclined = false;
|
|
54106
|
+
await writePrefs(client, prefs);
|
|
54107
|
+
await applyPluginActions(uninstalledTargets, claudePlan);
|
|
54108
|
+
return;
|
|
54109
|
+
}
|
|
54110
|
+
const promptMessages = [];
|
|
54111
|
+
let confirmMessage = "Install the Vercel plugin?";
|
|
54112
|
+
if (uninstalledTargets.includes("claude-code") && claudeStatus && claudePlan) {
|
|
54113
|
+
const claudePrompt = buildClaudePromptCopy(claudeStatus, claudePlan);
|
|
54114
|
+
promptMessages.push(claudePrompt.message);
|
|
54115
|
+
confirmMessage = claudePrompt.confirm;
|
|
54116
|
+
}
|
|
54117
|
+
const promptMessage = promptMessages.join(" ").trim();
|
|
54118
|
+
if (promptMessage) {
|
|
54119
|
+
output_manager_default.log(promptMessage);
|
|
54120
|
+
}
|
|
54121
|
+
const accepted = await confirm(client, confirmMessage);
|
|
54122
|
+
await markPromptedToday(client, prefs);
|
|
54123
|
+
if (accepted) {
|
|
54124
|
+
prefs.pluginDeclined = false;
|
|
54125
|
+
await writePrefs(client, prefs);
|
|
54126
|
+
await applyPluginActions(uninstalledTargets, claudePlan);
|
|
54127
|
+
} else {
|
|
54128
|
+
prefs.pluginDeclined = true;
|
|
54129
|
+
await writePrefs(client, prefs);
|
|
54130
|
+
}
|
|
54131
|
+
}
|
|
54132
|
+
}
|
|
54133
|
+
} catch (err) {
|
|
54134
|
+
output_manager_default.debug(`Auto-install agent tooling failed: ${err}`);
|
|
54135
|
+
}
|
|
54136
|
+
}
|
|
54137
|
+
async function showPluginTipIfNeeded(client) {
|
|
54138
|
+
try {
|
|
54139
|
+
const prefs = await readPrefs(client);
|
|
54140
|
+
if (prefs.pluginDeclined)
|
|
54141
|
+
return;
|
|
54142
|
+
const targets = await getPluginTargets();
|
|
54143
|
+
for (const target of targets) {
|
|
54144
|
+
if (!await isPluginInstalledForTarget(target)) {
|
|
54145
|
+
output_manager_default.log(
|
|
54146
|
+
import_chalk11.default.dim(
|
|
54147
|
+
"Tip: Run `npx plugins add vercel/vercel-plugin` to enhance your agent experience"
|
|
54148
|
+
)
|
|
54149
|
+
);
|
|
54150
|
+
return;
|
|
54151
|
+
}
|
|
54152
|
+
}
|
|
54153
|
+
} catch {
|
|
54154
|
+
}
|
|
54155
|
+
}
|
|
54156
|
+
|
|
54157
|
+
// src/util/login/update-current-team-after-login.ts
|
|
54158
|
+
async function updateCurrentTeamAfterLogin(client, ssoTeamId) {
|
|
54159
|
+
if (ssoTeamId) {
|
|
54160
|
+
client.config.currentTeam = ssoTeamId;
|
|
54161
|
+
} else {
|
|
54162
|
+
let user = null;
|
|
54163
|
+
try {
|
|
54164
|
+
user = await getUser(client);
|
|
54165
|
+
} catch (_err) {
|
|
54166
|
+
output_manager_default.error("Failed to fetch the logged in user. Please try again.");
|
|
54167
|
+
return 1;
|
|
54168
|
+
}
|
|
54169
|
+
if (user.version === "northstar" && user.defaultTeamId) {
|
|
54170
|
+
client.config.currentTeam = user.defaultTeamId;
|
|
54171
|
+
} else {
|
|
54172
|
+
delete client.config.currentTeam;
|
|
54173
|
+
}
|
|
54174
|
+
}
|
|
54175
|
+
}
|
|
54176
|
+
|
|
54177
|
+
// src/util/oauth.ts
|
|
54178
|
+
var import_node_fetch = __toESM(require_lib2(), 1);
|
|
54179
|
+
|
|
54180
|
+
// src/util/ua.ts
|
|
54181
|
+
import os2 from "os";
|
|
54182
|
+
var ua_default = `${pkg_default.name} ${pkg_default.version} node-${process.version} ${os2.platform()} (${os2.arch()})`;
|
|
54183
|
+
|
|
54184
|
+
// src/util/oauth.ts
|
|
54185
|
+
import { hostname } from "os";
|
|
54186
|
+
var VERCEL_ISSUER = new URL("https://vercel.com");
|
|
54187
|
+
var VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
|
|
54188
|
+
var userAgent = `${hostname()} @ ${ua_default}`;
|
|
54189
|
+
var _as;
|
|
54190
|
+
async function as() {
|
|
54191
|
+
if (!_as) {
|
|
54192
|
+
const discoveryResponse = await discoveryEndpointRequest(VERCEL_ISSUER);
|
|
54193
|
+
const [discoveryResponseError, as2] = await processDiscoveryEndpointResponse(discoveryResponse);
|
|
54194
|
+
if (discoveryResponseError) {
|
|
54195
|
+
throw discoveryResponseError;
|
|
54196
|
+
}
|
|
54197
|
+
_as = as2;
|
|
54198
|
+
}
|
|
54199
|
+
return _as;
|
|
54200
|
+
}
|
|
54201
|
+
async function discoveryEndpointRequest(issuer) {
|
|
54202
|
+
return await (0, import_node_fetch.default)(new URL(".well-known/openid-configuration", issuer), {
|
|
54203
|
+
headers: { "Content-Type": "application/json", "user-agent": userAgent }
|
|
54204
|
+
});
|
|
54205
|
+
}
|
|
54206
|
+
async function processDiscoveryEndpointResponse(response) {
|
|
54207
|
+
const json = await response.json();
|
|
54208
|
+
if (!response.ok) {
|
|
54209
|
+
return [new Error("Discovery endpoint request failed")];
|
|
54210
|
+
}
|
|
54211
|
+
if (typeof json !== "object" || json === null || !canParseURL(json.issuer) || !canParseURL(json.device_authorization_endpoint) || !canParseURL(json.token_endpoint) || !canParseURL(json.revocation_endpoint) || !canParseURL(json.jwks_uri) || !canParseURL(json.introspection_endpoint)) {
|
|
54212
|
+
return [new TypeError("Invalid discovery response")];
|
|
54213
|
+
}
|
|
54214
|
+
const issuer = new URL(json.issuer);
|
|
54215
|
+
if (issuer.href !== VERCEL_ISSUER.href) {
|
|
54216
|
+
return [new Error("Issuer mismatch")];
|
|
54217
|
+
}
|
|
54218
|
+
return [
|
|
54219
|
+
null,
|
|
54220
|
+
{
|
|
54221
|
+
issuer,
|
|
54222
|
+
device_authorization_endpoint: new URL(
|
|
54223
|
+
json.device_authorization_endpoint
|
|
54224
|
+
),
|
|
54225
|
+
token_endpoint: new URL(json.token_endpoint),
|
|
54226
|
+
revocation_endpoint: new URL(json.revocation_endpoint),
|
|
54227
|
+
jwks_uri: new URL(json.jwks_uri),
|
|
54228
|
+
introspection_endpoint: new URL(json.introspection_endpoint)
|
|
54229
|
+
}
|
|
54230
|
+
];
|
|
54231
|
+
}
|
|
54232
|
+
async function deviceAuthorizationRequest(options) {
|
|
54233
|
+
const body = new URLSearchParams({
|
|
54234
|
+
client_id: VERCEL_CLI_CLIENT_ID
|
|
54235
|
+
});
|
|
54236
|
+
if (options?.refresh_token) {
|
|
54237
|
+
body.set("refresh_token", options.refresh_token);
|
|
54238
|
+
if (options.acr_values) {
|
|
54239
|
+
body.set("acr_values", options.acr_values);
|
|
54240
|
+
}
|
|
54241
|
+
} else {
|
|
54242
|
+
body.set("scope", "openid offline_access");
|
|
54243
|
+
}
|
|
54244
|
+
return await (0, import_node_fetch.default)((await as()).device_authorization_endpoint, {
|
|
54245
|
+
method: "POST",
|
|
54246
|
+
headers: {
|
|
54247
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
54248
|
+
"user-agent": userAgent
|
|
54249
|
+
},
|
|
54250
|
+
body
|
|
54251
|
+
});
|
|
54252
|
+
}
|
|
54253
|
+
async function processDeviceAuthorizationResponse(response) {
|
|
54254
|
+
const json = await response.json();
|
|
54255
|
+
if (!response.ok) {
|
|
54256
|
+
return [new OAuthError("Device authorization request failed", json)];
|
|
54257
|
+
}
|
|
54258
|
+
if (typeof json !== "object" || json === null)
|
|
54259
|
+
return [new TypeError("Expected response to be an object")];
|
|
54260
|
+
if (!("device_code" in json) || typeof json.device_code !== "string")
|
|
54261
|
+
return [new TypeError("Expected `device_code` to be a string")];
|
|
54262
|
+
if (!("user_code" in json) || typeof json.user_code !== "string")
|
|
54263
|
+
return [new TypeError("Expected `user_code` to be a string")];
|
|
54264
|
+
if (!("verification_uri" in json) || typeof json.verification_uri !== "string" || !canParseURL(json.verification_uri)) {
|
|
54265
|
+
return [new TypeError("Expected `verification_uri` to be a string")];
|
|
54266
|
+
}
|
|
54267
|
+
if (!("verification_uri_complete" in json) || typeof json.verification_uri_complete !== "string" || !canParseURL(json.verification_uri_complete)) {
|
|
54268
|
+
return [
|
|
54269
|
+
new TypeError("Expected `verification_uri_complete` to be a string")
|
|
54270
|
+
];
|
|
54271
|
+
}
|
|
54272
|
+
if (!("expires_in" in json) || typeof json.expires_in !== "number")
|
|
54273
|
+
return [new TypeError("Expected `expires_in` to be a number")];
|
|
54274
|
+
if (!("interval" in json) || typeof json.interval !== "number")
|
|
54275
|
+
return [new TypeError("Expected `interval` to be a number")];
|
|
54276
|
+
return [
|
|
54277
|
+
null,
|
|
54278
|
+
{
|
|
54279
|
+
device_code: json.device_code,
|
|
54280
|
+
user_code: json.user_code,
|
|
54281
|
+
verification_uri: json.verification_uri,
|
|
54282
|
+
verification_uri_complete: json.verification_uri_complete,
|
|
54283
|
+
expiresAt: Date.now() + json.expires_in * 1e3,
|
|
54284
|
+
interval: json.interval
|
|
54285
|
+
}
|
|
54286
|
+
];
|
|
54287
|
+
}
|
|
54288
|
+
async function deviceAccessTokenRequest(options) {
|
|
54289
|
+
try {
|
|
54290
|
+
return [
|
|
54291
|
+
null,
|
|
54292
|
+
await (0, import_node_fetch.default)((await as()).token_endpoint, {
|
|
54293
|
+
method: "POST",
|
|
54294
|
+
headers: {
|
|
54295
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
54296
|
+
"user-agent": userAgent
|
|
54297
|
+
},
|
|
54298
|
+
body: new URLSearchParams({
|
|
54299
|
+
client_id: VERCEL_CLI_CLIENT_ID,
|
|
54300
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
54301
|
+
...options
|
|
54302
|
+
}),
|
|
54303
|
+
// TODO: Drop `node-fetch` and just use `signal`
|
|
54304
|
+
timeout: 10 * 1e3,
|
|
54305
|
+
// @ts-expect-error: Signal is part of `fetch` spec, should drop `node-fetch`
|
|
54306
|
+
signal: AbortSignal.timeout(10 * 1e3)
|
|
54307
|
+
})
|
|
54308
|
+
];
|
|
54309
|
+
} catch (error) {
|
|
54310
|
+
if (error instanceof Error)
|
|
54311
|
+
return [error];
|
|
54312
|
+
return [
|
|
54313
|
+
new Error("An unknown error occurred. See the logs for details.", {
|
|
54314
|
+
cause: error
|
|
54315
|
+
})
|
|
54316
|
+
];
|
|
54317
|
+
}
|
|
54318
|
+
}
|
|
54319
|
+
async function processTokenResponse(response) {
|
|
54320
|
+
const json = await response.json();
|
|
54321
|
+
if (!response.ok) {
|
|
54322
|
+
return [new OAuthError("Device access token request failed", json)];
|
|
54323
|
+
}
|
|
54324
|
+
if (typeof json !== "object" || json === null)
|
|
54325
|
+
return [new TypeError("Expected response to be an object")];
|
|
54326
|
+
if (!("access_token" in json) || typeof json.access_token !== "string")
|
|
54327
|
+
return [new TypeError("Expected `access_token` to be a string")];
|
|
54328
|
+
if (!("token_type" in json) || json.token_type !== "Bearer")
|
|
54329
|
+
return [new TypeError('Expected `token_type` to be "Bearer"')];
|
|
54330
|
+
if (!("expires_in" in json) || typeof json.expires_in !== "number")
|
|
54331
|
+
return [new TypeError("Expected `expires_in` to be a number")];
|
|
54332
|
+
if ("refresh_token" in json && (typeof json.refresh_token !== "string" || !json.refresh_token))
|
|
54333
|
+
return [new TypeError("Expected `refresh_token` to be a string")];
|
|
54334
|
+
if ("scope" in json && typeof json.scope !== "string")
|
|
54335
|
+
return [new TypeError("Expected `scope` to be a string")];
|
|
54336
|
+
return [null, json];
|
|
54337
|
+
}
|
|
54338
|
+
async function revocationRequest(options) {
|
|
54339
|
+
return await (0, import_node_fetch.default)((await as()).revocation_endpoint, {
|
|
54340
|
+
method: "POST",
|
|
54341
|
+
headers: {
|
|
54342
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
54343
|
+
"user-agent": userAgent
|
|
54344
|
+
},
|
|
54345
|
+
body: new URLSearchParams({ ...options, client_id: VERCEL_CLI_CLIENT_ID })
|
|
54346
|
+
});
|
|
54347
|
+
}
|
|
54348
|
+
async function processRevocationResponse(response) {
|
|
54349
|
+
if (response.ok)
|
|
54350
|
+
return [null, null];
|
|
54351
|
+
const json = await response.json();
|
|
54352
|
+
return [new OAuthError("Revocation request failed", json)];
|
|
54353
|
+
}
|
|
54354
|
+
async function refreshTokenRequest(options) {
|
|
54355
|
+
return await (0, import_node_fetch.default)((await as()).token_endpoint, {
|
|
54356
|
+
method: "POST",
|
|
54357
|
+
headers: {
|
|
54358
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
54359
|
+
"user-agent": userAgent
|
|
54360
|
+
},
|
|
54361
|
+
body: new URLSearchParams({
|
|
54362
|
+
client_id: VERCEL_CLI_CLIENT_ID,
|
|
54363
|
+
grant_type: "refresh_token",
|
|
54364
|
+
...options
|
|
54365
|
+
})
|
|
54366
|
+
});
|
|
54367
|
+
}
|
|
54368
|
+
function processOAuthErrorResponse(json) {
|
|
54369
|
+
if (typeof json !== "object" || json === null)
|
|
54370
|
+
return new TypeError("Expected response to be an object");
|
|
54371
|
+
if (!("error" in json) || typeof json.error !== "string")
|
|
54372
|
+
return new TypeError("Expected `error` to be a string");
|
|
54373
|
+
if ("error_description" in json && typeof json.error_description !== "string")
|
|
54374
|
+
return new TypeError("Expected `error_description` to be a string");
|
|
54375
|
+
if ("error_uri" in json && typeof json.error_uri !== "string")
|
|
54376
|
+
return new TypeError("Expected `error_uri` to be a string");
|
|
54377
|
+
return json;
|
|
54378
|
+
}
|
|
54379
|
+
var OAuthError = class extends Error {
|
|
54380
|
+
constructor(message, response) {
|
|
54381
|
+
var __super = (...args) => {
|
|
54382
|
+
super(...args);
|
|
54383
|
+
};
|
|
54384
|
+
const error = processOAuthErrorResponse(response);
|
|
54385
|
+
if (error instanceof TypeError) {
|
|
54386
|
+
const message2 = `Unexpected server response: ${JSON.stringify(response)}`;
|
|
54387
|
+
__super(message2);
|
|
54388
|
+
this.cause = new Error(message2, { cause: error });
|
|
54389
|
+
this.code = "server_error";
|
|
54390
|
+
return;
|
|
54391
|
+
}
|
|
54392
|
+
let cause = error.error;
|
|
54393
|
+
if (error.error_description)
|
|
54394
|
+
cause += `: ${error.error_description}`;
|
|
54395
|
+
if (error.error_uri)
|
|
54396
|
+
cause += ` (${error.error_uri})`;
|
|
54397
|
+
__super(message, { cause });
|
|
54398
|
+
this.cause = new Error(cause);
|
|
54399
|
+
this.code = error.error;
|
|
54400
|
+
}
|
|
54401
|
+
};
|
|
54402
|
+
function isOAuthError(error) {
|
|
54403
|
+
return error instanceof OAuthError;
|
|
54404
|
+
}
|
|
54405
|
+
function canParseURL(url) {
|
|
54406
|
+
try {
|
|
54407
|
+
return !!new URL(url);
|
|
54408
|
+
} catch {
|
|
54409
|
+
return false;
|
|
54410
|
+
}
|
|
54411
|
+
}
|
|
54412
|
+
|
|
54413
|
+
// src/commands/login/future.ts
|
|
54414
|
+
async function performDeviceCodeFlow(client, options) {
|
|
54415
|
+
const deviceAuthorizationResponse = await deviceAuthorizationRequest({
|
|
54416
|
+
refresh_token: options?.refreshToken,
|
|
54417
|
+
acr_values: options?.acrValues
|
|
54418
|
+
});
|
|
54419
|
+
output_manager_default.debug(
|
|
54420
|
+
`'Device Authorization response:', ${await deviceAuthorizationResponse.clone().text()}`
|
|
54421
|
+
);
|
|
54422
|
+
const [deviceAuthorizationError, deviceAuthorization] = await processDeviceAuthorizationResponse(deviceAuthorizationResponse);
|
|
54423
|
+
if (deviceAuthorizationError) {
|
|
54424
|
+
printError(deviceAuthorizationError);
|
|
54425
|
+
return null;
|
|
54426
|
+
}
|
|
54427
|
+
const { device_code, user_code, verification_uri, expiresAt, interval } = deviceAuthorization;
|
|
54428
|
+
let { verification_uri_complete } = deviceAuthorization;
|
|
54429
|
+
if (options?.teamId) {
|
|
54430
|
+
const url = new URL(verification_uri_complete);
|
|
54431
|
+
url.searchParams.set("team_id", options.teamId);
|
|
54432
|
+
verification_uri_complete = url.toString();
|
|
54433
|
+
}
|
|
54434
|
+
const isCursorAgent = client.agentName === KNOWN_AGENTS2.CURSOR || client.agentName === KNOWN_AGENTS2.CURSOR_CLI;
|
|
54435
|
+
const shouldSkipBrowser = process.env.CI && !isCursorAgent;
|
|
54436
|
+
output_manager_default.log(
|
|
54437
|
+
`
|
|
54438
|
+
Visit ${import_chalk12.default.bold(
|
|
54439
|
+
output_manager_default.link(
|
|
54440
|
+
verification_uri.replace("https://", ""),
|
|
54441
|
+
verification_uri_complete,
|
|
54442
|
+
{ color: false, fallback: () => verification_uri_complete }
|
|
54443
|
+
)
|
|
54444
|
+
)}${output_manager_default.supportsHyperlink ? ` and enter ${import_chalk12.default.bold(user_code)}` : ""}
|
|
54445
|
+
`
|
|
54446
|
+
);
|
|
54447
|
+
if (!shouldSkipBrowser) {
|
|
54448
|
+
try {
|
|
54449
|
+
const browserProcess = await open.default(verification_uri_complete);
|
|
54450
|
+
browserProcess.on("error", (error) => {
|
|
54451
|
+
output_manager_default.debug(`Failed to open browser: ${error}`);
|
|
54452
|
+
});
|
|
54453
|
+
} catch (error) {
|
|
54454
|
+
output_manager_default.debug(`Failed to open browser: ${error}`);
|
|
54455
|
+
if (client.isAgent && client.nonInteractive) {
|
|
54456
|
+
output_manager_default.log(
|
|
54457
|
+
`
|
|
54458
|
+
${import_chalk12.default.yellow("\u26A0")} ${import_chalk12.default.bold("Browser could not be opened automatically.")}
|
|
54459
|
+
`
|
|
54460
|
+
);
|
|
54461
|
+
output_manager_default.log(
|
|
54462
|
+
`Please ask the user to manually visit the URL above and complete the authentication process.
|
|
54463
|
+
`
|
|
54464
|
+
);
|
|
54465
|
+
}
|
|
54466
|
+
}
|
|
54467
|
+
}
|
|
54468
|
+
const rl = readline3.createInterface({
|
|
54469
|
+
input: process.stdin,
|
|
54470
|
+
output: process.stdout
|
|
54471
|
+
}).on("SIGINT", () => {
|
|
54472
|
+
process.exit(0);
|
|
54473
|
+
});
|
|
54474
|
+
output_manager_default.spinner("Waiting for authentication...");
|
|
54475
|
+
let intervalMs = interval * 1e3;
|
|
54476
|
+
let result = null;
|
|
54477
|
+
let flowError = new Error(
|
|
54478
|
+
"Timed out waiting for authentication. Please try again."
|
|
54479
|
+
);
|
|
54480
|
+
async function pollForToken() {
|
|
54481
|
+
while (Date.now() < expiresAt) {
|
|
54482
|
+
const [tokenResponseError, tokenResponse] = await deviceAccessTokenRequest({ device_code });
|
|
54483
|
+
if (tokenResponseError) {
|
|
54484
|
+
if (tokenResponseError.message.includes("timeout")) {
|
|
54485
|
+
intervalMs *= 2;
|
|
54486
|
+
output_manager_default.debug(
|
|
54487
|
+
`Connection timeout. Slowing down, polling every ${intervalMs / 1e3}s...`
|
|
54488
|
+
);
|
|
54489
|
+
await wait(intervalMs);
|
|
54490
|
+
continue;
|
|
54491
|
+
}
|
|
54492
|
+
return tokenResponseError;
|
|
54493
|
+
}
|
|
54494
|
+
output_manager_default.debug(
|
|
54495
|
+
`'Device Access Token response:', ${await tokenResponse.clone().text()}`
|
|
54496
|
+
);
|
|
54497
|
+
const [tokensError, tokens] = await processTokenResponse(tokenResponse);
|
|
54498
|
+
if (isOAuthError(tokensError)) {
|
|
54499
|
+
const { code: code2 } = tokensError;
|
|
54500
|
+
switch (code2) {
|
|
54501
|
+
case "authorization_pending":
|
|
54502
|
+
await wait(intervalMs);
|
|
54503
|
+
continue;
|
|
54504
|
+
case "slow_down":
|
|
54505
|
+
intervalMs += 5 * 1e3;
|
|
54506
|
+
output_manager_default.debug(
|
|
54507
|
+
`Authorization server requests to slow down. Polling every ${intervalMs / 1e3}s...`
|
|
54508
|
+
);
|
|
54509
|
+
await wait(intervalMs);
|
|
54510
|
+
continue;
|
|
54511
|
+
default:
|
|
54512
|
+
return tokensError.cause;
|
|
54513
|
+
}
|
|
54514
|
+
}
|
|
54515
|
+
if (tokensError)
|
|
54516
|
+
return tokensError;
|
|
54517
|
+
output_manager_default.print((0, import_ansi_escapes4.eraseLines)(2));
|
|
54518
|
+
result = {
|
|
54519
|
+
access_token: tokens.access_token,
|
|
54520
|
+
expires_in: tokens.expires_in,
|
|
54521
|
+
refresh_token: tokens.refresh_token
|
|
54522
|
+
};
|
|
54523
|
+
return;
|
|
54524
|
+
}
|
|
54525
|
+
}
|
|
54526
|
+
flowError = await pollForToken();
|
|
54527
|
+
output_manager_default.stopSpinner();
|
|
54528
|
+
rl.close();
|
|
54529
|
+
if (flowError) {
|
|
54530
|
+
printError(flowError);
|
|
54531
|
+
return null;
|
|
54532
|
+
}
|
|
54533
|
+
return result;
|
|
54534
|
+
}
|
|
54535
|
+
async function login(client, telemetry) {
|
|
54536
|
+
const tokens = await performDeviceCodeFlow(client);
|
|
54537
|
+
if (!tokens) {
|
|
54538
|
+
telemetry.trackState("error");
|
|
54539
|
+
return 1;
|
|
54540
|
+
}
|
|
54541
|
+
const isInitialLogin = !client.authConfig.token;
|
|
54542
|
+
client.updateAuthConfig({
|
|
54543
|
+
token: tokens.access_token,
|
|
54544
|
+
userId: void 0,
|
|
54545
|
+
expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in,
|
|
54546
|
+
refreshToken: tokens.refresh_token
|
|
54547
|
+
});
|
|
54548
|
+
client.updateConfig({ currentTeam: void 0 });
|
|
54549
|
+
if (isInitialLogin) {
|
|
54550
|
+
await updateCurrentTeamAfterLogin(client);
|
|
54551
|
+
}
|
|
54552
|
+
client.writeToAuthConfigFile();
|
|
54553
|
+
client.writeToConfigFile();
|
|
54554
|
+
output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`);
|
|
54555
|
+
output_manager_default.print(`
|
|
54556
|
+
${import_chalk12.default.cyan("Congratulations!")} You are now signed in.
|
|
54557
|
+
|
|
54558
|
+
To deploy something, run ${getCommandName()}.
|
|
54559
|
+
|
|
54560
|
+
${emoji("tip")} To deploy every commit automatically,
|
|
54561
|
+
connect a Git Repository (${import_chalk12.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).
|
|
54562
|
+
`);
|
|
54563
|
+
telemetry.trackState("success");
|
|
54564
|
+
await autoInstallVercelPlugin(client);
|
|
54565
|
+
return 0;
|
|
54566
|
+
}
|
|
54567
|
+
async function wait(intervalMs) {
|
|
54568
|
+
await new Promise((resolve4) => setTimeout(resolve4, intervalMs));
|
|
54569
|
+
}
|
|
54570
|
+
|
|
53288
54571
|
// src/commands/env/pull.ts
|
|
53289
54572
|
var CONTENTS_PREFIX = "# Created by Vercel CLI\n";
|
|
53290
54573
|
function readHeadSync(path, length) {
|
|
@@ -53407,7 +54690,7 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
53407
54690
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
|
53408
54691
|
const exists = typeof head !== "undefined";
|
|
53409
54692
|
if (head === CONTENTS_PREFIX) {
|
|
53410
|
-
output_manager_default.log(`Overwriting existing ${
|
|
54693
|
+
output_manager_default.log(`Overwriting existing ${import_chalk13.default.bold(filename)} file`);
|
|
53411
54694
|
} else if (exists && !skipConfirmation) {
|
|
53412
54695
|
if (client.nonInteractive) {
|
|
53413
54696
|
outputActionRequired(client, {
|
|
@@ -53435,18 +54718,18 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
53435
54718
|
}
|
|
53436
54719
|
}
|
|
53437
54720
|
const projectSlugLink = formatProject(link.org.slug, link.project.name);
|
|
53438
|
-
const downloadMessage = gitBranch ? `Downloading \`${
|
|
54721
|
+
const downloadMessage = gitBranch ? `Downloading \`${import_chalk13.default.cyan(
|
|
53439
54722
|
environment
|
|
53440
|
-
)}\` Environment Variables for ${projectSlugLink} and any overrides for branch ${
|
|
54723
|
+
)}\` Environment Variables for ${projectSlugLink} and any overrides for branch ${import_chalk13.default.cyan(
|
|
53441
54724
|
gitBranch
|
|
53442
|
-
)}` : `Downloading \`${
|
|
54725
|
+
)}` : `Downloading \`${import_chalk13.default.cyan(
|
|
53443
54726
|
environment
|
|
53444
54727
|
)}\` Environment Variables for ${projectSlugLink}`;
|
|
53445
54728
|
output_manager_default.log(downloadMessage);
|
|
53446
54729
|
const pullStamp = stamp_default();
|
|
53447
54730
|
output_manager_default.spinner("Downloading");
|
|
53448
54731
|
const pullId = deploymentId || link.project.id;
|
|
53449
|
-
const pullResult = await
|
|
54732
|
+
const pullResult = await pullEnvRecordsForEnvPull(client, pullId, source, {
|
|
53450
54733
|
target: environment || "development",
|
|
53451
54734
|
gitBranch
|
|
53452
54735
|
});
|
|
@@ -53474,26 +54757,74 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
53474
54757
|
}
|
|
53475
54758
|
output_manager_default.print(
|
|
53476
54759
|
`${prependEmoji(
|
|
53477
|
-
`${exists ? "Updated" : "Created"} ${
|
|
54760
|
+
`${exists ? "Updated" : "Created"} ${import_chalk13.default.bold(filename)} file ${isGitIgnoreUpdated ? "and added it to .gitignore" : ""} ${import_chalk13.default.gray(pullStamp())}`,
|
|
53478
54761
|
emoji("success")
|
|
53479
54762
|
)}
|
|
53480
54763
|
`
|
|
53481
54764
|
);
|
|
53482
54765
|
}
|
|
54766
|
+
async function pullEnvRecordsForEnvPull(client, pullId, source, options) {
|
|
54767
|
+
try {
|
|
54768
|
+
return await pullEnvRecords(client, pullId, source, options);
|
|
54769
|
+
} catch (error) {
|
|
54770
|
+
if (!isAPIError(error) || error.code !== "challenge_required") {
|
|
54771
|
+
throw error;
|
|
54772
|
+
}
|
|
54773
|
+
const refreshToken = client.authConfig.refreshToken;
|
|
54774
|
+
if (!refreshToken || client.authConfig.tokenSource || !client.stdin.isTTY) {
|
|
54775
|
+
throw error;
|
|
54776
|
+
}
|
|
54777
|
+
output_manager_default.stopSpinner();
|
|
54778
|
+
output_manager_default.log("Sensitive Environment Variables require fresh authentication.");
|
|
54779
|
+
const acrValues = getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate);
|
|
54780
|
+
if (!acrValues) {
|
|
54781
|
+
throw error;
|
|
54782
|
+
}
|
|
54783
|
+
const tokens = await performDeviceCodeFlow(client, {
|
|
54784
|
+
refreshToken,
|
|
54785
|
+
acrValues
|
|
54786
|
+
});
|
|
54787
|
+
if (!tokens) {
|
|
54788
|
+
throw error;
|
|
54789
|
+
}
|
|
54790
|
+
client.updateAuthConfig({
|
|
54791
|
+
token: tokens.access_token,
|
|
54792
|
+
userId: void 0,
|
|
54793
|
+
expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in
|
|
54794
|
+
});
|
|
54795
|
+
client.writeToAuthConfigFile();
|
|
54796
|
+
output_manager_default.spinner("Downloading");
|
|
54797
|
+
return await pullEnvRecords(client, pullId, source, options);
|
|
54798
|
+
}
|
|
54799
|
+
}
|
|
54800
|
+
function getAcrValuesFromWWWAuthenticate(header) {
|
|
54801
|
+
if (!header) {
|
|
54802
|
+
return;
|
|
54803
|
+
}
|
|
54804
|
+
const bearerIndex = header.toLowerCase().indexOf("bearer");
|
|
54805
|
+
if (bearerIndex === -1) {
|
|
54806
|
+
return;
|
|
54807
|
+
}
|
|
54808
|
+
const bearerChallenge = header.slice(bearerIndex + "bearer".length);
|
|
54809
|
+
const match = bearerChallenge.match(
|
|
54810
|
+
/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i
|
|
54811
|
+
);
|
|
54812
|
+
return match?.[1]?.replace(/\\(.)/g, "$1") ?? match?.[2];
|
|
54813
|
+
}
|
|
53483
54814
|
function escapeValue(value) {
|
|
53484
54815
|
return value ? value.replace(new RegExp("\n", "g"), "\\n").replace(new RegExp("\r", "g"), "\\r") : "";
|
|
53485
54816
|
}
|
|
53486
54817
|
|
|
53487
54818
|
// src/util/projects/find-project-root.ts
|
|
53488
|
-
var
|
|
54819
|
+
var import_chalk14 = __toESM(require_source(), 1);
|
|
53489
54820
|
var import_fs_extra7 = __toESM(require_lib3(), 1);
|
|
53490
54821
|
import { stat } from "fs/promises";
|
|
53491
|
-
import { join as
|
|
54822
|
+
import { join as join9, dirname } from "path";
|
|
53492
54823
|
|
|
53493
54824
|
// src/util/projects/detect-services.ts
|
|
53494
54825
|
var import_fs_detectors2 = __toESM(require_dist6(), 1);
|
|
53495
|
-
import { readFile as
|
|
53496
|
-
import { basename as basename2, join as
|
|
54826
|
+
import { readFile as readFile4, writeFile as writeFile3 } from "fs/promises";
|
|
54827
|
+
import { basename as basename2, join as join8 } from "path";
|
|
53497
54828
|
import { parse as tomlParse, stringify as tomlStringify } from "smol-toml";
|
|
53498
54829
|
|
|
53499
54830
|
// src/util/is-vercel-toml-enabled.ts
|
|
@@ -54183,7 +55514,7 @@ function validateConfig(config) {
|
|
|
54183
55514
|
}
|
|
54184
55515
|
|
|
54185
55516
|
// src/util/projects/detect-entrypoint.ts
|
|
54186
|
-
import { join as
|
|
55517
|
+
import { join as join7 } from "path";
|
|
54187
55518
|
import {
|
|
54188
55519
|
isPythonFramework,
|
|
54189
55520
|
isNodeBackendFramework,
|
|
@@ -54191,7 +55522,7 @@ import {
|
|
|
54191
55522
|
} from "@vercel/build-utils";
|
|
54192
55523
|
function createDetectEntrypoint(projectRoot) {
|
|
54193
55524
|
return async ({ workPath, framework }) => {
|
|
54194
|
-
const absWorkPath = normalizePath2(
|
|
55525
|
+
const absWorkPath = normalizePath2(join7(projectRoot, workPath));
|
|
54195
55526
|
if (isPythonFramework(framework)) {
|
|
54196
55527
|
const { detectEntrypoint } = await import("@vercel/python");
|
|
54197
55528
|
return detectEntrypoint({
|
|
@@ -54254,7 +55585,7 @@ async function tryDetectServices(cwd) {
|
|
|
54254
55585
|
}
|
|
54255
55586
|
async function writeServicesConfig(cwd, config) {
|
|
54256
55587
|
const prepared = await prepareServicesConfigWrite(cwd, config);
|
|
54257
|
-
await
|
|
55588
|
+
await writeFile3(prepared.configPath, prepared.content, "utf8");
|
|
54258
55589
|
return { configFileName: basename2(prepared.configPath) };
|
|
54259
55590
|
}
|
|
54260
55591
|
async function getServicesConfigWriteBlocker(cwd, config) {
|
|
@@ -54272,9 +55603,9 @@ function toProjectServicesConfigPatch(config) {
|
|
|
54272
55603
|
}
|
|
54273
55604
|
async function prepareServicesConfigWrite(cwd, config) {
|
|
54274
55605
|
const compileResult = await compileVercelConfig(cwd);
|
|
54275
|
-
const configPath =
|
|
55606
|
+
const configPath = join8(cwd, "vercel.json");
|
|
54276
55607
|
if (isVercelTomlEnabled() && compileResult.sourceFile === "vercel.toml") {
|
|
54277
|
-
return prepareTomlServicesConfigWrite(
|
|
55608
|
+
return prepareTomlServicesConfigWrite(join8(cwd, "vercel.toml"), config);
|
|
54278
55609
|
}
|
|
54279
55610
|
if (compileResult.wasCompiled) {
|
|
54280
55611
|
throw new Error(
|
|
@@ -54307,7 +55638,7 @@ async function prepareTomlServicesConfigWrite(configPath, config) {
|
|
|
54307
55638
|
const patchKeys = Object.keys(patch);
|
|
54308
55639
|
let existingContent;
|
|
54309
55640
|
try {
|
|
54310
|
-
existingContent = await
|
|
55641
|
+
existingContent = await readFile4(configPath, "utf8");
|
|
54311
55642
|
} catch {
|
|
54312
55643
|
existingContent = "";
|
|
54313
55644
|
}
|
|
@@ -54354,10 +55685,10 @@ async function findProjectRoot(startDir) {
|
|
|
54354
55685
|
} catch {
|
|
54355
55686
|
return null;
|
|
54356
55687
|
}
|
|
54357
|
-
const hasVercelDir = await (0, import_fs_extra7.pathExists)(
|
|
54358
|
-
const hasVercelJson = await (0, import_fs_extra7.pathExists)(
|
|
54359
|
-
const hasVercelToml = isVercelTomlEnabled() && await (0, import_fs_extra7.pathExists)(
|
|
54360
|
-
const hasGit = await (0, import_fs_extra7.pathExists)(
|
|
55688
|
+
const hasVercelDir = await (0, import_fs_extra7.pathExists)(join9(dir, ".vercel"));
|
|
55689
|
+
const hasVercelJson = await (0, import_fs_extra7.pathExists)(join9(dir, "vercel.json"));
|
|
55690
|
+
const hasVercelToml = isVercelTomlEnabled() && await (0, import_fs_extra7.pathExists)(join9(dir, "vercel.toml"));
|
|
55691
|
+
const hasGit = await (0, import_fs_extra7.pathExists)(join9(dir, ".git"));
|
|
54361
55692
|
if (hasVercelDir || hasVercelJson || hasVercelToml || hasGit) {
|
|
54362
55693
|
return dir;
|
|
54363
55694
|
}
|
|
@@ -54375,15 +55706,15 @@ async function resolveProjectCwd(cwd) {
|
|
|
54375
55706
|
}
|
|
54376
55707
|
const result = await tryDetectServices(projectRoot);
|
|
54377
55708
|
if (result && (result.services?.length ?? 0) > 0) {
|
|
54378
|
-
output_manager_default.debug(`Running from project root: ${
|
|
55709
|
+
output_manager_default.debug(`Running from project root: ${import_chalk14.default.cyan(projectRoot)}`);
|
|
54379
55710
|
return projectRoot;
|
|
54380
55711
|
}
|
|
54381
55712
|
return cwd;
|
|
54382
55713
|
}
|
|
54383
55714
|
|
|
54384
55715
|
// src/util/projects/link.ts
|
|
54385
|
-
var
|
|
54386
|
-
var
|
|
55716
|
+
var readFile5 = promisify(fs4.readFile);
|
|
55717
|
+
var writeFile4 = promisify(fs4.writeFile);
|
|
54387
55718
|
var VERCEL_DIR = ".vercel";
|
|
54388
55719
|
var VERCEL_DIR_FALLBACK = ".now";
|
|
54389
55720
|
var VERCEL_DIR_README = "README.txt";
|
|
@@ -54408,7 +55739,7 @@ var linkSchema = {
|
|
|
54408
55739
|
}
|
|
54409
55740
|
};
|
|
54410
55741
|
function getVercelDirectory(cwd) {
|
|
54411
|
-
const possibleDirs = [
|
|
55742
|
+
const possibleDirs = [join10(cwd, VERCEL_DIR), join10(cwd, VERCEL_DIR_FALLBACK)];
|
|
54412
55743
|
const existingDirs = possibleDirs.filter((d) => isDirectory(d));
|
|
54413
55744
|
if (existingDirs.length > 1) {
|
|
54414
55745
|
throw new NowBuildError2({
|
|
@@ -54500,7 +55831,7 @@ async function getProjectLinkFromRepoLink(client, path, projectName, projectName
|
|
|
54500
55831
|
}
|
|
54501
55832
|
async function getLinkFromDir(dir) {
|
|
54502
55833
|
try {
|
|
54503
|
-
const json = await
|
|
55834
|
+
const json = await readFile5(join10(dir, VERCEL_DIR_PROJECT), "utf8");
|
|
54504
55835
|
const ajv2 = new import_ajv2.default();
|
|
54505
55836
|
const link = JSON.parse(json);
|
|
54506
55837
|
if (!ajv2.validate(linkSchema, link)) {
|
|
@@ -54660,8 +55991,8 @@ No, you should not share the ".vercel" folder with anyone.
|
|
|
54660
55991
|
Upon creation, it will be automatically added to your ".gitignore" file.
|
|
54661
55992
|
`;
|
|
54662
55993
|
async function writeReadme(path) {
|
|
54663
|
-
await
|
|
54664
|
-
|
|
55994
|
+
await writeFile4(
|
|
55995
|
+
join10(path, VERCEL_DIR, VERCEL_DIR_README),
|
|
54665
55996
|
VERCEL_DIR_README_CONTENT
|
|
54666
55997
|
);
|
|
54667
55998
|
}
|
|
@@ -54670,15 +56001,15 @@ async function linkFolderToProject(client, path, projectLink, projectName, orgSl
|
|
|
54670
56001
|
return;
|
|
54671
56002
|
}
|
|
54672
56003
|
try {
|
|
54673
|
-
await (0, import_fs_extra8.ensureDir)(
|
|
56004
|
+
await (0, import_fs_extra8.ensureDir)(join10(path, VERCEL_DIR));
|
|
54674
56005
|
} catch (err) {
|
|
54675
56006
|
if ((0, import_error_utils4.isErrnoException)(err) && err.code === "ENOTDIR") {
|
|
54676
56007
|
return;
|
|
54677
56008
|
}
|
|
54678
56009
|
throw err;
|
|
54679
56010
|
}
|
|
54680
|
-
await
|
|
54681
|
-
|
|
56011
|
+
await writeFile4(
|
|
56012
|
+
join10(path, VERCEL_DIR, VERCEL_DIR_PROJECT),
|
|
54682
56013
|
JSON.stringify({
|
|
54683
56014
|
...projectLink,
|
|
54684
56015
|
projectName
|
|
@@ -54790,9 +56121,9 @@ var VERCEL_CONFIG_EXTENSIONS = [
|
|
|
54790
56121
|
"cjs"
|
|
54791
56122
|
];
|
|
54792
56123
|
var DEFAULT_VERCEL_CONFIG_FILENAME = "Vercel config";
|
|
54793
|
-
async function
|
|
56124
|
+
async function fileExists2(filePath) {
|
|
54794
56125
|
try {
|
|
54795
|
-
await
|
|
56126
|
+
await access2(filePath);
|
|
54796
56127
|
return true;
|
|
54797
56128
|
} catch {
|
|
54798
56129
|
return false;
|
|
@@ -54801,8 +56132,8 @@ async function fileExists(filePath) {
|
|
|
54801
56132
|
async function findAllVercelConfigFiles(workPath) {
|
|
54802
56133
|
const foundFiles = [];
|
|
54803
56134
|
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
54804
|
-
const configPath =
|
|
54805
|
-
if (await
|
|
56135
|
+
const configPath = join11(workPath, `vercel.${ext}`);
|
|
56136
|
+
if (await fileExists2(configPath)) {
|
|
54806
56137
|
foundFiles.push(configPath);
|
|
54807
56138
|
}
|
|
54808
56139
|
}
|
|
@@ -54810,14 +56141,14 @@ async function findAllVercelConfigFiles(workPath) {
|
|
|
54810
56141
|
}
|
|
54811
56142
|
async function findSourceVercelConfigFile(workPath) {
|
|
54812
56143
|
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
54813
|
-
const configPath =
|
|
54814
|
-
if (await
|
|
56144
|
+
const configPath = join11(workPath, `vercel.${ext}`);
|
|
56145
|
+
if (await fileExists2(configPath)) {
|
|
54815
56146
|
return basename3(configPath);
|
|
54816
56147
|
}
|
|
54817
56148
|
}
|
|
54818
56149
|
if (isVercelTomlEnabled()) {
|
|
54819
|
-
const tomlPath =
|
|
54820
|
-
if (await
|
|
56150
|
+
const tomlPath = join11(workPath, "vercel.toml");
|
|
56151
|
+
if (await fileExists2(tomlPath)) {
|
|
54821
56152
|
return "vercel.toml";
|
|
54822
56153
|
}
|
|
54823
56154
|
}
|
|
@@ -54858,15 +56189,15 @@ function parseConfigLoaderError(stderr) {
|
|
|
54858
56189
|
return stderr.trim();
|
|
54859
56190
|
}
|
|
54860
56191
|
async function compileVercelConfig(workPath) {
|
|
54861
|
-
const vercelJsonPath =
|
|
54862
|
-
const nowJsonPath =
|
|
54863
|
-
const vercelTomlPath =
|
|
54864
|
-
const hasVercelJson = await
|
|
54865
|
-
const hasNowJson = await
|
|
54866
|
-
const hasVercelToml = isVercelTomlEnabled() && await
|
|
56192
|
+
const vercelJsonPath = join11(workPath, "vercel.json");
|
|
56193
|
+
const nowJsonPath = join11(workPath, "now.json");
|
|
56194
|
+
const vercelTomlPath = join11(workPath, "vercel.toml");
|
|
56195
|
+
const hasVercelJson = await fileExists2(vercelJsonPath);
|
|
56196
|
+
const hasNowJson = await fileExists2(nowJsonPath);
|
|
56197
|
+
const hasVercelToml = isVercelTomlEnabled() && await fileExists2(vercelTomlPath);
|
|
54867
56198
|
const vercelConfigPath = await findVercelConfigFile(workPath);
|
|
54868
|
-
const vercelDir =
|
|
54869
|
-
const compiledConfigPath =
|
|
56199
|
+
const vercelDir = join11(workPath, VERCEL_DIR);
|
|
56200
|
+
const compiledConfigPath = join11(vercelDir, "vercel.json");
|
|
54870
56201
|
if (hasNowJson) {
|
|
54871
56202
|
throw new DeprecatedNowJson(nowJsonPath);
|
|
54872
56203
|
}
|
|
@@ -54891,7 +56222,7 @@ async function compileVercelConfig(workPath) {
|
|
|
54891
56222
|
wasCompiled: false
|
|
54892
56223
|
};
|
|
54893
56224
|
}
|
|
54894
|
-
if (await
|
|
56225
|
+
if (await fileExists2(compiledConfigPath)) {
|
|
54895
56226
|
return {
|
|
54896
56227
|
configPath: compiledConfigPath,
|
|
54897
56228
|
wasCompiled: true,
|
|
@@ -54905,11 +56236,11 @@ async function compileVercelConfig(workPath) {
|
|
|
54905
56236
|
}
|
|
54906
56237
|
if (hasVercelToml) {
|
|
54907
56238
|
try {
|
|
54908
|
-
const tomlContent = await
|
|
56239
|
+
const tomlContent = await readFile6(vercelTomlPath, "utf8");
|
|
54909
56240
|
const config = tomlParse2(tomlContent);
|
|
54910
56241
|
const normalizedConfig = normalizeConfig(config);
|
|
54911
56242
|
await mkdir(vercelDir, { recursive: true });
|
|
54912
|
-
await
|
|
56243
|
+
await writeFile5(
|
|
54913
56244
|
compiledConfigPath,
|
|
54914
56245
|
JSON.stringify(normalizedConfig, null, 2),
|
|
54915
56246
|
"utf-8"
|
|
@@ -54929,10 +56260,10 @@ async function compileVercelConfig(workPath) {
|
|
|
54929
56260
|
}
|
|
54930
56261
|
}
|
|
54931
56262
|
const sourceConfigPath = vercelConfigPath;
|
|
54932
|
-
(0, import_dotenv.config)({ path:
|
|
54933
|
-
(0, import_dotenv.config)({ path:
|
|
54934
|
-
const tempOutPath =
|
|
54935
|
-
const loaderPath =
|
|
56263
|
+
(0, import_dotenv.config)({ path: join11(workPath, ".env") });
|
|
56264
|
+
(0, import_dotenv.config)({ path: join11(workPath, ".env.local") });
|
|
56265
|
+
const tempOutPath = join11(vercelDir, "vercel-temp.mjs");
|
|
56266
|
+
const loaderPath = join11(vercelDir, "vercel-loader.mjs");
|
|
54936
56267
|
try {
|
|
54937
56268
|
const { build } = await import("esbuild");
|
|
54938
56269
|
await mkdir(vercelDir, { recursive: true });
|
|
@@ -54952,7 +56283,7 @@ async function compileVercelConfig(workPath) {
|
|
|
54952
56283
|
const config = ('default' in configModule) ? configModule.default : ('config' in configModule) ? configModule.config : configModule;
|
|
54953
56284
|
process.send(config);
|
|
54954
56285
|
`;
|
|
54955
|
-
await
|
|
56286
|
+
await writeFile5(loaderPath, loaderScript, "utf-8");
|
|
54956
56287
|
const config = await new Promise((resolve4, reject) => {
|
|
54957
56288
|
const child = fork(loaderPath, [tempOutPath], {
|
|
54958
56289
|
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
@@ -55003,7 +56334,7 @@ async function compileVercelConfig(workPath) {
|
|
|
55003
56334
|
});
|
|
55004
56335
|
});
|
|
55005
56336
|
const normalizedConfig = normalizeConfig(config);
|
|
55006
|
-
await
|
|
56337
|
+
await writeFile5(
|
|
55007
56338
|
compiledConfigPath,
|
|
55008
56339
|
JSON.stringify(normalizedConfig, null, 2),
|
|
55009
56340
|
"utf-8"
|
|
@@ -55036,16 +56367,16 @@ async function compileVercelConfig(workPath) {
|
|
|
55036
56367
|
}
|
|
55037
56368
|
}
|
|
55038
56369
|
async function getVercelConfigPath(workPath) {
|
|
55039
|
-
const vercelJsonPath =
|
|
55040
|
-
const vercelTomlPath =
|
|
55041
|
-
const compiledConfigPath =
|
|
55042
|
-
if (await
|
|
56370
|
+
const vercelJsonPath = join11(workPath, "vercel.json");
|
|
56371
|
+
const vercelTomlPath = join11(workPath, "vercel.toml");
|
|
56372
|
+
const compiledConfigPath = join11(workPath, VERCEL_DIR, "vercel.json");
|
|
56373
|
+
if (await fileExists2(vercelJsonPath)) {
|
|
55043
56374
|
return vercelJsonPath;
|
|
55044
56375
|
}
|
|
55045
|
-
if (isVercelTomlEnabled() && await
|
|
56376
|
+
if (isVercelTomlEnabled() && await fileExists2(vercelTomlPath)) {
|
|
55046
56377
|
return vercelTomlPath;
|
|
55047
56378
|
}
|
|
55048
|
-
if (await
|
|
56379
|
+
if (await fileExists2(compiledConfigPath)) {
|
|
55049
56380
|
return compiledConfigPath;
|
|
55050
56381
|
}
|
|
55051
56382
|
return vercelJsonPath;
|
|
@@ -55083,6 +56414,16 @@ export {
|
|
|
55083
56414
|
esm_default,
|
|
55084
56415
|
esm_default2,
|
|
55085
56416
|
esm_default3,
|
|
56417
|
+
ua_default,
|
|
56418
|
+
require_open,
|
|
56419
|
+
autoInstallVercelPlugin,
|
|
56420
|
+
showPluginTipIfNeeded,
|
|
56421
|
+
processTokenResponse,
|
|
56422
|
+
revocationRequest,
|
|
56423
|
+
processRevocationResponse,
|
|
56424
|
+
refreshTokenRequest,
|
|
56425
|
+
performDeviceCodeFlow,
|
|
56426
|
+
login,
|
|
55086
56427
|
require_inherits,
|
|
55087
56428
|
require_tar_fs,
|
|
55088
56429
|
require_dist7 as require_dist,
|