vercel 59.24.0 → 59.25.2
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/README.md +2 -0
- package/dist/chunks/add-I6OSDG7H.js +8 -0
- package/dist/chunks/add-S7UAQFMS.js +8 -0
- package/dist/chunks/add-SAOTFJXH.js +8 -0
- package/dist/chunks/build-BQESAY3M.js +7 -0
- package/dist/chunks/{chunk-U2EJBAGE.js → chunk-25MLFUQD.js} +1 -1
- package/dist/chunks/{chunk-WVXO435I.js → chunk-2HZGNTI4.js} +1 -1
- package/dist/chunks/{chunk-YOQFHAWX.js → chunk-2R6NQXTQ.js} +1 -1
- package/dist/chunks/{chunk-OI5JAHZK.js → chunk-2UN7VRFD.js} +1 -1
- package/dist/chunks/{chunk-5H3QCVK5.js → chunk-3B4P7YHO.js} +1 -1
- package/dist/chunks/{chunk-VXPEFLJ6.js → chunk-3RV2B7D3.js} +1 -1
- package/dist/chunks/{chunk-X3KGMGDA.js → chunk-55GJZFU7.js} +1 -1
- package/dist/chunks/{chunk-KJ6MUEGB.js → chunk-5RZGGOSU.js} +1 -1
- package/dist/chunks/{chunk-NOYJJRDK.js → chunk-5TPZVSS5.js} +4 -4
- package/dist/chunks/{chunk-RSHNACJX.js → chunk-AAD7Z4WP.js} +2 -2
- package/dist/chunks/{chunk-JPIB7NB6.js → chunk-ADRTPMZX.js} +1 -1
- package/dist/chunks/{chunk-66KGIWDY.js → chunk-AKZOYEBP.js} +1 -1
- package/dist/chunks/{chunk-HW4QHETG.js → chunk-AP36GAOG.js} +1 -1
- package/dist/chunks/{chunk-QR7QPUFN.js → chunk-BKV35LVB.js} +1 -1
- package/dist/chunks/{chunk-F4PQSGJG.js → chunk-CGUVZZE7.js} +1 -1
- package/dist/chunks/{chunk-7S6R3LL4.js → chunk-CJE2WOKF.js} +1 -1
- package/dist/chunks/{chunk-P5EKTDOS.js → chunk-DM5B3RL5.js} +1 -1
- package/dist/chunks/{chunk-MHDVUE2Q.js → chunk-DRKY4FD3.js} +1 -1
- package/dist/chunks/{chunk-LL2XUFCY.js → chunk-F2YV6NXW.js} +1 -1
- package/dist/chunks/{chunk-LN7DRS3D.js → chunk-GTDDB5H3.js} +1 -1
- package/dist/chunks/{chunk-P7GPJFZ7.js → chunk-H4FTGLWV.js} +1 -1
- package/dist/chunks/{chunk-SURYRPWO.js → chunk-HFFYL7RZ.js} +1 -1
- package/dist/chunks/{chunk-LAKQ6JG3.js → chunk-IFLDELCH.js} +1 -1
- package/dist/chunks/{chunk-KF62ZVXT.js → chunk-IHLGZY7E.js} +1 -1
- package/dist/chunks/{chunk-QYFRPNL2.js → chunk-IQZ4RZCG.js} +1 -1
- package/dist/chunks/{chunk-BG25VOLN.js → chunk-J43KZUZH.js} +1 -1
- package/dist/chunks/{chunk-WTMSMKT5.js → chunk-JSKGZLE4.js} +1 -1
- package/dist/chunks/chunk-KCARCOP5.js +10 -0
- package/dist/chunks/{chunk-SKAUCH5L.js → chunk-L6PCGBYI.js} +1 -1
- package/dist/chunks/{chunk-MQO32DYF.js → chunk-LFI3BSDC.js} +1 -1
- package/dist/chunks/{chunk-NWL3VI5O.js → chunk-MNN5SBQF.js} +1 -1
- package/dist/chunks/{chunk-7DNHVDK2.js → chunk-N2KPEDSI.js} +2 -2
- package/dist/chunks/{chunk-PGF7MQK6.js → chunk-N5AIKGEO.js} +1 -1
- package/dist/chunks/chunk-NO52HJTS.js +8 -0
- package/dist/chunks/{chunk-DBABUG2N.js → chunk-OBMNRGJT.js} +1 -1
- package/dist/chunks/chunk-OILNJ2J2.js +7 -0
- package/dist/chunks/{chunk-MV6LWP5R.js → chunk-PSLDCFUV.js} +1 -1
- package/dist/chunks/{chunk-DPTTW6AM.js → chunk-Q3DGBC7N.js} +1 -1
- package/dist/chunks/{chunk-U7RBKXKN.js → chunk-QHU7NQI5.js} +1 -1
- package/dist/chunks/{chunk-V62NLRIZ.js → chunk-SIQZNFAH.js} +1 -1
- package/dist/chunks/{chunk-V3YAU6ES.js → chunk-TBKDCQGQ.js} +4 -4
- package/dist/chunks/{chunk-FXYCV7SI.js → chunk-TKIRQYH5.js} +1 -1
- package/dist/chunks/{chunk-KE3S2RRY.js → chunk-WPM4TQDF.js} +1 -1
- package/dist/chunks/{chunk-EUJWN3RB.js → chunk-WWB66KP5.js} +1 -1
- package/dist/chunks/{chunk-J7DOWLLD.js → chunk-YG6LPJFT.js} +1 -1
- package/dist/chunks/{chunk-6QNPNUTJ.js → chunk-YQ2O2NIF.js} +1 -1
- package/dist/chunks/chunk-YSN4YTUY.js +7 -0
- package/dist/chunks/{chunk-RYVVD7GM.js → chunk-ZC4LOS3A.js} +1 -1
- package/dist/chunks/clear-OLTGPRJ5.js +8 -0
- package/dist/chunks/compile-vercel-config-NKOWFZZG.js +7 -0
- package/dist/chunks/config-CZOTS44A.js +8 -0
- package/dist/chunks/{config-JTA2VZHH.js → config-DF4DBQSB.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/delete-5QARUXY7.js +10 -0
- package/dist/chunks/delete-MTZHX4LY.js +9 -0
- package/dist/chunks/detect-services-K72FCUKE.js +7 -0
- package/dist/chunks/disable-5PFOEZKB.js +7 -0
- package/dist/chunks/discard-XDKXFPA5.js +14 -0
- package/dist/chunks/edit-WJSAUDWF.js +8 -0
- package/dist/chunks/edit-YHZH2MYH.js +9 -0
- package/dist/chunks/enable-NYSTJC2H.js +7 -0
- package/dist/chunks/{exec-YH5WUJ4C.js → exec-3RMS2X6B.js} +1 -1
- package/dist/chunks/{export-ZKRSU23G.js → export-ZKT6EB42.js} +1 -1
- package/dist/chunks/future-IGDV62BF.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-UEYQIDXM.js +7 -0
- package/dist/chunks/image-2SK4J4O4.js +7 -0
- package/dist/chunks/import-builders-UBNV7HJX.js +7 -0
- package/dist/chunks/inspect-DVBCOD7K.js +13 -0
- package/dist/chunks/{inspect-OFHABZ6D.js → inspect-M6ZJQF6V.js} +1 -1
- package/dist/chunks/{inspect-GUUFDCF6.js → inspect-MCDQHBHZ.js} +1 -1
- package/dist/chunks/{inspect-SZ4HH7QY.js → inspect-S6AT7LNW.js} +1 -1
- package/dist/chunks/inspect-Y6BQY3VA.js +9 -0
- package/dist/chunks/{list-O5E5ZYAN.js → list-373ZPONO.js} +1 -1
- package/dist/chunks/list-6GSMWNLA.js +11 -0
- package/dist/chunks/{list-W2TEW25J.js → list-PPFTGAC6.js} +1 -1
- package/dist/chunks/login-RQ4VYI5A.js +9 -0
- package/dist/chunks/login-VJZGWSOW.js +7 -0
- package/dist/chunks/logs-TMTBVNCC.js +7 -0
- package/dist/chunks/{ls-WTAMOBVG.js → ls-3BRR7JIX.js} +1 -1
- package/dist/chunks/{ls-OC2YVP7U.js → ls-MNTDNVC5.js} +1 -1
- package/dist/chunks/{ls-X53N2CIG.js → ls-NXJRIM6O.js} +1 -1
- package/dist/chunks/ls-W7TJY3RN.js +8 -0
- package/dist/chunks/{ls-GNZ5XC5V.js → ls-X3GP2IRA.js} +1 -1
- package/dist/chunks/ls-XYOHKCZP.js +11 -0
- package/dist/chunks/{ls-Q6TGKOW6.js → ls-ZVLXMLGD.js} +1 -1
- package/dist/chunks/mutate-QJREWJEH.js +9 -0
- package/dist/chunks/notifications-D57XNFN2.js +7 -0
- package/dist/chunks/open-6ERMTBK7.js +7 -0
- package/dist/chunks/openapi-G3HACVTQ.js +7 -0
- package/dist/chunks/permissions-KKF5YWC3.js +7 -0
- package/dist/chunks/prompt-missing-credentials-KCPCA6L7.js +7 -0
- package/dist/chunks/publish-W53JMHOA.js +15 -0
- package/dist/chunks/pull-JDBB2JO5.js +7 -0
- package/dist/chunks/purchase-domain-if-available-RHJZ6U72.js +7 -0
- package/dist/chunks/push-DLROWCQ4.js +7 -0
- package/dist/chunks/{query-3GCRJN4Q.js → query-R2OKVWWT.js} +1 -1
- package/dist/chunks/reauthenticate-DIFJZWC5.js +7 -0
- package/dist/chunks/reorder-YD4ENV5L.js +10 -0
- package/dist/chunks/reply-TCDHRSGG.js +9 -0
- package/dist/chunks/resolve-ZEC456YB.js +12 -0
- package/dist/chunks/restore-RH6YGGXG.js +16 -0
- package/dist/chunks/rm-3M5ADIDW.js +8 -0
- package/dist/chunks/rm-G6EOLSCZ.js +8 -0
- package/dist/chunks/rm-PCTYRCOB.js +8 -0
- package/dist/chunks/rm-SHCFLXHI.js +8 -0
- package/dist/chunks/rm-UGEBIUFV.js +8 -0
- package/dist/chunks/rule-inspect-TED7H6MG.js +8 -0
- package/dist/chunks/rules-DGGA3QHB.js +7 -0
- package/dist/chunks/schema-22D2HKSJ.js +14 -0
- package/dist/chunks/{schema-HCHBRZFG.js → schema-H6XU3F2A.js} +1 -1
- package/dist/chunks/select-org-6AA7XX6E.js +7 -0
- package/dist/chunks/set-7UAH7RCL.js +7 -0
- package/dist/chunks/setup-and-link-NHQPSPPZ.js +7 -0
- package/dist/chunks/tags-OYKSDCSO.js +7 -0
- package/dist/chunks/{types-L37GS4JI.js → types-UYIFBCCL.js} +1 -1
- package/dist/chunks/{update-GITCTREW.js → update-OIQ44IMN.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 +5 -5
- 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 +8 -8
- package/dist/index.js +5 -5
- package/dist/internal-build-worker.js +10 -0
- package/dist/vc.js +46 -4
- package/dist/version.mjs +1 -1
- package/package.json +54 -54
- package/dist/chunks/add-7Y2KUKBS.js +0 -8
- package/dist/chunks/add-AH7CCGI4.js +0 -8
- package/dist/chunks/add-PZQFNEK6.js +0 -8
- package/dist/chunks/build-J2L7FBF6.js +0 -7
- package/dist/chunks/chunk-BK7VICZ5.js +0 -8
- package/dist/chunks/chunk-J3U3L45Y.js +0 -7
- package/dist/chunks/chunk-K2MXVUWY.js +0 -7
- package/dist/chunks/chunk-QHKY2XXG.js +0 -7
- package/dist/chunks/chunk-SQXB2UM4.js +0 -10
- package/dist/chunks/chunk-XU5QGRSL.js +0 -7
- package/dist/chunks/clear-K7ORVDOX.js +0 -8
- package/dist/chunks/compile-vercel-config-JNODRT2C.js +0 -7
- package/dist/chunks/config-RWVPD75M.js +0 -8
- package/dist/chunks/delete-2TO7EK2C.js +0 -10
- package/dist/chunks/delete-KB2GQRD2.js +0 -9
- package/dist/chunks/detect-services-S4EMRGXM.js +0 -7
- package/dist/chunks/disable-OECXCINH.js +0 -7
- package/dist/chunks/discard-TQ2BYSPA.js +0 -14
- package/dist/chunks/edit-GJY2Q7DK.js +0 -8
- package/dist/chunks/edit-OARSMUGS.js +0 -9
- package/dist/chunks/enable-CHWCHWYK.js +0 -7
- package/dist/chunks/future-7RNP7ZP6.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-SNWO4UCL.js +0 -7
- package/dist/chunks/image-XJJMFNS3.js +0 -7
- package/dist/chunks/import-builders-BJTHQZFZ.js +0 -7
- package/dist/chunks/inspect-KL6E4NYB.js +0 -13
- package/dist/chunks/inspect-PAQAACPV.js +0 -9
- package/dist/chunks/list-R3UBCTNJ.js +0 -11
- package/dist/chunks/login-FA3ZCLNA.js +0 -7
- package/dist/chunks/login-NN7X6ATG.js +0 -9
- package/dist/chunks/logs-XXEVORNG.js +0 -7
- package/dist/chunks/ls-6DBJ4O2U.js +0 -8
- package/dist/chunks/ls-I7TEWFFI.js +0 -11
- package/dist/chunks/mutate-TYDZXN6D.js +0 -9
- package/dist/chunks/notifications-ISH6L4LN.js +0 -7
- package/dist/chunks/open-NP6JK7D3.js +0 -7
- package/dist/chunks/openapi-QJEB6PRW.js +0 -7
- package/dist/chunks/permissions-CDHSBRVG.js +0 -7
- package/dist/chunks/prompt-missing-credentials-FX2H3SHO.js +0 -7
- package/dist/chunks/publish-JZHSWOHM.js +0 -15
- package/dist/chunks/pull-MCOEV5HI.js +0 -7
- package/dist/chunks/purchase-domain-if-available-G7SE7C2F.js +0 -7
- package/dist/chunks/push-XSQNASL2.js +0 -7
- package/dist/chunks/reauthenticate-QYJGKCGV.js +0 -7
- package/dist/chunks/reorder-DHP3CTN2.js +0 -10
- package/dist/chunks/reply-WKPVJAWP.js +0 -9
- package/dist/chunks/resolve-QF5SMBPD.js +0 -12
- package/dist/chunks/restore-A5UQIGNA.js +0 -16
- package/dist/chunks/rm-FIZ56DQC.js +0 -8
- package/dist/chunks/rm-L5KYP6JP.js +0 -8
- package/dist/chunks/rm-MRIJKX4E.js +0 -8
- package/dist/chunks/rm-VQ2ESDWM.js +0 -8
- package/dist/chunks/rm-WEOLZ2OC.js +0 -8
- package/dist/chunks/rule-inspect-WY667VBH.js +0 -8
- package/dist/chunks/rules-7PJ5PHRB.js +0 -7
- package/dist/chunks/schema-KWNBTTXA.js +0 -14
- package/dist/chunks/select-org-JEXIDHLI.js +0 -7
- package/dist/chunks/set-BRG2L4NA.js +0 -7
- package/dist/chunks/setup-and-link-R6IRKMYF.js +0 -7
- package/dist/chunks/tags-Y5KMBUYT.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{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{resolveProjectContext}from"./chunk-HFFYL7RZ.js";import{performDeviceCodeFlow}from"./chunk-H4FTGLWV.js";import{require_json_parse_better_errors}from"./chunk-N6CNMMSZ.js";import{ensureLink,parseEnv}from"./chunk-QHU7NQI5.js";import{require_frameworks}from"./chunk-KK4AJES5.js";import{pullSubcommand}from"./chunk-KUVMCIR4.js";import{param}from"./chunk-SXUEGVWB.js";import{STANDARD_ENVIRONMENTS,formatProject}from"./chunk-6BZCSVH6.js";import{parseTarget}from"./chunk-R3B67TKQ.js";import{getDeployment}from"./chunk-C5KVTG2O.js";import{TelemetryClient}from"./chunk-A5VLP25I.js";import{printError}from"./chunk-N5AIKGEO.js";import{parseArguments}from"./chunk-WWB66KP5.js";import{addToGitIgnore,require_lib}from"./chunk-5TPZVSS5.js";import{buildCommandWithYes,getPreservedArgsForEnvPull,outputActionRequired,outputAgentError}from"./chunk-KCARCOP5.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import{printAlignedLabel}from"./chunk-YMM3VY3J.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import{getCommandName,getCommandNamePlain}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk2=__toESM(require_source(),1),import_fs_extra2=__toESM(require_lib(),1);import{closeSync,openSync,readSync}from"fs";import{resolve}from"path";import{URLSearchParams}from"url";var RECOVERABLE_CHALLENGE_CODES=new Set(["challenge_required","challenge_required_email_otp","user_auth_required"]);async function withEnvChallengeRecovery(client,fn){let hadStoredSession=!!(client.authConfig.token||client.authConfig.refreshToken);try{return await fn()}catch(error){if(!isAPIError(error))throw error;let isRecoverableChallenge=RECOVERABLE_CHALLENGE_CODES.has(error.code),isRejectedStoredSession=hadStoredSession&&error.invalidToken===!0;if(!isRecoverableChallenge&&!isRejectedStoredSession||client.authConfig.tokenSource||!client.stdin.isTTY||client.nonInteractive)throw error;output_manager_default.stopSpinner(),output_manager_default.log("Sensitive Environment Variables require fresh authentication.");let refreshToken=client.authConfig.refreshToken,acrValues=getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate),tokens=isRecoverableChallenge&&refreshToken&&acrValues?await performDeviceCodeFlow(client,{refreshToken,acrValues,fallbackToLoginOnStepUpFailure:!0}):await performDeviceCodeFlow(client);if(!tokens)throw error;return client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let bearerIndex=header.toLowerCase().indexOf("bearer");if(bearerIndex===-1)return;let match=header.slice(bearerIndex+6).match(/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i);return match?.[1]?.replace(/\\(.)/g,"$1")??match?.[2]}async function getEnvRecords(client,projectId,source,{target,gitBranch,decrypt}={}){output_manager_default.debug(`Fetching Environment Variables of project ${projectId} and target ${target}`);let query=new URLSearchParams;if(target){let targetParam="target";target!=="production"&&target!=="preview"&&target!=="development"&&(targetParam="customEnvironmentId"),query.set(targetParam,target)}gitBranch&&query.set("gitBranch",gitBranch),decrypt&&query.set("decrypt",decrypt.toString()),source&&query.set("source",source);let url=`/v10/projects/${projectId}/env?${query}`;return withEnvChallengeRecovery(client,()=>client.fetch(url))}async function pullEnvRecords(client,projectIdOrDeploymentId,source,{target,gitBranch}={}){output_manager_default.debug(`Fetching Environment Variables of ${projectIdOrDeploymentId} and target ${target}`);let query=new URLSearchParams,url=`/v3/env/pull/${projectIdOrDeploymentId}`;return projectIdOrDeploymentId.startsWith("dpl_")||target&&(url+=`/${encodeURIComponent(target)}`,gitBranch&&(url+=`/${encodeURIComponent(gitBranch)}`)),source&&query.set("source",source),Array.from(query).length>0&&(url+=`?${query}`),withEnvChallengeRecovery(client,()=>client.fetch(url))}var import_fs_extra=__toESM(require_lib(),1);var import_chalk=__toESM(require_source(),1);async function createEnvObject(envPath){let envArr=(await(0,import_fs_extra.readFile)(envPath,"utf-8")).replace(/"/g,"").split(/\r?\n|\r/).filter(line=>/^[^#]/.test(line)).filter(line=>/=/i.test(line)),parsedEnv=parseEnv(envArr);if(Object.keys(parsedEnv).length===0){output_manager_default.debug("Failed to parse env file.");return}return parsedEnv}function findChanges(oldEnv,newEnv){let added=[],changed=[];for(let key of Object.keys(newEnv))oldEnv[key]===void 0?added.push(key):oldEnv[key]!==newEnv[key]&&changed.push(key),delete oldEnv[key];let removed=Object.keys(oldEnv);return{added,changed,removed}}function buildDeltaString(oldEnv,newEnv){let{added,changed,removed}=findChanges(oldEnv,newEnv),deltaString="";return deltaString+=import_chalk.default.green(addDeltaSection("+",changed,!0)),deltaString+=import_chalk.default.green(addDeltaSection("+",added)),deltaString+=import_chalk.default.red(addDeltaSection("-",removed)),deltaString&&import_chalk.default.gray(` Changes:
|
|
8
8
|
`)+deltaString+`
|
|
9
9
|
`}function addDeltaSection(prefix,arr,changed=!1){return arr.length===0?"":arr.sort().map(item=>` ${prefix} ${item}${changed?" (Updated)":""}`).join(`
|
|
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{require_lib}from"./chunk-
|
|
7
|
+
import{require_lib}from"./chunk-5TPZVSS5.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);return pathStat?pathStat.isDirectory()?path===homedir()&&!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1)?(output_manager_default.print(`Canceled
|
|
8
8
|
`),{valid:!1,exitCode:0}):{valid:!0,path}:(output_manager_default.prettyError({message:"Support for single file deployments has been removed.",link:"https://vercel.link/no-single-file-deployments"}),{valid:!1,exitCode:1}):(output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1})}export{validateRootDirectory,validatePaths};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_lib}from"./chunk-
|
|
7
|
+
import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_lib}from"./chunk-5TPZVSS5.js";import{packageName}from"./chunk-FI772UVH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{promisify}from"util";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var nativePackageName="@vercel/vc-native",execFileAsync=promisify(execFile),UnsupportedUpgradeInstallError=class extends Error{},globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args,{stdout}=await execFileAsync(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env,signal});return stdout.trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){throwIfAborted(signal);let nativeInstall=isNativeBinaryInstall(),pkg=nativeInstall?nativePackageName:packageName,installPath=nativeInstall?process.execPath:process.argv[1];try{installPath=await(0,import_fs_extra.realpath)(installPath)}catch{throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.")}let packageManager=await detectGlobalPackageManager(installPath,pkg,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let nativeInstall=isNativeBinaryInstall(),pkg=nativeInstall?nativePackageName:packageName,{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${pkg}@latest`),force=nativeInstall&&packageManager==="npm"?" --force":"",allowBuild=pnpmAllowBuildFlag(packageManager,nativeInstall?nativePackageName:"esbuild");return{command:`${packageManager} ${args.join(" ")}${force}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,isGlobal,getUpdateCommandInfo,getUpdateCommand};
|
|
@@ -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{AGENT_REASON}from"./chunk-T4LZS75P.js";import{getProjectByNameOrId}from"./chunk-
|
|
7
|
+
import{AGENT_REASON}from"./chunk-T4LZS75P.js";import{getProjectByNameOrId}from"./chunk-5TPZVSS5.js";import{ProjectNotFound}from"./chunk-RINZXCDJ.js";var MISSING_BOTH_MESSAGE="No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";async function resolveScope({client,flags={},linkedProject}){let flagScope=flags.scope?.trim()||void 0,flagProject=flags.project?.trim()||void 0;if(linkedProject.status==="linked"){if(!flagScope&&!flagProject)return{teamId:linkedProject.org.id,projectId:linkedProject.project.id};let teamId=flagScope?client.config.currentTeam:linkedProject.org.id;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject??linkedProject.project.id,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id}}if(flagScope&&flagProject){let teamId=client.config.currentTeam;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id}}return{reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE}}export{MISSING_BOTH_MESSAGE,resolveScope};
|