vercel 56.2.0 → 56.3.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.
Files changed (88) hide show
  1. package/dist/chunks/{add-YQRDKWJH.js → add-CF5SQESQ.js} +11 -14
  2. package/dist/chunks/{add-T6ZTAEU2.js → add-DMRGZN3Z.js} +10 -13
  3. package/dist/chunks/{chunk-LSPZHWWP.js → chunk-22G26AIX.js} +99 -74
  4. package/dist/chunks/{chunk-HMMPJ3VD.js → chunk-2C2JJTAM.js} +6 -10
  5. package/dist/chunks/{chunk-YGSTSVXS.js → chunk-2MXGTALG.js} +1076 -3627
  6. package/dist/chunks/{chunk-5AJNUXWP.js → chunk-3PKFXNJZ.js} +2 -4
  7. package/dist/chunks/{chunk-5OT26JZN.js → chunk-3VS4DTAU.js} +4 -6
  8. package/dist/chunks/{chunk-JJWESW5Y.js → chunk-4G6QZSBL.js} +2 -4
  9. package/dist/chunks/{chunk-HR6VI6UV.js → chunk-4YOCOUDN.js} +5 -6
  10. package/dist/chunks/{chunk-GXBDQRHJ.js → chunk-4Z5LC2CI.js} +1 -1
  11. package/dist/chunks/{chunk-2RVK3DDN.js → chunk-52QYYTM5.js} +4 -0
  12. package/dist/chunks/{chunk-CMJMYVQM.js → chunk-6OMC3HOW.js} +1 -1
  13. package/dist/chunks/{chunk-SRJTYE5U.js → chunk-A6LE5VAN.js} +1 -1
  14. package/dist/chunks/{chunk-QY63UKTP.js → chunk-DMSLNAVH.js} +2 -2
  15. package/dist/chunks/{chunk-PN2GJKM5.js → chunk-DZHRFBKE.js} +2 -2
  16. package/dist/chunks/{chunk-SHT5IY3Q.js → chunk-ERPZJ4SX.js} +14 -4
  17. package/dist/chunks/{chunk-K2THP63Z.js → chunk-EYNXG3FO.js} +3 -5
  18. package/dist/chunks/{chunk-RLJA2KI7.js → chunk-FYQPTH5C.js} +2 -4
  19. package/dist/chunks/{chunk-RLXBXRU2.js → chunk-G4PG5HVE.js} +6 -10
  20. package/dist/chunks/{chunk-7PZWVZN6.js → chunk-G75NFPIT.js} +1 -1
  21. package/dist/chunks/{chunk-7C7MMT4J.js → chunk-GIL3VAUR.js} +2 -4
  22. package/dist/chunks/{chunk-EKIKD7RS.js → chunk-HUKYQKVQ.js} +9 -7
  23. package/dist/chunks/{chunk-AVLGVZJ5.js → chunk-I2IICWBW.js} +190 -29
  24. package/dist/chunks/{chunk-E3Y4SDXF.js → chunk-ICSIFPXG.js} +3 -5
  25. package/dist/chunks/{chunk-P6AK7SVK.js → chunk-KSSNLCL4.js} +360 -25
  26. package/dist/chunks/{chunk-WOA4Z45Z.js → chunk-KXKQQIUS.js} +18 -12
  27. package/dist/chunks/{chunk-HA7C7SDO.js → chunk-LHFNIZ2P.js} +2 -4
  28. package/dist/chunks/{chunk-B6SCQUDV.js → chunk-NP32PAKT.js} +2 -2
  29. package/dist/chunks/{chunk-QEEGXNFK.js → chunk-NZRWTCRM.js} +1 -1
  30. package/dist/chunks/{chunk-IDMKFYEA.js → chunk-OGG6UBXK.js} +2 -4
  31. package/dist/chunks/{chunk-XFMTSTYT.js → chunk-PRO4S2KV.js} +8 -68
  32. package/dist/chunks/{chunk-NQEAHRBI.js → chunk-Q5ADSH7D.js} +11 -16
  33. package/dist/chunks/{chunk-AEENIITE.js → chunk-QP3C5YS5.js} +8 -8
  34. package/dist/chunks/{chunk-24FCBXI4.js → chunk-R6IGDGX3.js} +1 -1
  35. package/dist/chunks/{chunk-PQK4YU22.js → chunk-SDK7R4WO.js} +1 -1
  36. package/dist/chunks/{chunk-22GUZ5KG.js → chunk-STJJ3DFO.js} +2 -4
  37. package/dist/chunks/{chunk-EHTPDXTS.js → chunk-SZXT3PDQ.js} +3 -294
  38. package/dist/chunks/{chunk-CB3I3QIT.js → chunk-UDWRZXIT.js} +193 -85
  39. package/dist/chunks/{chunk-DREO3DFB.js → chunk-VZSZBD4V.js} +16 -6
  40. package/dist/chunks/{chunk-7S3QUMIG.js → chunk-YS6EDZHB.js} +3 -5
  41. package/dist/chunks/{chunk-EI555LUJ.js → chunk-ZDCS54ZZ.js} +3 -3
  42. package/dist/chunks/{chunk-4RGSUV5C.js → chunk-ZVLPUREX.js} +2 -2
  43. package/dist/chunks/{compile-vercel-config-3AG4VKHZ.js → compile-vercel-config-RPPL7W56.js} +5 -5
  44. package/dist/chunks/{delete-JLJ753B4.js → delete-QBVZ5X6B.js} +15 -15
  45. package/dist/chunks/{disable-AXFGDOYN.js → disable-YYGXPXBI.js} +15 -14
  46. package/dist/chunks/{discard-557SDKVO.js → discard-X2MSUFGI.js} +14 -13
  47. package/dist/chunks/{edit-ITGNF7S5.js → edit-3ABZQYUU.js} +18 -19
  48. package/dist/chunks/{enable-6RMJPNW5.js → enable-HUMYCGKA.js} +15 -14
  49. package/dist/chunks/{exec-G4AUF3KG.js → exec-CNBOV577.js} +3 -3
  50. package/dist/chunks/{export-3NC3DPRR.js → export-KGHH4WAT.js} +16 -15
  51. package/dist/chunks/{image-FGP5UVA5.js → image-OO3WWKZV.js} +6 -8
  52. package/dist/chunks/{inspect-FDF5WZMM.js → inspect-5TNHHD2M.js} +11 -13
  53. package/dist/chunks/{inspect-N5DHCKLZ.js → inspect-FNUCB7Y3.js} +9 -11
  54. package/dist/chunks/{inspect-AF5J3QDV.js → inspect-KSSQEAW7.js} +12 -16
  55. package/dist/chunks/{inspect-56OMR6RC.js → inspect-Z6SSD2SR.js} +9 -11
  56. package/dist/chunks/{list-PLG2ZHBA.js → list-TXNYRVJG.js} +9 -11
  57. package/dist/chunks/{list-F2AW7L3D.js → list-X2AD3HCX.js} +11 -14
  58. package/dist/chunks/{login-LQRR64K7.js → login-SLPCZ2OF.js} +14 -17
  59. package/dist/chunks/{ls-FWPYY7GH.js → ls-2YSINRJ3.js} +11 -14
  60. package/dist/chunks/{ls-EKNQN3V4.js → ls-4QMJLQQL.js} +11 -14
  61. package/dist/chunks/{ls-HZDBJLMG.js → ls-C7MNQ4IK.js} +13 -16
  62. package/dist/chunks/{ls-E7FYH3DW.js → ls-QLTOY23G.js} +10 -13
  63. package/dist/chunks/{publish-PDGTM3M7.js → publish-GV4LLLXP.js} +14 -13
  64. package/dist/chunks/{query-MUQKKYXI.js → query-3AHRMAPA.js} +11 -13
  65. package/dist/chunks/{reorder-B76HXU6D.js → reorder-VSVOPNM4.js} +18 -17
  66. package/dist/chunks/{restore-2PYXS4NP.js → restore-FKYCF73P.js} +20 -19
  67. package/dist/chunks/{rm-GZW2IDWX.js → rm-4QCXZRC2.js} +11 -14
  68. package/dist/chunks/{rm-SD3EJRXY.js → rm-UTFG42FN.js} +9 -12
  69. package/dist/chunks/{rm-SFC67P5U.js → rm-YV5WQKQM.js} +10 -13
  70. package/dist/chunks/{rule-inspect-MSPP3V4O.js → rule-inspect-IONN4MTP.js} +10 -13
  71. package/dist/chunks/{rules-AN32QRP7.js → rules-S2KPV7HY.js} +9 -11
  72. package/dist/chunks/{schema-2GYFHMCN.js → schema-3LX3V2HE.js} +12 -13
  73. package/dist/chunks/{tags-ULDC3YLP.js → tags-CQ4FRIJ4.js} +5 -7
  74. package/dist/chunks/{types-2TPA6J4G.js → types-QKLIFDDP.js} +5 -5
  75. package/dist/chunks/{update-NE62WKTZ.js → update-U7OGHCP5.js} +10 -13
  76. package/dist/commands/build/index.js +43 -38
  77. package/dist/commands/deploy/index.js +58 -75
  78. package/dist/commands/dev/index.js +206 -163
  79. package/dist/commands/env/index.js +77 -44
  80. package/dist/commands/link/index.js +26 -29
  81. package/dist/commands/list/index.js +15 -19
  82. package/dist/commands-bulk.js +3103 -1872
  83. package/dist/index.js +30 -33
  84. package/dist/version.mjs +1 -1
  85. package/package.json +22 -23
  86. package/dist/chunks/chunk-IC4YEIGW.js +0 -101
  87. package/dist/chunks/chunk-LXF3AXHM.js +0 -158
  88. package/dist/chunks/chunk-SGL3NMOP.js +0 -86
@@ -292,6 +292,348 @@ function getCommandNamePlain(subcommands) {
292
292
  return subcommands ? `${packageName} ${subcommands}` : packageName;
293
293
  }
294
294
 
295
+ // src/util/get-flags-specification.ts
296
+ function getFlagsSpecification(options) {
297
+ const flagsSpecification = {};
298
+ for (const option of options) {
299
+ flagsSpecification[`--${option.name}`] = option.type;
300
+ if (option.shorthand) {
301
+ flagsSpecification[`-${option.shorthand}`] = `--${option.name}`;
302
+ }
303
+ }
304
+ return flagsSpecification;
305
+ }
306
+
307
+ // src/util/redact-args.ts
308
+ var SENSITIVE_AUTH_FLAG_NAMES = /* @__PURE__ */ new Set(["--token", "-t"]);
309
+ function normalizeFlagName(flag) {
310
+ if (flag.includes("=")) {
311
+ return flag.slice(0, flag.indexOf("="));
312
+ }
313
+ return flag;
314
+ }
315
+ function stripSensitiveAuthArgs(args) {
316
+ const out = [];
317
+ for (let i = 0; i < args.length; i++) {
318
+ const arg = args[i];
319
+ const name = normalizeFlagName(arg);
320
+ if (SENSITIVE_AUTH_FLAG_NAMES.has(name)) {
321
+ if (!arg.includes("=") && i + 1 < args.length) {
322
+ i++;
323
+ }
324
+ continue;
325
+ }
326
+ out.push(arg);
327
+ }
328
+ return out;
329
+ }
330
+
331
+ // src/util/arg-common.ts
332
+ var globalCommandOptions = [
333
+ {
334
+ name: "help",
335
+ shorthand: "h",
336
+ type: Boolean,
337
+ description: "Output usage information",
338
+ deprecated: false
339
+ },
340
+ {
341
+ name: "version",
342
+ shorthand: "v",
343
+ type: Boolean,
344
+ description: "Output the version number",
345
+ deprecated: false
346
+ },
347
+ {
348
+ name: "cwd",
349
+ shorthand: null,
350
+ type: String,
351
+ argument: "DIR",
352
+ description: "Sets the current working directory for a single run of a command",
353
+ deprecated: false
354
+ },
355
+ {
356
+ name: "local-config",
357
+ shorthand: "A",
358
+ type: String,
359
+ argument: "FILE",
360
+ description: "Path to the local `vercel.json` file",
361
+ deprecated: false
362
+ },
363
+ {
364
+ name: "global-config",
365
+ shorthand: "Q",
366
+ type: String,
367
+ argument: "DIR",
368
+ description: "Path to the global `.vercel` directory",
369
+ deprecated: false
370
+ },
371
+ {
372
+ name: "debug",
373
+ shorthand: "d",
374
+ type: Boolean,
375
+ description: "Debug mode (default off)",
376
+ deprecated: false
377
+ },
378
+ {
379
+ name: "no-color",
380
+ shorthand: null,
381
+ type: Boolean,
382
+ description: "No color mode (default off)",
383
+ deprecated: false
384
+ },
385
+ {
386
+ name: "non-interactive",
387
+ shorthand: null,
388
+ type: Boolean,
389
+ description: "Run without interactive prompts; when an agent is detected this is the default",
390
+ deprecated: false
391
+ },
392
+ {
393
+ name: "scope",
394
+ shorthand: "S",
395
+ type: String,
396
+ description: "Set a custom scope",
397
+ deprecated: false
398
+ },
399
+ {
400
+ name: "token",
401
+ shorthand: "t",
402
+ type: String,
403
+ argument: "TOKEN",
404
+ description: "Login token",
405
+ deprecated: false
406
+ },
407
+ { name: "team", shorthand: "T", type: String, deprecated: false },
408
+ { name: "api", shorthand: null, type: String, deprecated: false }
409
+ ];
410
+ var GLOBAL_CLI_FLAG_NAMES = (() => {
411
+ const set = /* @__PURE__ */ new Set();
412
+ for (const opt of globalCommandOptions) {
413
+ set.add(`--${opt.name}`);
414
+ if (opt.shorthand) {
415
+ set.add(`-${opt.shorthand}`);
416
+ }
417
+ }
418
+ return set;
419
+ })();
420
+ function globalCliFlagTakesValue(flagName) {
421
+ const normalized = normalizeFlagName(flagName);
422
+ for (const opt of globalCommandOptions) {
423
+ if (`--${opt.name}` === normalized) {
424
+ return opt.type === String;
425
+ }
426
+ if (opt.shorthand && `-${opt.shorthand}` === normalized) {
427
+ return opt.type === String;
428
+ }
429
+ }
430
+ return false;
431
+ }
432
+ var SUGGESTION_FLAGS_TAKING_VALUE = /* @__PURE__ */ new Set([
433
+ "--config",
434
+ "--environment",
435
+ "--git-branch",
436
+ "--id",
437
+ "--value",
438
+ "--status",
439
+ "--name",
440
+ "--slug",
441
+ "--version",
442
+ // redirects list --version
443
+ "--search",
444
+ "--format",
445
+ "--project",
446
+ "--page",
447
+ "--per-page"
448
+ ]);
449
+ function suggestionFlagTakesSeparateValue(flagName) {
450
+ const name = normalizeFlagName(flagName);
451
+ if (globalCliFlagTakesValue(name))
452
+ return true;
453
+ return SUGGESTION_FLAGS_TAKING_VALUE.has(name);
454
+ }
455
+ function getSameSubcommandSuggestionFlags(args) {
456
+ const safeArgs = stripSensitiveAuthArgs(args);
457
+ const out = [];
458
+ for (let i = 0; i < safeArgs.length; i++) {
459
+ const a = safeArgs[i];
460
+ if (!a.startsWith("-"))
461
+ continue;
462
+ out.push(a);
463
+ if (a.includes("="))
464
+ continue;
465
+ const name = a;
466
+ if (suggestionFlagTakesSeparateValue(name) && i + 1 < safeArgs.length && !safeArgs[i + 1].startsWith("-")) {
467
+ out.push(safeArgs[++i]);
468
+ }
469
+ }
470
+ return out;
471
+ }
472
+ var GLOBAL_OPTIONS = getFlagsSpecification(globalCommandOptions);
473
+ var arg_common_default = () => GLOBAL_OPTIONS;
474
+ var yesOption = {
475
+ name: "yes",
476
+ shorthand: "y",
477
+ type: Boolean,
478
+ deprecated: false,
479
+ description: "Accept default value for all prompts"
480
+ };
481
+ var nextOption = {
482
+ name: "next",
483
+ shorthand: "N",
484
+ type: Number,
485
+ deprecated: false,
486
+ description: "Show next page of results",
487
+ argument: "MS"
488
+ };
489
+ var confirmOption = {
490
+ name: "confirm",
491
+ shorthand: "c",
492
+ type: Boolean,
493
+ deprecated: true
494
+ };
495
+ var limitOption = {
496
+ name: "limit",
497
+ shorthand: null,
498
+ type: Number,
499
+ deprecated: false,
500
+ description: "Number of results to return per page (default: 20, max: 100)",
501
+ argument: "NUMBER"
502
+ };
503
+ var forceOption = {
504
+ name: "force",
505
+ shorthand: "f",
506
+ type: Boolean,
507
+ deprecated: false
508
+ };
509
+ var formatOption = {
510
+ name: "format",
511
+ shorthand: "F",
512
+ type: String,
513
+ argument: "FORMAT",
514
+ description: "Specify the output format (json)",
515
+ deprecated: false
516
+ };
517
+ var jsonOption = {
518
+ name: "json",
519
+ shorthand: null,
520
+ type: Boolean,
521
+ deprecated: true,
522
+ description: "DEPRECATED: Use --format=json instead"
523
+ };
524
+ var allOption = {
525
+ name: "all",
526
+ shorthand: "a",
527
+ type: Boolean,
528
+ deprecated: false,
529
+ description: "List resources across all projects"
530
+ };
531
+ var projectOption = {
532
+ name: "project",
533
+ shorthand: null,
534
+ type: String,
535
+ argument: "NAME_OR_ID",
536
+ description: "Project name or ID (defaults to the linked project)",
537
+ deprecated: false
538
+ };
539
+ var deploymentOption = {
540
+ name: "deployment",
541
+ shorthand: null,
542
+ type: String,
543
+ deprecated: false,
544
+ description: "The deployment ID or URL to target",
545
+ argument: "ID|URL"
546
+ };
547
+ var protectionBypassOption = {
548
+ name: "protection-bypass",
549
+ shorthand: null,
550
+ type: String,
551
+ deprecated: false,
552
+ description: "Protection bypass secret for accessing protected deployments",
553
+ argument: "SECRET"
554
+ };
555
+ var GLOBAL_LONG_TO_OPT = /* @__PURE__ */ new Map();
556
+ var GLOBAL_SHORT_TO_OPT = /* @__PURE__ */ new Map();
557
+ for (const opt of globalCommandOptions) {
558
+ GLOBAL_LONG_TO_OPT.set(`--${opt.name}`, opt);
559
+ if (opt.shorthand) {
560
+ GLOBAL_SHORT_TO_OPT.set(`-${opt.shorthand}`, opt);
561
+ }
562
+ }
563
+ function getGlobalFlagsFromArgs(args, options) {
564
+ const delimiterIndex = args.indexOf("--");
565
+ const cliArgs = delimiterIndex === -1 ? args : args.slice(0, delimiterIndex);
566
+ const safeArgs = stripSensitiveAuthArgs(cliArgs);
567
+ const out = [];
568
+ for (let i = 0; i < safeArgs.length; i++) {
569
+ const a = safeArgs[i];
570
+ if (options?.preserveYes && (a === "--yes" || a === "-y")) {
571
+ out.push(a);
572
+ continue;
573
+ }
574
+ if (options?.preserveConfig && (a === "--config" || a.startsWith("--config="))) {
575
+ out.push(a);
576
+ if (a === "--config") {
577
+ const next = safeArgs[i + 1];
578
+ if (next && !next.startsWith("-")) {
579
+ out.push(next);
580
+ i++;
581
+ }
582
+ }
583
+ continue;
584
+ }
585
+ let opt;
586
+ if (a.startsWith("--") && a.includes("=")) {
587
+ const name = a.slice(2).split("=")[0];
588
+ opt = GLOBAL_LONG_TO_OPT.get(`--${name}`);
589
+ if (opt)
590
+ out.push(a);
591
+ continue;
592
+ }
593
+ opt = GLOBAL_LONG_TO_OPT.get(a) || GLOBAL_SHORT_TO_OPT.get(a);
594
+ if (!opt)
595
+ continue;
596
+ out.push(a);
597
+ if (opt.type === String && !a.includes("=")) {
598
+ const next = safeArgs[i + 1];
599
+ if (next && !next.startsWith("-")) {
600
+ out.push(next);
601
+ i++;
602
+ }
603
+ }
604
+ }
605
+ if (options?.preserveProject) {
606
+ const projectOption2 = findProjectOption(safeArgs);
607
+ if (projectOption2)
608
+ out.push(...projectOption2.args);
609
+ }
610
+ return out;
611
+ }
612
+ function findProjectOption(args) {
613
+ for (let i = 0; i < args.length; i++) {
614
+ const arg = args[i];
615
+ if (arg === "--")
616
+ return void 0;
617
+ if (arg.startsWith("--project=")) {
618
+ return {
619
+ value: arg.slice("--project=".length),
620
+ args: [arg]
621
+ };
622
+ }
623
+ if (arg === "--project") {
624
+ const value = args[i + 1];
625
+ if (value && !value.startsWith("-")) {
626
+ return { value, args: [arg, value] };
627
+ }
628
+ return void 0;
629
+ }
630
+ }
631
+ return void 0;
632
+ }
633
+ function getProjectOptionFromArgs(args) {
634
+ return findProjectOption(args)?.value;
635
+ }
636
+
295
637
  // src/util/now-error.ts
296
638
  var NowError = class extends Error {
297
639
  constructor({
@@ -979,30 +1321,6 @@ var InvalidLocalConfig = class extends NowError {
979
1321
  }
980
1322
  };
981
1323
 
982
- // src/util/redact-args.ts
983
- var SENSITIVE_AUTH_FLAG_NAMES = /* @__PURE__ */ new Set(["--token", "-t"]);
984
- function normalizeFlagName(flag) {
985
- if (flag.includes("=")) {
986
- return flag.slice(0, flag.indexOf("="));
987
- }
988
- return flag;
989
- }
990
- function stripSensitiveAuthArgs(args) {
991
- const out = [];
992
- for (let i = 0; i < args.length; i++) {
993
- const arg = args[i];
994
- const name = normalizeFlagName(arg);
995
- if (SENSITIVE_AUTH_FLAG_NAMES.has(name)) {
996
- if (!arg.includes("=") && i + 1 < args.length) {
997
- i++;
998
- }
999
- continue;
1000
- }
1001
- out.push(arg);
1002
- }
1003
- return out;
1004
- }
1005
-
1006
1324
  export {
1007
1325
  require_lib,
1008
1326
  cmd,
@@ -1010,8 +1328,25 @@ export {
1010
1328
  getTitleName,
1011
1329
  getCommandName,
1012
1330
  getCommandNamePlain,
1013
- normalizeFlagName,
1331
+ getFlagsSpecification,
1014
1332
  stripSensitiveAuthArgs,
1333
+ globalCommandOptions,
1334
+ suggestionFlagTakesSeparateValue,
1335
+ getSameSubcommandSuggestionFlags,
1336
+ arg_common_default,
1337
+ yesOption,
1338
+ nextOption,
1339
+ confirmOption,
1340
+ limitOption,
1341
+ forceOption,
1342
+ formatOption,
1343
+ jsonOption,
1344
+ allOption,
1345
+ projectOption,
1346
+ deploymentOption,
1347
+ protectionBypassOption,
1348
+ getGlobalFlagsFromArgs,
1349
+ getProjectOptionFromArgs,
1015
1350
  require_bytes,
1016
1351
  NowError,
1017
1352
  code,
@@ -5,22 +5,23 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
- printProjectNotFoundError,
9
8
  setupAndLink
10
- } from "./chunk-XFMTSTYT.js";
9
+ } from "./chunk-PRO4S2KV.js";
11
10
  import {
11
+ detectExplicitScope,
12
12
  getLinkedProject,
13
13
  param,
14
+ printProjectNotFoundError,
14
15
  resolveProjectCwd
15
- } from "./chunk-YGSTSVXS.js";
16
+ } from "./chunk-2MXGTALG.js";
16
17
  import {
17
18
  buildCommandWithYes,
18
19
  outputActionRequired
19
- } from "./chunk-CB3I3QIT.js";
20
+ } from "./chunk-UDWRZXIT.js";
20
21
  import {
21
22
  getCommandName,
22
23
  getCommandNamePlain
23
- } from "./chunk-P6AK7SVK.js";
24
+ } from "./chunk-KSSNLCL4.js";
24
25
  import {
25
26
  output_manager_default
26
27
  } from "./chunk-OX7KI3LF.js";
@@ -28,25 +29,30 @@ import {
28
29
  // src/util/link/ensure-link.ts
29
30
  async function ensureLink(commandName, client, cwd, opts = {}) {
30
31
  cwd = await resolveProjectCwd(cwd);
31
- let { link } = opts;
32
+ let link = opts.link;
32
33
  const nonInteractive = opts.nonInteractive ?? client.nonInteractive ?? false;
33
34
  opts.nonInteractive = nonInteractive;
34
35
  if (!link) {
35
36
  if (opts.forceDelete) {
36
37
  link = { status: "not_linked", org: null, project: null };
37
38
  } else {
38
- link = await getLinkedProject(
39
- client,
39
+ link = await getLinkedProject(client, {
40
40
  cwd,
41
- opts.projectName,
42
- opts.failIfNotFound
43
- );
41
+ projectName: opts.projectName,
42
+ projectNameIsExplicit: Boolean(opts.projectName && opts.failIfNotFound),
43
+ scopeIsExplicit: detectExplicitScope(client)
44
+ });
44
45
  }
45
46
  opts.link = link;
46
47
  }
47
48
  if (link.status === "linked" && opts.forceDelete || link.status === "not_linked") {
48
49
  if (link.status === "not_linked" && opts.failIfNotFound && opts.projectName) {
49
- await printProjectNotFoundError(client, opts.projectName, commandName);
50
+ await printProjectNotFoundError(
51
+ client,
52
+ opts.projectName,
53
+ commandName,
54
+ link.orgId
55
+ );
50
56
  return 1;
51
57
  }
52
58
  if (link.status === "not_linked" && opts.requireExistingLink) {
@@ -10,11 +10,9 @@ import {
10
10
  formatOption,
11
11
  limitOption,
12
12
  nextOption,
13
+ packageName,
13
14
  yesOption
14
- } from "./chunk-EHTPDXTS.js";
15
- import {
16
- packageName
17
- } from "./chunk-P6AK7SVK.js";
15
+ } from "./chunk-KSSNLCL4.js";
18
16
 
19
17
  // src/commands/list/command.ts
20
18
  var listCommand = {
@@ -6,11 +6,11 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  STANDARD_ENVIRONMENTS
9
- } from "./chunk-YGSTSVXS.js";
9
+ } from "./chunk-2MXGTALG.js";
10
10
  import {
11
11
  getCommandName,
12
12
  require_lib
13
- } from "./chunk-P6AK7SVK.js";
13
+ } from "./chunk-KSSNLCL4.js";
14
14
  import {
15
15
  output_manager_default
16
16
  } from "./chunk-OX7KI3LF.js";
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_string_width
9
- } from "./chunk-EHTPDXTS.js";
9
+ } from "./chunk-SZXT3PDQ.js";
10
10
  import {
11
11
  __commonJS,
12
12
  __require,
@@ -6,12 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  confirmOption,
9
+ packageName,
9
10
  projectOption,
10
11
  yesOption
11
- } from "./chunk-EHTPDXTS.js";
12
- import {
13
- packageName
14
- } from "./chunk-P6AK7SVK.js";
12
+ } from "./chunk-KSSNLCL4.js";
15
13
 
16
14
  // src/commands/dev/command.ts
17
15
  var devCommand = {
@@ -4,21 +4,14 @@ 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
- AGENT_REASON,
9
- AGENT_STATUS
10
- } from "./chunk-IC4YEIGW.js";
11
7
  import {
12
8
  getLocalPathConfig,
13
9
  isPromptBackError,
14
10
  isPromptCanceledError
15
- } from "./chunk-EI555LUJ.js";
16
- import {
17
- getScope
18
- } from "./chunk-LXF3AXHM.js";
11
+ } from "./chunk-ZDCS54ZZ.js";
19
12
  import {
20
13
  table
21
- } from "./chunk-QEEGXNFK.js";
14
+ } from "./chunk-NZRWTCRM.js";
22
15
  import {
23
16
  Separator,
24
17
  VERCEL_DIR_PROJECT,
@@ -53,20 +46,15 @@ import {
53
46
  selectAndParseRemoteUrl,
54
47
  selectOrg,
55
48
  writeServicesConfig
56
- } from "./chunk-YGSTSVXS.js";
57
- import {
58
- buildCommandWithGlobalFlags,
59
- outputAgentError,
60
- shouldEmitNonInteractiveCommandError
61
- } from "./chunk-CB3I3QIT.js";
49
+ } from "./chunk-2MXGTALG.js";
62
50
  import {
63
51
  printError
64
- } from "./chunk-EHTPDXTS.js";
52
+ } from "./chunk-SZXT3PDQ.js";
65
53
  import {
66
54
  CantParseJSONFile,
67
55
  ProjectNotFound,
68
56
  isAPIError
69
- } from "./chunk-P6AK7SVK.js";
57
+ } from "./chunk-KSSNLCL4.js";
70
58
  import {
71
59
  output_manager_default
72
60
  } from "./chunk-OX7KI3LF.js";
@@ -167,53 +155,6 @@ async function readConfig(dir) {
167
155
  return null;
168
156
  }
169
157
 
170
- // src/util/projects/project-not-found-error.ts
171
- async function printProjectNotFoundError(client, projectNameOrId, commandName) {
172
- let contextName;
173
- try {
174
- const scope = await getScope(client);
175
- contextName = scope.contextName;
176
- } catch (err) {
177
- output_manager_default.debug(`getScope failed during error reporting: ${err}`);
178
- }
179
- const scopeClause = contextName ? ` (${contextName})` : "";
180
- const headline = `Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`;
181
- output_manager_default.error(
182
- `${headline}
183
-
184
- If it lives in a different team or account:
185
- \u2022 Retry with \`--scope <team-slug|your-username>\`, or
186
- \u2022 Run \`vercel switch <team-slug|your-username>\` to change scope.
187
-
188
- List accessible teams with \`vercel teams ls\`.`
189
- );
190
- if (!shouldEmitNonInteractiveCommandError(client)) {
191
- return;
192
- }
193
- const retryWithScope = buildCommandWithGlobalFlags(
194
- client.argv,
195
- `${commandName} --project ${projectNameOrId} --scope <team-slug>`
196
- );
197
- outputAgentError(
198
- client,
199
- {
200
- status: AGENT_STATUS.ERROR,
201
- reason: AGENT_REASON.PROJECT_NOT_FOUND,
202
- message: `${headline} If it lives in a different team or account, retry with --scope <team-slug|your-username> or run \`vercel switch <team-slug|your-username>\` to change scope.`,
203
- ...contextName ? { scope: contextName } : {},
204
- next: [
205
- { command: "vercel teams ls", when: "list accessible teams" },
206
- { command: retryWithScope, when: "retry with a specific team" },
207
- {
208
- command: "vercel switch <team-slug>",
209
- when: "change the default scope"
210
- }
211
- ]
212
- },
213
- 1
214
- );
215
- }
216
-
217
158
  // src/util/input/display-services.ts
218
159
  var import_frameworks = __toESM(require_frameworks(), 1);
219
160
  import {
@@ -1190,7 +1131,7 @@ async function setupAndLink(client, path2, {
1190
1131
  return { status: "error", exitCode: 1, reason: "PATH_IS_FILE" };
1191
1132
  }
1192
1133
  if (!link) {
1193
- link = await getLinkedProject(client, path2);
1134
+ link = await getLinkedProject(client, { cwd: path2 });
1194
1135
  }
1195
1136
  const isTTY = client.stdin.isTTY;
1196
1137
  let rootDirectory = null;
@@ -1200,7 +1141,7 @@ async function setupAndLink(client, path2, {
1200
1141
  return link;
1201
1142
  }
1202
1143
  if (getPlatformEnv("ORG_ID") && getPlatformEnv("PROJECT_ID")) {
1203
- const envLink = await getLinkedProject(client, path2);
1144
+ const envLink = await getLinkedProject(client, { cwd: path2 });
1204
1145
  if (envLink.status === "error") {
1205
1146
  return envLink;
1206
1147
  }
@@ -1535,6 +1476,5 @@ export {
1535
1476
  validatePaths,
1536
1477
  readConfig,
1537
1478
  displayDetectedServices,
1538
- setupAndLink,
1539
- printProjectNotFoundError
1479
+ setupAndLink
1540
1480
  };