vercel 28.5.3 → 28.5.5
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 +34 -64
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -220282,7 +220282,6 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
220282
220282
|
redirectRoutes: null,
|
220283
220283
|
rewriteRoutes: null,
|
220284
220284
|
errorRoutes: null,
|
220285
|
-
limitedRoutes: null,
|
220286
220285
|
};
|
220287
220286
|
}
|
220288
220287
|
const sortedFiles = files.sort(sortFiles);
|
@@ -220330,7 +220329,6 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
220330
220329
|
redirectRoutes: null,
|
220331
220330
|
rewriteRoutes: null,
|
220332
220331
|
errorRoutes: null,
|
220333
|
-
limitedRoutes: null,
|
220334
220332
|
};
|
220335
220333
|
}
|
220336
220334
|
if (apiRoute) {
|
@@ -220385,7 +220383,6 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
220385
220383
|
defaultRoutes: null,
|
220386
220384
|
rewriteRoutes: null,
|
220387
220385
|
errorRoutes: null,
|
220388
|
-
limitedRoutes: null,
|
220389
220386
|
};
|
220390
220387
|
}
|
220391
220388
|
// If `outputDirectory` is an empty string,
|
@@ -220422,7 +220419,6 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
220422
220419
|
defaultRoutes: null,
|
220423
220420
|
rewriteRoutes: null,
|
220424
220421
|
errorRoutes: null,
|
220425
|
-
limitedRoutes: null,
|
220426
220422
|
};
|
220427
220423
|
}
|
220428
220424
|
// Exclude the middleware builder for Next.js apps since @vercel/next
|
@@ -220455,7 +220451,7 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
220455
220451
|
});
|
220456
220452
|
}
|
220457
220453
|
}
|
220458
|
-
const routesResult = getRouteResult(
|
220454
|
+
const routesResult = getRouteResult(apiRoutes, dynamicRoutes, usedOutputDirectory, apiBuilders, frontendBuilder, options);
|
220459
220455
|
return {
|
220460
220456
|
warnings,
|
220461
220457
|
builders: builders.length ? builders : null,
|
@@ -220464,7 +220460,6 @@ async function detectBuilders(files, pkg, options = {}) {
|
|
220464
220460
|
defaultRoutes: routesResult.defaultRoutes,
|
220465
220461
|
rewriteRoutes: routesResult.rewriteRoutes,
|
220466
220462
|
errorRoutes: routesResult.errorRoutes,
|
220467
|
-
limitedRoutes: routesResult.limitedRoutes,
|
220468
220463
|
};
|
220469
220464
|
}
|
220470
220465
|
exports.detectBuilders = detectBuilders;
|
@@ -220915,17 +220910,11 @@ function createRouteFromPath(filePath, featHandleMiss, cleanUrls) {
|
|
220915
220910
|
}
|
220916
220911
|
return { route, isDynamic };
|
220917
220912
|
}
|
220918
|
-
function getRouteResult(
|
220919
|
-
const deps = Object.assign({}, pkg?.dependencies, pkg?.devDependencies);
|
220913
|
+
function getRouteResult(apiRoutes, dynamicRoutes, outputDirectory, apiBuilders, frontendBuilder, options) {
|
220920
220914
|
const defaultRoutes = [];
|
220921
220915
|
const redirectRoutes = [];
|
220922
220916
|
const rewriteRoutes = [];
|
220923
220917
|
const errorRoutes = [];
|
220924
|
-
const limitedRoutes = {
|
220925
|
-
defaultRoutes: [],
|
220926
|
-
redirectRoutes: [],
|
220927
|
-
rewriteRoutes: [],
|
220928
|
-
};
|
220929
220918
|
const framework = frontendBuilder?.config?.framework || '';
|
220930
220919
|
const isNextjs = framework === 'nextjs' || is_official_runtime_1.isOfficialRuntime('next', frontendBuilder?.use);
|
220931
220920
|
const ignoreRuntimes = slugToFramework.get(framework)?.ignoreRuntimes;
|
@@ -220936,29 +220925,10 @@ function getRouteResult(pkg, apiRoutes, dynamicRoutes, outputDirectory, apiBuild
|
|
220936
220925
|
// return a copy of routes.
|
220937
220926
|
// We should exclud errorRoutes and
|
220938
220927
|
const extSet = detectApiExtensions(apiBuilders);
|
220939
|
-
const withTag = options.tag ? `@${options.tag}` : '';
|
220940
|
-
const extSetLimited = detectApiExtensions(apiBuilders.filter(b => {
|
220941
|
-
if (b.use === `@vercel/python${withTag}` &&
|
220942
|
-
!('vercel-plugin-python' in deps)) {
|
220943
|
-
return false;
|
220944
|
-
}
|
220945
|
-
if (b.use === `@vercel/go${withTag}` &&
|
220946
|
-
!('vercel-plugin-go' in deps)) {
|
220947
|
-
return false;
|
220948
|
-
}
|
220949
|
-
if (b.use === `@vercel/ruby${withTag}` &&
|
220950
|
-
!('vercel-plugin-ruby' in deps)) {
|
220951
|
-
return false;
|
220952
|
-
}
|
220953
|
-
return true;
|
220954
|
-
}));
|
220955
220928
|
if (extSet.size > 0) {
|
220956
220929
|
const extGroup = `(?:\\.(?:${Array.from(extSet)
|
220957
220930
|
.map(ext => ext.slice(1))
|
220958
220931
|
.join('|')}))`;
|
220959
|
-
const extGroupLimited = `(?:\\.(?:${Array.from(extSetLimited)
|
220960
|
-
.map(ext => ext.slice(1))
|
220961
|
-
.join('|')}))`;
|
220962
220932
|
if (options.cleanUrls) {
|
220963
220933
|
redirectRoutes.push({
|
220964
220934
|
src: `^/(api(?:.+)?)/index${extGroup}?/?$`,
|
@@ -220972,18 +220942,6 @@ function getRouteResult(pkg, apiRoutes, dynamicRoutes, outputDirectory, apiBuild
|
|
220972
220942
|
},
|
220973
220943
|
status: 308,
|
220974
220944
|
});
|
220975
|
-
limitedRoutes.redirectRoutes.push({
|
220976
|
-
src: `^/(api(?:.+)?)/index${extGroupLimited}?/?$`,
|
220977
|
-
headers: { Location: options.trailingSlash ? '/$1/' : '/$1' },
|
220978
|
-
status: 308,
|
220979
|
-
});
|
220980
|
-
limitedRoutes.redirectRoutes.push({
|
220981
|
-
src: `^/api/(.+)${extGroupLimited}/?$`,
|
220982
|
-
headers: {
|
220983
|
-
Location: options.trailingSlash ? '/api/$1/' : '/api/$1',
|
220984
|
-
},
|
220985
|
-
status: 308,
|
220986
|
-
});
|
220987
220945
|
}
|
220988
220946
|
else {
|
220989
220947
|
defaultRoutes.push({ handle: 'miss' });
|
@@ -220992,17 +220950,13 @@ function getRouteResult(pkg, apiRoutes, dynamicRoutes, outputDirectory, apiBuild
|
|
220992
220950
|
dest: '/api/$1',
|
220993
220951
|
check: true,
|
220994
220952
|
});
|
220995
|
-
limitedRoutes.defaultRoutes.push({ handle: 'miss' });
|
220996
|
-
limitedRoutes.defaultRoutes.push({
|
220997
|
-
src: `^/api/(.+)${extGroupLimited}$`,
|
220998
|
-
dest: '/api/$1',
|
220999
|
-
check: true,
|
221000
|
-
});
|
221001
220953
|
}
|
221002
220954
|
}
|
221003
220955
|
rewriteRoutes.push(...dynamicRoutes);
|
221004
|
-
|
221005
|
-
|
220956
|
+
const hasApiBuild = apiBuilders.find(builder => {
|
220957
|
+
return builder.src?.startsWith('api/');
|
220958
|
+
});
|
220959
|
+
if (typeof ignoreRuntimes === 'undefined' && hasApiBuild) {
|
221006
220960
|
// This route is only necessary to hide the directory listing
|
221007
220961
|
// to avoid enumerating serverless function names.
|
221008
220962
|
// But it causes issues in `vc dev` for frameworks that handle
|
@@ -221046,7 +221000,6 @@ function getRouteResult(pkg, apiRoutes, dynamicRoutes, outputDirectory, apiBuild
|
|
221046
221000
|
redirectRoutes,
|
221047
221001
|
rewriteRoutes,
|
221048
221002
|
errorRoutes,
|
221049
|
-
limitedRoutes,
|
221050
221003
|
};
|
221051
221004
|
}
|
221052
221005
|
function sortFilesBySegmentCount(fileA, fileB) {
|
@@ -233854,7 +233807,9 @@ async function doBuild(client, project, buildsJson, cwd, outputDir) {
|
|
233854
233807
|
...project.settings,
|
233855
233808
|
...(0, project_settings_1.pickOverrides)(localConfig),
|
233856
233809
|
};
|
233857
|
-
if (
|
233810
|
+
if (process.env.VERCEL_BUILD_MONOREPO_SUPPORT === '1' &&
|
233811
|
+
pkg?.scripts?.['vercel-build'] === undefined &&
|
233812
|
+
projectSettings.rootDirectory !== null &&
|
233858
233813
|
projectSettings.rootDirectory !== '.') {
|
233859
233814
|
await (0, monorepo_1.setMonorepoDefaultSettings)(cwd, workPath, projectSettings, output);
|
233860
233815
|
}
|
@@ -241955,7 +241910,7 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output
|
|
241955
241910
|
const relativeToRoot = (0, path_1.relative)(workPath, cwd);
|
241956
241911
|
const setCommand = (command, value) => {
|
241957
241912
|
if (projectSettings[command]) {
|
241958
|
-
output.warn(`Cannot automatically assign ${command} as it is already set via project settings or
|
241913
|
+
output.warn(`Cannot automatically assign ${command} as it is already set via project settings or configuration overrides.`);
|
241959
241914
|
}
|
241960
241915
|
else {
|
241961
241916
|
projectSettings[command] = value;
|
@@ -241965,13 +241920,28 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output
|
|
241965
241920
|
output.log(`Automatically detected ${(0, title_1.default)(monorepoManager)} monorepo manager. Attempting to assign default \`buildCommand\` and \`installCommand\` settings.`);
|
241966
241921
|
}
|
241967
241922
|
if (monorepoManager === 'turbo') {
|
241968
|
-
|
241969
|
-
|
241970
|
-
|
241971
|
-
|
241923
|
+
const [turboJSONBuf, packageJSONBuf] = await Promise.all([
|
241924
|
+
fs_extra_1.default.readFile((0, path_1.join)(cwd, 'turbo.json')).catch(() => null),
|
241925
|
+
fs_extra_1.default.readFile((0, path_1.join)(cwd, 'package.json')).catch(() => null),
|
241926
|
+
]);
|
241927
|
+
let hasBuildPipeline = false;
|
241928
|
+
if (turboJSONBuf !== null) {
|
241929
|
+
const turboJSON = json5_1.default.parse(turboJSONBuf.toString('utf-8'));
|
241930
|
+
if (turboJSON?.pipeline?.build) {
|
241931
|
+
hasBuildPipeline = true;
|
241932
|
+
}
|
241933
|
+
}
|
241934
|
+
else if (packageJSONBuf !== null) {
|
241935
|
+
const packageJSON = JSON.parse(packageJSONBuf.toString('utf-8'));
|
241936
|
+
if (packageJSON?.turbo?.pipeline?.build) {
|
241937
|
+
hasBuildPipeline = true;
|
241938
|
+
}
|
241939
|
+
}
|
241940
|
+
if (!hasBuildPipeline) {
|
241941
|
+
output.warn('Missing required `build` pipeline in turbo.json or package.json Turbo configuration. Skipping automatic setting assignment.');
|
241972
241942
|
return;
|
241973
241943
|
}
|
241974
|
-
setCommand('buildCommand', `cd ${relativeToRoot} && npx turbo run build --filter
|
241944
|
+
setCommand('buildCommand', `cd ${relativeToRoot} && npx turbo run build --filter={./${(0, path_1.relative)(cwd, workPath)}}...`);
|
241975
241945
|
setCommand('installCommand', `cd ${relativeToRoot} && ${packageManager} install`);
|
241976
241946
|
}
|
241977
241947
|
else if (monorepoManager === 'nx') {
|
@@ -241979,7 +241949,7 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output
|
|
241979
241949
|
const nxJSON = json5_1.default.parse(fs_extra_1.default.readFileSync((0, path_1.join)(cwd, 'nx.json'), 'utf-8'));
|
241980
241950
|
if (!nxJSON?.targetDefaults?.build) {
|
241981
241951
|
output.log('Missing default `build` target in nx.json. Checking for project level Nx configuration...');
|
241982
|
-
const [projectJSONBuf,
|
241952
|
+
const [projectJSONBuf, packageJSONBuf] = await Promise.all([
|
241983
241953
|
fs_extra_1.default.readFile((0, path_1.join)(workPath, 'project.json')).catch(() => null),
|
241984
241954
|
fs_extra_1.default.readFile((0, path_1.join)(workPath, 'package.json')).catch(() => null),
|
241985
241955
|
]);
|
@@ -241991,8 +241961,8 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output
|
|
241991
241961
|
hasBuildTarget = true;
|
241992
241962
|
}
|
241993
241963
|
}
|
241994
|
-
if (
|
241995
|
-
const packageJSON = json5_1.default.parse(
|
241964
|
+
if (packageJSONBuf) {
|
241965
|
+
const packageJSON = json5_1.default.parse(packageJSONBuf.toString('utf-8'));
|
241996
241966
|
if (packageJSON?.nx) {
|
241997
241967
|
output.log('Found package.json Nx configuration.');
|
241998
241968
|
if (packageJSON.nx.targets?.build) {
|
@@ -255891,7 +255861,7 @@ module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source
|
|
255891
255861
|
/***/ ((module) => {
|
255892
255862
|
|
255893
255863
|
"use strict";
|
255894
|
-
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"28.5.
|
255864
|
+
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"28.5.5\",\"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 --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/\",\"coverage\":\"codecov\",\"build\":\"ts-node ./scripts/build.ts\",\"dev\":\"ts-node ./src/index.ts\"},\"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.5.8\",\"@vercel/go\":\"2.2.16\",\"@vercel/hydrogen\":\"0.0.30\",\"@vercel/next\":\"3.2.12\",\"@vercel/node\":\"2.6.3\",\"@vercel/python\":\"3.1.26\",\"@vercel/redwood\":\"1.0.36\",\"@vercel/remix\":\"1.0.36\",\"@vercel/ruby\":\"1.3.42\",\"@vercel/static-build\":\"1.0.38\",\"json5\":\"2.2.1\",\"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\",\"@swc/core\":\"1.2.218\",\"@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\":\"14.18.33\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@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.2.18\",\"@vercel/error-utils\":\"1.0.3\",\"@vercel/frameworks\":\"1.1.12\",\"@vercel/fs-detectors\":\"3.5.2\",\"@vercel/fun\":\"1.0.4\",\"@vercel/ncc\":\"0.24.0\",\"@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\",\"boxen\":\"4.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\",\"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\",\"line-async-iterator\":\"3.0.0\",\"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.7\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.4.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"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\":\"10.9.1\",\"typescript\":\"4.7.4\",\"universal-analytics\":\"0.4.20\",\"utility-types\":\"2.1.0\",\"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\"]}}");
|
255895
255865
|
|
255896
255866
|
/***/ }),
|
255897
255867
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "28.5.
|
3
|
+
"version": "28.5.5",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -99,7 +99,7 @@
|
|
99
99
|
"@vercel/client": "12.2.18",
|
100
100
|
"@vercel/error-utils": "1.0.3",
|
101
101
|
"@vercel/frameworks": "1.1.12",
|
102
|
-
"@vercel/fs-detectors": "3.5.
|
102
|
+
"@vercel/fs-detectors": "3.5.2",
|
103
103
|
"@vercel/fun": "1.0.4",
|
104
104
|
"@vercel/ncc": "0.24.0",
|
105
105
|
"@zeit/source-map-support": "0.6.2",
|
@@ -195,5 +195,5 @@
|
|
195
195
|
"<rootDir>/test/**/*.test.ts"
|
196
196
|
]
|
197
197
|
},
|
198
|
-
"gitHead": "
|
198
|
+
"gitHead": "6796fd721d72042def14ec613e850199335d10e9"
|
199
199
|
}
|