vercel 54.17.3 → 54.18.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 (61) hide show
  1. package/dist/chunks/{add-PQWZCK7O.js → add-6IFGG2TY.js} +8 -8
  2. package/dist/chunks/chunk-2RVK3DDN.js +224 -0
  3. package/dist/chunks/{chunk-OYQKUG4C.js → chunk-5ACKBNHW.js} +8 -8
  4. package/dist/chunks/{chunk-HCJRHKSM.js → chunk-AQIWBG3Y.js} +8 -8
  5. package/dist/chunks/{chunk-IAOBSXJ5.js → chunk-AWAUGLOM.js} +3 -3
  6. package/dist/chunks/{chunk-2CYJVSAM.js → chunk-B3VMTJM2.js} +1 -1
  7. package/dist/chunks/{chunk-UXP2N2WD.js → chunk-C6H4BP2L.js} +57 -5
  8. package/dist/chunks/{chunk-YI3JV6GM.js → chunk-CT3OCODK.js} +1 -1
  9. package/dist/chunks/{chunk-5FAPBIX6.js → chunk-DZ65TDY4.js} +1 -1
  10. package/dist/chunks/{chunk-NRP6ZKXJ.js → chunk-F57GYOKZ.js} +1 -1
  11. package/dist/chunks/{chunk-G4YL2LRL.js → chunk-FOPFOSQM.js} +2 -2
  12. package/dist/chunks/{chunk-JKIM3UW3.js → chunk-GZ5KF7HK.js} +5 -5
  13. package/dist/chunks/{chunk-ATBH7KGL.js → chunk-HMWVVA4B.js} +1 -1
  14. package/dist/chunks/{chunk-4FG6Q2EM.js → chunk-IBJBNVZV.js} +1 -1
  15. package/dist/chunks/{chunk-QM7D5H2G.js → chunk-JJKW6J63.js} +1 -1
  16. package/dist/chunks/{chunk-MB63D7UN.js → chunk-JWQ37WLT.js} +4 -3
  17. package/dist/chunks/{chunk-QMMMXYOY.js → chunk-KQDEJE65.js} +2 -2
  18. package/dist/chunks/{chunk-6V37RSQB.js → chunk-MUDZFSZC.js} +1 -1
  19. package/dist/chunks/{chunk-OSXRHH6W.js → chunk-UNIIXDM2.js} +20 -20
  20. package/dist/chunks/{chunk-BHMMV3HE.js → chunk-VUVQO3LF.js} +3605 -512
  21. package/dist/chunks/{chunk-FMBDRMTZ.js → chunk-X7KGEDKQ.js} +9 -8
  22. package/dist/chunks/{chunk-P4KQ3FJ4.js → chunk-XQQXV6ZZ.js} +1 -0
  23. package/dist/chunks/{chunk-SBYEIQ32.js → chunk-YHFZKOKK.js} +1 -1
  24. package/dist/chunks/{compile-vercel-config-45XN4U4D.js → compile-vercel-config-CZH5GU3R.js} +4 -4
  25. package/dist/chunks/{delete-RQYOSBNO.js → delete-KZJPJUTT.js} +5 -5
  26. package/dist/chunks/{disable-RRGOZIA7.js → disable-XXKGGPR5.js} +5 -5
  27. package/dist/chunks/{discard-X2NIGII5.js → discard-VFWCCRDF.js} +5 -5
  28. package/dist/chunks/{edit-QV3Y6IUT.js → edit-RY2KAHX2.js} +6 -6
  29. package/dist/chunks/{enable-UQAJJKCG.js → enable-M2PSCPZH.js} +5 -5
  30. package/dist/chunks/{exec-HI4HF4GY.js → exec-CGBHRYWG.js} +14 -9
  31. package/dist/chunks/{export-D4YNS2G5.js → export-U3ZPYBWC.js} +5 -5
  32. package/dist/chunks/fetch-proxy-R3JZNXBZ.js +99 -0
  33. package/dist/chunks/{inspect-FHB3H3NA.js → inspect-HI7DLEJ2.js} +7 -7
  34. package/dist/chunks/{list-QYUCZR26.js → list-KLZIIRGS.js} +12 -12
  35. package/dist/chunks/{list-6RAHTDT2.js → list-TUYF4LRT.js} +6 -6
  36. package/dist/chunks/{ls-GKWWEHQS.js → ls-6PFY2I7Q.js} +8 -8
  37. package/dist/chunks/{publish-UTKKRA4P.js → publish-GXWEL4UA.js} +5 -5
  38. package/dist/chunks/{query-NM7MXRFW.js → query-SLLJ6OJT.js} +11 -11
  39. package/dist/chunks/{reorder-ZLVQQBMG.js → reorder-VRC6BLJM.js} +5 -5
  40. package/dist/chunks/{restore-SDTDA4A6.js → restore-SMXHUGVC.js} +5 -5
  41. package/dist/chunks/{rm-65PQY7XN.js → rm-V7DGLIHX.js} +8 -8
  42. package/dist/chunks/{rule-inspect-JFKSPCDU.js → rule-inspect-7AZGYZDI.js} +8 -8
  43. package/dist/chunks/{rules-6672IXZE.js → rules-MQBE2RMP.js} +6 -6
  44. package/dist/chunks/{schema-DC2LLUHD.js → schema-EMHEFUMV.js} +6 -6
  45. package/dist/chunks/{update-7VFELUTD.js → update-GSQ26HZG.js} +8 -8
  46. package/dist/commands/build/index.js +28 -18
  47. package/dist/commands/deploy/index.js +21 -21
  48. package/dist/commands/dev/index.js +46 -38
  49. package/dist/commands/env/index.js +15 -15
  50. package/dist/commands/link/index.js +13 -13
  51. package/dist/commands/list/index.js +12 -12
  52. package/dist/commands-bulk.js +227 -84
  53. package/dist/fetch-dist-tags.cjs +60 -0
  54. package/dist/get-latest-worker.cjs +6 -56
  55. package/dist/help.js +1 -1
  56. package/dist/index.js +200 -61
  57. package/dist/version.mjs +1 -1
  58. package/package.json +17 -19
  59. package/dist/chunks/chunk-N2T234LO.js +0 -3144
  60. package/dist/chunks/{chunk-3NR6OYDV.js → chunk-LWJWW6ZY.js} +3 -3
  61. package/dist/chunks/{chunk-D7MGZH35.js → chunk-U5FVI3MF.js} +3 -3
@@ -0,0 +1,60 @@
1
+ const https = require('https');
2
+
3
+ /**
4
+ * Fetches the dist tags from npm for a given package.
5
+ *
6
+ * This is a shared CJS module used by both:
7
+ * - `get-latest-worker.cjs` (background cache refresh, spawned process)
8
+ * - `get-latest-version/index.ts` (fresh pre-prompt lookup, main process)
9
+ *
10
+ * @param {string} name The package name
11
+ * @param {{ timeout?: number }} [options]
12
+ * @param {number} [options.timeout] Maximum time to wait, in milliseconds
13
+ * @returns {Promise<Record<string, string> | undefined>} A map of dist tags
14
+ * to versions, or `undefined` on any error/timeout.
15
+ */
16
+ function fetchDistTags(name, options) {
17
+ const timeout = (options && options.timeout) || 3000;
18
+ const agent = new https.Agent({
19
+ keepAlive: true,
20
+ maxSockets: 15, // See: `npm config get maxsockets`
21
+ });
22
+ const headers = {
23
+ accept:
24
+ 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
25
+ };
26
+ const url = `https://registry.npmjs.org/-/package/${name}/dist-tags`;
27
+
28
+ return new Promise(resolve => {
29
+ const timer = setTimeout(() => {
30
+ req.destroy();
31
+ resolve(undefined);
32
+ }, timeout);
33
+
34
+ const req = https.get(url, { agent, headers }, res => {
35
+ let buf = '';
36
+ res.on('data', chunk => {
37
+ buf += chunk;
38
+ });
39
+ res.on('end', () => {
40
+ clearTimeout(timer);
41
+ try {
42
+ if (res.statusCode && res.statusCode >= 400) {
43
+ resolve(undefined);
44
+ return;
45
+ }
46
+ resolve(JSON.parse(buf));
47
+ } catch {
48
+ resolve(undefined);
49
+ }
50
+ });
51
+ });
52
+
53
+ req.on('error', () => {
54
+ clearTimeout(timer);
55
+ resolve(undefined);
56
+ });
57
+ });
58
+ }
59
+
60
+ module.exports = { fetchDistTags };
@@ -14,11 +14,11 @@
14
14
  * never be available.
15
15
  */
16
16
 
17
- const https = require('https');
18
17
  const { mkdirSync, writeFileSync } = require('fs');
19
18
  const { access, mkdir, readFile, unlink, writeFile } = require('fs/promises');
20
19
  const path = require('path');
21
20
  const { format, inspect } = require('util');
21
+ const { fetchDistTags } = require('./fetch-dist-tags.cjs');
22
22
 
23
23
  /**
24
24
  * An simple output helper which accumulates error and debug log messages in
@@ -118,7 +118,11 @@ process.once('message', async msg => {
118
118
  output.debug(`Initializing lock file with pid ${process.pid}`);
119
119
  await writeFile(lockFile, String(process.pid), 'utf-8');
120
120
 
121
- const tags = await fetchDistTags(name);
121
+ output.debug(`Fetching dist-tags for ${name}`);
122
+ const tags = await fetchDistTags(name, { timeout: 8000 });
123
+ if (!tags) {
124
+ throw new Error('Failed to fetch dist-tags from npm');
125
+ }
122
126
  const version = tags[distTag];
123
127
  const expireAt = Date.now() + updateCheckInterval;
124
128
  const notifyAt = await getNotifyAt(cacheFile, version);
@@ -216,57 +220,3 @@ async function getNotifyAt(cacheFile, version) {
216
220
  }
217
221
  }
218
222
  }
219
-
220
- /**
221
- * Fetches the dist tags from npm for a given package.
222
- *
223
- * @param {string} name The package name
224
- * @returns A map of dist tags to versions
225
- */
226
- async function fetchDistTags(name) {
227
- // fetch the latest version from npm
228
- const agent = new https.Agent({
229
- keepAlive: true,
230
- maxSockets: 15, // See: `npm config get maxsockets`
231
- });
232
- const headers = {
233
- accept:
234
- 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
235
- };
236
- const url = `https://registry.npmjs.org/-/package/${name}/dist-tags`;
237
- output.debug(`Fetching ${url}`);
238
-
239
- return new Promise((resolve, reject) => {
240
- const req = https.get(
241
- url,
242
- {
243
- agent,
244
- headers,
245
- },
246
- res => {
247
- let buf = '';
248
- res.on('data', chunk => {
249
- buf += chunk;
250
- });
251
- res.on('end', () => {
252
- try {
253
- if (res.statusCode && res.statusCode >= 400) {
254
- return reject(
255
- new Error(
256
- `Fetch dist-tags failed ${res.statusCode} ${res.statusMessage}`
257
- )
258
- );
259
- }
260
-
261
- resolve(JSON.parse(buf));
262
- } catch (err) {
263
- reject(err);
264
- }
265
- });
266
- }
267
- );
268
-
269
- req.on('error', reject);
270
- req.end();
271
- });
272
- }
package/dist/help.js CHANGED
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  help
9
- } from "./chunks/chunk-P4KQ3FJ4.js";
9
+ } from "./chunks/chunk-XQQXV6ZZ.js";
10
10
  import "./chunks/chunk-S7KYDPEM.js";
11
11
  import "./chunks/chunk-TZ2YI2VH.js";
12
12
  export {
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  help
9
- } from "./chunks/chunk-P4KQ3FJ4.js";
9
+ } from "./chunks/chunk-XQQXV6ZZ.js";
10
10
  import {
11
11
  box,
12
12
  canAutoUpdate,
@@ -18,10 +18,10 @@ import {
18
18
  require_ci_info,
19
19
  setAutoUpdate,
20
20
  tryOpenApiFallback
21
- } from "./chunks/chunk-OYQKUG4C.js";
21
+ } from "./chunks/chunk-5ACKBNHW.js";
22
22
  import {
23
23
  getUpdateCommand
24
- } from "./chunks/chunk-SBYEIQ32.js";
24
+ } from "./chunks/chunk-YHFZKOKK.js";
25
25
  import {
26
26
  Client,
27
27
  getAuthConfigFilePath,
@@ -30,30 +30,31 @@ import {
30
30
  readAuthConfigFile,
31
31
  readConfigFile,
32
32
  writeToConfigFile
33
- } from "./chunks/chunk-HCJRHKSM.js";
33
+ } from "./chunks/chunk-AQIWBG3Y.js";
34
34
  import {
35
35
  highlight
36
36
  } from "./chunks/chunk-V5P25P7F.js";
37
37
  import {
38
38
  commandNames,
39
39
  commands
40
- } from "./chunks/chunk-UXP2N2WD.js";
40
+ } from "./chunks/chunk-C6H4BP2L.js";
41
41
  import "./chunks/chunk-LCNEKTLC.js";
42
42
  import "./chunks/chunk-IB56QKCM.js";
43
+ import "./chunks/chunk-56AJHIQC.js";
43
44
  import "./chunks/chunk-DPS62LHL.js";
44
45
  import "./chunks/chunk-SGPBULVT.js";
45
46
  import "./chunks/chunk-VKRW77HH.js";
46
- import "./chunks/chunk-56AJHIQC.js";
47
47
  import "./chunks/chunk-IJJOI63T.js";
48
48
  import {
49
49
  require_semver
50
50
  } from "./chunks/chunk-IB5L4LKZ.js";
51
- import "./chunks/chunk-2CYJVSAM.js";
52
- import "./chunks/chunk-ATBH7KGL.js";
51
+ import "./chunks/chunk-B3VMTJM2.js";
52
+ import "./chunks/chunk-HMWVVA4B.js";
53
53
  import {
54
54
  getScope
55
- } from "./chunks/chunk-6V37RSQB.js";
56
- import "./chunks/chunk-3NR6OYDV.js";
55
+ } from "./chunks/chunk-MUDZFSZC.js";
56
+ import "./chunks/chunk-LWJWW6ZY.js";
57
+ import "./chunks/chunk-LYCSVJIX.js";
57
58
  import {
58
59
  getLinkFromDir,
59
60
  getTeams,
@@ -64,16 +65,13 @@ import {
64
65
  readJSONFile,
65
66
  require_dist as require_dist2,
66
67
  require_lib
67
- } from "./chunks/chunk-BHMMV3HE.js";
68
+ } from "./chunks/chunk-VUVQO3LF.js";
69
+ import "./chunks/chunk-X5UROEGN.js";
68
70
  import {
69
71
  TelemetryClient,
70
72
  TelemetryEventStore,
71
73
  isNativeBinaryInstall
72
74
  } from "./chunks/chunk-Q77ALSXR.js";
73
- import "./chunks/chunk-X5UROEGN.js";
74
- import "./chunks/chunk-N2T234LO.js";
75
- import "./chunks/chunk-GGP5R3FU.js";
76
- import "./chunks/chunk-LYCSVJIX.js";
77
75
  import {
78
76
  getArgs,
79
77
  parseArguments,
@@ -92,10 +90,14 @@ import {
92
90
  import {
93
91
  pkg_default
94
92
  } from "./chunks/chunk-P4QNYOFB.js";
93
+ import {
94
+ setFetchDispatcher
95
+ } from "./chunks/chunk-2RVK3DDN.js";
95
96
  import {
96
97
  output_manager_default,
97
98
  require_dist
98
99
  } from "./chunks/chunk-Z5SBJH6L.js";
100
+ import "./chunks/chunk-GGP5R3FU.js";
99
101
  import {
100
102
  require_source
101
103
  } from "./chunks/chunk-S7KYDPEM.js";
@@ -394,10 +396,60 @@ var require_xdg_app_paths = __commonJS({
394
396
  }
395
397
  });
396
398
 
399
+ // src/util/get-latest-version/fetch-dist-tags.cjs
400
+ var require_fetch_dist_tags = __commonJS({
401
+ "src/util/get-latest-version/fetch-dist-tags.cjs"(exports, module) {
402
+ "use strict";
403
+ var https = __require("https");
404
+ function fetchDistTags2(name, options) {
405
+ const timeout = options && options.timeout || 3e3;
406
+ const agent = new https.Agent({
407
+ keepAlive: true,
408
+ maxSockets: 15
409
+ // See: `npm config get maxsockets`
410
+ });
411
+ const headers = {
412
+ accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"
413
+ };
414
+ const url = `https://registry.npmjs.org/-/package/${name}/dist-tags`;
415
+ return new Promise((resolve) => {
416
+ const timer = setTimeout(() => {
417
+ req.destroy();
418
+ resolve(void 0);
419
+ }, timeout);
420
+ const req = https.get(url, { agent, headers }, (res) => {
421
+ let buf = "";
422
+ res.on("data", (chunk) => {
423
+ buf += chunk;
424
+ });
425
+ res.on("end", () => {
426
+ clearTimeout(timer);
427
+ try {
428
+ if (res.statusCode && res.statusCode >= 400) {
429
+ resolve(void 0);
430
+ return;
431
+ }
432
+ resolve(JSON.parse(buf));
433
+ } catch {
434
+ resolve(void 0);
435
+ }
436
+ });
437
+ });
438
+ req.on("error", () => {
439
+ clearTimeout(timer);
440
+ resolve(void 0);
441
+ });
442
+ });
443
+ }
444
+ module.exports = { fetchDistTags: fetchDistTags2 };
445
+ }
446
+ });
447
+
397
448
  // src/index.ts
398
449
  var import_error_utils3 = __toESM(require_dist(), 1);
399
450
  var import_fs_extra2 = __toESM(require_lib(), 1);
400
451
  var import_chalk = __toESM(require_source(), 1);
452
+ var import_semver2 = __toESM(require_semver(), 1);
401
453
  var import_epipebomb = __toESM(require_epipebomb(), 1);
402
454
  import { join as join2 } from "path";
403
455
  import { existsSync as existsSync2 } from "fs";
@@ -408,14 +460,16 @@ var import_xdg_app_paths = __toESM(require_xdg_app_paths(), 1);
408
460
  var import_fs_extra = __toESM(require_lib(), 1);
409
461
  import { dirname, parse as parsePath, resolve as resolvePath } from "path";
410
462
  import { spawn } from "child_process";
463
+ var import_fetch_dist_tags = __toESM(require_fetch_dist_tags(), 1);
411
464
  function getLatestVersion({
412
465
  cacheDir = (0, import_xdg_app_paths.default)("com.vercel.cli").cache(),
413
466
  distTag = "latest",
414
467
  notifyInterval = 1e3 * 60 * 60 * 24 * 3,
415
468
  // 3 days
416
469
  pkg,
417
- updateCheckInterval = 1e3 * 60 * 60 * 24
470
+ updateCheckInterval = 1e3 * 60 * 60 * 24,
418
471
  // 1 day
472
+ consumeNotification = true
419
473
  }) {
420
474
  if (!pkg || typeof pkg !== "object" || !pkg.name || typeof pkg.name !== "string") {
421
475
  throw new TypeError("Expected package to be an object with a package name");
@@ -448,8 +502,10 @@ function getLatestVersion({
448
502
  updateAvailable = import_semver.default.lt(pkg.version, cache.version);
449
503
  }
450
504
  if (shouldNotify && updateAvailable) {
451
- cache.notifyAt = Date.now() + notifyInterval;
452
- (0, import_fs_extra.outputJSONSync)(cacheFile, cache);
505
+ if (consumeNotification) {
506
+ cache.notifyAt = Date.now() + notifyInterval;
507
+ (0, import_fs_extra.outputJSONSync)(cacheFile, cache);
508
+ }
453
509
  return cache.version;
454
510
  }
455
511
  }
@@ -490,6 +546,39 @@ function spawnWorker(payload) {
490
546
  worker.unref();
491
547
  });
492
548
  }
549
+ async function fetchLatestVersion({
550
+ name,
551
+ distTag = "latest",
552
+ timeout = 3e3
553
+ }) {
554
+ const tags = await (0, import_fetch_dist_tags.fetchDistTags)(name, { timeout });
555
+ return tags?.[distTag];
556
+ }
557
+ function updateLatestVersionCache({
558
+ cacheDir = (0, import_xdg_app_paths.default)("com.vercel.cli").cache(),
559
+ distTag = "latest",
560
+ name,
561
+ version,
562
+ updateCheckInterval = 1e3 * 60 * 60 * 24
563
+ // 1 day
564
+ }) {
565
+ const cacheFile = resolvePath(
566
+ cacheDir,
567
+ "package-updates",
568
+ `${name}-${distTag}.json`
569
+ );
570
+ let notifyAt;
571
+ try {
572
+ const existing = (0, import_fs_extra.readJSONSync)(cacheFile);
573
+ notifyAt = existing?.notifyAt;
574
+ } catch {
575
+ }
576
+ (0, import_fs_extra.outputJSONSync)(cacheFile, {
577
+ expireAt: Date.now() + updateCheckInterval,
578
+ notifyAt,
579
+ version
580
+ });
581
+ }
493
582
 
494
583
  // src/index.ts
495
584
  import { URL } from "url";
@@ -1634,7 +1723,12 @@ var main = async () => {
1634
1723
  output_manager_default.debug(
1635
1724
  `Agent/TTY/nonInteractive: isAgent=${isAgent} agentName=${detectedAgent?.name ?? "none"} stdin.isTTY=${String(process.stdin?.isTTY)} --non-interactive=${nonInteractiveFlag} explicitFalse=${explicitNonInteractiveFalse} => nonInteractive=${nonInteractive}`
1636
1725
  );
1637
- const agent = hasProxyConfig() ? new (await import("proxy-agent")).ProxyAgent({ keepAlive: true }) : new HttpsAgent({ keepAlive: true });
1726
+ const proxyConfigured = hasProxyConfig();
1727
+ const agent = proxyConfigured ? new (await import("proxy-agent")).ProxyAgent({ keepAlive: true }) : new HttpsAgent({ keepAlive: true });
1728
+ if (proxyConfigured) {
1729
+ const { EnvProxyDispatcher } = await import("./chunks/fetch-proxy-R3JZNXBZ.js");
1730
+ setFetchDispatcher(new EnvProxyDispatcher());
1731
+ }
1638
1732
  client = new Client({
1639
1733
  agent,
1640
1734
  apiUrl,
@@ -1878,7 +1972,7 @@ var main = async () => {
1878
1972
  if (!targetCommand) {
1879
1973
  targetCommand = parsedArgs.args[2];
1880
1974
  try {
1881
- const { execExtension } = await import("./chunks/exec-HI4HF4GY.js");
1975
+ const { execExtension } = await import("./chunks/exec-CGBHRYWG.js");
1882
1976
  exitCode = await execExtension(
1883
1977
  client,
1884
1978
  targetCommand,
@@ -2253,28 +2347,74 @@ var main = async () => {
2253
2347
  }
2254
2348
  return exitCode;
2255
2349
  };
2350
+ var cachedLatest;
2351
+ var freshLookupPromise;
2352
+ if (SHOULD_CHECK_FOR_UPDATES && !isNativeBinaryInstall()) {
2353
+ cachedLatest = getLatestVersion({ pkg: pkg_default, consumeNotification: false });
2354
+ if (cachedLatest) {
2355
+ output_manager_default.debug("Update may be available, fetching fresh version...");
2356
+ freshLookupPromise = fetchLatestVersion({
2357
+ name: pkg_default.name,
2358
+ timeout: 3e3
2359
+ }).catch(() => void 0);
2360
+ }
2361
+ }
2362
+ async function promptAndUpgrade(client2, targetVersion) {
2363
+ try {
2364
+ const shouldUpgrade = await client2.input.confirm(
2365
+ "Would you like to upgrade now?",
2366
+ true
2367
+ );
2368
+ if (!shouldUpgrade)
2369
+ return;
2370
+ const upgradeExitCode = await executeUpgrade(targetVersion);
2371
+ if (upgradeExitCode === 0 && !hasAutoUpdatePreference(client2.config)) {
2372
+ const enableAutoUpdates = await client2.input.confirm(
2373
+ "Enable automatic CLI updates for future releases?",
2374
+ false
2375
+ );
2376
+ setAutoUpdate(client2, enableAutoUpdates);
2377
+ }
2378
+ return upgradeExitCode;
2379
+ } catch (err) {
2380
+ if (err instanceof Error && err.message.includes("User force closed the prompt")) {
2381
+ return;
2382
+ }
2383
+ throw err;
2384
+ }
2385
+ }
2256
2386
  main().then(async (exitCode) => {
2257
- if (SHOULD_CHECK_FOR_UPDATES && !isNativeBinaryInstall()) {
2258
- const latest = getLatestVersion({
2259
- pkg: pkg_default
2260
- });
2387
+ if (cachedLatest) {
2388
+ const originalExitCode = typeof exitCode === "number" ? exitCode : 0;
2389
+ const fresh = freshLookupPromise ? await freshLookupPromise : void 0;
2390
+ output_manager_default.debug(`Fresh lookup result: ${fresh ?? "failed"}`);
2391
+ let latest;
2392
+ let userUpToDate = false;
2393
+ if (fresh) {
2394
+ updateLatestVersionCache({ name: pkg_default.name, version: fresh });
2395
+ if (import_semver2.default.lt(pkg_default.version, fresh)) {
2396
+ latest = fresh;
2397
+ } else {
2398
+ userUpToDate = true;
2399
+ }
2400
+ }
2401
+ getLatestVersion({ pkg: pkg_default });
2402
+ if (!userUpToDate && await canAutoUpdate(
2403
+ client,
2404
+ originalExitCode,
2405
+ resolvedCommandForUpdate
2406
+ )) {
2407
+ const upgradeExitCode = await executeUpgrade();
2408
+ process.exitCode = originalExitCode;
2409
+ if (upgradeExitCode !== 0) {
2410
+ output_manager_default.log(
2411
+ `Automatic update failed. Continuing with original exit code ${originalExitCode}.`
2412
+ );
2413
+ }
2414
+ return;
2415
+ }
2261
2416
  if (latest) {
2262
2417
  const changelog = `https://github.com/vercel/vercel/releases/tag/vercel%40${latest}`;
2263
- const originalExitCode = typeof exitCode === "number" ? exitCode : 0;
2264
- if (await canAutoUpdate(
2265
- client,
2266
- originalExitCode,
2267
- resolvedCommandForUpdate
2268
- )) {
2269
- const upgradeExitCode = await executeUpgrade(latest);
2270
- process.exitCode = originalExitCode;
2271
- if (upgradeExitCode !== 0) {
2272
- output_manager_default.log(
2273
- `Automatic update failed. Continuing with original exit code ${originalExitCode}.`
2274
- );
2275
- }
2276
- return;
2277
- }
2278
2418
  if (isTTY) {
2279
2419
  const errorMsg = exitCode && exitCode !== 2 ? import_chalk.default.magenta(
2280
2420
  ` The latest update ${import_chalk.default.italic(
@@ -2292,28 +2432,10 @@ Update available for Vercel CLI (${import_chalk.default.gray(
2292
2432
  `Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
2293
2433
  `
2294
2434
  );
2295
- try {
2296
- const shouldUpgrade = await client.input.confirm(
2297
- "Would you like to upgrade now?",
2298
- true
2299
- );
2300
- if (shouldUpgrade) {
2301
- const upgradeExitCode = await executeUpgrade(latest);
2302
- if (upgradeExitCode === 0 && !hasAutoUpdatePreference(client.config)) {
2303
- const enableAutoUpdates = await client.input.confirm(
2304
- "Enable automatic CLI updates for future releases?",
2305
- false
2306
- );
2307
- setAutoUpdate(client, enableAutoUpdates);
2308
- }
2309
- process.exitCode = upgradeExitCode;
2310
- return;
2311
- }
2312
- } catch (err) {
2313
- if (err instanceof Error && err.message.includes("User force closed the prompt")) {
2314
- } else {
2315
- throw err;
2316
- }
2435
+ const upgradeExitCode = await promptAndUpgrade(client, latest);
2436
+ if (upgradeExitCode !== void 0) {
2437
+ process.exitCode = upgradeExitCode;
2438
+ return;
2317
2439
  }
2318
2440
  } else {
2319
2441
  const errorMsg = exitCode && exitCode !== 2 ? import_chalk.default.magenta(
@@ -2334,6 +2456,23 @@ Run ${import_chalk.default.cyan(cmd(await getUpdateCommand()))} to update.${erro
2334
2456
  );
2335
2457
  output_manager_default.print("\n");
2336
2458
  }
2459
+ } else if (!fresh) {
2460
+ if (isTTY) {
2461
+ output_manager_default.print("\nA newer version of Vercel CLI may be available.\n");
2462
+ const upgradeExitCode = await promptAndUpgrade(client);
2463
+ if (upgradeExitCode !== void 0) {
2464
+ process.exitCode = upgradeExitCode;
2465
+ return;
2466
+ }
2467
+ } else {
2468
+ output_manager_default.print(
2469
+ box(
2470
+ `A newer version of Vercel CLI may be available.
2471
+ Run ${import_chalk.default.cyan(cmd(await getUpdateCommand()))} to update.`
2472
+ )
2473
+ );
2474
+ output_manager_default.print("\n");
2475
+ }
2337
2476
  }
2338
2477
  }
2339
2478
  process.exitCode = exitCode;
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "54.17.3";
1
+ export const version = "54.18.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "54.17.3",
3
+ "version": "54.18.0",
4
4
  "type": "module",
5
5
  "preferGlobal": true,
6
6
  "license": "Apache-2.0",
@@ -27,36 +27,36 @@
27
27
  "@vercel/prepare-flags-definitions": "0.3.0",
28
28
  "chokidar": "4.0.0",
29
29
  "esbuild": "0.27.0",
30
- "form-data": "^4.0.0",
31
30
  "jose": "5.9.6",
32
31
  "luxon": "^3.4.0",
33
32
  "proxy-agent": "6.4.0",
34
33
  "sandbox": "3.1.2",
35
34
  "smol-toml": "1.5.2",
35
+ "undici": "5.29.0",
36
36
  "zod": "4.1.11",
37
- "@vercel/backends": "0.8.18",
37
+ "@vercel/backends": "0.8.19",
38
38
  "@vercel/build-utils": "13.32.1",
39
39
  "@vercel/cli-auth": "0.3.0",
40
- "@vercel/cli-config": "0.2.0",
41
- "@vercel/container": "0.0.2",
40
+ "@vercel/container": "0.0.3",
42
41
  "@vercel/detect-agent": "1.2.3",
42
+ "@vercel/cli-config": "0.2.0",
43
43
  "@vercel/elysia": "0.1.97",
44
- "@vercel/express": "0.1.109",
44
+ "@vercel/express": "0.1.110",
45
+ "@vercel/go": "3.10.2",
45
46
  "@vercel/fastify": "0.1.100",
46
- "@vercel/go": "3.10.1",
47
47
  "@vercel/h3": "0.1.106",
48
- "@vercel/hono": "0.2.100",
48
+ "@vercel/koa": "0.1.80",
49
+ "@vercel/nestjs": "0.2.101",
49
50
  "@vercel/hydrogen": "1.4.0",
51
+ "@vercel/hono": "0.2.100",
50
52
  "@vercel/next": "4.20.1",
53
+ "@vercel/python": "6.47.3",
51
54
  "@vercel/node": "5.8.21",
52
- "@vercel/nestjs": "0.2.101",
53
- "@vercel/python": "6.47.2",
54
55
  "@vercel/redwood": "2.5.0",
55
- "@vercel/koa": "0.1.80",
56
- "@vercel/ruby": "2.5.1",
57
56
  "@vercel/remix-builder": "5.9.1",
58
- "@vercel/static-build": "2.11.3",
59
- "@vercel/rust": "1.3.0"
57
+ "@vercel/ruby": "2.5.1",
58
+ "@vercel/rust": "1.3.0",
59
+ "@vercel/static-build": "2.11.3"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@edge-runtime/node-utils": "2.3.0",
@@ -88,7 +88,6 @@
88
88
  "@types/mock-fs": "4.13.4",
89
89
  "@types/ms": "0.7.30",
90
90
  "@types/node": "20.11.0",
91
- "@types/node-fetch": "2.5.10",
92
91
  "@types/npm-package-arg": "6.1.0",
93
92
  "@types/pluralize": "0.0.29",
94
93
  "@types/qs": "6.9.7",
@@ -149,7 +148,6 @@
149
148
  "minimatch": "3.1.2",
150
149
  "mock-fs": "5.5.0",
151
150
  "ms": "2.1.2",
152
- "node-fetch": "2.6.7",
153
151
  "npm-package-arg": "6.1.0",
154
152
  "open": "8.4.0",
155
153
  "ora": "3.4.0",
@@ -181,11 +179,11 @@
181
179
  "yauzl-promise": "2.1.3",
182
180
  "@vercel-internals/constants": "1.0.4",
183
181
  "@vercel-internals/get-package-json": "1.0.0",
184
- "@vercel-internals/types": "3.0.6",
185
182
  "@vercel/client": "17.6.2",
186
- "@vercel/frameworks": "3.30.0",
187
- "@vercel/fs-detectors": "6.10.3",
183
+ "@vercel-internals/types": "3.0.6",
188
184
  "@vercel/error-utils": "2.2.0",
185
+ "@vercel/frameworks": "3.30.1",
186
+ "@vercel/fs-detectors": "6.11.0",
189
187
  "@vercel/routing-utils": "6.4.0"
190
188
  },
191
189
  "scripts": {