vercel 27.1.2 → 27.1.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 +86 -55
- package/package.json +2 -2
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,53 @@ 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
|
+
await writeBuildsJsonPromise;
|
231008
|
+
const buildJsonBuild = buildsJsonBuilds.get(build);
|
231009
|
+
if (buildJsonBuild) {
|
231010
|
+
buildJsonBuild.error = {
|
231011
|
+
name: err.name,
|
231012
|
+
message: err.message,
|
231013
|
+
stack: err.stack,
|
231014
|
+
...err,
|
231015
|
+
};
|
231016
|
+
await fs_extra_1.default.writeJSON(buildsJsonPath, buildsJson, {
|
231017
|
+
spaces: 2,
|
231018
|
+
});
|
231019
|
+
}
|
231020
|
+
return 1;
|
231021
|
+
}
|
230997
231022
|
}
|
230998
231023
|
if (corepackShimDir) {
|
230999
231024
|
corepack_1.cleanupCorepack(corepackShimDir);
|
@@ -239122,6 +239147,7 @@ const build_utils_1 = __webpack_require__(3131);
|
|
239122
239147
|
const promisepipe_1 = __importDefault(__webpack_require__(48568));
|
239123
239148
|
const unzip_1 = __webpack_require__(58168);
|
239124
239149
|
const link_1 = __webpack_require__(67630);
|
239150
|
+
const { normalize } = path_1.posix;
|
239125
239151
|
exports.OUTPUT_DIR = path_1.join(link_1.VERCEL_DIR, 'output');
|
239126
239152
|
async function writeBuildResult(outputDir, buildResult, build, builder, builderPkg, cleanUrls) {
|
239127
239153
|
const { version } = builder;
|
@@ -239147,6 +239173,12 @@ function isFile(v) {
|
|
239147
239173
|
const type = v?.type;
|
239148
239174
|
return type === 'FileRef' || type === 'FileFsRef' || type === 'FileBlob';
|
239149
239175
|
}
|
239176
|
+
/**
|
239177
|
+
* Remove duplicate slashes as well as leading/trailing slashes.
|
239178
|
+
*/
|
239179
|
+
function stripDuplicateSlashes(path) {
|
239180
|
+
return normalize(path).replace(/(^\/|\/$)/g, '');
|
239181
|
+
}
|
239150
239182
|
/**
|
239151
239183
|
* Writes the output from the `build()` return value of a v2 Builder to
|
239152
239184
|
* the filesystem.
|
@@ -239159,16 +239191,17 @@ async function writeBuildResultV2(outputDir, buildResult, cleanUrls) {
|
|
239159
239191
|
const lambdas = new Map();
|
239160
239192
|
const overrides = {};
|
239161
239193
|
for (const [path, output] of Object.entries(buildResult.output)) {
|
239194
|
+
const normalizedPath = stripDuplicateSlashes(path);
|
239162
239195
|
if (isLambda(output)) {
|
239163
|
-
await writeLambda(outputDir, output,
|
239196
|
+
await writeLambda(outputDir, output, normalizedPath, lambdas);
|
239164
239197
|
}
|
239165
239198
|
else if (isPrerender(output)) {
|
239166
|
-
await writeLambda(outputDir, output.lambda,
|
239199
|
+
await writeLambda(outputDir, output.lambda, normalizedPath, lambdas);
|
239167
239200
|
// Write the fallback file alongside the Lambda directory
|
239168
239201
|
let fallback = output.fallback;
|
239169
239202
|
if (fallback) {
|
239170
239203
|
const ext = getFileExtension(fallback);
|
239171
|
-
const fallbackName = `${
|
239204
|
+
const fallbackName = `${normalizedPath}.prerender-fallback${ext}`;
|
239172
239205
|
const fallbackPath = path_1.join(outputDir, 'functions', fallbackName);
|
239173
239206
|
const stream = fallback.toStream();
|
239174
239207
|
await promisepipe_1.default(stream, fs_extra_1.default.createWriteStream(fallbackPath, { mode: fallback.mode }));
|
@@ -239177,7 +239210,7 @@ async function writeBuildResultV2(outputDir, buildResult, cleanUrls) {
|
|
239177
239210
|
fsPath: path_1.basename(fallbackName),
|
239178
239211
|
});
|
239179
239212
|
}
|
239180
|
-
const prerenderConfigPath = path_1.join(outputDir, 'functions', `${
|
239213
|
+
const prerenderConfigPath = path_1.join(outputDir, 'functions', `${normalizedPath}.prerender-config.json`);
|
239181
239214
|
const prerenderConfig = {
|
239182
239215
|
...output,
|
239183
239216
|
lambda: undefined,
|
@@ -239186,13 +239219,13 @@ async function writeBuildResultV2(outputDir, buildResult, cleanUrls) {
|
|
239186
239219
|
await fs_extra_1.default.writeJSON(prerenderConfigPath, prerenderConfig, { spaces: 2 });
|
239187
239220
|
}
|
239188
239221
|
else if (isFile(output)) {
|
239189
|
-
await writeStaticFile(outputDir, output,
|
239222
|
+
await writeStaticFile(outputDir, output, normalizedPath, overrides, cleanUrls);
|
239190
239223
|
}
|
239191
239224
|
else if (isEdgeFunction(output)) {
|
239192
|
-
await writeEdgeFunction(outputDir, output,
|
239225
|
+
await writeEdgeFunction(outputDir, output, normalizedPath);
|
239193
239226
|
}
|
239194
239227
|
else {
|
239195
|
-
throw new Error(`Unsupported output type: "${output.type}" for ${
|
239228
|
+
throw new Error(`Unsupported output type: "${output.type}" for ${normalizedPath}`);
|
239196
239229
|
}
|
239197
239230
|
}
|
239198
239231
|
return Object.keys(overrides).length > 0 ? overrides : undefined;
|
@@ -239208,9 +239241,7 @@ async function writeBuildResultV3(outputDir, buildResult, build) {
|
|
239208
239241
|
throw new Error(`Expected "build.src" to be a string`);
|
239209
239242
|
}
|
239210
239243
|
const ext = path_1.extname(src);
|
239211
|
-
const path = build.config?.zeroConfig
|
239212
|
-
? src.substring(0, src.length - ext.length)
|
239213
|
-
: src;
|
239244
|
+
const path = stripDuplicateSlashes(build.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src);
|
239214
239245
|
if (isLambda(output)) {
|
239215
239246
|
await writeLambda(outputDir, output, path);
|
239216
239247
|
}
|
@@ -252655,7 +252686,7 @@ module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source
|
|
252655
252686
|
/***/ ((module) => {
|
252656
252687
|
|
252657
252688
|
"use strict";
|
252658
|
-
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"27.1.
|
252689
|
+
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"27.1.3\",\"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.5\",\"@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\":\"e2d4efab08e15a9f9177672e1591ba92ba1b7090\"}");
|
252659
252690
|
|
252660
252691
|
/***/ }),
|
252661
252692
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "27.1.
|
3
|
+
"version": "27.1.3",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -195,5 +195,5 @@
|
|
195
195
|
"<rootDir>/test/**/*.test.ts"
|
196
196
|
]
|
197
197
|
},
|
198
|
-
"gitHead": "
|
198
|
+
"gitHead": "e2d4efab08e15a9f9177672e1591ba92ba1b7090"
|
199
199
|
}
|