vercel 53.4.0 → 54.1.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 (76) hide show
  1. package/dist/chunks/{add-FYITUY65.js → add-XFFRWMRQ.js} +10 -8
  2. package/dist/chunks/{chunk-NF7HK5MP.js → chunk-2DFWEDF7.js} +2 -2
  3. package/dist/chunks/{chunk-GQLARSTH.js → chunk-4GQQJY5Y.js} +1 -1
  4. package/dist/chunks/{chunk-ONYQGA2O.js → chunk-4PSOOFYO.js} +2 -2
  5. package/dist/chunks/{chunk-KTULXE6M.js → chunk-4VPRHRPA.js} +3 -3
  6. package/dist/chunks/{chunk-WOWCXMTU.js → chunk-76ZNZKIN.js} +1 -3
  7. package/dist/chunks/{chunk-GCKUEAUE.js → chunk-CQANJIEC.js} +2 -2
  8. package/dist/chunks/{chunk-MW7BI4C2.js → chunk-CVDYWVCD.js} +2 -2
  9. package/dist/chunks/{chunk-KSIISCB2.js → chunk-DKD6GTQT.js} +1 -1
  10. package/dist/chunks/{chunk-IVC36JQ5.js → chunk-F2UPASLT.js} +9 -7
  11. package/dist/chunks/{chunk-Z2ES2XHU.js → chunk-FUBTAFL2.js} +2 -2
  12. package/dist/chunks/{chunk-PU7YKGJI.js → chunk-FXOKKAK2.js} +6 -6
  13. package/dist/chunks/{chunk-KM7WTYJ4.js → chunk-FXSXQHVF.js} +4 -4
  14. package/dist/chunks/{chunk-NIOGCTVR.js → chunk-IFATV36R.js} +2 -2
  15. package/dist/chunks/{chunk-KHDOCVQF.js → chunk-IIZO5JJ2.js} +1 -1
  16. package/dist/chunks/{chunk-YWCYZANP.js → chunk-J3BCJYPE.js} +6 -6
  17. package/dist/chunks/{chunk-4LDQIDKG.js → chunk-JFVGRFME.js} +2 -2
  18. package/dist/chunks/{chunk-3XU5UGVN.js → chunk-JFWE5ORG.js} +2 -2
  19. package/dist/chunks/{chunk-73EVSBLA.js → chunk-KWDV5FZH.js} +2 -2
  20. package/dist/chunks/{chunk-54T7XV3H.js → chunk-LVUE7LLE.js} +1 -1
  21. package/dist/chunks/{chunk-IS56OO2J.js → chunk-MMF4BVAP.js} +5 -5
  22. package/dist/chunks/chunk-N2T234LO.js +3144 -0
  23. package/dist/chunks/{chunk-5HTDIHTQ.js → chunk-N4WFAZKO.js} +4 -4
  24. package/dist/chunks/{chunk-ZY4YCCXG.js → chunk-N733ZD4W.js} +1 -1
  25. package/dist/chunks/{chunk-X7KU44KR.js → chunk-NYJXGEIR.js} +1 -1
  26. package/dist/chunks/chunk-P4QNYOFB.js +96 -0
  27. package/dist/chunks/{chunk-CMAHZSFA.js → chunk-PNA7EZB2.js} +6 -3
  28. package/dist/chunks/{chunk-WZO6BNJ7.js → chunk-PPIAHRII.js} +2 -2
  29. package/dist/chunks/{chunk-3NSIZGHP.js → chunk-TZMIHH5D.js} +3 -3
  30. package/dist/chunks/{chunk-EBEBY45K.js → chunk-UGXBNJMO.js} +5 -100
  31. package/dist/chunks/{chunk-AXQNAI65.js → chunk-ULXHXZCZ.js} +1 -1
  32. package/dist/chunks/{chunk-6EI6XOUG.js → chunk-UTXSTM52.js} +98 -64
  33. package/dist/chunks/{chunk-SLWOG5CX.js → chunk-UVFXUXOZ.js} +155 -84
  34. package/dist/chunks/{chunk-44EL4BJL.js → chunk-V6RCNEUA.js} +424 -2730
  35. package/dist/chunks/{chunk-LBP7YFBV.js → chunk-X775BOSL.js} +651 -3662
  36. package/dist/chunks/{chunk-7TCOOSFP.js → chunk-XNUHSM7I.js} +4 -4
  37. package/dist/chunks/{chunk-JZLADLMF.js → chunk-XVAEOG4L.js} +2 -2
  38. package/dist/chunks/{chunk-HAJ2XRTQ.js → chunk-ZAAKSLHC.js} +2 -2
  39. package/dist/chunks/{chunk-QGLS47RE.js → chunk-ZINNI4TC.js} +1 -1
  40. package/dist/chunks/{chunk-6447C5WV.js → chunk-ZKKIBUCU.js} +3 -3
  41. package/dist/chunks/cjs-DV4RM7XU.js +20743 -0
  42. package/dist/chunks/{compile-vercel-config-ED6WXKEL.js → compile-vercel-config-42PRUTEP.js} +6 -4
  43. package/dist/chunks/constants-3FSSR6E7.js +13 -0
  44. package/dist/chunks/{delete-FYRG67YL.js → delete-MXCXLO5L.js} +8 -6
  45. package/dist/chunks/{disable-T6JFY4LL.js → disable-LXQSUVY3.js} +8 -6
  46. package/dist/chunks/{discard-OLVACEPN.js → discard-CKMEANJI.js} +8 -6
  47. package/dist/chunks/{edit-JI2VCMGG.js → edit-PKYWQTN6.js} +9 -7
  48. package/dist/chunks/{enable-2W35HGRM.js → enable-IONDBJSL.js} +8 -6
  49. package/dist/chunks/exec-5MN7VTSE.js +1368 -0
  50. package/dist/chunks/{export-FFMFMPGE.js → export-YV3QFTMT.js} +8 -6
  51. package/dist/chunks/{inspect-RDRV6BUD.js → inspect-SF355FJC.js} +10 -8
  52. package/dist/chunks/{list-5WGQ7F6P.js → list-GEI7DMTS.js} +8 -6
  53. package/dist/chunks/{list-F2GP6UZ7.js → list-ZGR3WI5L.js} +13 -11
  54. package/dist/chunks/{ls-ZLHJPSZZ.js → ls-GYN5LXZK.js} +10 -8
  55. package/dist/chunks/pkg-56KRLZ5K.js +13 -0
  56. package/dist/chunks/{publish-S2PGRBDP.js → publish-3WCELCTS.js} +8 -6
  57. package/dist/chunks/{query-G5K7DLLJ.js → query-TP56OPX6.js} +12 -10
  58. package/dist/chunks/{reorder-K5VXZ7F5.js → reorder-QRNHPN5V.js} +8 -6
  59. package/dist/chunks/{restore-QJYBYUIZ.js → restore-IGN4HUFX.js} +8 -6
  60. package/dist/chunks/{rm-WCHM3XXB.js → rm-55RGOT4O.js} +10 -8
  61. package/dist/chunks/{rule-inspect-VMWUI4WH.js → rule-inspect-QVOVMKDK.js} +10 -8
  62. package/dist/chunks/{rules-SOQXK4AE.js → rules-KRCW5RQK.js} +9 -8
  63. package/dist/chunks/{schema-2H2WLFJN.js → schema-3J3IBIFA.js} +11 -9
  64. package/dist/chunks/{types-7VDI75PV.js → types-QAT6PCGL.js} +5 -4
  65. package/dist/chunks/{update-W6DZOFHV.js → update-E5UAD2DD.js} +10 -8
  66. package/dist/commands/build/index.js +71 -25
  67. package/dist/commands/deploy/index.js +66 -53
  68. package/dist/commands/dev/index.js +58 -30
  69. package/dist/commands/env/index.js +20 -18
  70. package/dist/commands/link/index.js +21 -19
  71. package/dist/commands/list/index.js +14 -12
  72. package/dist/commands-bulk.js +1817 -1449
  73. package/dist/help.js +1 -1
  74. package/dist/index.js +236 -22334
  75. package/dist/version.mjs +1 -1
  76. package/package.json +28 -24
@@ -6,10 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getLocalPathConfig
9
- } from "./chunk-KTULXE6M.js";
10
- import {
11
- table
12
- } from "./chunk-KSIISCB2.js";
9
+ } from "./chunk-4VPRHRPA.js";
13
10
  import {
14
11
  VERCEL_DIR_PROJECT,
15
12
  VERCEL_DIR_README,
@@ -42,15 +39,18 @@ import {
42
39
  selectAndParseRemoteUrl,
43
40
  selectOrg,
44
41
  writeServicesConfig
45
- } from "./chunk-LBP7YFBV.js";
42
+ } from "./chunk-X775BOSL.js";
43
+ import {
44
+ table
45
+ } from "./chunk-DKD6GTQT.js";
46
46
  import {
47
47
  printError
48
- } from "./chunk-GQLARSTH.js";
48
+ } from "./chunk-4GQQJY5Y.js";
49
49
  import {
50
50
  CantParseJSONFile,
51
51
  ProjectNotFound,
52
52
  isAPIError
53
- } from "./chunk-EBEBY45K.js";
53
+ } from "./chunk-UGXBNJMO.js";
54
54
  import {
55
55
  output_manager_default
56
56
  } from "./chunk-ZQKJVHXY.js";
@@ -284,6 +284,7 @@ function displayServiceErrors(errors) {
284
284
  // src/util/link/setup-and-link.ts
285
285
  var import_chalk6 = __toESM(require_source(), 1);
286
286
  var import_fs_extra2 = __toESM(require_lib(), 1);
287
+ var import_fs_detectors2 = __toESM(require_dist(), 1);
287
288
  import { join as join2, basename } from "path";
288
289
 
289
290
  // src/util/input/input-project.ts
@@ -324,7 +325,7 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
324
325
  } else {
325
326
  if (await client.input.confirm(
326
327
  `Found project ${import_chalk2.default.cyan(
327
- `\u201C${org.slug}/${detectedProject.name}\u201D`
328
+ `"${org.slug}/${detectedProject.name}"`
328
329
  )}. Link to it?`,
329
330
  true
330
331
  )) {
@@ -346,7 +347,7 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
346
347
  } else if (hasMoreProjects) {
347
348
  let toLink;
348
349
  await client.input.text({
349
- message: "What's the name of your existing project?",
350
+ message: "Existing project name?",
350
351
  validate: async (val) => {
351
352
  if (!val) {
352
353
  return "Project name cannot be empty";
@@ -373,7 +374,7 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
373
374
  }
374
375
  }
375
376
  return await client.input.text({
376
- message: `What\u2019s your project\u2019s name?`,
377
+ message: `Name?`,
377
378
  default: !detectedProject ? slugifiedName : void 0,
378
379
  validate: async (val) => {
379
380
  if (!val) {
@@ -460,14 +461,14 @@ async function editProjectSettings(client, projectSettings, framework, autoConfi
460
461
  if (localConfigValue)
461
462
  settings[setting] = localConfigValue;
462
463
  }
463
- output_manager_default.print(`Local settings detected in ${configFileName}:
464
+ output_manager_default.print(` Local settings detected in ${configFileName}:
464
465
  `);
465
466
  for (const setting of settingKeys) {
466
467
  const override = localConfigurationOverrides[setting];
467
468
  if (override) {
468
469
  output_manager_default.print(
469
- `${import_chalk4.default.dim(
470
- `- ${import_chalk4.default.bold(`${settingMap[setting]}:`)} ${override}`
470
+ ` ${import_chalk4.default.dim(
471
+ `${import_chalk4.default.bold(`${settingMap[setting]}:`)} ${override}`
471
472
  )}
472
473
  `
473
474
  );
@@ -480,7 +481,7 @@ async function editProjectSettings(client, projectSettings, framework, autoConfi
480
481
  if (overrideFramework) {
481
482
  framework = overrideFramework;
482
483
  output_manager_default.print(
483
- `Merging default Project Settings for ${framework.name}. Previously listed overrides are prioritized.
484
+ ` Merging default Project Settings for ${framework.name}. Previously listed overrides are prioritized.
484
485
  `
485
486
  );
486
487
  }
@@ -490,22 +491,21 @@ async function editProjectSettings(client, projectSettings, framework, autoConfi
490
491
  settings.framework = null;
491
492
  return settings;
492
493
  }
493
- const styledFramework = (frameworkName) => {
494
- const frameworkStyle = {
495
- text: frameworkName,
496
- color: import_chalk4.default.blue
497
- };
498
- if (frameworkName === "Hono") {
499
- frameworkStyle.text = "\u{1F525} Hono";
500
- frameworkStyle.color = import_chalk4.default.hex("#FFA500");
501
- }
502
- return import_chalk4.default.bold(frameworkStyle.color(frameworkStyle.text));
503
- };
504
- output_manager_default.log(
505
- !framework.slug ? `No framework detected. Default Project Settings:
506
- ` : `Auto-detected Project Settings for ${styledFramework(framework.name)}
507
- `
508
- );
494
+ if (!framework.slug) {
495
+ output_manager_default.print(` No framework detected. Default Project Settings:
496
+ `);
497
+ } else {
498
+ const buildCmd = framework.settings.buildCommand?.value ?? null;
499
+ const outputSetting = framework.settings.outputDirectory;
500
+ const outputDir = outputSetting ? isSettingValue(outputSetting) ? outputSetting.value : outputSetting.placeholder : null;
501
+ const inline = [
502
+ buildCmd ? `${settingMap.buildCommand}: ${buildCmd}` : null,
503
+ outputDir ? `${settingMap.outputDirectory}: ${outputDir}` : null
504
+ ].filter(Boolean);
505
+ const detail = inline.length ? import_chalk4.default.dim(` (${inline.join(", ")})`) : "";
506
+ output_manager_default.print(` ${import_chalk4.default.bold("Detected")} ${framework.name}${detail}
507
+ `);
508
+ }
509
509
  settings.framework = framework.slug;
510
510
  if (!framework.slug) {
511
511
  for (const setting of settingKeys) {
@@ -516,15 +516,15 @@ async function editProjectSettings(client, projectSettings, framework, autoConfi
516
516
  const override = localConfigurationOverrides?.[setting];
517
517
  if (!override && defaultSetting) {
518
518
  output_manager_default.print(
519
- `${import_chalk4.default.dim(
520
- `- ${import_chalk4.default.bold(`${settingMap[setting]}:`)} ${isSettingValue(defaultSetting) ? defaultSetting.value : import_chalk4.default.italic(`${defaultSetting.placeholder}`)}`
519
+ ` ${import_chalk4.default.dim(
520
+ `${import_chalk4.default.bold(`${settingMap[setting]}:`)} ${isSettingValue(defaultSetting) ? defaultSetting.value : import_chalk4.default.italic(`${defaultSetting.placeholder}`)}`
521
521
  )}
522
522
  `
523
523
  );
524
524
  }
525
525
  }
526
526
  }
527
- if (autoConfirm || !await client.input.confirm("Want to modify these settings?", false)) {
527
+ if (autoConfirm || !await client.input.confirm("Customize settings?", false)) {
528
528
  return settings;
529
529
  }
530
530
  const choices = settingKeys.reduce(
@@ -543,7 +543,7 @@ async function editProjectSettings(client, projectSettings, framework, autoConfi
543
543
  for (const setting of settingFields) {
544
544
  const field = settingMap[setting];
545
545
  settings[setting] = await client.input.text({
546
- message: `What's your ${import_chalk4.default.bold(field)}?`
546
+ message: `${import_chalk4.default.bold(field)}?`
547
547
  });
548
548
  }
549
549
  return settings;
@@ -594,7 +594,7 @@ async function getServicesSetupState(workPath) {
594
594
  const detectServicesResult = await (0, import_fs_detectors.detectServices)({
595
595
  fs: new import_fs_detectors.LocalFileSystemDetector(workPath)
596
596
  });
597
- const hasConfiguredServices = detectServicesResult.resolved.source === "configured";
597
+ const hasConfiguredServices = detectServicesResult.resolved?.source === "configured";
598
598
  const inferredServices = hasConfiguredServices ? null : detectServicesResult.inferred;
599
599
  const inferredServicesWriteBlocker = inferredServices ? await getServicesConfigWriteBlocker(workPath, inferredServices.config) : null;
600
600
  return {
@@ -700,7 +700,8 @@ async function promptForInferredServicesSetup({
700
700
  workPath,
701
701
  inferred.config
702
702
  );
703
- output_manager_default.log(`Added services configuration to ${configFileName}.`);
703
+ output_manager_default.print(` Added services configuration to ${configFileName}.
704
+ `);
704
705
  return { type: "services" };
705
706
  }
706
707
 
@@ -859,7 +860,7 @@ function formatMatchReason(match) {
859
860
  return import_chalk6.default.gray("(folder name)");
860
861
  }
861
862
  function formatCrossTeamMatch(match) {
862
- return `${import_chalk6.default.blue(match.org.slug)}/${match.project.name} ${formatMatchReason(
863
+ return `${import_chalk6.default.bold(match.org.slug)}/${match.project.name} ${formatMatchReason(
863
864
  match
864
865
  )}`;
865
866
  }
@@ -873,14 +874,48 @@ function printCrossTeamSearchScope({
873
874
  skippedLimitedTeamSlugs
874
875
  }) {
875
876
  if (searchedTeamSlugs.length > 0) {
876
- output_manager_default.log(`Searched teams: ${formatTeamList(searchedTeamSlugs)}`);
877
+ output_manager_default.print(` Searched teams: ${formatTeamList(searchedTeamSlugs)}
878
+ `);
877
879
  }
878
880
  if (skippedLimitedTeamSlugs.length > 0) {
879
- output_manager_default.log(
880
- `Skipped ${skippedLimitedTeamSlugs.length} SSO-protected ${skippedLimitedTeamSlugs.length === 1 ? "team" : "teams"}`
881
+ output_manager_default.print(
882
+ ` Skipped ${skippedLimitedTeamSlugs.length} SSO-protected ${skippedLimitedTeamSlugs.length === 1 ? "team" : "teams"}
883
+ `
881
884
  );
882
885
  }
883
886
  }
887
+ function isErrnoException(err) {
888
+ return err instanceof Error && typeof err.code === "string";
889
+ }
890
+ async function hasWorkspaces(cwd) {
891
+ try {
892
+ const fs = new import_fs_detectors2.LocalFileSystemDetector(cwd);
893
+ const workspaces = await (0, import_fs_detectors2.getWorkspaces)({ fs });
894
+ return workspaces.length > 0;
895
+ } catch (err) {
896
+ if (isErrnoException(err) && err.code && ["ENOENT", "EACCES", "ENOTDIR"].includes(err.code)) {
897
+ output_manager_default.debug(`getWorkspaces failed for ${cwd}: ${err}`);
898
+ return false;
899
+ }
900
+ throw err;
901
+ }
902
+ }
903
+ async function shouldPromptForRootDirectory(opts) {
904
+ if (opts.servicesChoice?.type === "project-directory") {
905
+ return true;
906
+ }
907
+ if (await hasWorkspaces(opts.path)) {
908
+ return true;
909
+ }
910
+ try {
911
+ const detected = await detectProjects(opts.path);
912
+ const frameworksAtRoot = detected.get("") ?? [];
913
+ return frameworksAtRoot.length === 0;
914
+ } catch (err) {
915
+ output_manager_default.debug(`detectProjects failed at root: ${err}`);
916
+ return true;
917
+ }
918
+ }
884
919
  async function maybePullEnvAfterLink(client, path2, autoConfirm, pullEnv) {
885
920
  if (!pullEnv || !client.stdin.isTTY || client.nonInteractive) {
886
921
  return;
@@ -1107,15 +1142,11 @@ async function setupAndLink(client, path2, {
1107
1142
  if (!isTTY && !autoConfirm && !nonInteractive) {
1108
1143
  return { status: "error", exitCode: 1, reason: "HEADLESS" };
1109
1144
  }
1110
- const shouldStartSetup = autoConfirm || nonInteractive || await client.input.confirm(
1111
- `${setupMsg} ${import_chalk6.default.cyan(`\u201C${humanizePath(path2)}\u201D`)}?`,
1112
- true
1145
+ output_manager_default.print(
1146
+ `
1147
+ ${import_chalk6.default.bold(setupMsg)} ${import_chalk6.default.dim(`"${humanizePath(path2)}"`)}
1148
+ `
1113
1149
  );
1114
- if (!shouldStartSetup) {
1115
- output_manager_default.print(`Canceled. Project not set up.
1116
- `);
1117
- return { status: "not_linked", org: null, project: null };
1118
- }
1119
1150
  let skipAutoDetect = false;
1120
1151
  if (searchAcrossTeams) {
1121
1152
  let crossTeamMatches = [];
@@ -1163,8 +1194,9 @@ async function setupAndLink(client, path2, {
1163
1194
  }
1164
1195
  if (!autoConfirm && !nonInteractive && skippedLimitedTeams.length > 0) {
1165
1196
  if (crossTeamMatches.length === 0) {
1166
- output_manager_default.log(
1167
- `No matching projects found in the ${searchedTeamSlugs.length} ${searchedTeamSlugs.length === 1 ? "team" : "teams"} available in your current session.`
1197
+ output_manager_default.print(
1198
+ ` No matching projects found in the ${searchedTeamSlugs.length} ${searchedTeamSlugs.length === 1 ? "team" : "teams"} available in your current session.
1199
+ `
1168
1200
  );
1169
1201
  }
1170
1202
  const limitedTeamMatches = await searchSelectedLimitedTeams({
@@ -1187,8 +1219,8 @@ async function setupAndLink(client, path2, {
1187
1219
  return linkedLimitedMatch;
1188
1220
  }
1189
1221
  if (limitedTeamMatches.length === 0) {
1190
- output_manager_default.log(
1191
- "No matching projects found in the selected SSO-protected teams."
1222
+ output_manager_default.print(
1223
+ " No matching projects found in the selected SSO-protected teams.\n"
1192
1224
  );
1193
1225
  }
1194
1226
  skipAutoDetect = skipAutoDetect || crossTeamMatches.length > 0 || limitedTeamMatches.length > 0;
@@ -1197,11 +1229,7 @@ async function setupAndLink(client, path2, {
1197
1229
  }
1198
1230
  }
1199
1231
  try {
1200
- org = await selectOrg(
1201
- client,
1202
- "Which scope should contain your project?",
1203
- autoConfirm
1204
- );
1232
+ org = await selectOrg(client, "Which team?", autoConfirm);
1205
1233
  } catch (err) {
1206
1234
  if (isAPIError(err)) {
1207
1235
  if (err.code === "NOT_AUTHORIZED") {
@@ -1283,13 +1311,19 @@ async function setupAndLink(client, path2, {
1283
1311
  rootInferredServicesChoice.selectedPath
1284
1312
  );
1285
1313
  } else {
1286
- rootDirectory = await inputRootDirectory(client, path2, autoConfirm);
1287
- if (rootDirectory && !await validateRootDirectory(path2, join2(path2, rootDirectory))) {
1288
- return {
1289
- status: "error",
1290
- exitCode: 1,
1291
- reason: "INVALID_ROOT_DIRECTORY"
1292
- };
1314
+ const shouldPromptRoot = await shouldPromptForRootDirectory({
1315
+ path: path2,
1316
+ servicesChoice: rootInferredServicesChoice
1317
+ });
1318
+ if (shouldPromptRoot) {
1319
+ rootDirectory = await inputRootDirectory(client, path2, autoConfirm);
1320
+ if (rootDirectory && !await validateRootDirectory(path2, join2(path2, rootDirectory))) {
1321
+ return {
1322
+ status: "error",
1323
+ exitCode: 1,
1324
+ reason: "INVALID_ROOT_DIRECTORY"
1325
+ };
1326
+ }
1293
1327
  }
1294
1328
  }
1295
1329
  pathWithRootDirectory = rootDirectory ? join2(path2, rootDirectory) : path2;