@depup/vercel 58.4.4-depup.0 → 59.1.3-depup.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 (119) hide show
  1. package/README.md +8 -9
  2. package/changes.json +7 -11
  3. package/dist/chunks/{add-245XOFJO.js → add-CUGPQYFW.js} +11 -11
  4. package/dist/chunks/{add-XH24V5VU.js → add-PP3PJPJV.js} +8 -8
  5. package/dist/chunks/{add-P7WBQMBW.js → add-PRG4KKYH.js} +45 -12
  6. package/dist/chunks/{build-M7NJYJPE.js → build-T22GMLY6.js} +11 -11
  7. package/dist/chunks/{chunk-AW5YINX6.js → chunk-2MF3ZAVW.js} +48 -6
  8. package/dist/chunks/{chunk-WR7JTCGL.js → chunk-3BU2UCGV.js} +1 -1
  9. package/dist/chunks/{chunk-MAHXF73X.js → chunk-3L2YLLHC.js} +1 -1
  10. package/dist/chunks/{chunk-ZGBBPJ6B.js → chunk-43DD2KNM.js} +254 -1539
  11. package/dist/chunks/{chunk-M5NOLAJ4.js → chunk-4HI7G6KG.js} +1 -1
  12. package/dist/chunks/chunk-4JKZ7SRX.js +559 -0
  13. package/dist/chunks/{chunk-Y5GTPWXB.js → chunk-57G6HBJ4.js} +3 -3
  14. package/dist/chunks/{chunk-2LBVX2H3.js → chunk-5DVMXOFT.js} +3 -3
  15. package/dist/chunks/{chunk-YCPUAG77.js → chunk-7NQLRE5V.js} +1 -1
  16. package/dist/chunks/{chunk-JLWQWYKO.js → chunk-BBSS3XIW.js} +2 -4
  17. package/dist/chunks/{chunk-IEDUCUDV.js → chunk-BCZFZETZ.js} +92 -46
  18. package/dist/chunks/{chunk-SJYAUEZR.js → chunk-DAWJOQF6.js} +52 -79
  19. package/dist/chunks/chunk-DEB45ND4.js +61 -0
  20. package/dist/chunks/{chunk-AQDWMAPM.js → chunk-DOMLWKKZ.js} +795 -516
  21. package/dist/chunks/{chunk-EBLH23AQ.js → chunk-F7OXZLY2.js} +6 -9
  22. package/dist/chunks/{chunk-J6LK45HT.js → chunk-GFCTRJI5.js} +16 -2
  23. package/dist/chunks/{chunk-V5P25P7F.js → chunk-GGPE5377.js} +5 -12
  24. package/dist/chunks/{chunk-4LDQIDRM.js → chunk-GMWRTZVZ.js} +9 -1
  25. package/dist/chunks/{chunk-NJUPUGOE.js → chunk-HT2XWSAJ.js} +1 -1
  26. package/dist/chunks/chunk-IKKUCZE7.js +96 -0
  27. package/dist/chunks/chunk-JKQWQA2T.js +39 -0
  28. package/dist/chunks/{chunk-XIG4GH62.js → chunk-JYEO6OJS.js} +188 -102
  29. package/dist/chunks/{chunk-HSYF5SI3.js → chunk-KTLFN5FV.js} +1 -1
  30. package/dist/chunks/{chunk-XPKWKPWA.js → chunk-KXDWXXJH.js} +27 -1
  31. package/dist/chunks/chunk-LNVZ3T7X.js +2908 -0
  32. package/dist/chunks/{chunk-NJ6QXKQD.js → chunk-M34ZRNDQ.js} +1 -1
  33. package/dist/chunks/chunk-MXLA3VQS.js +20 -0
  34. package/dist/chunks/{chunk-2SFMOCWR.js → chunk-PD7ZUXE7.js} +1 -1
  35. package/dist/chunks/chunk-QCVKGY2A.js +151 -0
  36. package/dist/chunks/{chunk-XE5VSQ25.js → chunk-QD5NX7RG.js} +1 -1
  37. package/dist/chunks/{chunk-4N7XLXM2.js → chunk-QQ6PH4RY.js} +1 -0
  38. package/dist/chunks/{chunk-A5KP5HAI.js → chunk-RIB4S2IB.js} +10 -1
  39. package/dist/chunks/{chunk-ZX2FSPWV.js → chunk-SJQEGGH7.js} +4 -4
  40. package/dist/chunks/{chunk-3QAUXPIR.js → chunk-SOKQBFF7.js} +1128 -162
  41. package/dist/chunks/chunk-SQGMTRZD.js +1385 -0
  42. package/dist/chunks/{chunk-TJJ562C5.js → chunk-TJLBCLEX.js} +15 -0
  43. package/dist/chunks/{chunk-62MH5KPX.js → chunk-TM3F7PLR.js} +7 -7
  44. package/dist/chunks/{chunk-2WILSD7J.js → chunk-TNKRSTMB.js} +1 -1
  45. package/dist/chunks/{chunk-4UYKSYKQ.js → chunk-UMA66MKW.js} +66 -2
  46. package/dist/chunks/{chunk-KT4XXKJK.js → chunk-VAFU7DXZ.js} +195 -3
  47. package/dist/chunks/{chunk-RQ7H43CJ.js → chunk-VDJN4WKH.js} +1 -1
  48. package/dist/chunks/{chunk-4CCY5OPH.js → chunk-VE545BR3.js} +5039 -3119
  49. package/dist/chunks/{chunk-B3JTF4CF.js → chunk-WC7IINFV.js} +10 -1
  50. package/dist/chunks/{chunk-YDUINEII.js → chunk-XZLI27ES.js} +7 -5
  51. package/dist/chunks/{chunk-4BUPRO5B.js → chunk-ZUVJISHS.js} +3 -3
  52. package/dist/chunks/{clear-HWIKQ4NC.js → clear-Z4IKUIN7.js} +8 -8
  53. package/dist/chunks/{compile-vercel-config-U5NRIMZ2.js → compile-vercel-config-PSVXFAZW.js} +4 -4
  54. package/dist/chunks/config-M5GMZ2X5.js +159 -0
  55. package/dist/chunks/{constants-3FSSR6E7.js → constants-YMCRE6IG.js} +5 -3
  56. package/dist/chunks/{delete-NVMGVD5Z.js → delete-5GRRDJSF.js} +5 -5
  57. package/dist/chunks/{delete-FZCOUFGN.js → delete-P4XIBY7T.js} +8 -8
  58. package/dist/chunks/{disable-ERM2BWEQ.js → disable-NT5NYVO7.js} +5 -5
  59. package/dist/chunks/{discard-KM5OLEN4.js → discard-TBNIEAJZ.js} +5 -5
  60. package/dist/chunks/{edit-HT3UTATZ.js → edit-DJ6MT6HA.js} +6 -6
  61. package/dist/chunks/{edit-TOSB2EMI.js → edit-UF3D2CCH.js} +9 -9
  62. package/dist/chunks/{enable-BQL6AOQV.js → enable-JTQBQMBO.js} +5 -5
  63. package/dist/chunks/{export-UOWQHOG3.js → export-OKMRGRVM.js} +5 -5
  64. package/dist/chunks/{image-F5SC6Q7Y.js → image-ARUJH4H5.js} +4 -4
  65. package/dist/chunks/import-builders-3NTMZM64.js +30 -0
  66. package/dist/chunks/{inspect-PZJM2CWT.js → inspect-5NETOGAI.js} +11 -12
  67. package/dist/chunks/{inspect-GKJ6T5H4.js → inspect-CHFKZKKP.js} +8 -8
  68. package/dist/chunks/{inspect-LGKOLH2O.js → inspect-FXZTQY62.js} +9 -9
  69. package/dist/chunks/{inspect-35FU5R62.js → inspect-PTXIBSYW.js} +11 -11
  70. package/dist/chunks/{inspect-5J5GSTOB.js → inspect-UXP2HDES.js} +8 -8
  71. package/dist/chunks/{list-2IIE7CAP.js → list-2WMIVJ2R.js} +31 -15
  72. package/dist/chunks/{list-ITFJYYQ2.js → list-ADI55WKW.js} +13 -14
  73. package/dist/chunks/{list-KZETH3ZE.js → list-DYCZA2VX.js} +6 -6
  74. package/dist/chunks/{login-BQPJCJEZ.js → login-YCSIQG6B.js} +11 -11
  75. package/dist/chunks/{ls-UXUEP54B.js → ls-2TKUIUK4.js} +14 -15
  76. package/dist/chunks/{ls-YSFWSM6J.js → ls-EOMIQLRH.js} +14 -15
  77. package/dist/chunks/{ls-7GHDK4MD.js → ls-PQFDGOJL.js} +17 -18
  78. package/dist/chunks/{ls-DL2LA35C.js → ls-RZVTIP5U.js} +14 -15
  79. package/dist/chunks/{ls-ZZFLH7PK.js → ls-VIOMDUGW.js} +17 -18
  80. package/dist/chunks/{open-ADNJQN5E.js → open-JYPWOXQD.js} +7 -7
  81. package/dist/chunks/{permissions-72SZCBIY.js → permissions-SGJWGEVD.js} +6 -6
  82. package/dist/chunks/{publish-OOAGSEBM.js → publish-ZUQHJAXL.js} +5 -5
  83. package/dist/chunks/{push-B6TZDXNF.js → push-XMVKG5A5.js} +11 -11
  84. package/dist/chunks/{query-LZWS5TDH.js → query-ZLJZEGZB.js} +240 -52
  85. package/dist/chunks/{reorder-MRHFKPMK.js → reorder-NVHDWMRU.js} +5 -5
  86. package/dist/chunks/{reply-BKTJXO3B.js → reply-PUUPUQ3V.js} +9 -9
  87. package/dist/chunks/{resolve-BKVGSGPN.js → resolve-5U2LJVE6.js} +8 -8
  88. package/dist/chunks/{restore-USR7SKWV.js → restore-OXIUY2UI.js} +5 -5
  89. package/dist/chunks/{rm-2UO6BT3A.js → rm-3IOCBNPE.js} +9 -9
  90. package/dist/chunks/{rm-37MKKV3I.js → rm-BZNKJRXU.js} +8 -8
  91. package/dist/chunks/{rm-VY3OHKFH.js → rm-OUI4ZB5R.js} +8 -8
  92. package/dist/chunks/{rm-KUWPNZIS.js → rm-Z2KYJ7XT.js} +11 -11
  93. package/dist/chunks/{rule-inspect-JVDOOTWK.js → rule-inspect-ZBJJCDQV.js} +17 -25
  94. package/dist/chunks/{rules-NTBFZBIF.js → rules-HEGAXXUN.js} +10 -7
  95. package/dist/chunks/{schema-6EZ72OVH.js → schema-7GVL3BNP.js} +65 -33
  96. package/dist/chunks/schema-ZYIJYA2E.js +425 -0
  97. package/dist/chunks/{tags-HNPC63QA.js → tags-3SCWCMNQ.js} +3 -3
  98. package/dist/chunks/{types-QTOA2BTQ.js → types-AJHILHO5.js} +3 -5
  99. package/dist/chunks/{update-LUYWNZP3.js → update-YR2GCCJN.js} +40 -9
  100. package/dist/commands/build/index.js +282 -2932
  101. package/dist/commands/deploy/index.js +397 -84
  102. package/dist/commands/dev/index.js +339 -194
  103. package/dist/commands/env/index.js +101 -163
  104. package/dist/commands/link/index.js +17 -23
  105. package/dist/commands/list/index.js +11 -13
  106. package/dist/commands-bulk.js +10189 -4062
  107. package/dist/help.js +1 -1
  108. package/dist/index.js +141 -114
  109. package/dist/vc.js +18 -17
  110. package/dist/version.mjs +2 -1
  111. package/package.json +80 -77
  112. package/dist/chunks/chunk-2FMPLU44.js +0 -106
  113. package/dist/chunks/chunk-2MAPZXVV.js +0 -206
  114. package/dist/chunks/chunk-CPFNFVCL.js +0 -85
  115. package/dist/chunks/chunk-GFG6QDIE.js +0 -101
  116. package/dist/chunks/chunk-KBEX5MYS.js +0 -208
  117. package/dist/chunks/chunk-UE3JUVUZ.js +0 -1474
  118. package/dist/chunks/{chunk-BUZRVER7.js → chunk-P65EEFTR.js} +3 -3
  119. /package/dist/{commands/dev/next-dev-websocket-shim-preload.cjs → runtime-assets/node-preloads/next-dev-websocket.cjs} +0 -0
@@ -7,37 +7,47 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-NJ6QXKQD.js";
10
+ } from "./chunk-M34ZRNDQ.js";
11
11
  import {
12
- getGlobalPathConfig,
13
12
  progress,
13
+ require_ci_info
14
+ } from "./chunk-4JKZ7SRX.js";
15
+ import {
14
16
  writeToConfigFile
15
- } from "./chunk-SJYAUEZR.js";
17
+ } from "./chunk-DAWJOQF6.js";
18
+ import {
19
+ getGlobalPathConfig
20
+ } from "./chunk-JKQWQA2T.js";
16
21
  import {
17
22
  validateJsonOutput
18
- } from "./chunk-XPKWKPWA.js";
23
+ } from "./chunk-KXDWXXJH.js";
19
24
  import {
20
25
  apiCommand,
21
- listSubcommand4 as listSubcommand,
22
- loginCommand
23
- } from "./chunk-3QAUXPIR.js";
26
+ listSubcommand4 as listSubcommand
27
+ } from "./chunk-SOKQBFF7.js";
24
28
  import {
25
29
  require_semver
26
30
  } from "./chunk-IB5L4LKZ.js";
27
31
  import {
28
32
  help
29
- } from "./chunk-ZX2FSPWV.js";
33
+ } from "./chunk-SJQEGGH7.js";
30
34
  import {
31
- login
32
- } from "./chunk-4CCY5OPH.js";
35
+ require_chownr,
36
+ require_mkdirp,
37
+ require_pump,
38
+ require_tar_stream
39
+ } from "./chunk-VE545BR3.js";
33
40
  import {
34
41
  TelemetryClient,
35
42
  isNativeBinaryInstall
36
43
  } from "./chunk-ECCWJHC6.js";
44
+ import {
45
+ require_ms
46
+ } from "./chunk-GGP5R3FU.js";
37
47
  import {
38
48
  printError,
39
49
  require_strip_ansi
40
- } from "./chunk-KBEX5MYS.js";
50
+ } from "./chunk-VAFU7DXZ.js";
41
51
  import {
42
52
  parseArguments
43
53
  } from "./chunk-XLKFJPMT.js";
@@ -48,450 +58,359 @@ import {
48
58
  import {
49
59
  pkg_default
50
60
  } from "./chunk-P4QNYOFB.js";
61
+ import {
62
+ fetch as fetch2,
63
+ toNodeReadable
64
+ } from "./chunk-52QYYTM5.js";
51
65
  import {
52
66
  output_manager_default
53
67
  } from "./chunk-OX7KI3LF.js";
54
- import {
55
- require_ms
56
- } from "./chunk-GGP5R3FU.js";
57
68
  import {
58
69
  require_source
59
70
  } from "./chunk-S7KYDPEM.js";
60
71
  import {
61
72
  __commonJS,
73
+ __require,
62
74
  __toESM
63
75
  } from "./chunk-TZ2YI2VH.js";
64
76
 
65
- // ../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/vendors.json
66
- var require_vendors = __commonJS({
67
- "../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/vendors.json"(exports, module) {
68
- module.exports = [
69
- {
70
- name: "Agola CI",
71
- constant: "AGOLA",
72
- env: "AGOLA_GIT_REF",
73
- pr: "AGOLA_PULL_REQUEST_ID"
74
- },
75
- {
76
- name: "Appcircle",
77
- constant: "APPCIRCLE",
78
- env: "AC_APPCIRCLE",
79
- pr: {
80
- env: "AC_GIT_PR",
81
- ne: "false"
82
- }
83
- },
84
- {
85
- name: "AppVeyor",
86
- constant: "APPVEYOR",
87
- env: "APPVEYOR",
88
- pr: "APPVEYOR_PULL_REQUEST_NUMBER"
89
- },
90
- {
91
- name: "AWS CodeBuild",
92
- constant: "CODEBUILD",
93
- env: "CODEBUILD_BUILD_ARN",
94
- pr: {
95
- env: "CODEBUILD_WEBHOOK_EVENT",
96
- any: [
97
- "PULL_REQUEST_CREATED",
98
- "PULL_REQUEST_UPDATED",
99
- "PULL_REQUEST_REOPENED"
100
- ]
101
- }
102
- },
103
- {
104
- name: "Azure Pipelines",
105
- constant: "AZURE_PIPELINES",
106
- env: "TF_BUILD",
107
- pr: {
108
- BUILD_REASON: "PullRequest"
109
- }
110
- },
111
- {
112
- name: "Bamboo",
113
- constant: "BAMBOO",
114
- env: "bamboo_planKey"
115
- },
116
- {
117
- name: "Bitbucket Pipelines",
118
- constant: "BITBUCKET",
119
- env: "BITBUCKET_COMMIT",
120
- pr: "BITBUCKET_PR_ID"
121
- },
122
- {
123
- name: "Bitrise",
124
- constant: "BITRISE",
125
- env: "BITRISE_IO",
126
- pr: "BITRISE_PULL_REQUEST"
127
- },
128
- {
129
- name: "Buddy",
130
- constant: "BUDDY",
131
- env: "BUDDY_WORKSPACE_ID",
132
- pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
133
- },
134
- {
135
- name: "Buildkite",
136
- constant: "BUILDKITE",
137
- env: "BUILDKITE",
138
- pr: {
139
- env: "BUILDKITE_PULL_REQUEST",
140
- ne: "false"
141
- }
142
- },
143
- {
144
- name: "CircleCI",
145
- constant: "CIRCLE",
146
- env: "CIRCLECI",
147
- pr: "CIRCLE_PULL_REQUEST"
148
- },
149
- {
150
- name: "Cirrus CI",
151
- constant: "CIRRUS",
152
- env: "CIRRUS_CI",
153
- pr: "CIRRUS_PR"
154
- },
155
- {
156
- name: "Codefresh",
157
- constant: "CODEFRESH",
158
- env: "CF_BUILD_ID",
159
- pr: {
160
- any: [
161
- "CF_PULL_REQUEST_NUMBER",
162
- "CF_PULL_REQUEST_ID"
163
- ]
164
- }
165
- },
166
- {
167
- name: "Codemagic",
168
- constant: "CODEMAGIC",
169
- env: "CM_BUILD_ID",
170
- pr: "CM_PULL_REQUEST"
171
- },
172
- {
173
- name: "Codeship",
174
- constant: "CODESHIP",
175
- env: {
176
- CI_NAME: "codeship"
177
- }
178
- },
179
- {
180
- name: "Drone",
181
- constant: "DRONE",
182
- env: "DRONE",
183
- pr: {
184
- DRONE_BUILD_EVENT: "pull_request"
185
- }
186
- },
187
- {
188
- name: "dsari",
189
- constant: "DSARI",
190
- env: "DSARI"
191
- },
192
- {
193
- name: "Earthly",
194
- constant: "EARTHLY",
195
- env: "EARTHLY_CI"
196
- },
197
- {
198
- name: "Expo Application Services",
199
- constant: "EAS",
200
- env: "EAS_BUILD"
201
- },
202
- {
203
- name: "Gerrit",
204
- constant: "GERRIT",
205
- env: "GERRIT_PROJECT"
206
- },
207
- {
208
- name: "Gitea Actions",
209
- constant: "GITEA_ACTIONS",
210
- env: "GITEA_ACTIONS"
211
- },
212
- {
213
- name: "GitHub Actions",
214
- constant: "GITHUB_ACTIONS",
215
- env: "GITHUB_ACTIONS",
216
- pr: {
217
- GITHUB_EVENT_NAME: "pull_request"
218
- }
219
- },
220
- {
221
- name: "GitLab CI",
222
- constant: "GITLAB",
223
- env: "GITLAB_CI",
224
- pr: "CI_MERGE_REQUEST_ID"
225
- },
226
- {
227
- name: "GoCD",
228
- constant: "GOCD",
229
- env: "GO_PIPELINE_LABEL"
230
- },
231
- {
232
- name: "Google Cloud Build",
233
- constant: "GOOGLE_CLOUD_BUILD",
234
- env: "BUILDER_OUTPUT"
235
- },
236
- {
237
- name: "Harness CI",
238
- constant: "HARNESS",
239
- env: "HARNESS_BUILD_ID"
240
- },
241
- {
242
- name: "Heroku",
243
- constant: "HEROKU",
244
- env: {
245
- env: "NODE",
246
- includes: "/app/.heroku/node/bin/node"
247
- }
248
- },
249
- {
250
- name: "Hudson",
251
- constant: "HUDSON",
252
- env: "HUDSON_URL"
253
- },
254
- {
255
- name: "Jenkins",
256
- constant: "JENKINS",
257
- env: [
258
- "JENKINS_URL",
259
- "BUILD_ID"
260
- ],
261
- pr: {
262
- any: [
263
- "ghprbPullId",
264
- "CHANGE_ID"
265
- ]
266
- }
267
- },
268
- {
269
- name: "LayerCI",
270
- constant: "LAYERCI",
271
- env: "LAYERCI",
272
- pr: "LAYERCI_PULL_REQUEST"
273
- },
274
- {
275
- name: "Magnum CI",
276
- constant: "MAGNUM",
277
- env: "MAGNUM"
278
- },
279
- {
280
- name: "Netlify CI",
281
- constant: "NETLIFY",
282
- env: "NETLIFY",
283
- pr: {
284
- env: "PULL_REQUEST",
285
- ne: "false"
286
- }
287
- },
288
- {
289
- name: "Nevercode",
290
- constant: "NEVERCODE",
291
- env: "NEVERCODE",
292
- pr: {
293
- env: "NEVERCODE_PULL_REQUEST",
294
- ne: "false"
295
- }
296
- },
297
- {
298
- name: "Prow",
299
- constant: "PROW",
300
- env: "PROW_JOB_ID"
301
- },
302
- {
303
- name: "ReleaseHub",
304
- constant: "RELEASEHUB",
305
- env: "RELEASE_BUILD_ID"
306
- },
307
- {
308
- name: "Render",
309
- constant: "RENDER",
310
- env: "RENDER",
311
- pr: {
312
- IS_PULL_REQUEST: "true"
313
- }
314
- },
315
- {
316
- name: "Sail CI",
317
- constant: "SAIL",
318
- env: "SAILCI",
319
- pr: "SAIL_PULL_REQUEST_NUMBER"
320
- },
321
- {
322
- name: "Screwdriver",
323
- constant: "SCREWDRIVER",
324
- env: "SCREWDRIVER",
325
- pr: {
326
- env: "SD_PULL_REQUEST",
327
- ne: "false"
77
+ // ../../node_modules/.pnpm/tar-fs@1.16.5/node_modules/tar-fs/index.js
78
+ var require_tar_fs = __commonJS({
79
+ "../../node_modules/.pnpm/tar-fs@1.16.5/node_modules/tar-fs/index.js"(exports) {
80
+ var chownr = require_chownr();
81
+ var tar2 = require_tar_stream();
82
+ var pump = require_pump();
83
+ var mkdirp = require_mkdirp();
84
+ var fs = __require("fs");
85
+ var path = __require("path");
86
+ var os = __require("os");
87
+ var win32 = os.platform() === "win32";
88
+ var noop = function() {
89
+ };
90
+ var echo = function(name) {
91
+ return name;
92
+ };
93
+ var normalize = !win32 ? echo : function(name) {
94
+ return name.replace(/\\/g, "/").replace(/[:?<>|]/g, "_");
95
+ };
96
+ var statAll = function(fs2, stat2, cwd, ignore, entries, sort) {
97
+ var queue = entries || ["."];
98
+ return function loop(callback) {
99
+ if (!queue.length)
100
+ return callback();
101
+ var next = queue.shift();
102
+ var nextAbs = path.join(cwd, next);
103
+ stat2(nextAbs, function(err, stat3) {
104
+ if (err)
105
+ return callback(err);
106
+ if (!stat3.isDirectory())
107
+ return callback(null, next, stat3);
108
+ fs2.readdir(nextAbs, function(err2, files) {
109
+ if (err2)
110
+ return callback(err2);
111
+ if (sort)
112
+ files.sort();
113
+ for (var i = 0; i < files.length; i++) {
114
+ if (!ignore(path.join(cwd, next, files[i])))
115
+ queue.push(path.join(next, files[i]));
116
+ }
117
+ callback(null, next, stat3);
118
+ });
119
+ });
120
+ };
121
+ };
122
+ var strip = function(map, level) {
123
+ return function(header) {
124
+ header.name = header.name.split("/").slice(level).join("/");
125
+ var linkname = header.linkname;
126
+ if (linkname && (header.type === "link" || path.isAbsolute(linkname))) {
127
+ header.linkname = linkname.split("/").slice(level).join("/");
328
128
  }
329
- },
330
- {
331
- name: "Semaphore",
332
- constant: "SEMAPHORE",
333
- env: "SEMAPHORE",
334
- pr: "PULL_REQUEST_NUMBER"
335
- },
336
- {
337
- name: "Sourcehut",
338
- constant: "SOURCEHUT",
339
- env: {
340
- CI_NAME: "sourcehut"
129
+ return map(header);
130
+ };
131
+ };
132
+ exports.pack = function(cwd, opts) {
133
+ if (!cwd)
134
+ cwd = ".";
135
+ if (!opts)
136
+ opts = {};
137
+ var xfs = opts.fs || fs;
138
+ var ignore = opts.ignore || opts.filter || noop;
139
+ var map = opts.map || noop;
140
+ var mapStream = opts.mapStream || echo;
141
+ var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort);
142
+ var strict = opts.strict !== false;
143
+ var umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
144
+ var dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
145
+ var fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
146
+ var pack = opts.pack || tar2.pack();
147
+ var finish = opts.finish || noop;
148
+ if (opts.strip)
149
+ map = strip(map, opts.strip);
150
+ if (opts.readable) {
151
+ dmode |= parseInt(555, 8);
152
+ fmode |= parseInt(444, 8);
153
+ }
154
+ if (opts.writable) {
155
+ dmode |= parseInt(333, 8);
156
+ fmode |= parseInt(222, 8);
157
+ }
158
+ var onsymlink = function(filename, header) {
159
+ xfs.readlink(path.join(cwd, filename), function(err, linkname) {
160
+ if (err)
161
+ return pack.destroy(err);
162
+ header.linkname = normalize(linkname);
163
+ pack.entry(header, onnextentry);
164
+ });
165
+ };
166
+ var onstat = function(err, filename, stat2) {
167
+ if (err)
168
+ return pack.destroy(err);
169
+ if (!filename) {
170
+ if (opts.finalize !== false)
171
+ pack.finalize();
172
+ return finish(pack);
341
173
  }
342
- },
343
- {
344
- name: "Strider CD",
345
- constant: "STRIDER",
346
- env: "STRIDER"
347
- },
348
- {
349
- name: "TaskCluster",
350
- constant: "TASKCLUSTER",
351
- env: [
352
- "TASK_ID",
353
- "RUN_ID"
354
- ]
355
- },
356
- {
357
- name: "TeamCity",
358
- constant: "TEAMCITY",
359
- env: "TEAMCITY_VERSION"
360
- },
361
- {
362
- name: "Travis CI",
363
- constant: "TRAVIS",
364
- env: "TRAVIS",
365
- pr: {
366
- env: "TRAVIS_PULL_REQUEST",
367
- ne: "false"
174
+ if (stat2.isSocket())
175
+ return onnextentry();
176
+ var header = {
177
+ name: normalize(filename),
178
+ mode: (stat2.mode | (stat2.isDirectory() ? dmode : fmode)) & umask,
179
+ mtime: stat2.mtime,
180
+ size: stat2.size,
181
+ type: "file",
182
+ uid: stat2.uid,
183
+ gid: stat2.gid
184
+ };
185
+ if (stat2.isDirectory()) {
186
+ header.size = 0;
187
+ header.type = "directory";
188
+ header = map(header) || header;
189
+ return pack.entry(header, onnextentry);
368
190
  }
369
- },
370
- {
371
- name: "Vela",
372
- constant: "VELA",
373
- env: "VELA",
374
- pr: {
375
- VELA_PULL_REQUEST: "1"
191
+ if (stat2.isSymbolicLink()) {
192
+ header.size = 0;
193
+ header.type = "symlink";
194
+ header = map(header) || header;
195
+ return onsymlink(filename, header);
376
196
  }
377
- },
378
- {
379
- name: "Vercel",
380
- constant: "VERCEL",
381
- env: {
382
- any: [
383
- "NOW_BUILDER",
384
- "VERCEL"
385
- ]
386
- },
387
- pr: "VERCEL_GIT_PULL_REQUEST_ID"
388
- },
389
- {
390
- name: "Visual Studio App Center",
391
- constant: "APPCENTER",
392
- env: "APPCENTER_BUILD_ID"
393
- },
394
- {
395
- name: "Woodpecker",
396
- constant: "WOODPECKER",
397
- env: {
398
- CI: "woodpecker"
399
- },
400
- pr: {
401
- CI_BUILD_EVENT: "pull_request"
197
+ header = map(header) || header;
198
+ if (!stat2.isFile()) {
199
+ if (strict)
200
+ return pack.destroy(new Error("unsupported type for " + filename));
201
+ return onnextentry();
402
202
  }
403
- },
404
- {
405
- name: "Xcode Cloud",
406
- constant: "XCODE_CLOUD",
407
- env: "CI_XCODE_PROJECT",
408
- pr: "CI_PULL_REQUEST_NUMBER"
409
- },
410
- {
411
- name: "Xcode Server",
412
- constant: "XCODE_SERVER",
413
- env: "XCS"
414
- }
415
- ];
416
- }
417
- });
418
-
419
- // ../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/index.js
420
- var require_ci_info = __commonJS({
421
- "../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/index.js"(exports) {
422
- "use strict";
423
- var vendors = require_vendors();
424
- var env = process.env;
425
- Object.defineProperty(exports, "_vendors", {
426
- value: vendors.map(function(v) {
427
- return v.constant;
428
- })
429
- });
430
- exports.name = null;
431
- exports.isPR = null;
432
- exports.id = null;
433
- vendors.forEach(function(vendor) {
434
- const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
435
- const isCI = envs.every(function(obj) {
436
- return checkEnv(obj);
437
- });
438
- exports[vendor.constant] = isCI;
439
- if (!isCI) {
440
- return;
203
+ var entry = pack.entry(header, onnextentry);
204
+ if (!entry)
205
+ return;
206
+ var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header);
207
+ rs.on("error", function(err2) {
208
+ entry.destroy(err2);
209
+ });
210
+ pump(rs, entry);
211
+ };
212
+ var onnextentry = function(err) {
213
+ if (err)
214
+ return pack.destroy(err);
215
+ statNext(onstat);
216
+ };
217
+ onnextentry();
218
+ return pack;
219
+ };
220
+ var head = function(list) {
221
+ return list.length ? list[list.length - 1] : null;
222
+ };
223
+ var processGetuid = function() {
224
+ return process.getuid ? process.getuid() : -1;
225
+ };
226
+ var processUmask = function() {
227
+ return process.umask ? process.umask() : 0;
228
+ };
229
+ exports.extract = function(cwd, opts) {
230
+ if (!cwd)
231
+ cwd = ".";
232
+ if (!opts)
233
+ opts = {};
234
+ var xfs = opts.fs || fs;
235
+ var ignore = opts.ignore || opts.filter || noop;
236
+ var map = opts.map || noop;
237
+ var mapStream = opts.mapStream || echo;
238
+ var own = opts.chown !== false && !win32 && processGetuid() === 0;
239
+ var extract = opts.extract || tar2.extract();
240
+ var stack = [];
241
+ var now = /* @__PURE__ */ new Date();
242
+ var umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
243
+ var dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
244
+ var fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
245
+ var strict = opts.strict !== false;
246
+ if (opts.strip)
247
+ map = strip(map, opts.strip);
248
+ if (opts.readable) {
249
+ dmode |= parseInt(555, 8);
250
+ fmode |= parseInt(444, 8);
441
251
  }
442
- exports.name = vendor.name;
443
- exports.isPR = checkPR(vendor);
444
- exports.id = vendor.constant;
445
- });
446
- exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
447
- (env.BUILD_ID || // Jenkins, Cloudbees
448
- env.BUILD_NUMBER || // Jenkins, TeamCity
449
- env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
450
- env.CI_APP_ID || // Appflow
451
- env.CI_BUILD_ID || // Appflow
452
- env.CI_BUILD_NUMBER || // Appflow
453
- env.CI_NAME || // Codeship and others
454
- env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
455
- env.RUN_ID || // TaskCluster, dsari
456
- exports.name || false));
457
- function checkEnv(obj) {
458
- if (typeof obj === "string")
459
- return !!env[obj];
460
- if ("env" in obj) {
461
- return env[obj.env] && env[obj.env].includes(obj.includes);
252
+ if (opts.writable) {
253
+ dmode |= parseInt(333, 8);
254
+ fmode |= parseInt(222, 8);
462
255
  }
463
- if ("any" in obj) {
464
- return obj.any.some(function(k) {
465
- return !!env[k];
256
+ var utimesParent = function(name, cb) {
257
+ var top;
258
+ while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0])
259
+ stack.pop();
260
+ if (!top)
261
+ return cb();
262
+ xfs.utimes(top[0], now, top[1], cb);
263
+ };
264
+ var utimes = function(name, header, cb) {
265
+ if (opts.utimes === false)
266
+ return cb();
267
+ if (header.type === "directory")
268
+ return xfs.utimes(name, now, header.mtime, cb);
269
+ if (header.type === "symlink")
270
+ return utimesParent(name, cb);
271
+ xfs.utimes(name, now, header.mtime, function(err) {
272
+ if (err)
273
+ return cb(err);
274
+ utimesParent(name, cb);
466
275
  });
467
- }
468
- return Object.keys(obj).every(function(k) {
469
- return env[k] === obj[k];
470
- });
471
- }
472
- function checkPR(vendor) {
473
- switch (typeof vendor.pr) {
474
- case "string":
475
- return !!env[vendor.pr];
476
- case "object":
477
- if ("env" in vendor.pr) {
478
- if ("any" in vendor.pr) {
479
- return vendor.pr.any.some(function(key) {
480
- return env[vendor.pr.env] === key;
276
+ };
277
+ var chperm = function(name, header, cb) {
278
+ var link = header.type === "symlink";
279
+ var chmod2 = link ? xfs.lchmod : xfs.chmod;
280
+ var chown = link ? xfs.lchown : xfs.chown;
281
+ if (!chmod2)
282
+ return cb();
283
+ var mode = (header.mode | (header.type === "directory" ? dmode : fmode)) & umask;
284
+ chmod2(name, mode, function(err) {
285
+ if (err)
286
+ return cb(err);
287
+ if (!own)
288
+ return cb();
289
+ if (!chown)
290
+ return cb();
291
+ chown(name, header.uid, header.gid, cb);
292
+ });
293
+ };
294
+ extract.on("entry", function(header, stream, next) {
295
+ header = map(header) || header;
296
+ header.name = normalize(header.name);
297
+ var name = path.join(cwd, path.join("/", header.name));
298
+ if (ignore(name, header)) {
299
+ stream.resume();
300
+ return next();
301
+ }
302
+ var stat2 = function(err) {
303
+ if (err)
304
+ return next(err);
305
+ utimes(name, header, function(err2) {
306
+ if (err2)
307
+ return next(err2);
308
+ if (win32)
309
+ return next();
310
+ chperm(name, header, next);
311
+ });
312
+ };
313
+ var onsymlink = function() {
314
+ if (win32)
315
+ return next();
316
+ xfs.unlink(name, function() {
317
+ var dst = path.resolve(path.dirname(name), header.linkname);
318
+ if (!dst.startsWith(path.resolve(cwd)))
319
+ return next(new Error(name + " is not a valid symlink"));
320
+ xfs.symlink(header.linkname, name, stat2);
321
+ });
322
+ };
323
+ var onlink = function() {
324
+ if (win32)
325
+ return next();
326
+ xfs.unlink(name, function() {
327
+ var srcpath = path.join(cwd, path.join("/", header.linkname));
328
+ xfs.realpath(srcpath, function(err, dst) {
329
+ if (err || !dst.startsWith(path.resolve(cwd)))
330
+ return next(new Error(name + " is not a valid hardlink"));
331
+ xfs.link(dst, name, function(err2) {
332
+ if (err2 && err2.code === "EPERM" && opts.hardlinkAsFilesFallback) {
333
+ stream = xfs.createReadStream(srcpath);
334
+ return onfile();
335
+ }
336
+ stat2(err2);
481
337
  });
482
- } else {
483
- return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
484
- }
485
- } else if ("any" in vendor.pr) {
486
- return vendor.pr.any.some(function(key) {
487
- return !!env[key];
488
338
  });
489
- } else {
490
- return checkEnv(vendor.pr);
491
- }
492
- default:
493
- return null;
494
- }
339
+ });
340
+ };
341
+ var onfile = function() {
342
+ var ws = xfs.createWriteStream(name);
343
+ var rs = mapStream(stream, header);
344
+ ws.on("error", function(err) {
345
+ rs.destroy(err);
346
+ });
347
+ pump(rs, ws, function(err) {
348
+ if (err)
349
+ return next(err);
350
+ ws.on("close", stat2);
351
+ });
352
+ };
353
+ if (header.type === "directory") {
354
+ stack.push([name, header.mtime]);
355
+ return mkdirfix(name, {
356
+ fs: xfs,
357
+ own,
358
+ uid: header.uid,
359
+ gid: header.gid
360
+ }, stat2);
361
+ }
362
+ var dir = path.dirname(name);
363
+ validate(xfs, dir, path.join(cwd, "."), function(err, valid) {
364
+ if (err)
365
+ return next(err);
366
+ if (!valid)
367
+ return next(new Error(dir + " is not a valid path"));
368
+ mkdirfix(dir, {
369
+ fs: xfs,
370
+ own,
371
+ uid: header.uid,
372
+ gid: header.gid
373
+ }, function(err2) {
374
+ if (err2)
375
+ return next(err2);
376
+ switch (header.type) {
377
+ case "file":
378
+ return onfile();
379
+ case "link":
380
+ return onlink();
381
+ case "symlink":
382
+ return onsymlink();
383
+ }
384
+ if (strict)
385
+ return next(new Error("unsupported type for " + name + " (" + header.type + ")"));
386
+ stream.resume();
387
+ next();
388
+ });
389
+ });
390
+ });
391
+ if (opts.finish)
392
+ extract.on("finish", opts.finish);
393
+ return extract;
394
+ };
395
+ function validate(fs2, name, root, cb) {
396
+ if (name === root)
397
+ return cb(null, true);
398
+ fs2.lstat(name, function(err, st) {
399
+ if (err && err.code !== "ENOENT")
400
+ return cb(err);
401
+ if (err || st.isDirectory())
402
+ return validate(fs2, path.join(name, ".."), root, cb);
403
+ cb(null, false);
404
+ });
405
+ }
406
+ function mkdirfix(name, opts, cb) {
407
+ mkdirp(name, { fs: opts.fs }, function(err, made) {
408
+ if (!err && made && opts.own) {
409
+ chownr(made, opts.uid, opts.gid, cb);
410
+ } else {
411
+ cb(err);
412
+ }
413
+ });
495
414
  }
496
415
  }
497
416
  });
@@ -2885,7 +2804,7 @@ function renderUpgradeProgress(current, total, phase) {
2885
2804
  );
2886
2805
  }
2887
2806
  function execFileStdout(command, args) {
2888
- return new Promise((resolve3, reject) => {
2807
+ return new Promise((resolve4, reject) => {
2889
2808
  execFile(
2890
2809
  command,
2891
2810
  args,
@@ -2895,7 +2814,7 @@ function execFileStdout(command, args) {
2895
2814
  reject(error);
2896
2815
  return;
2897
2816
  }
2898
- resolve3(stdout.toString());
2817
+ resolve4(stdout.toString());
2899
2818
  }
2900
2819
  );
2901
2820
  });
@@ -2963,7 +2882,7 @@ async function executeUpgrade(targetVersion) {
2963
2882
  }
2964
2883
  output_manager_default.debug(`Executing: ${updateCommand} (cwd: ${cwd})`);
2965
2884
  renderUpgradeProgress(targetVersion ? 1 : 2, totalSteps, "Installing\u2026");
2966
- return new Promise((resolve3) => {
2885
+ return new Promise((resolve4) => {
2967
2886
  const stdout = [];
2968
2887
  const stderr = [];
2969
2888
  const upgradeProcess = spawn(command, args, {
@@ -2983,7 +2902,7 @@ async function executeUpgrade(targetVersion) {
2983
2902
  output_manager_default.stopSpinner();
2984
2903
  output_manager_default.error(`Failed to execute upgrade command: ${err.message}`);
2985
2904
  output_manager_default.log(`You can try running the command manually: ${updateCommand}`);
2986
- resolve3(1);
2905
+ resolve4(1);
2987
2906
  });
2988
2907
  upgradeProcess.on("close", (code) => {
2989
2908
  if (code !== 0) {
@@ -3000,7 +2919,7 @@ async function executeUpgrade(targetVersion) {
3000
2919
  output_manager_default.log(
3001
2920
  `You can try running the command manually: ${updateCommand}`
3002
2921
  );
3003
- resolve3(code ?? 1);
2922
+ resolve4(code ?? 1);
3004
2923
  return;
3005
2924
  }
3006
2925
  renderUpgradeProgress(totalSteps, totalSteps);
@@ -3009,17 +2928,435 @@ async function executeUpgrade(targetVersion) {
3009
2928
  output_manager_default.success(
3010
2929
  `Vercel CLI has been upgraded to v${resolvedTargetVersion} successfully!`
3011
2930
  );
3012
- resolve3(0);
2931
+ resolve4(0);
3013
2932
  return;
3014
2933
  }
3015
2934
  output_manager_default.success("Vercel CLI has been upgraded successfully!");
3016
- resolve3(0);
2935
+ resolve4(0);
3017
2936
  });
3018
2937
  });
3019
2938
  }
3020
2939
 
3021
2940
  // src/util/updates.ts
3022
2941
  var import_ci_info = __toESM(require_ci_info(), 1);
2942
+
2943
+ // src/util/native-self-update.ts
2944
+ var import_tar_fs = __toESM(require_tar_fs(), 1);
2945
+ var import_semver2 = __toESM(require_semver(), 1);
2946
+ import { createGunzip } from "zlib";
2947
+ import { createHash as createHash2 } from "crypto";
2948
+ import { createWriteStream } from "fs";
2949
+ import { homedir, tmpdir as tmpdir2 } from "os";
2950
+ import { join as join2, resolve as resolve3, sep } from "path";
2951
+ import { pipeline } from "stream/promises";
2952
+ import {
2953
+ chmod,
2954
+ copyFile,
2955
+ mkdir as mkdir2,
2956
+ mkdtemp,
2957
+ readdir,
2958
+ readFile as readFile4,
2959
+ readlink,
2960
+ realpath,
2961
+ rename,
2962
+ rm,
2963
+ stat,
2964
+ symlink,
2965
+ unlink,
2966
+ writeFile as writeFile2
2967
+ } from "fs/promises";
2968
+ var REGISTRY = "https://registry.npmjs.org";
2969
+ async function moveFile(source, destination) {
2970
+ try {
2971
+ await rename(source, destination);
2972
+ } catch (err) {
2973
+ if (err.code !== "EXDEV") {
2974
+ throw err;
2975
+ }
2976
+ await copyFile(source, destination);
2977
+ await rm(source, { force: true });
2978
+ }
2979
+ }
2980
+ var CURL_INSTALL_COMMAND = "curl -fsSL https://api-frameworks.vercel.sh/install | sh";
2981
+ var SUPPORTED_PLATFORMS = /* @__PURE__ */ new Set([
2982
+ "darwin-arm64",
2983
+ "darwin-x64",
2984
+ "linux-arm64",
2985
+ "linux-x64"
2986
+ ]);
2987
+ function getInstallRoot() {
2988
+ const root = process.env.VERCEL_INSTALL_DIR;
2989
+ return root ? resolve3(root) : join2(homedir(), ".vercel");
2990
+ }
2991
+ function platformTarget() {
2992
+ return `${process.platform}-${process.arch}`;
2993
+ }
2994
+ function isSupportedPlatform() {
2995
+ return SUPPORTED_PLATFORMS.has(platformTarget());
2996
+ }
2997
+ function unsupportedPlatformMessage() {
2998
+ const supported = Array.from(SUPPORTED_PLATFORMS).join(", ");
2999
+ return `The native Vercel CLI binary is not available for your platform (${platformTarget()}). Supported platforms: ${supported}. You can install the CLI with a package manager instead: npm i -g vercel@latest`;
3000
+ }
3001
+ function nativePackageSuffix() {
3002
+ return `vc-native-${platformTarget()}`;
3003
+ }
3004
+ function nativePackageName() {
3005
+ return `@vercel/${nativePackageSuffix()}`;
3006
+ }
3007
+ async function isCurlInstall() {
3008
+ if (!isNativeBinaryInstall()) {
3009
+ return false;
3010
+ }
3011
+ const versionsPrefix = join2(getInstallRoot(), "versions") + sep;
3012
+ if (process.execPath.startsWith(versionsPrefix)) {
3013
+ return true;
3014
+ }
3015
+ try {
3016
+ const real = await realpath(process.execPath);
3017
+ return real.startsWith(versionsPrefix);
3018
+ } catch {
3019
+ return false;
3020
+ }
3021
+ }
3022
+ async function resolveLatestVersion(pkgName) {
3023
+ const res = await fetch2(`${REGISTRY}/${pkgName}/latest`);
3024
+ if (!res.ok) {
3025
+ throw new Error(
3026
+ `Failed to fetch package metadata from the npm registry (HTTP ${res.status})`
3027
+ );
3028
+ }
3029
+ const manifest = await res.json();
3030
+ if (!manifest.version || !import_semver2.default.valid(manifest.version)) {
3031
+ throw new Error("Could not resolve the latest native binary version");
3032
+ }
3033
+ return manifest.version;
3034
+ }
3035
+ async function resolveLatestNativeVersion() {
3036
+ return resolveLatestVersion(nativePackageName());
3037
+ }
3038
+ async function listAvailableVersions(pkgName) {
3039
+ const res = await fetch2(`${REGISTRY}/${pkgName}`, {
3040
+ headers: {
3041
+ // Abbreviated metadata: much smaller response.
3042
+ accept: "application/vnd.npm.install-v1+json"
3043
+ }
3044
+ });
3045
+ if (!res.ok) {
3046
+ throw new Error(
3047
+ `Failed to fetch package metadata from the npm registry (HTTP ${res.status})`
3048
+ );
3049
+ }
3050
+ const manifest = await res.json();
3051
+ const versions = Object.keys(manifest.versions ?? {}).filter(
3052
+ (v) => import_semver2.default.valid(v)
3053
+ );
3054
+ return versions.sort(import_semver2.default.rcompare);
3055
+ }
3056
+ async function downloadAndExtractBinary(version, destination) {
3057
+ if (!isSupportedPlatform()) {
3058
+ throw new Error(unsupportedPlatformMessage());
3059
+ }
3060
+ const suffix = nativePackageSuffix();
3061
+ const tarballUrl = `${REGISTRY}/@vercel/${suffix}/-/${suffix}-${version}.tgz`;
3062
+ const res = await fetch2(tarballUrl);
3063
+ if (res.status === 404) {
3064
+ throw new Error(
3065
+ `No native binary is available for Vercel CLI v${version} on ${platformTarget()}. Older versions may predate native binary builds. You can install that version with a package manager instead: npm i -g vercel@${version}`
3066
+ );
3067
+ }
3068
+ if (!res.ok) {
3069
+ throw new Error(`Failed to download ${tarballUrl} (HTTP ${res.status})`);
3070
+ }
3071
+ const tmpDir = await mkdtemp(join2(tmpdir2(), "vercel-upgrade-"));
3072
+ try {
3073
+ await pipeline(
3074
+ toNodeReadable(res.body),
3075
+ createGunzip(),
3076
+ import_tar_fs.default.extract(tmpDir, {
3077
+ // Drop symlink/hardlink entries: they're the tar link-following
3078
+ // traversal vector (CVE-2024-12905 / CVE-2025-48387).
3079
+ ignore: (_name, header) => header?.type !== "file" && header?.type !== "directory"
3080
+ })
3081
+ );
3082
+ const binary = join2(tmpDir, "package", "bin", "vercel");
3083
+ const stats = await stat(binary).catch(() => null);
3084
+ if (!stats?.isFile()) {
3085
+ throw new Error(
3086
+ "Downloaded tarball did not contain the expected binary (package/bin/vercel)"
3087
+ );
3088
+ }
3089
+ await mkdir2(destination, { recursive: true });
3090
+ await chmod(binary, 493);
3091
+ await moveFile(binary, join2(destination, "vercel"));
3092
+ } finally {
3093
+ await rm(tmpDir, { recursive: true, force: true });
3094
+ }
3095
+ }
3096
+ async function forceSymlink(target, linkPath) {
3097
+ await unlink(linkPath).catch(() => {
3098
+ });
3099
+ await symlink(target, linkPath);
3100
+ }
3101
+ async function linkVersion(version) {
3102
+ const installRoot = getInstallRoot();
3103
+ const binaryPath = join2(installRoot, "versions", version, "vercel");
3104
+ const binDir = join2(installRoot, "bin");
3105
+ await mkdir2(binDir, { recursive: true });
3106
+ await forceSymlink(binaryPath, join2(binDir, "vercel"));
3107
+ await forceSymlink(binaryPath, join2(binDir, "vc"));
3108
+ }
3109
+ async function installAndLinkVersion(version) {
3110
+ const installRoot = getInstallRoot();
3111
+ const versionDir = join2(installRoot, "versions", version);
3112
+ const binaryPath = join2(versionDir, "vercel");
3113
+ const existing = await stat(binaryPath).catch(() => null);
3114
+ if (!existing?.isFile()) {
3115
+ output_manager_default.spinner(`Downloading Vercel CLI v${version}\u2026`, 0);
3116
+ await downloadAndExtractBinary(version, versionDir);
3117
+ }
3118
+ await linkVersion(version);
3119
+ }
3120
+ var PR_BINARIES_URL = process.env.VERCEL_PR_BINARIES_URL || "https://api-frameworks.vercel.sh/pr-binaries";
3121
+ function parsePrTarget(target) {
3122
+ const match = /^pr[/-](\d+)$/i.exec(target.trim());
3123
+ if (!match) {
3124
+ return void 0;
3125
+ }
3126
+ const pr = Number(match[1]);
3127
+ return Number.isSafeInteger(pr) && pr > 0 ? pr : void 0;
3128
+ }
3129
+ function prVersionDirName(pr) {
3130
+ return `pr-${pr}`;
3131
+ }
3132
+ function isPrVersionName(name) {
3133
+ return /^pr-\d+$/.test(name);
3134
+ }
3135
+ async function fetchPrBuildSha(pr) {
3136
+ const url = `${PR_BINARIES_URL}/${pr}/current-sha`;
3137
+ const res = await fetch2(url);
3138
+ if (res.status === 404) {
3139
+ throw new Error(
3140
+ `No binary found for PR #${pr}. The PR may not have a build yet, or the build may still be running.`
3141
+ );
3142
+ }
3143
+ if (!res.ok) {
3144
+ throw new Error(
3145
+ `Failed to fetch current build for PR #${pr} (HTTP ${res.status})`
3146
+ );
3147
+ }
3148
+ const sha = (await res.text()).trim().toLowerCase();
3149
+ if (!/^[0-9a-f]{40}$/.test(sha)) {
3150
+ throw new Error(`Unexpected build SHA format for PR #${pr}`);
3151
+ }
3152
+ return sha;
3153
+ }
3154
+ function getPrBinaryBaseUrl(pr, buildSha) {
3155
+ return `${PR_BINARIES_URL}/${pr}/shas/${buildSha}`;
3156
+ }
3157
+ async function fetchPrChecksum(pr, buildSha) {
3158
+ const url = `${getPrBinaryBaseUrl(pr, buildSha)}/vercel-${platformTarget()}.sha256`;
3159
+ const res = await fetch2(url);
3160
+ if (res.status === 404) {
3161
+ throw new Error(
3162
+ `No binary found for PR #${pr} on ${platformTarget()}. The PR may not have a build yet, or the build may still be running.`
3163
+ );
3164
+ }
3165
+ if (!res.ok) {
3166
+ throw new Error(
3167
+ `Failed to fetch checksum for PR #${pr} (HTTP ${res.status})`
3168
+ );
3169
+ }
3170
+ const text = (await res.text()).trim();
3171
+ const sha = text.split(/\s+/)[0]?.toLowerCase();
3172
+ if (!/^[0-9a-f]{64}$/.test(sha ?? "")) {
3173
+ throw new Error(`Unexpected checksum format for PR #${pr}`);
3174
+ }
3175
+ return sha;
3176
+ }
3177
+ async function downloadPrBinary(pr, buildSha, expectedSha, destination) {
3178
+ if (!isSupportedPlatform()) {
3179
+ throw new Error(unsupportedPlatformMessage());
3180
+ }
3181
+ const url = `${getPrBinaryBaseUrl(pr, buildSha)}/vercel-${platformTarget()}`;
3182
+ const res = await fetch2(url);
3183
+ if (res.status === 404) {
3184
+ throw new Error(
3185
+ `No binary found for PR #${pr} on ${platformTarget()}. The PR may not have a build yet, or the build may still be running.`
3186
+ );
3187
+ }
3188
+ if (!res.ok) {
3189
+ throw new Error(`Failed to download ${url} (HTTP ${res.status})`);
3190
+ }
3191
+ const tmpDir = await mkdtemp(join2(tmpdir2(), "vercel-pr-"));
3192
+ try {
3193
+ const tmpBinary = join2(tmpDir, "vercel");
3194
+ const hash = createHash2("sha256");
3195
+ const body = toNodeReadable(res.body);
3196
+ body.on("data", (chunk) => hash.update(chunk));
3197
+ await pipeline(body, createWriteStream(tmpBinary));
3198
+ const actualSha = hash.digest("hex");
3199
+ if (actualSha !== expectedSha) {
3200
+ throw new Error(
3201
+ `Checksum mismatch for PR #${pr} binary. The build may have been updated mid-download; try again.`
3202
+ );
3203
+ }
3204
+ await mkdir2(destination, { recursive: true });
3205
+ await chmod(tmpBinary, 493);
3206
+ await moveFile(tmpBinary, join2(destination, "vercel"));
3207
+ await writeFile2(join2(destination, "vercel.sha256"), `${actualSha}
3208
+ `);
3209
+ } finally {
3210
+ await rm(tmpDir, { recursive: true, force: true });
3211
+ }
3212
+ }
3213
+ async function installAndLinkPrBinary(pr) {
3214
+ const installRoot = getInstallRoot();
3215
+ const versionDir = join2(installRoot, "versions", prVersionDirName(pr));
3216
+ const binaryPath = join2(versionDir, "vercel");
3217
+ const shaPath = join2(versionDir, "vercel.sha256");
3218
+ output_manager_default.spinner(`Checking latest build for PR #${pr}\u2026`, 0);
3219
+ const buildSha = await fetchPrBuildSha(pr);
3220
+ const remoteSha = await fetchPrChecksum(pr, buildSha);
3221
+ const existing = await stat(binaryPath).catch(() => null);
3222
+ const localSha = existing?.isFile() ? (await readFile4(shaPath, "utf8").catch(() => "")).trim().split(/\s+/)[0] : void 0;
3223
+ if (existing?.isFile() && localSha === remoteSha) {
3224
+ await linkVersion(prVersionDirName(pr));
3225
+ return { updated: false, buildSha };
3226
+ }
3227
+ output_manager_default.spinner(`Downloading Vercel CLI build for PR #${pr}\u2026`, 0);
3228
+ await downloadPrBinary(pr, buildSha, remoteSha, versionDir);
3229
+ await linkVersion(prVersionDirName(pr));
3230
+ return { updated: true, buildSha };
3231
+ }
3232
+ async function listInstalledVersions() {
3233
+ const versionsDir = join2(getInstallRoot(), "versions");
3234
+ const entries = await readdir(versionsDir, { withFileTypes: true }).catch(
3235
+ () => []
3236
+ );
3237
+ const versions = [];
3238
+ const prBuilds = [];
3239
+ for (const entry of entries) {
3240
+ const isPr = isPrVersionName(entry.name);
3241
+ if (!entry.isDirectory() || !import_semver2.default.valid(entry.name) && !isPr) {
3242
+ continue;
3243
+ }
3244
+ const binary = join2(versionsDir, entry.name, "vercel");
3245
+ const stats = await stat(binary).catch(() => null);
3246
+ if (stats?.isFile()) {
3247
+ (isPr ? prBuilds : versions).push(entry.name);
3248
+ }
3249
+ }
3250
+ return [...versions.sort(import_semver2.default.rcompare), ...prBuilds.sort()];
3251
+ }
3252
+ async function getLinkedVersion() {
3253
+ const link = join2(getInstallRoot(), "bin", "vercel");
3254
+ try {
3255
+ const target = await readlink(link);
3256
+ const segments = target.split(sep);
3257
+ const versionsIdx = segments.lastIndexOf("versions");
3258
+ const version = versionsIdx >= 0 ? segments[versionsIdx + 1] : void 0;
3259
+ return version && (import_semver2.default.valid(version) || isPrVersionName(version)) ? version : void 0;
3260
+ } catch {
3261
+ return void 0;
3262
+ }
3263
+ }
3264
+ async function isLinkedToPrBuild() {
3265
+ const linked = await getLinkedVersion();
3266
+ return linked !== void 0 && isPrVersionName(linked);
3267
+ }
3268
+ function pinFilePath() {
3269
+ return join2(getInstallRoot(), "pinned");
3270
+ }
3271
+ async function setPinnedVersion(version) {
3272
+ await writeFile2(pinFilePath(), `${version}
3273
+ `);
3274
+ }
3275
+ async function clearPinnedVersion() {
3276
+ await unlink(pinFilePath()).catch(() => {
3277
+ });
3278
+ }
3279
+ async function getPinnedVersion() {
3280
+ const pinned = (await readFile4(pinFilePath(), "utf8").catch(() => "")).trim().split(/\s+/)[0];
3281
+ if (!pinned) {
3282
+ return void 0;
3283
+ }
3284
+ const linked = await getLinkedVersion();
3285
+ return pinned === linked ? pinned : void 0;
3286
+ }
3287
+ async function getPrBuildSha(name) {
3288
+ const shaPath = join2(getInstallRoot(), "versions", name, "vercel.sha256");
3289
+ const sha = (await readFile4(shaPath, "utf8").catch(() => "")).trim().split(/\s+/)[0];
3290
+ return /^[0-9a-f]{64}$/.test(sha) ? sha : void 0;
3291
+ }
3292
+ function packageManagerRemovalCommand() {
3293
+ const segments = process.execPath.split(sep);
3294
+ if (segments.includes("pnpm") || segments.includes(".pnpm")) {
3295
+ return "pnpm rm -g vercel";
3296
+ }
3297
+ if (segments.includes("yarn") || segments.includes(".yarn")) {
3298
+ return "yarn global remove vercel";
3299
+ }
3300
+ return "npm rm -g vercel";
3301
+ }
3302
+ async function printMigrationCleanup() {
3303
+ if (await isCurlInstall()) {
3304
+ return;
3305
+ }
3306
+ const removalCommand = packageManagerRemovalCommand();
3307
+ const binDir = join2(getInstallRoot(), "bin");
3308
+ output_manager_default.print("\n");
3309
+ output_manager_default.log(
3310
+ `The Vercel CLI now updates itself in ${binDir} and no longer needs your package manager.`
3311
+ );
3312
+ output_manager_default.log(
3313
+ `Remove the old install so the new binary takes effect: ${removalCommand}`
3314
+ );
3315
+ output_manager_default.log(
3316
+ "Then open a new terminal (or run `hash -r`) so your shell picks up the new binary."
3317
+ );
3318
+ }
3319
+ async function executeNativeSelfUpdate(targetVersion) {
3320
+ try {
3321
+ output_manager_default.spinner("Checking for updates\u2026", 0);
3322
+ const version = targetVersion ?? await resolveLatestNativeVersion();
3323
+ const onPrBuild = await isLinkedToPrBuild();
3324
+ if (!targetVersion && !onPrBuild && import_semver2.default.valid(version) && import_semver2.default.valid(pkg_default.version) && import_semver2.default.gte(pkg_default.version, version)) {
3325
+ output_manager_default.stopSpinner();
3326
+ output_manager_default.log(
3327
+ `No upgrade available. Vercel CLI is already up to date (v${pkg_default.version}).`
3328
+ );
3329
+ return 0;
3330
+ }
3331
+ if (onPrBuild) {
3332
+ output_manager_default.stopSpinner();
3333
+ output_manager_default.log(
3334
+ `Currently on a PR build (${await getLinkedVersion()}). Switching back to the latest release\u2026`
3335
+ );
3336
+ }
3337
+ await installAndLinkVersion(version);
3338
+ await clearPinnedVersion();
3339
+ output_manager_default.stopSpinner();
3340
+ output_manager_default.success(`Vercel CLI has been upgraded to v${version} successfully!`);
3341
+ await printMigrationCleanup();
3342
+ return 0;
3343
+ } catch (error) {
3344
+ output_manager_default.stopSpinner();
3345
+ output_manager_default.error(
3346
+ `Upgrade failed: ${error instanceof Error ? error.message : String(error)}`
3347
+ );
3348
+ output_manager_default.log(`You can try reinstalling manually: ${CURL_INSTALL_COMMAND}`);
3349
+ return 1;
3350
+ }
3351
+ }
3352
+
3353
+ // src/util/updates.ts
3354
+ async function isVersionPinned() {
3355
+ if (!isNativeBinaryInstall()) {
3356
+ return false;
3357
+ }
3358
+ return await getPinnedVersion() !== void 0;
3359
+ }
3023
3360
  function isAutoUpdateEnabled(config) {
3024
3361
  return config.updates?.auto === true;
3025
3362
  }
@@ -3058,79 +3395,8 @@ async function canAutoUpdate(client, exitCode, command) {
3058
3395
  return isGlobal();
3059
3396
  }
3060
3397
 
3061
- // src/commands/login/index.ts
3062
- var import_chalk5 = __toESM(require_source(), 1);
3063
-
3064
- // src/util/telemetry/commands/login/index.ts
3065
- var LoginTelemetryClient = class extends TelemetryClient {
3066
- /**
3067
- * Tracks the state of the login process.
3068
- * - `started` when the user initiates the login process.
3069
- * - `canceled` when the user cancels the login process.
3070
- * - `error` when the user encounters an error during the login process.
3071
- * - `success` when the user successfully logs in.
3072
- */
3073
- trackState(...args) {
3074
- this.trackLoginState(...args);
3075
- }
3076
- };
3077
-
3078
- // src/commands/login/index.ts
3079
- async function login2(client, options) {
3080
- let parsedArgs = null;
3081
- const flagsSpecification = getFlagsSpecification(loginCommand.options);
3082
- const telemetry = new LoginTelemetryClient({
3083
- opts: {
3084
- store: client.telemetryEventStore
3085
- }
3086
- });
3087
- try {
3088
- if (options.shouldParseArgs) {
3089
- parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
3090
- }
3091
- } catch (error) {
3092
- printError(error);
3093
- return 1;
3094
- }
3095
- if (parsedArgs?.flags["--help"]) {
3096
- telemetry.trackCliFlagHelp("login");
3097
- output_manager_default.print(help(loginCommand, { columns: client.stderr.columns }));
3098
- return 0;
3099
- }
3100
- if (parsedArgs?.flags["--token"]) {
3101
- output_manager_default.error('`--token` may not be used with the "login" command');
3102
- return 2;
3103
- }
3104
- if (options.shouldParseArgs && parsedArgs) {
3105
- const obsoleteFlags = Object.keys(parsedArgs.flags).filter((flag) => {
3106
- const flagKey = flag.replace("--", "");
3107
- const option = loginCommand.options.find((o) => o.name === flagKey);
3108
- if (!option || typeof option === "number")
3109
- return;
3110
- return "deprecated" in option && option.deprecated;
3111
- });
3112
- if (obsoleteFlags.length) {
3113
- const flags = obsoleteFlags.map((f) => import_chalk5.default.bold(f)).join(", ");
3114
- output_manager_default.warn(`The following flags are deprecated: ${flags}`);
3115
- }
3116
- const obsoleteArguments = parsedArgs.args.slice(1);
3117
- if (obsoleteArguments.length) {
3118
- const args = obsoleteArguments.map((a) => import_chalk5.default.bold(a)).join(", ");
3119
- output_manager_default.warn(`The following arguments are deprecated: ${args}`);
3120
- }
3121
- if (obsoleteArguments.length || obsoleteFlags.length) {
3122
- output_manager_default.print(
3123
- `Read more in our ${output_manager_default.link("changelog", "https://vercel.com/changelog/new-vercel-cli-login-flow")}.
3124
- `
3125
- );
3126
- }
3127
- }
3128
- telemetry.trackState("started");
3129
- return await login(client, telemetry);
3130
- }
3131
-
3132
3398
  // src/util/output/box.ts
3133
- var import_chalk6 = __toESM(require_source(), 1);
3399
+ var import_chalk5 = __toESM(require_source(), 1);
3134
3400
  var import_strip_ansi = __toESM(require_strip_ansi(), 1);
3135
3401
  var border = ["\u2500", "\u256D", "\u256E", "\u2502", "\u2502", "\u2570", "\u256F"];
3136
3402
  var nothing = ["\u2500", "", "", "", "", "", ""];
@@ -3142,7 +3408,7 @@ function box(message, {
3142
3408
  } = {}) {
3143
3409
  const lines = message.split(/\r?\n/).map((line) => [line, (0, import_strip_ansi.default)(line).length]);
3144
3410
  const maxLine = lines.reduce((p, [, len]) => Math.max(p, len), 0);
3145
- const borderColorFn = borderColor && import_chalk6.default[borderColor] || import_chalk6.default.yellow;
3411
+ const borderColorFn = borderColor && import_chalk5.default[borderColor] || import_chalk5.default.yellow;
3146
3412
  const clampedSidePadding = Math.max(1, padding * 3);
3147
3413
  const narrowMode = maxLine + 2 + clampedSidePadding * 2 > cols;
3148
3414
  const sidePadding = narrowMode ? 0 : clampedSidePadding;
@@ -3201,11 +3467,24 @@ export {
3201
3467
  api,
3202
3468
  tryOpenApiFallback,
3203
3469
  executeUpgrade,
3204
- require_ci_info,
3470
+ require_tar_fs,
3471
+ CURL_INSTALL_COMMAND,
3472
+ isCurlInstall,
3473
+ listAvailableVersions,
3474
+ installAndLinkVersion,
3475
+ parsePrTarget,
3476
+ installAndLinkPrBinary,
3477
+ listInstalledVersions,
3478
+ getLinkedVersion,
3479
+ isLinkedToPrBuild,
3480
+ setPinnedVersion,
3481
+ getPinnedVersion,
3482
+ getPrBuildSha,
3483
+ executeNativeSelfUpdate,
3484
+ isVersionPinned,
3205
3485
  isAutoUpdateEnabled,
3206
3486
  hasAutoUpdatePreference,
3207
3487
  setAutoUpdate,
3208
3488
  canAutoUpdate,
3209
- login2 as login,
3210
3489
  box
3211
3490
  };