vercel 27.1.1 → 27.1.4
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 +94 -55
- package/package.json +4 -4
package/dist/index.js
CHANGED
@@ -230924,26 +230924,33 @@ async function main(client) {
|
|
230924
230924
|
await fs_extra_1.default.mkdirp(outputDir);
|
230925
230925
|
const ops = [];
|
230926
230926
|
// Write the `detectedBuilders` result to output dir
|
230927
|
-
|
230928
|
-
|
230929
|
-
|
230930
|
-
|
230931
|
-
|
230932
|
-
|
230933
|
-
|
230934
|
-
|
230935
|
-
|
230936
|
-
const { builder, pkg: builderPkg } = builderWithPkg;
|
230937
|
-
return {
|
230927
|
+
const buildsJsonBuilds = new Map(builds.map(build => {
|
230928
|
+
const builderWithPkg = buildersWithPkgs.get(build.use);
|
230929
|
+
if (!builderWithPkg) {
|
230930
|
+
throw new Error(`Failed to load Builder "${build.use}"`);
|
230931
|
+
}
|
230932
|
+
const { builder, pkg: builderPkg } = builderWithPkg;
|
230933
|
+
return [
|
230934
|
+
build,
|
230935
|
+
{
|
230938
230936
|
require: builderPkg.name,
|
230939
230937
|
requirePath: builderWithPkg.path,
|
230940
230938
|
apiVersion: builder.version,
|
230941
230939
|
...build,
|
230942
|
-
}
|
230943
|
-
|
230944
|
-
}, {
|
230945
|
-
spaces: 2,
|
230940
|
+
},
|
230941
|
+
];
|
230946
230942
|
}));
|
230943
|
+
const buildsJson = {
|
230944
|
+
'//': 'This file was generated by the `vercel build` command. It is not part of the Build Output API.',
|
230945
|
+
target,
|
230946
|
+
argv: process.argv,
|
230947
|
+
builds: Array.from(buildsJsonBuilds.values()),
|
230948
|
+
};
|
230949
|
+
const buildsJsonPath = path_1.join(outputDir, 'builds.json');
|
230950
|
+
const writeBuildsJsonPromise = fs_extra_1.default.writeJSON(buildsJsonPath, buildsJson, {
|
230951
|
+
spaces: 2,
|
230952
|
+
});
|
230953
|
+
ops.push(writeBuildsJsonPromise);
|
230947
230954
|
// The `meta` config property is re-used for each Builder
|
230948
230955
|
// invocation so that Builders can share state between
|
230949
230956
|
// subsequent entrypoint builds.
|
@@ -230965,35 +230972,57 @@ async function main(client) {
|
|
230965
230972
|
if (!builderWithPkg) {
|
230966
230973
|
throw new Error(`Failed to load Builder "${build.use}"`);
|
230967
230974
|
}
|
230968
|
-
|
230969
|
-
|
230970
|
-
|
230971
|
-
|
230972
|
-
|
230973
|
-
|
230974
|
-
|
230975
|
-
|
230976
|
-
|
230977
|
-
|
230978
|
-
|
230979
|
-
|
230980
|
-
|
230981
|
-
|
230982
|
-
|
230983
|
-
|
230984
|
-
|
230985
|
-
|
230986
|
-
|
230987
|
-
|
230988
|
-
|
230989
|
-
|
230990
|
-
|
230991
|
-
|
230992
|
-
|
230993
|
-
|
230994
|
-
|
230995
|
-
|
230996
|
-
|
230975
|
+
try {
|
230976
|
+
const { builder, pkg: builderPkg } = builderWithPkg;
|
230977
|
+
const buildConfig = {
|
230978
|
+
outputDirectory: project.settings.outputDirectory ?? undefined,
|
230979
|
+
...build.config,
|
230980
|
+
projectSettings: project.settings,
|
230981
|
+
installCommand: project.settings.installCommand ?? undefined,
|
230982
|
+
devCommand: project.settings.devCommand ?? undefined,
|
230983
|
+
buildCommand: project.settings.buildCommand ?? undefined,
|
230984
|
+
framework: project.settings.framework,
|
230985
|
+
nodeVersion: project.settings.nodeVersion,
|
230986
|
+
};
|
230987
|
+
const buildOptions = {
|
230988
|
+
files: filesMap,
|
230989
|
+
entrypoint: build.src,
|
230990
|
+
workPath,
|
230991
|
+
repoRootPath,
|
230992
|
+
config: buildConfig,
|
230993
|
+
meta,
|
230994
|
+
};
|
230995
|
+
output.debug(`Building entrypoint "${build.src}" with "${builderPkg.name}"`);
|
230996
|
+
const buildResult = await builder.build(buildOptions);
|
230997
|
+
// Store the build result to generate the final `config.json` after
|
230998
|
+
// all builds have completed
|
230999
|
+
buildResults.set(build, buildResult);
|
231000
|
+
// Start flushing the file outputs to the filesystem asynchronously
|
231001
|
+
ops.push(write_build_result_1.writeBuildResult(outputDir, buildResult, build, builder, builderPkg, vercelConfig?.cleanUrls).then(override => {
|
231002
|
+
if (override)
|
231003
|
+
overrides.push(override);
|
231004
|
+
}, err => err));
|
231005
|
+
}
|
231006
|
+
catch (err) {
|
231007
|
+
const configJson = {
|
231008
|
+
version: 3,
|
231009
|
+
};
|
231010
|
+
const configJsonPromise = fs_extra_1.default.writeJSON(path_1.join(outputDir, 'config.json'), configJson, { spaces: 2 });
|
231011
|
+
await Promise.all([writeBuildsJsonPromise, configJsonPromise]);
|
231012
|
+
const buildJsonBuild = buildsJsonBuilds.get(build);
|
231013
|
+
if (buildJsonBuild) {
|
231014
|
+
buildJsonBuild.error = {
|
231015
|
+
name: err.name,
|
231016
|
+
message: err.message,
|
231017
|
+
stack: err.stack,
|
231018
|
+
...err,
|
231019
|
+
};
|
231020
|
+
await fs_extra_1.default.writeJSON(buildsJsonPath, buildsJson, {
|
231021
|
+
spaces: 2,
|
231022
|
+
});
|
231023
|
+
}
|
231024
|
+
return 1;
|
231025
|
+
}
|
230997
231026
|
}
|
230998
231027
|
if (corepackShimDir) {
|
230999
231028
|
corepack_1.cleanupCorepack(corepackShimDir);
|
@@ -231888,6 +231917,7 @@ exports.default = async (client) => {
|
|
231888
231917
|
// deprecated
|
231889
231918
|
'--name': String,
|
231890
231919
|
'-n': '--name',
|
231920
|
+
'--no-clipboard': Boolean,
|
231891
231921
|
'--target': String,
|
231892
231922
|
});
|
231893
231923
|
}
|
@@ -231952,6 +231982,9 @@ exports.default = async (client) => {
|
|
231952
231982
|
if (argv['--name']) {
|
231953
231983
|
output.print(`${emoji_1.prependEmoji(`The ${param_1.default('--name')} option is deprecated (https://vercel.link/name-flag)`, emoji_1.emoji('warning'))}\n`);
|
231954
231984
|
}
|
231985
|
+
if (argv['--no-clipboard']) {
|
231986
|
+
output.print(`${emoji_1.prependEmoji(`The ${param_1.default('--no-clipboard')} option was ignored because it is the default behavior. Please remove it.`, emoji_1.emoji('warning'))}\n`);
|
231987
|
+
}
|
231955
231988
|
// build `target`
|
231956
231989
|
const target = parse_target_1.default(output, argv['--target'], argv['--prod']);
|
231957
231990
|
if (typeof target === 'number') {
|
@@ -239118,6 +239151,7 @@ const build_utils_1 = __webpack_require__(3131);
|
|
239118
239151
|
const promisepipe_1 = __importDefault(__webpack_require__(48568));
|
239119
239152
|
const unzip_1 = __webpack_require__(58168);
|
239120
239153
|
const link_1 = __webpack_require__(67630);
|
239154
|
+
const { normalize } = path_1.posix;
|
239121
239155
|
exports.OUTPUT_DIR = path_1.join(link_1.VERCEL_DIR, 'output');
|
239122
239156
|
async function writeBuildResult(outputDir, buildResult, build, builder, builderPkg, cleanUrls) {
|
239123
239157
|
const { version } = builder;
|
@@ -239143,6 +239177,12 @@ function isFile(v) {
|
|
239143
239177
|
const type = v?.type;
|
239144
239178
|
return type === 'FileRef' || type === 'FileFsRef' || type === 'FileBlob';
|
239145
239179
|
}
|
239180
|
+
/**
|
239181
|
+
* Remove duplicate slashes as well as leading/trailing slashes.
|
239182
|
+
*/
|
239183
|
+
function stripDuplicateSlashes(path) {
|
239184
|
+
return normalize(path).replace(/(^\/|\/$)/g, '');
|
239185
|
+
}
|
239146
239186
|
/**
|
239147
239187
|
* Writes the output from the `build()` return value of a v2 Builder to
|
239148
239188
|
* the filesystem.
|
@@ -239155,16 +239195,17 @@ async function writeBuildResultV2(outputDir, buildResult, cleanUrls) {
|
|
239155
239195
|
const lambdas = new Map();
|
239156
239196
|
const overrides = {};
|
239157
239197
|
for (const [path, output] of Object.entries(buildResult.output)) {
|
239198
|
+
const normalizedPath = stripDuplicateSlashes(path);
|
239158
239199
|
if (isLambda(output)) {
|
239159
|
-
await writeLambda(outputDir, output,
|
239200
|
+
await writeLambda(outputDir, output, normalizedPath, lambdas);
|
239160
239201
|
}
|
239161
239202
|
else if (isPrerender(output)) {
|
239162
|
-
await writeLambda(outputDir, output.lambda,
|
239203
|
+
await writeLambda(outputDir, output.lambda, normalizedPath, lambdas);
|
239163
239204
|
// Write the fallback file alongside the Lambda directory
|
239164
239205
|
let fallback = output.fallback;
|
239165
239206
|
if (fallback) {
|
239166
239207
|
const ext = getFileExtension(fallback);
|
239167
|
-
const fallbackName = `${
|
239208
|
+
const fallbackName = `${normalizedPath}.prerender-fallback${ext}`;
|
239168
239209
|
const fallbackPath = path_1.join(outputDir, 'functions', fallbackName);
|
239169
239210
|
const stream = fallback.toStream();
|
239170
239211
|
await promisepipe_1.default(stream, fs_extra_1.default.createWriteStream(fallbackPath, { mode: fallback.mode }));
|
@@ -239173,7 +239214,7 @@ async function writeBuildResultV2(outputDir, buildResult, cleanUrls) {
|
|
239173
239214
|
fsPath: path_1.basename(fallbackName),
|
239174
239215
|
});
|
239175
239216
|
}
|
239176
|
-
const prerenderConfigPath = path_1.join(outputDir, 'functions', `${
|
239217
|
+
const prerenderConfigPath = path_1.join(outputDir, 'functions', `${normalizedPath}.prerender-config.json`);
|
239177
239218
|
const prerenderConfig = {
|
239178
239219
|
...output,
|
239179
239220
|
lambda: undefined,
|
@@ -239182,13 +239223,13 @@ async function writeBuildResultV2(outputDir, buildResult, cleanUrls) {
|
|
239182
239223
|
await fs_extra_1.default.writeJSON(prerenderConfigPath, prerenderConfig, { spaces: 2 });
|
239183
239224
|
}
|
239184
239225
|
else if (isFile(output)) {
|
239185
|
-
await writeStaticFile(outputDir, output,
|
239226
|
+
await writeStaticFile(outputDir, output, normalizedPath, overrides, cleanUrls);
|
239186
239227
|
}
|
239187
239228
|
else if (isEdgeFunction(output)) {
|
239188
|
-
await writeEdgeFunction(outputDir, output,
|
239229
|
+
await writeEdgeFunction(outputDir, output, normalizedPath);
|
239189
239230
|
}
|
239190
239231
|
else {
|
239191
|
-
throw new Error(`Unsupported output type: "${output.type}" for ${
|
239232
|
+
throw new Error(`Unsupported output type: "${output.type}" for ${normalizedPath}`);
|
239192
239233
|
}
|
239193
239234
|
}
|
239194
239235
|
return Object.keys(overrides).length > 0 ? overrides : undefined;
|
@@ -239204,9 +239245,7 @@ async function writeBuildResultV3(outputDir, buildResult, build) {
|
|
239204
239245
|
throw new Error(`Expected "build.src" to be a string`);
|
239205
239246
|
}
|
239206
239247
|
const ext = path_1.extname(src);
|
239207
|
-
const path = build.config?.zeroConfig
|
239208
|
-
? src.substring(0, src.length - ext.length)
|
239209
|
-
: src;
|
239248
|
+
const path = stripDuplicateSlashes(build.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src);
|
239210
239249
|
if (isLambda(output)) {
|
239211
239250
|
await writeLambda(outputDir, output, path);
|
239212
239251
|
}
|
@@ -252651,7 +252690,7 @@ module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source
|
|
252651
252690
|
/***/ ((module) => {
|
252652
252691
|
|
252653
252692
|
"use strict";
|
252654
|
-
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"27.1.
|
252693
|
+
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"27.1.4\",\"preferGlobal\":true,\"license\":\"Apache-2.0\",\"description\":\"The command-line interface for Vercel\",\"homepage\":\"https://vercel.com\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/cli\"},\"scripts\":{\"preinstall\":\"node ./scripts/preinstall.js\",\"test\":\"jest --env node --verbose --runInBand --bail --forceExit\",\"test-unit\":\"yarn test test/unit/\",\"test-integration-cli\":\"rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose\",\"test-integration-dev\":\"yarn test test/dev/\",\"prepublishOnly\":\"yarn build\",\"coverage\":\"codecov\",\"build\":\"node -r ts-eager/register ./scripts/build.ts\",\"build-dev\":\"node -r ts-eager/register ./scripts/build.ts --dev\"},\"bin\":{\"vc\":\"./dist/index.js\",\"vercel\":\"./dist/index.js\"},\"files\":[\"dist\",\"scripts/preinstall.js\"],\"ava\":{\"extensions\":[\"ts\"],\"require\":[\"ts-node/register/transpile-only\",\"esm\"]},\"engines\":{\"node\":\">= 14\"},\"dependencies\":{\"@vercel/build-utils\":\"5.0.2\",\"@vercel/go\":\"2.0.6\",\"@vercel/hydrogen\":\"0.0.3\",\"@vercel/next\":\"3.1.6\",\"@vercel/node\":\"2.4.3\",\"@vercel/python\":\"3.0.6\",\"@vercel/redwood\":\"1.0.7\",\"@vercel/remix\":\"1.0.8\",\"@vercel/ruby\":\"1.3.14\",\"@vercel/static-build\":\"1.0.7\",\"update-notifier\":\"5.1.0\"},\"devDependencies\":{\"@alex_neo/jest-expect-message\":\"1.0.5\",\"@next/env\":\"11.1.2\",\"@sentry/node\":\"5.5.0\",\"@sindresorhus/slugify\":\"0.11.0\",\"@tootallnate/once\":\"1.1.2\",\"@types/ansi-escapes\":\"3.0.0\",\"@types/ansi-regex\":\"4.0.0\",\"@types/async-retry\":\"1.2.1\",\"@types/bytes\":\"3.0.0\",\"@types/chance\":\"1.1.3\",\"@types/debug\":\"0.0.31\",\"@types/dotenv\":\"6.1.1\",\"@types/escape-html\":\"0.0.20\",\"@types/express\":\"4.17.13\",\"@types/fs-extra\":\"9.0.13\",\"@types/glob\":\"7.1.1\",\"@types/http-proxy\":\"1.16.2\",\"@types/ini\":\"1.3.31\",\"@types/inquirer\":\"7.3.1\",\"@types/jest\":\"27.4.1\",\"@types/jest-expect-message\":\"1.0.3\",\"@types/load-json-file\":\"2.0.7\",\"@types/mime-types\":\"2.1.0\",\"@types/minimatch\":\"3.0.3\",\"@types/mri\":\"1.1.0\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"11.11.0\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@types/progress\":\"2.0.3\",\"@types/psl\":\"1.1.0\",\"@types/semver\":\"6.0.1\",\"@types/tar-fs\":\"1.16.1\",\"@types/text-table\":\"0.2.0\",\"@types/title\":\"3.4.1\",\"@types/universal-analytics\":\"0.4.2\",\"@types/update-notifier\":\"5.1.0\",\"@types/which\":\"1.3.2\",\"@types/write-json-file\":\"2.2.1\",\"@types/yauzl-promise\":\"2.1.0\",\"@vercel/client\":\"12.1.1\",\"@vercel/frameworks\":\"1.1.0\",\"@vercel/fs-detectors\":\"2.0.0\",\"@vercel/ncc\":\"0.24.0\",\"@zeit/fun\":\"0.11.2\",\"@zeit/source-map-support\":\"0.6.2\",\"ajv\":\"6.12.2\",\"alpha-sort\":\"2.0.1\",\"ansi-escapes\":\"3.0.0\",\"ansi-regex\":\"3.0.0\",\"arg\":\"5.0.0\",\"async-listen\":\"1.2.0\",\"async-retry\":\"1.1.3\",\"async-sema\":\"2.1.4\",\"ava\":\"2.2.0\",\"bytes\":\"3.0.0\",\"chalk\":\"4.1.0\",\"chance\":\"1.1.7\",\"chokidar\":\"3.3.1\",\"codecov\":\"3.8.2\",\"cpy\":\"7.2.0\",\"credit-card\":\"3.0.1\",\"date-fns\":\"1.29.0\",\"debug\":\"3.1.0\",\"dot\":\"1.1.3\",\"dotenv\":\"4.0.0\",\"email-prompt\":\"0.3.2\",\"email-validator\":\"1.1.1\",\"epipebomb\":\"1.0.0\",\"escape-html\":\"1.0.3\",\"esm\":\"3.1.4\",\"execa\":\"3.2.0\",\"express\":\"4.17.1\",\"fast-deep-equal\":\"3.1.3\",\"fs-extra\":\"10.0.0\",\"get-port\":\"5.1.1\",\"git-last-commit\":\"1.0.1\",\"glob\":\"7.1.2\",\"http-proxy\":\"1.18.1\",\"ini\":\"3.0.0\",\"inquirer\":\"7.0.4\",\"is-docker\":\"2.2.1\",\"is-port-reachable\":\"3.1.0\",\"is-url\":\"1.2.2\",\"jaro-winkler\":\"0.2.8\",\"jsonlines\":\"0.1.1\",\"load-json-file\":\"3.0.0\",\"mime-types\":\"2.1.24\",\"minimatch\":\"3.0.4\",\"mri\":\"1.1.5\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.1\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.4.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"progress\":\"2.0.3\",\"promisepipe\":\"3.0.0\",\"psl\":\"1.1.31\",\"qr-image\":\"3.2.0\",\"raw-body\":\"2.4.1\",\"rimraf\":\"3.0.2\",\"semver\":\"5.5.0\",\"serve-handler\":\"6.1.1\",\"strip-ansi\":\"5.2.0\",\"stripe\":\"5.1.0\",\"tar-fs\":\"1.16.3\",\"test-listen\":\"1.1.0\",\"text-table\":\"0.2.0\",\"title\":\"3.4.1\",\"tmp-promise\":\"1.0.3\",\"tree-kill\":\"1.2.2\",\"ts-node\":\"8.3.0\",\"typescript\":\"4.3.4\",\"universal-analytics\":\"0.4.20\",\"utility-types\":\"2.1.0\",\"which\":\"2.0.2\",\"write-json-file\":\"2.2.0\",\"xdg-app-paths\":\"5.1.0\",\"yauzl-promise\":\"2.1.3\"},\"jest\":{\"preset\":\"ts-jest\",\"globals\":{\"ts-jest\":{\"diagnostics\":false,\"isolatedModules\":true}},\"setupFilesAfterEnv\":[\"@alex_neo/jest-expect-message\"],\"verbose\":false,\"testEnvironment\":\"node\",\"testMatch\":[\"<rootDir>/test/**/*.test.ts\"]},\"gitHead\":\"1be7a80bb8688cd3567fd1f2dacf9ab4b8c4149e\"}");
|
252655
252694
|
|
252656
252695
|
/***/ }),
|
252657
252696
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "27.1.
|
3
|
+
"version": "27.1.4",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -45,13 +45,13 @@
|
|
45
45
|
"@vercel/build-utils": "5.0.2",
|
46
46
|
"@vercel/go": "2.0.6",
|
47
47
|
"@vercel/hydrogen": "0.0.3",
|
48
|
-
"@vercel/next": "3.1.
|
48
|
+
"@vercel/next": "3.1.6",
|
49
49
|
"@vercel/node": "2.4.3",
|
50
50
|
"@vercel/python": "3.0.6",
|
51
51
|
"@vercel/redwood": "1.0.7",
|
52
52
|
"@vercel/remix": "1.0.8",
|
53
53
|
"@vercel/ruby": "1.3.14",
|
54
|
-
"@vercel/static-build": "1.0.
|
54
|
+
"@vercel/static-build": "1.0.7",
|
55
55
|
"update-notifier": "5.1.0"
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
@@ -195,5 +195,5 @@
|
|
195
195
|
"<rootDir>/test/**/*.test.ts"
|
196
196
|
]
|
197
197
|
},
|
198
|
-
"gitHead": "
|
198
|
+
"gitHead": "1be7a80bb8688cd3567fd1f2dacf9ab4b8c4149e"
|
199
199
|
}
|