vercel 64.1.0 → 64.3.1
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-JH6ALI3H.js → add-5RV75RPG.js} +1 -1
- package/dist/chunks/{add-XZJ4G2MM.js → add-RFCYPSPS.js} +1 -1
- package/dist/chunks/{add-GEAC4RAQ.js → add-UXOTAL3N.js} +1 -1
- package/dist/chunks/{build-3T6EUCCK.js → build-SE3QLNVF.js} +1 -1
- package/dist/chunks/{chunk-SD757OFS.js → chunk-26Z4U6G4.js} +2 -2
- package/dist/chunks/{chunk-XEQT373M.js → chunk-2B3A3MOX.js} +1 -1
- package/dist/chunks/{chunk-RZGWCQP7.js → chunk-2FHICLHJ.js} +1 -1
- package/dist/chunks/{chunk-AG5QQNJ3.js → chunk-2UMWTCY7.js} +1 -1
- package/dist/chunks/{chunk-Z6UFAIEX.js → chunk-444RE4Z5.js} +1 -1
- package/dist/chunks/{chunk-5VWJIYJE.js → chunk-6GIP2YPX.js} +1 -1
- package/dist/chunks/{chunk-PJMVU4JC.js → chunk-6HOVHRWJ.js} +3 -3
- package/dist/chunks/chunk-6ZRULOO3.js +7 -0
- package/dist/chunks/{chunk-JGPRCZC2.js → chunk-7GFRZWLE.js} +1 -1
- package/dist/chunks/{chunk-BAJDLMZS.js → chunk-A63VVXW2.js} +1 -1
- package/dist/chunks/{chunk-RFEREQPS.js → chunk-AA434KXY.js} +1 -1
- package/dist/chunks/{chunk-YNIW7DTL.js → chunk-AALI66ML.js} +1 -1
- package/dist/chunks/{chunk-DW3TSGVC.js → chunk-AQUDXMFH.js} +1 -1
- package/dist/chunks/chunk-BAT6SDBJ.js +10 -0
- package/dist/chunks/chunk-BTCKMXWW.js +7 -0
- package/dist/chunks/{chunk-VM6TZGLE.js → chunk-CMKLX4DC.js} +1 -1
- package/dist/chunks/{chunk-MYCQIZU6.js → chunk-CN3IVZJO.js} +1 -1
- package/dist/chunks/{chunk-JSBEAHKA.js → chunk-CYV3X62I.js} +1 -1
- package/dist/chunks/{chunk-EO7GUARB.js → chunk-DNDBPLLI.js} +1 -1
- package/dist/chunks/{chunk-WQIGKVBV.js → chunk-DNTQK2SW.js} +1 -1
- package/dist/chunks/{chunk-37QGCN6P.js → chunk-E6R2QOOR.js} +1 -1
- package/dist/chunks/{chunk-Z4OH72VZ.js → chunk-ELDHGU6N.js} +1 -1
- package/dist/chunks/{chunk-DYQXJCHO.js → chunk-EVQJ7SCV.js} +1 -1
- package/dist/chunks/{chunk-JAQM6UXY.js → chunk-EXPLBM7J.js} +1 -1
- package/dist/chunks/{chunk-VRWPRZJY.js → chunk-FLBI6DY2.js} +1 -1
- package/dist/chunks/{chunk-ASU72O2R.js → chunk-G2IJOQR3.js} +1 -1
- package/dist/chunks/{chunk-UBKETNGO.js → chunk-GCSAJUL6.js} +1 -1
- package/dist/chunks/{chunk-XXDVZWWM.js → chunk-GF7EG5IA.js} +1 -1
- package/dist/chunks/{chunk-ELI3L2UX.js → chunk-GJP22N6R.js} +1 -1
- package/dist/chunks/{chunk-JNPG7MVL.js → chunk-GLJH35MJ.js} +1 -1
- package/dist/chunks/{chunk-TBLIJ2PS.js → chunk-GNV6PG6W.js} +1 -1
- package/dist/chunks/{chunk-M7GT3ZPT.js → chunk-GVVIFYQE.js} +1 -1
- package/dist/chunks/{chunk-JESE5FPO.js → chunk-GWZ4VPU3.js} +2 -2
- package/dist/chunks/{chunk-NJINP2WU.js → chunk-H3KYG32S.js} +2 -2
- package/dist/chunks/chunk-H7CRPXOA.js +14 -0
- package/dist/chunks/{chunk-JEPRHNQU.js → chunk-HJRAWEA2.js} +1 -1
- package/dist/chunks/{chunk-NFJPCOTV.js → chunk-HTLGLTKD.js} +2 -2
- package/dist/chunks/{chunk-E6UKNYFF.js → chunk-HVUJNVPS.js} +1 -1
- package/dist/chunks/{chunk-J53D7SLS.js → chunk-IIC2A4YN.js} +1 -1
- package/dist/chunks/{chunk-N7Q2IESO.js → chunk-IJCCFLCQ.js} +1 -1
- package/dist/chunks/{chunk-QYDG63GL.js → chunk-IL7X6EKK.js} +1 -1
- package/dist/chunks/{chunk-XD2LZRBS.js → chunk-IQ7FPAI4.js} +1 -1
- package/dist/chunks/{chunk-QJKJBD2M.js → chunk-ITKS32PG.js} +1 -1
- package/dist/chunks/{chunk-J2LAZELI.js → chunk-IVIZLWZQ.js} +1 -1
- package/dist/chunks/{chunk-YCXZZSW6.js → chunk-IYCHAIFZ.js} +1 -1
- package/dist/chunks/{chunk-UFXKCETS.js → chunk-J6O6JW2K.js} +1 -1
- package/dist/chunks/{chunk-G6B6TVAE.js → chunk-JCTXRR4A.js} +1 -1
- package/dist/chunks/{chunk-IDGWQE4B.js → chunk-JV6IPUGX.js} +1 -1
- package/dist/chunks/{chunk-JJSDRKX4.js → chunk-KGXW36FQ.js} +2 -2
- package/dist/chunks/{chunk-GSOPJJO5.js → chunk-KKCBFBJK.js} +1 -1
- package/dist/chunks/{chunk-FWFTX2WE.js → chunk-KKQL4AKH.js} +1 -1
- package/dist/chunks/{chunk-JNJOUMGF.js → chunk-KUGXOLL7.js} +1 -1
- package/dist/chunks/{chunk-JLXG2XWW.js → chunk-LD5U73LA.js} +1 -1
- package/dist/chunks/{chunk-75IAMKGV.js → chunk-M774HRX5.js} +2 -2
- package/dist/chunks/{chunk-5IPBCD7K.js → chunk-MI7W4QMV.js} +1 -1
- package/dist/chunks/{chunk-THSHYFA6.js → chunk-MMPQC2N6.js} +1 -1
- package/dist/chunks/{chunk-FIIHB66A.js → chunk-MV4WHUIC.js} +1 -1
- package/dist/chunks/{chunk-SYEKOJHT.js → chunk-MZ3QGJH3.js} +1 -1
- package/dist/chunks/{chunk-ZKDWPKO2.js → chunk-MZLQY2EQ.js} +1 -1
- package/dist/chunks/{chunk-OGCVOINQ.js → chunk-OCOVCC5Q.js} +1 -1
- package/dist/chunks/{chunk-ZUCSA4IW.js → chunk-OJKZ7EV3.js} +1 -1
- package/dist/chunks/{chunk-67NNB6S6.js → chunk-OUTCLR64.js} +1 -1
- package/dist/chunks/chunk-Q5ZGA2RO.js +7 -0
- package/dist/chunks/{chunk-OZ47SVXA.js → chunk-QAETJRKX.js} +1 -1
- package/dist/chunks/{chunk-7YRPMVZK.js → chunk-QC3HEGFD.js} +1 -1
- package/dist/chunks/{chunk-YBOS65VB.js → chunk-QC5AMRWR.js} +1 -1
- package/dist/chunks/{chunk-MJD6WHG4.js → chunk-QCWV7FML.js} +1 -1
- package/dist/chunks/{chunk-FBJWLH2A.js → chunk-TCYAAWLB.js} +1 -1
- package/dist/chunks/{chunk-MFIVZXHH.js → chunk-TDDZGUU6.js} +1 -1
- package/dist/chunks/{chunk-S7XZC23O.js → chunk-TPVAPVQC.js} +1 -1
- package/dist/chunks/{chunk-KELSPU2J.js → chunk-U3NQZJQ4.js} +8 -8
- package/dist/chunks/{chunk-GRTIWUV2.js → chunk-UCAE5Z5L.js} +1 -1
- package/dist/chunks/{chunk-L5FUUGYX.js → chunk-UGMTKOTN.js} +1 -1
- package/dist/chunks/{chunk-OJZEOWK2.js → chunk-VRWLNWNE.js} +1 -1
- package/dist/chunks/{chunk-R5K37TXM.js → chunk-VVAZC5IO.js} +1 -1
- package/dist/chunks/chunk-W3TGCMRW.js +9 -0
- package/dist/chunks/{chunk-UDQYOGSQ.js → chunk-WGOQGKS5.js} +1 -1
- package/dist/chunks/{chunk-3EYOQC4R.js → chunk-WYI4VNXT.js} +1 -1
- package/dist/chunks/{chunk-YI5G2A3V.js → chunk-XJXX4QXA.js} +1 -1
- package/dist/chunks/{chunk-YIIPBH2D.js → chunk-XSDAUM4F.js} +1 -1
- package/dist/chunks/{chunk-ZMBDYOVN.js → chunk-XW4ZWX3I.js} +1 -1
- package/dist/chunks/{chunk-2JBVMF2Y.js → chunk-Y24OSBXP.js} +1 -1
- package/dist/chunks/{chunk-A5R2HHNK.js → chunk-YROIQRYI.js} +1 -1
- package/dist/chunks/{chunk-4ZICRXI5.js → chunk-YS542RHZ.js} +1 -1
- package/dist/chunks/{chunk-KAJM2NEI.js → chunk-YUYCSDCO.js} +1 -1
- package/dist/chunks/{chunk-3AVG55SO.js → chunk-ZBDLYNUF.js} +1 -1
- package/dist/chunks/{chunk-HAVEFTOO.js → chunk-ZE53XHAY.js} +1 -1
- package/dist/chunks/{chunk-WLK5BBNP.js → chunk-ZLWTPS5T.js} +1 -1
- package/dist/chunks/{chunk-5UEBA6N6.js → chunk-ZQKDO5PL.js} +1 -1
- package/dist/chunks/{chunk-WPQN5UKR.js → chunk-ZQME5XUJ.js} +1 -1
- package/dist/chunks/{chunk-WHVT7UXE.js → chunk-ZVLDGT4O.js} +1 -1
- package/dist/chunks/{chunk-N7L3XLWC.js → chunk-ZZ3LJ22B.js} +1 -1
- package/dist/chunks/{clear-XCZCETRU.js → clear-2VHJFFMM.js} +1 -1
- package/dist/chunks/{compile-vercel-config-NQKOGOPH.js → compile-vercel-config-ADKZDUAU.js} +1 -1
- package/dist/chunks/{config-CIM647OM.js → config-6YWGF4CO.js} +1 -1
- package/dist/chunks/{config-P42IQJDF.js → config-VAOXMKVX.js} +1 -1
- package/dist/chunks/{connect-git-provider-VJYXBRYG.js → connect-git-provider-2JIBL3ST.js} +1 -1
- package/dist/chunks/{delete-MVJ3NENU.js → delete-FEUSV3JO.js} +1 -1
- package/dist/chunks/{delete-KJMVCQ7C.js → delete-YW2NH7VG.js} +1 -1
- package/dist/chunks/{detect-services-UYQZT6MU.js → detect-services-A2B6KJO5.js} +1 -1
- package/dist/chunks/{disable-666GPFHE.js → disable-KA6PS2CZ.js} +1 -1
- package/dist/chunks/{discard-RUQPJMOG.js → discard-ZNUPAJTQ.js} +1 -1
- package/dist/chunks/{edit-IIM7GKC2.js → edit-D7VE55ZF.js} +1 -1
- package/dist/chunks/{edit-NRJCMP4B.js → edit-YTYYBVZN.js} +1 -1
- package/dist/chunks/{enable-FVXIP7NX.js → enable-Q4OCTJIJ.js} +1 -1
- package/dist/chunks/{exec-QZXH5RXR.js → exec-NMRO6DIZ.js} +2 -2
- package/dist/chunks/{export-VPGLK5KL.js → export-UX6JVWOD.js} +1 -1
- package/dist/chunks/{future-MDYFVS3M.js → future-6UTK4EFE.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-MWXVKKFQ.js → generate-cert-for-deploy-WDKFR34X.js} +1 -1
- package/dist/chunks/{image-URNV2ABR.js → image-IL7IN7MD.js} +1 -1
- package/dist/chunks/{import-builders-FC5ESQ34.js → import-builders-FX2XXVRT.js} +1 -1
- package/dist/chunks/{inspect-LYGYBYV3.js → inspect-E2HPGMNI.js} +1 -1
- package/dist/chunks/{inspect-P4XEVJW5.js → inspect-F6NLCWHN.js} +1 -1
- package/dist/chunks/{inspect-6KZERH2F.js → inspect-UNZR445S.js} +1 -1
- package/dist/chunks/{inspect-OBNVJRYC.js → inspect-UPXTGUJQ.js} +1 -1
- package/dist/chunks/{inspect-G5NDWTDB.js → inspect-YAMAGNIW.js} +1 -1
- package/dist/chunks/{list-5YBZG374.js → list-FDYB6GHF.js} +1 -1
- package/dist/chunks/{list-ICJMKLOR.js → list-G4E6RG3V.js} +1 -1
- package/dist/chunks/{list-AV5CMKBK.js → list-GDI5O246.js} +1 -1
- package/dist/chunks/{login-SUBW6IFU.js → login-HU5OFS7T.js} +1 -1
- package/dist/chunks/{login-5VKAY2R5.js → login-XYYNIAMM.js} +1 -1
- package/dist/chunks/{logs-BJL37R5U.js → logs-EWXTZN4W.js} +1 -1
- package/dist/chunks/{ls-QGJPVPLK.js → ls-3GNX6IPE.js} +1 -1
- package/dist/chunks/{ls-TXKT6RCY.js → ls-A3HIPTF5.js} +1 -1
- package/dist/chunks/{ls-3Y2X26EY.js → ls-A4NEYMKP.js} +1 -1
- package/dist/chunks/{ls-SOTQGCPD.js → ls-CGZ3NL5R.js} +1 -1
- package/dist/chunks/{ls-AKUJ4VUV.js → ls-MO3R46TQ.js} +1 -1
- package/dist/chunks/{ls-EJ4THXVR.js → ls-SZKDUJHV.js} +1 -1
- package/dist/chunks/{ls-VEWJPLJC.js → ls-TCB7UUPP.js} +1 -1
- package/dist/chunks/{mutate-Y4KO4NAJ.js → mutate-BQAP2S7A.js} +1 -1
- package/dist/chunks/{notifications-J3SMCQX5.js → notifications-TDSFYYNB.js} +1 -1
- package/dist/chunks/{open-COGMMSHS.js → open-YPOEUM3S.js} +1 -1
- package/dist/chunks/{openapi-TP6GEZGZ.js → openapi-BQSQNXQE.js} +1 -1
- package/dist/chunks/{permissions-43WFISAY.js → permissions-6LOJKL5W.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-5AQVXSFB.js → prompt-missing-credentials-IGTCFUA6.js} +1 -1
- package/dist/chunks/{publish-4NSLHSHF.js → publish-CATCXJZG.js} +1 -1
- package/dist/chunks/pull-CXUNHWAO.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-S43PVX5Y.js → purchase-domain-if-available-4YKWAHH5.js} +1 -1
- package/dist/chunks/{push-2NBXVOX2.js → push-KZZE3AQ3.js} +1 -1
- package/dist/chunks/{query-DI4FF2ZM.js → query-GHFOZV7K.js} +1 -1
- package/dist/chunks/{reauthenticate-Z62FFYZH.js → reauthenticate-W7QIXLZ3.js} +1 -1
- package/dist/chunks/{reorder-P4AXRPMF.js → reorder-XU55LOZ5.js} +1 -1
- package/dist/chunks/{reply-ULZRH7KA.js → reply-B2XOCSZD.js} +1 -1
- package/dist/chunks/{resolve-3IS44LUW.js → resolve-H4BZ2QI3.js} +1 -1
- package/dist/chunks/{resolve-agent-team-DDBPICVE.js → resolve-agent-team-43HZCPF3.js} +1 -1
- package/dist/chunks/{restore-WM4EZHD4.js → restore-AJLS2N6C.js} +1 -1
- package/dist/chunks/{rm-4XX3UUUF.js → rm-2TR2KBDP.js} +1 -1
- package/dist/chunks/{rm-7Z6GJ4O2.js → rm-IGY6LD6H.js} +1 -1
- package/dist/chunks/{rm-TRMBM6DD.js → rm-N6ZUA66Z.js} +1 -1
- package/dist/chunks/{rm-C455A2EH.js → rm-OI5VS7GG.js} +1 -1
- package/dist/chunks/{rm-53YK7N2N.js → rm-ZQUVOC3V.js} +1 -1
- package/dist/chunks/{routes-3RJGIZYJ.js → routes-TCMUHSJF.js} +1 -1
- package/dist/chunks/{rule-inspect-FMZTPH3S.js → rule-inspect-NLEABBTP.js} +1 -1
- package/dist/chunks/{rules-K7XMFMXG.js → rules-SVLVB6YB.js} +1 -1
- package/dist/chunks/{schema-5R44NJNE.js → schema-HWS2SOZS.js} +1 -1
- package/dist/chunks/{schema-PQZAACV2.js → schema-KG4RWQBC.js} +1 -1
- package/dist/chunks/{select-org-GGUGYGDL.js → select-org-AAB5RBSB.js} +1 -1
- package/dist/chunks/{set-SZPCOILW.js → set-AJEMEBZU.js} +1 -1
- package/dist/chunks/setup-and-link-6AIRWXXX.js +7 -0
- package/dist/chunks/{tags-YS7EQDJY.js → tags-O6R6VWPP.js} +1 -1
- package/dist/chunks/{types-FK3W7A2Y.js → types-Y3NJROKH.js} +1 -1
- package/dist/chunks/{update-QVYTOT35.js → update-C7XR7CHI.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-bulk.js +776 -715
- package/dist/index.js +2 -2
- package/dist/internal-build.js +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +58 -57
- package/dist/chunks/chunk-AR5T62PK.js +0 -7
- package/dist/chunks/chunk-AU42HSQ3.js +0 -7
- package/dist/chunks/chunk-CSIUJLB7.js +0 -9
- package/dist/chunks/chunk-FLQJAP2A.js +0 -14
- package/dist/chunks/chunk-FZIRYAXC.js +0 -10
- package/dist/chunks/chunk-QC47UKDR.js +0 -7
- package/dist/chunks/pull-MS2PVQUV.js +0 -7
- package/dist/chunks/setup-and-link-OAS7PYL6.js +0 -7
|
@@ -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-OUTCLR64.js";import{detectProjects}from"./chunk-YTEZO2SZ.js";import{require_slugify}from"./chunk-COD3WAUI.js";import{selectOrg}from"./chunk-JCTXRR4A.js";import{createProject}from"./chunk-QHJLRTVY.js";import{readJSONFile}from"./chunk-MZLQY2EQ.js";import{singleFileProjectSettings,validateRootDirectory}from"./chunk-444RE4Z5.js";import{require_dist as require_dist2}from"./chunk-QC5AMRWR.js";import{checkExistsAndConnect,parseRepoUrl,selectAndParseRemoteUrl}from"./chunk-MZ3QGJH3.js";import{require_dist2 as require_dist}from"./chunk-BLAIBYEU.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-OCOVCC5Q.js";import{Separator}from"./chunk-MVGTMPMI.js";import{isPromptBackError,isPromptCanceledError}from"./chunk-P2O5DOYE.js";import{pull}from"./chunk-XJXX4QXA.js";import{require_frameworks}from"./chunk-MVCAUS4F.js";import{table}from"./chunk-773GOZIR.js";import{printError}from"./chunk-QAETJRKX.js";import{getLocalPathConfig}from"./chunk-IIC2A4YN.js";import{VERCEL_DIR_PROJECT,VERCEL_DIR_README,fetchProjectsForRepoUrl,findProjectsFromPath,findRepoRoot,getGitConfigPath,getLinkedProject,getProjectByNameOrId,getRemoteUrls,getVercelDirectory,isDirectory,linkFolderToProject,linkRepoProject,parseGitConfig,pluckRemoteUrls,require_lib,resolveGitRemote}from"./chunk-U3NQZJQ4.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{printAlignedLabel}from"./chunk-IJCCFLCQ.js";import{CantParseJSONFile,ProjectNotFound,isAPIError}from"./chunk-XSDAUM4F.js";import{output_manager_default,require_build_utils}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1),import_slugify3=__toESM(require_slugify(),1),import_build_utils4=__toESM(require_build_utils(),1),import_fs_detectors2=__toESM(require_dist(),1);import{join as join3,basename,extname}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"){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,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_dist,require_dist2}from"./chunk-BLAIBYEU.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{require_build_utils}from"./chunk-75IAMKGV.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectDaemons:()=>import_fs_detectors2.detectDaemons,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["schedule"],properties:{name:{type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]}},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}for(let[index,schedule]of(config.schedules??[]).entries())if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules[${index}].timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!/(docker|container)file/i.test(daemon.entrypoint.split(/[\\/]/).pop()??""))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
|
|
7
|
+
import{require_dist,require_dist2}from"./chunk-BLAIBYEU.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{require_build_utils}from"./chunk-M774HRX5.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectDaemons:()=>import_fs_detectors2.detectDaemons,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["schedule"],properties:{name:{type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]}},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}for(let[index,schedule]of(config.schedules??[]).entries())if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules[${index}].timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!/(docker|container)file/i.test(daemon.entrypoint.split(/[\\/]/).pop()??""))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
|
|
@@ -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{humanizeReference,renderAlertTable}from"./chunk-RRWEIG6B.js";import{formatDate}from"./chunk-YTDK6AHS.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-
|
|
7
|
+
import{humanizeReference,renderAlertTable}from"./chunk-RRWEIG6B.js";import{formatDate}from"./chunk-YTDK6AHS.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{buildCommandWithGlobalFlags,quoteArg}from"./chunk-BAT6SDBJ.js";import{printAlignedLabel}from"./chunk-IJCCFLCQ.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatBoolean(value){return value?"yes":"no"}function formatOperator(operator){return{gt:">",gte:">=",lt:"<",lte:"<="}[operator]??operator}function formatPublicRuleScope(rule){let scope=rule.ruleScope;return scope.type==="all"?"all projects":scope.type==="project"?`project: ${scope.projectId}`:`${scope.type}: ${scope.projectIds.join(", ")}`}function formatMetricSelection(metric){let modifiers=[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.length?`dimensions ${metric.dimensions.join(", ")}`:void 0].filter(Boolean);return`${metric.aggregation} ${metric.metric}${modifiers.length?` (${modifiers.join("; ")})`:""}`}function formatCustomTrigger(trigger){let minimum=trigger.minimum?`; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}`:"";return trigger.type==="anomaly"?`${trigger.output} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`:`${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`}function formatCustomCondition(rule){if(!rule.querySupported)return"Query unavailable via API";let query=rule.evaluation.query,output=query.outputs[0];return`${query.formulas?.[output]?`${output} = ${query.formulas[output]}`:query.metrics[output]?formatMetricSelection(query.metrics[output]):output}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`}function formatBuiltInCondition(rule){return`${rule.triggers.mode==="all"?"all triggers":rule.triggers.items.map(trigger=>humanizeReference(trigger.type)).join(", ")}; minimum ${rule.matchMinimumSeverityLevel}`}function formatRuleCondition(rule){return rule.type==="built-in"?formatBuiltInCondition(rule):formatCustomCondition(rule)}function printRules(rules){let rows=[["Name","Rule ID","Type","Scope","Condition"].map(header=>import_chalk.default.cyan(header)),...rules.map(rule=>[import_chalk.default.bold(truncateEnd(rule.name,36)),import_chalk.default.dim(rule.id),rule.isDefault?`${rule.type} (default)`:rule.type,truncateMiddle(formatPublicRuleScope(rule),38),truncateEnd(formatRuleCondition(rule),72)])];output_manager_default.print(`
|
|
8
8
|
${renderAlertTable(rows,2)}
|
|
9
9
|
`)}function commonRows(rule){return[["Name",rule.name],["Rule ID",rule.id],["Type",rule.type],["Scope",formatPublicRuleScope(rule)],["Default",formatBoolean(rule.isDefault)],...rule.createdAt?[["Created",formatDate(rule.createdAt)]]:[],...rule.updatedAt?[["Updated",formatDate(rule.updatedAt)]]:[]]}function notificationRows(rule){return[["Team owner notifications",formatBoolean(rule.notificationSettings.enableTeamOwnerNotifications)],...rule.notificationSettings.incidentIoRoutingKey?[["Incident.io routing key",rule.notificationSettings.incidentIoRoutingKey]]:[]]}function printBuiltInRule(rule){output_manager_default.print(`${import_chalk.default.cyan("Built-in conditions")}
|
|
10
10
|
|
|
@@ -4,5 +4,5 @@ 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{loadEmbeddedBuilderGraphs,loadEmbeddedBuilderIndex}from"./chunk-4CACOKMS.js";import{readJSONFile}from"./chunk-ZKDWPKO2.js";import{require_dist2,require_minimatch}from"./chunk-BLAIBYEU.js";import{require_semver}from"./chunk-BPUANOGW.js";import{require_execa}from"./chunk-GSOPJJO5.js";import{isManagedBuildersInstall}from"./chunk-NWGBDBZI.js";import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,require_lib,require_pluralize}from"./chunk-KELSPU2J.js";import{CantParseJSONFile,code}from"./chunk-YIIPBH2D.js";import{cmd}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{__commonJS,__export,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_builtins=__commonJS({"../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json"(exports,module){module.exports=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]}});var require_validate_npm_package_name=__commonJS({"../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js"(exports,module){"use strict";var scopedPackagePattern=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),builtins=require_builtins(),blacklist=["node_modules","favicon.ico"],validate=module.exports=function(name){var warnings=[],errors=[];if(name===null)return errors.push("name cannot be null"),done(warnings,errors);if(name===void 0)return errors.push("name cannot be undefined"),done(warnings,errors);if(typeof name!="string")return errors.push("name must be a string"),done(warnings,errors);if(name.length||errors.push("name length must be greater than zero"),name.match(/^\./)&&errors.push("name cannot start with a period"),name.match(/^_/)&&errors.push("name cannot start with an underscore"),name.trim()!==name&&errors.push("name cannot contain leading or trailing spaces"),blacklist.forEach(function(blacklistedName){name.toLowerCase()===blacklistedName&&errors.push(blacklistedName+" is a blacklisted name")}),builtins.forEach(function(builtin){name.toLowerCase()===builtin&&warnings.push(builtin+" is a core module name")}),name.length>214&&warnings.push("name can no longer contain more than 214 characters"),name.toLowerCase()!==name&&warnings.push("name can no longer contain capital letters"),/[~'!()*]/.test(name.split("/").slice(-1)[0])&&warnings.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(name)!==name){var nameMatch=name.match(scopedPackagePattern);if(nameMatch){var user=nameMatch[1],pkg=nameMatch[2];if(encodeURIComponent(user)===user&&encodeURIComponent(pkg)===pkg)return done(warnings,errors)}errors.push("name can only contain URL-friendly characters")}return done(warnings,errors)};validate.scopedPackagePattern=scopedPackagePattern;var done=function(warnings,errors){var result={validForNewPackages:errors.length===0&&warnings.length===0,validForOldPackages:errors.length===0,warnings,errors};return result.warnings.length||delete result.warnings,result.errors.length||delete result.errors,result}}});var require_git_host_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js"(exports,module){"use strict";var gitHosts=module.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(fragment){return"file-"+formatHashFragment(fragment)}}},gitHostDefaults={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:formatHashFragment};Object.keys(gitHosts).forEach(function(name){Object.keys(gitHostDefaults).forEach(function(key){gitHosts[name][key]||(gitHosts[name][key]=gitHostDefaults[key])}),gitHosts[name].protocols_re=RegExp("^("+gitHosts[name].protocols.map(function(protocol){return protocol.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function formatHashFragment(fragment){return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}}});var require_git_host=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js"(exports,module){"use strict";var gitHosts=require_git_host_info(),extend=Object.assign||function(target,source){if(source===null||typeof source!="object")return target;for(var keys=Object.keys(source),i=keys.length;i--;)target[keys[i]]=source[keys[i]];return target};module.exports=GitHost;function GitHost(type,user,auth,project,committish,defaultRepresentation,opts){var gitHostInfo=this;gitHostInfo.type=type,Object.keys(gitHosts[type]).forEach(function(key){gitHostInfo[key]=gitHosts[type][key]}),gitHostInfo.user=user,gitHostInfo.auth=auth,gitHostInfo.project=project,gitHostInfo.committish=committish,gitHostInfo.default=defaultRepresentation,gitHostInfo.opts=opts||{}}GitHost.prototype.hash=function(){return this.committish?"#"+this.committish:""};GitHost.prototype._fill=function(template,opts){if(template){var vars=extend({},opts);vars.path=vars.path?vars.path.replace(/^[/]+/g,""):"",opts=extend(extend({},this.opts),opts);var self=this;Object.keys(this).forEach(function(key){self[key]!=null&&vars[key]==null&&(vars[key]=self[key])});var rawAuth=vars.auth,rawcommittish=vars.committish,rawFragment=vars.fragment,rawPath=vars.path,rawProject=vars.project;Object.keys(vars).forEach(function(key){var value=vars[key];(key==="path"||key==="project")&&typeof value=="string"?vars[key]=value.split("/").map(function(pathComponent){return encodeURIComponent(pathComponent)}).join("/"):vars[key]=encodeURIComponent(value)}),vars["auth@"]=rawAuth?rawAuth+"@":"",vars["#fragment"]=rawFragment?"#"+this.hashformat(rawFragment):"",vars.fragment=vars.fragment?vars.fragment:"",vars["#path"]=rawPath?"#"+this.hashformat(rawPath):"",vars["/path"]=vars.path?"/"+vars.path:"",vars.projectPath=rawProject.split("/").map(encodeURIComponent).join("/"),opts.noCommittish?(vars["#committish"]="",vars["/tree/committish"]="",vars["/committish"]="",vars.committish=""):(vars["#committish"]=rawcommittish?"#"+rawcommittish:"",vars["/tree/committish"]=vars.committish?"/"+vars.treepath+"/"+vars.committish:"",vars["/committish"]=vars.committish?"/"+vars.committish:"",vars.committish=vars.committish||"master");var res=template;return Object.keys(vars).forEach(function(key){res=res.replace(new RegExp("[{]"+key+"[}]","g"),vars[key])}),opts.noGitPlus?res.replace(/^git[+]/,""):res}};GitHost.prototype.ssh=function(opts){return this._fill(this.sshtemplate,opts)};GitHost.prototype.sshurl=function(opts){return this._fill(this.sshurltemplate,opts)};GitHost.prototype.browse=function(P,F,opts){return typeof P=="string"?(typeof F!="string"&&(opts=F,F=null),this._fill(this.browsefiletemplate,extend({fragment:F,path:P},opts))):this._fill(this.browsetemplate,P)};GitHost.prototype.docs=function(opts){return this._fill(this.docstemplate,opts)};GitHost.prototype.bugs=function(opts){return this._fill(this.bugstemplate,opts)};GitHost.prototype.https=function(opts){return this._fill(this.httpstemplate,opts)};GitHost.prototype.git=function(opts){return this._fill(this.gittemplate,opts)};GitHost.prototype.shortcut=function(opts){return this._fill(this.shortcuttemplate,opts)};GitHost.prototype.path=function(opts){return this._fill(this.pathtemplate,opts)};GitHost.prototype.tarball=function(opts_){var opts=extend({},opts_,{noCommittish:!1});return this._fill(this.tarballtemplate,opts)};GitHost.prototype.file=function(P,opts){return this._fill(this.filetemplate,extend({path:P},opts))};GitHost.prototype.getDefaultRepresentation=function(){return this.default};GitHost.prototype.toString=function(opts){return this.default&&typeof this[this.default]=="function"?this[this.default](opts):this.sshurl(opts)}}});var require_hosted_git_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js"(exports,module){"use strict";var url=__require("url"),gitHosts=require_git_host_info(),GitHost=module.exports=require_git_host(),protocolToRepresentationMap={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function protocolToRepresentation(protocol){return protocolToRepresentationMap[protocol]||protocol.slice(0,-1)}var authProtocols={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0},cache={};module.exports.fromUrl=function(giturl,opts){if(typeof giturl=="string"){var key=giturl+JSON.stringify(opts||{});return key in cache||(cache[key]=fromUrl(giturl,opts)),cache[key]}};function fromUrl(giturl,opts){if(!(giturl==null||giturl==="")){var url2=fixupUnqualifiedGist(isGitHubShorthand(giturl)?"github:"+giturl:giturl),parsed=parseGitUrl(url2),shortcutMatch=url2.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),matches=Object.keys(gitHosts).map(function(gitHostName){try{var gitHostInfo=gitHosts[gitHostName],auth=null;parsed.auth&&authProtocols[parsed.protocol]&&(auth=parsed.auth);var committish=parsed.hash?decodeURIComponent(parsed.hash.substr(1)):null,user=null,project=null,defaultRepresentation=null;if(shortcutMatch&&shortcutMatch[1]===gitHostName)user=shortcutMatch[2]&&decodeURIComponent(shortcutMatch[2]),project=decodeURIComponent(shortcutMatch[3].replace(/\.git$/,"")),defaultRepresentation="shortcut";else{if(parsed.host&&parsed.host!==gitHostInfo.domain&&parsed.host.replace(/^www[.]/,"")!==gitHostInfo.domain||!gitHostInfo.protocols_re.test(parsed.protocol)||!parsed.path)return;var pathmatch=gitHostInfo.pathmatch,matched=parsed.path.match(pathmatch);if(!matched)return;matched[1]!==null&&matched[1]!==void 0&&(user=decodeURIComponent(matched[1].replace(/^:/,""))),project=decodeURIComponent(matched[2]),defaultRepresentation=protocolToRepresentation(parsed.protocol)}return new GitHost(gitHostName,user,auth,project,committish,defaultRepresentation,opts)}catch(ex){if(!(ex instanceof URIError))throw ex}}).filter(function(gitHostInfo){return gitHostInfo});if(matches.length===1)return matches[0]}}function isGitHubShorthand(arg){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg)}function fixupUnqualifiedGist(giturl){var parsed=url.parse(giturl);return parsed.protocol==="gist:"&&parsed.host&&!parsed.path?parsed.protocol+"/"+parsed.host:giturl}function parseGitUrl(giturl){var matched=giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!matched){var legacy=url.parse(giturl);if(legacy.auth&&typeof url.URL=="function"){var authmatch=giturl.match(/[^@]+@[^:/]+/);if(authmatch){var whatwg=new url.URL(authmatch[0]);legacy.auth=whatwg.username||"",whatwg.password&&(legacy.auth+=":"+whatwg.password)}}return legacy}return{protocol:"git+ssh:",slashes:!0,auth:matched[1],host:matched[2],port:null,hostname:matched[2],hash:matched[4],search:null,query:null,pathname:"/"+matched[3],path:"/"+matched[3],href:"git+ssh://"+matched[1]+"@"+matched[2]+"/"+matched[3]+(matched[4]||"")}}}});var require_os_tmpdir=__commonJS({"../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js"(exports,module){"use strict";var isWindows=process.platform==="win32",trailingSlashRe=isWindows?/[^:]\\$/:/.\/$/;module.exports=function(){var path;return isWindows?path=process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp":path=process.env.TMPDIR||process.env.TMP||process.env.TEMP||"/tmp",trailingSlashRe.test(path)&&(path=path.slice(0,-1)),path}}});var require_os_homedir=__commonJS({"../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js"(exports,module){"use strict";var os=__require("os");function homedir(){var env=process.env,home=env.HOME,user=env.LOGNAME||env.USER||env.LNAME||env.USERNAME;return process.platform==="win32"?env.USERPROFILE||env.HOMEDRIVE+env.HOMEPATH||home||null:process.platform==="darwin"?home||(user?"/Users/"+user:null):process.platform==="linux"?home||(process.getuid()===0?"/root":user?"/home/"+user:null):home||null}module.exports=typeof os.homedir=="function"?os.homedir:homedir}});var require_osenv=__commonJS({"../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js"(exports){var isWindows=process.platform==="win32",path=__require("path"),exec=__require("child_process").exec,osTmpdir=require_os_tmpdir(),osHomedir=require_os_homedir();function memo(key,lookup,fallback){var fell=!1,falling=!1;exports[key]=function(cb){var val=lookup();return!val&&!fell&&!falling&&fallback&&(fell=!0,falling=!0,exec(fallback,function(er,output,stderr){falling=!1,!er&&(val=output.trim())})),exports[key]=function(cb2){return cb2&&process.nextTick(cb2.bind(null,null,val)),val},cb&&!falling&&process.nextTick(cb.bind(null,null,val)),val}}memo("user",function(){return isWindows?process.env.USERDOMAIN+"\\"+process.env.USERNAME:process.env.USER},"whoami");memo("prompt",function(){return isWindows?process.env.PROMPT:process.env.PS1});memo("hostname",function(){return isWindows?process.env.COMPUTERNAME:process.env.HOSTNAME},"hostname");memo("tmpdir",function(){return osTmpdir()});memo("home",function(){return osHomedir()});memo("path",function(){return(process.env.PATH||process.env.Path||process.env.path).split(isWindows?";":":")});memo("editor",function(){return process.env.EDITOR||process.env.VISUAL||(isWindows?"notepad.exe":"vi")});memo("shell",function(){return isWindows?process.env.ComSpec||"cmd":process.env.SHELL||"bash"})}});var require_npa=__commonJS({"../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js"(exports,module){"use strict";module.exports=npa2;module.exports.resolve=resolve;module.exports.Result=Result;var url,HostedGit,semver,path,validatePackageName,osenv,isWindows=process.platform==="win32"||global.FAKE_WINDOWS,hasSlashes=isWindows?/\\|[/]/:/[/]/,isURL=/^(?:git[+])?[a-z]+:/i,isFilename=/[.](?:tgz|tar.gz|tar)$/i;function npa2(arg,where){let name,spec;if(typeof arg=="object")return arg instanceof Result&&(!where||where===arg.where)?arg:arg.name&&arg.rawSpec?npa2.resolve(arg.name,arg.rawSpec,where||arg.where):npa2(arg.raw,where||arg.where);let nameEndsAt=arg[0]==="@"?arg.slice(1).indexOf("@")+1:arg.indexOf("@"),namePart=nameEndsAt>0?arg.slice(0,nameEndsAt):arg;return isURL.test(arg)||namePart[0]!=="@"&&(hasSlashes.test(namePart)||isFilename.test(namePart))?spec=arg:nameEndsAt>0?(name=namePart,spec=arg.slice(nameEndsAt+1)):(validatePackageName||(validatePackageName=require_validate_npm_package_name()),validatePackageName(arg).validForOldPackages?name=arg:spec=arg),resolve(name,spec,where,arg)}var isFilespec=isWindows?/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/:/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/;function resolve(name,spec,where,arg){let res=new Result({raw:arg,name,rawSpec:spec,fromArgument:arg!=null});if(name&&res.setName(name),spec&&(isFilespec.test(spec)||/^file:/i.test(spec)))return fromFile(res,where);if(spec&&/^npm:/i.test(spec))return fromAlias(res,where);HostedGit||(HostedGit=require_hosted_git_info());let hosted=HostedGit.fromUrl(spec,{noGitPlus:!0,noCommittish:!0});return hosted?fromHostedGit(res,hosted):spec&&isURL.test(spec)?fromURL(res):spec&&(hasSlashes.test(spec)||isFilename.test(spec))?fromFile(res,where):fromRegistry(res)}function invalidPackageName(name,valid){let err=new Error(`Invalid package name "${name}": ${valid.errors.join("; ")}`);return err.code="EINVALIDPACKAGENAME",err}function invalidTagName(name){let err=new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`);return err.code="EINVALIDTAGNAME",err}function Result(opts){this.type=opts.type,this.registry=opts.registry,this.where=opts.where,opts.raw==null?this.raw=opts.name?opts.name+"@"+opts.rawSpec:opts.rawSpec:this.raw=opts.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=opts.rawSpec==null?"":opts.rawSpec,this.saveSpec=opts.saveSpec,this.fetchSpec=opts.fetchSpec,opts.name&&this.setName(opts.name),this.gitRange=opts.gitRange,this.gitCommittish=opts.gitCommittish,this.hosted=opts.hosted}Result.prototype={};Result.prototype.setName=function(name){validatePackageName||(validatePackageName=require_validate_npm_package_name());let valid=validatePackageName(name);if(!valid.validForOldPackages)throw invalidPackageName(name,valid);return this.name=name,this.scope=name[0]==="@"?name.slice(0,name.indexOf("/")):void 0,this.escapedName=name.replace("/","%2f"),this};Result.prototype.toString=function(){let full=[];this.name!=null&&this.name!==""&&full.push(this.name);let spec=this.saveSpec||this.fetchSpec||this.rawSpec;return spec!=null&&spec!==""&&full.push(spec),full.length?full.join("@"):this.raw};Result.prototype.toJSON=function(){let result=Object.assign({},this);return delete result.hosted,result};function setGitCommittish(res,committish){return committish!=null&&committish.length>=7&&committish.slice(0,7)==="semver:"?(res.gitRange=decodeURIComponent(committish.slice(7)),res.gitCommittish=null):res.gitCommittish=committish===""?null:committish,res}var isAbsolutePath=/^[/]|^[A-Za-z]:/;function resolvePath(where,spec){return isAbsolutePath.test(spec)?spec:(path||(path=__require("path")),path.resolve(where,spec))}function isAbsolute2(dir){return!!(dir[0]==="/"||/^[A-Za-z]:/.test(dir))}function fromFile(res,where){where||(where=process.cwd()),res.type=isFilename.test(res.rawSpec)?"file":"directory",res.where=where;let spec=res.rawSpec.replace(/\\/g,"/").replace(/^file:[/]*([A-Za-z]:)/,"$1").replace(/^file:(?:[/]*([~./]))?/,"$1");return/^~[/]/.test(spec)?(osenv||(osenv=require_osenv()),res.fetchSpec=resolvePath(osenv.home(),spec.slice(2)),res.saveSpec="file:"+spec):(res.fetchSpec=resolvePath(where,spec),isAbsolute2(spec)?res.saveSpec="file:"+spec:(path||(path=__require("path")),res.saveSpec="file:"+path.relative(where,res.fetchSpec))),res}function fromHostedGit(res,hosted){return res.type="git",res.hosted=hosted,res.saveSpec=hosted.toString({noGitPlus:!1,noCommittish:!1}),res.fetchSpec=hosted.getDefaultRepresentation()==="shortcut"?null:hosted.toString(),setGitCommittish(res,hosted.committish)}function unsupportedURLType(protocol,spec){let err=new Error(`Unsupported URL Type "${protocol}": ${spec}`);return err.code="EUNSUPPORTEDPROTOCOL",err}function matchGitScp(spec){let matched=spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);return matched&&!matched[1].match(/:[0-9]+\/?.*$/i)&&{fetchSpec:matched[1],gitCommittish:matched[2]==null?null:matched[2]}}function fromURL(res){url||(url=__require("url"));let urlparse=url.parse(res.rawSpec);switch(res.saveSpec=res.rawSpec,urlparse.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":res.type="git";let match=urlparse.protocol==="git+ssh:"&&matchGitScp(res.rawSpec);match?(setGitCommittish(res,match.gitCommittish),res.fetchSpec=match.fetchSpec):(setGitCommittish(res,urlparse.hash!=null?urlparse.hash.slice(1):""),urlparse.protocol=urlparse.protocol.replace(/^git[+]/,""),delete urlparse.hash,res.fetchSpec=url.format(urlparse));break;case"http:":case"https:":res.type="remote",res.fetchSpec=res.saveSpec;break;default:throw unsupportedURLType(urlparse.protocol,res.rawSpec)}return res}function fromAlias(res,where){let subSpec=npa2(res.rawSpec.substr(4),where);if(subSpec.type==="alias")throw new Error("nested aliases not supported");if(!subSpec.registry)throw new Error("aliases only work for registry deps");return res.subSpec=subSpec,res.registry=!0,res.type="alias",res.saveSpec=null,res.fetchSpec=null,res}function fromRegistry(res){res.registry=!0;let spec=res.rawSpec===""?"latest":res.rawSpec;res.saveSpec=null,res.fetchSpec=spec,semver||(semver=require_semver());let version2=semver.valid(spec,!0),range=semver.validRange(spec,!0);if(version2)res.type="version";else if(range)res.type="range";else{if(encodeURIComponent(spec)!==spec)throw invalidTagName(spec);res.type="tag"}return res}}});var require_import_builders=__commonJS({"../../internals/builder-orchestration/dist/import-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),import_builders_exports={};__export2(import_builders_exports,{createImportBuilders:()=>createImportBuilders2,formatResolvedBuilders:()=>formatResolvedBuilders2,getBuildersDir:()=>getBuildersDir2,pinBuilderSpecs:()=>pinBuilderSpecs});module.exports=__toCommonJS(import_builders_exports);var import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_path2=__require("path"),import_fs_extra=require_lib(),import_fs_detectors=require_dist2(),import_error_utils=require_dist();function isRemoteBuilderPin(pin){return/^https?:\/\//i.test(pin)}function isDefaultSpec(parsed){return parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function formatResolvedBuilders2(builders){return Array.from(builders.values(),b=>b.pkgPath?`${b.pkg.name}@${b.pkg.version}=${(0,import_path2.dirname)(b.pkgPath)}`:`${b.pkg.name}=built-in`).join(",")}function pinBuilderSpecs(specs,pins){let pinnedSpecs=new Map;for(let spec of specs){let parsed=(0,import_npm_package_arg2.default)(spec);if(parsed.name&&isDefaultSpec(parsed)){let version2=pins.get(parsed.name);version2&&pinnedSpecs.set(spec,isRemoteBuilderPin(version2)?version2:`${parsed.name}@${version2}`)}}return pinnedSpecs}function getBuildersDir2(cwd,vercelDir=".vercel"){let override=process.env.VERCEL_BUILDERS_DIR;return override?(0,import_path2.isAbsolute)(override)?override:(0,import_path2.resolve)(cwd,override):(0,import_path2.join)(cwd,vercelDir,"builders")}function createImportBuilders2(dependencies){let{buildersDir:resolveBuildersDir=getBuildersDir2,debug,installBuilders:installBuilders2,isNativeBinaryInstall,require:require2,staticBuilder,vercelDir}=dependencies,builderPins2=new Map;for(let[name,version2]of Object.entries(dependencies.builderPins))((0,import_semver.validRange)(version2)||isRemoteBuilderPin(version2))&&builderPins2.set(name,version2);let resolveDependencies={builderPins:builderPins2,debug,isNativeBinaryInstall,require:require2,staticBuilder};return async function(builderSpecs,cwd,span){let buildersDir=resolveBuildersDir(cwd,vercelDir),importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies);if("buildersToAdd"in importResult){let{buildersToAdd,installReasons}=importResult,pinnedSpecs=pinBuilderSpecs(buildersToAdd,builderPins2),installResult=await installBuilders2(buildersDir,new Set(Array.from(buildersToAdd,spec=>pinnedSpecs.get(spec)??spec)),span,installReasons,pinnedSpecs),allowedPinDriftSpecs=new Set(Array.from(pinnedSpecs.keys()).filter(spec=>installResult.has(spec)));if(importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies,installResult,allowedPinDriftSpecs),"buildersToAdd"in importResult){let{buildersToAdd:failed,installReasons:reasons}=importResult,failures=Array.from(failed,spec=>{let reason=reasons.get(spec);return reason?`${spec} (${reason})`:spec}),err=new Error(`Failed to load Builders after installing them: ${failures.join(", ")}. Retry the build. If the failure persists, contact Vercel Support.`);throw Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"}),err}}let resolvedBuildersDebug=[];for(let[spec,builderSpec]of importResult.builders)resolvedBuildersDebug.push(`${spec} => ${builderSpec.pkg.version}`);return debug(`Resolved builders: "${resolvedBuildersDebug.join(", ")}"`),importResult.builders}}function missingModuleId(err){let id=/Cannot find module '([^']+)'/.exec(err.message)?.[1];if(id&&!(id.startsWith("/")||id.startsWith(".")||/^[A-Za-z]:[\\/]/.test(id)))return id.replace(/[,=]/g,"_").slice(0,100)}async function resolveBuilders(buildersDir,builderSpecs,dependencies,resolvedSpecs,allowedPinDriftSpecs){let builders=new Map,buildersToAdd=new Set,installReasons=new Map;for(let spec of builderSpecs){let resolvedSpec=resolvedSpecs?.get(spec)||spec,parsed=(0,import_npm_package_arg2.default)(resolvedSpec),{name}=parsed;if(!name){buildersToAdd.add(spec),installReasons.set(spec,"url-spec");continue}if((0,import_fs_detectors.isStaticRuntime)(name)){builders.set(name,{builder:dependencies.staticBuilder,pkg:{name},path:"",pkgPath:"",dynamicallyInstalled:!1});continue}let entrypointLoadFailed=!1;try{let pkgPath,builderPkg;try{pkgPath=(0,import_path2.join)(buildersDir,"node_modules",name,"package.json"),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error;if(dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"not-installed");continue}pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);let peerVersion=dependencies.builderPins.get(name);if(isDefaultSpec(parsed)&&peerVersion&&(0,import_semver.valid)(peerVersion)&&builderPkg.version!==peerVersion&&!allowedPinDriftSpecs?.has(spec)){dependencies.debug(`Resolved "${name}@${builderPkg.version}" does not match pin "${peerVersion}"`),buildersToAdd.add(spec),installReasons.set(spec,"pin-version-mismatch");continue}if(isDefaultSpec(parsed)&&peerVersion&&isRemoteBuilderPin(peerVersion)&&pkgPath.startsWith(buildersDir)&&!allowedPinDriftSpecs?.has(spec)){let installedSpec;try{installedSpec=(await(0,import_fs_extra.readJSON)((0,import_path2.join)(buildersDir,"package.json"))).dependencies?.[name]}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error}if(installedSpec!==peerVersion){if(dependencies.debug(`Installed source for "${name}@${builderPkg.version}" is "${installedSpec??"unknown"}", not pin "${peerVersion}"`),dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}try{pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(resolveError){if((0,import_error_utils.isErrnoException)(resolveError)&&(resolveError.code==="MODULE_NOT_FOUND"||resolveError.code==="ENOENT")){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}throw resolveError}}}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);if(parsed.type==="version"&&parsed.rawSpec!==builderPkg.version){dependencies.debug(`Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"version-mismatch");continue}if(parsed.type==="range"&&!(0,import_semver.satisfies)(builderPkg.version,parsed.rawSpec)){dependencies.debug(`Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"range-mismatch");continue}let path=(0,import_path2.join)((0,import_path2.dirname)(pkgPath),builderPkg.main||"index.js"),builder;try{builder=dependencies.require(path)}catch(requireErr){throw entrypointLoadFailed=!0,requireErr}let dynamicallyInstalled=pkgPath.startsWith(buildersDir);builders.set(spec,{builder,pkg:{name,...builderPkg},path,pkgPath,dynamicallyInstalled}),dependencies.debug(`Imported Builder "${name}" from "${(0,import_path2.dirname)(pkgPath)}"`)}catch(error){if(!(error instanceof Error))throw error;let err=error;if((err.code==="MODULE_NOT_FOUND"||err.code==="ENOENT")&&!resolvedSpecs)if(dependencies.debug(`Failed to import "${name}": ${err}`),buildersToAdd.add(spec),entrypointLoadFailed){let missing=missingModuleId(err);installReasons.set(spec,missing?`entrypoint-load-failed:${missing}`:"entrypoint-load-failed")}else installReasons.set(spec,"not-installed");else throw err.message=`Importing "${name}": ${err.message}`,err}}return buildersToAdd.size>0?{buildersToAdd,installReasons}:{builders}}}});var require_static_builder=__commonJS({"../../internals/builder-orchestration/dist/static-builder.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),static_builder_exports2={};__export2(static_builder_exports2,{createStaticBuilder:()=>createStaticBuilder2,version:()=>version2});module.exports=__toCommonJS(static_builder_exports2);var import_minimatch=__toESM2(require_minimatch()),import_path2=__require("path"),import_build_utils=__require("@vercel/build-utils"),version2=2,ALWAYS_EXCLUDED_PREFIXES=[".git/","node_modules/"],DEFAULT_EXCLUDED_FILES=[".gitignore","package.json","package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock","bun.lockb","README.md"];function createStaticBuilder2(vercelConfigExtensions){let alwaysExcludedFiles=["vercel.json","vercel.toml",...vercelConfigExtensions.map(ext=>`vercel.${ext}`),".vercelignore","now.json",".nowignore"];return{version:version2,build:async({entrypoint,files,config,workPath,meta={},service})=>{let output={},outputDirectory=config.zeroConfig?config.outputDirectory:"",canPublish=meta.daemonContext?await(0,import_build_utils.createDaemonStaticFileFilter)({context:meta.daemonContext,publishPath:(0,import_path2.resolve)(workPath,outputDirectory||"."),serviceName:service?.name}):void 0;for(let[srcFilename,fileFsRef]of Object.entries(files)){if(entrypoint&&!(entrypoint===srcFilename||(0,import_minimatch.default)(srcFilename,entrypoint,{dot:!0})))continue;let filename=srcFilename;if(outputDirectory){let outputMatch=outputDirectory+"/";filename.startsWith(outputMatch)&&(filename=filename.slice(outputMatch.length))}ALWAYS_EXCLUDED_PREFIXES.some(prefix=>filename.startsWith(prefix))||alwaysExcludedFiles.includes(filename)||DEFAULT_EXCLUDED_FILES.includes(filename)||filename.startsWith(".env")||(!canPublish||await canPublish((0,import_path2.resolve)(workPath,srcFilename)))&&(output[filename]=fileFsRef)}return{output}},shouldServe:_opts=>{let opts={..._opts},{config:{zeroConfig,outputDirectory}}=opts;return zeroConfig&&outputDirectory&&(opts.entrypoint=`${outputDirectory}/${opts.entrypoint}`,opts.requestPath=`${outputDirectory}/${opts.requestPath}`),(0,import_build_utils.shouldServe)(opts)},diagnostics:async({service})=>({[import_build_utils.MANIFEST_FILENAME]:new import_build_utils.FileBlob({data:JSON.stringify({version:import_build_utils.MANIFEST_VERSION,runtime:"static",buildType:"app",dependencies:[],serviceType:service!==void 0?(0,import_build_utils.getReportedServiceType)(service):void 0})})})}}}});var require_install_builders=__commonJS({"../../internals/builder-orchestration/dist/install-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),install_builders_exports={};__export2(install_builders_exports,{createInstallBuilders:()=>createInstallBuilders2,getBuildUtilsSpec:()=>getBuildUtilsSpec,getBuildUtilsVersionForInstall:()=>getBuildUtilsVersionForInstall,shouldFallbackBuilderPins:()=>shouldFallbackBuilderPins});module.exports=__toCommonJS(install_builders_exports);var import_url=__require("url"),import_pluralize=__toESM2(require_pluralize()),import_path2=__require("path"),import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_fs_extra=require_lib(),import_error_utils=require_dist();function getBuildUtilsVersionForInstall(dependencies,usePinnedVersion){return usePinnedVersion?dependencies.pinnedBuildUtilsVersion??dependencies.buildUtilsVersion:dependencies.buildUtilsVersion}function shouldFallbackBuilderPins(dependencies,pinnedSpecCount){return pinnedSpecCount>0&&!dependencies.strictBuilderPins}function getBuildUtilsSpec(buildUtilsVersion){if(!buildUtilsVersion)return"@vercel/build-utils";if((0,import_semver.validRange)(buildUtilsVersion))return`@vercel/build-utils@${buildUtilsVersion}`;try{if((0,import_npm_package_arg2.default)(buildUtilsVersion).type==="remote")return`@vercel/build-utils@${buildUtilsVersion}`}catch{}return"@vercel/build-utils"}function getErrorMessage(err,execaMessage){return!err||!("stderr"in err)?execaMessage:typeof err.stderr=="string"?err.stderr:execaMessage}async function untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,buildUtilsVersion=dependencies.buildUtilsVersion){let{code:code2,cmd:cmd2,output,readJSONFile:readJSONFile2,run}=dependencies,resolvedSpecs=new Map,buildersPkgPath=(0,import_path2.join)(buildersDir,"package.json");try{let emptyPkgJson={private:!0,license:"UNLICENSED"};await(0,import_fs_extra.outputJSON)(buildersPkgPath,emptyPkgJson,{flag:"wx"})}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="EEXIST")throw error}output.log(`Installing ${(0,import_pluralize.default)("Builder",buildersToAdd.size)}: ${Array.from(buildersToAdd).join(", ")}`);let installArgs=["install",getBuildUtilsSpec(buildUtilsVersion),...buildersToAdd];try{let{stderr}=await run("npm",installArgs,{cwd:buildersDir,stdio:"pipe",reject:!0});stderr.split(`/\r?
|
|
7
|
+
import{loadEmbeddedBuilderGraphs,loadEmbeddedBuilderIndex}from"./chunk-4CACOKMS.js";import{readJSONFile}from"./chunk-MZLQY2EQ.js";import{require_dist2,require_minimatch}from"./chunk-BLAIBYEU.js";import{require_semver}from"./chunk-BPUANOGW.js";import{require_execa}from"./chunk-KKCBFBJK.js";import{isManagedBuildersInstall}from"./chunk-NWGBDBZI.js";import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,require_lib,require_pluralize}from"./chunk-U3NQZJQ4.js";import{CantParseJSONFile,code}from"./chunk-XSDAUM4F.js";import{cmd}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{__commonJS,__export,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_builtins=__commonJS({"../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json"(exports,module){module.exports=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]}});var require_validate_npm_package_name=__commonJS({"../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js"(exports,module){"use strict";var scopedPackagePattern=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),builtins=require_builtins(),blacklist=["node_modules","favicon.ico"],validate=module.exports=function(name){var warnings=[],errors=[];if(name===null)return errors.push("name cannot be null"),done(warnings,errors);if(name===void 0)return errors.push("name cannot be undefined"),done(warnings,errors);if(typeof name!="string")return errors.push("name must be a string"),done(warnings,errors);if(name.length||errors.push("name length must be greater than zero"),name.match(/^\./)&&errors.push("name cannot start with a period"),name.match(/^_/)&&errors.push("name cannot start with an underscore"),name.trim()!==name&&errors.push("name cannot contain leading or trailing spaces"),blacklist.forEach(function(blacklistedName){name.toLowerCase()===blacklistedName&&errors.push(blacklistedName+" is a blacklisted name")}),builtins.forEach(function(builtin){name.toLowerCase()===builtin&&warnings.push(builtin+" is a core module name")}),name.length>214&&warnings.push("name can no longer contain more than 214 characters"),name.toLowerCase()!==name&&warnings.push("name can no longer contain capital letters"),/[~'!()*]/.test(name.split("/").slice(-1)[0])&&warnings.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(name)!==name){var nameMatch=name.match(scopedPackagePattern);if(nameMatch){var user=nameMatch[1],pkg=nameMatch[2];if(encodeURIComponent(user)===user&&encodeURIComponent(pkg)===pkg)return done(warnings,errors)}errors.push("name can only contain URL-friendly characters")}return done(warnings,errors)};validate.scopedPackagePattern=scopedPackagePattern;var done=function(warnings,errors){var result={validForNewPackages:errors.length===0&&warnings.length===0,validForOldPackages:errors.length===0,warnings,errors};return result.warnings.length||delete result.warnings,result.errors.length||delete result.errors,result}}});var require_git_host_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js"(exports,module){"use strict";var gitHosts=module.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(fragment){return"file-"+formatHashFragment(fragment)}}},gitHostDefaults={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:formatHashFragment};Object.keys(gitHosts).forEach(function(name){Object.keys(gitHostDefaults).forEach(function(key){gitHosts[name][key]||(gitHosts[name][key]=gitHostDefaults[key])}),gitHosts[name].protocols_re=RegExp("^("+gitHosts[name].protocols.map(function(protocol){return protocol.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function formatHashFragment(fragment){return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}}});var require_git_host=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js"(exports,module){"use strict";var gitHosts=require_git_host_info(),extend=Object.assign||function(target,source){if(source===null||typeof source!="object")return target;for(var keys=Object.keys(source),i=keys.length;i--;)target[keys[i]]=source[keys[i]];return target};module.exports=GitHost;function GitHost(type,user,auth,project,committish,defaultRepresentation,opts){var gitHostInfo=this;gitHostInfo.type=type,Object.keys(gitHosts[type]).forEach(function(key){gitHostInfo[key]=gitHosts[type][key]}),gitHostInfo.user=user,gitHostInfo.auth=auth,gitHostInfo.project=project,gitHostInfo.committish=committish,gitHostInfo.default=defaultRepresentation,gitHostInfo.opts=opts||{}}GitHost.prototype.hash=function(){return this.committish?"#"+this.committish:""};GitHost.prototype._fill=function(template,opts){if(template){var vars=extend({},opts);vars.path=vars.path?vars.path.replace(/^[/]+/g,""):"",opts=extend(extend({},this.opts),opts);var self=this;Object.keys(this).forEach(function(key){self[key]!=null&&vars[key]==null&&(vars[key]=self[key])});var rawAuth=vars.auth,rawcommittish=vars.committish,rawFragment=vars.fragment,rawPath=vars.path,rawProject=vars.project;Object.keys(vars).forEach(function(key){var value=vars[key];(key==="path"||key==="project")&&typeof value=="string"?vars[key]=value.split("/").map(function(pathComponent){return encodeURIComponent(pathComponent)}).join("/"):vars[key]=encodeURIComponent(value)}),vars["auth@"]=rawAuth?rawAuth+"@":"",vars["#fragment"]=rawFragment?"#"+this.hashformat(rawFragment):"",vars.fragment=vars.fragment?vars.fragment:"",vars["#path"]=rawPath?"#"+this.hashformat(rawPath):"",vars["/path"]=vars.path?"/"+vars.path:"",vars.projectPath=rawProject.split("/").map(encodeURIComponent).join("/"),opts.noCommittish?(vars["#committish"]="",vars["/tree/committish"]="",vars["/committish"]="",vars.committish=""):(vars["#committish"]=rawcommittish?"#"+rawcommittish:"",vars["/tree/committish"]=vars.committish?"/"+vars.treepath+"/"+vars.committish:"",vars["/committish"]=vars.committish?"/"+vars.committish:"",vars.committish=vars.committish||"master");var res=template;return Object.keys(vars).forEach(function(key){res=res.replace(new RegExp("[{]"+key+"[}]","g"),vars[key])}),opts.noGitPlus?res.replace(/^git[+]/,""):res}};GitHost.prototype.ssh=function(opts){return this._fill(this.sshtemplate,opts)};GitHost.prototype.sshurl=function(opts){return this._fill(this.sshurltemplate,opts)};GitHost.prototype.browse=function(P,F,opts){return typeof P=="string"?(typeof F!="string"&&(opts=F,F=null),this._fill(this.browsefiletemplate,extend({fragment:F,path:P},opts))):this._fill(this.browsetemplate,P)};GitHost.prototype.docs=function(opts){return this._fill(this.docstemplate,opts)};GitHost.prototype.bugs=function(opts){return this._fill(this.bugstemplate,opts)};GitHost.prototype.https=function(opts){return this._fill(this.httpstemplate,opts)};GitHost.prototype.git=function(opts){return this._fill(this.gittemplate,opts)};GitHost.prototype.shortcut=function(opts){return this._fill(this.shortcuttemplate,opts)};GitHost.prototype.path=function(opts){return this._fill(this.pathtemplate,opts)};GitHost.prototype.tarball=function(opts_){var opts=extend({},opts_,{noCommittish:!1});return this._fill(this.tarballtemplate,opts)};GitHost.prototype.file=function(P,opts){return this._fill(this.filetemplate,extend({path:P},opts))};GitHost.prototype.getDefaultRepresentation=function(){return this.default};GitHost.prototype.toString=function(opts){return this.default&&typeof this[this.default]=="function"?this[this.default](opts):this.sshurl(opts)}}});var require_hosted_git_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js"(exports,module){"use strict";var url=__require("url"),gitHosts=require_git_host_info(),GitHost=module.exports=require_git_host(),protocolToRepresentationMap={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function protocolToRepresentation(protocol){return protocolToRepresentationMap[protocol]||protocol.slice(0,-1)}var authProtocols={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0},cache={};module.exports.fromUrl=function(giturl,opts){if(typeof giturl=="string"){var key=giturl+JSON.stringify(opts||{});return key in cache||(cache[key]=fromUrl(giturl,opts)),cache[key]}};function fromUrl(giturl,opts){if(!(giturl==null||giturl==="")){var url2=fixupUnqualifiedGist(isGitHubShorthand(giturl)?"github:"+giturl:giturl),parsed=parseGitUrl(url2),shortcutMatch=url2.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),matches=Object.keys(gitHosts).map(function(gitHostName){try{var gitHostInfo=gitHosts[gitHostName],auth=null;parsed.auth&&authProtocols[parsed.protocol]&&(auth=parsed.auth);var committish=parsed.hash?decodeURIComponent(parsed.hash.substr(1)):null,user=null,project=null,defaultRepresentation=null;if(shortcutMatch&&shortcutMatch[1]===gitHostName)user=shortcutMatch[2]&&decodeURIComponent(shortcutMatch[2]),project=decodeURIComponent(shortcutMatch[3].replace(/\.git$/,"")),defaultRepresentation="shortcut";else{if(parsed.host&&parsed.host!==gitHostInfo.domain&&parsed.host.replace(/^www[.]/,"")!==gitHostInfo.domain||!gitHostInfo.protocols_re.test(parsed.protocol)||!parsed.path)return;var pathmatch=gitHostInfo.pathmatch,matched=parsed.path.match(pathmatch);if(!matched)return;matched[1]!==null&&matched[1]!==void 0&&(user=decodeURIComponent(matched[1].replace(/^:/,""))),project=decodeURIComponent(matched[2]),defaultRepresentation=protocolToRepresentation(parsed.protocol)}return new GitHost(gitHostName,user,auth,project,committish,defaultRepresentation,opts)}catch(ex){if(!(ex instanceof URIError))throw ex}}).filter(function(gitHostInfo){return gitHostInfo});if(matches.length===1)return matches[0]}}function isGitHubShorthand(arg){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg)}function fixupUnqualifiedGist(giturl){var parsed=url.parse(giturl);return parsed.protocol==="gist:"&&parsed.host&&!parsed.path?parsed.protocol+"/"+parsed.host:giturl}function parseGitUrl(giturl){var matched=giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!matched){var legacy=url.parse(giturl);if(legacy.auth&&typeof url.URL=="function"){var authmatch=giturl.match(/[^@]+@[^:/]+/);if(authmatch){var whatwg=new url.URL(authmatch[0]);legacy.auth=whatwg.username||"",whatwg.password&&(legacy.auth+=":"+whatwg.password)}}return legacy}return{protocol:"git+ssh:",slashes:!0,auth:matched[1],host:matched[2],port:null,hostname:matched[2],hash:matched[4],search:null,query:null,pathname:"/"+matched[3],path:"/"+matched[3],href:"git+ssh://"+matched[1]+"@"+matched[2]+"/"+matched[3]+(matched[4]||"")}}}});var require_os_tmpdir=__commonJS({"../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js"(exports,module){"use strict";var isWindows=process.platform==="win32",trailingSlashRe=isWindows?/[^:]\\$/:/.\/$/;module.exports=function(){var path;return isWindows?path=process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp":path=process.env.TMPDIR||process.env.TMP||process.env.TEMP||"/tmp",trailingSlashRe.test(path)&&(path=path.slice(0,-1)),path}}});var require_os_homedir=__commonJS({"../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js"(exports,module){"use strict";var os=__require("os");function homedir(){var env=process.env,home=env.HOME,user=env.LOGNAME||env.USER||env.LNAME||env.USERNAME;return process.platform==="win32"?env.USERPROFILE||env.HOMEDRIVE+env.HOMEPATH||home||null:process.platform==="darwin"?home||(user?"/Users/"+user:null):process.platform==="linux"?home||(process.getuid()===0?"/root":user?"/home/"+user:null):home||null}module.exports=typeof os.homedir=="function"?os.homedir:homedir}});var require_osenv=__commonJS({"../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js"(exports){var isWindows=process.platform==="win32",path=__require("path"),exec=__require("child_process").exec,osTmpdir=require_os_tmpdir(),osHomedir=require_os_homedir();function memo(key,lookup,fallback){var fell=!1,falling=!1;exports[key]=function(cb){var val=lookup();return!val&&!fell&&!falling&&fallback&&(fell=!0,falling=!0,exec(fallback,function(er,output,stderr){falling=!1,!er&&(val=output.trim())})),exports[key]=function(cb2){return cb2&&process.nextTick(cb2.bind(null,null,val)),val},cb&&!falling&&process.nextTick(cb.bind(null,null,val)),val}}memo("user",function(){return isWindows?process.env.USERDOMAIN+"\\"+process.env.USERNAME:process.env.USER},"whoami");memo("prompt",function(){return isWindows?process.env.PROMPT:process.env.PS1});memo("hostname",function(){return isWindows?process.env.COMPUTERNAME:process.env.HOSTNAME},"hostname");memo("tmpdir",function(){return osTmpdir()});memo("home",function(){return osHomedir()});memo("path",function(){return(process.env.PATH||process.env.Path||process.env.path).split(isWindows?";":":")});memo("editor",function(){return process.env.EDITOR||process.env.VISUAL||(isWindows?"notepad.exe":"vi")});memo("shell",function(){return isWindows?process.env.ComSpec||"cmd":process.env.SHELL||"bash"})}});var require_npa=__commonJS({"../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js"(exports,module){"use strict";module.exports=npa2;module.exports.resolve=resolve;module.exports.Result=Result;var url,HostedGit,semver,path,validatePackageName,osenv,isWindows=process.platform==="win32"||global.FAKE_WINDOWS,hasSlashes=isWindows?/\\|[/]/:/[/]/,isURL=/^(?:git[+])?[a-z]+:/i,isFilename=/[.](?:tgz|tar.gz|tar)$/i;function npa2(arg,where){let name,spec;if(typeof arg=="object")return arg instanceof Result&&(!where||where===arg.where)?arg:arg.name&&arg.rawSpec?npa2.resolve(arg.name,arg.rawSpec,where||arg.where):npa2(arg.raw,where||arg.where);let nameEndsAt=arg[0]==="@"?arg.slice(1).indexOf("@")+1:arg.indexOf("@"),namePart=nameEndsAt>0?arg.slice(0,nameEndsAt):arg;return isURL.test(arg)||namePart[0]!=="@"&&(hasSlashes.test(namePart)||isFilename.test(namePart))?spec=arg:nameEndsAt>0?(name=namePart,spec=arg.slice(nameEndsAt+1)):(validatePackageName||(validatePackageName=require_validate_npm_package_name()),validatePackageName(arg).validForOldPackages?name=arg:spec=arg),resolve(name,spec,where,arg)}var isFilespec=isWindows?/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/:/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/;function resolve(name,spec,where,arg){let res=new Result({raw:arg,name,rawSpec:spec,fromArgument:arg!=null});if(name&&res.setName(name),spec&&(isFilespec.test(spec)||/^file:/i.test(spec)))return fromFile(res,where);if(spec&&/^npm:/i.test(spec))return fromAlias(res,where);HostedGit||(HostedGit=require_hosted_git_info());let hosted=HostedGit.fromUrl(spec,{noGitPlus:!0,noCommittish:!0});return hosted?fromHostedGit(res,hosted):spec&&isURL.test(spec)?fromURL(res):spec&&(hasSlashes.test(spec)||isFilename.test(spec))?fromFile(res,where):fromRegistry(res)}function invalidPackageName(name,valid){let err=new Error(`Invalid package name "${name}": ${valid.errors.join("; ")}`);return err.code="EINVALIDPACKAGENAME",err}function invalidTagName(name){let err=new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`);return err.code="EINVALIDTAGNAME",err}function Result(opts){this.type=opts.type,this.registry=opts.registry,this.where=opts.where,opts.raw==null?this.raw=opts.name?opts.name+"@"+opts.rawSpec:opts.rawSpec:this.raw=opts.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=opts.rawSpec==null?"":opts.rawSpec,this.saveSpec=opts.saveSpec,this.fetchSpec=opts.fetchSpec,opts.name&&this.setName(opts.name),this.gitRange=opts.gitRange,this.gitCommittish=opts.gitCommittish,this.hosted=opts.hosted}Result.prototype={};Result.prototype.setName=function(name){validatePackageName||(validatePackageName=require_validate_npm_package_name());let valid=validatePackageName(name);if(!valid.validForOldPackages)throw invalidPackageName(name,valid);return this.name=name,this.scope=name[0]==="@"?name.slice(0,name.indexOf("/")):void 0,this.escapedName=name.replace("/","%2f"),this};Result.prototype.toString=function(){let full=[];this.name!=null&&this.name!==""&&full.push(this.name);let spec=this.saveSpec||this.fetchSpec||this.rawSpec;return spec!=null&&spec!==""&&full.push(spec),full.length?full.join("@"):this.raw};Result.prototype.toJSON=function(){let result=Object.assign({},this);return delete result.hosted,result};function setGitCommittish(res,committish){return committish!=null&&committish.length>=7&&committish.slice(0,7)==="semver:"?(res.gitRange=decodeURIComponent(committish.slice(7)),res.gitCommittish=null):res.gitCommittish=committish===""?null:committish,res}var isAbsolutePath=/^[/]|^[A-Za-z]:/;function resolvePath(where,spec){return isAbsolutePath.test(spec)?spec:(path||(path=__require("path")),path.resolve(where,spec))}function isAbsolute2(dir){return!!(dir[0]==="/"||/^[A-Za-z]:/.test(dir))}function fromFile(res,where){where||(where=process.cwd()),res.type=isFilename.test(res.rawSpec)?"file":"directory",res.where=where;let spec=res.rawSpec.replace(/\\/g,"/").replace(/^file:[/]*([A-Za-z]:)/,"$1").replace(/^file:(?:[/]*([~./]))?/,"$1");return/^~[/]/.test(spec)?(osenv||(osenv=require_osenv()),res.fetchSpec=resolvePath(osenv.home(),spec.slice(2)),res.saveSpec="file:"+spec):(res.fetchSpec=resolvePath(where,spec),isAbsolute2(spec)?res.saveSpec="file:"+spec:(path||(path=__require("path")),res.saveSpec="file:"+path.relative(where,res.fetchSpec))),res}function fromHostedGit(res,hosted){return res.type="git",res.hosted=hosted,res.saveSpec=hosted.toString({noGitPlus:!1,noCommittish:!1}),res.fetchSpec=hosted.getDefaultRepresentation()==="shortcut"?null:hosted.toString(),setGitCommittish(res,hosted.committish)}function unsupportedURLType(protocol,spec){let err=new Error(`Unsupported URL Type "${protocol}": ${spec}`);return err.code="EUNSUPPORTEDPROTOCOL",err}function matchGitScp(spec){let matched=spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);return matched&&!matched[1].match(/:[0-9]+\/?.*$/i)&&{fetchSpec:matched[1],gitCommittish:matched[2]==null?null:matched[2]}}function fromURL(res){url||(url=__require("url"));let urlparse=url.parse(res.rawSpec);switch(res.saveSpec=res.rawSpec,urlparse.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":res.type="git";let match=urlparse.protocol==="git+ssh:"&&matchGitScp(res.rawSpec);match?(setGitCommittish(res,match.gitCommittish),res.fetchSpec=match.fetchSpec):(setGitCommittish(res,urlparse.hash!=null?urlparse.hash.slice(1):""),urlparse.protocol=urlparse.protocol.replace(/^git[+]/,""),delete urlparse.hash,res.fetchSpec=url.format(urlparse));break;case"http:":case"https:":res.type="remote",res.fetchSpec=res.saveSpec;break;default:throw unsupportedURLType(urlparse.protocol,res.rawSpec)}return res}function fromAlias(res,where){let subSpec=npa2(res.rawSpec.substr(4),where);if(subSpec.type==="alias")throw new Error("nested aliases not supported");if(!subSpec.registry)throw new Error("aliases only work for registry deps");return res.subSpec=subSpec,res.registry=!0,res.type="alias",res.saveSpec=null,res.fetchSpec=null,res}function fromRegistry(res){res.registry=!0;let spec=res.rawSpec===""?"latest":res.rawSpec;res.saveSpec=null,res.fetchSpec=spec,semver||(semver=require_semver());let version2=semver.valid(spec,!0),range=semver.validRange(spec,!0);if(version2)res.type="version";else if(range)res.type="range";else{if(encodeURIComponent(spec)!==spec)throw invalidTagName(spec);res.type="tag"}return res}}});var require_import_builders=__commonJS({"../../internals/builder-orchestration/dist/import-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),import_builders_exports={};__export2(import_builders_exports,{createImportBuilders:()=>createImportBuilders2,formatResolvedBuilders:()=>formatResolvedBuilders2,getBuildersDir:()=>getBuildersDir2,pinBuilderSpecs:()=>pinBuilderSpecs});module.exports=__toCommonJS(import_builders_exports);var import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_path2=__require("path"),import_fs_extra=require_lib(),import_fs_detectors=require_dist2(),import_error_utils=require_dist();function isRemoteBuilderPin(pin){return/^https?:\/\//i.test(pin)}function isDefaultSpec(parsed){return parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function formatResolvedBuilders2(builders){return Array.from(builders.values(),b=>b.pkgPath?`${b.pkg.name}@${b.pkg.version}=${(0,import_path2.dirname)(b.pkgPath)}`:`${b.pkg.name}=built-in`).join(",")}function pinBuilderSpecs(specs,pins){let pinnedSpecs=new Map;for(let spec of specs){let parsed=(0,import_npm_package_arg2.default)(spec);if(parsed.name&&isDefaultSpec(parsed)){let version2=pins.get(parsed.name);version2&&pinnedSpecs.set(spec,isRemoteBuilderPin(version2)?version2:`${parsed.name}@${version2}`)}}return pinnedSpecs}function getBuildersDir2(cwd,vercelDir=".vercel"){let override=process.env.VERCEL_BUILDERS_DIR;return override?(0,import_path2.isAbsolute)(override)?override:(0,import_path2.resolve)(cwd,override):(0,import_path2.join)(cwd,vercelDir,"builders")}function createImportBuilders2(dependencies){let{buildersDir:resolveBuildersDir=getBuildersDir2,debug,installBuilders:installBuilders2,isNativeBinaryInstall,require:require2,staticBuilder,vercelDir}=dependencies,builderPins2=new Map;for(let[name,version2]of Object.entries(dependencies.builderPins))((0,import_semver.validRange)(version2)||isRemoteBuilderPin(version2))&&builderPins2.set(name,version2);let resolveDependencies={builderPins:builderPins2,debug,isNativeBinaryInstall,require:require2,staticBuilder};return async function(builderSpecs,cwd,span){let buildersDir=resolveBuildersDir(cwd,vercelDir),importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies);if("buildersToAdd"in importResult){let{buildersToAdd,installReasons}=importResult,pinnedSpecs=pinBuilderSpecs(buildersToAdd,builderPins2),installResult=await installBuilders2(buildersDir,new Set(Array.from(buildersToAdd,spec=>pinnedSpecs.get(spec)??spec)),span,installReasons,pinnedSpecs),allowedPinDriftSpecs=new Set(Array.from(pinnedSpecs.keys()).filter(spec=>installResult.has(spec)));if(importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies,installResult,allowedPinDriftSpecs),"buildersToAdd"in importResult){let{buildersToAdd:failed,installReasons:reasons}=importResult,failures=Array.from(failed,spec=>{let reason=reasons.get(spec);return reason?`${spec} (${reason})`:spec}),err=new Error(`Failed to load Builders after installing them: ${failures.join(", ")}. Retry the build. If the failure persists, contact Vercel Support.`);throw Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"}),err}}let resolvedBuildersDebug=[];for(let[spec,builderSpec]of importResult.builders)resolvedBuildersDebug.push(`${spec} => ${builderSpec.pkg.version}`);return debug(`Resolved builders: "${resolvedBuildersDebug.join(", ")}"`),importResult.builders}}function missingModuleId(err){let id=/Cannot find module '([^']+)'/.exec(err.message)?.[1];if(id&&!(id.startsWith("/")||id.startsWith(".")||/^[A-Za-z]:[\\/]/.test(id)))return id.replace(/[,=]/g,"_").slice(0,100)}async function resolveBuilders(buildersDir,builderSpecs,dependencies,resolvedSpecs,allowedPinDriftSpecs){let builders=new Map,buildersToAdd=new Set,installReasons=new Map;for(let spec of builderSpecs){let resolvedSpec=resolvedSpecs?.get(spec)||spec,parsed=(0,import_npm_package_arg2.default)(resolvedSpec),{name}=parsed;if(!name){buildersToAdd.add(spec),installReasons.set(spec,"url-spec");continue}if((0,import_fs_detectors.isStaticRuntime)(name)){builders.set(name,{builder:dependencies.staticBuilder,pkg:{name},path:"",pkgPath:"",dynamicallyInstalled:!1});continue}let entrypointLoadFailed=!1;try{let pkgPath,builderPkg;try{pkgPath=(0,import_path2.join)(buildersDir,"node_modules",name,"package.json"),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error;if(dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"not-installed");continue}pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);let peerVersion=dependencies.builderPins.get(name);if(isDefaultSpec(parsed)&&peerVersion&&(0,import_semver.valid)(peerVersion)&&builderPkg.version!==peerVersion&&!allowedPinDriftSpecs?.has(spec)){dependencies.debug(`Resolved "${name}@${builderPkg.version}" does not match pin "${peerVersion}"`),buildersToAdd.add(spec),installReasons.set(spec,"pin-version-mismatch");continue}if(isDefaultSpec(parsed)&&peerVersion&&isRemoteBuilderPin(peerVersion)&&pkgPath.startsWith(buildersDir)&&!allowedPinDriftSpecs?.has(spec)){let installedSpec;try{installedSpec=(await(0,import_fs_extra.readJSON)((0,import_path2.join)(buildersDir,"package.json"))).dependencies?.[name]}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error}if(installedSpec!==peerVersion){if(dependencies.debug(`Installed source for "${name}@${builderPkg.version}" is "${installedSpec??"unknown"}", not pin "${peerVersion}"`),dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}try{pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(resolveError){if((0,import_error_utils.isErrnoException)(resolveError)&&(resolveError.code==="MODULE_NOT_FOUND"||resolveError.code==="ENOENT")){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}throw resolveError}}}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);if(parsed.type==="version"&&parsed.rawSpec!==builderPkg.version){dependencies.debug(`Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"version-mismatch");continue}if(parsed.type==="range"&&!(0,import_semver.satisfies)(builderPkg.version,parsed.rawSpec)){dependencies.debug(`Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"range-mismatch");continue}let path=(0,import_path2.join)((0,import_path2.dirname)(pkgPath),builderPkg.main||"index.js"),builder;try{builder=dependencies.require(path)}catch(requireErr){throw entrypointLoadFailed=!0,requireErr}let dynamicallyInstalled=pkgPath.startsWith(buildersDir);builders.set(spec,{builder,pkg:{name,...builderPkg},path,pkgPath,dynamicallyInstalled}),dependencies.debug(`Imported Builder "${name}" from "${(0,import_path2.dirname)(pkgPath)}"`)}catch(error){if(!(error instanceof Error))throw error;let err=error;if((err.code==="MODULE_NOT_FOUND"||err.code==="ENOENT")&&!resolvedSpecs)if(dependencies.debug(`Failed to import "${name}": ${err}`),buildersToAdd.add(spec),entrypointLoadFailed){let missing=missingModuleId(err);installReasons.set(spec,missing?`entrypoint-load-failed:${missing}`:"entrypoint-load-failed")}else installReasons.set(spec,"not-installed");else throw err.message=`Importing "${name}": ${err.message}`,err}}return buildersToAdd.size>0?{buildersToAdd,installReasons}:{builders}}}});var require_static_builder=__commonJS({"../../internals/builder-orchestration/dist/static-builder.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),static_builder_exports2={};__export2(static_builder_exports2,{createStaticBuilder:()=>createStaticBuilder2,version:()=>version2});module.exports=__toCommonJS(static_builder_exports2);var import_minimatch=__toESM2(require_minimatch()),import_path2=__require("path"),import_build_utils=__require("@vercel/build-utils"),version2=2,ALWAYS_EXCLUDED_PREFIXES=[".git/","node_modules/"],DEFAULT_EXCLUDED_FILES=[".gitignore","package.json","package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock","bun.lockb","README.md"];function createStaticBuilder2(vercelConfigExtensions){let alwaysExcludedFiles=["vercel.json","vercel.toml",...vercelConfigExtensions.map(ext=>`vercel.${ext}`),".vercelignore","now.json",".nowignore"];return{version:version2,build:async({entrypoint,files,config,workPath,meta={},service})=>{let output={},outputDirectory=config.zeroConfig?config.outputDirectory:"",canPublish=meta.daemonContext?await(0,import_build_utils.createDaemonStaticFileFilter)({context:meta.daemonContext,publishPath:(0,import_path2.resolve)(workPath,outputDirectory||"."),serviceName:service?.name}):void 0;for(let[srcFilename,fileFsRef]of Object.entries(files)){if(entrypoint&&!(entrypoint===srcFilename||(0,import_minimatch.default)(srcFilename,entrypoint,{dot:!0})))continue;let filename=srcFilename;if(outputDirectory){let outputMatch=outputDirectory+"/";filename.startsWith(outputMatch)&&(filename=filename.slice(outputMatch.length))}ALWAYS_EXCLUDED_PREFIXES.some(prefix=>filename.startsWith(prefix))||alwaysExcludedFiles.includes(filename)||DEFAULT_EXCLUDED_FILES.includes(filename)||filename.startsWith(".env")||(!canPublish||await canPublish((0,import_path2.resolve)(workPath,srcFilename)))&&(output[filename]=fileFsRef)}return{output}},shouldServe:_opts=>{let opts={..._opts},{config:{zeroConfig,outputDirectory}}=opts;return zeroConfig&&outputDirectory&&(opts.entrypoint=`${outputDirectory}/${opts.entrypoint}`,opts.requestPath=`${outputDirectory}/${opts.requestPath}`),(0,import_build_utils.shouldServe)(opts)},diagnostics:async({service})=>({[import_build_utils.MANIFEST_FILENAME]:new import_build_utils.FileBlob({data:JSON.stringify({version:import_build_utils.MANIFEST_VERSION,runtime:"static",buildType:"app",dependencies:[],serviceType:service!==void 0?(0,import_build_utils.getReportedServiceType)(service):void 0})})})}}}});var require_install_builders=__commonJS({"../../internals/builder-orchestration/dist/install-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),install_builders_exports={};__export2(install_builders_exports,{createInstallBuilders:()=>createInstallBuilders2,getBuildUtilsSpec:()=>getBuildUtilsSpec,getBuildUtilsVersionForInstall:()=>getBuildUtilsVersionForInstall,shouldFallbackBuilderPins:()=>shouldFallbackBuilderPins});module.exports=__toCommonJS(install_builders_exports);var import_url=__require("url"),import_pluralize=__toESM2(require_pluralize()),import_path2=__require("path"),import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_fs_extra=require_lib(),import_error_utils=require_dist();function getBuildUtilsVersionForInstall(dependencies,usePinnedVersion){return usePinnedVersion?dependencies.pinnedBuildUtilsVersion??dependencies.buildUtilsVersion:dependencies.buildUtilsVersion}function shouldFallbackBuilderPins(dependencies,pinnedSpecCount){return pinnedSpecCount>0&&!dependencies.strictBuilderPins}function getBuildUtilsSpec(buildUtilsVersion){if(!buildUtilsVersion)return"@vercel/build-utils";if((0,import_semver.validRange)(buildUtilsVersion))return`@vercel/build-utils@${buildUtilsVersion}`;try{if((0,import_npm_package_arg2.default)(buildUtilsVersion).type==="remote")return`@vercel/build-utils@${buildUtilsVersion}`}catch{}return"@vercel/build-utils"}function getErrorMessage(err,execaMessage){return!err||!("stderr"in err)?execaMessage:typeof err.stderr=="string"?err.stderr:execaMessage}async function untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,buildUtilsVersion=dependencies.buildUtilsVersion){let{code:code2,cmd:cmd2,output,readJSONFile:readJSONFile2,run}=dependencies,resolvedSpecs=new Map,buildersPkgPath=(0,import_path2.join)(buildersDir,"package.json");try{let emptyPkgJson={private:!0,license:"UNLICENSED"};await(0,import_fs_extra.outputJSON)(buildersPkgPath,emptyPkgJson,{flag:"wx"})}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="EEXIST")throw error}output.log(`Installing ${(0,import_pluralize.default)("Builder",buildersToAdd.size)}: ${Array.from(buildersToAdd).join(", ")}`);let installArgs=["install",getBuildUtilsSpec(buildUtilsVersion),...buildersToAdd];try{let{stderr}=await run("npm",installArgs,{cwd:buildersDir,stdio:"pipe",reject:!0});stderr.split(`/\r?
|
|
8
8
|
/`).filter(line=>line.includes("npm WARN deprecated")).forEach(line=>{output.warn(line)})}catch(err){if((0,import_error_utils.isError)(err)){let execaMessage=err.message,message=getErrorMessage(err,execaMessage);if(execaMessage.startsWith("Command failed with ENOENT"))message=`Please install ${cmd2("npm")} before continuing`;else{let notFoundUrl=/GET (.*) - Not found/.exec(message)?.[1];if(notFoundUrl){let url=new import_url.URL(notFoundUrl),packagePath=decodeURIComponent(url.pathname),packageName=/(@[^/]+\/[^/]+)$/.exec(packagePath)?.[1]??packagePath.split("/").filter(Boolean).at(-1)??packagePath;message=`The package ${code2(packageName)} is not published on the npm registry`}}err.message=message,Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"})}throw err}let nowScopePath=(0,import_path2.join)(buildersDir,"node_modules/@now");await(0,import_fs_extra.mkdirp)(nowScopePath);try{await(0,import_fs_extra.symlink)("../@vercel/build-utils",(0,import_path2.join)(nowScopePath,"build-utils"))}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EEXIST")throw err}let buildersPkg=await readJSONFile2(buildersPkgPath);if(dependencies.isCantParseJSONFile(buildersPkg))throw buildersPkg;if(!buildersPkg)throw new Error(`Failed to load "${buildersPkgPath}"`);for(let spec of buildersToAdd)for(let[name,version2]of Object.entries(buildersPkg.dependencies||{}))version2===spec&&(output.debug(`Resolved Builder spec "${spec}" to name "${name}"`),resolvedSpecs.set(spec,name));return resolvedSpecs}function createInstallBuilders2(dependencies){let{output}=dependencies;return async function(buildersDir,buildersToAdd,span,installReasons,pinnedSpecs){let install=async()=>{try{return await untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,getBuildUtilsVersionForInstall(dependencies,!!pinnedSpecs?.size))}catch(err){let fallbackPins=pinnedSpecs;if(!fallbackPins||!shouldFallbackBuilderPins(dependencies,fallbackPins.size))throw err;let fallbackSpecs=new Set(Array.from(buildersToAdd,spec=>{for(let[originalSpec,pinnedSpec]of fallbackPins)if(pinnedSpec===spec)return originalSpec;return spec}));output.warn("Could not install the Builder versions pinned by this Vercel CLI release. Retrying with versions allowed by your npm settings.");let resolvedSpecs=await untracedInstallBuilders(buildersDir,fallbackSpecs,dependencies,dependencies.buildUtilsVersion);for(let originalSpec of fallbackPins.keys())fallbackSpecs.has(originalSpec)&&resolvedSpecs.set(originalSpec,originalSpec);return resolvedSpecs}};if(!span)return install();let attributes={packages:Array.from(buildersToAdd).join(",")};return installReasons&&installReasons.size>0&&(attributes.reasons=Array.from(installReasons).map(([spec,reason])=>`${spec}=${reason}`).join(",")),pinnedSpecs&&pinnedSpecs.size>0&&(attributes.pinned="true",attributes.pinnedPackages=Array.from(pinnedSpecs.values()).join(",")),span.child("vc.installBuilders",attributes).trace(async s=>{try{return await install()}catch(err){throw s.setAttributes({error:(0,import_error_utils.isError)(err)?err.message:String(err)}),err}})}}}});var import_import_builders=__toESM(require_import_builders(),1);var static_builder_exports={};__export(static_builder_exports,{build:()=>build,diagnostics:()=>diagnostics,shouldServe:()=>shouldServe,version:()=>version});var import_static_builder=__toESM(require_static_builder(),1);var{version,build,shouldServe,diagnostics}=(0,import_static_builder.createStaticBuilder)(VERCEL_CONFIG_EXTENSIONS);var import_install_builders=__toESM(require_install_builders(),1);var import_execa=__toESM(require_execa(),1),binaryPkg=pkg_default,installBuilders=(0,import_install_builders.createInstallBuilders)({buildUtilsVersion:pkg_default.dependencies?.["@vercel/build-utils"],pinnedBuildUtilsVersion:binaryPkg.pinnedBuildUtilsVersion,strictBuilderPins:binaryPkg.strictBuilderPins,code,cmd,isCantParseJSONFile:value=>value instanceof CantParseJSONFile,output:output_manager_default,readJSONFile,run:import_execa.default});import{createRequire}from"module";var import_npm_package_arg=__toESM(require_npa(),1);function isManagedSpec(spec,managedNames){let parsed=(0,import_npm_package_arg.default)(spec);return!!parsed.name&&managedNames.has(parsed.name)&&parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function partitionBuilderSpecs(specs,managedNames){let managed=new Map,legacy=new Set;for(let spec of specs)isManagedSpec(spec,managedNames)?managed.set(spec,(0,import_npm_package_arg.default)(spec).name):legacy.add(spec);return{managed,legacy}}import{isAbsolute,join}from"path";var require_=createRequire(__filename);var builderPins=pkg_default.builders??{},managedBuilderNames=new Set(Object.keys(builderPins)),legacyImportBuilders=(0,import_import_builders.createImportBuilders)({builderPins,buildersDir:(cwd,vercelDir=VERCEL_DIR)=>join(cwd,vercelDir,"builders"),debug:message=>output_manager_default.debug(message),installBuilders,isNativeBinaryInstall:isManagedBuildersInstall,require:require_,staticBuilder:static_builder_exports,vercelDir:VERCEL_DIR}),vltImports,vltPreload,vltPreloadState="notStarted";function loadVltImports(){if(!vltImports){let imports=Promise.all([import("./vlt-builder-importer-RBUPAB6J.js"),loadEmbeddedBuilderIndex()]);vltImports=imports,imports.catch(()=>{vltImports===imports&&(vltImports=void 0)})}return vltImports}function getVltPreloadState(){return vltPreloadState}function preloadVltBuilderImports(){return vltPreload??=(async()=>{vltPreloadState="inFlight";try{await loadVltImports(),vltPreloadState="done"}catch(error){throw vltPreloadState="failed",error}})(),vltPreload}async function importBuilders(builderSpecs,cwd,span){let managedBuilders=isManagedBuildersInstall(),buildersDir=managedBuilders?process.env.VERCEL_BUILDERS_DIR:void 0;if(buildersDir&&!isAbsolute(buildersDir))throw new Error("VERCEL_BUILDERS_DIR must be an absolute path.");if(!managedBuilders)return legacyImportBuilders(builderSpecs,cwd,span);let{managed,legacy}=partitionBuilderSpecs(builderSpecs,managedBuilderNames);if(buildersDir&&managed.size>0&&span?.setAttributes({"builders.directory.enabled":"true","builders.directory.path":(0,import_import_builders.getBuildersDir)(cwd)}),output_manager_default.debug(`Builder import routing: vlt=[${[...managed].map(([spec])=>spec).join(", ")}], legacy=[${[...legacy].join(", ")}]`),managed.size===0)return legacyImportBuilders(legacy,cwd,span);let preloadState=vltPreloadState,loadStartedAt=performance.now(),[{createVltBuilderImporter},index]=await loadVltImports();span?.setAttributes({"builders.vlt.preloadState":preloadState,"builders.vlt.preloadAwaitMs":String(Math.round(performance.now()-loadStartedAt))});let vltImportBuilders=createVltBuilderImporter({loadIndex:async()=>index,loadGraphs:()=>loadEmbeddedBuilderGraphs(),require:require_,cacheRoot:buildersDir?(0,import_import_builders.getBuildersDir)(cwd):void 0,debug:message=>output_manager_default.debug(message)}),[vltBuilders,legacyBuilders]=await Promise.all([vltImportBuilders(managed,span),legacy.size?legacyImportBuilders(legacy,cwd,span):Promise.resolve(new Map)]);return new Map([...vltBuilders,...legacyBuilders])}export{require_npa,import_import_builders,getVltPreloadState,preloadVltBuilderImports,importBuilders};
|
|
@@ -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{events_default}from"./chunk-
|
|
7
|
+
import{events_default}from"./chunk-AQUDXMFH.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function displayBuildLogs(client,deployment,follow=!0,onAliasAssigned){let abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>printBuildLog(event,output_manager_default.print),onAliasAssigned,quiet:!1,findOpts:{direction:"forward",follow}},abortController),abortController}}function collectBuildLogs(client,deployment,follow=!0){let logs=[],abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>{event.created&&logs.push(event)},quiet:!0,findOpts:{direction:"forward",follow}},abortController).then(()=>logs),abortController}}async function displayBuildLogsUntilFinalError(client,deployment,error){let abortController=new AbortController;return events_default(client,deployment.id,{mode:"logs",onEvent:event=>{printBuildLog(event,output_manager_default.print),event.level==="error"&&event.text?.includes(error)&&abortController.abort()},quiet:!1,findOpts:{direction:"forward",follow:!0}},abortController)}function printBuildLog(log,print){if(!log.created)return;let date=new Date(log.created).toISOString(),cleanText=parseLogLines(log).join(`
|
|
8
8
|
`);for(let line of colorize(cleanText,log).split(`
|
|
9
9
|
`))print(`${import_chalk.default.dim(date)} ${line}
|
|
10
10
|
`)}function sanitize(log){return(0,import_strip_ansi.default)(log.text||"").replace(/\n$/,"").replace(/^\n/,"")}function parseLogLines(log){return sanitize(log).split(`
|
|
@@ -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_dist as require_dist2}from"./chunk-JALVF3C2.js";import{confirmOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{require_dist as require_dist2}from"./chunk-JALVF3C2.js";import{confirmOption,projectOption,yesOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_listen=__toESM(require_dist2(),1),import_error_utils=__toESM(require_dist(),1),DEV_QUEUE_API_PREFIX="/api/v3/topic/",DEV_QUEUE_PROXY_PREFIX="/_svc/_queues",DEV_QUEUE_DEFAULT_PORT=4782,DEV_RUNTIME_CACHE_DEFAULT_PORT=4783,DEV_SCHEDULES_DEFAULT_PORT=4784,DEV_SCHEDULES_PROXY_PREFIX="/_svc/_schedules",DEV_RESOURCE_TOKEN="vc-dev-token";function isValidDevResourceHost(origin,host){let port=new URL(origin).port,suffix=port?`:${port}`:"",normalizedHost=host?.toLowerCase();return normalizedHost===`127.0.0.1${suffix}`||normalizedHost===`localhost${suffix}`}async function listenOnDevResourcePort(server,options){let isPinned=options.port!==void 0,reservedPorts=new Set(options.reservedPorts),port=options.port??options.defaultPort;for(;;){if(!isPinned&&reservedPorts.has(port)){if(port>=65535)throw new Error(`${options.name} could not find an available port at or above 127.0.0.1:${options.defaultPort}. Choose another port with ${options.flag}.`);port++;continue}try{let address=await(0,import_async_listen.listen)(server,port,"127.0.0.1"),url=new URL(address.toString()),serverAddress=server.address(),actualPort=serverAddress&&typeof serverAddress!="string"?serverAddress.port:Number(url.port);return{origin:url.origin,port:actualPort,...port!==options.defaultPort&&!isPinned?{defaultPort:options.defaultPort}:{}}}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EADDRINUSE")throw err;if(isPinned||port>=65535)throw new Error(`${options.name} could not listen on 127.0.0.1:${port} because the port is already in use. Choose another port with ${options.flag}.`);port++}}}function getDevQueueEnv(baseUrl,hasWorkerServices=!0){return{...hasWorkerServices?{VERCEL_HAS_WORKER_SERVICES:"1"}:{},VERCEL_QUEUE_BASE_URL:baseUrl,VERCEL_QUEUE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_REGION:"dev1"}}function getDevSchedulesEnv(baseUrl,container=!1){if(!baseUrl)return{};let endpoint=new URL(baseUrl);return container&&["localhost","127.0.0.1","[::1]"].includes(endpoint.hostname)&&(endpoint.hostname="host.docker.internal"),{VERCEL_SCHEDULE_BASE_URL:endpoint.toString().replace(/\/$/,""),VERCEL_SCHEDULE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_SCHEDULE_DEV_API_VERSION:"1"}}var devCommand={name:"dev",aliases:["develop"],description:`Starts the \`${packageName} dev\` server.`,arguments:[{name:"dir",required:!1}],options:[{name:"listen",description:"Specify a URI endpoint on which to listen [0.0.0.0:3000]",argument:"URI",shorthand:"l",type:String,deprecated:!1},{name:"local",shorthand:"L",type:Boolean,deprecated:!1,description:"Start the dev server without linking to a Vercel project"},{name:"queue-port",description:`Specify the local Vercel Queues server port [${DEV_QUEUE_DEFAULT_PORT}]`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"runtime-cache-port",description:`Specify the local Runtime Cache server port [${DEV_RUNTIME_CACHE_DEFAULT_PORT}]`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"schedules-port",description:`Specify the local Vercel Schedules server port [${DEV_SCHEDULES_DEFAULT_PORT}]`,argument:"PORT",shorthand:null,type:String,deprecated:!1},yesOption,{name:"port",shorthand:"p",type:String,deprecated:!0},confirmOption,projectOption],examples:[{name:`Start the \`${packageName} dev\` server on port 8080`,value:`${packageName} dev --listen 8080`},{name:"Make the `vercel dev` server bind to localhost on port 5000",value:`${packageName} dev --listen 127.0.0.1:5000 `},{name:"Pin local resource server ports",value:`${packageName} dev --queue-port 5782 --runtime-cache-port 5783 --schedules-port 5784`}]};export{DEV_QUEUE_API_PREFIX,DEV_QUEUE_PROXY_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_RUNTIME_CACHE_DEFAULT_PORT,DEV_SCHEDULES_DEFAULT_PORT,DEV_SCHEDULES_PROXY_PREFIX,DEV_RESOURCE_TOKEN,isValidDevResourceHost,listenOnDevResourcePort,getDevQueueEnv,getDevSchedulesEnv,devCommand};
|