vercel 48.6.0 → 48.6.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 +158 -83
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -7304,13 +7304,13 @@ var require_chalk = __commonJS2({
|
|
|
7304
7304
|
styles[key] = {
|
|
7305
7305
|
get() {
|
|
7306
7306
|
const codes = ansiStyles[key];
|
|
7307
|
-
return
|
|
7307
|
+
return build3.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
|
|
7308
7308
|
}
|
|
7309
7309
|
};
|
|
7310
7310
|
}
|
|
7311
7311
|
styles.visible = {
|
|
7312
7312
|
get() {
|
|
7313
|
-
return
|
|
7313
|
+
return build3.call(this, this._styles || [], true, "visible");
|
|
7314
7314
|
}
|
|
7315
7315
|
};
|
|
7316
7316
|
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), "g");
|
|
@@ -7328,7 +7328,7 @@ var require_chalk = __commonJS2({
|
|
|
7328
7328
|
close: ansiStyles.color.close,
|
|
7329
7329
|
closeRe: ansiStyles.color.closeRe
|
|
7330
7330
|
};
|
|
7331
|
-
return
|
|
7331
|
+
return build3.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
|
7332
7332
|
};
|
|
7333
7333
|
}
|
|
7334
7334
|
};
|
|
@@ -7349,14 +7349,14 @@ var require_chalk = __commonJS2({
|
|
|
7349
7349
|
close: ansiStyles.bgColor.close,
|
|
7350
7350
|
closeRe: ansiStyles.bgColor.closeRe
|
|
7351
7351
|
};
|
|
7352
|
-
return
|
|
7352
|
+
return build3.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
|
7353
7353
|
};
|
|
7354
7354
|
}
|
|
7355
7355
|
};
|
|
7356
7356
|
}
|
|
7357
7357
|
var proto = Object.defineProperties(() => {
|
|
7358
7358
|
}, styles);
|
|
7359
|
-
function
|
|
7359
|
+
function build3(_styles, _empty, key) {
|
|
7360
7360
|
const builder = function() {
|
|
7361
7361
|
return applyStyle.apply(builder, arguments);
|
|
7362
7362
|
};
|
|
@@ -42518,7 +42518,7 @@ var require_colors = __commonJS2({
|
|
|
42518
42518
|
}
|
|
42519
42519
|
return str.replace(matchOperatorsRe, "\\$&");
|
|
42520
42520
|
};
|
|
42521
|
-
function
|
|
42521
|
+
function build3(_styles) {
|
|
42522
42522
|
var builder = function builder2() {
|
|
42523
42523
|
return applyStyle.apply(builder2, arguments);
|
|
42524
42524
|
};
|
|
@@ -42533,7 +42533,7 @@ var require_colors = __commonJS2({
|
|
|
42533
42533
|
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
|
|
42534
42534
|
ret[key] = {
|
|
42535
42535
|
get: function() {
|
|
42536
|
-
return
|
|
42536
|
+
return build3(this._styles.concat(key));
|
|
42537
42537
|
}
|
|
42538
42538
|
};
|
|
42539
42539
|
});
|
|
@@ -42592,7 +42592,7 @@ var require_colors = __commonJS2({
|
|
|
42592
42592
|
Object.keys(styles).forEach(function(name) {
|
|
42593
42593
|
ret[name] = {
|
|
42594
42594
|
get: function() {
|
|
42595
|
-
return
|
|
42595
|
+
return build3([name]);
|
|
42596
42596
|
}
|
|
42597
42597
|
};
|
|
42598
42598
|
});
|
|
@@ -49550,7 +49550,7 @@ var require_package = __commonJS2({
|
|
|
49550
49550
|
"../client/package.json"(exports2, module2) {
|
|
49551
49551
|
module2.exports = {
|
|
49552
49552
|
name: "@vercel/client",
|
|
49553
|
-
version: "17.1.
|
|
49553
|
+
version: "17.1.1",
|
|
49554
49554
|
main: "dist/index.js",
|
|
49555
49555
|
typings: "dist/index.d.ts",
|
|
49556
49556
|
homepage: "https://vercel.com",
|
|
@@ -49592,7 +49592,7 @@ var require_package = __commonJS2({
|
|
|
49592
49592
|
"@vercel/build-utils": "12.2.0",
|
|
49593
49593
|
"@vercel/error-utils": "2.0.3",
|
|
49594
49594
|
"@vercel/microfrontends": "1.2.2",
|
|
49595
|
-
"@vercel/routing-utils": "5.2.
|
|
49595
|
+
"@vercel/routing-utils": "5.2.1",
|
|
49596
49596
|
"async-retry": "1.2.3",
|
|
49597
49597
|
"async-sema": "3.0.0",
|
|
49598
49598
|
"fs-extra": "8.0.1",
|
|
@@ -133025,7 +133025,7 @@ var require_superstatic = __commonJS2({
|
|
|
133025
133025
|
convertTrailingSlash: () => convertTrailingSlash,
|
|
133026
133026
|
getCleanUrls: () => getCleanUrls2,
|
|
133027
133027
|
pathToRegexp: () => pathToRegexp,
|
|
133028
|
-
sourceToRegex: () =>
|
|
133028
|
+
sourceToRegex: () => sourceToRegex3
|
|
133029
133029
|
});
|
|
133030
133030
|
module2.exports = __toCommonJS4(superstatic_exports);
|
|
133031
133031
|
var import_url20 = require("url");
|
|
@@ -133103,7 +133103,7 @@ var require_superstatic = __commonJS2({
|
|
|
133103
133103
|
}
|
|
133104
133104
|
function convertRedirects(redirects, defaultStatus = 308) {
|
|
133105
133105
|
return redirects.map((r) => {
|
|
133106
|
-
const { src, segments } =
|
|
133106
|
+
const { src, segments } = sourceToRegex3(r.source);
|
|
133107
133107
|
const hasSegments = collectHasSegments(r.has);
|
|
133108
133108
|
normalizeHasKeys(r.has);
|
|
133109
133109
|
normalizeHasKeys(r.missing);
|
|
@@ -133136,7 +133136,7 @@ var require_superstatic = __commonJS2({
|
|
|
133136
133136
|
}
|
|
133137
133137
|
function convertRewrites(rewrites, internalParamNames) {
|
|
133138
133138
|
return rewrites.map((r) => {
|
|
133139
|
-
const { src, segments } =
|
|
133139
|
+
const { src, segments } = sourceToRegex3(r.source);
|
|
133140
133140
|
const hasSegments = collectHasSegments(r.has);
|
|
133141
133141
|
normalizeHasKeys(r.has);
|
|
133142
133142
|
normalizeHasKeys(r.missing);
|
|
@@ -133167,7 +133167,7 @@ var require_superstatic = __commonJS2({
|
|
|
133167
133167
|
function convertHeaders(headers) {
|
|
133168
133168
|
return headers.map((h) => {
|
|
133169
133169
|
const obj = {};
|
|
133170
|
-
const { src, segments } =
|
|
133170
|
+
const { src, segments } = sourceToRegex3(h.source);
|
|
133171
133171
|
const hasSegments = collectHasSegments(h.has);
|
|
133172
133172
|
normalizeHasKeys(h.has);
|
|
133173
133173
|
normalizeHasKeys(h.missing);
|
|
@@ -133229,7 +133229,7 @@ var require_superstatic = __commonJS2({
|
|
|
133229
133229
|
}
|
|
133230
133230
|
return routes2;
|
|
133231
133231
|
}
|
|
133232
|
-
function
|
|
133232
|
+
function sourceToRegex3(source) {
|
|
133233
133233
|
const keys = [];
|
|
133234
133234
|
const r = pathToRegexp("632", source, keys, {
|
|
133235
133235
|
strict: true,
|
|
@@ -134281,7 +134281,8 @@ var require_dist23 = __commonJS2({
|
|
|
134281
134281
|
isHandler: () => isHandler2,
|
|
134282
134282
|
isValidHandleValue: () => isValidHandleValue,
|
|
134283
134283
|
mergeRoutes: () => import_merge2.mergeRoutes,
|
|
134284
|
-
normalizeRoutes: () => normalizeRoutes2
|
|
134284
|
+
normalizeRoutes: () => normalizeRoutes2,
|
|
134285
|
+
sourceToRegex: () => import_superstatic2.sourceToRegex
|
|
134285
134286
|
});
|
|
134286
134287
|
module2.exports = __toCommonJS4(src_exports2);
|
|
134287
134288
|
var import_url20 = require("url");
|
|
@@ -135903,9 +135904,9 @@ function sortBuilders(builds) {
|
|
|
135903
135904
|
import_frameworks2.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
|
|
135904
135905
|
);
|
|
135905
135906
|
frontendRuntimeSet2.delete("@vercel/python");
|
|
135906
|
-
const toNumber = (
|
|
135907
|
-
return builds.sort((build1,
|
|
135908
|
-
return toNumber(build1) - toNumber(
|
|
135907
|
+
const toNumber = (build3) => build3.use === "@vercel/python" ? 1 : frontendRuntimeSet2.has(build3.use) ? 0 : 2;
|
|
135908
|
+
return builds.sort((build1, build22) => {
|
|
135909
|
+
return toNumber(build1) - toNumber(build22);
|
|
135909
135910
|
});
|
|
135910
135911
|
}
|
|
135911
135912
|
var import_frameworks2;
|
|
@@ -145936,20 +145937,17 @@ var init_unzip = __esm({
|
|
|
145936
145937
|
});
|
|
145937
145938
|
|
|
145938
145939
|
// src/util/build/write-build-result.ts
|
|
145939
|
-
async function writeBuildResult(repoRootPath, outputDir, buildResult,
|
|
145940
|
+
async function writeBuildResult(repoRootPath, outputDir, buildResult, build3, builder, builderPkg, vercelConfig, standalone = false) {
|
|
145940
145941
|
let version2 = builder.version;
|
|
145941
|
-
if (
|
|
145942
|
-
version2 =
|
|
145943
|
-
}
|
|
145944
|
-
if ("experimentalVersion" in builder && process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1" && "name" in builder && builder.name === "hono") {
|
|
145945
|
-
version2 = builder.experimentalVersion;
|
|
145942
|
+
if ((0, import_build_utils11.isExperimentalBackendsEnabled)() && "output" in buildResult) {
|
|
145943
|
+
version2 = 2;
|
|
145946
145944
|
}
|
|
145947
145945
|
if (typeof version2 !== "number" || version2 === 2) {
|
|
145948
145946
|
return writeBuildResultV2(
|
|
145949
145947
|
repoRootPath,
|
|
145950
145948
|
outputDir,
|
|
145951
145949
|
buildResult,
|
|
145952
|
-
|
|
145950
|
+
build3,
|
|
145953
145951
|
vercelConfig,
|
|
145954
145952
|
standalone
|
|
145955
145953
|
);
|
|
@@ -145958,7 +145956,7 @@ async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, bu
|
|
|
145958
145956
|
repoRootPath,
|
|
145959
145957
|
outputDir,
|
|
145960
145958
|
buildResult,
|
|
145961
|
-
|
|
145959
|
+
build3,
|
|
145962
145960
|
vercelConfig,
|
|
145963
145961
|
standalone
|
|
145964
145962
|
);
|
|
@@ -145983,16 +145981,16 @@ function isFile(v) {
|
|
|
145983
145981
|
function stripDuplicateSlashes(path11) {
|
|
145984
145982
|
return normalize2(path11).replace(/(^\/|\/$)/g, "");
|
|
145985
145983
|
}
|
|
145986
|
-
async function writeBuildResultV2(repoRootPath, outputDir, buildResult,
|
|
145984
|
+
async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build3, vercelConfig, standalone = false) {
|
|
145987
145985
|
if ("buildOutputPath" in buildResult) {
|
|
145988
145986
|
await mergeBuilderOutput(outputDir, buildResult);
|
|
145989
145987
|
return;
|
|
145990
145988
|
}
|
|
145991
145989
|
if (!buildResult.output) {
|
|
145992
145990
|
const configFile = vercelConfig?.[import_client3.fileNameSymbol];
|
|
145993
|
-
const updateMessage =
|
|
145991
|
+
const updateMessage = build3.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
|
|
145994
145992
|
throw new Error(
|
|
145995
|
-
`The build result from "${
|
|
145993
|
+
`The build result from "${build3.use}" is missing the "output" property.${updateMessage}`
|
|
145996
145994
|
);
|
|
145997
145995
|
}
|
|
145998
145996
|
const existingFunctions = /* @__PURE__ */ new Map();
|
|
@@ -146085,9 +146083,40 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
|
|
|
146085
146083
|
}
|
|
146086
146084
|
return Object.keys(overrides).length > 0 ? overrides : void 0;
|
|
146087
146085
|
}
|
|
146088
|
-
async function writeBuildResultV3(repoRootPath, outputDir, buildResult,
|
|
146086
|
+
async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build3, vercelConfig, standalone = false) {
|
|
146089
146087
|
const { output: output2 } = buildResult;
|
|
146090
|
-
|
|
146088
|
+
if (process.env.VERCEL_EXPERIMENTAL_ROUTES_JSON === "1") {
|
|
146089
|
+
const routesJsonPath = (0, import_path21.join)(outputDir, "..", "routes.json");
|
|
146090
|
+
if ((0, import_fs_extra12.existsSync)(routesJsonPath)) {
|
|
146091
|
+
try {
|
|
146092
|
+
const newOutput = {
|
|
146093
|
+
index: output2
|
|
146094
|
+
};
|
|
146095
|
+
const routesJson = await import_fs_extra12.default.readJSON(routesJsonPath);
|
|
146096
|
+
if (routesJson && typeof routesJson === "object" && "routes" in routesJson && Array.isArray(routesJson.routes)) {
|
|
146097
|
+
for (const route of routesJson.routes) {
|
|
146098
|
+
if (route.source === "/") {
|
|
146099
|
+
continue;
|
|
146100
|
+
}
|
|
146101
|
+
if (route.source) {
|
|
146102
|
+
newOutput[route.source] = output2;
|
|
146103
|
+
}
|
|
146104
|
+
}
|
|
146105
|
+
}
|
|
146106
|
+
return writeBuildResultV2(
|
|
146107
|
+
repoRootPath,
|
|
146108
|
+
outputDir,
|
|
146109
|
+
{ output: newOutput, routes: buildResult.routes },
|
|
146110
|
+
build3,
|
|
146111
|
+
vercelConfig,
|
|
146112
|
+
standalone
|
|
146113
|
+
);
|
|
146114
|
+
} catch (error3) {
|
|
146115
|
+
output_manager_default.error(`Failed to read routes.json: ${error3}`);
|
|
146116
|
+
}
|
|
146117
|
+
}
|
|
146118
|
+
}
|
|
146119
|
+
const src = build3.src;
|
|
146091
146120
|
if (typeof src !== "string") {
|
|
146092
146121
|
throw new Error(`Expected "build.src" to be a string`);
|
|
146093
146122
|
}
|
|
@@ -146097,7 +146126,7 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
|
|
|
146097
146126
|
}) : {};
|
|
146098
146127
|
const ext = (0, import_path21.extname)(src);
|
|
146099
146128
|
const path11 = stripDuplicateSlashes(
|
|
146100
|
-
|
|
146129
|
+
build3.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
|
|
146101
146130
|
);
|
|
146102
146131
|
if (isLambda(output2)) {
|
|
146103
146132
|
await writeLambda(
|
|
@@ -146120,7 +146149,7 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
|
|
|
146120
146149
|
);
|
|
146121
146150
|
} else {
|
|
146122
146151
|
throw new Error(
|
|
146123
|
-
`Unsupported output type: "${output2.type}" for ${
|
|
146152
|
+
`Unsupported output type: "${output2.type}" for ${build3.src}`
|
|
146124
146153
|
);
|
|
146125
146154
|
}
|
|
146126
146155
|
}
|
|
@@ -146362,6 +146391,7 @@ var init_write_build_result = __esm({
|
|
|
146362
146391
|
init_unzip();
|
|
146363
146392
|
init_link2();
|
|
146364
146393
|
import_client3 = __toESM3(require_dist7());
|
|
146394
|
+
init_output_manager();
|
|
146365
146395
|
({ normalize: normalize2 } = import_path21.posix);
|
|
146366
146396
|
OUTPUT_DIR = (0, import_path21.join)(VERCEL_DIR2, "output");
|
|
146367
146397
|
}
|
|
@@ -148254,19 +148284,19 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148254
148284
|
await import_fs_extra18.default.mkdirp(outputDir);
|
|
148255
148285
|
const ops = [];
|
|
148256
148286
|
const buildsJsonBuilds = new Map(
|
|
148257
|
-
builds.map((
|
|
148258
|
-
const builderWithPkg = buildersWithPkgs.get(
|
|
148287
|
+
builds.map((build3) => {
|
|
148288
|
+
const builderWithPkg = buildersWithPkgs.get(build3.use);
|
|
148259
148289
|
if (!builderWithPkg) {
|
|
148260
|
-
throw new Error(`Failed to load Builder "${
|
|
148290
|
+
throw new Error(`Failed to load Builder "${build3.use}"`);
|
|
148261
148291
|
}
|
|
148262
148292
|
const { builder, pkg: builderPkg } = builderWithPkg;
|
|
148263
148293
|
return [
|
|
148264
|
-
|
|
148294
|
+
build3,
|
|
148265
148295
|
{
|
|
148266
148296
|
require: builderPkg.name,
|
|
148267
148297
|
requirePath: builderWithPkg.path,
|
|
148268
148298
|
apiVersion: builder.version,
|
|
148269
|
-
...
|
|
148299
|
+
...build3
|
|
148270
148300
|
}
|
|
148271
148301
|
];
|
|
148272
148302
|
})
|
|
@@ -148283,12 +148313,12 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148283
148313
|
const repoRootPath = cwd;
|
|
148284
148314
|
const corepackShimDir = await initCorepack({ repoRootPath });
|
|
148285
148315
|
const diagnostics = {};
|
|
148286
|
-
for (const
|
|
148287
|
-
if (typeof
|
|
148316
|
+
for (const build3 of sortedBuilders) {
|
|
148317
|
+
if (typeof build3.src !== "string")
|
|
148288
148318
|
continue;
|
|
148289
|
-
const builderWithPkg = buildersWithPkgs.get(
|
|
148319
|
+
const builderWithPkg = buildersWithPkgs.get(build3.use);
|
|
148290
148320
|
if (!builderWithPkg) {
|
|
148291
|
-
throw new Error(`Failed to load Builder "${
|
|
148321
|
+
throw new Error(`Failed to load Builder "${build3.use}"`);
|
|
148292
148322
|
}
|
|
148293
148323
|
try {
|
|
148294
148324
|
const { builder, pkg: builderPkg } = builderWithPkg;
|
|
@@ -148305,10 +148335,10 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148305
148335
|
output_manager_default.debug(`Setting env ${envKey} to "${value}"`);
|
|
148306
148336
|
}
|
|
148307
148337
|
}
|
|
148308
|
-
const isFrontendBuilder =
|
|
148338
|
+
const isFrontendBuilder = build3.config && "framework" in build3.config;
|
|
148309
148339
|
const buildConfig = isZeroConfig ? {
|
|
148310
148340
|
outputDirectory: projectSettings.outputDirectory ?? void 0,
|
|
148311
|
-
...
|
|
148341
|
+
...build3.config,
|
|
148312
148342
|
projectSettings,
|
|
148313
148343
|
installCommand: projectSettings.installCommand ?? void 0,
|
|
148314
148344
|
devCommand: projectSettings.devCommand ?? void 0,
|
|
@@ -148317,7 +148347,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148317
148347
|
nodeVersion: projectSettings.nodeVersion,
|
|
148318
148348
|
bunVersion: localConfig.bunVersion ?? void 0
|
|
148319
148349
|
} : {
|
|
148320
|
-
...
|
|
148350
|
+
...build3.config || {},
|
|
148321
148351
|
bunVersion: localConfig.bunVersion ?? void 0
|
|
148322
148352
|
};
|
|
148323
148353
|
const builderSpan = span.child("vc.builder", {
|
|
@@ -148325,7 +148355,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148325
148355
|
});
|
|
148326
148356
|
const buildOptions = {
|
|
148327
148357
|
files: filesMap,
|
|
148328
|
-
entrypoint:
|
|
148358
|
+
entrypoint: build3.src,
|
|
148329
148359
|
workPath,
|
|
148330
148360
|
repoRootPath,
|
|
148331
148361
|
config: buildConfig,
|
|
@@ -148333,16 +148363,14 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148333
148363
|
span: builderSpan
|
|
148334
148364
|
};
|
|
148335
148365
|
output_manager_default.debug(
|
|
148336
|
-
`Building entrypoint "${
|
|
148366
|
+
`Building entrypoint "${build3.src}" with "${builderPkg.name}"`
|
|
148337
148367
|
);
|
|
148338
148368
|
let buildResult;
|
|
148339
148369
|
try {
|
|
148340
148370
|
buildResult = await builderSpan.trace(
|
|
148341
148371
|
() => {
|
|
148342
|
-
if (
|
|
148343
|
-
return
|
|
148344
|
-
} else if (process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1" && "name" in builder && builder.name === "hono" && "experimentalBuild" in builder && typeof builder.experimentalBuild === "function") {
|
|
148345
|
-
return builder.experimentalBuild(buildOptions);
|
|
148372
|
+
if ((0, import_build_utils13.shouldUseExperimentalBackends)(buildConfig.framework) && builderPkg.name !== "@vercel/static") {
|
|
148373
|
+
return experimentalBackendBuilder.build(buildOptions);
|
|
148346
148374
|
}
|
|
148347
148375
|
return builder.build(buildOptions);
|
|
148348
148376
|
}
|
|
@@ -148372,12 +148400,55 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148372
148400
|
if ((0, import_build_utils13.getDiscontinuedNodeVersions)().some((o) => o.runtime === lambdaRuntime)) {
|
|
148373
148401
|
throw new import_build_utils13.NowBuildError({
|
|
148374
148402
|
code: "NODEJS_DISCONTINUED_VERSION",
|
|
148375
|
-
message: `The Runtime "${
|
|
148403
|
+
message: `The Runtime "${build3.use}" is using "${lambdaRuntime}", which is discontinued. Please upgrade your Runtime to a more recent version or consult the author for more details.`,
|
|
148376
148404
|
link: "https://vercel.link/function-runtimes"
|
|
148377
148405
|
});
|
|
148378
148406
|
}
|
|
148379
148407
|
}
|
|
148380
|
-
|
|
148408
|
+
const backendBuilders = [
|
|
148409
|
+
"@vercel/express",
|
|
148410
|
+
"@vercel/hono",
|
|
148411
|
+
"@vercel/fastify"
|
|
148412
|
+
];
|
|
148413
|
+
const isBackendBuilder = build3.use && backendBuilders.includes(build3.use);
|
|
148414
|
+
if (process.env.VERCEL_EXPERIMENTAL_ROUTES_JSON === "1") {
|
|
148415
|
+
if ("output" in buildResult && buildResult.output && isBackendBuilder) {
|
|
148416
|
+
const routesJsonPath = (0, import_path27.join)(outputDir, "..", "routes.json");
|
|
148417
|
+
if ((0, import_fs_extra18.existsSync)(routesJsonPath)) {
|
|
148418
|
+
try {
|
|
148419
|
+
const routesJson = await readJSONFile(routesJsonPath);
|
|
148420
|
+
if (routesJson && typeof routesJson === "object" && "routes" in routesJson && Array.isArray(routesJson.routes)) {
|
|
148421
|
+
const convertedRoutes = [];
|
|
148422
|
+
for (const route of routesJson.routes) {
|
|
148423
|
+
if (typeof route.source !== "string") {
|
|
148424
|
+
continue;
|
|
148425
|
+
}
|
|
148426
|
+
const { src } = (0, import_routing_utils2.sourceToRegex)(route.source);
|
|
148427
|
+
const newRoute = {
|
|
148428
|
+
src,
|
|
148429
|
+
dest: route.source
|
|
148430
|
+
};
|
|
148431
|
+
if (route.methods) {
|
|
148432
|
+
newRoute.methods = route.methods;
|
|
148433
|
+
}
|
|
148434
|
+
if (route.source === "/") {
|
|
148435
|
+
continue;
|
|
148436
|
+
}
|
|
148437
|
+
convertedRoutes.push(newRoute);
|
|
148438
|
+
}
|
|
148439
|
+
buildResult.routes = [
|
|
148440
|
+
{ handle: "filesystem" },
|
|
148441
|
+
...convertedRoutes,
|
|
148442
|
+
{ src: "/(.*)", dest: "/" }
|
|
148443
|
+
];
|
|
148444
|
+
}
|
|
148445
|
+
} catch (error3) {
|
|
148446
|
+
output_manager_default.error(`Failed to read routes.json: ${error3}`);
|
|
148447
|
+
}
|
|
148448
|
+
}
|
|
148449
|
+
}
|
|
148450
|
+
}
|
|
148451
|
+
buildResults.set(build3, buildResult);
|
|
148381
148452
|
let buildOutputLength = 0;
|
|
148382
148453
|
if ("output" in buildResult) {
|
|
148383
148454
|
buildOutputLength = Array.isArray(buildResult.output) ? buildResult.output.length : 1;
|
|
@@ -148390,7 +148461,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148390
148461
|
repoRootPath,
|
|
148391
148462
|
outputDir,
|
|
148392
148463
|
buildResult,
|
|
148393
|
-
|
|
148464
|
+
build3,
|
|
148394
148465
|
builder,
|
|
148395
148466
|
builderPkg,
|
|
148396
148467
|
localConfig,
|
|
@@ -148405,7 +148476,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148405
148476
|
)
|
|
148406
148477
|
);
|
|
148407
148478
|
} catch (err) {
|
|
148408
|
-
const buildJsonBuild = buildsJsonBuilds.get(
|
|
148479
|
+
const buildJsonBuild = buildsJsonBuilds.get(build3);
|
|
148409
148480
|
if (buildJsonBuild) {
|
|
148410
148481
|
buildJsonBuild.error = toEnumerableError(err);
|
|
148411
148482
|
}
|
|
@@ -148459,10 +148530,10 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
|
|
|
148459
148530
|
if (existingConfig.overrides) {
|
|
148460
148531
|
overrides.push(existingConfig.overrides);
|
|
148461
148532
|
}
|
|
148462
|
-
for (const [
|
|
148533
|
+
for (const [build3, buildResult] of buildResults.entries()) {
|
|
148463
148534
|
if ("buildOutputPath" in buildResult) {
|
|
148464
|
-
output_manager_default.debug(`Using "config.json" for "${
|
|
148465
|
-
buildResults.set(
|
|
148535
|
+
output_manager_default.debug(`Using "config.json" for "${build3.use}`);
|
|
148536
|
+
buildResults.set(build3, existingConfig);
|
|
148466
148537
|
break;
|
|
148467
148538
|
}
|
|
148468
148539
|
}
|
|
@@ -148523,8 +148594,8 @@ async function getFramework(cwd, buildResults) {
|
|
|
148523
148594
|
return;
|
|
148524
148595
|
}
|
|
148525
148596
|
if (detectedFramework.useRuntime) {
|
|
148526
|
-
for (const [
|
|
148527
|
-
if ("framework" in buildResult &&
|
|
148597
|
+
for (const [build3, buildResult] of buildResults.entries()) {
|
|
148598
|
+
if ("framework" in buildResult && build3.use === detectedFramework.useRuntime.use) {
|
|
148528
148599
|
return buildResult.framework;
|
|
148529
148600
|
}
|
|
148530
148601
|
}
|
|
@@ -148543,8 +148614,8 @@ async function getFramework(cwd, buildResults) {
|
|
|
148543
148614
|
};
|
|
148544
148615
|
}
|
|
148545
148616
|
}
|
|
148546
|
-
function expandBuild(files,
|
|
148547
|
-
if (!
|
|
148617
|
+
function expandBuild(files, build3) {
|
|
148618
|
+
if (!build3.use) {
|
|
148548
148619
|
throw new import_build_utils13.NowBuildError({
|
|
148549
148620
|
code: `invalid_build_specification`,
|
|
148550
148621
|
message: "Field `use` is missing in build specification",
|
|
@@ -148552,7 +148623,7 @@ function expandBuild(files, build2) {
|
|
|
148552
148623
|
action: "View Documentation"
|
|
148553
148624
|
});
|
|
148554
148625
|
}
|
|
148555
|
-
let src = (0, import_path27.normalize)(
|
|
148626
|
+
let src = (0, import_path27.normalize)(build3.src || "**").split(import_path27.sep).join("/");
|
|
148556
148627
|
if (src === "." || src === "./") {
|
|
148557
148628
|
throw new import_build_utils13.NowBuildError({
|
|
148558
148629
|
code: `invalid_build_specification`,
|
|
@@ -148569,7 +148640,7 @@ function expandBuild(files, build2) {
|
|
|
148569
148640
|
);
|
|
148570
148641
|
return matches.map((m) => {
|
|
148571
148642
|
return {
|
|
148572
|
-
...
|
|
148643
|
+
...build3,
|
|
148573
148644
|
src: m
|
|
148574
148645
|
};
|
|
148575
148646
|
});
|
|
@@ -148641,7 +148712,7 @@ async function getFrameworkRoutes(framework, dirPrefix) {
|
|
|
148641
148712
|
}
|
|
148642
148713
|
return routes2;
|
|
148643
148714
|
}
|
|
148644
|
-
var import_chalk55, import_dotenv, import_fs_extra18, import_minimatch2, import_path27, import_semver3, import_build_utils13, import_client6, import_frameworks5, import_fs_detectors4, import_routing_utils2, import_promises2, InMemoryReporter;
|
|
148715
|
+
var import_chalk55, import_dotenv, import_fs_extra18, import_minimatch2, import_path27, import_semver3, experimentalBackendBuilder, import_build_utils13, import_client6, import_frameworks5, import_fs_detectors4, import_routing_utils2, import_promises2, InMemoryReporter;
|
|
148645
148716
|
var init_build2 = __esm({
|
|
148646
148717
|
"src/commands/build/index.ts"() {
|
|
148647
148718
|
"use strict";
|
|
@@ -148651,6 +148722,7 @@ var init_build2 = __esm({
|
|
|
148651
148722
|
import_minimatch2 = __toESM3(require_minimatch2());
|
|
148652
148723
|
import_path27 = require("path");
|
|
148653
148724
|
import_semver3 = __toESM3(require_semver());
|
|
148725
|
+
experimentalBackendBuilder = __toESM3(require("@vercel/backends"));
|
|
148654
148726
|
import_build_utils13 = require("@vercel/build-utils");
|
|
148655
148727
|
import_client6 = __toESM3(require_dist7());
|
|
148656
148728
|
import_frameworks5 = __toESM3(require_frameworks());
|
|
@@ -151054,7 +151126,7 @@ var init_util = __esm({
|
|
|
151054
151126
|
regions,
|
|
151055
151127
|
quiet = false,
|
|
151056
151128
|
env,
|
|
151057
|
-
build:
|
|
151129
|
+
build: build3,
|
|
151058
151130
|
forceNew = false,
|
|
151059
151131
|
withCache = false,
|
|
151060
151132
|
target = null,
|
|
@@ -151070,7 +151142,7 @@ var init_util = __esm({
|
|
|
151070
151142
|
const requestBody = {
|
|
151071
151143
|
...nowConfig,
|
|
151072
151144
|
env,
|
|
151073
|
-
build:
|
|
151145
|
+
build: build3,
|
|
151074
151146
|
public: wantsPublic || nowConfig.public,
|
|
151075
151147
|
name,
|
|
151076
151148
|
project,
|
|
@@ -152041,7 +152113,7 @@ var init_deploy2 = __esm({
|
|
|
152041
152113
|
return 1;
|
|
152042
152114
|
}
|
|
152043
152115
|
const prebuiltBuild = await getPrebuiltJson(vercelOutputDir);
|
|
152044
|
-
const prebuiltError = prebuiltBuild?.error || prebuiltBuild?.builds?.find((
|
|
152116
|
+
const prebuiltError = prebuiltBuild?.error || prebuiltBuild?.builds?.find((build3) => "error" in build3)?.error;
|
|
152045
152117
|
if (prebuiltError) {
|
|
152046
152118
|
output_manager_default.log(
|
|
152047
152119
|
`Prebuilt deployment cannot be created because ${getCommandName(
|
|
@@ -169475,7 +169547,7 @@ async function getBuildMatches(vercelConfig, cwd, devServer, fileList) {
|
|
|
169475
169547
|
if (src[0] === "/") {
|
|
169476
169548
|
src = src.substring(1);
|
|
169477
169549
|
}
|
|
169478
|
-
if (
|
|
169550
|
+
if ((0, import_build_utils16.isBackendFramework)(buildConfig.config?.framework)) {
|
|
169479
169551
|
src = "package.json";
|
|
169480
169552
|
}
|
|
169481
169553
|
if (buildConfig.config?.framework === "fastapi" || buildConfig.config?.framework === "flask") {
|
|
@@ -170109,8 +170181,8 @@ async function getReachableHostOnPort(port) {
|
|
|
170109
170181
|
]);
|
|
170110
170182
|
return results.find(Boolean) || false;
|
|
170111
170183
|
}
|
|
170112
|
-
function filterFrontendBuilds(
|
|
170113
|
-
const { name } = (0, import_npm_package_arg2.default)(
|
|
170184
|
+
function filterFrontendBuilds(build3) {
|
|
170185
|
+
const { name } = (0, import_npm_package_arg2.default)(build3.use);
|
|
170114
170186
|
return !frontendRuntimeSet.has(name || "");
|
|
170115
170187
|
}
|
|
170116
170188
|
function hasNewRoutingProperties(vercelConfig) {
|
|
@@ -171133,6 +171205,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
|
171133
171205
|
return defaults;
|
|
171134
171206
|
}
|
|
171135
171207
|
}
|
|
171208
|
+
if ((0, import_build_utils17.isExperimentalBackendsEnabled)()) {
|
|
171209
|
+
return "npx @vercel/cervel dev";
|
|
171210
|
+
}
|
|
171136
171211
|
}
|
|
171137
171212
|
return void 0;
|
|
171138
171213
|
}
|
|
@@ -177583,7 +177658,7 @@ var init_builds = __esm({
|
|
|
177583
177658
|
getCommonPath = (buildGroup) => {
|
|
177584
177659
|
const commonPath = [];
|
|
177585
177660
|
const splits = buildGroup.map(
|
|
177586
|
-
(
|
|
177661
|
+
(build3) => getDirPath(build3.entrypoint).split("/")
|
|
177587
177662
|
);
|
|
177588
177663
|
const shortest = splits.reduce(
|
|
177589
177664
|
(prevValue, currentValue) => Math.min(prevValue, currentValue.length),
|
|
@@ -177599,15 +177674,15 @@ var init_builds = __esm({
|
|
|
177599
177674
|
}
|
|
177600
177675
|
return commonPath.join("/") || "/";
|
|
177601
177676
|
};
|
|
177602
|
-
styleBuild = (
|
|
177603
|
-
const { entrypoint, id } =
|
|
177677
|
+
styleBuild = (build3, times, longestSource) => {
|
|
177678
|
+
const { entrypoint, id } = build3;
|
|
177604
177679
|
const time = typeof times[id] === "string" ? times[id] : "";
|
|
177605
177680
|
let pathColor = import_chalk98.default.cyan;
|
|
177606
|
-
if (isFailed(
|
|
177681
|
+
if (isFailed(build3)) {
|
|
177607
177682
|
pathColor = import_chalk98.default.red;
|
|
177608
177683
|
}
|
|
177609
177684
|
const entry = entrypoint.padEnd(longestSource + padding);
|
|
177610
|
-
const prefix = hasOutput(
|
|
177685
|
+
const prefix = hasOutput(build3) ? "\u250C" : "\u2576";
|
|
177611
177686
|
return `${import_chalk98.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
|
177612
177687
|
};
|
|
177613
177688
|
styleHiddenBuilds = (commonPath, buildGroup, times, longestSource, isHidden2 = false) => {
|
|
@@ -177699,7 +177774,7 @@ var init_builds = __esm({
|
|
|
177699
177774
|
return nextList;
|
|
177700
177775
|
};
|
|
177701
177776
|
builds_default = (builds, times) => {
|
|
177702
|
-
let path11 = builds.sort(sortByEntrypoint).map((
|
|
177777
|
+
let path11 = builds.sort(sortByEntrypoint).map((build3) => [build3]);
|
|
177703
177778
|
const highestLevel = builds.reduce((prev, curr) => {
|
|
177704
177779
|
const partCounter = curr.entrypoint.split("/").length - 1;
|
|
177705
177780
|
return partCounter > prev ? partCounter : prev;
|
|
@@ -177762,9 +177837,9 @@ var init_builds = __esm({
|
|
|
177762
177837
|
finalBuildsLength++;
|
|
177763
177838
|
}
|
|
177764
177839
|
const outputs = [];
|
|
177765
|
-
for (const
|
|
177766
|
-
if (Array.isArray(
|
|
177767
|
-
outputs.push(...
|
|
177840
|
+
for (const build3 of buildGroup) {
|
|
177841
|
+
if (Array.isArray(build3.output)) {
|
|
177842
|
+
outputs.push(...build3.output);
|
|
177768
177843
|
}
|
|
177769
177844
|
}
|
|
177770
177845
|
outputs.slice(0, MAX_OUTPUTS_PER_GROUP).forEach(
|
|
@@ -178099,8 +178174,8 @@ async function printDetails({
|
|
|
178099
178174
|
}
|
|
178100
178175
|
if (builds.length > 0) {
|
|
178101
178176
|
const times = {};
|
|
178102
|
-
for (const
|
|
178103
|
-
const { id: id2, createdAt: createdAt2, readyStateAt } =
|
|
178177
|
+
for (const build3 of builds) {
|
|
178178
|
+
const { id: id2, createdAt: createdAt2, readyStateAt } = build3;
|
|
178104
178179
|
times[id2] = createdAt2 && readyStateAt ? elapsed(readyStateAt - createdAt2) : null;
|
|
178105
178180
|
}
|
|
178106
178181
|
print(import_chalk100.default.bold(" Builds\n\n"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vercel",
|
|
3
|
-
"version": "48.6.
|
|
3
|
+
"version": "48.6.2",
|
|
4
4
|
"preferGlobal": true,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "The command-line interface for Vercel",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"@vercel/build-utils": "12.2.0",
|
|
26
26
|
"@vercel/fun": "1.1.6",
|
|
27
27
|
"@vercel/go": "3.2.3",
|
|
28
|
-
"@vercel/express": "0.1.
|
|
29
|
-
"@vercel/hono": "0.2.
|
|
28
|
+
"@vercel/express": "0.1.1",
|
|
29
|
+
"@vercel/hono": "0.2.1",
|
|
30
30
|
"@vercel/h3": "0.1.7",
|
|
31
31
|
"@vercel/hydrogen": "1.3.0",
|
|
32
|
-
"@vercel/next": "4.14.
|
|
32
|
+
"@vercel/next": "4.14.1",
|
|
33
33
|
"@vercel/node": "5.5.0",
|
|
34
34
|
"@vercel/python": "5.0.10",
|
|
35
35
|
"@vercel/redwood": "2.4.0",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"@vercel/static-build": "2.8.0",
|
|
39
39
|
"chokidar": "4.0.0",
|
|
40
40
|
"jose": "5.9.6",
|
|
41
|
-
"@vercel/detect-agent": "1.0.0"
|
|
41
|
+
"@vercel/detect-agent": "1.0.0",
|
|
42
|
+
"@vercel/backends": "0.0.3"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@alex_neo/jest-expect-message": "1.0.5",
|
|
@@ -83,11 +84,11 @@
|
|
|
83
84
|
"@types/which": "3.0.0",
|
|
84
85
|
"@types/write-json-file": "2.2.1",
|
|
85
86
|
"@types/yauzl-promise": "2.1.0",
|
|
86
|
-
"@vercel/client": "17.1.
|
|
87
|
+
"@vercel/client": "17.1.1",
|
|
87
88
|
"@vercel/error-utils": "2.0.3",
|
|
88
89
|
"@vercel/frameworks": "3.14.0",
|
|
89
|
-
"@vercel/fs-detectors": "5.7.
|
|
90
|
-
"@vercel/routing-utils": "5.2.
|
|
90
|
+
"@vercel/fs-detectors": "5.7.1",
|
|
91
|
+
"@vercel/routing-utils": "5.2.1",
|
|
91
92
|
"@vitest/expect": "2.1.3",
|
|
92
93
|
"ajv": "6.12.3",
|
|
93
94
|
"alpha-sort": "2.0.1",
|
|
@@ -180,7 +181,7 @@
|
|
|
180
181
|
"coverage": "codecov",
|
|
181
182
|
"build": "node scripts/build.mjs",
|
|
182
183
|
"dev": "echo \"'pnpm dev [command]' has been removed. Use 'pnpm vercel [command]' instead.\" && exit 1",
|
|
183
|
-
"vercel": "
|
|
184
|
+
"vercel": "pnpm build && node ./dist/vc.js",
|
|
184
185
|
"vc": "pnpm vercel",
|
|
185
186
|
"type-check": "tsc --noEmit"
|
|
186
187
|
}
|