vercel 54.6.1 → 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-PABR7UDW.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-YV5W67AJ.js → chunk-5K6XFQBY.js} +45 -777
- package/dist/chunks/{chunk-F7OFM5NM.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-L3BYKHWE.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-HXCZ6ZNO.js → chunk-DDORH57D.js} +2 -2
- package/dist/chunks/{chunk-55ZHYOXR.js → chunk-ERQAMRRQ.js} +2 -2
- package/dist/chunks/{chunk-NVHKS2AA.js → chunk-FO7QBAVZ.js} +4 -4
- package/dist/chunks/{chunk-TFLXDK24.js → chunk-FQ2EU7QM.js} +7 -7
- package/dist/chunks/{chunk-NYJXGEIR.js → chunk-FV5RQPKY.js} +1 -1
- package/dist/chunks/{chunk-5IH3CKCW.js → chunk-HW6MMF4G.js} +4 -4
- package/dist/chunks/{chunk-UGXBNJMO.js → chunk-IDFKAJW3.js} +1 -0
- package/dist/chunks/{chunk-3ZDA2CNR.js → chunk-K5ISROJF.js} +1 -1
- package/dist/chunks/{chunk-KSS3AMDU.js → chunk-KFVFRVDK.js} +2 -2
- package/dist/chunks/{chunk-HD3NJHWT.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-V2EPUZ7C.js → chunk-QAHIBMRJ.js} +1490 -167
- package/dist/chunks/chunk-RKLHR2YE.js +152 -0
- package/dist/chunks/{chunk-KTMAZEOI.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-DSVJF7BT.js → chunk-TSUZWPXS.js} +4 -4
- package/dist/chunks/{chunk-BDBG7347.js → chunk-TVXUA533.js} +2 -2
- package/dist/chunks/{chunk-DUIYXUIB.js → chunk-UOYAPQ6P.js} +10 -14
- package/dist/chunks/{chunk-FJOUYHN4.js → chunk-WAGY7TO7.js} +1 -1
- package/dist/chunks/{chunk-ZINNI4TC.js → chunk-WWLVPUED.js} +1 -1
- package/dist/chunks/{chunk-TKQCQ2Z4.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-UWWV5Q74.js → compile-vercel-config-UMMPRYHE.js} +4 -4
- package/dist/chunks/{delete-Z2TQELK6.js → delete-ZIUHVZKU.js} +6 -6
- package/dist/chunks/{disable-D7GG4H3R.js → disable-3I6Y3PMB.js} +6 -6
- package/dist/chunks/{discard-IIG3TUIT.js → discard-P4QEYWQI.js} +6 -6
- package/dist/chunks/{edit-DD2KENCR.js → edit-C7W4II4F.js} +7 -7
- package/dist/chunks/{enable-UCYQRKCL.js → enable-YLFEOJHC.js} +6 -6
- package/dist/chunks/{export-U4BZUMSZ.js → export-AEWPAFG5.js} +6 -6
- package/dist/chunks/{inspect-PYA4NFIT.js → inspect-UTKNO4PH.js} +8 -8
- package/dist/chunks/{list-RDT3KISX.js → list-G2JFMLAP.js} +6 -6
- package/dist/chunks/{list-QHVLSNFO.js → list-K6T37XX7.js} +9 -9
- package/dist/chunks/{ls-E3EILWRU.js → ls-SDUUITFJ.js} +8 -8
- package/dist/chunks/{publish-HSIQS5SO.js → publish-CVDJGN4U.js} +6 -6
- package/dist/chunks/{query-5SREWTMU.js → query-NZR7YNV5.js} +8 -8
- package/dist/chunks/{reorder-QRLPE5HF.js → reorder-XXHIOZ4E.js} +6 -6
- package/dist/chunks/{restore-AI3YOHCB.js → restore-SCM6T5BD.js} +6 -6
- package/dist/chunks/{rm-ZLDS7FJG.js → rm-I24CJRZY.js} +8 -8
- package/dist/chunks/{rule-inspect-2LDHZJ24.js → rule-inspect-3K5RYFGG.js} +8 -8
- package/dist/chunks/{rules-DTEFM3BW.js → rules-T2VAUOFG.js} +8 -8
- package/dist/chunks/{schema-G6O7BMIJ.js → schema-F6W32I35.js} +9 -9
- package/dist/chunks/{types-V6KTYGWP.js → types-LU2G5DD3.js} +4 -4
- package/dist/chunks/{update-A3O2FDGF.js → update-ZYQWTTCL.js} +8 -8
- package/dist/commands/build/index.js +22 -24
- package/dist/commands/deploy/index.js +23 -24
- package/dist/commands/dev/index.js +14 -14
- package/dist/commands/env/index.js +18 -19
- 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 +11 -11
- package/dist/chunks/chunk-76ZNZKIN.js +0 -17
- package/dist/chunks/chunk-OF7SJ4AC.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(
|
|
@@ -28345,7 +28348,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28345
28348
|
LocalFileSystemDetector: () => LocalFileSystemDetector4
|
|
28346
28349
|
});
|
|
28347
28350
|
module.exports = __toCommonJS2(local_file_system_detector_exports);
|
|
28348
|
-
var
|
|
28351
|
+
var import_promises6 = __toESM2(__require("fs/promises"));
|
|
28349
28352
|
var import_path12 = __require("path");
|
|
28350
28353
|
var import_filesystem = require_filesystem();
|
|
28351
28354
|
var import_error_utils5 = require_dist();
|
|
@@ -28356,7 +28359,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28356
28359
|
}
|
|
28357
28360
|
async _hasPath(name) {
|
|
28358
28361
|
try {
|
|
28359
|
-
await
|
|
28362
|
+
await import_promises6.default.stat(this.getFilePath(name));
|
|
28360
28363
|
return true;
|
|
28361
28364
|
} catch (err) {
|
|
28362
28365
|
if ((0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT") {
|
|
@@ -28366,15 +28369,15 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28366
28369
|
}
|
|
28367
28370
|
}
|
|
28368
28371
|
_readFile(name) {
|
|
28369
|
-
return
|
|
28372
|
+
return import_promises6.default.readFile(this.getFilePath(name));
|
|
28370
28373
|
}
|
|
28371
28374
|
async _isFile(name) {
|
|
28372
|
-
const stat2 = await
|
|
28375
|
+
const stat2 = await import_promises6.default.stat(this.getFilePath(name));
|
|
28373
28376
|
return stat2.isFile();
|
|
28374
28377
|
}
|
|
28375
28378
|
async _readdir(dir) {
|
|
28376
28379
|
const dirPath = this.getFilePath(dir);
|
|
28377
|
-
const entries = await
|
|
28380
|
+
const entries = await import_promises6.default.readdir(dirPath, { withFileTypes: true });
|
|
28378
28381
|
const result = [];
|
|
28379
28382
|
for (const entry of entries) {
|
|
28380
28383
|
let type;
|
|
@@ -30239,11 +30242,11 @@ var require_brace_expansion2 = __commonJS({
|
|
|
30239
30242
|
if (pad) {
|
|
30240
30243
|
var need = width - c.length;
|
|
30241
30244
|
if (need > 0) {
|
|
30242
|
-
var
|
|
30245
|
+
var z2 = new Array(need + 1).join("0");
|
|
30243
30246
|
if (i < 0)
|
|
30244
|
-
c = "-" +
|
|
30247
|
+
c = "-" + z2 + c.slice(1);
|
|
30245
30248
|
else
|
|
30246
|
-
c =
|
|
30249
|
+
c = z2 + c;
|
|
30247
30250
|
}
|
|
30248
30251
|
}
|
|
30249
30252
|
}
|
|
@@ -33961,6 +33964,330 @@ var require_json_parse_better_errors = __commonJS({
|
|
|
33961
33964
|
}
|
|
33962
33965
|
});
|
|
33963
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
|
+
|
|
33964
34291
|
// ../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js
|
|
33965
34292
|
var require_universalify2 = __commonJS({
|
|
33966
34293
|
"../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js"(exports) {
|
|
@@ -34240,11 +34567,11 @@ var require_utimes2 = __commonJS({
|
|
|
34240
34567
|
"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
|
|
34241
34568
|
"use strict";
|
|
34242
34569
|
var fs5 = require_graceful_fs();
|
|
34243
|
-
var
|
|
34570
|
+
var os3 = __require("os");
|
|
34244
34571
|
var path = __require("path");
|
|
34245
34572
|
function hasMillisResSync() {
|
|
34246
34573
|
let tmpfile = path.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
|
|
34247
|
-
tmpfile = path.join(
|
|
34574
|
+
tmpfile = path.join(os3.tmpdir(), tmpfile);
|
|
34248
34575
|
const d = /* @__PURE__ */ new Date(1435410243862);
|
|
34249
34576
|
fs5.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
|
|
34250
34577
|
const fd = fs5.openSync(tmpfile, "r+");
|
|
@@ -34254,7 +34581,7 @@ var require_utimes2 = __commonJS({
|
|
|
34254
34581
|
}
|
|
34255
34582
|
function hasMillisRes(callback) {
|
|
34256
34583
|
let tmpfile = path.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
|
|
34257
|
-
tmpfile = path.join(
|
|
34584
|
+
tmpfile = path.join(os3.tmpdir(), tmpfile);
|
|
34258
34585
|
const d = /* @__PURE__ */ new Date(1435410243862);
|
|
34259
34586
|
fs5.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
|
|
34260
34587
|
if (err)
|
|
@@ -35552,7 +35879,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
35552
35879
|
} catch (_) {
|
|
35553
35880
|
_fs = __require("fs");
|
|
35554
35881
|
}
|
|
35555
|
-
function
|
|
35882
|
+
function readFile7(file, options, callback) {
|
|
35556
35883
|
if (callback == null) {
|
|
35557
35884
|
callback = options;
|
|
35558
35885
|
options = {};
|
|
@@ -35621,7 +35948,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
35621
35948
|
var str = JSON.stringify(obj, options ? options.replacer : null, spaces);
|
|
35622
35949
|
return str.replace(/\n/g, EOL) + EOL;
|
|
35623
35950
|
}
|
|
35624
|
-
function
|
|
35951
|
+
function writeFile6(file, obj, options, callback) {
|
|
35625
35952
|
if (callback == null) {
|
|
35626
35953
|
callback = options;
|
|
35627
35954
|
options = {};
|
|
@@ -35651,9 +35978,9 @@ var require_jsonfile3 = __commonJS({
|
|
|
35651
35978
|
return content;
|
|
35652
35979
|
}
|
|
35653
35980
|
var jsonfile = {
|
|
35654
|
-
readFile:
|
|
35981
|
+
readFile: readFile7,
|
|
35655
35982
|
readFileSync,
|
|
35656
|
-
writeFile:
|
|
35983
|
+
writeFile: writeFile6,
|
|
35657
35984
|
writeFileSync
|
|
35658
35985
|
};
|
|
35659
35986
|
module.exports = jsonfile;
|
|
@@ -38551,9 +38878,9 @@ var require_path2 = __commonJS({
|
|
|
38551
38878
|
"use strict";
|
|
38552
38879
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38553
38880
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
38554
|
-
var
|
|
38881
|
+
var os3 = __require("os");
|
|
38555
38882
|
var path = __require("path");
|
|
38556
|
-
var IS_WINDOWS_PLATFORM =
|
|
38883
|
+
var IS_WINDOWS_PLATFORM = os3.platform() === "win32";
|
|
38557
38884
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
38558
38885
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
38559
38886
|
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
@@ -38685,9 +39012,9 @@ var require_is_glob = __commonJS({
|
|
|
38685
39012
|
}
|
|
38686
39013
|
}
|
|
38687
39014
|
if (str[index] === "\\") {
|
|
38688
|
-
var
|
|
39015
|
+
var open2 = str[index + 1];
|
|
38689
39016
|
index += 2;
|
|
38690
|
-
var close = chars[
|
|
39017
|
+
var close = chars[open2];
|
|
38691
39018
|
if (close) {
|
|
38692
39019
|
var n = str.indexOf(close, index);
|
|
38693
39020
|
if (n !== -1) {
|
|
@@ -38713,9 +39040,9 @@ var require_is_glob = __commonJS({
|
|
|
38713
39040
|
return true;
|
|
38714
39041
|
}
|
|
38715
39042
|
if (str[index] === "\\") {
|
|
38716
|
-
var
|
|
39043
|
+
var open2 = str[index + 1];
|
|
38717
39044
|
index += 2;
|
|
38718
|
-
var close = chars[
|
|
39045
|
+
var close = chars[open2];
|
|
38719
39046
|
if (close) {
|
|
38720
39047
|
var n = str.indexOf(close, index);
|
|
38721
39048
|
if (n !== -1) {
|
|
@@ -39703,7 +40030,7 @@ var require_parse2 = __commonJS({
|
|
|
39703
40030
|
continue;
|
|
39704
40031
|
}
|
|
39705
40032
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
39706
|
-
const
|
|
40033
|
+
const open2 = value;
|
|
39707
40034
|
let next;
|
|
39708
40035
|
if (options.keepQuotes !== true) {
|
|
39709
40036
|
value = "";
|
|
@@ -39713,7 +40040,7 @@ var require_parse2 = __commonJS({
|
|
|
39713
40040
|
value += next + advance();
|
|
39714
40041
|
continue;
|
|
39715
40042
|
}
|
|
39716
|
-
if (next ===
|
|
40043
|
+
if (next === open2) {
|
|
39717
40044
|
if (options.keepQuotes === true)
|
|
39718
40045
|
value += next;
|
|
39719
40046
|
break;
|
|
@@ -39757,8 +40084,8 @@ var require_parse2 = __commonJS({
|
|
|
39757
40084
|
if (value === CHAR_COMMA && depth > 0) {
|
|
39758
40085
|
if (block.ranges > 0) {
|
|
39759
40086
|
block.ranges = 0;
|
|
39760
|
-
const
|
|
39761
|
-
block.nodes = [
|
|
40087
|
+
const open2 = block.nodes.shift();
|
|
40088
|
+
block.nodes = [open2, { type: "text", value: stringify(block) }];
|
|
39762
40089
|
}
|
|
39763
40090
|
push({ type: "comma", value });
|
|
39764
40091
|
block.commas++;
|
|
@@ -40861,15 +41188,15 @@ var require_parse3 = __commonJS({
|
|
|
40861
41188
|
}
|
|
40862
41189
|
if (value === "{" && opts.nobrace !== true) {
|
|
40863
41190
|
increment("braces");
|
|
40864
|
-
const
|
|
41191
|
+
const open2 = {
|
|
40865
41192
|
type: "brace",
|
|
40866
41193
|
value,
|
|
40867
41194
|
output: "(",
|
|
40868
41195
|
outputIndex: state.output.length,
|
|
40869
41196
|
tokensIndex: state.tokens.length
|
|
40870
41197
|
};
|
|
40871
|
-
braces.push(
|
|
40872
|
-
push(
|
|
41198
|
+
braces.push(open2);
|
|
41199
|
+
push(open2);
|
|
40873
41200
|
continue;
|
|
40874
41201
|
}
|
|
40875
41202
|
if (value === "}") {
|
|
@@ -43872,8 +44199,8 @@ var require_settings4 = __commonJS({
|
|
|
43872
44199
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43873
44200
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
43874
44201
|
var fs5 = __require("fs");
|
|
43875
|
-
var
|
|
43876
|
-
var CPU_COUNT = Math.max(
|
|
44202
|
+
var os3 = __require("os");
|
|
44203
|
+
var CPU_COUNT = Math.max(os3.cpus().length, 1);
|
|
43877
44204
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
43878
44205
|
lstat: fs5.lstat,
|
|
43879
44206
|
lstatSync: fs5.lstatSync,
|
|
@@ -44064,14 +44391,14 @@ var require_utils8 = __commonJS({
|
|
|
44064
44391
|
});
|
|
44065
44392
|
module.exports = __toCommonJS2(utils_exports);
|
|
44066
44393
|
var import_node_fs2 = __toESM2(__require("fs"), 1);
|
|
44067
|
-
var
|
|
44394
|
+
var import_node_path3 = __require("path");
|
|
44068
44395
|
var CONFIGURATION_FILENAMES = [
|
|
44069
44396
|
"microfrontends.jsonc",
|
|
44070
44397
|
"microfrontends.json"
|
|
44071
44398
|
];
|
|
44072
44399
|
function findConfig({ dir }) {
|
|
44073
44400
|
for (const filename of CONFIGURATION_FILENAMES) {
|
|
44074
|
-
const maybeConfig = (0,
|
|
44401
|
+
const maybeConfig = (0, import_node_path3.join)(dir, filename);
|
|
44075
44402
|
if (import_node_fs2.default.existsSync(maybeConfig)) {
|
|
44076
44403
|
return maybeConfig;
|
|
44077
44404
|
}
|
|
@@ -44291,11 +44618,11 @@ var require_utils9 = __commonJS({
|
|
|
44291
44618
|
prepareFiles: () => prepareFiles
|
|
44292
44619
|
});
|
|
44293
44620
|
module.exports = __toCommonJS2(utils_exports);
|
|
44294
|
-
var
|
|
44621
|
+
var import_node_fetch2 = __toESM2(require_lib2());
|
|
44295
44622
|
var import_path12 = __require("path");
|
|
44296
44623
|
var import_url4 = __require("url");
|
|
44297
44624
|
var import_ignore = __toESM2(require_ignore());
|
|
44298
|
-
var
|
|
44625
|
+
var import_pkg2 = require_pkg();
|
|
44299
44626
|
var import_build_utils6 = __require("@vercel/build-utils");
|
|
44300
44627
|
var import_async_sema = require_lib7();
|
|
44301
44628
|
var import_fs_extra9 = require_lib6();
|
|
@@ -44564,17 +44891,17 @@ ${clearRelative(ignoreFile)}`);
|
|
|
44564
44891
|
url = parsedUrl.toString();
|
|
44565
44892
|
delete opts.teamId;
|
|
44566
44893
|
}
|
|
44567
|
-
const
|
|
44894
|
+
const userAgent2 = opts.userAgent || `client-v${import_pkg2.pkgVersion}`;
|
|
44568
44895
|
delete opts.userAgent;
|
|
44569
44896
|
opts.headers = {
|
|
44570
44897
|
...opts.headers,
|
|
44571
44898
|
authorization: `Bearer ${token}`,
|
|
44572
44899
|
accept: "application/json",
|
|
44573
|
-
"user-agent":
|
|
44900
|
+
"user-agent": userAgent2
|
|
44574
44901
|
};
|
|
44575
44902
|
debug(`${opts.method || "GET"} ${url}`);
|
|
44576
44903
|
time = Date.now();
|
|
44577
|
-
const res = await (0,
|
|
44904
|
+
const res = await (0, import_node_fetch2.default)(url, opts);
|
|
44578
44905
|
debug(`DONE in ${Date.now() - time}ms: ${opts.method || "GET"} ${url}`);
|
|
44579
44906
|
semaphore.release();
|
|
44580
44907
|
return res;
|
|
@@ -44740,7 +45067,7 @@ var require_check_deployment_status = __commonJS({
|
|
|
44740
45067
|
}
|
|
44741
45068
|
}
|
|
44742
45069
|
async function* checkDeploymentStatus2(deployment, clientOptions) {
|
|
44743
|
-
const { token, teamId, apiUrl, userAgent } = clientOptions;
|
|
45070
|
+
const { token, teamId, apiUrl, userAgent: userAgent2 } = clientOptions;
|
|
44744
45071
|
const debug = (0, import_utils22.createDebug)(clientOptions.debug);
|
|
44745
45072
|
let deploymentState = deployment;
|
|
44746
45073
|
const apiDeployments = (0, import_utils4.getApiDeploymentsUrl)();
|
|
@@ -44760,7 +45087,7 @@ var require_check_deployment_status = __commonJS({
|
|
|
44760
45087
|
deploymentResponse = await (0, import_utils4.fetchApi)(
|
|
44761
45088
|
`${apiDeployments}/${deployment.id || deployment.deploymentId}${teamId ? `?teamId=${teamId}` : ""}`,
|
|
44762
45089
|
token,
|
|
44763
|
-
{ apiUrl, userAgent, agent: clientOptions.agent }
|
|
45090
|
+
{ apiUrl, userAgent: userAgent2, agent: clientOptions.agent }
|
|
44764
45091
|
);
|
|
44765
45092
|
retriesLeft--;
|
|
44766
45093
|
if (retriesLeft == 0) {
|
|
@@ -45973,7 +46300,7 @@ var require_BufferList = __commonJS({
|
|
|
45973
46300
|
this.head = this.tail = null;
|
|
45974
46301
|
this.length = 0;
|
|
45975
46302
|
};
|
|
45976
|
-
BufferList.prototype.join = function
|
|
46303
|
+
BufferList.prototype.join = function join12(s) {
|
|
45977
46304
|
if (this.length === 0)
|
|
45978
46305
|
return "";
|
|
45979
46306
|
var p = this.head;
|
|
@@ -49202,8 +49529,8 @@ var require_tar_fs = __commonJS({
|
|
|
49202
49529
|
var mkdirp = require_mkdirp();
|
|
49203
49530
|
var fs5 = __require("fs");
|
|
49204
49531
|
var path = __require("path");
|
|
49205
|
-
var
|
|
49206
|
-
var win32 =
|
|
49532
|
+
var os3 = __require("os");
|
|
49533
|
+
var win32 = os3.platform() === "win32";
|
|
49207
49534
|
var noop = function() {
|
|
49208
49535
|
};
|
|
49209
49536
|
var echo = function(name) {
|
|
@@ -49563,7 +49890,7 @@ var require_archive = __commonJS({
|
|
|
49563
49890
|
createTgzFiles: () => createTgzFiles
|
|
49564
49891
|
});
|
|
49565
49892
|
module.exports = __toCommonJS2(archive_exports);
|
|
49566
|
-
var
|
|
49893
|
+
var import_node_path3 = __require("path");
|
|
49567
49894
|
var import_node_zlib = __require("zlib");
|
|
49568
49895
|
var import_build_utils6 = __require("@vercel/build-utils");
|
|
49569
49896
|
var import_tar_fs = __toESM2(require_tar_fs());
|
|
@@ -49572,7 +49899,7 @@ var require_archive = __commonJS({
|
|
|
49572
49899
|
const filesToArchive = exclude ? fileList.filter((file) => !exclude.includes(file)) : fileList;
|
|
49573
49900
|
debug?.("Packing tarball");
|
|
49574
49901
|
const tarStream = import_tar_fs.default.pack(workPath, {
|
|
49575
|
-
entries: filesToArchive.map((file) => (0,
|
|
49902
|
+
entries: filesToArchive.map((file) => (0, import_node_path3.relative)(workPath, file))
|
|
49576
49903
|
}).pipe((0, import_node_zlib.createGzip)());
|
|
49577
49904
|
const chunkedTarBuffers = await (0, import_build_utils6.streamToBufferChunks)(tarStream);
|
|
49578
49905
|
debug?.(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
|
|
@@ -49580,7 +49907,7 @@ var require_archive = __commonJS({
|
|
|
49580
49907
|
chunkedTarBuffers.map((chunk, index) => [
|
|
49581
49908
|
(0, import_hashes.hash)(chunk),
|
|
49582
49909
|
{
|
|
49583
|
-
names: [(0,
|
|
49910
|
+
names: [(0, import_node_path3.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
|
|
49584
49911
|
data: chunk,
|
|
49585
49912
|
mode: 438
|
|
49586
49913
|
}
|
|
@@ -50047,8 +50374,8 @@ var require_dist7 = __commonJS({
|
|
|
50047
50374
|
|
|
50048
50375
|
// src/util/compile-vercel-config.ts
|
|
50049
50376
|
var import_dotenv = __toESM(require_main(), 1);
|
|
50050
|
-
import { mkdir, readFile as
|
|
50051
|
-
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";
|
|
50052
50379
|
import { fork } from "child_process";
|
|
50053
50380
|
import { parse as tomlParse2 } from "smol-toml";
|
|
50054
50381
|
|
|
@@ -50056,7 +50383,7 @@ import { parse as tomlParse2 } from "smol-toml";
|
|
|
50056
50383
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
50057
50384
|
var import_fs_extra8 = __toESM(require_lib3(), 1);
|
|
50058
50385
|
import fs4 from "fs";
|
|
50059
|
-
import { join as
|
|
50386
|
+
import { join as join10, relative } from "path";
|
|
50060
50387
|
import { promisify } from "util";
|
|
50061
50388
|
|
|
50062
50389
|
// src/util/projects/get-project-by-id-or-name.ts
|
|
@@ -51804,7 +52131,7 @@ function repoInfoToUrl(info) {
|
|
|
51804
52131
|
|
|
51805
52132
|
// src/util/git/connect-git-provider.ts
|
|
51806
52133
|
var import_chalk5 = __toESM(require_source(), 1);
|
|
51807
|
-
import { URL } from "url";
|
|
52134
|
+
import { URL as URL2 } from "url";
|
|
51808
52135
|
|
|
51809
52136
|
// ../../node_modules/.pnpm/@inquirer+select@2.2.2/node_modules/@inquirer/select/dist/esm/index.mjs
|
|
51810
52137
|
var import_chalk4 = __toESM(require_source2(), 1);
|
|
@@ -52075,12 +52402,12 @@ function buildRepoUrl(provider, org, repo) {
|
|
|
52075
52402
|
function getURL(input) {
|
|
52076
52403
|
let url = null;
|
|
52077
52404
|
try {
|
|
52078
|
-
url = new
|
|
52405
|
+
url = new URL2(input);
|
|
52079
52406
|
} catch {
|
|
52080
52407
|
}
|
|
52081
52408
|
if (!url) {
|
|
52082
52409
|
try {
|
|
52083
|
-
url = new
|
|
52410
|
+
url = new URL2(`ssh://${input.replace(":", "/")}`);
|
|
52084
52411
|
} catch {
|
|
52085
52412
|
}
|
|
52086
52413
|
}
|
|
@@ -52149,7 +52476,7 @@ async function selectAndParseRemoteUrl(client, remoteUrls) {
|
|
|
52149
52476
|
}
|
|
52150
52477
|
async function checkExistsAndConnect({
|
|
52151
52478
|
client,
|
|
52152
|
-
confirm,
|
|
52479
|
+
confirm: confirm2,
|
|
52153
52480
|
org,
|
|
52154
52481
|
project,
|
|
52155
52482
|
gitProviderLink,
|
|
@@ -52186,7 +52513,7 @@ async function checkExistsAndConnect({
|
|
|
52186
52513
|
}
|
|
52187
52514
|
const shouldReplaceRepo = await confirmRepoConnect(
|
|
52188
52515
|
client,
|
|
52189
|
-
|
|
52516
|
+
confirm2,
|
|
52190
52517
|
connectedProvider,
|
|
52191
52518
|
connectedRepoPath
|
|
52192
52519
|
);
|
|
@@ -52704,7 +53031,7 @@ function findProjectsFromPath(projects, path) {
|
|
|
52704
53031
|
}
|
|
52705
53032
|
|
|
52706
53033
|
// src/commands/env/pull.ts
|
|
52707
|
-
var
|
|
53034
|
+
var import_chalk13 = __toESM(require_source(), 1);
|
|
52708
53035
|
var import_fs_extra5 = __toESM(require_lib3(), 1);
|
|
52709
53036
|
import { closeSync, openSync, readSync } from "fs";
|
|
52710
53037
|
import { resolve as resolve3 } from "path";
|
|
@@ -53303,6 +53630,944 @@ function parseTarget({
|
|
|
53303
53630
|
return void 0;
|
|
53304
53631
|
}
|
|
53305
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
|
+
|
|
53306
54571
|
// src/commands/env/pull.ts
|
|
53307
54572
|
var CONTENTS_PREFIX = "# Created by Vercel CLI\n";
|
|
53308
54573
|
function readHeadSync(path, length) {
|
|
@@ -53425,7 +54690,7 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
53425
54690
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
|
53426
54691
|
const exists = typeof head !== "undefined";
|
|
53427
54692
|
if (head === CONTENTS_PREFIX) {
|
|
53428
|
-
output_manager_default.log(`Overwriting existing ${
|
|
54693
|
+
output_manager_default.log(`Overwriting existing ${import_chalk13.default.bold(filename)} file`);
|
|
53429
54694
|
} else if (exists && !skipConfirmation) {
|
|
53430
54695
|
if (client.nonInteractive) {
|
|
53431
54696
|
outputActionRequired(client, {
|
|
@@ -53453,18 +54718,18 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
53453
54718
|
}
|
|
53454
54719
|
}
|
|
53455
54720
|
const projectSlugLink = formatProject(link.org.slug, link.project.name);
|
|
53456
|
-
const downloadMessage = gitBranch ? `Downloading \`${
|
|
54721
|
+
const downloadMessage = gitBranch ? `Downloading \`${import_chalk13.default.cyan(
|
|
53457
54722
|
environment
|
|
53458
|
-
)}\` Environment Variables for ${projectSlugLink} and any overrides for branch ${
|
|
54723
|
+
)}\` Environment Variables for ${projectSlugLink} and any overrides for branch ${import_chalk13.default.cyan(
|
|
53459
54724
|
gitBranch
|
|
53460
|
-
)}` : `Downloading \`${
|
|
54725
|
+
)}` : `Downloading \`${import_chalk13.default.cyan(
|
|
53461
54726
|
environment
|
|
53462
54727
|
)}\` Environment Variables for ${projectSlugLink}`;
|
|
53463
54728
|
output_manager_default.log(downloadMessage);
|
|
53464
54729
|
const pullStamp = stamp_default();
|
|
53465
54730
|
output_manager_default.spinner("Downloading");
|
|
53466
54731
|
const pullId = deploymentId || link.project.id;
|
|
53467
|
-
const pullResult = await
|
|
54732
|
+
const pullResult = await pullEnvRecordsForEnvPull(client, pullId, source, {
|
|
53468
54733
|
target: environment || "development",
|
|
53469
54734
|
gitBranch
|
|
53470
54735
|
});
|
|
@@ -53492,26 +54757,74 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
53492
54757
|
}
|
|
53493
54758
|
output_manager_default.print(
|
|
53494
54759
|
`${prependEmoji(
|
|
53495
|
-
`${exists ? "Updated" : "Created"} ${
|
|
54760
|
+
`${exists ? "Updated" : "Created"} ${import_chalk13.default.bold(filename)} file ${isGitIgnoreUpdated ? "and added it to .gitignore" : ""} ${import_chalk13.default.gray(pullStamp())}`,
|
|
53496
54761
|
emoji("success")
|
|
53497
54762
|
)}
|
|
53498
54763
|
`
|
|
53499
54764
|
);
|
|
53500
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
|
+
}
|
|
53501
54814
|
function escapeValue(value) {
|
|
53502
54815
|
return value ? value.replace(new RegExp("\n", "g"), "\\n").replace(new RegExp("\r", "g"), "\\r") : "";
|
|
53503
54816
|
}
|
|
53504
54817
|
|
|
53505
54818
|
// src/util/projects/find-project-root.ts
|
|
53506
|
-
var
|
|
54819
|
+
var import_chalk14 = __toESM(require_source(), 1);
|
|
53507
54820
|
var import_fs_extra7 = __toESM(require_lib3(), 1);
|
|
53508
54821
|
import { stat } from "fs/promises";
|
|
53509
|
-
import { join as
|
|
54822
|
+
import { join as join9, dirname } from "path";
|
|
53510
54823
|
|
|
53511
54824
|
// src/util/projects/detect-services.ts
|
|
53512
54825
|
var import_fs_detectors2 = __toESM(require_dist6(), 1);
|
|
53513
|
-
import { readFile as
|
|
53514
|
-
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";
|
|
53515
54828
|
import { parse as tomlParse, stringify as tomlStringify } from "smol-toml";
|
|
53516
54829
|
|
|
53517
54830
|
// src/util/is-vercel-toml-enabled.ts
|
|
@@ -54201,7 +55514,7 @@ function validateConfig(config) {
|
|
|
54201
55514
|
}
|
|
54202
55515
|
|
|
54203
55516
|
// src/util/projects/detect-entrypoint.ts
|
|
54204
|
-
import { join as
|
|
55517
|
+
import { join as join7 } from "path";
|
|
54205
55518
|
import {
|
|
54206
55519
|
isPythonFramework,
|
|
54207
55520
|
isNodeBackendFramework,
|
|
@@ -54209,7 +55522,7 @@ import {
|
|
|
54209
55522
|
} from "@vercel/build-utils";
|
|
54210
55523
|
function createDetectEntrypoint(projectRoot) {
|
|
54211
55524
|
return async ({ workPath, framework }) => {
|
|
54212
|
-
const absWorkPath = normalizePath2(
|
|
55525
|
+
const absWorkPath = normalizePath2(join7(projectRoot, workPath));
|
|
54213
55526
|
if (isPythonFramework(framework)) {
|
|
54214
55527
|
const { detectEntrypoint } = await import("@vercel/python");
|
|
54215
55528
|
return detectEntrypoint({
|
|
@@ -54272,7 +55585,7 @@ async function tryDetectServices(cwd) {
|
|
|
54272
55585
|
}
|
|
54273
55586
|
async function writeServicesConfig(cwd, config) {
|
|
54274
55587
|
const prepared = await prepareServicesConfigWrite(cwd, config);
|
|
54275
|
-
await
|
|
55588
|
+
await writeFile3(prepared.configPath, prepared.content, "utf8");
|
|
54276
55589
|
return { configFileName: basename2(prepared.configPath) };
|
|
54277
55590
|
}
|
|
54278
55591
|
async function getServicesConfigWriteBlocker(cwd, config) {
|
|
@@ -54290,9 +55603,9 @@ function toProjectServicesConfigPatch(config) {
|
|
|
54290
55603
|
}
|
|
54291
55604
|
async function prepareServicesConfigWrite(cwd, config) {
|
|
54292
55605
|
const compileResult = await compileVercelConfig(cwd);
|
|
54293
|
-
const configPath =
|
|
55606
|
+
const configPath = join8(cwd, "vercel.json");
|
|
54294
55607
|
if (isVercelTomlEnabled() && compileResult.sourceFile === "vercel.toml") {
|
|
54295
|
-
return prepareTomlServicesConfigWrite(
|
|
55608
|
+
return prepareTomlServicesConfigWrite(join8(cwd, "vercel.toml"), config);
|
|
54296
55609
|
}
|
|
54297
55610
|
if (compileResult.wasCompiled) {
|
|
54298
55611
|
throw new Error(
|
|
@@ -54325,7 +55638,7 @@ async function prepareTomlServicesConfigWrite(configPath, config) {
|
|
|
54325
55638
|
const patchKeys = Object.keys(patch);
|
|
54326
55639
|
let existingContent;
|
|
54327
55640
|
try {
|
|
54328
|
-
existingContent = await
|
|
55641
|
+
existingContent = await readFile4(configPath, "utf8");
|
|
54329
55642
|
} catch {
|
|
54330
55643
|
existingContent = "";
|
|
54331
55644
|
}
|
|
@@ -54372,10 +55685,10 @@ async function findProjectRoot(startDir) {
|
|
|
54372
55685
|
} catch {
|
|
54373
55686
|
return null;
|
|
54374
55687
|
}
|
|
54375
|
-
const hasVercelDir = await (0, import_fs_extra7.pathExists)(
|
|
54376
|
-
const hasVercelJson = await (0, import_fs_extra7.pathExists)(
|
|
54377
|
-
const hasVercelToml = isVercelTomlEnabled() && await (0, import_fs_extra7.pathExists)(
|
|
54378
|
-
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"));
|
|
54379
55692
|
if (hasVercelDir || hasVercelJson || hasVercelToml || hasGit) {
|
|
54380
55693
|
return dir;
|
|
54381
55694
|
}
|
|
@@ -54393,15 +55706,15 @@ async function resolveProjectCwd(cwd) {
|
|
|
54393
55706
|
}
|
|
54394
55707
|
const result = await tryDetectServices(projectRoot);
|
|
54395
55708
|
if (result && (result.services?.length ?? 0) > 0) {
|
|
54396
|
-
output_manager_default.debug(`Running from project root: ${
|
|
55709
|
+
output_manager_default.debug(`Running from project root: ${import_chalk14.default.cyan(projectRoot)}`);
|
|
54397
55710
|
return projectRoot;
|
|
54398
55711
|
}
|
|
54399
55712
|
return cwd;
|
|
54400
55713
|
}
|
|
54401
55714
|
|
|
54402
55715
|
// src/util/projects/link.ts
|
|
54403
|
-
var
|
|
54404
|
-
var
|
|
55716
|
+
var readFile5 = promisify(fs4.readFile);
|
|
55717
|
+
var writeFile4 = promisify(fs4.writeFile);
|
|
54405
55718
|
var VERCEL_DIR = ".vercel";
|
|
54406
55719
|
var VERCEL_DIR_FALLBACK = ".now";
|
|
54407
55720
|
var VERCEL_DIR_README = "README.txt";
|
|
@@ -54426,7 +55739,7 @@ var linkSchema = {
|
|
|
54426
55739
|
}
|
|
54427
55740
|
};
|
|
54428
55741
|
function getVercelDirectory(cwd) {
|
|
54429
|
-
const possibleDirs = [
|
|
55742
|
+
const possibleDirs = [join10(cwd, VERCEL_DIR), join10(cwd, VERCEL_DIR_FALLBACK)];
|
|
54430
55743
|
const existingDirs = possibleDirs.filter((d) => isDirectory(d));
|
|
54431
55744
|
if (existingDirs.length > 1) {
|
|
54432
55745
|
throw new NowBuildError2({
|
|
@@ -54518,7 +55831,7 @@ async function getProjectLinkFromRepoLink(client, path, projectName, projectName
|
|
|
54518
55831
|
}
|
|
54519
55832
|
async function getLinkFromDir(dir) {
|
|
54520
55833
|
try {
|
|
54521
|
-
const json = await
|
|
55834
|
+
const json = await readFile5(join10(dir, VERCEL_DIR_PROJECT), "utf8");
|
|
54522
55835
|
const ajv2 = new import_ajv2.default();
|
|
54523
55836
|
const link = JSON.parse(json);
|
|
54524
55837
|
if (!ajv2.validate(linkSchema, link)) {
|
|
@@ -54678,8 +55991,8 @@ No, you should not share the ".vercel" folder with anyone.
|
|
|
54678
55991
|
Upon creation, it will be automatically added to your ".gitignore" file.
|
|
54679
55992
|
`;
|
|
54680
55993
|
async function writeReadme(path) {
|
|
54681
|
-
await
|
|
54682
|
-
|
|
55994
|
+
await writeFile4(
|
|
55995
|
+
join10(path, VERCEL_DIR, VERCEL_DIR_README),
|
|
54683
55996
|
VERCEL_DIR_README_CONTENT
|
|
54684
55997
|
);
|
|
54685
55998
|
}
|
|
@@ -54688,15 +56001,15 @@ async function linkFolderToProject(client, path, projectLink, projectName, orgSl
|
|
|
54688
56001
|
return;
|
|
54689
56002
|
}
|
|
54690
56003
|
try {
|
|
54691
|
-
await (0, import_fs_extra8.ensureDir)(
|
|
56004
|
+
await (0, import_fs_extra8.ensureDir)(join10(path, VERCEL_DIR));
|
|
54692
56005
|
} catch (err) {
|
|
54693
56006
|
if ((0, import_error_utils4.isErrnoException)(err) && err.code === "ENOTDIR") {
|
|
54694
56007
|
return;
|
|
54695
56008
|
}
|
|
54696
56009
|
throw err;
|
|
54697
56010
|
}
|
|
54698
|
-
await
|
|
54699
|
-
|
|
56011
|
+
await writeFile4(
|
|
56012
|
+
join10(path, VERCEL_DIR, VERCEL_DIR_PROJECT),
|
|
54700
56013
|
JSON.stringify({
|
|
54701
56014
|
...projectLink,
|
|
54702
56015
|
projectName
|
|
@@ -54808,9 +56121,9 @@ var VERCEL_CONFIG_EXTENSIONS = [
|
|
|
54808
56121
|
"cjs"
|
|
54809
56122
|
];
|
|
54810
56123
|
var DEFAULT_VERCEL_CONFIG_FILENAME = "Vercel config";
|
|
54811
|
-
async function
|
|
56124
|
+
async function fileExists2(filePath) {
|
|
54812
56125
|
try {
|
|
54813
|
-
await
|
|
56126
|
+
await access2(filePath);
|
|
54814
56127
|
return true;
|
|
54815
56128
|
} catch {
|
|
54816
56129
|
return false;
|
|
@@ -54819,8 +56132,8 @@ async function fileExists(filePath) {
|
|
|
54819
56132
|
async function findAllVercelConfigFiles(workPath) {
|
|
54820
56133
|
const foundFiles = [];
|
|
54821
56134
|
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
54822
|
-
const configPath =
|
|
54823
|
-
if (await
|
|
56135
|
+
const configPath = join11(workPath, `vercel.${ext}`);
|
|
56136
|
+
if (await fileExists2(configPath)) {
|
|
54824
56137
|
foundFiles.push(configPath);
|
|
54825
56138
|
}
|
|
54826
56139
|
}
|
|
@@ -54828,14 +56141,14 @@ async function findAllVercelConfigFiles(workPath) {
|
|
|
54828
56141
|
}
|
|
54829
56142
|
async function findSourceVercelConfigFile(workPath) {
|
|
54830
56143
|
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
54831
|
-
const configPath =
|
|
54832
|
-
if (await
|
|
56144
|
+
const configPath = join11(workPath, `vercel.${ext}`);
|
|
56145
|
+
if (await fileExists2(configPath)) {
|
|
54833
56146
|
return basename3(configPath);
|
|
54834
56147
|
}
|
|
54835
56148
|
}
|
|
54836
56149
|
if (isVercelTomlEnabled()) {
|
|
54837
|
-
const tomlPath =
|
|
54838
|
-
if (await
|
|
56150
|
+
const tomlPath = join11(workPath, "vercel.toml");
|
|
56151
|
+
if (await fileExists2(tomlPath)) {
|
|
54839
56152
|
return "vercel.toml";
|
|
54840
56153
|
}
|
|
54841
56154
|
}
|
|
@@ -54876,15 +56189,15 @@ function parseConfigLoaderError(stderr) {
|
|
|
54876
56189
|
return stderr.trim();
|
|
54877
56190
|
}
|
|
54878
56191
|
async function compileVercelConfig(workPath) {
|
|
54879
|
-
const vercelJsonPath =
|
|
54880
|
-
const nowJsonPath =
|
|
54881
|
-
const vercelTomlPath =
|
|
54882
|
-
const hasVercelJson = await
|
|
54883
|
-
const hasNowJson = await
|
|
54884
|
-
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);
|
|
54885
56198
|
const vercelConfigPath = await findVercelConfigFile(workPath);
|
|
54886
|
-
const vercelDir =
|
|
54887
|
-
const compiledConfigPath =
|
|
56199
|
+
const vercelDir = join11(workPath, VERCEL_DIR);
|
|
56200
|
+
const compiledConfigPath = join11(vercelDir, "vercel.json");
|
|
54888
56201
|
if (hasNowJson) {
|
|
54889
56202
|
throw new DeprecatedNowJson(nowJsonPath);
|
|
54890
56203
|
}
|
|
@@ -54909,7 +56222,7 @@ async function compileVercelConfig(workPath) {
|
|
|
54909
56222
|
wasCompiled: false
|
|
54910
56223
|
};
|
|
54911
56224
|
}
|
|
54912
|
-
if (await
|
|
56225
|
+
if (await fileExists2(compiledConfigPath)) {
|
|
54913
56226
|
return {
|
|
54914
56227
|
configPath: compiledConfigPath,
|
|
54915
56228
|
wasCompiled: true,
|
|
@@ -54923,11 +56236,11 @@ async function compileVercelConfig(workPath) {
|
|
|
54923
56236
|
}
|
|
54924
56237
|
if (hasVercelToml) {
|
|
54925
56238
|
try {
|
|
54926
|
-
const tomlContent = await
|
|
56239
|
+
const tomlContent = await readFile6(vercelTomlPath, "utf8");
|
|
54927
56240
|
const config = tomlParse2(tomlContent);
|
|
54928
56241
|
const normalizedConfig = normalizeConfig(config);
|
|
54929
56242
|
await mkdir(vercelDir, { recursive: true });
|
|
54930
|
-
await
|
|
56243
|
+
await writeFile5(
|
|
54931
56244
|
compiledConfigPath,
|
|
54932
56245
|
JSON.stringify(normalizedConfig, null, 2),
|
|
54933
56246
|
"utf-8"
|
|
@@ -54947,10 +56260,10 @@ async function compileVercelConfig(workPath) {
|
|
|
54947
56260
|
}
|
|
54948
56261
|
}
|
|
54949
56262
|
const sourceConfigPath = vercelConfigPath;
|
|
54950
|
-
(0, import_dotenv.config)({ path:
|
|
54951
|
-
(0, import_dotenv.config)({ path:
|
|
54952
|
-
const tempOutPath =
|
|
54953
|
-
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");
|
|
54954
56267
|
try {
|
|
54955
56268
|
const { build } = await import("esbuild");
|
|
54956
56269
|
await mkdir(vercelDir, { recursive: true });
|
|
@@ -54970,7 +56283,7 @@ async function compileVercelConfig(workPath) {
|
|
|
54970
56283
|
const config = ('default' in configModule) ? configModule.default : ('config' in configModule) ? configModule.config : configModule;
|
|
54971
56284
|
process.send(config);
|
|
54972
56285
|
`;
|
|
54973
|
-
await
|
|
56286
|
+
await writeFile5(loaderPath, loaderScript, "utf-8");
|
|
54974
56287
|
const config = await new Promise((resolve4, reject) => {
|
|
54975
56288
|
const child = fork(loaderPath, [tempOutPath], {
|
|
54976
56289
|
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
@@ -55021,7 +56334,7 @@ async function compileVercelConfig(workPath) {
|
|
|
55021
56334
|
});
|
|
55022
56335
|
});
|
|
55023
56336
|
const normalizedConfig = normalizeConfig(config);
|
|
55024
|
-
await
|
|
56337
|
+
await writeFile5(
|
|
55025
56338
|
compiledConfigPath,
|
|
55026
56339
|
JSON.stringify(normalizedConfig, null, 2),
|
|
55027
56340
|
"utf-8"
|
|
@@ -55054,16 +56367,16 @@ async function compileVercelConfig(workPath) {
|
|
|
55054
56367
|
}
|
|
55055
56368
|
}
|
|
55056
56369
|
async function getVercelConfigPath(workPath) {
|
|
55057
|
-
const vercelJsonPath =
|
|
55058
|
-
const vercelTomlPath =
|
|
55059
|
-
const compiledConfigPath =
|
|
55060
|
-
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)) {
|
|
55061
56374
|
return vercelJsonPath;
|
|
55062
56375
|
}
|
|
55063
|
-
if (isVercelTomlEnabled() && await
|
|
56376
|
+
if (isVercelTomlEnabled() && await fileExists2(vercelTomlPath)) {
|
|
55064
56377
|
return vercelTomlPath;
|
|
55065
56378
|
}
|
|
55066
|
-
if (await
|
|
56379
|
+
if (await fileExists2(compiledConfigPath)) {
|
|
55067
56380
|
return compiledConfigPath;
|
|
55068
56381
|
}
|
|
55069
56382
|
return vercelJsonPath;
|
|
@@ -55101,6 +56414,16 @@ export {
|
|
|
55101
56414
|
esm_default,
|
|
55102
56415
|
esm_default2,
|
|
55103
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,
|
|
55104
56427
|
require_inherits,
|
|
55105
56428
|
require_tar_fs,
|
|
55106
56429
|
require_dist7 as require_dist,
|