vercel 31.0.1 → 31.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +545 -139
- package/package.json +8 -9
- package/scripts/preinstall.js +0 -101
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
|
/***/ }),
|
@@ -226853,58 +226856,186 @@ exports.default = rm;
|
|
226853
226856
|
|
226854
226857
|
/***/ }),
|
226855
226858
|
|
226856
|
-
/***/
|
226857
|
-
/***/ (
|
226859
|
+
/***/ 28831:
|
226860
|
+
/***/ ((__unused_webpack_module, exports) => {
|
226858
226861
|
|
226859
226862
|
"use strict";
|
226860
226863
|
|
226861
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
226862
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
226863
|
-
};
|
226864
226864
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
226865
|
-
exports.
|
226866
|
-
|
226867
|
-
|
226868
|
-
|
226869
|
-
|
226870
|
-
|
226871
|
-
|
226872
|
-
|
226873
|
-
|
226874
|
-
|
226875
|
-
|
226876
|
-
|
226877
|
-
|
226878
|
-
|
226879
|
-
|
226880
|
-
|
226881
|
-
|
226882
|
-
|
226883
|
-
|
226884
|
-
|
226885
|
-
|
226886
|
-
|
226887
|
-
|
226888
|
-
|
226889
|
-
|
226890
|
-
|
226891
|
-
|
226892
|
-
|
226893
|
-
|
226894
|
-
|
226895
|
-
|
226896
|
-
|
226897
|
-
|
226898
|
-
|
226899
|
-
|
226900
|
-
|
226901
|
-
|
226902
|
-
|
226903
|
-
|
226904
|
-
|
226905
|
-
|
226865
|
+
exports.deployCommand = void 0;
|
226866
|
+
exports.deployCommand = {
|
226867
|
+
name: 'deploy',
|
226868
|
+
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`).',
|
226869
|
+
arguments: [
|
226870
|
+
{
|
226871
|
+
name: 'project-path',
|
226872
|
+
required: false,
|
226873
|
+
},
|
226874
|
+
],
|
226875
|
+
options: [
|
226876
|
+
{
|
226877
|
+
name: 'force',
|
226878
|
+
shorthand: 'f',
|
226879
|
+
type: 'boolean',
|
226880
|
+
deprecated: false,
|
226881
|
+
description: 'Force a new deployment even if nothing has changed',
|
226882
|
+
multi: false,
|
226883
|
+
},
|
226884
|
+
{
|
226885
|
+
name: 'with-cache',
|
226886
|
+
shorthand: null,
|
226887
|
+
type: 'boolean',
|
226888
|
+
deprecated: false,
|
226889
|
+
description: 'Retain build cache when using "--force"',
|
226890
|
+
multi: false,
|
226891
|
+
},
|
226892
|
+
{
|
226893
|
+
name: 'public',
|
226894
|
+
shorthand: 'p',
|
226895
|
+
type: 'boolean',
|
226896
|
+
deprecated: false,
|
226897
|
+
description: 'Deployment is public (`/_src`) is exposed)',
|
226898
|
+
multi: false,
|
226899
|
+
},
|
226900
|
+
{
|
226901
|
+
name: 'env',
|
226902
|
+
shorthand: 'e',
|
226903
|
+
type: 'string',
|
226904
|
+
argument: 'key=value',
|
226905
|
+
deprecated: false,
|
226906
|
+
multi: true,
|
226907
|
+
description: 'Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)',
|
226908
|
+
},
|
226909
|
+
{
|
226910
|
+
name: 'build-env',
|
226911
|
+
shorthand: 'b',
|
226912
|
+
type: 'string',
|
226913
|
+
argument: 'key=value',
|
226914
|
+
deprecated: false,
|
226915
|
+
multi: true,
|
226916
|
+
description: 'Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)',
|
226917
|
+
},
|
226918
|
+
{
|
226919
|
+
name: 'meta',
|
226920
|
+
shorthand: 'm',
|
226921
|
+
type: 'string',
|
226922
|
+
argument: 'key=value',
|
226923
|
+
deprecated: false,
|
226924
|
+
multi: true,
|
226925
|
+
description: 'Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)',
|
226926
|
+
},
|
226927
|
+
{
|
226928
|
+
name: 'regions',
|
226929
|
+
shorthand: null,
|
226930
|
+
type: 'string',
|
226931
|
+
deprecated: false,
|
226932
|
+
description: 'Set default regions to enable the deployment on',
|
226933
|
+
multi: false,
|
226934
|
+
},
|
226935
|
+
{
|
226936
|
+
name: 'prebuilt',
|
226937
|
+
shorthand: null,
|
226938
|
+
type: 'boolean',
|
226939
|
+
deprecated: false,
|
226940
|
+
description: 'Use in combination with `vc build`. Deploy an existing build',
|
226941
|
+
multi: false,
|
226942
|
+
},
|
226943
|
+
{
|
226944
|
+
name: 'prod',
|
226945
|
+
shorthand: null,
|
226946
|
+
type: 'boolean',
|
226947
|
+
deprecated: false,
|
226948
|
+
description: 'Create a production deployment',
|
226949
|
+
multi: false,
|
226950
|
+
},
|
226951
|
+
{
|
226952
|
+
name: 'archive',
|
226953
|
+
shorthand: null,
|
226954
|
+
type: 'string',
|
226955
|
+
deprecated: false,
|
226956
|
+
description: 'Compress the deployment code into a file before uploading it',
|
226957
|
+
multi: false,
|
226958
|
+
},
|
226959
|
+
{
|
226960
|
+
name: 'no-wait',
|
226961
|
+
shorthand: null,
|
226962
|
+
type: 'boolean',
|
226963
|
+
deprecated: false,
|
226964
|
+
description: "Don't wait for the deployment to finish",
|
226965
|
+
multi: false,
|
226966
|
+
},
|
226967
|
+
{
|
226968
|
+
name: 'skip-domain',
|
226969
|
+
shorthand: null,
|
226970
|
+
type: 'boolean',
|
226971
|
+
deprecated: false,
|
226972
|
+
description: undefined,
|
226973
|
+
multi: false,
|
226974
|
+
},
|
226975
|
+
{
|
226976
|
+
name: 'yes',
|
226977
|
+
shorthand: 'y',
|
226978
|
+
type: 'boolean',
|
226979
|
+
deprecated: false,
|
226980
|
+
description: 'Use default options to skip all prompts',
|
226981
|
+
multi: false,
|
226982
|
+
},
|
226983
|
+
{
|
226984
|
+
name: 'name',
|
226985
|
+
shorthand: 'n',
|
226986
|
+
type: 'string',
|
226987
|
+
deprecated: true,
|
226988
|
+
description: 'Provide a Vercel Project name',
|
226989
|
+
multi: false,
|
226990
|
+
},
|
226991
|
+
{
|
226992
|
+
name: 'no-clipboard',
|
226993
|
+
shorthand: null,
|
226994
|
+
type: 'boolean',
|
226995
|
+
deprecated: true,
|
226996
|
+
description: 'Do not copy deployment URL to clipboard',
|
226997
|
+
multi: false,
|
226998
|
+
},
|
226999
|
+
{
|
227000
|
+
name: 'target',
|
227001
|
+
shorthand: null,
|
227002
|
+
type: 'string',
|
227003
|
+
deprecated: true,
|
227004
|
+
description: 'Specify the target deployment environment',
|
227005
|
+
multi: false,
|
227006
|
+
},
|
227007
|
+
{
|
227008
|
+
name: 'confirm',
|
227009
|
+
shorthand: 'c',
|
227010
|
+
type: 'boolean',
|
227011
|
+
deprecated: true,
|
227012
|
+
description: 'Use default options to skip all prompts',
|
227013
|
+
multi: false,
|
227014
|
+
},
|
227015
|
+
],
|
227016
|
+
examples: [
|
227017
|
+
{
|
227018
|
+
name: 'Deploy the current directory',
|
227019
|
+
value: 'vercel',
|
227020
|
+
},
|
227021
|
+
{
|
227022
|
+
name: 'Deploy a custom path',
|
227023
|
+
value: 'vercel /usr/src/project',
|
227024
|
+
},
|
227025
|
+
{
|
227026
|
+
name: 'Deploy with run-time Environment Variables',
|
227027
|
+
value: 'vercel -e NODE_ENV=production',
|
227028
|
+
},
|
227029
|
+
{
|
227030
|
+
name: 'Deploy with prebuilt outputs',
|
227031
|
+
value: ['vercel build', 'vercel deploy --prebuilt'],
|
227032
|
+
},
|
227033
|
+
{
|
227034
|
+
name: 'Write Deployment URL to a file',
|
227035
|
+
value: 'vercel > deployment-url.txt',
|
227036
|
+
},
|
227037
|
+
],
|
226906
227038
|
};
|
226907
|
-
exports.help = help;
|
226908
227039
|
|
226909
227040
|
|
226910
227041
|
/***/ }),
|
@@ -226973,7 +227104,6 @@ const emoji_1 = __webpack_require__(35172);
|
|
226973
227104
|
const input_root_directory_1 = __webpack_require__(70738);
|
226974
227105
|
const validate_paths_1 = __importStar(__webpack_require__(33922));
|
226975
227106
|
const pkg_name_1 = __webpack_require__(79000);
|
226976
|
-
const args_1 = __webpack_require__(89097);
|
226977
227107
|
const get_deployment_checks_1 = __webpack_require__(10559);
|
226978
227108
|
const parse_target_1 = __importDefault(__webpack_require__(43667));
|
226979
227109
|
const get_prebuilt_json_1 = __importDefault(__webpack_require__(80282));
|
@@ -226983,40 +227113,26 @@ const parse_env_1 = __webpack_require__(59818);
|
|
226983
227113
|
const error_utils_1 = __webpack_require__(39799);
|
226984
227114
|
const project_settings_1 = __webpack_require__(61440);
|
226985
227115
|
const print_deployment_status_1 = __webpack_require__(27951);
|
227116
|
+
const help_1 = __webpack_require__(58219);
|
227117
|
+
const command_1 = __webpack_require__(28831);
|
226986
227118
|
exports.default = async (client) => {
|
226987
227119
|
const { output } = client;
|
226988
227120
|
let argv = null;
|
227121
|
+
const argOptions = {};
|
227122
|
+
for (const option of command_1.deployCommand.options) {
|
227123
|
+
argOptions[`--${option.name}`] =
|
227124
|
+
option.type === 'boolean' ? Boolean : String;
|
227125
|
+
if (option.shorthand) {
|
227126
|
+
argOptions[`-${option.shorthand}`] = `--${option.name}`;
|
227127
|
+
}
|
227128
|
+
if (option.name === 'env' ||
|
227129
|
+
option.name === 'build-env' ||
|
227130
|
+
option.name === 'meta') {
|
227131
|
+
argOptions[`--${option.name}`] = [String];
|
227132
|
+
}
|
227133
|
+
}
|
226989
227134
|
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
|
-
});
|
227135
|
+
argv = (0, get_args_1.default)(client.argv.slice(2), argOptions);
|
227020
227136
|
if ('--confirm' in argv) {
|
227021
227137
|
output.warn('`--confirm` is deprecated, please use `--yes` instead');
|
227022
227138
|
argv['--yes'] = argv['--confirm'];
|
@@ -227027,7 +227143,7 @@ exports.default = async (client) => {
|
|
227027
227143
|
return 1;
|
227028
227144
|
}
|
227029
227145
|
if (argv['--help']) {
|
227030
|
-
output.print((0,
|
227146
|
+
output.print((0, help_1.help)(command_1.deployCommand, { columns: client.stderr.columns }));
|
227031
227147
|
return 2;
|
227032
227148
|
}
|
227033
227149
|
if (argv._[0] === 'deploy') {
|
@@ -230094,6 +230210,198 @@ async function main(client) {
|
|
230094
230210
|
exports.default = main;
|
230095
230211
|
|
230096
230212
|
|
230213
|
+
/***/ }),
|
230214
|
+
|
230215
|
+
/***/ 58219:
|
230216
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
230217
|
+
|
230218
|
+
"use strict";
|
230219
|
+
|
230220
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
230221
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
230222
|
+
};
|
230223
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
230224
|
+
exports.help = exports.buildHelpOutput = exports.buildCommandExampleLines = exports.buildCommandOptionLines = exports.buildCommandSynopsisLine = exports.outputArrayToString = exports.lineToString = exports.calcLineLength = void 0;
|
230225
|
+
const chalk_1 = __importDefault(__webpack_require__(90877));
|
230226
|
+
const strip_ansi_1 = __importDefault(__webpack_require__(66884));
|
230227
|
+
const constants_1 = __webpack_require__(98551);
|
230228
|
+
const INDENT = ' '.repeat(2);
|
230229
|
+
const NEWLINE = '\n';
|
230230
|
+
function calcLineLength(line) {
|
230231
|
+
return (0, strip_ansi_1.default)(lineToString(line)).length;
|
230232
|
+
}
|
230233
|
+
exports.calcLineLength = calcLineLength;
|
230234
|
+
// Insert spaces in between non-whitespace items only
|
230235
|
+
function lineToString(line) {
|
230236
|
+
let string = '';
|
230237
|
+
for (let i = 0; i < line.length; i++) {
|
230238
|
+
if (i === line.length - 1) {
|
230239
|
+
string += line[i];
|
230240
|
+
}
|
230241
|
+
else {
|
230242
|
+
const curr = line[i];
|
230243
|
+
const next = line[i + 1];
|
230244
|
+
string += curr;
|
230245
|
+
if (curr.trim() !== '' && next.trim() !== '') {
|
230246
|
+
string += ' ';
|
230247
|
+
}
|
230248
|
+
}
|
230249
|
+
}
|
230250
|
+
return string;
|
230251
|
+
}
|
230252
|
+
exports.lineToString = lineToString;
|
230253
|
+
function outputArrayToString(outputArray) {
|
230254
|
+
return outputArray.join(NEWLINE);
|
230255
|
+
}
|
230256
|
+
exports.outputArrayToString = outputArrayToString;
|
230257
|
+
/**
|
230258
|
+
* Example: `▲ vercel deploy [path] [options]`
|
230259
|
+
* @param command
|
230260
|
+
* @returns
|
230261
|
+
*/
|
230262
|
+
function buildCommandSynopsisLine(command) {
|
230263
|
+
const line = [constants_1.LOGO, chalk_1.default.bold(constants_1.NAME), chalk_1.default.bold(command.name)];
|
230264
|
+
if (command.arguments.length > 0) {
|
230265
|
+
for (const argument of command.arguments) {
|
230266
|
+
line.push(argument.required ? argument.name : `[${argument.name}]`);
|
230267
|
+
}
|
230268
|
+
}
|
230269
|
+
if (command.options.length > 0) {
|
230270
|
+
line.push('[options]');
|
230271
|
+
}
|
230272
|
+
return lineToString(line);
|
230273
|
+
}
|
230274
|
+
exports.buildCommandSynopsisLine = buildCommandSynopsisLine;
|
230275
|
+
function buildCommandOptionLines(command, options) {
|
230276
|
+
// Filter out deprecated and intentionally undocumented options
|
230277
|
+
command.options = command.options.filter(option => !option.deprecated && option.description !== undefined);
|
230278
|
+
// Initialize output array with header and empty line
|
230279
|
+
const outputArray = [chalk_1.default.dim(`Options:`), ''];
|
230280
|
+
// Start building option lines
|
230281
|
+
const optionLines = [];
|
230282
|
+
// Sort command options alphabetically
|
230283
|
+
command.options.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
230284
|
+
// Keep track of longest "start" of an option line to determine description spacing
|
230285
|
+
let maxLineStartLength = 0;
|
230286
|
+
// Iterate over options and create the "start" of each option (e.g. ` -b, --build-env <key=value>`)
|
230287
|
+
for (const option of command.options) {
|
230288
|
+
const startLine = [INDENT];
|
230289
|
+
if (option.shorthand) {
|
230290
|
+
startLine.push(`-${option.shorthand},`);
|
230291
|
+
}
|
230292
|
+
startLine.push(`--${option.name}`);
|
230293
|
+
if (option.argument) {
|
230294
|
+
startLine.push(`<${option.argument}>`);
|
230295
|
+
}
|
230296
|
+
// the length includes the INDENT
|
230297
|
+
const lineLength = calcLineLength(startLine);
|
230298
|
+
maxLineStartLength = Math.max(lineLength, maxLineStartLength);
|
230299
|
+
optionLines.push(startLine);
|
230300
|
+
}
|
230301
|
+
/*
|
230302
|
+
* Iterate over in-progress option lines to add space-filler and description
|
230303
|
+
* For Example:
|
230304
|
+
* | --archive My description starts here.
|
230305
|
+
* |
|
230306
|
+
* | -b, --build-env <key=value> Start of description here then
|
230307
|
+
* | it wraps here.
|
230308
|
+
* |
|
230309
|
+
* | -e, --env <key=value> My description is short.
|
230310
|
+
*
|
230311
|
+
* Breaking down option lines:
|
230312
|
+
* | -b, --build-env <key=value> Start of description here then
|
230313
|
+
* |[][ ][][ ]
|
230314
|
+
* |↑ ↑ ↑ ↑
|
230315
|
+
* |1 2 3 4
|
230316
|
+
* | it wraps here.
|
230317
|
+
* |[][ ][ ]
|
230318
|
+
* |↑ ↑ ↑
|
230319
|
+
* |5 6 7
|
230320
|
+
* | 1, 5 = indent
|
230321
|
+
* | 2 = start
|
230322
|
+
* | 3, 6 = space-filler
|
230323
|
+
* | 4, 7 = description
|
230324
|
+
*/
|
230325
|
+
for (let i = 0; i < optionLines.length; i++) {
|
230326
|
+
const optionLine = optionLines[i];
|
230327
|
+
const option = command.options[i];
|
230328
|
+
// Add only 2 spaces to the longest line, and then make all shorter lines the same length.
|
230329
|
+
optionLine.push(' '.repeat(2 + (maxLineStartLength - calcLineLength(optionLine))));
|
230330
|
+
// Descriptions may be longer than max line length. Wrap them to the same column as the first description line
|
230331
|
+
const lines = [optionLine];
|
230332
|
+
if (option.description) {
|
230333
|
+
for (const descriptionWord of option.description.split(' ')) {
|
230334
|
+
// insert a new line when the next word would match or exceed the maximum line length
|
230335
|
+
if (calcLineLength(lines[lines.length - 1]) +
|
230336
|
+
(0, strip_ansi_1.default)(descriptionWord).length >=
|
230337
|
+
options.columns) {
|
230338
|
+
// initialize the new line with the necessary whitespace. The INDENT is apart of `maxLineStartLength`
|
230339
|
+
lines.push([' '.repeat(maxLineStartLength + 2)]);
|
230340
|
+
}
|
230341
|
+
// insert the word to the current last line
|
230342
|
+
lines[lines.length - 1].push(descriptionWord);
|
230343
|
+
}
|
230344
|
+
}
|
230345
|
+
// for every line, transform into a string and push it to the output
|
230346
|
+
for (const line of lines) {
|
230347
|
+
outputArray.push(lineToString(line));
|
230348
|
+
}
|
230349
|
+
// add an empty line in between in each option block for readability (skip the last block)
|
230350
|
+
if (i !== optionLines.length - 1)
|
230351
|
+
outputArray.push('');
|
230352
|
+
}
|
230353
|
+
// return the entire list of options as a single string after delete the last '\n' added to the option list
|
230354
|
+
return outputArrayToString(outputArray);
|
230355
|
+
}
|
230356
|
+
exports.buildCommandOptionLines = buildCommandOptionLines;
|
230357
|
+
function buildCommandExampleLines(command) {
|
230358
|
+
const outputArray = [chalk_1.default.dim(`Examples:`), ''];
|
230359
|
+
for (const example of command.examples) {
|
230360
|
+
const nameLine = [INDENT];
|
230361
|
+
nameLine.push(chalk_1.default.gray('-'));
|
230362
|
+
nameLine.push(example.name);
|
230363
|
+
outputArray.push(lineToString(nameLine));
|
230364
|
+
outputArray.push('');
|
230365
|
+
const buildValueLine = (value) => {
|
230366
|
+
return lineToString([INDENT, INDENT, chalk_1.default.cyan(`$ ${value}`)]);
|
230367
|
+
};
|
230368
|
+
if (Array.isArray(example.value)) {
|
230369
|
+
for (const line of example.value) {
|
230370
|
+
outputArray.push(buildValueLine(line));
|
230371
|
+
}
|
230372
|
+
}
|
230373
|
+
else {
|
230374
|
+
outputArray.push(buildValueLine(example.value));
|
230375
|
+
}
|
230376
|
+
outputArray.push('');
|
230377
|
+
}
|
230378
|
+
// delete the last newline added after examples iteration
|
230379
|
+
outputArray.splice(-1);
|
230380
|
+
return outputArrayToString(outputArray);
|
230381
|
+
}
|
230382
|
+
exports.buildCommandExampleLines = buildCommandExampleLines;
|
230383
|
+
function buildHelpOutput(command, options) {
|
230384
|
+
const outputArray = [
|
230385
|
+
buildCommandSynopsisLine(command),
|
230386
|
+
'',
|
230387
|
+
command.description,
|
230388
|
+
'',
|
230389
|
+
buildCommandOptionLines(command, options),
|
230390
|
+
'',
|
230391
|
+
buildCommandExampleLines(command),
|
230392
|
+
'',
|
230393
|
+
];
|
230394
|
+
return outputArrayToString(outputArray);
|
230395
|
+
}
|
230396
|
+
exports.buildHelpOutput = buildHelpOutput;
|
230397
|
+
function help(command, options) {
|
230398
|
+
return buildHelpOutput(command, {
|
230399
|
+
columns: options.columns ?? 80,
|
230400
|
+
});
|
230401
|
+
}
|
230402
|
+
exports.help = help;
|
230403
|
+
|
230404
|
+
|
230097
230405
|
/***/ }),
|
230098
230406
|
|
230099
230407
|
/***/ 48208:
|
@@ -230673,7 +230981,7 @@ async function main(client) {
|
|
230673
230981
|
}
|
230674
230982
|
if (argv['--repo']) {
|
230675
230983
|
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);
|
230984
|
+
await (0, repo_1.ensureRepoLink)(client, cwd, { yes, overwrite: true });
|
230677
230985
|
}
|
230678
230986
|
else {
|
230679
230987
|
const link = await (0, ensure_link_1.ensureLink)('link', client, cwd, {
|
@@ -232328,7 +232636,7 @@ exports.default = async (client) => {
|
|
232328
232636
|
action: 'redeploy',
|
232329
232637
|
},
|
232330
232638
|
name: fromDeployment.name,
|
232331
|
-
target: fromDeployment.target
|
232639
|
+
target: fromDeployment.target,
|
232332
232640
|
},
|
232333
232641
|
method: 'POST',
|
232334
232642
|
});
|
@@ -236863,8 +237171,8 @@ exports.default = readConfig;
|
|
236863
237171
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
236864
237172
|
exports.SENTRY_DSN = exports.GA_TRACKING_ID = void 0;
|
236865
237173
|
// This file is auto-generated
|
236866
|
-
exports.GA_TRACKING_ID =
|
236867
|
-
exports.SENTRY_DSN =
|
237174
|
+
exports.GA_TRACKING_ID = "UA-117491914-3";
|
237175
|
+
exports.SENTRY_DSN = "https://26a24e59ba954011919a524b341b6ab5@sentry.io/1323225";
|
236868
237176
|
|
236869
237177
|
|
236870
237178
|
/***/ }),
|
@@ -244413,6 +244721,21 @@ function printRemoteUrls(output, remoteUrls) {
|
|
244413
244721
|
exports.printRemoteUrls = printRemoteUrls;
|
244414
244722
|
|
244415
244723
|
|
244724
|
+
/***/ }),
|
244725
|
+
|
244726
|
+
/***/ 83744:
|
244727
|
+
/***/ ((__unused_webpack_module, exports) => {
|
244728
|
+
|
244729
|
+
"use strict";
|
244730
|
+
|
244731
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
244732
|
+
exports.repoInfoToUrl = void 0;
|
244733
|
+
function repoInfoToUrl(info) {
|
244734
|
+
return `https://${info.provider}.com/${info.org}/${info.repo}`;
|
244735
|
+
}
|
244736
|
+
exports.repoInfoToUrl = repoInfoToUrl;
|
244737
|
+
|
244738
|
+
|
244416
244739
|
/***/ }),
|
244417
244740
|
|
244418
244741
|
/***/ 64377:
|
@@ -246128,8 +246451,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
246128
246451
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
246129
246452
|
exports.findProjectsFromPath = exports.findRepoRoot = exports.ensureRepoLink = exports.getRepoLink = void 0;
|
246130
246453
|
const chalk_1 = __importDefault(__webpack_require__(90877));
|
246454
|
+
const inquirer_1 = __importDefault(__webpack_require__(13863));
|
246131
246455
|
const pluralize_1 = __importDefault(__webpack_require__(43669));
|
246132
246456
|
const os_1 = __webpack_require__(12087);
|
246457
|
+
const slugify_1 = __importDefault(__webpack_require__(17456));
|
246133
246458
|
const path_1 = __webpack_require__(85622);
|
246134
246459
|
const build_utils_1 = __webpack_require__(63445);
|
246135
246460
|
const fs_extra_1 = __webpack_require__(36365);
|
@@ -246141,6 +246466,10 @@ const link_2 = __importDefault(__webpack_require__(39302));
|
|
246141
246466
|
const emoji_1 = __webpack_require__(35172);
|
246142
246467
|
const select_org_1 = __importDefault(__webpack_require__(96339));
|
246143
246468
|
const add_to_gitignore_1 = __webpack_require__(19159);
|
246469
|
+
const create_project_1 = __importDefault(__webpack_require__(3410));
|
246470
|
+
const detect_projects_1 = __webpack_require__(9268);
|
246471
|
+
const repo_info_to_url_1 = __webpack_require__(83744);
|
246472
|
+
const connect_git_provider_1 = __webpack_require__(82748);
|
246144
246473
|
const home = (0, os_1.homedir)();
|
246145
246474
|
/**
|
246146
246475
|
* Given a directory path `cwd`, finds the root of the Git repository
|
@@ -246161,7 +246490,7 @@ async function getRepoLink(client, cwd) {
|
|
246161
246490
|
return { rootPath, repoConfig, repoConfigPath };
|
246162
246491
|
}
|
246163
246492
|
exports.getRepoLink = getRepoLink;
|
246164
|
-
async function ensureRepoLink(client, cwd, yes
|
246493
|
+
async function ensureRepoLink(client, cwd, { yes, overwrite }) {
|
246165
246494
|
const { output } = client;
|
246166
246495
|
const repoLink = await getRepoLink(client, cwd);
|
246167
246496
|
if (repoLink) {
|
@@ -246171,7 +246500,13 @@ async function ensureRepoLink(client, cwd, yes = false) {
|
|
246171
246500
|
throw new Error('Could not determine Git repository root directory');
|
246172
246501
|
}
|
246173
246502
|
let { rootPath, repoConfig, repoConfigPath } = repoLink;
|
246174
|
-
if (!repoConfig) {
|
246503
|
+
if (overwrite || !repoConfig) {
|
246504
|
+
// Detect the projects on the filesystem out of band, so that
|
246505
|
+
// they will be ready by the time the projects are listed
|
246506
|
+
const detectedProjectsPromise = (0, detect_projects_1.detectProjects)(rootPath).catch(err => {
|
246507
|
+
output.debug(`Failed to detect local projects: ${err}`);
|
246508
|
+
return new Map();
|
246509
|
+
});
|
246175
246510
|
// Not yet linked, so prompt user to begin linking
|
246176
246511
|
let shouldLink = yes ||
|
246177
246512
|
(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 +246527,107 @@ async function ensureRepoLink(client, cwd, yes = false) {
|
|
246192
246527
|
}
|
246193
246528
|
else {
|
246194
246529
|
// Prompt user to select which remote to use
|
246195
|
-
const originIndex = remoteNames.indexOf('origin');
|
246196
246530
|
const answer = await client.prompt({
|
246197
246531
|
type: 'list',
|
246198
246532
|
name: 'value',
|
246199
246533
|
message: 'Which Git remote should be used?',
|
246200
|
-
choices: remoteNames.map(name => {
|
246534
|
+
choices: remoteNames.sort().map(name => {
|
246201
246535
|
return { name: name, value: name };
|
246202
246536
|
}),
|
246203
|
-
default:
|
246537
|
+
default: remoteNames.includes('origin') ? 'origin' : undefined,
|
246204
246538
|
});
|
246205
246539
|
remoteName = answer.value;
|
246206
246540
|
}
|
246207
246541
|
const repoUrl = remoteUrls[remoteName];
|
246208
|
-
|
246542
|
+
const parsedRepoUrl = (0, connect_git_provider_1.parseRepoUrl)(repoUrl);
|
246543
|
+
if (!parsedRepoUrl) {
|
246544
|
+
throw new Error(`Failed to parse Git URL: ${repoUrl}`);
|
246545
|
+
}
|
246546
|
+
const repoUrlLink = output.link(repoUrl, (0, repo_info_to_url_1.repoInfoToUrl)(parsedRepoUrl), {
|
246547
|
+
fallback: () => (0, link_2.default)(repoUrl),
|
246548
|
+
});
|
246549
|
+
output.spinner(`Fetching Projects for ${repoUrlLink} under ${chalk_1.default.bold(org.slug)}…`);
|
246209
246550
|
let projects = [];
|
246210
246551
|
const query = new URLSearchParams({ repoUrl });
|
246211
246552
|
const projectsIterator = client.fetchPaginated(`/v9/projects?${query}`);
|
246212
|
-
|
246553
|
+
const detectedProjects = await detectedProjectsPromise;
|
246213
246554
|
for await (const chunk of projectsIterator) {
|
246214
246555
|
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
246556
|
if (chunk.pagination.next) {
|
246223
246557
|
output.spinner(`Found ${chalk_1.default.bold(projects.length)} Projects…`, 0);
|
246224
246558
|
}
|
246225
246559
|
}
|
246226
246560
|
if (projects.length === 0) {
|
246227
|
-
output.log(`No Projects are linked to ${
|
246228
|
-
|
246229
|
-
|
246230
|
-
|
246231
|
-
}
|
246232
|
-
|
246233
|
-
|
246234
|
-
|
246235
|
-
|
246236
|
-
|
246237
|
-
|
246238
|
-
|
246561
|
+
output.log(`No Projects are linked to ${repoUrlLink} under ${chalk_1.default.bold(org.slug)}.`);
|
246562
|
+
}
|
246563
|
+
else {
|
246564
|
+
output.log(`Found ${(0, pluralize_1.default)('Project', projects.length, true)} linked to ${repoUrlLink} under ${chalk_1.default.bold(org.slug)}`);
|
246565
|
+
}
|
246566
|
+
// For any projects that already exists on Vercel, remove them from the
|
246567
|
+
// locally detected directories. Any remaining ones will be prompted to
|
246568
|
+
// create new Projects for.
|
246569
|
+
for (const project of projects) {
|
246570
|
+
detectedProjects.delete(project.rootDirectory ?? '');
|
246571
|
+
}
|
246572
|
+
if (detectedProjects.size > 0) {
|
246573
|
+
output.log(`Detected ${(0, pluralize_1.default)('new Project', detectedProjects.size, true)} that may be created.`);
|
246574
|
+
}
|
246575
|
+
const addSeparators = projects.length > 0 && detectedProjects.size > 0;
|
246576
|
+
const { selected } = await client.prompt({
|
246577
|
+
type: 'checkbox',
|
246578
|
+
name: 'selected',
|
246579
|
+
message: `Which Projects should be ${projects.length ? 'linked to' : 'created'}?`,
|
246580
|
+
choices: [
|
246581
|
+
...(addSeparators
|
246582
|
+
? [new inquirer_1.default.Separator('----- Existing Projects -----')]
|
246583
|
+
: []),
|
246584
|
+
...projects.map(project => {
|
246585
|
+
return {
|
246586
|
+
name: `${org.slug}/${project.name}`,
|
246587
|
+
value: project,
|
246588
|
+
checked: true,
|
246589
|
+
};
|
246590
|
+
}),
|
246591
|
+
...(addSeparators
|
246592
|
+
? [new inquirer_1.default.Separator('----- New Projects to be created -----')]
|
246593
|
+
: []),
|
246594
|
+
...Array.from(detectedProjects.entries()).map(([rootDirectory, framework]) => {
|
246595
|
+
const name = (0, slugify_1.default)([(0, path_1.basename)(rootPath), (0, path_1.basename)(rootDirectory)]
|
246596
|
+
.filter(Boolean)
|
246597
|
+
.join('-'));
|
246598
|
+
return {
|
246599
|
+
name: `${org.slug}/${name} (${framework})`,
|
246600
|
+
value: {
|
246601
|
+
newProject: true,
|
246602
|
+
rootDirectory,
|
246603
|
+
name,
|
246604
|
+
framework,
|
246605
|
+
},
|
246606
|
+
};
|
246607
|
+
}),
|
246608
|
+
],
|
246609
|
+
});
|
246610
|
+
if (selected.length === 0) {
|
246611
|
+
output.print(`No Projects were selected. Repository not linked.\n`);
|
246239
246612
|
return;
|
246240
246613
|
}
|
246614
|
+
for (let i = 0; i < selected.length; i++) {
|
246615
|
+
const selection = selected[i];
|
246616
|
+
if (!selection.newProject)
|
246617
|
+
continue;
|
246618
|
+
const orgAndName = `${org.slug}/${selection.name}`;
|
246619
|
+
output.spinner(`Creating new Project: ${orgAndName}`);
|
246620
|
+
delete selection.newProject;
|
246621
|
+
if (!selection.rootDirectory)
|
246622
|
+
delete selection.rootDirectory;
|
246623
|
+
selected[i] = await (0, create_project_1.default)(client, selection);
|
246624
|
+
await (0, connect_git_provider_1.connectGitProvider)(client, org, selected[i].id, parsedRepoUrl.provider, `${parsedRepoUrl.org}/${parsedRepoUrl.repo}`);
|
246625
|
+
output.log(`Created new Project: ${output.link(orgAndName, `https://vercel.com/${orgAndName}`)}`);
|
246626
|
+
}
|
246241
246627
|
repoConfig = {
|
246242
246628
|
orgId: org.id,
|
246243
246629
|
remoteName,
|
246244
|
-
projects:
|
246630
|
+
projects: selected.map((project) => {
|
246245
246631
|
return {
|
246246
246632
|
id: project.id,
|
246247
246633
|
name: project.name,
|
@@ -246253,7 +246639,7 @@ async function ensureRepoLink(client, cwd, yes = false) {
|
|
246253
246639
|
await (0, link_1.writeReadme)(rootPath);
|
246254
246640
|
// update .gitignore
|
246255
246641
|
const isGitIgnoreUpdated = await (0, add_to_gitignore_1.addToGitIgnore)(rootPath);
|
246256
|
-
output.print((0, emoji_1.prependEmoji)(`Linked to ${
|
246642
|
+
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
246643
|
}
|
246258
246644
|
return {
|
246259
246645
|
repoConfig,
|
@@ -246353,7 +246739,6 @@ const chalk_1 = __importDefault(__webpack_require__(90877));
|
|
246353
246739
|
const fs_extra_1 = __webpack_require__(36365);
|
246354
246740
|
const link_1 = __webpack_require__(49347);
|
246355
246741
|
const create_project_1 = __importDefault(__webpack_require__(3410));
|
246356
|
-
const update_project_1 = __importDefault(__webpack_require__(32862));
|
246357
246742
|
const handle_error_1 = __importDefault(__webpack_require__(64377));
|
246358
246743
|
const confirm_1 = __importDefault(__webpack_require__(59320));
|
246359
246744
|
const humanize_path_1 = __importDefault(__webpack_require__(33234));
|
@@ -246497,9 +246882,10 @@ async function setupAndLink(client, path, { autoConfirm = false, forceDelete = f
|
|
246497
246882
|
if (rootDirectory) {
|
246498
246883
|
settings.rootDirectory = rootDirectory;
|
246499
246884
|
}
|
246500
|
-
const project = await (0, create_project_1.default)(client,
|
246501
|
-
|
246502
|
-
|
246885
|
+
const project = await (0, create_project_1.default)(client, {
|
246886
|
+
...settings,
|
246887
|
+
name: newProjectName,
|
246888
|
+
});
|
246503
246889
|
await (0, link_1.linkFolderToProject)(client, path, {
|
246504
246890
|
projectId: project.id,
|
246505
246891
|
orgId: org.id,
|
@@ -248363,16 +248749,56 @@ exports.addDomainToProject = addDomainToProject;
|
|
248363
248749
|
"use strict";
|
248364
248750
|
|
248365
248751
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
248366
|
-
async function createProject(client,
|
248752
|
+
async function createProject(client, settings) {
|
248367
248753
|
const project = await client.fetch('/v1/projects', {
|
248368
248754
|
method: 'POST',
|
248369
|
-
body: {
|
248755
|
+
body: { ...settings },
|
248370
248756
|
});
|
248371
248757
|
return project;
|
248372
248758
|
}
|
248373
248759
|
exports.default = createProject;
|
248374
248760
|
|
248375
248761
|
|
248762
|
+
/***/ }),
|
248763
|
+
|
248764
|
+
/***/ 9268:
|
248765
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
248766
|
+
|
248767
|
+
"use strict";
|
248768
|
+
|
248769
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
248770
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
248771
|
+
};
|
248772
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
248773
|
+
exports.detectProjects = void 0;
|
248774
|
+
const path_1 = __webpack_require__(85622);
|
248775
|
+
const frameworks_1 = __importDefault(__webpack_require__(36678));
|
248776
|
+
const fs_detectors_1 = __webpack_require__(88995);
|
248777
|
+
async function detectProjects(cwd) {
|
248778
|
+
const fs = new fs_detectors_1.LocalFileSystemDetector(cwd);
|
248779
|
+
const workspaces = await (0, fs_detectors_1.getWorkspaces)({ fs });
|
248780
|
+
const detectedProjects = new Map();
|
248781
|
+
const packagePaths = (await Promise.all(workspaces.map(workspace => (0, fs_detectors_1.getWorkspacePackagePaths)({
|
248782
|
+
fs,
|
248783
|
+
workspace,
|
248784
|
+
})))).flat();
|
248785
|
+
if (packagePaths.length === 0) {
|
248786
|
+
packagePaths.push('/');
|
248787
|
+
}
|
248788
|
+
await Promise.all(packagePaths.map(async (p) => {
|
248789
|
+
const framework = await (0, fs_detectors_1.detectFramework)({
|
248790
|
+
fs: fs.chdir((0, path_1.join)('.', p)),
|
248791
|
+
frameworkList: frameworks_1.default,
|
248792
|
+
});
|
248793
|
+
if (!framework)
|
248794
|
+
return;
|
248795
|
+
detectedProjects.set(p.slice(1), framework);
|
248796
|
+
}));
|
248797
|
+
return detectedProjects;
|
248798
|
+
}
|
248799
|
+
exports.detectProjects = detectProjects;
|
248800
|
+
|
248801
|
+
|
248376
248802
|
/***/ }),
|
248377
248803
|
|
248378
248804
|
/***/ 18693:
|
@@ -248951,26 +249377,6 @@ async function removeProject(client, projectNameOrId) {
|
|
248951
249377
|
exports.default = removeProject;
|
248952
249378
|
|
248953
249379
|
|
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
249380
|
/***/ }),
|
248975
249381
|
|
248976
249382
|
/***/ 60076:
|
@@ -250038,7 +250444,7 @@ module.exports = JSON.parse("[[[0,44],\"disallowed_STD3_valid\"],[[45,46],\"vali
|
|
250038
250444
|
/***/ ((module) => {
|
250039
250445
|
|
250040
250446
|
"use strict";
|
250041
|
-
module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.
|
250447
|
+
module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"12.6.4\",\"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.1\",\"@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
250448
|
|
250043
250449
|
/***/ }),
|
250044
250450
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "31.0.
|
3
|
+
"version": "31.0.2",
|
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.
|
25
|
+
"@vercel/build-utils": "6.8.1",
|
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.
|
29
|
+
"@vercel/node": "2.15.4",
|
30
30
|
"@vercel/python": "3.1.60",
|
31
31
|
"@vercel/redwood": "1.1.15",
|
32
|
-
"@vercel/remix-builder": "1.8.
|
32
|
+
"@vercel/remix-builder": "1.8.16",
|
33
33
|
"@vercel/ruby": "1.3.76",
|
34
|
-
"@vercel/static-build": "1.3.
|
34
|
+
"@vercel/static-build": "1.3.39"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
37
37
|
"@alex_neo/jest-expect-message": "1.0.5",
|
@@ -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": "1.0.
|
78
|
+
"@vercel-internals/constants": "1.0.4",
|
79
79
|
"@vercel-internals/get-package-json": "1.0.0",
|
80
|
-
"@vercel-internals/types": "1.0.
|
81
|
-
"@vercel/client": "12.6.
|
80
|
+
"@vercel-internals/types": "1.0.4",
|
81
|
+
"@vercel/client": "12.6.4",
|
82
82
|
"@vercel/error-utils": "1.0.10",
|
83
83
|
"@vercel/frameworks": "1.4.3",
|
84
84
|
"@vercel/fs-detectors": "4.0.1",
|
@@ -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",
|
package/scripts/preinstall.js
DELETED
@@ -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
|
-
});
|