vercel 31.0.1 → 31.0.3

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/index.js CHANGED
@@ -9,12 +9,15 @@ module.exports =
9
9
  "use strict";
10
10
 
11
11
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12
- exports.PROJECT_ENV_TARGET = void 0;
12
+ exports.TITLE = exports.NAME = exports.LOGO = exports.PROJECT_ENV_TARGET = void 0;
13
13
  exports.PROJECT_ENV_TARGET = [
14
14
  'production',
15
15
  'preview',
16
16
  'development',
17
17
  ];
18
+ exports.LOGO = '▲';
19
+ exports.NAME = 'vercel';
20
+ exports.TITLE = 'Vercel';
18
21
  //# sourceMappingURL=index.js.map
19
22
 
20
23
  /***/ }),
@@ -192316,7 +192319,7 @@ module.exports = {
192316
192319
 
192317
192320
  /***/ }),
192318
192321
 
192319
- /***/ 18505:
192322
+ /***/ 9429:
192320
192323
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
192321
192324
 
192322
192325
  "use strict";
@@ -192324,10 +192327,14 @@ module.exports = {
192324
192327
  const supportsColor = __webpack_require__(96328);
192325
192328
  const hasFlag = __webpack_require__(72035);
192326
192329
 
192330
+ /**
192331
+ @param {string} versionString
192332
+ @returns {{ major: number, minor: number, patch: number }}
192333
+ */
192327
192334
  function parseVersion(versionString) {
192328
192335
  if (/^\d{3,4}$/.test(versionString)) {
192329
192336
  // Env var doesn't always use dots. example: 4601 => 46.1.0
192330
- const m = /(\d{1,2})(\d{2})/.exec(versionString);
192337
+ const m = /(\d{1,2})(\d{2})/.exec(versionString) || [];
192331
192338
  return {
192332
192339
  major: 0,
192333
192340
  minor: parseInt(m[1], 10),
@@ -192343,11 +192350,23 @@ function parseVersion(versionString) {
192343
192350
  };
192344
192351
  }
192345
192352
 
192353
+ /**
192354
+ @param {{ isTTY?: boolean | undefined }} stream
192355
+ @returns {boolean}
192356
+ */
192346
192357
  function supportsHyperlink(stream) {
192347
- const {env} = process;
192358
+ const {
192359
+ CI,
192360
+ FORCE_HYPERLINK,
192361
+ NETLIFY,
192362
+ TEAMCITY_VERSION,
192363
+ TERM_PROGRAM,
192364
+ TERM_PROGRAM_VERSION,
192365
+ VTE_VERSION
192366
+ } = process.env;
192348
192367
 
192349
- if ('FORCE_HYPERLINK' in env) {
192350
- return !(env.FORCE_HYPERLINK.length > 0 && parseInt(env.FORCE_HYPERLINK, 10) === 0);
192368
+ if (FORCE_HYPERLINK) {
192369
+ return !(FORCE_HYPERLINK.length > 0 && parseInt(FORCE_HYPERLINK, 10) === 0);
192351
192370
  }
192352
192371
 
192353
192372
  if (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {
@@ -192358,6 +192377,11 @@ function supportsHyperlink(stream) {
192358
192377
  return true;
192359
192378
  }
192360
192379
 
192380
+ // Netlify does not run a TTY, it does not need `supportsColor` check
192381
+ if (NETLIFY) {
192382
+ return true;
192383
+ }
192384
+
192361
192385
  // If they specify no colors, they probably don't want hyperlinks.
192362
192386
  if (!supportsColor.supportsColor(stream)) {
192363
192387
  return false;
@@ -192371,39 +192395,40 @@ function supportsHyperlink(stream) {
192371
192395
  return false;
192372
192396
  }
192373
192397
 
192374
- if ('NETLIFY' in env) {
192375
- return true;
192376
- }
192377
-
192378
- if ('CI' in env) {
192398
+ if (CI) {
192379
192399
  return false;
192380
192400
  }
192381
192401
 
192382
- if ('TEAMCITY_VERSION' in env) {
192402
+ if (TEAMCITY_VERSION) {
192383
192403
  return false;
192384
192404
  }
192385
192405
 
192386
- if ('TERM_PROGRAM' in env) {
192387
- const version = parseVersion(env.TERM_PROGRAM_VERSION);
192406
+ if (TERM_PROGRAM) {
192407
+ const version = parseVersion(TERM_PROGRAM_VERSION || '');
192388
192408
 
192389
- switch (env.TERM_PROGRAM) {
192409
+ switch (TERM_PROGRAM) {
192390
192410
  case 'iTerm.app':
192391
192411
  if (version.major === 3) {
192392
192412
  return version.minor >= 1;
192393
192413
  }
192394
192414
 
192395
192415
  return version.major > 3;
192416
+ case 'WezTerm':
192417
+ return version.major >= 20200620;
192418
+ case 'vscode':
192419
+ // eslint-disable-next-line no-mixed-operators
192420
+ return version.major > 1 || version.major === 1 && version.minor >= 72;
192396
192421
  // No default
192397
192422
  }
192398
192423
  }
192399
192424
 
192400
- if ('VTE_VERSION' in env) {
192425
+ if (VTE_VERSION) {
192401
192426
  // 0.50.0 was supposed to support hyperlinks, but throws a segfault
192402
- if (env.VTE_VERSION === '0.50.0') {
192427
+ if (VTE_VERSION === '0.50.0') {
192403
192428
  return false;
192404
192429
  }
192405
192430
 
192406
- const version = parseVersion(env.VTE_VERSION);
192431
+ const version = parseVersion(VTE_VERSION);
192407
192432
  return version.major > 0 || version.minor >= 50;
192408
192433
  }
192409
192434
 
@@ -222549,7 +222574,7 @@ exports.detectFileSystemAPI = detectFileSystemAPI;
222549
222574
  "use strict";
222550
222575
 
222551
222576
  Object.defineProperty(exports, "__esModule", ({ value: true }));
222552
- exports.detectFrameworkVersion = exports.detectFrameworkRecord = exports.detectFramework = void 0;
222577
+ exports.detectFrameworkVersion = exports.detectFrameworkRecord = exports.detectFrameworks = exports.detectFramework = void 0;
222553
222578
  const child_process_1 = __webpack_require__(63129);
222554
222579
  async function matches(fs, framework) {
222555
222580
  const { detectors } = framework;
@@ -222639,6 +222664,19 @@ async function detectFramework({ fs, frameworkList, }) {
222639
222664
  return result.find(res => res !== null) ?? null;
222640
222665
  }
222641
222666
  exports.detectFramework = detectFramework;
222667
+ /**
222668
+ * Detects all matching Frameworks based on the given virtual filesystem.
222669
+ */
222670
+ async function detectFrameworks({ fs, frameworkList, }) {
222671
+ const result = await Promise.all(frameworkList.map(async (frameworkMatch) => {
222672
+ if (await matches(fs, frameworkMatch)) {
222673
+ return frameworkMatch;
222674
+ }
222675
+ return null;
222676
+ }));
222677
+ return result.filter(res => res !== null);
222678
+ }
222679
+ exports.detectFrameworks = detectFrameworks;
222642
222680
  // Note: Does not currently support a `frameworkList` of monorepo managers
222643
222681
  async function detectFrameworkRecord({ fs, frameworkList, }) {
222644
222682
  const result = await Promise.all(frameworkList.map(async (frameworkMatch) => {
@@ -222944,7 +222982,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
222944
222982
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
222945
222983
  };
222946
222984
  Object.defineProperty(exports, "__esModule", ({ value: true }));
222947
- exports.packageManagers = exports.isStaticRuntime = exports.isOfficialRuntime = exports.monorepoManagers = exports.getWorkspacePackagePaths = exports.getWorkspaces = exports.workspaceManagers = exports.LocalFileSystemDetector = exports.DetectorFilesystem = exports.getProjectPaths = exports.detectFrameworkVersion = exports.detectFrameworkRecord = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = void 0;
222985
+ exports.packageManagers = exports.isStaticRuntime = exports.isOfficialRuntime = exports.monorepoManagers = exports.getWorkspacePackagePaths = exports.getWorkspaces = exports.workspaceManagers = exports.LocalFileSystemDetector = exports.DetectorFilesystem = exports.getProjectPaths = exports.detectFrameworkVersion = exports.detectFrameworkRecord = exports.detectFrameworks = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = void 0;
222948
222986
  var detect_builders_1 = __webpack_require__(91906);
222949
222987
  Object.defineProperty(exports, "detectBuilders", ({ enumerable: true, get: function () { return detect_builders_1.detectBuilders; } }));
222950
222988
  Object.defineProperty(exports, "detectOutputDirectory", ({ enumerable: true, get: function () { return detect_builders_1.detectOutputDirectory; } }));
@@ -222954,6 +222992,7 @@ var detect_file_system_api_1 = __webpack_require__(49587);
222954
222992
  Object.defineProperty(exports, "detectFileSystemAPI", ({ enumerable: true, get: function () { return detect_file_system_api_1.detectFileSystemAPI; } }));
222955
222993
  var detect_framework_1 = __webpack_require__(7244);
222956
222994
  Object.defineProperty(exports, "detectFramework", ({ enumerable: true, get: function () { return detect_framework_1.detectFramework; } }));
222995
+ Object.defineProperty(exports, "detectFrameworks", ({ enumerable: true, get: function () { return detect_framework_1.detectFrameworks; } }));
222957
222996
  Object.defineProperty(exports, "detectFrameworkRecord", ({ enumerable: true, get: function () { return detect_framework_1.detectFrameworkRecord; } }));
222958
222997
  Object.defineProperty(exports, "detectFrameworkVersion", ({ enumerable: true, get: function () { return detect_framework_1.detectFrameworkVersion; } }));
222959
222998
  var get_project_paths_1 = __webpack_require__(50330);
@@ -226853,58 +226892,186 @@ exports.default = rm;
226853
226892
 
226854
226893
  /***/ }),
226855
226894
 
226856
- /***/ 89097:
226857
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
226895
+ /***/ 28831:
226896
+ /***/ ((__unused_webpack_module, exports) => {
226858
226897
 
226859
226898
  "use strict";
226860
226899
 
226861
- var __importDefault = (this && this.__importDefault) || function (mod) {
226862
- return (mod && mod.__esModule) ? mod : { "default": mod };
226863
- };
226864
226900
  Object.defineProperty(exports, "__esModule", ({ value: true }));
226865
- exports.help = void 0;
226866
- const chalk_1 = __importDefault(__webpack_require__(90877));
226867
- const logo_1 = __importDefault(__webpack_require__(66669));
226868
- const pkg_name_1 = __webpack_require__(79000);
226869
- const help = () => {
226870
- return `
226871
- ${chalk_1.default.bold(`${logo_1.default} ${(0, pkg_name_1.getPkgName)()} [deploy]`)} [path-to-project] [options]
226872
-
226873
- --prod Create a production deployment
226874
- -p, --public Deployment is public (${chalk_1.default.dim('`/_src`')} is exposed)
226875
- -e, --env Include an env var during run time (e.g.: ${chalk_1.default.dim('`-e KEY=value`')}). Can appear many times.
226876
- -b, --build-env Similar to ${chalk_1.default.dim('`--env`')} but for build time only.
226877
- -m, --meta Add metadata for the deployment (e.g.: ${chalk_1.default.dim('`-m KEY=value`')}). Can appear many times.
226878
- --no-wait Don't wait for the deployment to finish
226879
- -f, --force Force a new deployment even if nothing has changed
226880
- --with-cache Retain build cache when using "--force"
226881
- --regions Set default regions to enable the deployment on
226882
-
226883
- ${chalk_1.default.dim('Examples:')}
226884
-
226885
- ${chalk_1.default.gray('')} Deploy the current directory
226886
-
226887
- ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()}`)}
226888
-
226889
- ${chalk_1.default.gray('–')} Deploy a custom path
226890
-
226891
- ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} /usr/src/project`)}
226892
-
226893
- ${chalk_1.default.gray('')} Deploy with Environment Variables
226894
-
226895
- ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} -e NODE_ENV=production`)}
226896
-
226897
- ${chalk_1.default.gray('–')} Deploy with prebuilt outputs
226898
-
226899
- ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} build`)}
226900
- ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} deploy --prebuilt`)}
226901
-
226902
- ${chalk_1.default.gray('')} Write Deployment URL to a file
226903
-
226904
- ${chalk_1.default.cyan(`$ ${(0, pkg_name_1.getPkgName)()} > deployment-url.txt`)}
226905
- `;
226901
+ exports.deployCommand = void 0;
226902
+ exports.deployCommand = {
226903
+ name: 'deploy',
226904
+ description: 'Deploy your project to Vercel. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`).',
226905
+ arguments: [
226906
+ {
226907
+ name: 'project-path',
226908
+ required: false,
226909
+ },
226910
+ ],
226911
+ options: [
226912
+ {
226913
+ name: 'force',
226914
+ shorthand: 'f',
226915
+ type: 'boolean',
226916
+ deprecated: false,
226917
+ description: 'Force a new deployment even if nothing has changed',
226918
+ multi: false,
226919
+ },
226920
+ {
226921
+ name: 'with-cache',
226922
+ shorthand: null,
226923
+ type: 'boolean',
226924
+ deprecated: false,
226925
+ description: 'Retain build cache when using "--force"',
226926
+ multi: false,
226927
+ },
226928
+ {
226929
+ name: 'public',
226930
+ shorthand: 'p',
226931
+ type: 'boolean',
226932
+ deprecated: false,
226933
+ description: 'Deployment is public (`/_src`) is exposed)',
226934
+ multi: false,
226935
+ },
226936
+ {
226937
+ name: 'env',
226938
+ shorthand: 'e',
226939
+ type: 'string',
226940
+ argument: 'key=value',
226941
+ deprecated: false,
226942
+ multi: true,
226943
+ description: 'Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)',
226944
+ },
226945
+ {
226946
+ name: 'build-env',
226947
+ shorthand: 'b',
226948
+ type: 'string',
226949
+ argument: 'key=value',
226950
+ deprecated: false,
226951
+ multi: true,
226952
+ description: 'Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)',
226953
+ },
226954
+ {
226955
+ name: 'meta',
226956
+ shorthand: 'm',
226957
+ type: 'string',
226958
+ argument: 'key=value',
226959
+ deprecated: false,
226960
+ multi: true,
226961
+ description: 'Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)',
226962
+ },
226963
+ {
226964
+ name: 'regions',
226965
+ shorthand: null,
226966
+ type: 'string',
226967
+ deprecated: false,
226968
+ description: 'Set default regions to enable the deployment on',
226969
+ multi: false,
226970
+ },
226971
+ {
226972
+ name: 'prebuilt',
226973
+ shorthand: null,
226974
+ type: 'boolean',
226975
+ deprecated: false,
226976
+ description: 'Use in combination with `vc build`. Deploy an existing build',
226977
+ multi: false,
226978
+ },
226979
+ {
226980
+ name: 'prod',
226981
+ shorthand: null,
226982
+ type: 'boolean',
226983
+ deprecated: false,
226984
+ description: 'Create a production deployment',
226985
+ multi: false,
226986
+ },
226987
+ {
226988
+ name: 'archive',
226989
+ shorthand: null,
226990
+ type: 'string',
226991
+ deprecated: false,
226992
+ description: 'Compress the deployment code into a file before uploading it',
226993
+ multi: false,
226994
+ },
226995
+ {
226996
+ name: 'no-wait',
226997
+ shorthand: null,
226998
+ type: 'boolean',
226999
+ deprecated: false,
227000
+ description: "Don't wait for the deployment to finish",
227001
+ multi: false,
227002
+ },
227003
+ {
227004
+ name: 'skip-domain',
227005
+ shorthand: null,
227006
+ type: 'boolean',
227007
+ deprecated: false,
227008
+ description: undefined,
227009
+ multi: false,
227010
+ },
227011
+ {
227012
+ name: 'yes',
227013
+ shorthand: 'y',
227014
+ type: 'boolean',
227015
+ deprecated: false,
227016
+ description: 'Use default options to skip all prompts',
227017
+ multi: false,
227018
+ },
227019
+ {
227020
+ name: 'name',
227021
+ shorthand: 'n',
227022
+ type: 'string',
227023
+ deprecated: true,
227024
+ description: 'Provide a Vercel Project name',
227025
+ multi: false,
227026
+ },
227027
+ {
227028
+ name: 'no-clipboard',
227029
+ shorthand: null,
227030
+ type: 'boolean',
227031
+ deprecated: true,
227032
+ description: 'Do not copy deployment URL to clipboard',
227033
+ multi: false,
227034
+ },
227035
+ {
227036
+ name: 'target',
227037
+ shorthand: null,
227038
+ type: 'string',
227039
+ deprecated: true,
227040
+ description: 'Specify the target deployment environment',
227041
+ multi: false,
227042
+ },
227043
+ {
227044
+ name: 'confirm',
227045
+ shorthand: 'c',
227046
+ type: 'boolean',
227047
+ deprecated: true,
227048
+ description: 'Use default options to skip all prompts',
227049
+ multi: false,
227050
+ },
227051
+ ],
227052
+ examples: [
227053
+ {
227054
+ name: 'Deploy the current directory',
227055
+ value: 'vercel',
227056
+ },
227057
+ {
227058
+ name: 'Deploy a custom path',
227059
+ value: 'vercel /usr/src/project',
227060
+ },
227061
+ {
227062
+ name: 'Deploy with run-time Environment Variables',
227063
+ value: 'vercel -e NODE_ENV=production',
227064
+ },
227065
+ {
227066
+ name: 'Deploy with prebuilt outputs',
227067
+ value: ['vercel build', 'vercel deploy --prebuilt'],
227068
+ },
227069
+ {
227070
+ name: 'Write Deployment URL to a file',
227071
+ value: 'vercel > deployment-url.txt',
227072
+ },
227073
+ ],
226906
227074
  };
226907
- exports.help = help;
226908
227075
 
226909
227076
 
226910
227077
  /***/ }),
@@ -226973,7 +227140,6 @@ const emoji_1 = __webpack_require__(35172);
226973
227140
  const input_root_directory_1 = __webpack_require__(70738);
226974
227141
  const validate_paths_1 = __importStar(__webpack_require__(33922));
226975
227142
  const pkg_name_1 = __webpack_require__(79000);
226976
- const args_1 = __webpack_require__(89097);
226977
227143
  const get_deployment_checks_1 = __webpack_require__(10559);
226978
227144
  const parse_target_1 = __importDefault(__webpack_require__(43667));
226979
227145
  const get_prebuilt_json_1 = __importDefault(__webpack_require__(80282));
@@ -226983,40 +227149,26 @@ const parse_env_1 = __webpack_require__(59818);
226983
227149
  const error_utils_1 = __webpack_require__(39799);
226984
227150
  const project_settings_1 = __webpack_require__(61440);
226985
227151
  const print_deployment_status_1 = __webpack_require__(27951);
227152
+ const help_1 = __webpack_require__(58219);
227153
+ const command_1 = __webpack_require__(28831);
226986
227154
  exports.default = async (client) => {
226987
227155
  const { output } = client;
226988
227156
  let argv = null;
227157
+ const argOptions = {};
227158
+ for (const option of command_1.deployCommand.options) {
227159
+ argOptions[`--${option.name}`] =
227160
+ option.type === 'boolean' ? Boolean : String;
227161
+ if (option.shorthand) {
227162
+ argOptions[`-${option.shorthand}`] = `--${option.name}`;
227163
+ }
227164
+ if (option.name === 'env' ||
227165
+ option.name === 'build-env' ||
227166
+ option.name === 'meta') {
227167
+ argOptions[`--${option.name}`] = [String];
227168
+ }
227169
+ }
226989
227170
  try {
226990
- argv = (0, get_args_1.default)(client.argv.slice(2), {
226991
- '--force': Boolean,
226992
- '--with-cache': Boolean,
226993
- '--public': Boolean,
226994
- '--env': [String],
226995
- '--build-env': [String],
226996
- '--meta': [String],
226997
- // This is not an array in favor of matching
226998
- // the config property name.
226999
- '--regions': String,
227000
- '--prebuilt': Boolean,
227001
- '--prod': Boolean,
227002
- '--archive': String,
227003
- '--no-wait': Boolean,
227004
- '--skip-domain': Boolean,
227005
- '--yes': Boolean,
227006
- '-f': '--force',
227007
- '-p': '--public',
227008
- '-e': '--env',
227009
- '-b': '--build-env',
227010
- '-m': '--meta',
227011
- '-y': '--yes',
227012
- // deprecated
227013
- '--name': String,
227014
- '-n': '--name',
227015
- '--no-clipboard': Boolean,
227016
- '--target': String,
227017
- '--confirm': Boolean,
227018
- '-c': '--confirm',
227019
- });
227171
+ argv = (0, get_args_1.default)(client.argv.slice(2), argOptions);
227020
227172
  if ('--confirm' in argv) {
227021
227173
  output.warn('`--confirm` is deprecated, please use `--yes` instead');
227022
227174
  argv['--yes'] = argv['--confirm'];
@@ -227027,7 +227179,7 @@ exports.default = async (client) => {
227027
227179
  return 1;
227028
227180
  }
227029
227181
  if (argv['--help']) {
227030
- output.print((0, args_1.help)());
227182
+ output.print((0, help_1.help)(command_1.deployCommand, { columns: client.stderr.columns }));
227031
227183
  return 2;
227032
227184
  }
227033
227185
  if (argv._[0] === 'deploy') {
@@ -230094,6 +230246,198 @@ async function main(client) {
230094
230246
  exports.default = main;
230095
230247
 
230096
230248
 
230249
+ /***/ }),
230250
+
230251
+ /***/ 58219:
230252
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
230253
+
230254
+ "use strict";
230255
+
230256
+ var __importDefault = (this && this.__importDefault) || function (mod) {
230257
+ return (mod && mod.__esModule) ? mod : { "default": mod };
230258
+ };
230259
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
230260
+ exports.help = exports.buildHelpOutput = exports.buildCommandExampleLines = exports.buildCommandOptionLines = exports.buildCommandSynopsisLine = exports.outputArrayToString = exports.lineToString = exports.calcLineLength = void 0;
230261
+ const chalk_1 = __importDefault(__webpack_require__(90877));
230262
+ const strip_ansi_1 = __importDefault(__webpack_require__(66884));
230263
+ const constants_1 = __webpack_require__(98551);
230264
+ const INDENT = ' '.repeat(2);
230265
+ const NEWLINE = '\n';
230266
+ function calcLineLength(line) {
230267
+ return (0, strip_ansi_1.default)(lineToString(line)).length;
230268
+ }
230269
+ exports.calcLineLength = calcLineLength;
230270
+ // Insert spaces in between non-whitespace items only
230271
+ function lineToString(line) {
230272
+ let string = '';
230273
+ for (let i = 0; i < line.length; i++) {
230274
+ if (i === line.length - 1) {
230275
+ string += line[i];
230276
+ }
230277
+ else {
230278
+ const curr = line[i];
230279
+ const next = line[i + 1];
230280
+ string += curr;
230281
+ if (curr.trim() !== '' && next.trim() !== '') {
230282
+ string += ' ';
230283
+ }
230284
+ }
230285
+ }
230286
+ return string;
230287
+ }
230288
+ exports.lineToString = lineToString;
230289
+ function outputArrayToString(outputArray) {
230290
+ return outputArray.join(NEWLINE);
230291
+ }
230292
+ exports.outputArrayToString = outputArrayToString;
230293
+ /**
230294
+ * Example: `▲ vercel deploy [path] [options]`
230295
+ * @param command
230296
+ * @returns
230297
+ */
230298
+ function buildCommandSynopsisLine(command) {
230299
+ const line = [constants_1.LOGO, chalk_1.default.bold(constants_1.NAME), chalk_1.default.bold(command.name)];
230300
+ if (command.arguments.length > 0) {
230301
+ for (const argument of command.arguments) {
230302
+ line.push(argument.required ? argument.name : `[${argument.name}]`);
230303
+ }
230304
+ }
230305
+ if (command.options.length > 0) {
230306
+ line.push('[options]');
230307
+ }
230308
+ return lineToString(line);
230309
+ }
230310
+ exports.buildCommandSynopsisLine = buildCommandSynopsisLine;
230311
+ function buildCommandOptionLines(command, options) {
230312
+ // Filter out deprecated and intentionally undocumented options
230313
+ command.options = command.options.filter(option => !option.deprecated && option.description !== undefined);
230314
+ // Initialize output array with header and empty line
230315
+ const outputArray = [chalk_1.default.dim(`Options:`), ''];
230316
+ // Start building option lines
230317
+ const optionLines = [];
230318
+ // Sort command options alphabetically
230319
+ command.options.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
230320
+ // Keep track of longest "start" of an option line to determine description spacing
230321
+ let maxLineStartLength = 0;
230322
+ // Iterate over options and create the "start" of each option (e.g. ` -b, --build-env <key=value>`)
230323
+ for (const option of command.options) {
230324
+ const startLine = [INDENT];
230325
+ if (option.shorthand) {
230326
+ startLine.push(`-${option.shorthand},`);
230327
+ }
230328
+ startLine.push(`--${option.name}`);
230329
+ if (option.argument) {
230330
+ startLine.push(`<${option.argument}>`);
230331
+ }
230332
+ // the length includes the INDENT
230333
+ const lineLength = calcLineLength(startLine);
230334
+ maxLineStartLength = Math.max(lineLength, maxLineStartLength);
230335
+ optionLines.push(startLine);
230336
+ }
230337
+ /*
230338
+ * Iterate over in-progress option lines to add space-filler and description
230339
+ * For Example:
230340
+ * | --archive My description starts here.
230341
+ * |
230342
+ * | -b, --build-env <key=value> Start of description here then
230343
+ * | it wraps here.
230344
+ * |
230345
+ * | -e, --env <key=value> My description is short.
230346
+ *
230347
+ * Breaking down option lines:
230348
+ * | -b, --build-env <key=value> Start of description here then
230349
+ * |[][ ][][ ]
230350
+ * |↑ ↑ ↑ ↑
230351
+ * |1 2 3 4
230352
+ * | it wraps here.
230353
+ * |[][ ][ ]
230354
+ * |↑ ↑ ↑
230355
+ * |5 6 7
230356
+ * | 1, 5 = indent
230357
+ * | 2 = start
230358
+ * | 3, 6 = space-filler
230359
+ * | 4, 7 = description
230360
+ */
230361
+ for (let i = 0; i < optionLines.length; i++) {
230362
+ const optionLine = optionLines[i];
230363
+ const option = command.options[i];
230364
+ // Add only 2 spaces to the longest line, and then make all shorter lines the same length.
230365
+ optionLine.push(' '.repeat(2 + (maxLineStartLength - calcLineLength(optionLine))));
230366
+ // Descriptions may be longer than max line length. Wrap them to the same column as the first description line
230367
+ const lines = [optionLine];
230368
+ if (option.description) {
230369
+ for (const descriptionWord of option.description.split(' ')) {
230370
+ // insert a new line when the next word would match or exceed the maximum line length
230371
+ if (calcLineLength(lines[lines.length - 1]) +
230372
+ (0, strip_ansi_1.default)(descriptionWord).length >=
230373
+ options.columns) {
230374
+ // initialize the new line with the necessary whitespace. The INDENT is apart of `maxLineStartLength`
230375
+ lines.push([' '.repeat(maxLineStartLength + 2)]);
230376
+ }
230377
+ // insert the word to the current last line
230378
+ lines[lines.length - 1].push(descriptionWord);
230379
+ }
230380
+ }
230381
+ // for every line, transform into a string and push it to the output
230382
+ for (const line of lines) {
230383
+ outputArray.push(lineToString(line));
230384
+ }
230385
+ // add an empty line in between in each option block for readability (skip the last block)
230386
+ if (i !== optionLines.length - 1)
230387
+ outputArray.push('');
230388
+ }
230389
+ // return the entire list of options as a single string after delete the last '\n' added to the option list
230390
+ return outputArrayToString(outputArray);
230391
+ }
230392
+ exports.buildCommandOptionLines = buildCommandOptionLines;
230393
+ function buildCommandExampleLines(command) {
230394
+ const outputArray = [chalk_1.default.dim(`Examples:`), ''];
230395
+ for (const example of command.examples) {
230396
+ const nameLine = [INDENT];
230397
+ nameLine.push(chalk_1.default.gray('-'));
230398
+ nameLine.push(example.name);
230399
+ outputArray.push(lineToString(nameLine));
230400
+ outputArray.push('');
230401
+ const buildValueLine = (value) => {
230402
+ return lineToString([INDENT, INDENT, chalk_1.default.cyan(`$ ${value}`)]);
230403
+ };
230404
+ if (Array.isArray(example.value)) {
230405
+ for (const line of example.value) {
230406
+ outputArray.push(buildValueLine(line));
230407
+ }
230408
+ }
230409
+ else {
230410
+ outputArray.push(buildValueLine(example.value));
230411
+ }
230412
+ outputArray.push('');
230413
+ }
230414
+ // delete the last newline added after examples iteration
230415
+ outputArray.splice(-1);
230416
+ return outputArrayToString(outputArray);
230417
+ }
230418
+ exports.buildCommandExampleLines = buildCommandExampleLines;
230419
+ function buildHelpOutput(command, options) {
230420
+ const outputArray = [
230421
+ buildCommandSynopsisLine(command),
230422
+ '',
230423
+ command.description,
230424
+ '',
230425
+ buildCommandOptionLines(command, options),
230426
+ '',
230427
+ buildCommandExampleLines(command),
230428
+ '',
230429
+ ];
230430
+ return outputArrayToString(outputArray);
230431
+ }
230432
+ exports.buildHelpOutput = buildHelpOutput;
230433
+ function help(command, options) {
230434
+ return buildHelpOutput(command, {
230435
+ columns: options.columns ?? 80,
230436
+ });
230437
+ }
230438
+ exports.help = help;
230439
+
230440
+
230097
230441
  /***/ }),
230098
230442
 
230099
230443
  /***/ 48208:
@@ -230673,7 +231017,7 @@ async function main(client) {
230673
231017
  }
230674
231018
  if (argv['--repo']) {
230675
231019
  client.output.warn(`The ${(0, cmd_1.default)('--repo')} flag is in alpha, please report issues`);
230676
- await (0, repo_1.ensureRepoLink)(client, cwd, yes);
231020
+ await (0, repo_1.ensureRepoLink)(client, cwd, { yes, overwrite: true });
230677
231021
  }
230678
231022
  else {
230679
231023
  const link = await (0, ensure_link_1.ensureLink)('link', client, cwd, {
@@ -231756,6 +232100,10 @@ async function rm(client, args) {
231756
232100
  client.output.error('No such project exists');
231757
232101
  return 1;
231758
232102
  }
232103
+ if ((0, errors_ts_1.isAPIError)(err) && err.status === 403) {
232104
+ client.output.error(err.message);
232105
+ return 1;
232106
+ }
231759
232107
  }
231760
232108
  const elapsed = (0, ms_1.default)(Date.now() - start);
231761
232109
  client.output.log(`${chalk_1.default.cyan('Success!')} Project ${chalk_1.default.bold(name)} removed ${chalk_1.default.gray(`[${elapsed}]`)}`);
@@ -232328,7 +232676,7 @@ exports.default = async (client) => {
232328
232676
  action: 'redeploy',
232329
232677
  },
232330
232678
  name: fromDeployment.name,
232331
- target: fromDeployment.target || 'production',
232679
+ target: fromDeployment.target ?? undefined,
232332
232680
  },
232333
232681
  method: 'POST',
232334
232682
  });
@@ -236512,7 +236860,8 @@ class Client extends events_1.EventEmitter {
236512
236860
  (0, print_indications_1.default)(this, res);
236513
236861
  if (!res.ok) {
236514
236862
  const error = await (0, response_error_1.default)(res);
236515
- if (isSAMLError(error)) {
236863
+ // we should force reauth only if error has a teamId
236864
+ if (isSAMLError(error) && error.teamId) {
236516
236865
  try {
236517
236866
  // A SAML error means the token is expired, or is not
236518
236867
  // designated for the requested team, so the user needs
@@ -236863,8 +237212,8 @@ exports.default = readConfig;
236863
237212
  Object.defineProperty(exports, "__esModule", ({ value: true }));
236864
237213
  exports.SENTRY_DSN = exports.GA_TRACKING_ID = void 0;
236865
237214
  // This file is auto-generated
236866
- exports.GA_TRACKING_ID = undefined;
236867
- exports.SENTRY_DSN = undefined;
237215
+ exports.GA_TRACKING_ID = "UA-117491914-3";
237216
+ exports.SENTRY_DSN = "https://26a24e59ba954011919a524b341b6ab5@sentry.io/1323225";
236868
237217
 
236869
237218
 
236870
237219
  /***/ }),
@@ -237694,6 +238043,9 @@ async function processDeployment({ org, cwd, projectName, isSettingUpProject, ar
237694
238043
  if (error.code === 'missing_project_settings') {
237695
238044
  return error;
237696
238045
  }
238046
+ if (error.code === 'forbidden') {
238047
+ return error;
238048
+ }
237697
238049
  throw error;
237698
238050
  }
237699
238051
  // Handle alias-assigned event
@@ -244413,6 +244765,21 @@ function printRemoteUrls(output, remoteUrls) {
244413
244765
  exports.printRemoteUrls = printRemoteUrls;
244414
244766
 
244415
244767
 
244768
+ /***/ }),
244769
+
244770
+ /***/ 83744:
244771
+ /***/ ((__unused_webpack_module, exports) => {
244772
+
244773
+ "use strict";
244774
+
244775
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
244776
+ exports.repoInfoToUrl = void 0;
244777
+ function repoInfoToUrl(info) {
244778
+ return `https://${info.provider}.com/${info.org}/${info.repo}`;
244779
+ }
244780
+ exports.repoInfoToUrl = repoInfoToUrl;
244781
+
244782
+
244416
244783
  /***/ }),
244417
244784
 
244418
244785
  /***/ 64377:
@@ -246128,8 +246495,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
246128
246495
  Object.defineProperty(exports, "__esModule", ({ value: true }));
246129
246496
  exports.findProjectsFromPath = exports.findRepoRoot = exports.ensureRepoLink = exports.getRepoLink = void 0;
246130
246497
  const chalk_1 = __importDefault(__webpack_require__(90877));
246498
+ const inquirer_1 = __importDefault(__webpack_require__(13863));
246131
246499
  const pluralize_1 = __importDefault(__webpack_require__(43669));
246132
246500
  const os_1 = __webpack_require__(12087);
246501
+ const slugify_1 = __importDefault(__webpack_require__(17456));
246133
246502
  const path_1 = __webpack_require__(85622);
246134
246503
  const build_utils_1 = __webpack_require__(63445);
246135
246504
  const fs_extra_1 = __webpack_require__(36365);
@@ -246141,6 +246510,10 @@ const link_2 = __importDefault(__webpack_require__(39302));
246141
246510
  const emoji_1 = __webpack_require__(35172);
246142
246511
  const select_org_1 = __importDefault(__webpack_require__(96339));
246143
246512
  const add_to_gitignore_1 = __webpack_require__(19159);
246513
+ const create_project_1 = __importDefault(__webpack_require__(3410));
246514
+ const detect_projects_1 = __webpack_require__(9268);
246515
+ const repo_info_to_url_1 = __webpack_require__(83744);
246516
+ const connect_git_provider_1 = __webpack_require__(82748);
246144
246517
  const home = (0, os_1.homedir)();
246145
246518
  /**
246146
246519
  * Given a directory path `cwd`, finds the root of the Git repository
@@ -246161,7 +246534,7 @@ async function getRepoLink(client, cwd) {
246161
246534
  return { rootPath, repoConfig, repoConfigPath };
246162
246535
  }
246163
246536
  exports.getRepoLink = getRepoLink;
246164
- async function ensureRepoLink(client, cwd, yes = false) {
246537
+ async function ensureRepoLink(client, cwd, { yes, overwrite }) {
246165
246538
  const { output } = client;
246166
246539
  const repoLink = await getRepoLink(client, cwd);
246167
246540
  if (repoLink) {
@@ -246171,7 +246544,13 @@ async function ensureRepoLink(client, cwd, yes = false) {
246171
246544
  throw new Error('Could not determine Git repository root directory');
246172
246545
  }
246173
246546
  let { rootPath, repoConfig, repoConfigPath } = repoLink;
246174
- if (!repoConfig) {
246547
+ if (overwrite || !repoConfig) {
246548
+ // Detect the projects on the filesystem out of band, so that
246549
+ // they will be ready by the time the projects are listed
246550
+ const detectedProjectsPromise = (0, detect_projects_1.detectProjects)(rootPath).catch(err => {
246551
+ output.debug(`Failed to detect local projects: ${err}`);
246552
+ return new Map();
246553
+ });
246175
246554
  // Not yet linked, so prompt user to begin linking
246176
246555
  let shouldLink = yes ||
246177
246556
  (await (0, confirm_1.default)(client, `Link Git repository at ${chalk_1.default.cyan(`“${(0, humanize_path_1.default)(rootPath)}”`)} to your Project(s)?`, true));
@@ -246192,56 +246571,107 @@ async function ensureRepoLink(client, cwd, yes = false) {
246192
246571
  }
246193
246572
  else {
246194
246573
  // Prompt user to select which remote to use
246195
- const originIndex = remoteNames.indexOf('origin');
246196
246574
  const answer = await client.prompt({
246197
246575
  type: 'list',
246198
246576
  name: 'value',
246199
246577
  message: 'Which Git remote should be used?',
246200
- choices: remoteNames.map(name => {
246578
+ choices: remoteNames.sort().map(name => {
246201
246579
  return { name: name, value: name };
246202
246580
  }),
246203
- default: originIndex === -1 ? 0 : originIndex,
246581
+ default: remoteNames.includes('origin') ? 'origin' : undefined,
246204
246582
  });
246205
246583
  remoteName = answer.value;
246206
246584
  }
246207
246585
  const repoUrl = remoteUrls[remoteName];
246208
- output.spinner(`Fetching Projects for ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}…`);
246586
+ const parsedRepoUrl = (0, connect_git_provider_1.parseRepoUrl)(repoUrl);
246587
+ if (!parsedRepoUrl) {
246588
+ throw new Error(`Failed to parse Git URL: ${repoUrl}`);
246589
+ }
246590
+ const repoUrlLink = output.link(repoUrl, (0, repo_info_to_url_1.repoInfoToUrl)(parsedRepoUrl), {
246591
+ fallback: () => (0, link_2.default)(repoUrl),
246592
+ });
246593
+ output.spinner(`Fetching Projects for ${repoUrlLink} under ${chalk_1.default.bold(org.slug)}…`);
246209
246594
  let projects = [];
246210
246595
  const query = new URLSearchParams({ repoUrl });
246211
246596
  const projectsIterator = client.fetchPaginated(`/v9/projects?${query}`);
246212
- let printedFound = false;
246597
+ const detectedProjects = await detectedProjectsPromise;
246213
246598
  for await (const chunk of projectsIterator) {
246214
246599
  projects = projects.concat(chunk.projects);
246215
- if (!printedFound && projects.length > 0) {
246216
- output.log(`${(0, pluralize_1.default)('Project', chunk.projects.length)} linked to ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}:`);
246217
- printedFound = true;
246218
- }
246219
- for (const project of chunk.projects) {
246220
- output.print(` * ${chalk_1.default.cyan(`${org.slug}/${project.name}\n`)}`);
246221
- }
246222
246600
  if (chunk.pagination.next) {
246223
246601
  output.spinner(`Found ${chalk_1.default.bold(projects.length)} Projects…`, 0);
246224
246602
  }
246225
246603
  }
246226
246604
  if (projects.length === 0) {
246227
- output.log(`No Projects are linked to ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)}.`);
246228
- // TODO: run detection logic to find potential projects.
246229
- // then prompt user to select valid projects.
246230
- // then create new Projects
246231
- }
246232
- shouldLink =
246233
- yes ||
246234
- (await (0, confirm_1.default)(client, `Link to ${projects.length === 1
246235
- ? 'this Project'
246236
- : `these ${chalk_1.default.bold(projects.length)} Projects`}?`, true));
246237
- if (!shouldLink) {
246238
- output.print(`Canceled. Repository not linked.\n`);
246605
+ output.log(`No Projects are linked to ${repoUrlLink} under ${chalk_1.default.bold(org.slug)}.`);
246606
+ }
246607
+ else {
246608
+ output.log(`Found ${(0, pluralize_1.default)('Project', projects.length, true)} linked to ${repoUrlLink} under ${chalk_1.default.bold(org.slug)}`);
246609
+ }
246610
+ // For any projects that already exists on Vercel, remove them from the
246611
+ // locally detected directories. Any remaining ones will be prompted to
246612
+ // create new Projects for.
246613
+ for (const project of projects) {
246614
+ detectedProjects.delete(project.rootDirectory ?? '');
246615
+ }
246616
+ if (detectedProjects.size > 0) {
246617
+ output.log(`Detected ${(0, pluralize_1.default)('new Project', detectedProjects.size, true)} that may be created.`);
246618
+ }
246619
+ const addSeparators = projects.length > 0 && detectedProjects.size > 0;
246620
+ const { selected } = await client.prompt({
246621
+ type: 'checkbox',
246622
+ name: 'selected',
246623
+ message: `Which Projects should be ${projects.length ? 'linked to' : 'created'}?`,
246624
+ choices: [
246625
+ ...(addSeparators
246626
+ ? [new inquirer_1.default.Separator('----- Existing Projects -----')]
246627
+ : []),
246628
+ ...projects.map(project => {
246629
+ return {
246630
+ name: `${org.slug}/${project.name}`,
246631
+ value: project,
246632
+ checked: true,
246633
+ };
246634
+ }),
246635
+ ...(addSeparators
246636
+ ? [new inquirer_1.default.Separator('----- New Projects to be created -----')]
246637
+ : []),
246638
+ ...Array.from(detectedProjects.entries()).map(([rootDirectory, framework]) => {
246639
+ const name = (0, slugify_1.default)([(0, path_1.basename)(rootPath), (0, path_1.basename)(rootDirectory)]
246640
+ .filter(Boolean)
246641
+ .join('-'));
246642
+ return {
246643
+ name: `${org.slug}/${name} (${framework})`,
246644
+ value: {
246645
+ newProject: true,
246646
+ rootDirectory,
246647
+ name,
246648
+ framework,
246649
+ },
246650
+ };
246651
+ }),
246652
+ ],
246653
+ });
246654
+ if (selected.length === 0) {
246655
+ output.print(`No Projects were selected. Repository not linked.\n`);
246239
246656
  return;
246240
246657
  }
246658
+ for (let i = 0; i < selected.length; i++) {
246659
+ const selection = selected[i];
246660
+ if (!selection.newProject)
246661
+ continue;
246662
+ const orgAndName = `${org.slug}/${selection.name}`;
246663
+ output.spinner(`Creating new Project: ${orgAndName}`);
246664
+ delete selection.newProject;
246665
+ if (!selection.rootDirectory)
246666
+ delete selection.rootDirectory;
246667
+ selected[i] = await (0, create_project_1.default)(client, selection);
246668
+ await (0, connect_git_provider_1.connectGitProvider)(client, org, selected[i].id, parsedRepoUrl.provider, `${parsedRepoUrl.org}/${parsedRepoUrl.repo}`);
246669
+ output.log(`Created new Project: ${output.link(orgAndName, `https://vercel.com/${orgAndName}`)}`);
246670
+ }
246241
246671
  repoConfig = {
246242
246672
  orgId: org.id,
246243
246673
  remoteName,
246244
- projects: projects.map(project => {
246674
+ projects: selected.map((project) => {
246245
246675
  return {
246246
246676
  id: project.id,
246247
246677
  name: project.name,
@@ -246253,7 +246683,7 @@ async function ensureRepoLink(client, cwd, yes = false) {
246253
246683
  await (0, link_1.writeReadme)(rootPath);
246254
246684
  // update .gitignore
246255
246685
  const isGitIgnoreUpdated = await (0, add_to_gitignore_1.addToGitIgnore)(rootPath);
246256
- output.print((0, emoji_1.prependEmoji)(`Linked to ${(0, link_2.default)(repoUrl)} under ${chalk_1.default.bold(org.slug)} (created ${link_1.VERCEL_DIR}${isGitIgnoreUpdated ? ' and added it to .gitignore' : ''})`, (0, emoji_1.emoji)('link')) + '\n');
246686
+ output.print((0, emoji_1.prependEmoji)(`Linked to ${repoUrlLink} under ${chalk_1.default.bold(org.slug)} (created ${link_1.VERCEL_DIR}${isGitIgnoreUpdated ? ' and added it to .gitignore' : ''})`, (0, emoji_1.emoji)('link')) + '\n');
246257
246687
  }
246258
246688
  return {
246259
246689
  repoConfig,
@@ -246353,7 +246783,6 @@ const chalk_1 = __importDefault(__webpack_require__(90877));
246353
246783
  const fs_extra_1 = __webpack_require__(36365);
246354
246784
  const link_1 = __webpack_require__(49347);
246355
246785
  const create_project_1 = __importDefault(__webpack_require__(3410));
246356
- const update_project_1 = __importDefault(__webpack_require__(32862));
246357
246786
  const handle_error_1 = __importDefault(__webpack_require__(64377));
246358
246787
  const confirm_1 = __importDefault(__webpack_require__(59320));
246359
246788
  const humanize_path_1 = __importDefault(__webpack_require__(33234));
@@ -246497,9 +246926,10 @@ async function setupAndLink(client, path, { autoConfirm = false, forceDelete = f
246497
246926
  if (rootDirectory) {
246498
246927
  settings.rootDirectory = rootDirectory;
246499
246928
  }
246500
- const project = await (0, create_project_1.default)(client, newProjectName);
246501
- await (0, update_project_1.default)(client, project.id, settings);
246502
- Object.assign(project, settings);
246929
+ const project = await (0, create_project_1.default)(client, {
246930
+ ...settings,
246931
+ name: newProjectName,
246932
+ });
246503
246933
  await (0, link_1.linkFolderToProject)(client, path, {
246504
246934
  projectId: project.id,
246505
246935
  orgId: org.id,
@@ -247521,7 +247951,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
247521
247951
  exports.Output = void 0;
247522
247952
  const chalk_1 = __importDefault(__webpack_require__(90877));
247523
247953
  const ansiEscapes = __importStar(__webpack_require__(68700));
247524
- const supports_hyperlinks_1 = __webpack_require__(18505);
247954
+ const supports_hyperlinks_1 = __webpack_require__(9429);
247525
247955
  const link_1 = __importDefault(__webpack_require__(39302));
247526
247956
  const wait_1 = __importDefault(__webpack_require__(34604));
247527
247957
  const error_utils_1 = __webpack_require__(39799);
@@ -248363,16 +248793,56 @@ exports.addDomainToProject = addDomainToProject;
248363
248793
  "use strict";
248364
248794
 
248365
248795
  Object.defineProperty(exports, "__esModule", ({ value: true }));
248366
- async function createProject(client, projectName) {
248796
+ async function createProject(client, settings) {
248367
248797
  const project = await client.fetch('/v1/projects', {
248368
248798
  method: 'POST',
248369
- body: { name: projectName },
248799
+ body: { ...settings },
248370
248800
  });
248371
248801
  return project;
248372
248802
  }
248373
248803
  exports.default = createProject;
248374
248804
 
248375
248805
 
248806
+ /***/ }),
248807
+
248808
+ /***/ 9268:
248809
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
248810
+
248811
+ "use strict";
248812
+
248813
+ var __importDefault = (this && this.__importDefault) || function (mod) {
248814
+ return (mod && mod.__esModule) ? mod : { "default": mod };
248815
+ };
248816
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
248817
+ exports.detectProjects = void 0;
248818
+ const path_1 = __webpack_require__(85622);
248819
+ const frameworks_1 = __importDefault(__webpack_require__(36678));
248820
+ const fs_detectors_1 = __webpack_require__(88995);
248821
+ async function detectProjects(cwd) {
248822
+ const fs = new fs_detectors_1.LocalFileSystemDetector(cwd);
248823
+ const workspaces = await (0, fs_detectors_1.getWorkspaces)({ fs });
248824
+ const detectedProjects = new Map();
248825
+ const packagePaths = (await Promise.all(workspaces.map(workspace => (0, fs_detectors_1.getWorkspacePackagePaths)({
248826
+ fs,
248827
+ workspace,
248828
+ })))).flat();
248829
+ if (packagePaths.length === 0) {
248830
+ packagePaths.push('/');
248831
+ }
248832
+ await Promise.all(packagePaths.map(async (p) => {
248833
+ const framework = await (0, fs_detectors_1.detectFramework)({
248834
+ fs: fs.chdir((0, path_1.join)('.', p)),
248835
+ frameworkList: frameworks_1.default,
248836
+ });
248837
+ if (!framework)
248838
+ return;
248839
+ detectedProjects.set(p.slice(1), framework);
248840
+ }));
248841
+ return detectedProjects;
248842
+ }
248843
+ exports.detectProjects = detectProjects;
248844
+
248845
+
248376
248846
  /***/ }),
248377
248847
 
248378
248848
  /***/ 18693:
@@ -248951,26 +249421,6 @@ async function removeProject(client, projectNameOrId) {
248951
249421
  exports.default = removeProject;
248952
249422
 
248953
249423
 
248954
- /***/ }),
248955
-
248956
- /***/ 32862:
248957
- /***/ ((__unused_webpack_module, exports) => {
248958
-
248959
- "use strict";
248960
-
248961
- Object.defineProperty(exports, "__esModule", ({ value: true }));
248962
- async function updateProject(client, prjNameOrId, settings) {
248963
- // `ProjectSettings` is technically compatible with JSONObject
248964
- const body = settings;
248965
- const res = await client.fetch(`/v2/projects/${encodeURIComponent(prjNameOrId)}`, {
248966
- method: 'PATCH',
248967
- body,
248968
- });
248969
- return res;
248970
- }
248971
- exports.default = updateProject;
248972
-
248973
-
248974
249424
  /***/ }),
248975
249425
 
248976
249426
  /***/ 60076:
@@ -250038,7 +250488,7 @@ module.exports = JSON.parse("[[[0,44],\"disallowed_STD3_valid\"],[[45,46],\"vali
250038
250488
  /***/ ((module) => {
250039
250489
 
250040
250490
  "use strict";
250041
- module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.3\",\"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.8.0\",\"@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\"}}");
250491
+ module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.5\",\"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.8.2\",\"@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\"}}");
250042
250492
 
250043
250493
  /***/ }),
250044
250494
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "31.0.1",
3
+ "version": "31.0.3",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -22,16 +22,16 @@
22
22
  "node": ">= 14"
23
23
  },
24
24
  "dependencies": {
25
- "@vercel/build-utils": "6.8.0",
25
+ "@vercel/build-utils": "6.8.2",
26
26
  "@vercel/go": "2.5.1",
27
27
  "@vercel/hydrogen": "0.0.64",
28
28
  "@vercel/next": "3.8.8",
29
- "@vercel/node": "2.15.3",
29
+ "@vercel/node": "2.15.5",
30
30
  "@vercel/python": "3.1.60",
31
31
  "@vercel/redwood": "1.1.15",
32
- "@vercel/remix-builder": "1.8.15",
32
+ "@vercel/remix-builder": "1.8.17",
33
33
  "@vercel/ruby": "1.3.76",
34
- "@vercel/static-build": "1.3.38"
34
+ "@vercel/static-build": "1.3.40"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@alex_neo/jest-expect-message": "1.0.5",
@@ -75,13 +75,13 @@
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": "1.0.3",
78
+ "@vercel-internals/constants": "1.0.4",
79
79
  "@vercel-internals/get-package-json": "1.0.0",
80
- "@vercel-internals/types": "1.0.3",
81
- "@vercel/client": "12.6.3",
80
+ "@vercel-internals/types": "1.0.5",
81
+ "@vercel/client": "12.6.5",
82
82
  "@vercel/error-utils": "1.0.10",
83
83
  "@vercel/frameworks": "1.4.3",
84
- "@vercel/fs-detectors": "4.0.1",
84
+ "@vercel/fs-detectors": "4.1.0",
85
85
  "@vercel/fun": "1.0.4",
86
86
  "@vercel/ncc": "0.24.0",
87
87
  "@vercel/routing-utils": "2.2.1",
@@ -149,7 +149,7 @@
149
149
  "serve-handler": "6.1.1",
150
150
  "strip-ansi": "6.0.1",
151
151
  "stripe": "5.1.0",
152
- "supports-hyperlinks": "2.2.0",
152
+ "supports-hyperlinks": "3.0.0",
153
153
  "tar-fs": "1.16.3",
154
154
  "test-listen": "1.1.0",
155
155
  "text-table": "0.2.0",
@@ -165,7 +165,6 @@
165
165
  "yauzl-promise": "2.1.3"
166
166
  },
167
167
  "scripts": {
168
- "preinstall": "node ./scripts/preinstall.js",
169
168
  "test": "jest --env node --verbose --bail",
170
169
  "test-unit": "pnpm test test/unit/",
171
170
  "test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
@@ -1,101 +0,0 @@
1
- #!/usr/bin/env node
2
- const { join } = require('path');
3
- const { statSync } = require('fs');
4
- const pkg = require('../package');
5
-
6
- function error(command) {
7
- console.error('> Error:', command);
8
- }
9
-
10
- function debug(str) {
11
- if (
12
- process.argv.find(str => str === '--debug') ||
13
- process.env.PREINSTALL_DEBUG
14
- ) {
15
- console.log(`[debug] [${new Date().toISOString()}]`, str);
16
- }
17
- }
18
-
19
- function isYarn() {
20
- return process.env.npm_config_heading !== 'npm';
21
- }
22
-
23
- function isGlobal() {
24
- const cmd = JSON.parse(process.env.npm_config_argv || '{ "original": [] }');
25
-
26
- return isYarn()
27
- ? cmd.original.includes('global')
28
- : Boolean(process.env.npm_config_global);
29
- }
30
-
31
- function isVercel() {
32
- return pkg.name === 'vercel';
33
- }
34
-
35
- function validateNodeVersion() {
36
- let semver = '>= 0';
37
- let major = '1';
38
-
39
- try {
40
- major = process.versions.node.split('.')[0];
41
- const pkg = require('../package.json');
42
- semver = pkg.engines.node;
43
- } catch (e) {
44
- debug('Failed to read package.json engines');
45
- }
46
-
47
- const isValid = eval(`${major} ${semver}`);
48
- return { isValid, expected: semver, actual: process.versions.node };
49
- }
50
-
51
- function isInNodeModules(name) {
52
- try {
53
- const nodeModules = join(__dirname, '..', '..');
54
- const stat = statSync(join(nodeModules, name));
55
- return stat.isDirectory();
56
- } catch (err) {
57
- return false;
58
- }
59
- }
60
-
61
- async function main() {
62
- if (!isGlobal()) {
63
- debug('Skipping preinstall since Vercel CLI is being installed locally');
64
- return;
65
- }
66
-
67
- const ver = validateNodeVersion();
68
-
69
- if (!ver.isValid) {
70
- error(
71
- `Detected unsupported Node.js version.\n` +
72
- `Expected "${ver.expected}" but found "${ver.actual}".\n` +
73
- `Please update to the latest Node.js LTS version to install Vercel CLI.`
74
- );
75
- process.exit(1);
76
- }
77
-
78
- if (isVercel() && isInNodeModules('now')) {
79
- const uninstall = isYarn()
80
- ? 'yarn global remove now'
81
- : 'npm uninstall -g now';
82
- console.error(`NOTE: Run \`${uninstall}\` to uninstall \`now\`\n`);
83
- }
84
- }
85
-
86
- process.on('unhandledRejection', err => {
87
- console.error('Unhandled Rejection:');
88
- console.error(err);
89
- process.exit(1);
90
- });
91
-
92
- process.on('uncaughtException', err => {
93
- console.error('Uncaught Exception:');
94
- console.error(err);
95
- process.exit(1);
96
- });
97
-
98
- main().catch(err => {
99
- console.error(err);
100
- process.exit(1);
101
- });