@vercel/cli-support 65.14.0 → 65.15.0-snapshot-ff25f3f66933
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.
- package/dist/chunks/add-63SUIZGX.js +8 -0
- package/dist/chunks/add-FTVNBJLV.js +8 -0
- package/dist/chunks/add-JJOY2UAF.js +8 -0
- package/dist/chunks/alerts-SNR4JKOI.js +8 -0
- package/dist/chunks/build-LM2L5H7D.js +7 -0
- package/dist/chunks/{chunk-OX5KSZFU.js → chunk-26HI5UUO.js} +1 -1
- package/dist/chunks/{chunk-2SVS5PWL.js → chunk-2B6WUOVU.js} +1 -1
- package/dist/chunks/{chunk-NR2JDEYD.js → chunk-2ONWHJT5.js} +1 -1
- package/dist/chunks/{chunk-4JPTCTBV.js → chunk-3BMYPWEY.js} +1 -1
- package/dist/chunks/{chunk-HNLLL52N.js → chunk-3VENFXBY.js} +1 -1
- package/dist/chunks/{chunk-QU4WGUNK.js → chunk-44XWDKGK.js} +1 -1
- package/dist/chunks/{chunk-RD45QAHF.js → chunk-4A2IRNN5.js} +1 -1
- package/dist/chunks/chunk-4KM7OKNQ.js +7 -0
- package/dist/chunks/{chunk-QEMYZTK7.js → chunk-4XH7ID62.js} +1 -1
- package/dist/chunks/{chunk-SJU4QJVF.js → chunk-5K4JQIXT.js} +1 -1
- package/dist/chunks/{chunk-A5UV4EAX.js → chunk-5NI34DGB.js} +1 -1
- package/dist/chunks/{chunk-MVOMOVK3.js → chunk-5OQL545S.js} +1 -1
- package/dist/chunks/{chunk-D4URLIDE.js → chunk-63FDIHG6.js} +1 -1
- package/dist/chunks/{chunk-NNHPXHOT.js → chunk-AMPA7GJJ.js} +1 -1
- package/dist/chunks/{chunk-7DT2GH67.js → chunk-AWS3XIC5.js} +1 -1
- package/dist/chunks/{chunk-UKBMDOUD.js → chunk-BTFAU5KV.js} +1 -1
- package/dist/chunks/chunk-BVIHERDQ.js +10 -0
- package/dist/chunks/{chunk-ZRHHEWGW.js → chunk-BVUPKUQX.js} +1 -1
- package/dist/chunks/{chunk-V4AZABH6.js → chunk-C5X4AET5.js} +1 -1
- package/dist/chunks/{chunk-6CHTRMWQ.js → chunk-C65YPDYZ.js} +1 -1
- package/dist/chunks/{chunk-2CMY3JXZ.js → chunk-CINU5WXR.js} +1 -1
- package/dist/chunks/{chunk-IWFB7TGB.js → chunk-DNBYNPEQ.js} +1 -1
- package/dist/chunks/{chunk-PURYFV4L.js → chunk-EZH3HTOS.js} +1 -1
- package/dist/chunks/{chunk-B7SLQSME.js → chunk-F4H6YJ3W.js} +1 -1
- package/dist/chunks/{chunk-6FP3V45O.js → chunk-FJTPVWDH.js} +1 -1
- package/dist/chunks/{chunk-VTM6RPYS.js → chunk-GD2G4YPE.js} +1 -1
- package/dist/chunks/{chunk-76FG2WPQ.js → chunk-GEXD62LF.js} +2 -2
- package/dist/chunks/chunk-GK445CTM.js +7 -0
- package/dist/chunks/{chunk-E3E7SPFO.js → chunk-GRH3TN3C.js} +1 -1
- package/dist/chunks/{chunk-AAD3PR73.js → chunk-HVNHF4YT.js} +1 -1
- package/dist/chunks/{chunk-LRBJZNET.js → chunk-I3B46CJP.js} +1 -1
- package/dist/chunks/{chunk-QUAIU6FH.js → chunk-I4TWSNQG.js} +1 -1
- package/dist/chunks/{chunk-QTTJMXKJ.js → chunk-IGIZBS6R.js} +1 -1
- package/dist/chunks/{chunk-FT5IZURV.js → chunk-JNWDS5I5.js} +1 -1
- package/dist/chunks/{chunk-BJBJYWAJ.js → chunk-KCLAUWOE.js} +1 -1
- package/dist/chunks/{chunk-ZP36CA3U.js → chunk-KLS5OROC.js} +1 -1
- package/dist/chunks/chunk-KPDAYSQS.js +10 -0
- package/dist/chunks/{chunk-JR3732RL.js → chunk-LJQ6I5U7.js} +1 -1
- package/dist/chunks/chunk-LOA7SZWH.js +7 -0
- package/dist/chunks/{chunk-E7T3YJRB.js → chunk-LPZDMWAU.js} +1 -1
- package/dist/chunks/chunk-LRCAUAEX.js +7 -0
- package/dist/chunks/{chunk-WKFLDUTU.js → chunk-M54QGGZY.js} +1 -1
- package/dist/chunks/{chunk-MBEYI5HF.js → chunk-MDXQPPAD.js} +1 -1
- package/dist/chunks/{chunk-Y6PC5E6Y.js → chunk-NA2URAJP.js} +1 -1
- package/dist/chunks/{chunk-N56EMHCO.js → chunk-NA5CGEQQ.js} +1 -1
- package/dist/chunks/{chunk-P3JKE7TX.js → chunk-P2DZUXJE.js} +1 -1
- package/dist/chunks/{chunk-RJJYX4RA.js → chunk-PM2B26M3.js} +1 -1
- package/dist/chunks/{chunk-WE5MHW2O.js → chunk-PTSMCYMO.js} +1 -1
- package/dist/chunks/chunk-PV6L7L3M.js +10 -0
- package/dist/chunks/{chunk-TEHLABJO.js → chunk-QNOF7F4W.js} +1 -1
- package/dist/chunks/chunk-RWPWNYXQ.js +11 -0
- package/dist/chunks/{chunk-ZZTIGQXP.js → chunk-TR3VJOOL.js} +1 -1
- package/dist/chunks/{chunk-WFH24UO3.js → chunk-UDYXJAKZ.js} +1 -1
- package/dist/chunks/{chunk-SAPTIA7Q.js → chunk-UMGS2S22.js} +1 -1
- package/dist/chunks/{chunk-25W3CLDF.js → chunk-VMYOYDLM.js} +1 -1
- package/dist/chunks/{chunk-BSCJRQ3E.js → chunk-VYR72PE3.js} +1 -1
- package/dist/chunks/chunk-W45KFKUW.js +7 -0
- package/dist/chunks/{chunk-4L6SITE4.js → chunk-WTCPCQO3.js} +1 -1
- package/dist/chunks/{chunk-TF5BOGQN.js → chunk-XNJGNXLC.js} +1 -1
- package/dist/chunks/{chunk-WAWNYFSK.js → chunk-XRIGLBI2.js} +1 -1
- package/dist/chunks/chunk-XYUCYNGO.js +12 -0
- package/dist/chunks/chunk-YE245S4O.js +7 -0
- package/dist/chunks/{chunk-5OOWE5CD.js → chunk-YWUDUQVB.js} +1 -1
- package/dist/chunks/{chunk-DMPPORR6.js → chunk-YZFIUGQU.js} +2 -2
- package/dist/chunks/{chunk-HWUQVJIJ.js → chunk-ZBCSM7TZ.js} +1 -1
- package/dist/chunks/{chunk-HDUZSFTK.js → chunk-ZHAPKFVM.js} +8 -8
- package/dist/chunks/{chunk-22FAXGPD.js → chunk-ZMDXQDUX.js} +1 -1
- package/dist/chunks/chunk-ZZMEF6YW.js +9 -0
- package/dist/chunks/clear-RH4DFMFS.js +8 -0
- package/dist/chunks/compile-vercel-config-5I2XTLGA.js +7 -0
- package/dist/chunks/config-7NAK6ELR.js +8 -0
- package/dist/chunks/{config-XH62NJX7.js → config-S7D5SXXX.js} +1 -1
- package/dist/chunks/contract-EOQS4PUF.js +11 -0
- package/dist/chunks/delete-BW3US2B4.js +9 -0
- package/dist/chunks/delete-IXPXDUKM.js +10 -0
- package/dist/chunks/{describe-RNFQJQD5.js → describe-CLIYKTIO.js} +1 -1
- package/dist/chunks/detect-services-H2CSYD7K.js +7 -0
- package/dist/chunks/disable-4CQ364WX.js +7 -0
- package/dist/chunks/discard-GM6F2QEE.js +14 -0
- package/dist/chunks/edit-CFBF2DHX.js +8 -0
- package/dist/chunks/edit-JWZ7JHNG.js +9 -0
- package/dist/chunks/enable-POFTCHC3.js +7 -0
- package/dist/chunks/{export-TVJDXCZA.js → export-2RBXGWD2.js} +1 -1
- package/dist/chunks/future-KRTXP2NN.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-XWDWUVOJ.js +7 -0
- package/dist/chunks/{image-NFARXO3R.js → image-ZNOJ5BHX.js} +1 -1
- package/dist/chunks/import-builders-INOS2CRI.js +7 -0
- package/dist/chunks/{inspect-H6LSGCYS.js → inspect-3SYISED5.js} +1 -1
- package/dist/chunks/inspect-7Z6NAOEA.js +13 -0
- package/dist/chunks/{inspect-RMP4AAQR.js → inspect-BX6N5NGY.js} +1 -1
- package/dist/chunks/inspect-PMF2QQNR.js +9 -0
- package/dist/chunks/inspect-XWAWYTTM.js +8 -0
- package/dist/chunks/{inspect-4RQLEUGZ.js → inspect-Y6B3I7VS.js} +1 -1
- package/dist/chunks/{list-6SRUT2BU.js → list-6BM2FFXL.js} +1 -1
- package/dist/chunks/list-I33FSRK2.js +8 -0
- package/dist/chunks/list-UHGKMLS7.js +12 -0
- package/dist/chunks/{list-WEGUICE6.js → list-YB4SK7JQ.js} +1 -1
- package/dist/chunks/login-COGUODSF.js +9 -0
- package/dist/chunks/{purchase-domain-if-available-66DVKBZ5.js → login-V7NNX7G5.js} +1 -1
- package/dist/chunks/logs-6YKT7CLQ.js +7 -0
- package/dist/chunks/{ls-PTRVCVXJ.js → ls-GIPBHSUE.js} +1 -1
- package/dist/chunks/{ls-7JX4KZXU.js → ls-OPHCNF47.js} +1 -1
- package/dist/chunks/{ls-YC4IWYN7.js → ls-S2FS2RJL.js} +1 -1
- package/dist/chunks/ls-SSPPCRZA.js +11 -0
- package/dist/chunks/{ls-CKOBQXUR.js → ls-Y6RU35DL.js} +1 -1
- package/dist/chunks/{ls-7Z5WT5OK.js → ls-YL7CECSE.js} +1 -1
- package/dist/chunks/ls-YVI4FS34.js +8 -0
- package/dist/chunks/migrate-experimental-services-HHEYJ3EC.js +7 -0
- package/dist/chunks/mutate-ZAEQRAJ2.js +9 -0
- package/dist/chunks/{notifications-BTVI6EIG.js → notifications-QLQMKDQE.js} +1 -1
- package/dist/chunks/open-Y6RMPEQW.js +7 -0
- package/dist/chunks/{permissions-JGQHHLCP.js → permissions-MWO4CAST.js} +1 -1
- package/dist/chunks/{plugin-offer-OQF2T2HP.js → plugin-offer-F7345TVV.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-HMZJOZXY.js +7 -0
- package/dist/chunks/publish-5NZFNIHX.js +15 -0
- package/dist/chunks/pull-WVZPWJ5E.js +7 -0
- package/dist/chunks/purchase-domain-if-available-7NYSS4PT.js +7 -0
- package/dist/chunks/push-5KDOQ2KV.js +7 -0
- package/dist/chunks/{query-XKNAII7Y.js → query-IMYCCJ7D.js} +1 -1
- package/dist/chunks/reauthenticate-KGWNCD4L.js +7 -0
- package/dist/chunks/remove-TULHNFGP.js +9 -0
- package/dist/chunks/reorder-BD4O4IHH.js +10 -0
- package/dist/chunks/reply-DGXOGKDS.js +9 -0
- package/dist/chunks/resolve-67YIJ2JQ.js +12 -0
- package/dist/chunks/resolve-agent-team-LEWHIJGT.js +7 -0
- package/dist/chunks/restore-Z7QQ7FTO.js +16 -0
- package/dist/chunks/rm-HTNTY7A7.js +8 -0
- package/dist/chunks/rm-MDLFUMTM.js +8 -0
- package/dist/chunks/rm-RYJR3Z6Z.js +8 -0
- package/dist/chunks/rm-WGTRKNYK.js +8 -0
- package/dist/chunks/rm-XADFVFRB.js +8 -0
- package/dist/chunks/rule-inspect-TINSZNWB.js +8 -0
- package/dist/chunks/{schema-DULOJDLJ.js → schema-32WJMSPO.js} +1 -1
- package/dist/chunks/schema-QWMFAIG7.js +14 -0
- package/dist/chunks/select-org-MK2XRB5D.js +7 -0
- package/dist/chunks/set-B5MARIVL.js +7 -0
- package/dist/chunks/set-MMPBGIWR.js +8 -0
- package/dist/chunks/setup-and-link-DRFJTYTX.js +7 -0
- package/dist/chunks/{tags-FHC6EMQ2.js → tags-CRCAU65V.js} +1 -1
- package/dist/chunks/{update-S6EDQLRE.js → update-VVHV2M46.js} +1 -1
- package/dist/chunks/usage-OXA6T6IL.js +13 -0
- package/dist/chunks/{validate-config-YBBR32MV.js → validate-config-QBDSJCTR.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +1 -1
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +37 -39
- package/dist/commands-ai.js +3 -3
- package/dist/commands-blob.js +2 -2
- package/dist/commands-core.js +58 -44
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +1 -1
- package/dist/commands-integrations.js +30 -17
- package/dist/commands-observability.js +8 -7
- package/dist/commands-routing.js +44 -27
- package/dist/help.js +1 -1
- package/dist/index.js +4 -4
- package/dist/internal-build.js +1 -1
- package/dist/package.json +11 -11
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +16 -16
- package/dist/chunks/add-BYNKYST2.js +0 -8
- package/dist/chunks/add-HXK3HUQG.js +0 -8
- package/dist/chunks/add-WTK2AFMX.js +0 -8
- package/dist/chunks/alerts-XAOLRZK3.js +0 -8
- package/dist/chunks/build-BXCATM4H.js +0 -7
- package/dist/chunks/chunk-5YLKPSZI.js +0 -7
- package/dist/chunks/chunk-623OWG6A.js +0 -7
- package/dist/chunks/chunk-EWHM5VFZ.js +0 -10
- package/dist/chunks/chunk-JLURS22G.js +0 -7
- package/dist/chunks/chunk-K5Z2NE3P.js +0 -7
- package/dist/chunks/chunk-KHXWKYEZ.js +0 -10
- package/dist/chunks/chunk-LGN3TASP.js +0 -7
- package/dist/chunks/chunk-MGFM2KHC.js +0 -11
- package/dist/chunks/chunk-PLGG2AWX.js +0 -10
- package/dist/chunks/chunk-TPKFVYL5.js +0 -12
- package/dist/chunks/clear-IVHCV4EA.js +0 -8
- package/dist/chunks/compile-vercel-config-PYYVTC3B.js +0 -7
- package/dist/chunks/config-JUMF25FF.js +0 -8
- package/dist/chunks/contract-BLBTK32L.js +0 -10
- package/dist/chunks/delete-6FYWPVDH.js +0 -9
- package/dist/chunks/delete-PVH4423M.js +0 -10
- package/dist/chunks/detect-services-25NRRPII.js +0 -7
- package/dist/chunks/disable-HOKABZ7L.js +0 -7
- package/dist/chunks/discard-TLBZGTGN.js +0 -14
- package/dist/chunks/edit-HSJ4FSZQ.js +0 -8
- package/dist/chunks/edit-NNIE7NNF.js +0 -9
- package/dist/chunks/enable-TY6QUZWZ.js +0 -7
- package/dist/chunks/future-OELW62EE.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-HBBZE5NA.js +0 -7
- package/dist/chunks/import-builders-ZEJEFXAX.js +0 -7
- package/dist/chunks/inspect-HXE2UT6Z.js +0 -8
- package/dist/chunks/inspect-OCHE3DVA.js +0 -13
- package/dist/chunks/inspect-UTYZYPSK.js +0 -9
- package/dist/chunks/list-YYHMAGMG.js +0 -8
- package/dist/chunks/list-ZXY2AMNN.js +0 -12
- package/dist/chunks/login-DBKNZ6RP.js +0 -7
- package/dist/chunks/login-XNS4A4L7.js +0 -9
- package/dist/chunks/logs-F7AR7Y5S.js +0 -7
- package/dist/chunks/ls-GGIZNTY4.js +0 -11
- package/dist/chunks/ls-ISBLA37G.js +0 -8
- package/dist/chunks/migrate-experimental-services-XHPJAZFK.js +0 -7
- package/dist/chunks/mutate-AQGXSJED.js +0 -9
- package/dist/chunks/open-TZLOIAGJ.js +0 -7
- package/dist/chunks/prompt-missing-credentials-ATEAZE3Q.js +0 -7
- package/dist/chunks/publish-E2QCYVQM.js +0 -15
- package/dist/chunks/pull-YEEZTBZB.js +0 -7
- package/dist/chunks/push-WT2R2MH2.js +0 -7
- package/dist/chunks/reauthenticate-JONKFLTL.js +0 -7
- package/dist/chunks/remove-PLSYF2ZB.js +0 -9
- package/dist/chunks/reorder-4UCOO5AJ.js +0 -10
- package/dist/chunks/reply-B2OCHHMQ.js +0 -9
- package/dist/chunks/resolve-PU5UR7JC.js +0 -12
- package/dist/chunks/resolve-agent-team-FFV2K42Z.js +0 -7
- package/dist/chunks/restore-7AWVT7RT.js +0 -16
- package/dist/chunks/rm-523X3JI3.js +0 -8
- package/dist/chunks/rm-DTGRJLGC.js +0 -8
- package/dist/chunks/rm-GHF2AEO6.js +0 -8
- package/dist/chunks/rm-GVFFKCYP.js +0 -8
- package/dist/chunks/rm-QXPFFK7Z.js +0 -8
- package/dist/chunks/rule-inspect-N3B2737B.js +0 -8
- package/dist/chunks/schema-KZ3NXHDV.js +0 -14
- package/dist/chunks/select-org-RK3NJUXQ.js +0 -7
- package/dist/chunks/set-CYNAACFX.js +0 -7
- package/dist/chunks/set-UDHZOYCP.js +0 -8
- package/dist/chunks/setup-and-link-BUARMJER.js +0 -7
- package/dist/chunks/usage-OZY35PJU.js +0 -13
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getNativePackageName}from"./chunk-T7GKQYWA.js";import{HOMEBREW_UPGRADE_COMMAND,execPackageManager,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,packageManagerInvocation,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-WAWNYFSK.js";import{require_semver}from"./chunk-BPUANOGW.js";import{withDirectoryLock}from"./chunk-TABMJZVW.js";import{progress}from"./chunk-U56NHYAH.js";import{require_ci_info}from"./chunk-KDCODXVL.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{getCachedUsername,require_lib}from"./chunk-HDUZSFTK.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_fetch_dist_tags=__commonJS({"src/util/get-latest-version/fetch-dist-tags.cjs"(exports,module){"use strict";var https=__require("https");function fetchDistTags(name,options){let timeout=options&&options.timeout||3e3,agent=new https.Agent({keepAlive:!0,maxSockets:15}),headers={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},url=`https://registry.npmjs.org/-/package/${name}/dist-tags`;return new Promise(resolve2=>{let timer=setTimeout(()=>{req.destroy(),resolve2(void 0)},timeout),req=https.get(url,{agent,headers},res=>{let buf="";res.on("data",chunk=>{buf+=chunk}),res.on("end",()=>{clearTimeout(timer);try{if(res.statusCode&&res.statusCode>=400){resolve2(void 0);return}resolve2(JSON.parse(buf))}catch{resolve2(void 0)}})});req.on("error",()=>{clearTimeout(timer),resolve2(void 0)})})}module.exports={fetchDistTags}}});function getWhoamiCachedAnswer(args,authConfig){return args.includes("--cached")?getCachedUsername(authConfig):void 0}var import_semver=__toESM(require_semver(),1);import{spawn}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return execPackageManager(command,args,{cwd,env,timeout:15e3})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
|
|
7
|
+
import{getNativePackageName}from"./chunk-T7GKQYWA.js";import{HOMEBREW_UPGRADE_COMMAND,execPackageManager,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,packageManagerInvocation,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-XRIGLBI2.js";import{require_semver}from"./chunk-BPUANOGW.js";import{withDirectoryLock}from"./chunk-TABMJZVW.js";import{progress}from"./chunk-U56NHYAH.js";import{require_ci_info}from"./chunk-KDCODXVL.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{getCachedUsername,require_lib}from"./chunk-ZHAPKFVM.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_fetch_dist_tags=__commonJS({"src/util/get-latest-version/fetch-dist-tags.cjs"(exports,module){"use strict";var https=__require("https");function fetchDistTags(name,options){let timeout=options&&options.timeout||3e3,agent=new https.Agent({keepAlive:!0,maxSockets:15}),headers={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},url=`https://registry.npmjs.org/-/package/${name}/dist-tags`;return new Promise(resolve2=>{let timer=setTimeout(()=>{req.destroy(),resolve2(void 0)},timeout),req=https.get(url,{agent,headers},res=>{let buf="";res.on("data",chunk=>{buf+=chunk}),res.on("end",()=>{clearTimeout(timer);try{if(res.statusCode&&res.statusCode>=400){resolve2(void 0);return}resolve2(JSON.parse(buf))}catch{resolve2(void 0)}})});req.on("error",()=>{clearTimeout(timer),resolve2(void 0)})})}module.exports={fetchDistTags}}});function getWhoamiCachedAnswer(args,authConfig){return args.includes("--cached")?getCachedUsername(authConfig):void 0}var import_semver=__toESM(require_semver(),1);import{spawn}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return execPackageManager(command,args,{cwd,env,timeout:15e3})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
|
|
8
8
|
`).reverse()])try{let value=JSON.parse(line),parsed=Array.isArray(value)&&value.length===1?value[0]:value,version=typeof parsed=="string"?parsed:typeof parsed?.data=="string"?parsed.data:void 0;if(version&&import_semver.default.valid(version))return version}catch{let version=line.trim();if(import_semver.default.valid(version))return version}}async function getLatestPackageVersion(packageManager,installArgs,cwd,global,env,bypassMinReleaseAge=!0){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let manager=getUpgradePackageManager(packageManager),queryArgs=[...manager.metadataArgs(packageSpecifier),...bypassMinReleaseAge?manager.releaseAgeBypassArgs:[]];try{let stdout=await execFileStdout(packageManager,queryArgs,cwd,env);return parseVersionOutput(stdout)}catch(error){output_manager_default.debug(`Failed to resolve the latest Vercel CLI version: ${error instanceof Error?error.message:String(error)}`);return}}async function getInstalledPackageVersion(packageManager,installArgs,cwd,global){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let packageName=packageSpecifier.slice(0,-7);try{let stdout=await execFileStdout(packageManager,["list",packageName,"--depth=0","--json",...global?["--global"]:[]],cwd),parsed=JSON.parse(stdout),projects=Array.isArray(parsed)?parsed:[parsed];for(let project of projects){let version=project?.dependencies?.[packageName]?.version??project?.devDependencies?.[packageName]?.version??project?.optionalDependencies?.[packageName]?.version;if(typeof version=="string"&&import_semver.default.valid(version))return version}}catch(error){output_manager_default.debug(`Failed to read the installed Vercel CLI version: ${error instanceof Error?error.message:String(error)}`)}}function isVersionCurrent(current,latest){return import_semver.default.valid(current)&&import_semver.default.valid(latest)?import_semver.default.gte(current,latest):current===latest}function pinPackageVersion(args,version){return args.map(arg=>arg.endsWith("@latest")?`${arg.slice(0,-6)}${version}`:arg)}async function getMinReleaseAgeContext(packageManager,cwd,global){let setting=packageManager==="pnpm"?"minimumReleaseAge":"min-release-age";try{let raw=(await execFileStdout(packageManager,["config","get",setting,"--json",...global?["--global"]:[]],cwd)).trim(),value=raw===""||raw==="undefined"?void 0:JSON.parse(raw);if(!(value==null||value===""||value==="undefined")){let age=typeof value=="number"||typeof value=="string"&&value.trim()!==""?Number(value):NaN;if(!Number.isFinite(age)||age<0)return`Could not determine ${packageManager}'s configured minimum release age.`;let minutes=packageManager==="pnpm"?age:age*1440,duration=minutes>0&&minutes%60===0?`${minutes/60} ${minutes===60?"hour":"hours"}`:`${minutes} ${minutes===1?"minute":"minutes"}`;return`${packageManager} ${setting} is configured to ${duration}.`}if(packageManager==="pnpm"){let version=parseVersionOutput(await execFileStdout(packageManager,["--version"],cwd));if(version&&!import_semver.default.prerelease(version)&&import_semver.default.gte(version,"11.0.0"))return`pnpm ${version} defaults to a minimum release age of 24 hours (1440 minutes); no explicit minimumReleaseAge setting was reported.`}return`${packageManager} did not report a configured minimum release age.`}catch{return`Could not determine ${packageManager}'s configured minimum release age.`}}function isMinReleaseAgeError(packageManager,stdout,stderr){let installerOutput=`${stdout}
|
|
9
9
|
${stderr}`;return packageManager==="pnpm"?installerOutput.includes("ERR_PNPM_NO_MATURE_MATCHING_VERSION")||installerOutput.includes("ERR_PNPM_NO_MATCHING_VERSION")&&installerOutput.includes("satisfies the specs but was released at"):packageManager==="npm"?/\bETARGET\b/.test(installerOutput)&&installerOutput.includes("with a date before")||/min-release-age cannot be provided/i.test(installerOutput):!1}function setMinReleaseAgeBypass(client,enabled){client.config={...client.config,updates:{...client.config.updates,bypassMinReleaseAge:enabled}},client.writeToConfigFile()}async function executeHomebrewUpgrade(env=trustedUpgradeEnvironment){let[brew,...args]=HOMEBREW_UPGRADE_COMMAND.split(" ");output_manager_default.debug(`Executing: ${HOMEBREW_UPGRADE_COMMAND}`);let result=await new Promise(resolve2=>{let settled=!1,brewProcess=spawn(brew,args,{cwd:trustedUpgradeDirectory,env:{...env},stdio:"inherit",shell:!1});brewProcess.on("error",spawnError=>{settled||(settled=!0,resolve2({code:1,spawnError}))}),brewProcess.on("close",code=>{settled||(settled=!0,resolve2({code:code??1}))})});return result.spawnError?(output_manager_default.error(`Failed to run Homebrew: ${result.spawnError.message}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`),1):(result.code!==0&&(output_manager_default.error(`Homebrew upgrade failed with exit code ${result.code}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`)),result.code)}function executeAutomaticUpgrade(client,env=trustedUpgradeEnvironment){return executeUpgrade("latest",client,!1,!0,env,"package-manager")}async function executeUpgrade(targetVersion,client,bypassMinReleaseAge=!1,explicitTarget=!1,env=trustedUpgradeEnvironment,releaseAgePolicy="newest",outcome){let totalSteps=targetVersion?2:3;renderUpgradeProgress(0,totalSteps,"Resolving installer\u2026");let{command:updateCommand,global,packageManager}=await getUpdateCommandInfo(env).catch(error=>{throw output_manager_default.stopSpinner(),error}),[command,...args]=updateCommand.split(" "),cwd=global?trustedUpgradeDirectory:process.cwd(),bypassArgs=getUpgradePackageManager(packageManager).releaseAgeBypassArgs;if(bypassMinReleaseAge&&bypassArgs.length===0)return output_manager_default.stopSpinner(),output_manager_default.error(`Minimum release-age bypass is not supported for ${packageManager}. Run the upgrade without --bypass-min-release-age, or configure release-age settings in ${packageManager} directly.`),1;bypassMinReleaseAge&&client&&client.config.updates?.bypassMinReleaseAge!==!0&&setMinReleaseAgeBypass(client,!0);let versionBefore=pkg_default.version,installLatestTag=explicitTarget&&targetVersion==="latest",resolvedTargetVersion=installLatestTag?void 0:targetVersion;if(targetVersion||(renderUpgradeProgress(1,totalSteps,"Checking for updates\u2026"),resolvedTargetVersion=await getLatestPackageVersion(packageManager,args,cwd,global,env,releaseAgePolicy==="newest")),!resolvedTargetVersion&&!installLatestTag)return output_manager_default.stopSpinner(),output_manager_default.error("Failed to resolve the latest Vercel CLI version."),1;if(!explicitTarget&&resolvedTargetVersion&&isVersionCurrent(versionBefore,resolvedTargetVersion))return renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.log(`No upgrade available. Vercel CLI is already up to date (v${versionBefore}).`),0;let installArgs=resolvedTargetVersion?pinPackageVersion(args,resolvedTargetVersion):args,shouldBypass=releaseAgePolicy==="newest"&&bypassArgs.length>0&&(bypassMinReleaseAge||client?.config.updates?.bypassMinReleaseAge===!0);shouldBypass&&(installArgs=[...installArgs,...bypassArgs]);let runInstall=currentArgs=>{let installCommand=[command,...currentArgs].join(" ");return output_manager_default.debug(`Executing: ${installCommand} (cwd: ${cwd})`),new Promise(resolve2=>{let stdout=[],stderr=[],invocation;try{invocation=packageManagerInvocation(command,currentArgs,env)}catch(spawnError){resolve2({code:1,stdout:"",stderr:"",spawnError});return}let upgradeProcess=spawn(invocation.file,invocation.args,{cwd,env:{...env},stdio:["inherit","pipe","pipe"],shell:!1,windowsVerbatimArguments:invocation.windowsVerbatimArguments});upgradeProcess.stdout?.on("data",data=>{stdout.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stdout] ${data.toString().trimEnd()}`)}),upgradeProcess.stderr?.on("data",data=>{stderr.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stderr] ${data.toString().trimEnd()}`)});let settled=!1;upgradeProcess.on("error",spawnError=>{settled||(settled=!0,resolve2({code:1,stdout:"",stderr:"",spawnError}))}),upgradeProcess.on("close",code=>{settled||(settled=!0,resolve2({code:code??1,stdout:Buffer.concat(stdout).toString(),stderr:Buffer.concat(stderr).toString()}))})})};renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026");let result=await runInstall(installArgs),usedAllowedRelease=!1;if(result.code!==0&&!result.spawnError&&releaseAgePolicy==="newest"&&!shouldBypass&&bypassArgs.length>0&&isMinReleaseAgeError(packageManager,result.stdout,result.stderr)){let context=await getMinReleaseAgeContext(packageManager,cwd,global);output_manager_default.stopSpinner();let blockedMessage=`The package manager blocked this Vercel CLI release because of its minimum release-age setting. ${context}`;if(!client||client.nonInteractive||!client.stdin.isTTY)return output_manager_default.error(`${blockedMessage}
|
|
10
10
|
To install the newest release allowed by your settings:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getOrganization}from"./chunk-ZZMEF6YW.js";import{budgetPauses,formatUsd,formatUsdWhole,listBudgetProducts,percentUsed}from"./chunk-W45KFKUW.js";import{table}from"./chunk-CJZE7647.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{ProjectNotFound}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function webhookLabel(budget){return budget.webhook?budget.webhook.url??"configured (unavailable)":"\u2014"}function scopeCells(budget,names){let{scope,scopeId}=budget;return[scope,scopeId?names?.get(scopeId)??scopeId:"\u2014"]}function printBudgetsTable(budgets,spentFor,names){let spendHeaders=spentFor?["spent","used"]:[],spendAlign=spentFor?["r","r"]:[];return`${table([["type","name","amount",...spendHeaders,"status","pause","webhook"].map(header=>import_chalk.default.gray(header)),...budgets.map(budget=>{let spendCells=[];if(spentFor){let spent=spentFor(budget),used=percentUsed(spent,budget.amount);spendCells.push(spent===null?"\u2014":formatUsd(spent),used===null?"\u2014":`${used}%`)}return[...scopeCells(budget,names),formatUsdWhole(budget.amount),...spendCells,budget.status,budgetPauses(budget)?"yes":"no",webhookLabel(budget)]})],{align:["l","l","r",...spendAlign,"l","l","l"],hsep:4}).replace(/^/gm," ")}
|
|
8
|
+
|
|
9
|
+
`}function warnUnavailableWebhooks(budgets){budgets.some(budget=>budget.webhook&&budget.webhook.url===null)&&output_manager_default.warn("A webhook is configured, but its URL could not be loaded. That is not the same as having no webhook.")}function formatAlertTime(ms){return Number.isFinite(ms)?`${new Date(ms).toISOString().slice(0,16).replace("T"," ")} UTC`:"\u2014"}function formatUsdString(value){let dollars=Number(value);return Number.isFinite(dollars)?formatUsd(dollars):value}function alertThresholdLabel(alert){return`${alert.threshold.percent}%`}function alertActionsLabel(alert){let{sendNotifications,triggerWebhook,pauseUsage}=alert.threshold,actions=[sendNotifications&&"notify",triggerWebhook&&"webhook",pauseUsage&&"pause"].filter(Boolean);return actions.length>0?actions.join(", "):"\u2014"}function printBudgetAlertsTable(alerts,names){return`${table([["date","type","name","threshold","spent","budget amount","actions configured"].map(header=>import_chalk.default.gray(header)),...alerts.map(alert=>[formatAlertTime(alert.triggeredAt),...scopeCells(alert,names),alertThresholdLabel(alert),formatUsdString(alert.spent),formatUsdWhole(alert.budgetAmount),alertActionsLabel(alert)])],{align:["l","l","l","r","r","r","l"],hsep:4}).replace(/^/gm," ")}
|
|
10
|
+
|
|
11
|
+
`}function scopeNameOf(names,item){return item.scopeId?names.get(item.scopeId)??null:null}function scopeIds(items,scope){let ids=new Set;for(let item of items)item.scope===scope&&item.scopeId&&ids.add(item.scopeId);return[...ids]}async function loadScopeNames(client,team,items){let names=new Map([[team.id,team.slug]]),projectIds=scopeIds(items,"project"),hasProducts=scopeIds(items,"product").length>0;return await Promise.all([...scopeIds(items,"organization").map(id=>getOrganization(client,id).then(organization=>{names.set(id,organization.slug)},()=>{})),hasProducts&&listBudgetProducts(client).then(products=>{for(let product of products)names.set(product.id,product.name)},()=>{}),...projectIds.map(async id=>{let project=await getProjectByNameOrId(client,id,team.id).catch(()=>{});project&&!(project instanceof ProjectNotFound)&&names.set(id,project.name)})]),names}function targetScopeNames(target,items){let{name}=target.json,names=new Map;if(name)for(let{scopeId}of items)scopeId&&names.set(scopeId,name);return names}export{printBudgetsTable,warnUnavailableWebhooks,printBudgetAlertsTable,scopeNameOf,loadScopeNames,targetScopeNames};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-REJLEESP.js";import{pullEnvRecords}from"./chunk-
|
|
7
|
+
import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-REJLEESP.js";import{pullEnvRecords}from"./chunk-KCLAUWOE.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__toESM}from"./chunk-BZENIQ7N.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}import{existsSync,readFileSync}from"node:fs";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir));if(linkLocation==="")return{repoRoot,resolvedRootDirectory:""};let setting=normalizeRelative(rootDirectorySetting??"");return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join(anchorDir,setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_ci_info}from"./chunk-KDCODXVL.js";import{getConfigFilePath}from"./chunk-
|
|
7
|
+
import{require_ci_info}from"./chunk-KDCODXVL.js";import{getConfigFilePath}from"./chunk-ZHAPKFVM.js";import{wantsMachineReadableOutput}from"./chunk-6GKP6VUF.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_ci_info=__toESM(require_ci_info(),1);function isInteractiveHumanRun(client,command,{allowAgentOverride=!1}={}){let argv=client.argv.slice(2),explicitInteraction=allowAgentOverride&&(argv.includes("--non-interactive=false")||argv.includes("--no-non-interactive")||argv.includes("--non-interactive")&&argv[argv.indexOf("--non-interactive")+1]==="false");return(!client.isAgent||explicitInteraction)&&!client.nonInteractive&&!import_ci_info.default.isCI&&client.stdin.isTTY===!0&&client.stderr.isTTY===!0&&!wantsMachineReadableOutput(command,client.argv)}var import_cli_config=__toESM(require_cli_config(),1);function markOnboardingSeen(client,key){client.config[key]=!0;try{let path=getConfigFilePath();(0,import_cli_config.writeGlobalConfigFile)(path,{...(0,import_cli_config.readGlobalConfigFile)(path),[key]:!0})}catch{output_manager_default.debug(`Could not save ${key}.`)}}export{isInteractiveHumanRun,markOnboardingSeen};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{resolveProjectContext}from"./chunk-WTCPCQO3.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-IRNQJ6ZX.js";import{parseArguments}from"./chunk-NHB43235.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-EZVNGJN5.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}export{requireProjectContext,parseSubcommandArguments,validateRequiredArguments};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{createDetectEntrypoint,getServicesConfigWriteBlocker,writeServicesConfig}from"./chunk-
|
|
7
|
+
import{createDetectEntrypoint,getServicesConfigWriteBlocker,writeServicesConfig}from"./chunk-KLS5OROC.js";import{detectProjects}from"./chunk-UZXQY5X5.js";import{require_dist as require_dist2}from"./chunk-3JM374FP.js";import{validateRootDirectory}from"./chunk-MDXQPPAD.js";import{require_slugify}from"./chunk-COD3WAUI.js";import{createProject}from"./chunk-ANIA2G6F.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-YWUDUQVB.js";import{readJSONFile}from"./chunk-I3B46CJP.js";import{checkExistsAndConnect,parseRepoUrl,selectAndParseRemoteUrl}from"./chunk-L75A5BMY.js";import{Separator}from"./chunk-YTRKHRL3.js";import{selectOrg}from"./chunk-BTFAU5KV.js";import{require_dist}from"./chunk-MTJLZGL5.js";import{pull}from"./chunk-IGIZBS6R.js";import{require_frameworks}from"./chunk-ZKNEIE44.js";import{table}from"./chunk-CJZE7647.js";import{printError}from"./chunk-ZMT7EYYL.js";import{VERCEL_DIR_PROJECT,VERCEL_DIR_README,fetchProjectsForRepoUrl,findProjectsFromPath,findRepoRoot,getGitConfigPath,getLinkedProject,getLocalPathConfig,getRemoteUrls,getVercelDirectory,humanizePath,isDirectory,isPromptBackError,isPromptCanceledError,linkFolderToProject,linkRepoProject,localConfigFlagPath,parseGitConfig,pluckRemoteUrls,require_lib,resolveGitRemote}from"./chunk-ZHAPKFVM.js";import{printAlignedLabel}from"./chunk-M7FED5YP.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{CantParseJSONFile,ProjectNotFound,isAPIError}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1),import_build_utils4=__toESM(require_build_utils(),1),import_fs_detectors2=__toESM(require_dist(),1);import{join as join4,basename}from"path";var import_chalk=__toESM(require_source(),1);var import_slugify=__toESM(require_slugify(),1);var SEARCH_ALL_PROJECTS="search-all-projects",CREATE_NEW_PROJECT="create-new-project",BACK_TO_PROJECT_SELECTION=Symbol("back-to-project-selection"),BACK_TO_TEAM_SELECTION=Symbol("back-to-team-selection"),SWITCH_GIT_REMOTE=Symbol("switch-git-remote"),NO_EXISTING_PROJECTS=Symbol("no-existing-projects");async function inputProjectDecision(client,defaultDecision){let createChoice={name:"Create new project",value:"create"},existingChoice={name:"Link existing project",value:"existing"};return await client.input.select({message:"Project?",choices:defaultDecision==="existing"?[existingChoice,createChoice]:[createChoice,existingChoice]})}function randomNameSuffix(){return Math.random().toString(36).slice(2,6).padEnd(4,"0")}async function suggestNewProjectName(client,org,slugifiedName,knownTaken){let taken=knownTaken;if(!taken)try{taken=!(await getProjectByNameOrId(client,slugifiedName,org.id)instanceof ProjectNotFound)}catch{taken=!1}return taken?`${slugifiedName}-${randomNameSuffix()}`:slugifiedName}function promptForProjectName(client,org,defaultName,message="Name?"){return client.input.text({message,default:defaultName,validate:async val=>val?await getProjectByNameOrId(client,val,org.id)instanceof ProjectNotFound?!0:"Project already exists":"Project name cannot be empty"})}async function promptForProjectNameWithBack(client,org,defaultName){try{return await client.withPromptBackNavigation(()=>promptForProjectName(client,org,defaultName,`Name? ${import_chalk.default.dim("Press \u2191 to return to project options")}`))}catch(error){if(isPromptBackError(error))return BACK_TO_PROJECT_SELECTION;throw error}}async function searchExistingProjects(client,org,allowBack){let firstPage=await client.fetch("/v9/projects?limit=100",{accountId:org.id}),projects=firstPage.projects,hasMoreProjects=firstPage.pagination.next!=null;if(projects.length===0)return output_manager_default.log(`No existing projects found under ${import_chalk.default.bold(org.slug)}. Creating new project.`),NO_EXISTING_PROJECTS;let pageSize=15,countHint=projects.length>pageSize?` ${import_chalk.default.dim(`(${hasMoreProjects?"100+":projects.length} projects)`)}`:"";return await client.input.search({message:`Which project?${countHint}`,pageSize,source:async(term,{signal})=>{let searchTerm=term?.trim(),matchingProjects=projects;if(searchTerm)if(hasMoreProjects)matchingProjects=(await client.fetch(`/v9/projects?search=${encodeURIComponent(searchTerm)}&limit=20`,{accountId:org.id,signal})).projects;else{let normalizedSearchTerm=searchTerm.toLowerCase();matchingProjects=projects.filter(project=>project.name.toLowerCase().includes(normalizedSearchTerm)||project.id===searchTerm)}let choices=matchingProjects.slice().sort((a,b)=>b.updatedAt-a.updatedAt).map(project=>({name:project.name,value:project}));if(!allowBack)return choices;let backChoice={name:"Back to project options",value:BACK_TO_PROJECT_SELECTION};return choices.length===0?[backChoice]:searchTerm?choices:[...choices,new Separator,backChoice]}})}async function inputProject(client,org,detectedProjectName,autoConfirm=!1,skipAutoDetect=!1,showProjectSuggestions=!1,allowTeamSelectionBack=!1,repoMatches=[],gitRemoteOptions){let slugifiedName=(0,import_slugify.default)(detectedProjectName),canSwitchGitRemote=(gitRemoteOptions?.remoteNames.length??0)>1,detectedProject=null;if(!skipAutoDetect&&repoMatches.length===0){output_manager_default.spinner("Searching for existing projects\u2026",1e3);let[project,slugifiedProject]=await Promise.all([getProjectByNameOrId(client,detectedProjectName,org.id),slugifiedName!==detectedProjectName?getProjectByNameOrId(client,slugifiedName,org.id):null]);if(detectedProject=project instanceof ProjectNotFound?slugifiedProject instanceof ProjectNotFound?null:slugifiedProject:project,detectedProject&&!detectedProject.id)throw new Error('Detected linked project does not have "id".');output_manager_default.stopSpinner()}if(autoConfirm)return repoMatches.length===1?repoMatches[0]:detectedProject||detectedProjectName;if(client.nonInteractive){if(detectedProject)return detectedProject;let err=new Error("Confirmation required");throw err.code="HEADLESS",err}let slugifiedNameKnownFree=!skipAutoDetect&&repoMatches.length===0&&!detectedProject,memoizedDefaultName;async function defaultNewProjectName(){return memoizedDefaultName===void 0&&(memoizedDefaultName=slugifiedNameKnownFree?slugifiedName:await suggestNewProjectName(client,org,slugifiedName,detectedProject?.name===slugifiedName)),memoizedDefaultName}let shouldLinkProject;if(showProjectSuggestions&&!skipAutoDetect)for(;;){let choices=[];if(repoMatches.length>0?choices.push(...repoMatches.map(match=>({name:`${match.project.name} ${import_chalk.default.gray("(linked by git)")}`,value:match})),new Separator):detectedProject&&choices.push({name:`${detectedProject.name} ${import_chalk.default.gray("(folder name)")}`,value:detectedProject},new Separator),choices.push({name:"Search all projects",value:SEARCH_ALL_PROJECTS,description:"Browse or search every project in this team"},{name:"Create a new project",value:CREATE_NEW_PROJECT,description:`Create it under ${org.slug}`}),canSwitchGitRemote){let current=gitRemoteOptions?.currentRemoteName;choices.push({name:"Switch Git remote",value:SWITCH_GIT_REMOTE,description:current?`Suggestions are from ${current}`:"Search projects linked to a different remote"})}allowTeamSelectionBack&&choices.push({name:"Choose a different team",value:BACK_TO_TEAM_SELECTION,description:"Return to team selection"});let selected=await client.input.select({message:"Which project?",choices});if(selected===BACK_TO_TEAM_SELECTION)return BACK_TO_TEAM_SELECTION;if(selected===SWITCH_GIT_REMOTE)return SWITCH_GIT_REMOTE;if(selected===CREATE_NEW_PROJECT){let projectName=await promptForProjectNameWithBack(client,org,await defaultNewProjectName());if(projectName===BACK_TO_PROJECT_SELECTION)continue;return projectName}if(selected!==SEARCH_ALL_PROJECTS)return selected;let existingProject=await searchExistingProjects(client,org,!0);if(existingProject!==BACK_TO_PROJECT_SELECTION){if(existingProject===NO_EXISTING_PROJECTS){let projectName=await promptForProjectNameWithBack(client,org,slugifiedName);if(projectName===BACK_TO_PROJECT_SELECTION)continue;return projectName}return existingProject}}else if(!detectedProject)shouldLinkProject=await inputProjectDecision(client,skipAutoDetect?"existing":"create")==="existing";else{if(output_manager_default.print(` ${import_chalk.default.bold("Found existing project")}
|
|
8
8
|
`),printAlignedLabel("Project",`${org.slug}/${detectedProject.name}`),await client.input.confirm("Link directory to project?",!0))return detectedProject;shouldLinkProject=await inputProjectDecision(client,"existing")==="existing"}if(shouldLinkProject){let existingProject=await searchExistingProjects(client,org,!1);if(existingProject!==NO_EXISTING_PROJECTS&&existingProject!==BACK_TO_PROJECT_SELECTION)return existingProject}return await promptForProjectName(client,org,await defaultNewProjectName())}var import_build_utils=__toESM(require_build_utils(),1),import_chalk2=__toESM(require_source(),1);import path from"path";async function inputRootDirectory(client,cwd,autoConfirm=!1){if(autoConfirm)return null;for(;;){let rootDirectory=await client.input.text({message:"Code directory?",transformer:input=>`${import_chalk2.default.dim("./")}${input}`});if(!rootDirectory)return null;let normal=path.normalize(rootDirectory);if(normal==="."||normal==="./")return null;let fullPath=path.join(cwd,normal);if(await validateRootDirectory(cwd,fullPath,"Please choose a different one.")!==!1)return(0,import_build_utils.normalizePath)(normal)}}var import_chalk3=__toESM(require_source(),1),import_frameworks=__toESM(require_frameworks(),1);function isSettingValue(setting){return setting&&typeof setting.value=="string"}var settingMap={buildCommand:"Build Command",devCommand:"Development Command",commandForIgnoringBuildStep:"Ignore Command",installCommand:"Install Command",outputDirectory:"Output Directory",framework:"Framework"},settingKeys=Object.keys(settingMap).sort();async function editProjectSettings(client,projectSettings,framework,autoConfirm,localConfigurationOverrides,configFileName="vercel.json",staticSite=null){let settings=Object.assign({buildCommand:null,devCommand:null,framework:null,commandForIgnoringBuildStep:null,installCommand:null,outputDirectory:null},projectSettings);if(localConfigurationOverrides&&Object.values(localConfigurationOverrides??{}).some(Boolean)){for(let setting of settingKeys){let localConfigValue=localConfigurationOverrides[setting];localConfigValue&&(settings[setting]=localConfigValue)}output_manager_default.print(` Local settings detected in ${configFileName}:
|
|
9
9
|
`);for(let setting of settingKeys){let override=localConfigurationOverrides[setting];override&&output_manager_default.print(` ${import_chalk3.default.dim(`${import_chalk3.default.bold(`${settingMap[setting]}:`)} ${override}`)}
|
|
10
10
|
`)}if(localConfigurationOverrides.framework){let overrideFramework=import_frameworks.frameworkList.find(f=>f.slug===localConfigurationOverrides.framework);overrideFramework&&(framework=overrideFramework,output_manager_default.print(` Merging default Project Settings for ${framework.name}. Previously listed overrides are prioritized.
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getScope}from"./chunk-
|
|
7
|
+
import{getScope}from"./chunk-3BMYPWEY.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-IRNQJ6ZX.js";import{getOrgById}from"./chunk-ZHAPKFVM.js";import{suggestCorrection}from"./chunk-NHB43235.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";async function findSimilarProjectName(client,name,orgId){try{let{projects}=await client.fetch("/v9/projects?limit=100",{accountId:orgId});return suggestCorrection(name,projects.map(project=>project.name).filter(projectName=>/^[a-z0-9._-]+$/i.test(projectName)))}catch(err){output_manager_default.debug(`Project suggestion lookup failed: ${err}`);return}}async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId,{createCommand}={}){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`,suggestion=createCommand?await findSimilarProjectName(client,projectNameOrId,orgId):void 0,suggestionLine=suggestion?` Did you mean ${suggestion}?`:"",createNote=createCommand?.note;if(output_manager_default.error(`${headline}${suggestionLine}
|
|
8
8
|
|
|
9
9
|
`+(createCommand?`To create it${createNote?`, ${createNote}`:""}:
|
|
10
10
|
${createCommand.command}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{fetchAllPages}from"./chunk-MSJA64LL.js";import{isPerEntityScope}from"./chunk-YE245S4O.js";import{isAPIError}from"./chunk-GOI2VVI7.js";var TEAM_BUDGET={scope:"team"},BUDGET_THRESHOLD_PERCENTS=[50,75,100],PAUSE_AT_PERCENT=100;function buildThresholds({pause,webhookUrl}){return BUDGET_THRESHOLD_PERCENTS.map(percent=>({percent,sendNotifications:!0,triggerWebhook:!!webhookUrl,pauseUsage:percent===PAUSE_AT_PERCENT?!!pause:!1}))}function thresholdsForSet({existing,pause,pauseSpecified,webhookUrl,webhookSpecified}){if(!existing?.length)return buildThresholds({pause,webhookUrl});let next=existing.map(threshold=>({...threshold}));if(pauseSpecified&&(next=applyPauseToThresholds(next,pause)),webhookSpecified){let triggerWebhook=!!webhookUrl;next=next.map(threshold=>({...threshold,triggerWebhook}))}return next}function hasPauseThreshold(thresholds){return thresholds.some(threshold=>threshold.percent===PAUSE_AT_PERCENT)}function pausePercentsOutside100(thresholds){return thresholds.filter(threshold=>threshold.pauseUsage&&threshold.percent!==PAUSE_AT_PERCENT).map(threshold=>threshold.percent)}function applyPauseToThresholds(thresholds,pause){return pause?thresholds.map(threshold=>({...threshold,pauseUsage:threshold.percent===PAUSE_AT_PERCENT})):thresholds.map(threshold=>({...threshold,pauseUsage:!1}))}function spendDollars(spend){return spend?.currentSpend==null?null:spend.currentSpend/100}function percentUsed(spent,amount){return spent!==null&&amount>0?Math.round(spent/amount*100):null}function spendPayload(spent,amount){return{currentSpend:spent,percentUsed:amount===null?null:percentUsed(spent,amount),unit:"usd"}}var NO_RETRY={retries:0};function budgetPauses(budget){return budget.thresholds.some(t=>t.pauseUsage)}function ownerJson(owner){return owner.type==="organization"?{organizationId:owner.id,organizationSlug:owner.slug}:{teamId:owner.id,teamSlug:owner.slug}}function withScopeName(item,scopeName){return Object.fromEntries(Object.entries(item).flatMap(([key,value])=>key==="scopeId"?[[key,value],["scopeName",scopeName]]:[[key,value]]))}function budgetJson(budget,scopeName){return withScopeName({...budget,webhook:budget.webhook?{id:budget.webhook.id,url:budget.webhook.url}:null},scopeName)}function budgetAlertJson(alert,scopeName){return withScopeName(alert,scopeName)}function setReceipt({owner,target,outcome,budget}){let webhookSecret=budget.webhook?.secret;return{...ownerJson(owner),target,outcome,budget:budgetJson(budget,target.name),...webhookSecret?{webhookSecret}:{}}}function removeReceipt({owner,target,budget}){return{...ownerJson(owner),target,outcome:budget?"deleted":"unchanged",alreadyAbsent:budget===null,budget:budget?budgetJson(budget,target.name):null}}function formatUsdWhole(dollars){return`$${dollars.toLocaleString("en-US",{maximumFractionDigits:0})}`}function formatUsd(dollars){return`$${dollars.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}async function listBudgets(client,selector){let budgets=await fetchAllPages(async next=>{let params=new URLSearchParams({limit:"100",status:"active"});setSelectorParams(params,selector),next&¶ms.set("next",next);let page=await client.fetch(`/v2/budgets?${params}`,{method:"GET",...ownerOptions(selector)});return{items:page.data??[],next:page.pagination?.next??null}});return newestPerSlot(budgets)}function newestPerSlot(budgets){let seen=new Set;return budgets.filter(budget=>{let target=isPerEntityScope(budget.scope)?budget.scopeId??"":"",slot=`${budget.ownerId}:${budget.scope}:${target}`;return seen.has(slot)?!1:(seen.add(slot),!0)})}async function findBudget(client,selector=TEAM_BUDGET){return(await listBudgets(client,selector))[0]}async function createBudget(client,input){try{return await client.fetch(`/v2/budgets${orgQuery(input)}`,{method:"POST",...ownerOptions(input),retry:{retries:0},body:{scope:input.scope,...input.scopeId?{scopeId:input.scopeId}:{},amount:input.amount,thresholds:input.thresholds,...input.webhookUrl?{webhookUrl:input.webhookUrl}:{}}})}catch(err){let budgetId=existingBudgetId(err);if(!budgetId)throw err;return updateBudget(client,budgetId,{amount:input.amount,thresholds:input.thresholds,webhookUrl:input.webhookUrl||null},input)}}function isPreviousPlanBudgetError(err){return isAPIError(err)&&err.code==="budget_not_current"}function existingBudgetId(err){if(!isAPIError(err)||err.code!=="budget_exists")return;let{budgetId,status}=err;return status==="disabled"&&typeof budgetId=="string"?budgetId:void 0}async function updateBudget(client,budgetId,input,selector){return client.fetch(budgetPath(budgetId,selector),{method:"PATCH",...ownerOptions(selector),retry:{retries:0},body:{amount:input.amount,thresholds:input.thresholds,status:"active",...input.webhookUrl!==void 0?{webhookUrl:input.webhookUrl}:{}}})}async function removeBudget(client,budgetId,selector){return client.fetch(budgetPath(budgetId,selector),{method:"DELETE",...ownerOptions(selector)})}function budgetPath(budgetId,selector){return`/v2/budgets/${encodeURIComponent(budgetId)}${orgQuery(selector)}`}async function getTeamSpend(client,teamId,selector=TEAM_BUDGET,{retry}={}){if(selector.orgId)return{currentSpend:null,avgSpend:null};let params=new URLSearchParams;selector.scope!=="team"&&setSelectorParams(params,selector);let qs=params.toString(),{data}=await client.fetch(`/teams/${encodeURIComponent(teamId)}/spend${qs?`?${qs}`:""}`,{method:"GET",...retry?{retry}:{}});return data??{currentSpend:null,avgSpend:null}}async function listBudgetAlerts(client,selector,query={},{retry}={}){let params=new URLSearchParams;setSelectorParams(params,selector);for(let[key,value]of Object.entries(query))value!==void 0&¶ms.set(key,String(value));let page=await client.fetch(`/v2/budget-alerts?${params}`,{method:"GET",...ownerOptions(selector),...retry?{retry}:{}});return{data:page.data??[],next:page.pagination?.next??null}}async function listBudgetProducts(client){return(await client.fetch("/v2/budget-products",{method:"GET"})).data??[]}function setSelectorParams(params,selector){if(selector){if(Array.isArray(selector.scope)){params.set("scope",selector.scope.join(","));return}params.set("scope",selector.scope),"scopeId"in selector&&selector.scopeId&¶ms.set("scopeId",selector.scopeId),"orgId"in selector&&selector.orgId&¶ms.set("orgId",selector.orgId)}}function orgIdOf(selector){return selector&&"orgId"in selector?selector.orgId:void 0}function ownerOptions(selector){return orgIdOf(selector)?{useCurrentTeam:!1}:{}}function orgQuery(selector){let orgId=orgIdOf(selector);return orgId?`?${new URLSearchParams({orgId})}`:""}export{TEAM_BUDGET,thresholdsForSet,hasPauseThreshold,pausePercentsOutside100,spendDollars,percentUsed,spendPayload,NO_RETRY,budgetPauses,ownerJson,budgetJson,budgetAlertJson,setReceipt,removeReceipt,formatUsdWhole,formatUsd,listBudgets,findBudget,createBudget,isPreviousPlanBudgetError,updateBudget,removeBudget,getTeamSpend,listBudgetAlerts,listBudgetProducts};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{printProjectNotFoundError}from"./chunk-
|
|
7
|
+
import{printProjectNotFoundError}from"./chunk-VYR72PE3.js";import{detectExplicitScope}from"./chunk-3BMYPWEY.js";import{omitGlobalFlagsFromArgs}from"./chunk-IRNQJ6ZX.js";import{getLinkedProject}from"./chunk-ZHAPKFVM.js";function getInvokingCommandFromArgv(argv){let args=omitGlobalFlagsFromArgs(argv.slice(2)),positionals=[];for(let arg of args){if(arg.startsWith("-"))break;positionals.push(arg)}return positionals.join(" ")}async function resolveProjectContext({client,cwd=client.cwd,projectNameOrId,commandName="",projectNotFoundHandling="report",skipOwnerLookup,quiet}){let context=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client),skipOwnerLookup,quiet});return context.status==="not_linked"&&projectNameOrId&&projectNotFoundHandling==="report"?(await printProjectNotFoundError(client,projectNameOrId,commandName||getInvokingCommandFromArgv(client.argv),context.orgId),{status:"error",exitCode:1,orgId:context.orgId}):context}export{resolveProjectContext};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{toGranularityMsFromDuration}from"./chunk-
|
|
7
|
+
import{toGranularityMsFromDuration}from"./chunk-CINU5WXR.js";var VALUE_ALIAS="value",COUNT_ALIAS="__seriesCount";function alignTimeRangeToGranularity(startTime,endTime,granularity){let bucketMs=toGranularityMsFromDuration(granularity);return{startTime:new Date(Math.floor(startTime.getTime()/bucketMs)*bucketMs),endTime:new Date(Math.ceil(endTime.getTime()/bucketMs)*bucketMs)}}function createCanonicalMetricsRequest(options){let metrics={[VALUE_ALIAS]:options.selection},rankMetric=VALUE_ALIAS;return options.groupBy.length>0&&options.orderBy==="count"&&options.selection.aggregation!=="count"&&(metrics[COUNT_ALIAS]={metric:options.metric,aggregation:"count"},rankMetric=COUNT_ALIAS),{scope:{ownerId:options.scope.ownerId,...options.scope.type==="project"?{projectIds:options.scope.projectIds}:{}},timeRange:{start:options.startTime.toISOString(),end:options.endTime.toISOString()},bucketSeconds:toGranularityMsFromDuration(options.granularity)/1e3,...options.groupBy.length>0?{groupBy:options.groupBy}:{},...options.filter?{filter:options.filter}:{},metrics,outputs:[VALUE_ALIAS],...options.groupBy.length>0?{seriesSelection:{limit:options.limit,mode:"exact",rankBy:[{metric:rankMetric,direction:options.orderDirection??"desc"}]}}:{}}}function canonicalResponseToMetricsResponse(response,rollupColumn,orderBy,orderDirection){let toRow=point=>({...point.dimensions,[rollupColumn]:point.values[VALUE_ALIAS]??null});return{...response.series?{data:response.series.map(point=>({timestamp:point.timestamp,...toRow(point)}))}:{},summary:response.summary.map(toRow),statistics:{rowsRead:response.meta.statistics.rowsRead,bytesRead:response.meta.statistics.bytesRead,dbTimeSeconds:response.meta.statistics.databaseElapsedMs/1e3,engineTimeSeconds:response.meta.statistics.elapsedMs/1e3,queryTable:[...new Set(response.meta.sources.map(source=>source.id))].sort().join(",")},...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}var FILTER_DEPRECATION_WARNING="OData support in --query is deprecated and will be removed soon. KQL will be the only supported filter syntax.";function usesODataSyntax(filters){return filters?.some(filter=>{let unquoted=filter.replace(/"(?:\\.|[^"\\])*"|'(?:''|[^'])*'/g,"");return/\s(?:eq|ne|gt|ge|lt|le|in)\s/i.test(unquoted)||/\b(?:contains|startswith|endswith)\s*\(/i.test(unquoted)})??!1}export{alignTimeRangeToGranularity,createCanonicalMetricsRequest,canonicalResponseToMetricsResponse,FILTER_DEPRECATION_WARNING,usesODataSyntax};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-
|
|
7
|
+
import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-ZHAPKFVM.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile,spawnSync}from"child_process";var SAFE_ARGUMENT=/^[\w@./:=+-]+$/;function envValue(env,name){let key=Object.keys(env).find(key2=>key2.toLowerCase()===name.toLowerCase());return key?env[key]:void 0}function packageManagerInvocation(command,args,env=process.env,platform=process.platform){if(platform!=="win32")return{file:command,args};for(let arg of[command,...args])if(!SAFE_ARGUMENT.test(arg))throw new Error(`Refusing to pass ${JSON.stringify(arg)} to cmd.exe for ${command}`);let systemRoot=envValue(env,"SystemRoot");return{file:envValue(env,"ComSpec")||(systemRoot?`${systemRoot}\\System32\\cmd.exe`:"cmd.exe"),args:["/d","/s","/c",`"${[command,...args].join(" ")}"`],windowsVerbatimArguments:!0}}function execPackageManager(command,args,{cwd,env,timeout,signal},platform=process.platform){return new Promise((resolve2,reject)=>{let invocation=packageManagerInvocation(command,args,env,platform),windows=platform==="win32",timer,stop=()=>stopProcessTree(child,env),child=execFile(invocation.file,invocation.args,{encoding:"utf8",windowsHide:!0,windowsVerbatimArguments:invocation.windowsVerbatimArguments,cwd,env:{...env},...windows?{}:{timeout,signal}},(error,stdout)=>{clearTimeout(timer),signal?.removeEventListener("abort",stop),error?reject(error):resolve2(String(stdout))});windows&&(timer=setTimeout(stop,timeout),signal?.aborted?stop():signal?.addEventListener("abort",stop,{once:!0}))})}function stopProcessTree(child,env){if(!child?.pid)return;let systemRoot=envValue(env,"SystemRoot");spawnSync(systemRoot?`${systemRoot}\\System32\\taskkill.exe`:"taskkill.exe",["/pid",String(child.pid),"/T","/F"],{stdio:"ignore",windowsHide:!0})}import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{constructor(){super(...arguments);this.code="unsupported_install"}},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`);this.code="homebrew_install"}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await execPackageManager(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{cwd:trustedUpgradeDirectory,env,timeout:15e3,signal})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{packageManagerInvocation,execPackageManager,trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};
|