vercel 56.5.0 → 58.0.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-KNK5E2YT.js → add-7PPD4ZUJ.js} +2 -2
- package/dist/chunks/{add-6GRH6G2M.js → add-E4KH6P4A.js} +6 -5
- package/dist/chunks/{chunk-YS6EDZHB.js → chunk-2MJROFVC.js} +5 -1
- package/dist/chunks/chunk-3PGXYIKC.js +147 -0
- package/dist/chunks/chunk-5AJPMLDV.js +28 -0
- package/dist/chunks/{chunk-V5P25P7F.js → chunk-A3NYPUKZ.js} +7 -12
- package/dist/chunks/{chunk-JQG5EDRD.js → chunk-AZTV7WPZ.js} +1 -1
- package/dist/chunks/{chunk-3BHSS5E2.js → chunk-B2MTCHPO.js} +65 -210
- package/dist/chunks/{chunk-GAOAGU5K.js → chunk-BYQQLGCT.js} +1 -1
- package/dist/chunks/{chunk-ARKHETJP.js → chunk-DGFASMSE.js} +1 -1
- package/dist/chunks/{chunk-W346YNDN.js → chunk-DWMH5M4Q.js} +4 -1
- package/dist/chunks/{chunk-PRYNIKBZ.js → chunk-EA22NMFU.js} +1 -1
- package/dist/chunks/{chunk-26TEKOBZ.js → chunk-FB4UFWEC.js} +8 -1
- package/dist/chunks/chunk-FGDKMNEN.js +21 -0
- package/dist/chunks/{chunk-23U6FANO.js → chunk-FYR7WEUJ.js} +11 -18
- package/dist/chunks/chunk-GZLPFESR.js +48 -0
- package/dist/chunks/{chunk-STJJ3DFO.js → chunk-KCF6S3XF.js} +16 -1
- package/dist/chunks/{chunk-PPEQUJ7T.js → chunk-KGVT2RSG.js} +3 -3
- package/dist/chunks/{chunk-4MK452Y5.js → chunk-L4WYMJB3.js} +8 -8
- package/dist/chunks/{chunk-BM36UWE2.js → chunk-MDQJLTGN.js} +1 -1
- package/dist/chunks/{chunk-Z7NPYIZ6.js → chunk-NM43FFV6.js} +0 -8
- package/dist/chunks/chunk-OF2GNB42.js +53 -0
- package/dist/chunks/{chunk-YTFJGKRG.js → chunk-OQGN4TEC.js} +1 -1
- package/dist/chunks/chunk-PRWJUY5U.js +848 -0
- package/dist/chunks/{chunk-F5OMERHI.js → chunk-QZD5DKUR.js} +10 -23
- package/dist/chunks/{chunk-SWEPOMSA.js → chunk-R54DAHCL.js} +4 -3
- package/dist/chunks/{chunk-DOF6CJLL.js → chunk-RSCSALZH.js} +15 -839
- package/dist/chunks/{chunk-G4MTGCZ5.js → chunk-TEWJ7TIW.js} +1 -1
- package/dist/chunks/{chunk-TMK6RSYW.js → chunk-TPX7RZBM.js} +1433 -979
- package/dist/chunks/chunk-V4RMJKQP.js +36 -0
- package/dist/chunks/{chunk-DI3HR3K6.js → chunk-VUESC3YO.js} +1 -1
- package/dist/chunks/{chunk-IBP2XAUH.js → chunk-WANVKOVB.js} +39 -5
- package/dist/chunks/{chunk-X43U65TH.js → chunk-WDE2EDYX.js} +2 -2
- package/dist/chunks/{chunk-6RTK6BWX.js → chunk-YA3WQFLY.js} +1 -1
- package/dist/chunks/{chunk-EYICIM2K.js → chunk-YZMZCQP3.js} +4 -4
- package/dist/chunks/{chunk-CM3DLBDY.js → chunk-ZMVFTCQF.js} +1 -1
- package/dist/chunks/{compile-vercel-config-IFET4E6H.js → compile-vercel-config-G2IVBXEI.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{delete-PXB5WRH7.js → delete-2EIVGM6P.js} +2 -2
- package/dist/chunks/{delete-X2MUMONI.js → delete-E6ZQNE5X.js} +2 -2
- package/dist/chunks/{disable-GBL3SHJL.js → disable-M3Q6BBB7.js} +2 -2
- package/dist/chunks/{discard-XVVSRGDR.js → discard-3R6ETBPS.js} +2 -2
- package/dist/chunks/{edit-EIHRP6XT.js → edit-7JUDPVXD.js} +3 -3
- package/dist/chunks/{edit-K5Y2BDJO.js → edit-ICVMGRRU.js} +2 -2
- package/dist/chunks/{enable-W7AMJWKH.js → enable-HLTA35QL.js} +2 -2
- package/dist/chunks/{export-N3AZ2KOO.js → export-E6XZUFW3.js} +2 -2
- package/dist/chunks/{image-DRTGVPVJ.js → image-SIRPPQZT.js} +3 -3
- package/dist/chunks/{inspect-DYXTX6P4.js → inspect-4FYBOOM5.js} +2 -2
- package/dist/chunks/{inspect-AAIVWSJI.js → inspect-65YX7L3O.js} +2 -2
- package/dist/chunks/inspect-6TQWDIBG.js +587 -0
- package/dist/chunks/{inspect-IPSAYR2C.js → inspect-NFOURIGN.js} +2 -2
- package/dist/chunks/{inspect-SLZLI6ZC.js → inspect-OEWWGAHZ.js} +3 -3
- package/dist/chunks/{list-IF2YW73F.js → list-27DCGMBI.js} +1 -1
- package/dist/chunks/{list-V7VTXVK4.js → list-APFMKZJO.js} +41 -54
- package/dist/chunks/{list-K2HLGUXV.js → list-XQCZVLES.js} +3 -3
- package/dist/chunks/{login-7C6HQEOG.js → login-FMU4CQOV.js} +2 -2
- package/dist/chunks/{ls-2NU353QP.js → ls-24BRCAZR.js} +2 -2
- package/dist/chunks/ls-3L6EN4YU.js +188 -0
- package/dist/chunks/{ls-NKECPPOR.js → ls-BFACWH6C.js} +2 -2
- package/dist/chunks/{ls-QQQHOJBE.js → ls-T5RGDBCV.js} +2 -2
- package/dist/chunks/{open-2FAPZA6V.js → open-AG3VYJZM.js} +2 -2
- package/dist/chunks/{publish-G7PB64LJ.js → publish-5OVCPS4J.js} +2 -2
- package/dist/chunks/{query-D4QBT4WR.js → query-QS4VKBXJ.js} +8 -8
- package/dist/chunks/{reorder-3Z7YIPAX.js → reorder-B5V2P7YM.js} +2 -2
- package/dist/chunks/{reply-7QQBXL5H.js → reply-JBLWE6RS.js} +2 -2
- package/dist/chunks/{resolve-UYKTDZEX.js → resolve-2I6XH2G3.js} +2 -2
- package/dist/chunks/{restore-Q2DR7SMW.js → restore-O63FZXCL.js} +2 -2
- package/dist/chunks/{rm-OCLUTM57.js → rm-HUED5R3Q.js} +6 -5
- package/dist/chunks/{rm-O4M4GFSK.js → rm-N7W3QYWZ.js} +2 -2
- package/dist/chunks/{rm-PCWMEHQ2.js → rm-P3NJSCMY.js} +2 -2
- package/dist/chunks/rule-inspect-M3QUSPU2.js +283 -0
- package/dist/chunks/{rules-LIH5FLPJ.js → rules-NSSWPJ2B.js} +7 -7
- package/dist/chunks/{schema-OFALTXXM.js → schema-G2PAXPVA.js} +6 -4
- package/dist/chunks/{tags-P4HIAI6D.js → tags-JFMO63D4.js} +2 -2
- package/dist/chunks/{update-E3ZQAFBS.js → update-VJCKD6YG.js} +6 -5
- package/dist/commands/build/index.js +42 -10
- package/dist/commands/deploy/index.js +34 -24
- package/dist/commands/dev/index.js +23 -13
- package/dist/commands/env/index.js +8 -7
- package/dist/commands/link/index.js +8 -8
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +1959 -1816
- package/dist/index.js +19 -20
- package/dist/vc.js +54 -18
- package/dist/version.mjs +1 -1
- package/package.json +35 -35
- package/dist/chunks/chunk-GNV7547O.js +0 -86
- package/dist/chunks/inspect-5YUAEI3L.js +0 -351
- package/dist/chunks/ls-RH6Y4XBS.js +0 -113
- package/dist/chunks/rule-inspect-XJ47UEG7.js +0 -141
|
@@ -4,51 +4,40 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import {
|
|
8
|
-
highlight
|
|
9
|
-
} from "./chunk-V5P25P7F.js";
|
|
10
7
|
import {
|
|
11
8
|
PromptBackError,
|
|
12
|
-
PromptCanceledError
|
|
13
|
-
|
|
14
|
-
} from "./chunk-GNV7547O.js";
|
|
9
|
+
PromptCanceledError
|
|
10
|
+
} from "./chunk-V4RMJKQP.js";
|
|
15
11
|
import {
|
|
16
|
-
DEFAULT_VERCEL_CONFIG_FILENAME,
|
|
17
|
-
VERCEL_CONFIG_EXTENSIONS,
|
|
18
|
-
VERCEL_DIR,
|
|
19
12
|
createPrompt,
|
|
20
13
|
esm_default,
|
|
21
14
|
esm_default2,
|
|
22
15
|
esm_default3,
|
|
23
|
-
humanizePath,
|
|
24
16
|
isBackspaceKey,
|
|
25
17
|
isEnterKey,
|
|
26
|
-
|
|
18
|
+
isOAuthError,
|
|
27
19
|
makeTheme,
|
|
28
20
|
onExit,
|
|
29
21
|
performDeviceCodeFlow,
|
|
22
|
+
persistAuthConfig,
|
|
30
23
|
processTokenResponse,
|
|
31
24
|
refreshTokenRequest,
|
|
32
25
|
require_cli_width,
|
|
33
|
-
require_dist as require_dist2,
|
|
34
26
|
require_lib2 as require_lib,
|
|
35
27
|
require_source as require_source2,
|
|
36
28
|
require_wrap_ansi,
|
|
37
29
|
ua_default,
|
|
38
30
|
useKeypress,
|
|
39
31
|
usePrefix,
|
|
40
|
-
useState
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
require_load_json_file
|
|
44
|
-
} from "./chunk-ECCWJHC6.js";
|
|
32
|
+
useState,
|
|
33
|
+
writeToConfigFile
|
|
34
|
+
} from "./chunk-TPX7RZBM.js";
|
|
45
35
|
import {
|
|
46
36
|
parseArguments,
|
|
47
37
|
require_strip_ansi
|
|
48
38
|
} from "./chunk-SZXT3PDQ.js";
|
|
49
39
|
import {
|
|
50
|
-
APIError
|
|
51
|
-
NowError
|
|
40
|
+
APIError
|
|
52
41
|
} from "./chunk-KSSNLCL4.js";
|
|
53
42
|
import {
|
|
54
43
|
pkg_default
|
|
@@ -362,7 +351,7 @@ var require_retry2 = __commonJS({
|
|
|
362
351
|
});
|
|
363
352
|
|
|
364
353
|
// ../../node_modules/.pnpm/async-retry@1.1.3/node_modules/async-retry/dist/index.js
|
|
365
|
-
var
|
|
354
|
+
var require_dist2 = __commonJS({
|
|
366
355
|
"../../node_modules/.pnpm/async-retry@1.1.3/node_modules/async-retry/dist/index.js"(exports, module) {
|
|
367
356
|
"use strict";
|
|
368
357
|
var retrier = require_retry2();
|
|
@@ -397,162 +386,19 @@ var require_dist3 = __commonJS({
|
|
|
397
386
|
}
|
|
398
387
|
});
|
|
399
388
|
|
|
400
|
-
// src/util/config/global-path.ts
|
|
401
|
-
import path from "path";
|
|
402
|
-
import * as config from "@vercel/cli-config";
|
|
403
|
-
function getGlobalPathConfig2(argvSlice = process.argv.slice(2), cwd = process.cwd()) {
|
|
404
|
-
const args = parseArguments(argvSlice, {}, { permissive: true });
|
|
405
|
-
const confFlag = args.flags["--global-config"];
|
|
406
|
-
if (confFlag) {
|
|
407
|
-
return path.resolve(cwd, confFlag);
|
|
408
|
-
} else {
|
|
409
|
-
return config.getGlobalPathConfig();
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// src/util/config/files.ts
|
|
414
|
-
var import_load_json_file = __toESM(require_load_json_file(), 1);
|
|
415
|
-
var import_error_utils = __toESM(require_dist(), 1);
|
|
416
|
-
var import_client = __toESM(require_dist2(), 1);
|
|
417
|
-
import { join, basename, dirname } from "path";
|
|
418
|
-
import { accessSync, constants } from "fs";
|
|
419
|
-
import * as config2 from "@vercel/cli-config";
|
|
420
|
-
import {
|
|
421
|
-
persistCliAuthConfig,
|
|
422
|
-
readCliAuthConfig
|
|
423
|
-
} from "@vercel/cli-auth/credentials-store.js";
|
|
424
|
-
var VERCEL_DIR2 = getGlobalPathConfig2();
|
|
425
|
-
var CONFIG_FILE_PATH = config2.getConfigFilePath(VERCEL_DIR2);
|
|
426
|
-
var AUTH_CONFIG_FILE_PATH = config2.getAuthConfigFilePath(VERCEL_DIR2);
|
|
427
|
-
var readConfigFile = () => {
|
|
428
|
-
return config2.readGlobalConfigFile(CONFIG_FILE_PATH);
|
|
429
|
-
};
|
|
430
|
-
var writeToConfigFile = (stuff) => {
|
|
431
|
-
try {
|
|
432
|
-
config2.writeGlobalConfigFile(CONFIG_FILE_PATH, stuff);
|
|
433
|
-
} catch (err) {
|
|
434
|
-
if ((0, import_error_utils.isErrnoException)(err)) {
|
|
435
|
-
if ((0, import_error_utils.isErrnoException)(err) && err.code === "EPERM") {
|
|
436
|
-
output_manager_default.error(
|
|
437
|
-
`Not able to create ${highlight(
|
|
438
|
-
CONFIG_FILE_PATH
|
|
439
|
-
)} (operation not permitted).`
|
|
440
|
-
);
|
|
441
|
-
process.exit(1);
|
|
442
|
-
} else if (err.code === "EBADF") {
|
|
443
|
-
output_manager_default.error(
|
|
444
|
-
`Not able to create ${highlight(
|
|
445
|
-
CONFIG_FILE_PATH
|
|
446
|
-
)} (bad file descriptor).`
|
|
447
|
-
);
|
|
448
|
-
process.exit(1);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
throw err;
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
var readAuthConfigFile = (_globalConfig) => {
|
|
455
|
-
return {
|
|
456
|
-
...config2.getDefaultAuthConfig(),
|
|
457
|
-
...readCliAuthConfig(VERCEL_DIR2)
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
var persistAuthConfig = (authConfig, _globalConfig) => {
|
|
461
|
-
try {
|
|
462
|
-
return persistCliAuthConfig(VERCEL_DIR2, authConfig);
|
|
463
|
-
} catch (err) {
|
|
464
|
-
const wrappedError = new Error(
|
|
465
|
-
`Not able to create ${humanizePath(AUTH_CONFIG_FILE_PATH)} (${(0, import_error_utils.errorToStringFriendly)(
|
|
466
|
-
err
|
|
467
|
-
)}).`
|
|
468
|
-
);
|
|
469
|
-
wrappedError.cause = err;
|
|
470
|
-
throw wrappedError;
|
|
471
|
-
}
|
|
472
|
-
};
|
|
473
|
-
function getConfigFilePath2() {
|
|
474
|
-
return CONFIG_FILE_PATH;
|
|
475
|
-
}
|
|
476
|
-
function getAuthConfigFilePath2() {
|
|
477
|
-
return AUTH_CONFIG_FILE_PATH;
|
|
478
|
-
}
|
|
479
|
-
function readLocalConfig(prefix = process.cwd()) {
|
|
480
|
-
let config3 = void 0;
|
|
481
|
-
let target = "";
|
|
482
|
-
try {
|
|
483
|
-
target = getLocalPathConfig(prefix);
|
|
484
|
-
} catch (err) {
|
|
485
|
-
if (err instanceof NowError) {
|
|
486
|
-
output_manager_default.error(err.message);
|
|
487
|
-
process.exit(1);
|
|
488
|
-
} else {
|
|
489
|
-
throw err;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
if (!target) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
try {
|
|
496
|
-
accessSync(target, constants.F_OK);
|
|
497
|
-
config3 = import_load_json_file.default.sync(target);
|
|
498
|
-
} catch (err) {
|
|
499
|
-
if ((0, import_error_utils.isErrnoException)(err) && err.code === "ENOENT") {
|
|
500
|
-
} else if ((0, import_error_utils.isError)(err) && err.name === "JSONError") {
|
|
501
|
-
output_manager_default.error(err.message);
|
|
502
|
-
process.exit(1);
|
|
503
|
-
} else if ((0, import_error_utils.isErrnoException)(err)) {
|
|
504
|
-
const code = err.code ? ` (${err.code})` : "";
|
|
505
|
-
output_manager_default.error(`Failed to read config file: ${target}${code}`);
|
|
506
|
-
process.exit(1);
|
|
507
|
-
} else {
|
|
508
|
-
output_manager_default.prettyError(err);
|
|
509
|
-
process.exit(1);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
if (!config3) {
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
const isCompiledConfig = basename(target) === "vercel.json" && basename(dirname(target)) === VERCEL_DIR;
|
|
516
|
-
if (isCompiledConfig) {
|
|
517
|
-
const workPath = dirname(dirname(target));
|
|
518
|
-
let sourceFile = null;
|
|
519
|
-
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
520
|
-
const configPath = join(workPath, `vercel.${ext}`);
|
|
521
|
-
try {
|
|
522
|
-
accessSync(configPath, constants.F_OK);
|
|
523
|
-
sourceFile = basename(configPath);
|
|
524
|
-
break;
|
|
525
|
-
} catch {
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
if (!sourceFile && isVercelTomlEnabled()) {
|
|
529
|
-
const tomlPath = join(workPath, "vercel.toml");
|
|
530
|
-
try {
|
|
531
|
-
accessSync(tomlPath, constants.F_OK);
|
|
532
|
-
sourceFile = "vercel.toml";
|
|
533
|
-
} catch {
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
config3[import_client.fileNameSymbol] = sourceFile || DEFAULT_VERCEL_CONFIG_FILENAME;
|
|
537
|
-
} else {
|
|
538
|
-
config3[import_client.fileNameSymbol] = basename(target);
|
|
539
|
-
}
|
|
540
|
-
return config3;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
389
|
// src/util/client.ts
|
|
544
390
|
var import_chalk4 = __toESM(require_source(), 1);
|
|
545
391
|
|
|
546
392
|
// ../../node_modules/.pnpm/@inquirer+confirm@3.1.2/node_modules/@inquirer/confirm/dist/esm/index.mjs
|
|
547
|
-
var esm_default4 = createPrompt((
|
|
548
|
-
const { transformer = (answer) => answer ? "yes" : "no" } =
|
|
393
|
+
var esm_default4 = createPrompt((config, done) => {
|
|
394
|
+
const { transformer = (answer) => answer ? "yes" : "no" } = config;
|
|
549
395
|
const [status, setStatus] = useState("pending");
|
|
550
396
|
const [value, setValue] = useState("");
|
|
551
|
-
const theme = makeTheme(
|
|
397
|
+
const theme = makeTheme(config.theme);
|
|
552
398
|
const prefix = usePrefix({ theme });
|
|
553
399
|
useKeypress((key, rl) => {
|
|
554
400
|
if (isEnterKey(key)) {
|
|
555
|
-
let answer =
|
|
401
|
+
let answer = config.default !== false;
|
|
556
402
|
if (/^(y|yes)/i.test(value))
|
|
557
403
|
answer = true;
|
|
558
404
|
else if (/^(n|no)/i.test(value))
|
|
@@ -569,9 +415,9 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
|
569
415
|
if (status === "done") {
|
|
570
416
|
formattedValue = theme.style.answer(value);
|
|
571
417
|
} else {
|
|
572
|
-
defaultValue = ` ${theme.style.defaultAnswer(
|
|
418
|
+
defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
|
|
573
419
|
}
|
|
574
|
-
const message = theme.style.message(
|
|
420
|
+
const message = theme.style.message(config.message);
|
|
575
421
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
576
422
|
});
|
|
577
423
|
|
|
@@ -592,13 +438,13 @@ function getChoiceKey(choice, key) {
|
|
|
592
438
|
return choice.value;
|
|
593
439
|
return choice.name;
|
|
594
440
|
}
|
|
595
|
-
var esm_default5 = createPrompt((
|
|
596
|
-
const { choices, default: defaultKey = "h", expanded: defaultExpandState = false } =
|
|
441
|
+
var esm_default5 = createPrompt((config, done) => {
|
|
442
|
+
const { choices, default: defaultKey = "h", expanded: defaultExpandState = false } = config;
|
|
597
443
|
const [status, setStatus] = useState("pending");
|
|
598
444
|
const [value, setValue] = useState("");
|
|
599
445
|
const [expanded, setExpanded] = useState(defaultExpandState);
|
|
600
446
|
const [errorMsg, setError] = useState(void 0);
|
|
601
|
-
const theme = makeTheme(
|
|
447
|
+
const theme = makeTheme(config.theme);
|
|
602
448
|
const prefix = usePrefix({ theme });
|
|
603
449
|
useKeypress((event, rl) => {
|
|
604
450
|
if (isEnterKey(event)) {
|
|
@@ -623,7 +469,7 @@ var esm_default5 = createPrompt((config3, done) => {
|
|
|
623
469
|
setError(void 0);
|
|
624
470
|
}
|
|
625
471
|
});
|
|
626
|
-
const message = theme.style.message(
|
|
472
|
+
const message = theme.style.message(config.message);
|
|
627
473
|
if (status === "done") {
|
|
628
474
|
return `${prefix} ${message} ${theme.style.answer(value)}`;
|
|
629
475
|
}
|
|
@@ -662,11 +508,11 @@ var esm_default5 = createPrompt((config3, done) => {
|
|
|
662
508
|
});
|
|
663
509
|
|
|
664
510
|
// ../../node_modules/.pnpm/@inquirer+input@2.1.2/node_modules/@inquirer/input/dist/esm/index.mjs
|
|
665
|
-
var esm_default6 = createPrompt((
|
|
666
|
-
const { validate = () => true } =
|
|
667
|
-
const theme = makeTheme(
|
|
511
|
+
var esm_default6 = createPrompt((config, done) => {
|
|
512
|
+
const { validate = () => true } = config;
|
|
513
|
+
const theme = makeTheme(config.theme);
|
|
668
514
|
const [status, setStatus] = useState("pending");
|
|
669
|
-
const [defaultValue = "", setDefaultValue] = useState(
|
|
515
|
+
const [defaultValue = "", setDefaultValue] = useState(config.default);
|
|
670
516
|
const [errorMsg, setError] = useState(void 0);
|
|
671
517
|
const [value, setValue] = useState("");
|
|
672
518
|
const isLoading = status === "loading";
|
|
@@ -700,10 +546,10 @@ var esm_default6 = createPrompt((config3, done) => {
|
|
|
700
546
|
setError(void 0);
|
|
701
547
|
}
|
|
702
548
|
});
|
|
703
|
-
const message = theme.style.message(
|
|
549
|
+
const message = theme.style.message(config.message);
|
|
704
550
|
let formattedValue = value;
|
|
705
|
-
if (typeof
|
|
706
|
-
formattedValue =
|
|
551
|
+
if (typeof config.transformer === "function") {
|
|
552
|
+
formattedValue = config.transformer(value, { isFinal: status === "done" });
|
|
707
553
|
} else if (status === "done") {
|
|
708
554
|
formattedValue = theme.style.answer(value);
|
|
709
555
|
}
|
|
@@ -723,9 +569,9 @@ var esm_default6 = createPrompt((config3, done) => {
|
|
|
723
569
|
|
|
724
570
|
// ../../node_modules/.pnpm/@inquirer+password@2.1.2/node_modules/@inquirer/password/dist/esm/index.mjs
|
|
725
571
|
var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
|
|
726
|
-
var esm_default7 = createPrompt((
|
|
727
|
-
const { validate = () => true } =
|
|
728
|
-
const theme = makeTheme(
|
|
572
|
+
var esm_default7 = createPrompt((config, done) => {
|
|
573
|
+
const { validate = () => true } = config;
|
|
574
|
+
const theme = makeTheme(config.theme);
|
|
729
575
|
const [status, setStatus] = useState("pending");
|
|
730
576
|
const [errorMsg, setError] = useState(void 0);
|
|
731
577
|
const [value, setValue] = useState("");
|
|
@@ -753,11 +599,11 @@ var esm_default7 = createPrompt((config3, done) => {
|
|
|
753
599
|
setError(void 0);
|
|
754
600
|
}
|
|
755
601
|
});
|
|
756
|
-
const message = theme.style.message(
|
|
602
|
+
const message = theme.style.message(config.message);
|
|
757
603
|
let formattedValue = "";
|
|
758
604
|
let helpTip;
|
|
759
|
-
if (
|
|
760
|
-
const maskChar = typeof
|
|
605
|
+
if (config.mask) {
|
|
606
|
+
const maskChar = typeof config.mask === "string" ? config.mask : "*";
|
|
761
607
|
formattedValue = maskChar.repeat(value.length);
|
|
762
608
|
} else if (status !== "done") {
|
|
763
609
|
helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes.default.cursorHide}`;
|
|
@@ -1254,7 +1100,7 @@ var PromisePolyfill = class extends Promise {
|
|
|
1254
1100
|
|
|
1255
1101
|
// ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs
|
|
1256
1102
|
function createPrompt2(view) {
|
|
1257
|
-
const prompt = (
|
|
1103
|
+
const prompt = (config, context = {}) => {
|
|
1258
1104
|
const { input = process.stdin, signal } = context;
|
|
1259
1105
|
const cleanups = /* @__PURE__ */ new Set();
|
|
1260
1106
|
const output = new import_mute_stream.default();
|
|
@@ -1288,7 +1134,7 @@ function createPrompt2(view) {
|
|
|
1288
1134
|
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
1289
1135
|
cycle(() => {
|
|
1290
1136
|
try {
|
|
1291
|
-
const nextView = view(
|
|
1137
|
+
const nextView = view(config, (value) => {
|
|
1292
1138
|
setImmediate(() => resolve2(value));
|
|
1293
1139
|
});
|
|
1294
1140
|
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
@@ -1365,9 +1211,9 @@ function normalizeChoices(choices) {
|
|
|
1365
1211
|
};
|
|
1366
1212
|
});
|
|
1367
1213
|
}
|
|
1368
|
-
var esm_default8 = createPrompt2((
|
|
1369
|
-
const { pageSize = 7, validate = () => true } =
|
|
1370
|
-
const theme = makeTheme2(searchTheme,
|
|
1214
|
+
var esm_default8 = createPrompt2((config, done) => {
|
|
1215
|
+
const { pageSize = 7, validate = () => true } = config;
|
|
1216
|
+
const theme = makeTheme2(searchTheme, config.theme);
|
|
1371
1217
|
const firstRender = useRef(true);
|
|
1372
1218
|
const [status, setStatus] = useState2("loading");
|
|
1373
1219
|
const [searchTerm, setSearchTerm] = useState2("");
|
|
@@ -1386,7 +1232,7 @@ var esm_default8 = createPrompt2((config3, done) => {
|
|
|
1386
1232
|
setSearchError(void 0);
|
|
1387
1233
|
const fetchResults = async () => {
|
|
1388
1234
|
try {
|
|
1389
|
-
const results = await
|
|
1235
|
+
const results = await config.source(searchTerm || void 0, {
|
|
1390
1236
|
signal: controller.signal
|
|
1391
1237
|
});
|
|
1392
1238
|
if (!controller.signal.aborted) {
|
|
@@ -1443,7 +1289,7 @@ var esm_default8 = createPrompt2((config3, done) => {
|
|
|
1443
1289
|
setSearchTerm(rl.line);
|
|
1444
1290
|
}
|
|
1445
1291
|
});
|
|
1446
|
-
const message = theme.style.message(
|
|
1292
|
+
const message = theme.style.message(config.message, status);
|
|
1447
1293
|
if (active > 0) {
|
|
1448
1294
|
firstRender.current = false;
|
|
1449
1295
|
}
|
|
@@ -1493,8 +1339,8 @@ ${theme.style.description(selectedChoice.description)}` : ``;
|
|
|
1493
1339
|
});
|
|
1494
1340
|
|
|
1495
1341
|
// src/util/client.ts
|
|
1496
|
-
var import_async_retry = __toESM(
|
|
1497
|
-
import { join
|
|
1342
|
+
var import_async_retry = __toESM(require_dist2(), 1);
|
|
1343
|
+
import { join, resolve } from "path";
|
|
1498
1344
|
import { EventEmitter } from "events";
|
|
1499
1345
|
import { URL } from "url";
|
|
1500
1346
|
import {
|
|
@@ -1602,7 +1448,7 @@ function sharedPromise(fn) {
|
|
|
1602
1448
|
}
|
|
1603
1449
|
|
|
1604
1450
|
// src/util/client.ts
|
|
1605
|
-
var
|
|
1451
|
+
var import_error_utils = __toESM(require_dist(), 1);
|
|
1606
1452
|
|
|
1607
1453
|
// src/util/sleep.ts
|
|
1608
1454
|
function sleep(ms) {
|
|
@@ -1820,6 +1666,23 @@ ${error.stack}`);
|
|
|
1820
1666
|
refresh_token: authConfig.refreshToken
|
|
1821
1667
|
});
|
|
1822
1668
|
const [tokensError, tokens] = await processTokenResponse(tokenResponse);
|
|
1669
|
+
if (isOAuthError(tokensError) && tokensError.code === "invalid_grant" && !authConfig.tokenSource && this.stdin.isTTY && !this.nonInteractive) {
|
|
1670
|
+
output_manager_default.debug(
|
|
1671
|
+
`Stored session refresh failed: ${tokensError.cause.message}`
|
|
1672
|
+
);
|
|
1673
|
+
output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");
|
|
1674
|
+
const recoveredTokens = await performDeviceCodeFlow(this);
|
|
1675
|
+
if (recoveredTokens) {
|
|
1676
|
+
this.updateAuthConfig({
|
|
1677
|
+
token: recoveredTokens.access_token,
|
|
1678
|
+
userId: void 0,
|
|
1679
|
+
expiresAt: Math.floor(Date.now() / 1e3) + recoveredTokens.expires_in,
|
|
1680
|
+
refreshToken: recoveredTokens.refresh_token
|
|
1681
|
+
});
|
|
1682
|
+
this.persistAuthConfig();
|
|
1683
|
+
return;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1823
1686
|
if (tokensError) {
|
|
1824
1687
|
output_manager_default.debug("Error refreshing token, emptying auth config.");
|
|
1825
1688
|
this.emptyAuthConfig();
|
|
@@ -1845,7 +1708,7 @@ ${error.stack}`);
|
|
|
1845
1708
|
return getSharedGlobalPathConfig();
|
|
1846
1709
|
}
|
|
1847
1710
|
async readConfig(fileName, schema) {
|
|
1848
|
-
const filePath =
|
|
1711
|
+
const filePath = join(this.getGlobalPathConfig(), fileName);
|
|
1849
1712
|
return readSharedConfigFile(filePath, schema);
|
|
1850
1713
|
}
|
|
1851
1714
|
async maybeReadConfig(fileName, schema) {
|
|
@@ -1856,11 +1719,11 @@ ${error.stack}`);
|
|
|
1856
1719
|
}
|
|
1857
1720
|
}
|
|
1858
1721
|
async writeConfig(fileName, schema, value) {
|
|
1859
|
-
const filePath =
|
|
1722
|
+
const filePath = join(this.getGlobalPathConfig(), fileName);
|
|
1860
1723
|
writeSharedConfigFile(filePath, schema, value);
|
|
1861
1724
|
}
|
|
1862
|
-
updateConfig(
|
|
1863
|
-
this.config = { ...this.config, ...
|
|
1725
|
+
updateConfig(config) {
|
|
1726
|
+
this.config = { ...this.config, ...config };
|
|
1864
1727
|
}
|
|
1865
1728
|
writeToConfigFile() {
|
|
1866
1729
|
writeToConfigFile(this.config);
|
|
@@ -2015,7 +1878,7 @@ Are you sure you want to proceed?`;
|
|
|
2015
1878
|
try {
|
|
2016
1879
|
await this.reauthenticate(error);
|
|
2017
1880
|
} catch (reauthError) {
|
|
2018
|
-
return bail((0,
|
|
1881
|
+
return bail((0, import_error_utils.normalizeError)(reauthError));
|
|
2019
1882
|
}
|
|
2020
1883
|
} else if (res.status === 429 && opts.bailOn429) {
|
|
2021
1884
|
return bail(error);
|
|
@@ -2076,16 +1939,8 @@ function progress(current, total, opts = {}) {
|
|
|
2076
1939
|
}
|
|
2077
1940
|
|
|
2078
1941
|
export {
|
|
2079
|
-
|
|
2080
|
-
require_dist3 as require_dist,
|
|
1942
|
+
require_dist2 as require_dist,
|
|
2081
1943
|
printIndications,
|
|
2082
|
-
readConfigFile,
|
|
2083
|
-
writeToConfigFile,
|
|
2084
|
-
readAuthConfigFile,
|
|
2085
|
-
persistAuthConfig,
|
|
2086
|
-
getConfigFilePath2 as getConfigFilePath,
|
|
2087
|
-
getAuthConfigFilePath2 as getAuthConfigFilePath,
|
|
2088
|
-
readLocalConfig,
|
|
2089
1944
|
sleep,
|
|
2090
1945
|
isJSONObject,
|
|
2091
1946
|
Client,
|
|
@@ -4,6 +4,9 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
truncateEnd
|
|
9
|
+
} from "./chunk-OF2GNB42.js";
|
|
7
10
|
import {
|
|
8
11
|
require_dist
|
|
9
12
|
} from "./chunk-OX7KI3LF.js";
|
|
@@ -296,7 +299,7 @@ function pickCustomEnvironment(customEnvironments, customEnvironmentSlugOrId) {
|
|
|
296
299
|
|
|
297
300
|
// src/util/output/ellipsis.ts
|
|
298
301
|
function ellipsis(str, length) {
|
|
299
|
-
return str
|
|
302
|
+
return truncateEnd(str, length, { omission: "\u2026" });
|
|
300
303
|
}
|
|
301
304
|
|
|
302
305
|
export {
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
require_lib,
|
|
20
20
|
require_minimatch,
|
|
21
21
|
require_pluralize
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TPX7RZBM.js";
|
|
23
23
|
import {
|
|
24
24
|
CantParseJSONFile,
|
|
25
25
|
cmd,
|
|
@@ -11117,6 +11117,12 @@ function getBuilderPins() {
|
|
|
11117
11117
|
function isBareSpec(parsed) {
|
|
11118
11118
|
return parsed.type === "tag" && parsed.rawSpec === "";
|
|
11119
11119
|
}
|
|
11120
|
+
function formatResolvedBuilders(builders) {
|
|
11121
|
+
return Array.from(
|
|
11122
|
+
builders.values(),
|
|
11123
|
+
(b) => b.pkgPath ? `${b.pkg.name}@${b.pkg.version}=${dirname(b.pkgPath)}` : `${b.pkg.name}=built-in`
|
|
11124
|
+
).join(",");
|
|
11125
|
+
}
|
|
11120
11126
|
function pinBuilderSpecs(specs) {
|
|
11121
11127
|
const pins = getBuilderPins();
|
|
11122
11128
|
const pinnedSpecs = /* @__PURE__ */ new Map();
|
|
@@ -12155,6 +12161,7 @@ export {
|
|
|
12155
12161
|
require_npa,
|
|
12156
12162
|
staticFiles,
|
|
12157
12163
|
require_mime_types,
|
|
12164
|
+
formatResolvedBuilders,
|
|
12158
12165
|
importBuilders,
|
|
12159
12166
|
getStaticServiceSchedules,
|
|
12160
12167
|
OUTPUT_DIR,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
|
|
8
|
+
// src/util/openapi/column-label.ts
|
|
9
|
+
function humanizeIdentifier(raw) {
|
|
10
|
+
const s = raw.trim();
|
|
11
|
+
if (!s) {
|
|
12
|
+
return raw;
|
|
13
|
+
}
|
|
14
|
+
const withSpaces = s.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
15
|
+
const words = withSpaces.split(/[\s_-]+/).filter(Boolean);
|
|
16
|
+
return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
humanizeIdentifier
|
|
21
|
+
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getLinkedProject,
|
|
12
12
|
getProjectByNameOrId,
|
|
13
13
|
getScope
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TPX7RZBM.js";
|
|
15
15
|
import {
|
|
16
16
|
AGENT_REASON,
|
|
17
17
|
buildCommandWithGlobalFlags,
|
|
@@ -38,6 +38,9 @@ function emitAlertsScopeError(client, jsonOutput, code, message, agent) {
|
|
|
38
38
|
return outputError(client, jsonOutput, code, message);
|
|
39
39
|
}
|
|
40
40
|
async function resolveAlertsScope(client, opts) {
|
|
41
|
+
const command = opts.command ?? "alerts";
|
|
42
|
+
const projectCommand = `${command} --project <name_or_id>`;
|
|
43
|
+
const allCommand = `${command} --all`;
|
|
41
44
|
if (opts.all || opts.project) {
|
|
42
45
|
const { team } = await getScope(client);
|
|
43
46
|
if (!team) {
|
|
@@ -84,7 +87,7 @@ async function resolveAlertsScope(client, opts) {
|
|
|
84
87
|
{
|
|
85
88
|
command: buildCommandWithGlobalFlags(
|
|
86
89
|
client.argv,
|
|
87
|
-
|
|
90
|
+
projectCommand
|
|
88
91
|
),
|
|
89
92
|
when: "Retry with a project you can access (replace <name_or_id>)"
|
|
90
93
|
}
|
|
@@ -105,11 +108,8 @@ async function resolveAlertsScope(client, opts) {
|
|
|
105
108
|
reason: AGENT_REASON.NOT_FOUND,
|
|
106
109
|
next: [
|
|
107
110
|
{
|
|
108
|
-
command: buildCommandWithGlobalFlags(
|
|
109
|
-
|
|
110
|
-
"alerts rules ls"
|
|
111
|
-
),
|
|
112
|
-
when: "List rules in the current linked project or adjust --project"
|
|
111
|
+
command: buildCommandWithGlobalFlags(client.argv, projectCommand),
|
|
112
|
+
when: "Retry with a valid project (replace <name_or_id>)"
|
|
113
113
|
}
|
|
114
114
|
]
|
|
115
115
|
}
|
|
@@ -135,18 +135,12 @@ async function resolveAlertsScope(client, opts) {
|
|
|
135
135
|
when: "Link this directory to a Vercel project"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
|
-
command: buildCommandWithGlobalFlags(
|
|
139
|
-
|
|
140
|
-
"alerts rules ls --project <name_or_id>"
|
|
141
|
-
),
|
|
142
|
-
when: "List rules for a project without linking (replace <name_or_id>)"
|
|
138
|
+
command: buildCommandWithGlobalFlags(client.argv, projectCommand),
|
|
139
|
+
when: "Retry with an explicit project (replace <name_or_id>)"
|
|
143
140
|
},
|
|
144
141
|
{
|
|
145
|
-
command: buildCommandWithGlobalFlags(
|
|
146
|
-
|
|
147
|
-
"alerts rules ls --all"
|
|
148
|
-
),
|
|
149
|
-
when: "List team-wide rules without a linked project"
|
|
142
|
+
command: buildCommandWithGlobalFlags(client.argv, allCommand),
|
|
143
|
+
when: "Use team-wide scope without a linked project"
|
|
150
144
|
}
|
|
151
145
|
]
|
|
152
146
|
});
|
|
@@ -158,6 +152,5 @@ async function resolveAlertsScope(client, opts) {
|
|
|
158
152
|
}
|
|
159
153
|
|
|
160
154
|
export {
|
|
161
|
-
emitAlertsScopeError,
|
|
162
155
|
resolveAlertsScope
|
|
163
156
|
};
|