vercel 54.14.2 → 54.14.5

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 (52) hide show
  1. package/dist/chunks/{add-PKT6ULVJ.js → add-5Z2AAQMM.js} +4 -4
  2. package/dist/chunks/{chunk-G3NXHUFT.js → chunk-25XEQWUS.js} +1 -1
  3. package/dist/chunks/{chunk-JISJDGJF.js → chunk-2GOVUIMY.js} +1 -1
  4. package/dist/chunks/{chunk-Z3X747P6.js → chunk-2N7NBUQX.js} +1 -1
  5. package/dist/chunks/{chunk-IPWWE7PB.js → chunk-45S2Y3TD.js} +1 -1
  6. package/dist/chunks/{chunk-2XEEOHHH.js → chunk-6ABEFMPX.js} +1 -1
  7. package/dist/chunks/{chunk-4BFK3C7V.js → chunk-6H2YVMJJ.js} +1 -1
  8. package/dist/chunks/{chunk-O7RJHL34.js → chunk-6R3YPU76.js} +203 -6
  9. package/dist/chunks/chunk-BRQ6PX3U.js +593 -0
  10. package/dist/chunks/{chunk-3BR246Y6.js → chunk-EBIX223X.js} +2 -11
  11. package/dist/chunks/{chunk-2HN6DLIY.js → chunk-ETVOM3IR.js} +1 -1
  12. package/dist/chunks/{chunk-372SHB43.js → chunk-IXTKPQYW.js} +3 -3
  13. package/dist/chunks/{chunk-FEYVO2US.js → chunk-JLLN34XF.js} +90 -32
  14. package/dist/chunks/{chunk-O4V7CMVO.js → chunk-KSSRTKN4.js} +7 -5
  15. package/dist/chunks/{chunk-2ZSXQQXI.js → chunk-MOVGWTDQ.js} +8 -18
  16. package/dist/chunks/{chunk-SDZ5ICZL.js → chunk-PSG6ZBGQ.js} +1 -1
  17. package/dist/chunks/{chunk-FLW73SZ3.js → chunk-PXJA4KXE.js} +2 -2
  18. package/dist/chunks/{chunk-YLGMXYFG.js → chunk-R5MIXAJF.js} +2 -2
  19. package/dist/chunks/{chunk-J7BMPRCU.js → chunk-X23JL3ZL.js} +1 -1
  20. package/dist/chunks/{chunk-ILJH44MK.js → chunk-YE3C5CUX.js} +1 -1
  21. package/dist/chunks/{chunk-LQR3CHMH.js → chunk-YIAUEFUY.js} +211 -787
  22. package/dist/chunks/{chunk-OHIZ4SVU.js → chunk-ZR4XADWC.js} +15 -3
  23. package/dist/chunks/{compile-vercel-config-3LV7J3IZ.js → compile-vercel-config-UMUHH55E.js} +1 -1
  24. package/dist/chunks/{delete-GFW6Y6TZ.js → delete-NO2U3UGV.js} +2 -2
  25. package/dist/chunks/{disable-PGRAS2ZL.js → disable-AGDDHVKZ.js} +2 -2
  26. package/dist/chunks/{discard-S6N5Q4G5.js → discard-Q5HML52L.js} +2 -2
  27. package/dist/chunks/{edit-TICKX4ZV.js → edit-HSHJAKHM.js} +3 -3
  28. package/dist/chunks/{enable-L3BYWN6S.js → enable-YMJAXOGA.js} +2 -2
  29. package/dist/chunks/{export-NXS33U5T.js → export-RCACOTPE.js} +2 -2
  30. package/dist/chunks/{inspect-OOI5JN3Y.js → inspect-OJHOQHD2.js} +3 -3
  31. package/dist/chunks/{list-77WL6463.js → list-LLUDMAWA.js} +3 -3
  32. package/dist/chunks/{list-6EHRL2D4.js → list-R7V2P6TM.js} +2 -2
  33. package/dist/chunks/{ls-PBSOEXFG.js → ls-KAI6V7SU.js} +4 -4
  34. package/dist/chunks/{publish-CU2THVYW.js → publish-KCYVRDAT.js} +2 -2
  35. package/dist/chunks/{query-HEATRYAK.js → query-MBJLAQRX.js} +3 -3
  36. package/dist/chunks/{reorder-IQVKSM3H.js → reorder-C5BJWFJM.js} +2 -2
  37. package/dist/chunks/{restore-RDEOBGAS.js → restore-F63NO7XP.js} +2 -2
  38. package/dist/chunks/{rm-MCSGTU4J.js → rm-HT7YO3JX.js} +4 -4
  39. package/dist/chunks/{rule-inspect-3YK2XSL3.js → rule-inspect-IHEUI5JT.js} +4 -4
  40. package/dist/chunks/{rules-F4MRDDHM.js → rules-ZUBTVSNC.js} +6 -6
  41. package/dist/chunks/{schema-65C5EBJ7.js → schema-VAQSZY2H.js} +3 -3
  42. package/dist/chunks/{update-XB4WSRGY.js → update-BS5FBLIP.js} +4 -4
  43. package/dist/commands/build/index.js +53 -29
  44. package/dist/commands/deploy/index.js +12 -11
  45. package/dist/commands/dev/index.js +69 -22
  46. package/dist/commands/env/index.js +8 -6
  47. package/dist/commands/link/index.js +8 -15
  48. package/dist/commands/list/index.js +3 -3
  49. package/dist/commands-bulk.js +621 -101
  50. package/dist/index.js +9 -9
  51. package/dist/version.mjs +1 -1
  52. package/package.json +15 -15
@@ -7,22 +7,26 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-IPWWE7PB.js";
10
+ } from "./chunk-45S2Y3TD.js";
11
11
  import {
12
12
  getGlobalPathConfig,
13
+ progress,
13
14
  writeToConfigFile
14
- } from "./chunk-OHIZ4SVU.js";
15
+ } from "./chunk-ZR4XADWC.js";
15
16
  import {
16
17
  apiCommand,
17
18
  listSubcommand2 as listSubcommand,
18
19
  loginCommand
19
- } from "./chunk-O7RJHL34.js";
20
+ } from "./chunk-6R3YPU76.js";
21
+ import {
22
+ require_semver
23
+ } from "./chunk-IB5L4LKZ.js";
20
24
  import {
21
25
  help
22
26
  } from "./chunk-AWD3IGXU.js";
23
27
  import {
24
28
  login
25
- } from "./chunk-LQR3CHMH.js";
29
+ } from "./chunk-YIAUEFUY.js";
26
30
  import {
27
31
  TelemetryClient,
28
32
  isNativeBinaryInstall
@@ -2854,33 +2858,95 @@ async function runTagOperation(client, options) {
2854
2858
  }
2855
2859
 
2856
2860
  // src/util/upgrade.ts
2861
+ var import_semver = __toESM(require_semver(), 1);
2857
2862
  import { spawn, execFile } from "child_process";
2858
- import { promisify } from "util";
2859
2863
  import { tmpdir } from "os";
2860
- var execFileAsync = promisify(execFile);
2861
- async function getInstalledVersion() {
2862
- for (const bin of ["vercel", "vc"]) {
2864
+ function renderUpgradeProgress(current, total, phase) {
2865
+ const bar = progress(current, total);
2866
+ output_manager_default.spinner(
2867
+ bar ? `Upgrading Vercel CLI [${bar}] (${current}/${total})${phase ? ` ${phase}` : ""}` : phase || "Upgrading Vercel CLI\u2026",
2868
+ 0
2869
+ );
2870
+ }
2871
+ function execFileStdout(command, args) {
2872
+ return new Promise((resolve3, reject) => {
2873
+ execFile(
2874
+ command,
2875
+ args,
2876
+ { encoding: "utf8", windowsHide: true },
2877
+ (error, stdout) => {
2878
+ if (error) {
2879
+ reject(error);
2880
+ return;
2881
+ }
2882
+ resolve3(stdout.toString());
2883
+ }
2884
+ );
2885
+ });
2886
+ }
2887
+ function parseVersionOutput(stdout) {
2888
+ for (const line of stdout.trim().split("\n").reverse()) {
2863
2889
  try {
2864
- const { stdout } = await execFileAsync(bin, ["--version"], {
2865
- encoding: "utf8",
2866
- windowsHide: true
2867
- });
2868
- const version = stdout.trim();
2869
- if (version) {
2890
+ const parsed = JSON.parse(line);
2891
+ const version = typeof parsed === "string" ? parsed : typeof parsed?.data === "string" ? parsed.data : void 0;
2892
+ if (version && import_semver.default.valid(version)) {
2870
2893
  return version;
2871
2894
  }
2872
2895
  } catch {
2896
+ const version = line.trim();
2897
+ if (import_semver.default.valid(version)) {
2898
+ return version;
2899
+ }
2873
2900
  }
2874
2901
  }
2875
2902
  return void 0;
2876
2903
  }
2904
+ async function getLatestPackageVersion(packageManager, installArgs) {
2905
+ const packageSpecifier = installArgs.find((arg) => arg.endsWith("@latest"));
2906
+ if (!packageSpecifier) {
2907
+ return void 0;
2908
+ }
2909
+ const queryArgs = packageManager === "yarn" ? ["info", packageSpecifier, "version", "--json"] : ["view", packageSpecifier, "version", "--json"];
2910
+ try {
2911
+ const stdout = await execFileStdout(packageManager, queryArgs);
2912
+ return parseVersionOutput(stdout);
2913
+ } catch (error) {
2914
+ output_manager_default.debug(
2915
+ `Failed to resolve the latest Vercel CLI version: ${error instanceof Error ? error.message : String(error)}`
2916
+ );
2917
+ return void 0;
2918
+ }
2919
+ }
2920
+ function isVersionCurrent(current, latest) {
2921
+ return import_semver.default.valid(current) && import_semver.default.valid(latest) ? import_semver.default.gte(current, latest) : current === latest;
2922
+ }
2877
2923
  async function executeUpgrade(targetVersion) {
2878
- const { command: updateCommand, global } = await getUpdateCommandInfo();
2924
+ const totalSteps = targetVersion ? 2 : 3;
2925
+ renderUpgradeProgress(0, totalSteps, "Resolving installer\u2026");
2926
+ const { command: updateCommand, global } = await getUpdateCommandInfo().catch(
2927
+ (error) => {
2928
+ output_manager_default.stopSpinner();
2929
+ throw error;
2930
+ }
2931
+ );
2879
2932
  const [command, ...args] = updateCommand.split(" ");
2880
2933
  const cwd = global ? tmpdir() : process.cwd();
2881
2934
  const versionBefore = pkg_default.version;
2882
- output_manager_default.log(`Upgrading Vercel CLI...`);
2935
+ let resolvedTargetVersion = targetVersion;
2936
+ if (!resolvedTargetVersion) {
2937
+ renderUpgradeProgress(1, totalSteps, "Checking for updates\u2026");
2938
+ resolvedTargetVersion = await getLatestPackageVersion(command, args);
2939
+ }
2940
+ if (resolvedTargetVersion && isVersionCurrent(versionBefore, resolvedTargetVersion)) {
2941
+ renderUpgradeProgress(totalSteps, totalSteps);
2942
+ output_manager_default.stopSpinner();
2943
+ output_manager_default.log(
2944
+ `No upgrade available. Vercel CLI is already up to date (v${versionBefore}).`
2945
+ );
2946
+ return 0;
2947
+ }
2883
2948
  output_manager_default.debug(`Executing: ${updateCommand} (cwd: ${cwd})`);
2949
+ renderUpgradeProgress(targetVersion ? 1 : 2, totalSteps, "Installing\u2026");
2884
2950
  return new Promise((resolve3) => {
2885
2951
  const stdout = [];
2886
2952
  const stderr = [];
@@ -2896,12 +2962,14 @@ async function executeUpgrade(targetVersion) {
2896
2962
  stderr.push(Uint8Array.from(data));
2897
2963
  });
2898
2964
  upgradeProcess.on("error", (err) => {
2965
+ output_manager_default.stopSpinner();
2899
2966
  output_manager_default.error(`Failed to execute upgrade command: ${err.message}`);
2900
2967
  output_manager_default.log(`You can try running the command manually: ${updateCommand}`);
2901
2968
  resolve3(1);
2902
2969
  });
2903
2970
  upgradeProcess.on("close", (code) => {
2904
2971
  if (code !== 0) {
2972
+ output_manager_default.stopSpinner();
2905
2973
  const stdoutStr = Buffer.concat(stdout).toString();
2906
2974
  const stderrStr = Buffer.concat(stderr).toString();
2907
2975
  if (stdoutStr) {
@@ -2917,27 +2985,17 @@ async function executeUpgrade(targetVersion) {
2917
2985
  resolve3(code ?? 1);
2918
2986
  return;
2919
2987
  }
2920
- if (targetVersion) {
2988
+ renderUpgradeProgress(totalSteps, totalSteps);
2989
+ output_manager_default.stopSpinner();
2990
+ if (resolvedTargetVersion) {
2921
2991
  output_manager_default.success(
2922
- `Vercel CLI has been upgraded to v${targetVersion} successfully!`
2992
+ `Vercel CLI has been upgraded to v${resolvedTargetVersion} successfully!`
2923
2993
  );
2924
2994
  resolve3(0);
2925
2995
  return;
2926
2996
  }
2927
- getInstalledVersion().then((versionAfter) => {
2928
- if (versionAfter && versionAfter === versionBefore) {
2929
- output_manager_default.log(
2930
- `No upgrade available. Vercel CLI is already on the latest version (v${versionBefore}).`
2931
- );
2932
- } else if (versionAfter) {
2933
- output_manager_default.success(
2934
- `Vercel CLI has been upgraded to v${versionAfter} successfully!`
2935
- );
2936
- } else {
2937
- output_manager_default.success("Vercel CLI has been upgraded successfully!");
2938
- }
2939
- resolve3(0);
2940
- });
2997
+ output_manager_default.success("Vercel CLI has been upgraded successfully!");
2998
+ resolve3(0);
2941
2999
  });
2942
3000
  });
2943
3001
  }
@@ -6,27 +6,29 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  writeProjectSettings
9
- } from "./chunk-2XEEOHHH.js";
9
+ } from "./chunk-6ABEFMPX.js";
10
+ import {
11
+ autoInstallVercelPlugin
12
+ } from "./chunk-BRQ6PX3U.js";
10
13
  import {
11
14
  stamp_default
12
15
  } from "./chunk-64IF634X.js";
13
16
  import {
14
17
  ensureLink
15
- } from "./chunk-YLGMXYFG.js";
18
+ } from "./chunk-R5MIXAJF.js";
16
19
  import {
17
20
  pullCommand
18
- } from "./chunk-SDZ5ICZL.js";
21
+ } from "./chunk-PSG6ZBGQ.js";
19
22
  import {
20
23
  help
21
24
  } from "./chunk-AWD3IGXU.js";
22
25
  import {
23
26
  VERCEL_DIR,
24
27
  VERCEL_DIR_PROJECT,
25
- autoInstallVercelPlugin,
26
28
  envPullCommandLogic,
27
29
  humanizePath,
28
30
  parseTarget
29
- } from "./chunk-LQR3CHMH.js";
31
+ } from "./chunk-YIAUEFUY.js";
30
32
  import {
31
33
  TelemetryClient
32
34
  } from "./chunk-HIYWSGI7.js";
@@ -7,9 +7,10 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  isJSONObject,
9
9
  printIndications,
10
+ progress,
10
11
  require_dist as require_dist2,
11
12
  sleep
12
- } from "./chunk-OHIZ4SVU.js";
13
+ } from "./chunk-ZR4XADWC.js";
13
14
  import {
14
15
  suggestNextCommands
15
16
  } from "./chunk-LKBI43XK.js";
@@ -19,22 +20,24 @@ import {
19
20
  } from "./chunk-TCF6MGBY.js";
20
21
  import {
21
22
  CommandTimeout
22
- } from "./chunk-O7RJHL34.js";
23
+ } from "./chunk-6R3YPU76.js";
24
+ import {
25
+ showPluginTipIfNeeded
26
+ } from "./chunk-BRQ6PX3U.js";
23
27
  import {
24
28
  stamp_default
25
29
  } from "./chunk-64IF634X.js";
26
30
  import {
27
31
  getScope
28
- } from "./chunk-G3NXHUFT.js";
32
+ } from "./chunk-25XEQWUS.js";
29
33
  import {
30
34
  getProjectByNameOrId,
31
35
  param,
32
36
  printAlignedLabel,
33
37
  require_dist as require_dist3,
34
38
  require_pluralize,
35
- showPluginTipIfNeeded,
36
39
  ua_default
37
- } from "./chunk-LQR3CHMH.js";
40
+ } from "./chunk-YIAUEFUY.js";
38
41
  import {
39
42
  require_lib
40
43
  } from "./chunk-N2T234LO.js";
@@ -1938,19 +1941,6 @@ var import_client = __toESM(require_dist3(), 1);
1938
1941
  var import_error_utils = __toESM(require_dist(), 1);
1939
1942
  var import_bytes = __toESM(require_bytes(), 1);
1940
1943
  var import_chalk2 = __toESM(require_source(), 1);
1941
-
1942
- // src/util/output/progress.ts
1943
- function progress(current, total, opts = {}) {
1944
- const { width = 20, complete = "=", incomplete = "-" } = opts;
1945
- if (total <= 0 || current < 0 || current > total) {
1946
- return null;
1947
- }
1948
- const unit = total / width;
1949
- const pos = Math.floor(current / unit);
1950
- return `${complete.repeat(pos)}${incomplete.repeat(width - pos)}`;
1951
- }
1952
-
1953
- // src/util/deploy/process-deployment.ts
1954
1944
  function printInspectUrl(inspectorUrl) {
1955
1945
  if (!inspectorUrl) {
1956
1946
  return;
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getEnvTargetPlaceholder
9
- } from "./chunk-LQR3CHMH.js";
9
+ } from "./chunk-YIAUEFUY.js";
10
10
  import {
11
11
  projectOption,
12
12
  yesOption
@@ -12,11 +12,11 @@ import {
12
12
  } from "./chunk-LJ5WXXG6.js";
13
13
  import {
14
14
  getScope
15
- } from "./chunk-G3NXHUFT.js";
15
+ } from "./chunk-25XEQWUS.js";
16
16
  import {
17
17
  getLinkedProject,
18
18
  getProjectByNameOrId
19
- } from "./chunk-LQR3CHMH.js";
19
+ } from "./chunk-YIAUEFUY.js";
20
20
  import {
21
21
  buildCommandWithGlobalFlags,
22
22
  outputAgentError
@@ -7,12 +7,12 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  printProjectNotFoundError,
9
9
  setupAndLink
10
- } from "./chunk-372SHB43.js";
10
+ } from "./chunk-IXTKPQYW.js";
11
11
  import {
12
12
  getLinkedProject,
13
13
  param,
14
14
  resolveProjectCwd
15
- } from "./chunk-LQR3CHMH.js";
15
+ } from "./chunk-YIAUEFUY.js";
16
16
  import {
17
17
  buildCommandWithYes,
18
18
  outputActionRequired
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-LJ5WXXG6.js";
11
11
  import {
12
12
  getLinkedProject
13
- } from "./chunk-LQR3CHMH.js";
13
+ } from "./chunk-YIAUEFUY.js";
14
14
  import {
15
15
  buildCommandWithYes,
16
16
  outputAgentError
@@ -143,7 +143,7 @@ var metricsCommand = {
143
143
  },
144
144
  {
145
145
  name: "Function duration by route",
146
- value: `${packageName} metrics vercel.function_invocation.request_duration_ms -a avg --group-by route --since 1h`
146
+ value: `${packageName} metrics vercel.function_invocation.function_duration_ms -a avg --group-by route --since 1h`
147
147
  },
148
148
  {
149
149
  name: "AI Gateway costs by provider",