vercel 29.4.0 → 30.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +381 -133
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -218636,8 +218636,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
218636
218636
  return (mod && mod.__esModule) ? mod : { "default": mod };
218637
218637
  };
218638
218638
  Object.defineProperty(exports, "__esModule", ({ value: true }));
218639
- exports.createDeployment = exports.buildFileTree = exports.getVercelIgnore = void 0;
218639
+ exports.createDeployment = exports.buildFileTree = exports.getVercelIgnore = exports.checkDeploymentStatus = void 0;
218640
218640
  const create_deployment_1 = __importDefault(__webpack_require__(36371));
218641
+ var check_deployment_status_1 = __webpack_require__(83633);
218642
+ Object.defineProperty(exports, "checkDeploymentStatus", ({ enumerable: true, get: function () { return check_deployment_status_1.checkDeploymentStatus; } }));
218641
218643
  var index_1 = __webpack_require__(67110);
218642
218644
  Object.defineProperty(exports, "getVercelIgnore", ({ enumerable: true, get: function () { return index_1.getVercelIgnore; } }));
218643
218645
  Object.defineProperty(exports, "buildFileTree", ({ enumerable: true, get: function () { return index_1.buildFileTree; } }));
@@ -224853,6 +224855,7 @@ const help = () => `
224853
224855
  login [email] Logs into your account or creates a new one
224854
224856
  logout Logs out of your account
224855
224857
  pull [path] Pull your Project Settings from the cloud
224858
+ redeploy [url|id] Rebuild and deploy a previous deployment.
224856
224859
  rollback [url|id] Quickly revert back to a previous deployment
224857
224860
  switch [scope] Switches between teams and your personal account
224858
224861
 
@@ -226946,14 +226949,13 @@ const stamp_1 = __importDefault(__webpack_require__(49079));
226946
226949
  const create_deploy_1 = __importDefault(__webpack_require__(45303));
226947
226950
  const get_deployment_1 = __importDefault(__webpack_require__(84249));
226948
226951
  const parse_meta_1 = __importDefault(__webpack_require__(93983));
226949
- const link_1 = __importDefault(__webpack_require__(39302));
226950
226952
  const param_1 = __importDefault(__webpack_require__(20668));
226951
226953
  const errors_ts_1 = __webpack_require__(39240);
226952
226954
  const errors_1 = __webpack_require__(74148);
226953
226955
  const purchase_domain_if_available_1 = __importDefault(__webpack_require__(9696));
226954
226956
  const confirm_1 = __importDefault(__webpack_require__(59320));
226955
226957
  const edit_project_settings_1 = __importDefault(__webpack_require__(18279));
226956
- const link_2 = __webpack_require__(49347);
226958
+ const link_1 = __webpack_require__(49347);
226957
226959
  const get_project_name_1 = __importDefault(__webpack_require__(960));
226958
226960
  const select_org_1 = __importDefault(__webpack_require__(96339));
226959
226961
  const input_project_1 = __importDefault(__webpack_require__(38877));
@@ -226961,7 +226963,6 @@ const emoji_1 = __webpack_require__(35172);
226961
226963
  const input_root_directory_1 = __webpack_require__(70738);
226962
226964
  const validate_paths_1 = __importStar(__webpack_require__(33922));
226963
226965
  const pkg_name_1 = __webpack_require__(79000);
226964
- const get_preferred_preview_url_1 = __webpack_require__(62666);
226965
226966
  const args_1 = __webpack_require__(89097);
226966
226967
  const get_deployment_checks_1 = __webpack_require__(10559);
226967
226968
  const parse_target_1 = __importDefault(__webpack_require__(43667));
@@ -226971,7 +226972,7 @@ const validate_archive_format_1 = __webpack_require__(86974);
226971
226972
  const parse_env_1 = __webpack_require__(59818);
226972
226973
  const error_utils_1 = __webpack_require__(39799);
226973
226974
  const project_settings_1 = __webpack_require__(61440);
226974
- const is_deploying_1 = __webpack_require__(25307);
226975
+ const print_deployment_status_1 = __webpack_require__(27951);
226975
226976
  exports.default = async (client) => {
226976
226977
  const { output } = client;
226977
226978
  let argv = null;
@@ -226990,6 +226991,7 @@ exports.default = async (client) => {
226990
226991
  '--prod': Boolean,
226991
226992
  '--archive': String,
226992
226993
  '--no-wait': Boolean,
226994
+ '--skip-domain': Boolean,
226993
226995
  '--yes': Boolean,
226994
226996
  '-f': '--force',
226995
226997
  '-p': '--public',
@@ -227115,7 +227117,7 @@ exports.default = async (client) => {
227115
227117
  return 1;
227116
227118
  }
227117
227119
  // retrieve `project` and `org` from .vercel
227118
- const link = await (0, link_2.getLinkedProject)(client, path);
227120
+ const link = await (0, link_1.getLinkedProject)(client, path);
227119
227121
  if (link.status === 'error') {
227120
227122
  return link.exitCode;
227121
227123
  }
@@ -227161,7 +227163,7 @@ exports.default = async (client) => {
227161
227163
  rootDirectory = project.rootDirectory;
227162
227164
  sourceFilesOutsideRootDirectory = project.sourceFilesOutsideRootDirectory;
227163
227165
  // we can already link the project
227164
- await (0, link_2.linkFolderToProject)(output, path, {
227166
+ await (0, link_1.linkFolderToProject)(output, path, {
227165
227167
  projectId: project.id,
227166
227168
  orgId: org.id,
227167
227169
  }, project.name, org.slug);
@@ -227259,6 +227261,7 @@ exports.default = async (client) => {
227259
227261
  throw new Error('`name` not found on project or provided by existing project');
227260
227262
  }
227261
227263
  try {
227264
+ const autoAssignCustomDomains = !argv['--skip-domain'];
227262
227265
  const createArgs = {
227263
227266
  name,
227264
227267
  env: deploymentEnv,
@@ -227282,6 +227285,7 @@ exports.default = async (client) => {
227282
227285
  target,
227283
227286
  skipAutoDetectionConfirmation: autoConfirm,
227284
227287
  noWait,
227288
+ autoAssignCustomDomains,
227285
227289
  };
227286
227290
  if (!localConfig.builds || localConfig.builds.length === 0) {
227287
227291
  // Only add projectSettings for zero config deployments
@@ -227398,7 +227402,7 @@ exports.default = async (client) => {
227398
227402
  (0, error_1.handleError)(err);
227399
227403
  return 1;
227400
227404
  }
227401
- return printDeploymentStatus(output, client, deployment, deployStamp, noWait);
227405
+ return (0, print_deployment_status_1.printDeploymentStatus)(client, deployment, deployStamp, noWait);
227402
227406
  };
227403
227407
  function handleCreateDeployError(output, error, localConfig) {
227404
227408
  if (error instanceof errors_ts_1.InvalidDomain) {
@@ -227464,62 +227468,6 @@ const addProcessEnv = async (log, env) => {
227464
227468
  }
227465
227469
  }
227466
227470
  };
227467
- const printDeploymentStatus = async (output, client, { readyState, alias: aliasList, aliasError, target, indications, url: deploymentUrl, aliasWarning, }, deployStamp, noWait) => {
227468
- indications = indications || [];
227469
- const isProdDeployment = target === 'production';
227470
- let isStillBuilding = false;
227471
- if (noWait) {
227472
- if ((0, is_deploying_1.isDeploying)(readyState)) {
227473
- isStillBuilding = true;
227474
- output.print((0, emoji_1.prependEmoji)('Note: Deployment is still processing...', (0, emoji_1.emoji)('notice')) + '\n');
227475
- }
227476
- }
227477
- if (!isStillBuilding && readyState !== 'READY') {
227478
- output.error(`Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error`);
227479
- return 1;
227480
- }
227481
- if (aliasError) {
227482
- output.warn(`Failed to assign aliases${aliasError.message ? `: ${aliasError.message}` : ''}`);
227483
- }
227484
- else {
227485
- // print preview/production url
227486
- let previewUrl;
227487
- // if `noWait` is true, then use the deployment url, not an alias
227488
- if (!noWait && Array.isArray(aliasList) && aliasList.length > 0) {
227489
- const previewUrlInfo = await (0, get_preferred_preview_url_1.getPreferredPreviewURL)(client, aliasList);
227490
- if (previewUrlInfo) {
227491
- previewUrl = previewUrlInfo.previewUrl;
227492
- }
227493
- else {
227494
- previewUrl = `https://${deploymentUrl}`;
227495
- }
227496
- }
227497
- else {
227498
- // fallback to deployment url
227499
- previewUrl = `https://${deploymentUrl}`;
227500
- }
227501
- output.print((0, emoji_1.prependEmoji)(`${isProdDeployment ? 'Production' : 'Preview'}: ${chalk_1.default.bold(previewUrl)} ${deployStamp()}`, (0, emoji_1.emoji)('success')) + `\n`);
227502
- }
227503
- if (aliasWarning?.message) {
227504
- indications.push({
227505
- type: 'warning',
227506
- payload: aliasWarning.message,
227507
- link: aliasWarning.link,
227508
- action: aliasWarning.action,
227509
- });
227510
- }
227511
- const newline = '\n';
227512
- for (let indication of indications) {
227513
- const message = (0, emoji_1.prependEmoji)(chalk_1.default.dim(indication.payload), (0, emoji_1.emoji)(indication.type)) +
227514
- newline;
227515
- let link = '';
227516
- if (indication.link)
227517
- link =
227518
- chalk_1.default.dim(`${indication.action || 'Learn More'}: ${(0, link_1.default)(indication.link)}`) + newline;
227519
- output.print(message + link);
227520
- }
227521
- return 0;
227522
- };
227523
227471
 
227524
227472
 
227525
227473
  /***/ }),
@@ -229312,7 +229260,7 @@ const help = () => {
229312
229260
  ls [environment] [gitbranch] List all variables for the specified Environment
229313
229261
  add [name] [environment] [gitbranch] Add an Environment Variable (see examples below)
229314
229262
  rm [name] [environment] [gitbranch] Remove an Environment Variable (see examples below)
229315
- pull [filename] Pull all Development Environment Variables from the cloud and write to a file [.env]
229263
+ pull [filename] Pull all Development Environment Variables from the cloud and write to a file [.env.local]
229316
229264
 
229317
229265
  ${chalk_1.default.dim('Options:')}
229318
229266
 
@@ -229565,7 +229513,7 @@ async function pull(client, project, environment, opts, args, output, cwd, sourc
229565
229513
  return 1;
229566
229514
  }
229567
229515
  // handle relative or absolute filename
229568
- const [filename = '.env'] = args;
229516
+ const [filename = '.env.local'] = args;
229569
229517
  const fullPath = (0, path_1.resolve)(cwd, filename);
229570
229518
  const skipConfirmation = opts['--yes'];
229571
229519
  const gitBranch = opts['--git-branch'];
@@ -229784,7 +229732,7 @@ async function connect(client, argv, args, project, org) {
229784
229732
  confirm,
229785
229733
  org,
229786
229734
  project,
229787
- repoInfo: repoArg,
229735
+ repoInfo: parsedUrlArg,
229788
229736
  });
229789
229737
  }
229790
229738
  if (!gitConfig) {
@@ -230170,6 +230118,7 @@ exports.default = new Map([
230170
230118
  ['project', 'project'],
230171
230119
  ['projects', 'project'],
230172
230120
  ['pull', 'pull'],
230121
+ ['redeploy', 'redeploy'],
230173
230122
  ['remove', 'remove'],
230174
230123
  ['rm', 'remove'],
230175
230124
  ['rollback', 'rollback'],
@@ -231923,6 +231872,184 @@ async function main(client) {
231923
231872
  exports.default = main;
231924
231873
 
231925
231874
 
231875
+ /***/ }),
231876
+
231877
+ /***/ 29281:
231878
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
231879
+
231880
+ "use strict";
231881
+
231882
+ var __importDefault = (this && this.__importDefault) || function (mod) {
231883
+ return (mod && mod.__esModule) ? mod : { "default": mod };
231884
+ };
231885
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
231886
+ const chalk_1 = __importDefault(__webpack_require__(90877));
231887
+ const client_1 = __webpack_require__(40521);
231888
+ const emoji_1 = __webpack_require__(35172);
231889
+ const get_args_1 = __importDefault(__webpack_require__(2505));
231890
+ const pkg_name_1 = __webpack_require__(79000);
231891
+ const get_deployment_by_id_or_url_1 = __webpack_require__(47662);
231892
+ const get_scope_1 = __importDefault(__webpack_require__(60324));
231893
+ const handle_error_1 = __importDefault(__webpack_require__(64377));
231894
+ const error_utils_1 = __webpack_require__(39799);
231895
+ const logo_1 = __importDefault(__webpack_require__(66669));
231896
+ const util_1 = __importDefault(__webpack_require__(4058));
231897
+ const print_deployment_status_1 = __webpack_require__(27951);
231898
+ const stamp_1 = __importDefault(__webpack_require__(49079));
231899
+ const ua_1 = __importDefault(__webpack_require__(36308));
231900
+ const help = () => {
231901
+ console.log(`
231902
+ ${chalk_1.default.bold(`${logo_1.default} ${(0, pkg_name_1.getPkgName)()} redeploy`)} [deploymentId|deploymentName]
231903
+
231904
+ Rebuild and deploy a previous deployment.
231905
+
231906
+ ${chalk_1.default.dim('Options:')}
231907
+
231908
+ -h, --help Output usage information
231909
+ -A ${chalk_1.default.bold.underline('FILE')}, --local-config=${chalk_1.default.bold.underline('FILE')} Path to the local ${'`vercel.json`'} file
231910
+ -Q ${chalk_1.default.bold.underline('DIR')}, --global-config=${chalk_1.default.bold.underline('DIR')} Path to the global ${'`.vercel`'} directory
231911
+ -d, --debug Debug mode [off]
231912
+ --no-color No color mode [off]
231913
+ --no-wait Don't wait for the redeploy to finish
231914
+ -t ${chalk_1.default.bold.underline('TOKEN')}, --token=${chalk_1.default.bold.underline('TOKEN')} Login token
231915
+ -y, --yes Skip questions when setting up new project using default scope and settings
231916
+
231917
+ ${chalk_1.default.dim('Examples:')}
231918
+
231919
+ ${chalk_1.default.gray('–')} Rebuild and deploy an existing deployment using id or url
231920
+
231921
+ ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} redeploy my-deployment.vercel.app`)}
231922
+
231923
+ ${chalk_1.default.gray('–')} Write Deployment URL to a file
231924
+
231925
+ ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} redeploy my-deployment.vercel.app > deployment-url.txt`)}
231926
+ `);
231927
+ };
231928
+ /**
231929
+ * `vc redeploy` command
231930
+ * @param {Client} client
231931
+ * @returns {Promise<number>} Resolves an exit code; 0 on success
231932
+ */
231933
+ exports.default = async (client) => {
231934
+ let argv;
231935
+ try {
231936
+ argv = (0, get_args_1.default)(client.argv.slice(2), {
231937
+ '--no-wait': Boolean,
231938
+ '--yes': Boolean,
231939
+ '-y': '--yes',
231940
+ });
231941
+ }
231942
+ catch (err) {
231943
+ (0, handle_error_1.default)(err);
231944
+ return 1;
231945
+ }
231946
+ if (argv['--help'] || argv._[0] === 'help') {
231947
+ help();
231948
+ return 2;
231949
+ }
231950
+ const { output } = client;
231951
+ const deployIdOrUrl = argv._[1];
231952
+ if (!deployIdOrUrl) {
231953
+ output.error(`Missing required deployment id or url: ${(0, pkg_name_1.getCommandName)(`redeploy <deployment-id-or-url>`)}`);
231954
+ return 1;
231955
+ }
231956
+ const { contextName } = await (0, get_scope_1.default)(client);
231957
+ const noWait = !!argv['--no-wait'];
231958
+ try {
231959
+ const fromDeployment = await (0, get_deployment_by_id_or_url_1.getDeploymentByIdOrURL)({
231960
+ client,
231961
+ contextName,
231962
+ deployIdOrUrl,
231963
+ });
231964
+ const deployStamp = (0, stamp_1.default)();
231965
+ output.spinner(`Redeploying project ${fromDeployment.id}`, 0);
231966
+ let deployment = await client.fetch(`/v13/deployments?forceNew=1`, {
231967
+ body: {
231968
+ deploymentId: fromDeployment.id,
231969
+ meta: {
231970
+ action: 'redeploy',
231971
+ },
231972
+ name: fromDeployment.name,
231973
+ target: fromDeployment.target || 'production',
231974
+ },
231975
+ method: 'POST',
231976
+ });
231977
+ output.stopSpinner();
231978
+ output.print(`${(0, emoji_1.prependEmoji)(`Inspect: ${chalk_1.default.bold(deployment.inspectorUrl)} ${deployStamp()}`, (0, emoji_1.emoji)('inspect'))}\n`);
231979
+ if (!client.stdout.isTTY) {
231980
+ client.stdout.write(`https://${deployment.url}`);
231981
+ }
231982
+ if (!noWait) {
231983
+ output.spinner(deployment.readyState === 'QUEUED' ? 'Queued' : 'Building', 0);
231984
+ if (deployment.readyState === 'READY' && deployment.aliasAssigned) {
231985
+ output.spinner('Completing', 0);
231986
+ }
231987
+ else {
231988
+ try {
231989
+ const clientOptions = {
231990
+ agent: client.agent,
231991
+ apiUrl: client.apiUrl,
231992
+ debug: client.output.debugEnabled,
231993
+ path: '',
231994
+ teamId: fromDeployment.team?.id,
231995
+ token: client.authConfig.token,
231996
+ userAgent: ua_1.default,
231997
+ };
231998
+ for await (const event of (0, client_1.checkDeploymentStatus)(deployment, clientOptions)) {
231999
+ if (event.type === 'building') {
232000
+ output.spinner('Building', 0);
232001
+ }
232002
+ else if (event.type === 'ready' &&
232003
+ (event.payload.checksState
232004
+ ? event.payload.checksState === 'completed'
232005
+ : true)) {
232006
+ output.spinner('Completing', 0);
232007
+ }
232008
+ else if (event.type === 'checks-running') {
232009
+ output.spinner('Running Checks', 0);
232010
+ }
232011
+ else if (event.type === 'alias-assigned' ||
232012
+ event.type === 'checks-conclusion-failed') {
232013
+ output.stopSpinner();
232014
+ deployment = event.payload;
232015
+ break;
232016
+ }
232017
+ else if (event.type === 'canceled') {
232018
+ output.stopSpinner();
232019
+ output.print('The deployment has been canceled.\n');
232020
+ return 1;
232021
+ }
232022
+ else if (event.type === 'error') {
232023
+ output.stopSpinner();
232024
+ const now = new util_1.default({
232025
+ client,
232026
+ currentTeam: fromDeployment.team?.id,
232027
+ });
232028
+ const error = await now.handleDeploymentError(event.payload, {
232029
+ env: {},
232030
+ });
232031
+ throw error;
232032
+ }
232033
+ }
232034
+ }
232035
+ catch (err) {
232036
+ output.prettyError(err);
232037
+ process.exit(1);
232038
+ }
232039
+ }
232040
+ }
232041
+ return (0, print_deployment_status_1.printDeploymentStatus)(client, deployment, deployStamp, noWait);
232042
+ }
232043
+ catch (err) {
232044
+ output.prettyError(err);
232045
+ if ((0, error_utils_1.isErrnoException)(err) && err.code === 'ERR_INVALID_TEAM') {
232046
+ output.error(`Use ${chalk_1.default.bold('vc switch')} to change your current team`);
232047
+ }
232048
+ return 1;
232049
+ }
232050
+ };
232051
+
232052
+
231926
232053
  /***/ }),
231927
232054
 
231928
232055
  /***/ 5445:
@@ -232273,7 +232400,7 @@ exports.default = async (client) => {
232273
232400
  }
232274
232401
  return await (0, request_rollback_1.default)({
232275
232402
  client,
232276
- deployId: actionOrDeployId,
232403
+ deployIdOrUrl: actionOrDeployId,
232277
232404
  project,
232278
232405
  timeout,
232279
232406
  });
@@ -233449,6 +233576,9 @@ const main = async () => {
233449
233576
  case 'pull':
233450
233577
  func = __webpack_require__(65158).default;
233451
233578
  break;
233579
+ case 'redeploy':
233580
+ func = __webpack_require__(29281).default;
233581
+ break;
233452
233582
  case 'remove':
233453
233583
  func = __webpack_require__(5445).default;
233454
233584
  break;
@@ -233935,9 +234065,6 @@ const ARG_COMMON = {
233935
234065
  '-Q': '--global-config',
233936
234066
  '--api': String,
233937
234067
  '--cwd': String,
233938
- // Deprecated
233939
- '--platform-version': Number,
233940
- '-V': '--platform-version',
233941
234068
  };
233942
234069
  exports.default = () => ARG_COMMON;
233943
234070
 
@@ -236377,6 +236504,77 @@ async function generateCertForDeploy(client, contextName, deployURL) {
236377
236504
  exports.default = generateCertForDeploy;
236378
236505
 
236379
236506
 
236507
+ /***/ }),
236508
+
236509
+ /***/ 47662:
236510
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
236511
+
236512
+ "use strict";
236513
+
236514
+ var __importDefault = (this && this.__importDefault) || function (mod) {
236515
+ return (mod && mod.__esModule) ? mod : { "default": mod };
236516
+ };
236517
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
236518
+ exports.getDeploymentByIdOrURL = void 0;
236519
+ const chalk_1 = __importDefault(__webpack_require__(90877));
236520
+ const get_deployment_1 = __importDefault(__webpack_require__(84249));
236521
+ const get_team_by_id_1 = __importDefault(__webpack_require__(94949));
236522
+ const is_valid_name_1 = __webpack_require__(64476);
236523
+ /**
236524
+ * Renders feedback while retrieving a deployment, then validates the
236525
+ * deployment belongs to the current team.
236526
+ *
236527
+ * @param client - The CLI client instance.
236528
+ * @param contextName - The context/team name.
236529
+ * @param deployIdOrUrl - The deployment id or URL.
236530
+ * @returns The deployment info.
236531
+ */
236532
+ async function getDeploymentByIdOrURL({ client, contextName, deployIdOrUrl, }) {
236533
+ const { config, output } = client;
236534
+ if (!(0, is_valid_name_1.isValidName)(deployIdOrUrl)) {
236535
+ throw new Error(`The provided argument "${deployIdOrUrl}" is not a valid deployment ID or URL`);
236536
+ }
236537
+ let deployment;
236538
+ let team;
236539
+ try {
236540
+ output.spinner(`Fetching deployment "${deployIdOrUrl}" in ${chalk_1.default.bold(contextName)}…`);
236541
+ const [teamResult, deploymentResult] = await Promise.allSettled([
236542
+ config.currentTeam ? (0, get_team_by_id_1.default)(client, config.currentTeam) : undefined,
236543
+ (0, get_deployment_1.default)(client, contextName, deployIdOrUrl),
236544
+ ]);
236545
+ if (teamResult.status === 'rejected') {
236546
+ throw new Error(`Failed to retrieve team information: ${teamResult.reason}`);
236547
+ }
236548
+ if (deploymentResult.status === 'rejected') {
236549
+ throw new Error(deploymentResult.reason.message);
236550
+ }
236551
+ team = teamResult.value;
236552
+ deployment = deploymentResult.value;
236553
+ // re-render the spinner text because it goes so fast
236554
+ output.log(`Fetching deployment "${deployIdOrUrl}" in ${chalk_1.default.bold(contextName)}…`);
236555
+ }
236556
+ finally {
236557
+ output.stopSpinner();
236558
+ }
236559
+ if (deployment.team?.id) {
236560
+ if (!team || deployment.team.id !== team.id) {
236561
+ const err = new Error(team
236562
+ ? `Deployment doesn't belong to current team ${chalk_1.default.bold(contextName)}`
236563
+ : `Deployment belongs to a different team`);
236564
+ err.code = 'ERR_INVALID_TEAM';
236565
+ throw err;
236566
+ }
236567
+ }
236568
+ else if (team) {
236569
+ const err = new Error(`Deployment doesn't belong to current team ${chalk_1.default.bold(contextName)}`);
236570
+ err.code = 'ERR_INVALID_TEAM';
236571
+ throw err;
236572
+ }
236573
+ return deployment;
236574
+ }
236575
+ exports.getDeploymentByIdOrURL = getDeploymentByIdOrURL;
236576
+
236577
+
236380
236578
  /***/ }),
236381
236579
 
236382
236580
  /***/ 10559:
@@ -236614,6 +236812,83 @@ function parseTarget(output, targetArg, prodArg) {
236614
236812
  exports.default = parseTarget;
236615
236813
 
236616
236814
 
236815
+ /***/ }),
236816
+
236817
+ /***/ 27951:
236818
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
236819
+
236820
+ "use strict";
236821
+
236822
+ var __importDefault = (this && this.__importDefault) || function (mod) {
236823
+ return (mod && mod.__esModule) ? mod : { "default": mod };
236824
+ };
236825
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
236826
+ exports.printDeploymentStatus = void 0;
236827
+ const chalk_1 = __importDefault(__webpack_require__(90877));
236828
+ const get_preferred_preview_url_1 = __webpack_require__(62666);
236829
+ const is_deploying_1 = __webpack_require__(25307);
236830
+ const link_1 = __importDefault(__webpack_require__(39302));
236831
+ const emoji_1 = __webpack_require__(35172);
236832
+ async function printDeploymentStatus(client, { readyState, alias: aliasList, aliasError, target, indications, url: deploymentUrl, aliasWarning, }, deployStamp, noWait) {
236833
+ const { output } = client;
236834
+ indications = indications || [];
236835
+ const isProdDeployment = target === 'production';
236836
+ let isStillBuilding = false;
236837
+ if (noWait) {
236838
+ if ((0, is_deploying_1.isDeploying)(readyState)) {
236839
+ isStillBuilding = true;
236840
+ output.print((0, emoji_1.prependEmoji)('Note: Deployment is still processing...', (0, emoji_1.emoji)('notice')) + '\n');
236841
+ }
236842
+ }
236843
+ if (!isStillBuilding && readyState !== 'READY') {
236844
+ output.error(`Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error`);
236845
+ return 1;
236846
+ }
236847
+ if (aliasError) {
236848
+ output.warn(`Failed to assign aliases${aliasError.message ? `: ${aliasError.message}` : ''}`);
236849
+ }
236850
+ else {
236851
+ // print preview/production url
236852
+ let previewUrl;
236853
+ // if `noWait` is true, then use the deployment url, not an alias
236854
+ if (!noWait && Array.isArray(aliasList) && aliasList.length > 0) {
236855
+ const previewUrlInfo = await (0, get_preferred_preview_url_1.getPreferredPreviewURL)(client, aliasList);
236856
+ if (previewUrlInfo) {
236857
+ previewUrl = previewUrlInfo.previewUrl;
236858
+ }
236859
+ else {
236860
+ previewUrl = `https://${deploymentUrl}`;
236861
+ }
236862
+ }
236863
+ else {
236864
+ // fallback to deployment url
236865
+ previewUrl = `https://${deploymentUrl}`;
236866
+ }
236867
+ output.print((0, emoji_1.prependEmoji)(`${isProdDeployment ? 'Production' : 'Preview'}: ${chalk_1.default.bold(previewUrl)} ${deployStamp()}`, (0, emoji_1.emoji)('success')) + `\n`);
236868
+ }
236869
+ if (aliasWarning?.message) {
236870
+ indications.push({
236871
+ type: 'warning',
236872
+ payload: aliasWarning.message,
236873
+ link: aliasWarning.link,
236874
+ action: aliasWarning.action,
236875
+ });
236876
+ }
236877
+ const newline = '\n';
236878
+ for (let indication of indications) {
236879
+ const message = (0, emoji_1.prependEmoji)(chalk_1.default.dim(indication.payload), (0, emoji_1.emoji)(indication.type)) +
236880
+ newline;
236881
+ let link = '';
236882
+ if (indication.link)
236883
+ link =
236884
+ chalk_1.default.dim(`${indication.action || 'Learn More'}: ${(0, link_1.default)(indication.link)}`) + newline;
236885
+ output.print(message + link);
236886
+ }
236887
+ return 0;
236888
+ }
236889
+ exports.printDeploymentStatus = printDeploymentStatus;
236890
+
236891
+
236617
236892
  /***/ }),
236618
236893
 
236619
236894
  /***/ 54944:
@@ -242798,7 +243073,7 @@ const errors_ts_1 = __webpack_require__(39240);
242798
243073
  const map_cert_error_1 = __importDefault(__webpack_require__(72812));
242799
243074
  const to_host_1 = __importDefault(__webpack_require__(47914));
242800
243075
  /**
242801
- * Retrieves a v13 deployment.
243076
+ * Retrieves a deployment by id or URL.
242802
243077
  *
242803
243078
  * @param client - The Vercel CLI client instance.
242804
243079
  * @param contextName - The scope context/team name.
@@ -243626,7 +243901,7 @@ class Now extends events_1.default {
243626
243901
  // Legacy
243627
243902
  nowConfig: nowConfig = {},
243628
243903
  // Latest
243629
- name, project, prebuilt = false, rootDirectory, wantsPublic, meta, gitMetadata, regions, quiet = false, env, build, forceNew = false, withCache = false, target = null, deployStamp, projectSettings, skipAutoDetectionConfirmation, noWait, }, org, isSettingUpProject, archive, cwd) {
243904
+ name, project, prebuilt = false, rootDirectory, wantsPublic, meta, gitMetadata, regions, quiet = false, env, build, forceNew = false, withCache = false, target = null, deployStamp, projectSettings, skipAutoDetectionConfirmation, noWait, autoAssignCustomDomains, }, org, isSettingUpProject, archive, cwd) {
243630
243905
  let hashes = {};
243631
243906
  const uploadStamp = (0, stamp_1.default)();
243632
243907
  let requestBody = {
@@ -243642,6 +243917,7 @@ class Now extends events_1.default {
243642
243917
  target: target || undefined,
243643
243918
  projectSettings,
243644
243919
  source: 'cli',
243920
+ autoAssignCustomDomains,
243645
243921
  };
243646
243922
  // Ignore specific items from vercel.json
243647
243923
  delete requestBody.scope;
@@ -245514,6 +245790,7 @@ async function setupAndLink(client, path, { autoConfirm = false, forceDelete = f
245514
245790
  ...localConfigurationOverrides,
245515
245791
  sourceFilesOutsideRootDirectory,
245516
245792
  },
245793
+ autoAssignCustomDomains: true,
245517
245794
  };
245518
245795
  const deployment = await (0, create_deploy_1.default)(client, now, config.currentTeam || 'current user', [sourcePath], createArgs, org, true, path);
245519
245796
  if (!deployment ||
@@ -248100,83 +248377,54 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
248100
248377
  Object.defineProperty(exports, "__esModule", ({ value: true }));
248101
248378
  const chalk_1 = __importDefault(__webpack_require__(90877));
248102
248379
  const pkg_name_1 = __webpack_require__(79000);
248103
- const get_deployment_1 = __importDefault(__webpack_require__(84249));
248380
+ const get_deployment_by_id_or_url_1 = __webpack_require__(47662);
248104
248381
  const get_scope_1 = __importDefault(__webpack_require__(60324));
248105
- const get_team_by_id_1 = __importDefault(__webpack_require__(94949));
248106
- const is_valid_name_1 = __webpack_require__(64476);
248382
+ const error_utils_1 = __webpack_require__(39799);
248107
248383
  const ms_1 = __importDefault(__webpack_require__(21378));
248108
248384
  const status_1 = __importDefault(__webpack_require__(87181));
248109
248385
  /**
248110
248386
  * Requests a rollback and waits for it complete.
248111
248387
  * @param {Client} client - The Vercel client instance
248112
- * @param {string} deployId - The deployment name or id to rollback
248388
+ * @param {string} deployIdOrUrl - The deployment name or id to rollback
248113
248389
  * @param {Project} project - Project info instance
248114
248390
  * @param {string} [timeout] - Time to poll for succeeded/failed state
248115
248391
  * @returns {Promise<number>} Resolves an exit code; 0 on success
248116
248392
  */
248117
- async function requestRollback({ client, deployId, project, timeout, }) {
248118
- const { config, output } = client;
248393
+ async function requestRollback({ client, deployIdOrUrl, project, timeout, }) {
248394
+ const { output } = client;
248119
248395
  const { contextName } = await (0, get_scope_1.default)(client);
248120
- if (!(0, is_valid_name_1.isValidName)(deployId)) {
248121
- output.error(`The provided argument "${deployId}" is not a valid deployment or project`);
248122
- return 1;
248123
- }
248124
- let deployment;
248125
- let team;
248126
248396
  try {
248127
- output.spinner(`Fetching deployment "${deployId}" in ${chalk_1.default.bold(contextName)}…`);
248128
- const [teamResult, deploymentResult] = await Promise.allSettled([
248129
- config.currentTeam ? (0, get_team_by_id_1.default)(client, config.currentTeam) : undefined,
248130
- (0, get_deployment_1.default)(client, contextName, deployId),
248131
- ]);
248132
- if (teamResult.status === 'rejected') {
248133
- output.error(`Failed to retrieve team information: ${teamResult.reason}`);
248134
- return 1;
248135
- }
248136
- if (deploymentResult.status === 'rejected') {
248137
- output.error(deploymentResult.reason);
248138
- return 1;
248397
+ const deployment = await (0, get_deployment_by_id_or_url_1.getDeploymentByIdOrURL)({
248398
+ client,
248399
+ contextName,
248400
+ deployIdOrUrl,
248401
+ });
248402
+ // create the rollback
248403
+ await client.fetch(`/v9/projects/${project.id}/rollback/${deployment.id}`, {
248404
+ body: {},
248405
+ method: 'POST',
248406
+ });
248407
+ if (timeout !== undefined && (0, ms_1.default)(timeout) === 0) {
248408
+ output.log(`Successfully requested rollback of ${chalk_1.default.bold(project.name)} to ${deployment.url} (${deployment.id})`);
248409
+ output.log(`To check rollback status, run ${(0, pkg_name_1.getCommandName)('rollback')}.`);
248410
+ return 0;
248139
248411
  }
248140
- team = teamResult.value;
248141
- deployment = deploymentResult.value;
248142
- // re-render the spinner text because it goes so fast
248143
- output.log(`Fetching deployment "${deployId}" in ${chalk_1.default.bold(contextName)}…`);
248144
- }
248145
- finally {
248146
- output.stopSpinner();
248412
+ // check the status
248413
+ return await (0, status_1.default)({
248414
+ client,
248415
+ contextName,
248416
+ deployment,
248417
+ project,
248418
+ timeout,
248419
+ });
248147
248420
  }
248148
- if (deployment.team?.id) {
248149
- if (!team || deployment.team.id !== team.id) {
248150
- output.error(team
248151
- ? `Deployment doesn't belong to current team ${chalk_1.default.bold(contextName)}`
248152
- : `Deployment belongs to a different team`);
248421
+ catch (err) {
248422
+ output.prettyError(err);
248423
+ if ((0, error_utils_1.isErrnoException)(err) && err.code === 'ERR_INVALID_TEAM') {
248153
248424
  output.error(`Use ${chalk_1.default.bold('vc switch')} to change your current team`);
248154
- return 1;
248155
248425
  }
248156
- }
248157
- else if (team) {
248158
- output.error(`Deployment doesn't belong to current team ${chalk_1.default.bold(contextName)}`);
248159
- output.error(`Use ${chalk_1.default.bold('vc switch')} to change your current team`);
248160
248426
  return 1;
248161
248427
  }
248162
- // create the rollback
248163
- await client.fetch(`/v9/projects/${project.id}/rollback/${deployment.id}`, {
248164
- body: {},
248165
- method: 'POST',
248166
- });
248167
- if (timeout !== undefined && (0, ms_1.default)(timeout) === 0) {
248168
- output.log(`Successfully requested rollback of ${chalk_1.default.bold(project.name)} to ${deployment.url} (${deployment.id})`);
248169
- output.log(`To check rollback status, run ${(0, pkg_name_1.getCommandName)('rollback')}.`);
248170
- return 0;
248171
- }
248172
- // check the status
248173
- return await (0, status_1.default)({
248174
- client,
248175
- contextName,
248176
- deployment,
248177
- project,
248178
- timeout,
248179
- });
248180
248428
  }
248181
248429
  exports.default = requestRollback;
248182
248430
 
@@ -249207,7 +249455,7 @@ module.exports = JSON.parse("[[[0,44],\"disallowed_STD3_valid\"],[[45,46],\"vali
249207
249455
  /***/ ((module) => {
249208
249456
 
249209
249457
  "use strict";
249210
- module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.5.1\",\"main\":\"dist/index.js\",\"typings\":\"dist/index.d.ts\",\"homepage\":\"https://vercel.com\",\"license\":\"Apache-2.0\",\"files\":[\"dist\"],\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/client\"},\"scripts\":{\"build\":\"tsc\",\"test-e2e\":\"pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts\",\"test\":\"jest --env node --verbose --runInBand --bail\",\"test-unit\":\"pnpm test tests/unit.*test.*\"},\"engines\":{\"node\":\">= 14\"},\"devDependencies\":{\"@types/async-retry\":\"1.4.5\",\"@types/fs-extra\":\"7.0.0\",\"@types/jest\":\"27.4.1\",\"@types/minimatch\":\"3.0.5\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"14.18.33\",\"@types/node-fetch\":\"2.5.4\",\"@types/recursive-readdir\":\"2.2.0\",\"@types/tar-fs\":\"1.16.1\",\"typescript\":\"4.9.5\"},\"dependencies\":{\"@vercel/build-utils\":\"6.7.3\",\"@vercel/routing-utils\":\"2.2.1\",\"@zeit/fetch\":\"5.2.0\",\"async-retry\":\"1.2.3\",\"async-sema\":\"3.0.0\",\"fs-extra\":\"8.0.1\",\"ignore\":\"4.0.6\",\"minimatch\":\"5.0.1\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"querystring\":\"^0.2.0\",\"sleep-promise\":\"8.0.1\",\"tar-fs\":\"1.16.3\"}}");
249458
+ module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.0\",\"main\":\"dist/index.js\",\"typings\":\"dist/index.d.ts\",\"homepage\":\"https://vercel.com\",\"license\":\"Apache-2.0\",\"files\":[\"dist\"],\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/client\"},\"scripts\":{\"build\":\"tsc\",\"test-e2e\":\"pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts\",\"test\":\"jest --env node --verbose --runInBand --bail\",\"test-unit\":\"pnpm test tests/unit.*test.*\"},\"engines\":{\"node\":\">= 14\"},\"devDependencies\":{\"@types/async-retry\":\"1.4.5\",\"@types/fs-extra\":\"7.0.0\",\"@types/jest\":\"27.4.1\",\"@types/minimatch\":\"3.0.5\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"14.18.33\",\"@types/node-fetch\":\"2.5.4\",\"@types/recursive-readdir\":\"2.2.0\",\"@types/tar-fs\":\"1.16.1\",\"typescript\":\"4.9.5\"},\"dependencies\":{\"@vercel/build-utils\":\"6.7.3\",\"@vercel/routing-utils\":\"2.2.1\",\"@zeit/fetch\":\"5.2.0\",\"async-retry\":\"1.2.3\",\"async-sema\":\"3.0.0\",\"fs-extra\":\"8.0.1\",\"ignore\":\"4.0.6\",\"minimatch\":\"5.0.1\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"querystring\":\"^0.2.0\",\"sleep-promise\":\"8.0.1\",\"tar-fs\":\"1.16.3\"}}");
249211
249459
 
249212
249460
  /***/ }),
249213
249461
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "29.4.0",
3
+ "version": "30.0.0",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -75,10 +75,10 @@
75
75
  "@types/which": "3.0.0",
76
76
  "@types/write-json-file": "2.2.1",
77
77
  "@types/yauzl-promise": "2.1.0",
78
- "@vercel-internals/constants": "*",
79
- "@vercel-internals/get-package-json": "*",
80
- "@vercel-internals/types": "*",
81
- "@vercel/client": "12.5.1",
78
+ "@vercel-internals/constants": "1.0.0",
79
+ "@vercel-internals/get-package-json": "1.0.0",
80
+ "@vercel-internals/types": "1.0.0",
81
+ "@vercel/client": "12.6.0",
82
82
  "@vercel/error-utils": "1.0.10",
83
83
  "@vercel/frameworks": "1.4.2",
84
84
  "@vercel/fs-detectors": "3.9.3",