vercel 63.0.1 → 63.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-QKGWNVQS.js → add-CCFBYKZH.js} +1 -1
- package/dist/chunks/{add-BODUK747.js → add-FNCCXJZO.js} +1 -1
- package/dist/chunks/{add-ZLY3DE35.js → add-LU5TSLJU.js} +1 -1
- package/dist/chunks/{build-SD6SLRK7.js → build-PUIFBQKZ.js} +1 -1
- package/dist/chunks/{chunk-MEJTHWZB.js → chunk-36EFWYTN.js} +1 -1
- package/dist/chunks/{chunk-JUSQYKFF.js → chunk-3TJDVDDJ.js} +1 -1
- package/dist/chunks/{chunk-QW2UP4W4.js → chunk-3YQVBYQD.js} +1 -1
- package/dist/chunks/{chunk-7D2HVBVP.js → chunk-5O2CW3SX.js} +1 -1
- package/dist/chunks/chunk-5YQP44VL.js +10 -0
- package/dist/chunks/{chunk-KNBEUC4P.js → chunk-6BE4D57F.js} +1 -1
- package/dist/chunks/{chunk-HJ3NY4UA.js → chunk-6LXX5P3A.js} +1 -1
- package/dist/chunks/{chunk-64U5W6GU.js → chunk-6OUBLFZ2.js} +1 -1
- package/dist/chunks/{chunk-YLTCVZOL.js → chunk-6TEFVB2U.js} +1 -1
- package/dist/chunks/{chunk-3AF3TTCR.js → chunk-7SGM233C.js} +1 -1
- package/dist/chunks/{chunk-PSBBSY46.js → chunk-A6RRKSD3.js} +1 -1
- package/dist/chunks/{chunk-ESMQCFCX.js → chunk-AHSMFZWH.js} +1 -1
- package/dist/chunks/{chunk-TKA7PPGY.js → chunk-BIFAR2CO.js} +1 -1
- package/dist/chunks/{chunk-X3JK3SQ2.js → chunk-D7KEDMBF.js} +1 -1
- package/dist/chunks/{chunk-6LRVRPYO.js → chunk-E6UKNYFF.js} +1 -1
- package/dist/chunks/{chunk-NZBUIMZG.js → chunk-EDVP7QUI.js} +1 -1
- package/dist/chunks/{chunk-WF5YVWWY.js → chunk-FU7KGU6V.js} +1 -1
- package/dist/chunks/{chunk-IYL5CKZ4.js → chunk-GAG42XNF.js} +1 -1
- package/dist/chunks/{chunk-DZ6GORJ7.js → chunk-HWYHRPWP.js} +1 -1
- package/dist/chunks/{chunk-UTW2FDSC.js → chunk-I3D36ZLJ.js} +1 -1
- package/dist/chunks/{chunk-KTNRWBHM.js → chunk-I7FGFRN3.js} +1 -1
- package/dist/chunks/{chunk-MA4K5IWW.js → chunk-IFNTXDX2.js} +1 -1
- package/dist/chunks/{chunk-JTAAWOJS.js → chunk-IMC63GXI.js} +1 -1
- package/dist/chunks/{chunk-VIBUYIZ3.js → chunk-J2LAZELI.js} +1 -1
- package/dist/chunks/{chunk-SY4EANZH.js → chunk-JORUFFOD.js} +3 -3
- package/dist/chunks/{chunk-4A5SGLIH.js → chunk-JYFYL3ON.js} +1 -1
- package/dist/chunks/{chunk-IAUAFUO2.js → chunk-K5GYV5CW.js} +1 -1
- package/dist/chunks/{chunk-B3PZ3I4Z.js → chunk-KCQERNQX.js} +1 -1
- package/dist/chunks/{chunk-QZRZ6ECD.js → chunk-KG3OGJ3U.js} +1 -1
- package/dist/chunks/{chunk-2H243SJV.js → chunk-MSH7V3FL.js} +1 -1
- package/dist/chunks/{chunk-VNSQCAVT.js → chunk-MT4MO7DT.js} +1 -1
- package/dist/chunks/{chunk-XJOOPPSQ.js → chunk-NUITF4GR.js} +1 -1
- package/dist/chunks/chunk-OB5XGIDM.js +9 -0
- package/dist/chunks/{chunk-25S4PQNK.js → chunk-OPVNMCAF.js} +1 -1
- package/dist/chunks/{chunk-AZ76R3LW.js → chunk-PLG4UIV4.js} +1 -1
- package/dist/chunks/{chunk-CRO7VQWK.js → chunk-PR7SYJVT.js} +1 -1
- package/dist/chunks/{chunk-2WYDLP7X.js → chunk-R6OWQQMZ.js} +1 -1
- package/dist/chunks/{chunk-SSEVYTJ7.js → chunk-RIPCUZO6.js} +1 -1
- package/dist/chunks/{chunk-VJEQAITW.js → chunk-RV77ZW7T.js} +1 -1
- package/dist/chunks/{chunk-V2BKSCXI.js → chunk-SKTP7MSL.js} +1 -1
- package/dist/chunks/{chunk-MYMM34ZH.js → chunk-SWJYZETA.js} +4 -4
- package/dist/chunks/{chunk-BZYQ6RFV.js → chunk-SYEKOJHT.js} +1 -1
- package/dist/chunks/{chunk-VOB4W7DO.js → chunk-SZRSBECO.js} +1 -1
- package/dist/chunks/{chunk-2LGNEOKV.js → chunk-T3PAZMDW.js} +1 -1
- package/dist/chunks/{chunk-V336CYEI.js → chunk-T6GXMIXO.js} +1 -1
- package/dist/chunks/{chunk-HUJPGK7W.js → chunk-TNZMCRAP.js} +1 -1
- package/dist/chunks/chunk-TUJ3WXOZ.js +7 -0
- package/dist/chunks/{chunk-BRUTDRAQ.js → chunk-VLSSMFTF.js} +1 -1
- package/dist/chunks/{chunk-VSE5BAPP.js → chunk-WPQN5UKR.js} +1 -1
- package/dist/chunks/{chunk-3DMY3OJR.js → chunk-X5GP2FBT.js} +1 -1
- package/dist/chunks/{chunk-AUZEOUZU.js → chunk-XKDY4OFQ.js} +1 -1
- package/dist/chunks/{chunk-H7LHZZKU.js → chunk-Y35RMGOU.js} +1 -1
- package/dist/chunks/{chunk-AZULOP7M.js → chunk-YIIPBH2D.js} +2 -2
- package/dist/chunks/{chunk-T6SFC3IH.js → chunk-Z6HYEIYV.js} +1 -1
- package/dist/chunks/{chunk-BWY67LI6.js → chunk-ZH4DW3T3.js} +1 -1
- package/dist/chunks/{chunk-T76ITV65.js → chunk-ZQBMRI57.js} +2 -2
- package/dist/chunks/{clear-PYDGQBSS.js → clear-E6TSPA67.js} +1 -1
- package/dist/chunks/{compile-vercel-config-KWSIFONF.js → compile-vercel-config-2HBWORW5.js} +1 -1
- package/dist/chunks/{config-Y3JEZPVK.js → config-MTH57FUD.js} +1 -1
- package/dist/chunks/{config-6TQFY5DN.js → config-NWNQSZNZ.js} +1 -1
- package/dist/chunks/{connect-git-provider-HW23GK35.js → connect-git-provider-VJYXBRYG.js} +1 -1
- package/dist/chunks/{delete-ZISJ7HIW.js → delete-MZ4LAS3L.js} +1 -1
- package/dist/chunks/{delete-HAOLSE35.js → delete-NIPKCWUT.js} +1 -1
- package/dist/chunks/{detect-services-22KZAGH2.js → detect-services-5CVG24CL.js} +1 -1
- package/dist/chunks/{disable-ZCEEK2BD.js → disable-YZATFLNR.js} +1 -1
- package/dist/chunks/{discard-VHO5BXYN.js → discard-B5IFVCDR.js} +1 -1
- package/dist/chunks/{edit-ZPNWEZWU.js → edit-3PKYF5FY.js} +1 -1
- package/dist/chunks/{edit-JRYFZ5N5.js → edit-EDTBD7PX.js} +1 -1
- package/dist/chunks/{enable-USQVAN4K.js → enable-AKGADEKU.js} +1 -1
- package/dist/chunks/{export-H7YV6NVF.js → export-NKCN63SF.js} +1 -1
- package/dist/chunks/{future-PHRPWAVY.js → future-AQR2QP74.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-WLYVWTBG.js → generate-cert-for-deploy-UNRGDROB.js} +1 -1
- package/dist/chunks/{image-6KIQRC65.js → image-IQJVHHAW.js} +1 -1
- package/dist/chunks/{import-builders-YAC6UE33.js → import-builders-4K4WE66I.js} +1 -1
- package/dist/chunks/{inspect-MRJ6JO7M.js → inspect-2UUTLI4H.js} +1 -1
- package/dist/chunks/{inspect-BQELJ5EI.js → inspect-4DASZGPR.js} +1 -1
- package/dist/chunks/{inspect-HJQWRFHR.js → inspect-FVB5P54P.js} +1 -1
- package/dist/chunks/{inspect-SEGNEPGI.js → inspect-GKZFZINR.js} +1 -1
- package/dist/chunks/{inspect-DWOQ6566.js → inspect-IU2VMHWZ.js} +1 -1
- package/dist/chunks/{list-S2XKQMNX.js → list-5LMFTD7U.js} +1 -1
- package/dist/chunks/{list-HS54LLJ5.js → list-OYT6T3TA.js} +1 -1
- package/dist/chunks/{list-OCU47YHP.js → list-TL7VBVR5.js} +1 -1
- package/dist/chunks/{login-SKAMFH7S.js → login-PFAKA6JO.js} +1 -1
- package/dist/chunks/{login-K6VYVJPS.js → login-UWL7N6ZS.js} +1 -1
- package/dist/chunks/{logs-KZSKOQUN.js → logs-4FOJKWAW.js} +1 -1
- package/dist/chunks/{ls-ZYM3DQXI.js → ls-6TRT3UFZ.js} +1 -1
- package/dist/chunks/{ls-LBBI45ZT.js → ls-B3D7XA2S.js} +1 -1
- package/dist/chunks/{ls-G5NTVYUB.js → ls-H7YO6MS5.js} +1 -1
- package/dist/chunks/{ls-NUM6IQL6.js → ls-SJDE4U7I.js} +1 -1
- package/dist/chunks/{ls-TE7BAMHR.js → ls-SXE2THDP.js} +1 -1
- package/dist/chunks/{ls-DTEGGHQA.js → ls-VFV23YCF.js} +1 -1
- package/dist/chunks/{ls-LCY7BHOP.js → ls-VNOGQ64O.js} +1 -1
- package/dist/chunks/{mutate-BAFVNNRU.js → mutate-IGC37SCR.js} +1 -1
- package/dist/chunks/{notifications-3EB3ZEU3.js → notifications-47EDEA5C.js} +1 -1
- package/dist/chunks/{open-J4X5KJ6A.js → open-NP444BUR.js} +1 -1
- package/dist/chunks/{openapi-C5BHMHWS.js → openapi-LW24FRTC.js} +1 -1
- package/dist/chunks/{permissions-JMFKPIO4.js → permissions-CP57O3II.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-VS3ZJSCQ.js → prompt-missing-credentials-C3OIQONK.js} +1 -1
- package/dist/chunks/{publish-WWI5HOAL.js → publish-5TK3IVYM.js} +1 -1
- package/dist/chunks/{pull-MTQAMT4L.js → pull-FCQKXYBD.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-ZIIAF7CC.js → purchase-domain-if-available-QBDRKJZ5.js} +1 -1
- package/dist/chunks/{push-PBKUSKXQ.js → push-SIR5XTJN.js} +1 -1
- package/dist/chunks/{query-5VGUVE2A.js → query-IEBWCCMJ.js} +1 -1
- package/dist/chunks/{reauthenticate-UGBXSWZE.js → reauthenticate-XSNRCXPC.js} +1 -1
- package/dist/chunks/{reorder-S2ZJML5K.js → reorder-TPLZXSRB.js} +1 -1
- package/dist/chunks/{reply-3GFULOMZ.js → reply-BCDQQ6I2.js} +1 -1
- package/dist/chunks/{resolve-USEBSFUT.js → resolve-VKJAE7KO.js} +1 -1
- package/dist/chunks/{restore-JD7IGDTY.js → restore-TZAXCNLL.js} +1 -1
- package/dist/chunks/{rm-ARMNSPGQ.js → rm-53HZ5XOQ.js} +1 -1
- package/dist/chunks/{rm-RHRKS7XG.js → rm-A2NTZ4EJ.js} +1 -1
- package/dist/chunks/{rm-BYOBKSWY.js → rm-DPVWWH4Q.js} +1 -1
- package/dist/chunks/{rm-EQYVIFNX.js → rm-TTZBAVUG.js} +1 -1
- package/dist/chunks/{rm-3V47KPK6.js → rm-V4M46PRZ.js} +1 -1
- package/dist/chunks/{routes-NID5V7EJ.js → routes-PKCKZ5T6.js} +1 -1
- package/dist/chunks/{rule-inspect-5DZ7OXGE.js → rule-inspect-5QXLEJZA.js} +1 -1
- package/dist/chunks/{rules-CM2ARIWZ.js → rules-2SBYOL6R.js} +1 -1
- package/dist/chunks/{schema-V75RRXXF.js → schema-OGGOD3HX.js} +1 -1
- package/dist/chunks/{schema-SZUKDSY2.js → schema-PGGJZ2AT.js} +1 -1
- package/dist/chunks/{select-org-SH4JT6RI.js → select-org-VBP5DCYP.js} +1 -1
- package/dist/chunks/{set-LY4YI5FZ.js → set-6BCSH3I3.js} +1 -1
- package/dist/chunks/{setup-and-link-MWLALWAS.js → setup-and-link-FPGTZUH6.js} +1 -1
- package/dist/chunks/{tags-P5GB7HTF.js → tags-77REB4BF.js} +1 -1
- package/dist/chunks/{types-OC7OTQNK.js → types-4C5N66YA.js} +1 -1
- package/dist/chunks/{update-SOD622HT.js → update-7BNVIJWB.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +5 -5
- 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 +48 -36
- package/dist/index.js +2 -2
- package/dist/internal-build.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +14 -14
- package/dist/chunks/chunk-5RR3435W.js +0 -10
- package/dist/chunks/chunk-U5C6XOLA.js +0 -9
- package/dist/chunks/chunk-W6LNIG5O.js +0 -7
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{printProjectNotFoundError}from"./chunk-
|
|
7
|
+
import{printProjectNotFoundError}from"./chunk-3YQVBYQD.js";import{omitGlobalFlagsFromArgs}from"./chunk-5YQP44VL.js";import{detectExplicitScope}from"./chunk-HWYHRPWP.js";import{getLinkedProject}from"./chunk-SWJYZETA.js";function getInvokingCommandFromArgv(argv){let args=omitGlobalFlagsFromArgs(argv.slice(2)),positionals=[];for(let arg of args){if(arg.startsWith("-"))break;positionals.push(arg)}return positionals.join(" ")}async function resolveProjectContext({client,cwd=client.cwd,projectNameOrId,commandName="",projectNotFoundHandling="report",skipOwnerLookup}){let context=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client),skipOwnerLookup});return context.status==="not_linked"&&projectNameOrId&&projectNotFoundHandling==="report"?(await printProjectNotFoundError(client,projectNameOrId,commandName||getInvokingCommandFromArgv(client.argv),context.orgId),{status:"error",exitCode:1,orgId:context.orgId}):context}export{resolveProjectContext};
|
|
@@ -4,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{outputError}from"./chunk-WH3SHWVK.js";import{require_execa}from"./chunk-GSOPJJO5.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-WH3SHWVK.js";import{require_execa}from"./chunk-GSOPJJO5.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-5YQP44VL.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import{getScope}from"./chunk-HWYHRPWP.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-SWJYZETA.js";import{require_lib}from"./chunk-ROPQIBWJ.js";import{ProjectNotFound,isAPIError,require_bytes}from"./chunk-YIIPBH2D.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{__toESM}from"./chunk-BZENIQ7N.js";function emitVcrScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveVcrScope(client,opts){if(opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitVcrScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project with vcr.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitVcrScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitVcrScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]})}return{teamId:team.id,teamSlug:team.slug,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or pass --project <name>.";return emitVcrScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"List repositories for a project without linking (replace <name_or_id>)"}]})}return{teamId:linkedProject.org.id,teamSlug:linkedProject.org.slug,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}var import_ms=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1);function formatBytes(size){return typeof size!="number"||Number.isNaN(size)?"-":import_bytes.default.format(size,{decimalPlaces:1})??"-"}function formatRelativeTime(iso){let time=new Date(iso).getTime();return Number.isNaN(time)?"-":`${(0,import_ms.default)(Date.now()-time)} ago`}function formatDigest(digest){return digest?digest.replace(/^sha256:/,"").slice(0,12):"-"}function formatImageStatus(status){switch(status){case"ready":return"Ready";case"preparing":return"Preparing";case"unoptimized":return"Ready (unoptimized)";default:return"-"}}var VCR_REGISTRY="vcr.vercel.com";function formatImageReference(teamSlug,projectName,repositoryName,digest){return digest?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}@${digest}`:"-"}function formatTagReference(teamSlug,projectName,repositoryName,tag){return tag?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}:${tag}`:"-"}function validateVcrJsonOutput(client,flags){let fr=validateJsonOutput(flags);return fr.valid?{jsonOutput:fr.jsonOutput}:(outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2)}function validateVcrChoice(client,flag,value,choices,jsonOutput){if(value===void 0||choices.includes(value))return;let message=`Invalid value for ${flag}: "${value}". Must be one of: ${choices.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message},2),outputError(client,jsonOutput,"INVALID_ARGUMENTS",message)}function requireVcrRepository(client,repository,jsonOutput,usage){if(!repository)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to pick a name or id"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndTag(client,repository,tag,jsonOutput,usage){if(!(repository&&tag))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr tag ls <repository>"),when:"List tags to pick a tag (replace <repository>)"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndImageId(client,repository,imageId,jsonOutput,usage){if(!(repository&&imageId))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image ls <repository>"),when:"List images to pick an image id (replace <repository>)"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}var import_which=__toESM(require_lib(),1),import_execa=__toESM(require_execa(),1);var VCR_ENGINES=["docker","podman","buildah"],VCR_LOGIN_USERNAME="oidc";function resolveRegistry(){return process.env.VERCEL_VCR_REGISTRY||VCR_REGISTRY}function isEngineInstalled(engine){return import_which.default.sync(engine,{nothrow:!0})!==null}function splitPassthrough(argv){let idx=argv.indexOf("--");return idx===-1?{own:argv.slice(2),passthrough:[]}:{own:argv.slice(2,idx),passthrough:argv.slice(idx+1)}}async function isBuildxAvailable(){let result=await(0,import_execa.default)("docker",["buildx","version"],{reject:!1,stdio:"ignore"});return result instanceof Error?!1:result.exitCode===0}function pushCompressionArgs(engine){return engine==="docker"?[]:["--compression-format","zstd","--compression-level","3"]}var AUTH_FAILURE=/\b(?:unauthorized|denied|forbidden)\b\s*:|authentication required|access to the resource is denied|\b(?:401 unauthorized|403 forbidden)\b/i,CREDENTIAL_STORE_CONFLICT=/already exists in the keychain|errSecDuplicateItem/i;function stderrTail(stderr){return stderr.trim().split(`
|
|
8
8
|
`).slice(-5).join(`
|
|
9
9
|
`)}async function engineLogin(engine,registry,token){let result=await(0,import_execa.default)(engine,["login",registry,"--username",VCR_LOGIN_USERNAME,"--password-stdin"],{input:token,reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:result.stderr??""}}async function engineLogout(engine,registry){await(0,import_execa.default)(engine,["logout",registry],{reject:!1,stdio:"ignore"})}async function runEngine(engine,args,opts){if(opts.captureStderr){let subprocess=(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:["inherit","inherit","pipe"],reject:!1});subprocess.stderr?.pipe(process.stderr);let result2=await subprocess;return result2 instanceof Error&&typeof result2.exitCode!="number"?{exitCode:1,stderr:result2.message}:{exitCode:typeof result2.exitCode=="number"?result2.exitCode:1,stderr:result2.stderr??""}}let result=await(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:"inherit",reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:""}}var NOT_AUTHORIZED_MESSAGE="You do not have access to the container registry in this scope. Ensure your role can manage the project, or pass --token and --scope.",NOT_AUTHORIZED_HINT="Confirm team scope with whoami; use --scope <team-slug> if the repository lives under another team.",genericMessage=err=>err.serverMessage||`API error (${err.status}).`,STATUS_INFO={401:{reason:"not_authorized",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},403:{reason:"forbidden",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},404:{reason:AGENT_REASON.NOT_FOUND,message:genericMessage},409:{reason:"conflict",message:genericMessage},429:{reason:"rate_limited",message:genericMessage}};function resolveStatusInfo(err){return STATUS_INFO[err.status]?STATUS_INFO[err.status]:err.status>=500?{reason:AGENT_REASON.API_ERROR,message:()=>`The container registry endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`}:{reason:AGENT_REASON.API_ERROR,message:genericMessage}}function handleVcrApiError(client,err,jsonOutput,opts={}){let info=resolveStatusInfo(err),message=info.message(err),next=[];return info.suggestWhoami&&next.push({command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"}),opts.retry&&next.push(opts.retry),outputAgentError(client,{status:"error",reason:info.reason,message,...info.hint?{hint:info.hint}:{},...next.length>0?{next}:{}},1),outputError(client,jsonOutput,err.code||"API_ERROR",message)}function reportEngineCommandFailure(client,engine,verb,result){let tail=stderrTail(result.stderr),message=`\`${engine} ${verb}\` failed (exit code ${result.exitCode}).${tail?`
|
|
10
10
|
${tail}`:""}`;return outputAgentError(client,{status:"error",reason:"command_failed",message},1),outputError(client,!1,"COMMAND_FAILED",message)}function reportEnginePushFailure(client,engine,verb,result){if(AUTH_FAILURE.test(result.stderr)){let message=`Push to ${resolveRegistry()} was rejected. Your registry credentials may be missing or expired.`;return outputAgentError(client,{status:"error",reason:"not_authorized",message,next:[{command:buildCommandWithGlobalFlags(client.argv,`vcr login ${engine}`),when:"Refresh registry credentials (valid ~12 hours)"}]},1),outputError(client,!1,"NOT_AUTHORIZED",message)}return reportEngineCommandFailure(client,engine,verb,result)}function emitVcrArgParseError(client,err,recoverTemplate){let msg=err instanceof Error?err.message:String(err),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:[{command:buildCommandWithGlobalFlags(client.argv,recoverTemplate),when:projectFlagMissingArg?"Re-run with a project name or id (replace placeholder)":"See valid usage"}]},2)}export{resolveVcrScope,formatBytes,formatRelativeTime,formatDigest,formatImageStatus,formatImageReference,formatTagReference,validateVcrJsonOutput,validateVcrChoice,requireVcrRepository,requireVcrRepositoryAndTag,requireVcrRepositoryAndImageId,VCR_ENGINES,VCR_LOGIN_USERNAME,resolveRegistry,isEngineInstalled,splitPassthrough,isBuildxAvailable,pushCompressionArgs,AUTH_FAILURE,CREDENTIAL_STORE_CONFLICT,stderrTail,engineLogin,engineLogout,runEngine,handleVcrApiError,reportEngineCommandFailure,reportEnginePushFailure,emitVcrArgParseError};
|
|
@@ -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{outputError,writeJsonError}from"./chunk-WH3SHWVK.js";import{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{outputError,writeJsonError}from"./chunk-WH3SHWVK.js";import{resolveProjectContext}from"./chunk-K5GYV5CW.js";import{printError}from"./chunk-T6GXMIXO.js";import{detectExplicitScope,getScope}from"./chunk-HWYHRPWP.js";import{getLinkedProject}from"./chunk-SWJYZETA.js";import{isAPIError}from"./chunk-YIIPBH2D.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-75IAMKGV.js";function handleCommentsParseError(err,subcommandName){return printError(err),err instanceof Error&&/unknown or unexpected option: -[^-]/.test(err.message)&&output_manager_default.log(`An argument starting with "-"? Put it after \`--\`: ${getCommandName(`comments ${subcommandName} -- <arg>`)}`),output_manager_default.log(`Run ${getCommandName(`comments ${subcommandName} --help`)} for usage.`),2}function threadNotFoundMessage(threadId,scope){return`Comment not found: ${threadId} in team ${scope.teamSlug??scope.teamId}. If it belongs to another team, pass --scope <team>.`}function query(teamId,params={}){let search=new URLSearchParams({teamId});for(let[key,value]of Object.entries(params))if(value!==void 0)if(Array.isArray(value))for(let entry of value)search.append(key,entry);else search.set(key,String(value));return search.toString()}var fetchOpts={useCurrentTeam:!1};function listThreads(client,teamId,params){return client.fetch(`/toolbar/threads?${query(teamId,{...params})}`,fetchOpts)}function getThread(client,teamId,threadId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,fetchOpts)}function updateThread(client,teamId,threadId,resolved){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body:{resolved}})}function listMessages(client,teamId,threadId,opts={}){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId,{...opts})}`,fetchOpts)}function addMessage(client,teamId,threadId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId)}`,{...fetchOpts,method:"POST",body})}function updateMessage(client,teamId,threadId,messageId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body})}function deleteMessage(client,teamId,threadId,messageId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"DELETE"})}function toApiErrorParts(err){let apiErr=err;return{code:apiErr.code||"API_ERROR",message:apiErr.serverMessage||`API error (${apiErr.status??"unknown"}).`}}import{spawnSync}from"node:child_process";async function resolveCommentsScope(client,opts){if(opts.urlTeamSlug&&!opts.project&&!detectExplicitScope(client))return{teamId:opts.urlTeamSlug,teamSlug:opts.urlTeamSlug};if(opts.project){let context;try{context=await resolveProjectContext({client,projectNameOrId:opts.project,projectNotFoundHandling:opts.jsonOutput?"return":"report"})}catch(err){if(isAPIError(err))return outputError(client,opts.jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`);throw err}return context.status==="error"?(opts.jsonOutput&&writeJsonError(client,"PROJECT_CONTEXT_ERROR","Could not resolve the project context."),context.exitCode):context.status==="not_linked"?outputError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",`Project "${opts.project}" was not found in the current scope.`):{teamId:context.org.id,teamSlug:context.org.slug,projectId:context.project.id,projectName:context.project.name,linked:!!context.repoRoot}}let linked=await getLinkedProject(client);if(linked.status==="error")return linked.exitCode;if(linked.status==="linked"){if(detectExplicitScope(client)){let{team:team2}=await getScope(client);if(!team2)return outputError(client,opts.jsonOutput,"NO_TEAM","No team context found for --scope.");if(team2.id!==linked.org.id)return opts.requireProject?outputError(client,opts.jsonOutput,"SCOPE_PROJECT_MISMATCH",`--scope ${team2.slug} does not match the linked project's team (${linked.org.slug}). Pass --project <name-or-id> for a project in ${team2.slug}.`):{teamId:team2.id,teamSlug:team2.slug}}return{teamId:linked.org.id,teamSlug:linked.org.slug,projectId:linked.project.id,projectName:linked.project.name,linked:!0}}if(opts.requireProject)return outputError(client,opts.jsonOutput,"NOT_LINKED","No linked project found. Run `vercel link` to link a project, or pass --project <name-or-id>.");let{team}=await getScope(client);return team?{teamId:team.id,teamSlug:team.slug}:outputError(client,opts.jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, or run `vercel link` in a project directory.")}function inferBranch(cwd){let result=spawnSync("git",["rev-parse","--abbrev-ref","HEAD"],{cwd,encoding:"utf8"});if(result.status===0){let branch=result.stdout.trim();if(branch&&branch!=="HEAD")return{value:branch,source:"git"}}let ciRef=process.env.VERCEL_GIT_COMMIT_REF||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME;if(ciRef)return{value:ciRef,source:"ci"}}export{handleCommentsParseError,threadNotFoundMessage,listThreads,getThread,updateThread,listMessages,addMessage,updateMessage,deleteMessage,toApiErrorParts,resolveCommentsScope,inferBranch};
|
|
@@ -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{teamCache}from"./chunk-VOZEB6PD.js";import{APIError,InvalidToken}from"./chunk-
|
|
7
|
+
import{teamCache}from"./chunk-VOZEB6PD.js";import{APIError,InvalidToken}from"./chunk-YIIPBH2D.js";import{URLSearchParams}from"url";async function getTeams(client,opts={}){let{apiVersion=1}=opts;if(apiVersion===1){if(client.teams)return client.teams;if(client.teamsPromise)return client.teamsPromise;client.teamsPromise=fetchTeams(client,opts).then(result=>{let teams=Array.isArray(result)?result:result.teams;return client.teams=teams,teams});try{return await client.teamsPromise}finally{client.teamsPromise=void 0}}return fetchTeams(client,opts)}async function fetchTeams(client,opts={}){let{apiVersion=1}=opts,query="";if(opts.apiVersion===2){let params=new URLSearchParams({limit:String(typeof opts.limit=="number"?opts.limit:20)});opts.next&¶ms.set("next",String(opts.next)),query=`?${params}`}try{let body=await client.fetch(`/v${apiVersion}/teams${query}`,{useCurrentTeam:!1});if(apiVersion===1){let teams=body.teams||[];for(let team of teams)teamCache.set(team.id,team);return teams}return body}catch(error){throw error instanceof APIError&&error.status===403?new InvalidToken(client.authConfig.tokenSource):error}}export{getTeams};
|
|
@@ -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{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-
|
|
7
|
+
import{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-5YQP44VL.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{isAPIError}from"./chunk-YIIPBH2D.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getRollupColumnName(metric,aggregation){return`${metric}_${aggregation}`.replace(/[./]/g,"_")}function getResolvedOrderMetadata(query,response){let orderBy=query.orderBy??(response.orderBy?"count":void 0),orderDirection=response.orderDirection??query.orderDirection;return{...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}function formatQueryJson(query,response){let orderMetadata=getResolvedOrderMetadata(query,response),queryWithResponseMetadata={...query,...orderMetadata};return JSON.stringify({query:queryWithResponseMetadata,summary:response.summary??[],data:response.data??[],...orderMetadata},null,2)}function formatErrorJson(code,message,allowedValues,recovery={}){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error:{...error,...recovery}},null,2)}function projectSelectorFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg.startsWith("--project="))return arg.slice(10);if(arg==="--project"&&i+1<args.length)return args[i+1]}}function hintRestatesCommand(hint,steps){if(!steps?.length)return!1;let plain=(0,import_strip_ansi.default)(hint).replace(/`/g,"").trim();return steps.some(step=>{let command=step.command.trim();return command===plain||command.startsWith(`${plain} `)})}function handleApiError(err,jsonOutput,client,overrides={},target={}){let code,message,override=overrides[err.status];if(override)code=override.code||err.code||"BAD_REQUEST",message=override.message;else switch(err.status){case 402:code=err.code||"PAYMENT_REQUIRED",message=err.serverMessage||"This feature requires an Observability Plus subscription.";break;case 429:code=err.code||"RATE_LIMITED",message=err.serverMessage||"You have reached the metrics query rate limit. Please wait and try again. If you need a higher limit, request one from your Vercel account team.";break;case 403:code="FORBIDDEN",message=err.serverMessage&&err.serverMessage!=="Response Error"?err.serverMessage:"You do not have permission to query metrics for this project/team.";break;case 500:code="INTERNAL_ERROR",message="An internal error occurred. Please try again later.";break;case 504:code="TIMEOUT",message="The query timed out. Try a shorter time range or fewer groups.";break;case 400:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`;break;default:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`}let billing=err.status===402?clientObservabilityPlanRecovery(client,err,message,target.projectName??projectSelectorFromArgv(client.argv),target.scope):void 0,recovery={...getErrorRecovery({...err,serverMessage:message},client),...billing&&{hint:billing.hint}},next=billing?.command?[{command:buildCommandWithGlobalFlags(client.argv.filter(arg=>!/^(?:--yes|--force|-y)(?:=|$)/.test(arg)),billing.command,void 0,{excludeFlags:billing.excludeFlags,preserveProject:billing.preserveProject}),when:billing.when}]:void 0;recovery.hint&&hintRestatesCommand(recovery.hint,next)&&delete recovery.hint;let details={...recovery,...next&&{next},...agentErrorMetadata(client)};if(trackAgentError(client,{reason:err.status===403?"forbidden":err.status===402?"payment_required":err.status===429?"rate_limited":code,...recovery}),jsonOutput||client.nonInteractive)client.stdout.write(formatErrorJson(code,message,err.allowedValues,details));else{output_manager_default.fatal(message),recovery.hint&&output_manager_default.print(` ${recovery.hint}
|
|
8
8
|
`);for(let step of next??[])output_manager_default.print(` ${step.command}
|
|
9
9
|
`);err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
10
10
|
Available values: ${err.allowedValues.join(", ")}
|
|
@@ -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-BIFAR2CO.js";import{detectProjects}from"./chunk-7V2F5IUY.js";import{require_slugify}from"./chunk-COD3WAUI.js";import{selectOrg}from"./chunk-EDVP7QUI.js";import{createProject}from"./chunk-QHJLRTVY.js";import{readJSONFile}from"./chunk-VLSSMFTF.js";import{singleFileProjectSettings,validateRootDirectory}from"./chunk-6TEFVB2U.js";import{require_dist as require_dist2}from"./chunk-MZ6DNAVL.js";import{checkExistsAndConnect,parseRepoUrl,selectAndParseRemoteUrl}from"./chunk-SYEKOJHT.js";import{require_dist2 as require_dist}from"./chunk-WJ4VNTE3.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-SZRSBECO.js";import{Separator}from"./chunk-MVGTMPMI.js";import{isPromptBackError,isPromptCanceledError}from"./chunk-P2O5DOYE.js";import{pull}from"./chunk-ZH4DW3T3.js";import{require_frameworks}from"./chunk-MVCAUS4F.js";import{table}from"./chunk-773GOZIR.js";import{printError}from"./chunk-T6GXMIXO.js";import{getLocalPathConfig}from"./chunk-HWYHRPWP.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-SWJYZETA.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{printAlignedLabel}from"./chunk-N7Q2IESO.js";import{CantParseJSONFile,ProjectNotFound,isAPIError}from"./chunk-YIIPBH2D.js";import{output_manager_default,require_build_utils}from"./chunk-75IAMKGV.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.
|