vercel 48.5.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.
Files changed (2) hide show
  1. package/dist/index.js +173 -87
  2. package/package.json +17 -16
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 build2.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
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 build2.call(this, this._styles || [], true, "visible");
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 build2.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
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 build2.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
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 build2(_styles, _empty, key) {
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 build2(_styles) {
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 build2(this._styles.concat(key));
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 build2([name]);
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.0.4",
49553
+ version: "17.1.1",
49554
49554
  main: "dist/index.js",
49555
49555
  typings: "dist/index.d.ts",
49556
49556
  homepage: "https://vercel.com",
@@ -49589,10 +49589,10 @@ var require_package = __commonJS2({
49589
49589
  vitest: "2.0.1"
49590
49590
  },
49591
49591
  dependencies: {
49592
- "@vercel/build-utils": "12.1.3",
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.0",
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",
@@ -120639,6 +120639,9 @@ var require_detect_builders = __commonJS2({
120639
120639
  config2.excludeFiles = func.excludeFiles;
120640
120640
  }
120641
120641
  }
120642
+ if (options.bunVersion) {
120643
+ config2.bunVersion = options.bunVersion;
120644
+ }
120642
120645
  const builder = {
120643
120646
  use,
120644
120647
  src: fileName,
@@ -120695,6 +120698,9 @@ var require_detect_builders = __commonJS2({
120695
120698
  if (projectSettings.outputDirectory) {
120696
120699
  config2.outputDirectory = projectSettings.outputDirectory;
120697
120700
  }
120701
+ if (options.bunVersion) {
120702
+ config2.bunVersion = options.bunVersion;
120703
+ }
120698
120704
  if (pkg && (framework === void 0 || framework !== "storybook" && createdAt < Date.parse("2020-03-01"))) {
120699
120705
  const deps = {
120700
120706
  ...pkg.dependencies,
@@ -120815,7 +120821,7 @@ var require_detect_builders = __commonJS2({
120815
120821
  }
120816
120822
  if (frontendBuilder && (0, import_is_official_runtime.isOfficialRuntime)("next", frontendBuilder.use)) {
120817
120823
  for (const fnKey of unusedFunctions.values()) {
120818
- if (fnKey.startsWith("pages/") || fnKey.startsWith("src/pages") || fnKey.startsWith("app/") || fnKey.startsWith("src/app/")) {
120824
+ if (fnKey.startsWith("pages/") || fnKey.startsWith("src/pages") || fnKey.startsWith("app/") || fnKey.startsWith("src/app/") || fnKey.startsWith("middleware") || fnKey.startsWith("src/middleware")) {
120819
120825
  unusedFunctions.delete(fnKey);
120820
120826
  } else {
120821
120827
  return {
@@ -133019,7 +133025,7 @@ var require_superstatic = __commonJS2({
133019
133025
  convertTrailingSlash: () => convertTrailingSlash,
133020
133026
  getCleanUrls: () => getCleanUrls2,
133021
133027
  pathToRegexp: () => pathToRegexp,
133022
- sourceToRegex: () => sourceToRegex
133028
+ sourceToRegex: () => sourceToRegex3
133023
133029
  });
133024
133030
  module2.exports = __toCommonJS4(superstatic_exports);
133025
133031
  var import_url20 = require("url");
@@ -133097,7 +133103,7 @@ var require_superstatic = __commonJS2({
133097
133103
  }
133098
133104
  function convertRedirects(redirects, defaultStatus = 308) {
133099
133105
  return redirects.map((r) => {
133100
- const { src, segments } = sourceToRegex(r.source);
133106
+ const { src, segments } = sourceToRegex3(r.source);
133101
133107
  const hasSegments = collectHasSegments(r.has);
133102
133108
  normalizeHasKeys(r.has);
133103
133109
  normalizeHasKeys(r.missing);
@@ -133130,7 +133136,7 @@ var require_superstatic = __commonJS2({
133130
133136
  }
133131
133137
  function convertRewrites(rewrites, internalParamNames) {
133132
133138
  return rewrites.map((r) => {
133133
- const { src, segments } = sourceToRegex(r.source);
133139
+ const { src, segments } = sourceToRegex3(r.source);
133134
133140
  const hasSegments = collectHasSegments(r.has);
133135
133141
  normalizeHasKeys(r.has);
133136
133142
  normalizeHasKeys(r.missing);
@@ -133161,7 +133167,7 @@ var require_superstatic = __commonJS2({
133161
133167
  function convertHeaders(headers) {
133162
133168
  return headers.map((h) => {
133163
133169
  const obj = {};
133164
- const { src, segments } = sourceToRegex(h.source);
133170
+ const { src, segments } = sourceToRegex3(h.source);
133165
133171
  const hasSegments = collectHasSegments(h.has);
133166
133172
  normalizeHasKeys(h.has);
133167
133173
  normalizeHasKeys(h.missing);
@@ -133223,7 +133229,7 @@ var require_superstatic = __commonJS2({
133223
133229
  }
133224
133230
  return routes2;
133225
133231
  }
133226
- function sourceToRegex(source) {
133232
+ function sourceToRegex3(source) {
133227
133233
  const keys = [];
133228
133234
  const r = pathToRegexp("632", source, keys, {
133229
133235
  strict: true,
@@ -134275,7 +134281,8 @@ var require_dist23 = __commonJS2({
134275
134281
  isHandler: () => isHandler2,
134276
134282
  isValidHandleValue: () => isValidHandleValue,
134277
134283
  mergeRoutes: () => import_merge2.mergeRoutes,
134278
- normalizeRoutes: () => normalizeRoutes2
134284
+ normalizeRoutes: () => normalizeRoutes2,
134285
+ sourceToRegex: () => import_superstatic2.sourceToRegex
134279
134286
  });
134280
134287
  module2.exports = __toCommonJS4(src_exports2);
134281
134288
  var import_url20 = require("url");
@@ -135897,9 +135904,9 @@ function sortBuilders(builds) {
135897
135904
  import_frameworks2.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
135898
135905
  );
135899
135906
  frontendRuntimeSet2.delete("@vercel/python");
135900
- const toNumber = (build2) => build2.use === "@vercel/python" ? 1 : frontendRuntimeSet2.has(build2.use) ? 0 : 2;
135901
- return builds.sort((build1, build2) => {
135902
- return toNumber(build1) - toNumber(build2);
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);
135903
135910
  });
135904
135911
  }
135905
135912
  var import_frameworks2;
@@ -145930,20 +145937,17 @@ var init_unzip = __esm({
145930
145937
  });
145931
145938
 
145932
145939
  // src/util/build/write-build-result.ts
145933
- async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, builder, builderPkg, vercelConfig, standalone = false) {
145940
+ async function writeBuildResult(repoRootPath, outputDir, buildResult, build3, builder, builderPkg, vercelConfig, standalone = false) {
145934
145941
  let version2 = builder.version;
145935
- if ("experimentalVersion" in builder && process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" && "name" in builder && builder.name === "express") {
145936
- version2 = builder.experimentalVersion;
145937
- }
145938
- if ("experimentalVersion" in builder && process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1" && "name" in builder && builder.name === "hono") {
145939
- version2 = builder.experimentalVersion;
145942
+ if ((0, import_build_utils11.isExperimentalBackendsEnabled)() && "output" in buildResult) {
145943
+ version2 = 2;
145940
145944
  }
145941
145945
  if (typeof version2 !== "number" || version2 === 2) {
145942
145946
  return writeBuildResultV2(
145943
145947
  repoRootPath,
145944
145948
  outputDir,
145945
145949
  buildResult,
145946
- build2,
145950
+ build3,
145947
145951
  vercelConfig,
145948
145952
  standalone
145949
145953
  );
@@ -145952,7 +145956,7 @@ async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, bu
145952
145956
  repoRootPath,
145953
145957
  outputDir,
145954
145958
  buildResult,
145955
- build2,
145959
+ build3,
145956
145960
  vercelConfig,
145957
145961
  standalone
145958
145962
  );
@@ -145977,16 +145981,16 @@ function isFile(v) {
145977
145981
  function stripDuplicateSlashes(path11) {
145978
145982
  return normalize2(path11).replace(/(^\/|\/$)/g, "");
145979
145983
  }
145980
- async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2, vercelConfig, standalone = false) {
145984
+ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build3, vercelConfig, standalone = false) {
145981
145985
  if ("buildOutputPath" in buildResult) {
145982
145986
  await mergeBuilderOutput(outputDir, buildResult);
145983
145987
  return;
145984
145988
  }
145985
145989
  if (!buildResult.output) {
145986
145990
  const configFile = vercelConfig?.[import_client3.fileNameSymbol];
145987
- const updateMessage = build2.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
145991
+ const updateMessage = build3.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
145988
145992
  throw new Error(
145989
- `The build result from "${build2.use}" is missing the "output" property.${updateMessage}`
145993
+ `The build result from "${build3.use}" is missing the "output" property.${updateMessage}`
145990
145994
  );
145991
145995
  }
145992
145996
  const existingFunctions = /* @__PURE__ */ new Map();
@@ -146079,9 +146083,40 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
146079
146083
  }
146080
146084
  return Object.keys(overrides).length > 0 ? overrides : void 0;
146081
146085
  }
146082
- async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2, vercelConfig, standalone = false) {
146086
+ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build3, vercelConfig, standalone = false) {
146083
146087
  const { output: output2 } = buildResult;
146084
- const src = build2.src;
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;
146085
146120
  if (typeof src !== "string") {
146086
146121
  throw new Error(`Expected "build.src" to be a string`);
146087
146122
  }
@@ -146091,7 +146126,7 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
146091
146126
  }) : {};
146092
146127
  const ext = (0, import_path21.extname)(src);
146093
146128
  const path11 = stripDuplicateSlashes(
146094
- build2.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
146129
+ build3.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
146095
146130
  );
146096
146131
  if (isLambda(output2)) {
146097
146132
  await writeLambda(
@@ -146114,7 +146149,7 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
146114
146149
  );
146115
146150
  } else {
146116
146151
  throw new Error(
146117
- `Unsupported output type: "${output2.type}" for ${build2.src}`
146152
+ `Unsupported output type: "${output2.type}" for ${build3.src}`
146118
146153
  );
146119
146154
  }
146120
146155
  }
@@ -146356,6 +146391,7 @@ var init_write_build_result = __esm({
146356
146391
  init_unzip();
146357
146392
  init_link2();
146358
146393
  import_client3 = __toESM3(require_dist7());
146394
+ init_output_manager();
146359
146395
  ({ normalize: normalize2 } = import_path21.posix);
146360
146396
  OUTPUT_DIR = (0, import_path21.join)(VERCEL_DIR2, "output");
146361
146397
  }
@@ -146798,7 +146834,8 @@ var init_validate_config = __esm({
146798
146834
  trailingSlash: import_routing_utils.trailingSlashSchema,
146799
146835
  functions: import_build_utils12.functionsSchema,
146800
146836
  images: imagesSchema,
146801
- crons: cronsSchema
146837
+ crons: cronsSchema,
146838
+ bunVersion: { type: "string" }
146802
146839
  }
146803
146840
  };
146804
146841
  ajv = new import_ajv2.default();
@@ -148247,19 +148284,19 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148247
148284
  await import_fs_extra18.default.mkdirp(outputDir);
148248
148285
  const ops = [];
148249
148286
  const buildsJsonBuilds = new Map(
148250
- builds.map((build2) => {
148251
- const builderWithPkg = buildersWithPkgs.get(build2.use);
148287
+ builds.map((build3) => {
148288
+ const builderWithPkg = buildersWithPkgs.get(build3.use);
148252
148289
  if (!builderWithPkg) {
148253
- throw new Error(`Failed to load Builder "${build2.use}"`);
148290
+ throw new Error(`Failed to load Builder "${build3.use}"`);
148254
148291
  }
148255
148292
  const { builder, pkg: builderPkg } = builderWithPkg;
148256
148293
  return [
148257
- build2,
148294
+ build3,
148258
148295
  {
148259
148296
  require: builderPkg.name,
148260
148297
  requirePath: builderWithPkg.path,
148261
148298
  apiVersion: builder.version,
148262
- ...build2
148299
+ ...build3
148263
148300
  }
148264
148301
  ];
148265
148302
  })
@@ -148276,12 +148313,12 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148276
148313
  const repoRootPath = cwd;
148277
148314
  const corepackShimDir = await initCorepack({ repoRootPath });
148278
148315
  const diagnostics = {};
148279
- for (const build2 of sortedBuilders) {
148280
- if (typeof build2.src !== "string")
148316
+ for (const build3 of sortedBuilders) {
148317
+ if (typeof build3.src !== "string")
148281
148318
  continue;
148282
- const builderWithPkg = buildersWithPkgs.get(build2.use);
148319
+ const builderWithPkg = buildersWithPkgs.get(build3.use);
148283
148320
  if (!builderWithPkg) {
148284
- throw new Error(`Failed to load Builder "${build2.use}"`);
148321
+ throw new Error(`Failed to load Builder "${build3.use}"`);
148285
148322
  }
148286
148323
  try {
148287
148324
  const { builder, pkg: builderPkg } = builderWithPkg;
@@ -148298,23 +148335,27 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148298
148335
  output_manager_default.debug(`Setting env ${envKey} to "${value}"`);
148299
148336
  }
148300
148337
  }
148301
- const isFrontendBuilder = build2.config && "framework" in build2.config;
148338
+ const isFrontendBuilder = build3.config && "framework" in build3.config;
148302
148339
  const buildConfig = isZeroConfig ? {
148303
148340
  outputDirectory: projectSettings.outputDirectory ?? void 0,
148304
- ...build2.config,
148341
+ ...build3.config,
148305
148342
  projectSettings,
148306
148343
  installCommand: projectSettings.installCommand ?? void 0,
148307
148344
  devCommand: projectSettings.devCommand ?? void 0,
148308
148345
  buildCommand: projectSettings.buildCommand ?? void 0,
148309
148346
  framework: projectSettings.framework,
148310
- nodeVersion: projectSettings.nodeVersion
148311
- } : build2.config || {};
148347
+ nodeVersion: projectSettings.nodeVersion,
148348
+ bunVersion: localConfig.bunVersion ?? void 0
148349
+ } : {
148350
+ ...build3.config || {},
148351
+ bunVersion: localConfig.bunVersion ?? void 0
148352
+ };
148312
148353
  const builderSpan = span.child("vc.builder", {
148313
148354
  name: builderPkg.name
148314
148355
  });
148315
148356
  const buildOptions = {
148316
148357
  files: filesMap,
148317
- entrypoint: build2.src,
148358
+ entrypoint: build3.src,
148318
148359
  workPath,
148319
148360
  repoRootPath,
148320
148361
  config: buildConfig,
@@ -148322,16 +148363,14 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148322
148363
  span: builderSpan
148323
148364
  };
148324
148365
  output_manager_default.debug(
148325
- `Building entrypoint "${build2.src}" with "${builderPkg.name}"`
148366
+ `Building entrypoint "${build3.src}" with "${builderPkg.name}"`
148326
148367
  );
148327
148368
  let buildResult;
148328
148369
  try {
148329
148370
  buildResult = await builderSpan.trace(
148330
148371
  () => {
148331
- if (process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" && "name" in builder && builder.name === "express" && "experimentalBuild" in builder && typeof builder.experimentalBuild === "function") {
148332
- return builder.experimentalBuild(buildOptions);
148333
- } else if (process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1" && "name" in builder && builder.name === "hono" && "experimentalBuild" in builder && typeof builder.experimentalBuild === "function") {
148334
- return builder.experimentalBuild(buildOptions);
148372
+ if ((0, import_build_utils13.shouldUseExperimentalBackends)(buildConfig.framework) && builderPkg.name !== "@vercel/static") {
148373
+ return experimentalBackendBuilder.build(buildOptions);
148335
148374
  }
148336
148375
  return builder.build(buildOptions);
148337
148376
  }
@@ -148361,12 +148400,55 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148361
148400
  if ((0, import_build_utils13.getDiscontinuedNodeVersions)().some((o) => o.runtime === lambdaRuntime)) {
148362
148401
  throw new import_build_utils13.NowBuildError({
148363
148402
  code: "NODEJS_DISCONTINUED_VERSION",
148364
- message: `The Runtime "${build2.use}" is using "${lambdaRuntime}", which is discontinued. Please upgrade your Runtime to a more recent version or consult the author for more details.`,
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.`,
148365
148404
  link: "https://vercel.link/function-runtimes"
148366
148405
  });
148367
148406
  }
148368
148407
  }
148369
- buildResults.set(build2, buildResult);
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);
148370
148452
  let buildOutputLength = 0;
148371
148453
  if ("output" in buildResult) {
148372
148454
  buildOutputLength = Array.isArray(buildResult.output) ? buildResult.output.length : 1;
@@ -148379,7 +148461,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148379
148461
  repoRootPath,
148380
148462
  outputDir,
148381
148463
  buildResult,
148382
- build2,
148464
+ build3,
148383
148465
  builder,
148384
148466
  builderPkg,
148385
148467
  localConfig,
@@ -148394,7 +148476,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148394
148476
  )
148395
148477
  );
148396
148478
  } catch (err) {
148397
- const buildJsonBuild = buildsJsonBuilds.get(build2);
148479
+ const buildJsonBuild = buildsJsonBuilds.get(build3);
148398
148480
  if (buildJsonBuild) {
148399
148481
  buildJsonBuild.error = toEnumerableError(err);
148400
148482
  }
@@ -148448,10 +148530,10 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148448
148530
  if (existingConfig.overrides) {
148449
148531
  overrides.push(existingConfig.overrides);
148450
148532
  }
148451
- for (const [build2, buildResult] of buildResults.entries()) {
148533
+ for (const [build3, buildResult] of buildResults.entries()) {
148452
148534
  if ("buildOutputPath" in buildResult) {
148453
- output_manager_default.debug(`Using "config.json" for "${build2.use}`);
148454
- buildResults.set(build2, existingConfig);
148535
+ output_manager_default.debug(`Using "config.json" for "${build3.use}`);
148536
+ buildResults.set(build3, existingConfig);
148455
148537
  break;
148456
148538
  }
148457
148539
  }
@@ -148512,8 +148594,8 @@ async function getFramework(cwd, buildResults) {
148512
148594
  return;
148513
148595
  }
148514
148596
  if (detectedFramework.useRuntime) {
148515
- for (const [build2, buildResult] of buildResults.entries()) {
148516
- if ("framework" in buildResult && build2.use === detectedFramework.useRuntime.use) {
148597
+ for (const [build3, buildResult] of buildResults.entries()) {
148598
+ if ("framework" in buildResult && build3.use === detectedFramework.useRuntime.use) {
148517
148599
  return buildResult.framework;
148518
148600
  }
148519
148601
  }
@@ -148532,8 +148614,8 @@ async function getFramework(cwd, buildResults) {
148532
148614
  };
148533
148615
  }
148534
148616
  }
148535
- function expandBuild(files, build2) {
148536
- if (!build2.use) {
148617
+ function expandBuild(files, build3) {
148618
+ if (!build3.use) {
148537
148619
  throw new import_build_utils13.NowBuildError({
148538
148620
  code: `invalid_build_specification`,
148539
148621
  message: "Field `use` is missing in build specification",
@@ -148541,7 +148623,7 @@ function expandBuild(files, build2) {
148541
148623
  action: "View Documentation"
148542
148624
  });
148543
148625
  }
148544
- let src = (0, import_path27.normalize)(build2.src || "**").split(import_path27.sep).join("/");
148626
+ let src = (0, import_path27.normalize)(build3.src || "**").split(import_path27.sep).join("/");
148545
148627
  if (src === "." || src === "./") {
148546
148628
  throw new import_build_utils13.NowBuildError({
148547
148629
  code: `invalid_build_specification`,
@@ -148558,7 +148640,7 @@ function expandBuild(files, build2) {
148558
148640
  );
148559
148641
  return matches.map((m) => {
148560
148642
  return {
148561
- ...build2,
148643
+ ...build3,
148562
148644
  src: m
148563
148645
  };
148564
148646
  });
@@ -148630,7 +148712,7 @@ async function getFrameworkRoutes(framework, dirPrefix) {
148630
148712
  }
148631
148713
  return routes2;
148632
148714
  }
148633
- 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;
148634
148716
  var init_build2 = __esm({
148635
148717
  "src/commands/build/index.ts"() {
148636
148718
  "use strict";
@@ -148640,6 +148722,7 @@ var init_build2 = __esm({
148640
148722
  import_minimatch2 = __toESM3(require_minimatch2());
148641
148723
  import_path27 = require("path");
148642
148724
  import_semver3 = __toESM3(require_semver());
148725
+ experimentalBackendBuilder = __toESM3(require("@vercel/backends"));
148643
148726
  import_build_utils13 = require("@vercel/build-utils");
148644
148727
  import_client6 = __toESM3(require_dist7());
148645
148728
  import_frameworks5 = __toESM3(require_frameworks());
@@ -151043,7 +151126,7 @@ var init_util = __esm({
151043
151126
  regions,
151044
151127
  quiet = false,
151045
151128
  env,
151046
- build: build2,
151129
+ build: build3,
151047
151130
  forceNew = false,
151048
151131
  withCache = false,
151049
151132
  target = null,
@@ -151059,7 +151142,7 @@ var init_util = __esm({
151059
151142
  const requestBody = {
151060
151143
  ...nowConfig,
151061
151144
  env,
151062
- build: build2,
151145
+ build: build3,
151063
151146
  public: wantsPublic || nowConfig.public,
151064
151147
  name,
151065
151148
  project,
@@ -152030,7 +152113,7 @@ var init_deploy2 = __esm({
152030
152113
  return 1;
152031
152114
  }
152032
152115
  const prebuiltBuild = await getPrebuiltJson(vercelOutputDir);
152033
- const prebuiltError = prebuiltBuild?.error || prebuiltBuild?.builds?.find((build2) => "error" in build2)?.error;
152116
+ const prebuiltError = prebuiltBuild?.error || prebuiltBuild?.builds?.find((build3) => "error" in build3)?.error;
152034
152117
  if (prebuiltError) {
152035
152118
  output_manager_default.log(
152036
152119
  `Prebuilt deployment cannot be created because ${getCommandName(
@@ -169464,7 +169547,7 @@ async function getBuildMatches(vercelConfig, cwd, devServer, fileList) {
169464
169547
  if (src[0] === "/") {
169465
169548
  src = src.substring(1);
169466
169549
  }
169467
- if (buildConfig.config?.framework === "hono" || buildConfig.config?.framework === "express" || buildConfig.config?.framework === "h3" || buildConfig.config?.framework === "nestjs" || buildConfig.config?.framework === "fastify") {
169550
+ if ((0, import_build_utils16.isBackendFramework)(buildConfig.config?.framework)) {
169468
169551
  src = "package.json";
169469
169552
  }
169470
169553
  if (buildConfig.config?.framework === "fastapi" || buildConfig.config?.framework === "flask") {
@@ -170098,8 +170181,8 @@ async function getReachableHostOnPort(port) {
170098
170181
  ]);
170099
170182
  return results.find(Boolean) || false;
170100
170183
  }
170101
- function filterFrontendBuilds(build2) {
170102
- const { name } = (0, import_npm_package_arg2.default)(build2.use);
170184
+ function filterFrontendBuilds(build3) {
170185
+ const { name } = (0, import_npm_package_arg2.default)(build3.use);
170103
170186
  return !frontendRuntimeSet.has(name || "");
170104
170187
  }
170105
170188
  function hasNewRoutingProperties(vercelConfig) {
@@ -171122,6 +171205,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
171122
171205
  return defaults;
171123
171206
  }
171124
171207
  }
171208
+ if ((0, import_build_utils17.isExperimentalBackendsEnabled)()) {
171209
+ return "npx @vercel/cervel dev";
171210
+ }
171125
171211
  }
171126
171212
  return void 0;
171127
171213
  }
@@ -177572,7 +177658,7 @@ var init_builds = __esm({
177572
177658
  getCommonPath = (buildGroup) => {
177573
177659
  const commonPath = [];
177574
177660
  const splits = buildGroup.map(
177575
- (build2) => getDirPath(build2.entrypoint).split("/")
177661
+ (build3) => getDirPath(build3.entrypoint).split("/")
177576
177662
  );
177577
177663
  const shortest = splits.reduce(
177578
177664
  (prevValue, currentValue) => Math.min(prevValue, currentValue.length),
@@ -177588,15 +177674,15 @@ var init_builds = __esm({
177588
177674
  }
177589
177675
  return commonPath.join("/") || "/";
177590
177676
  };
177591
- styleBuild = (build2, times, longestSource) => {
177592
- const { entrypoint, id } = build2;
177677
+ styleBuild = (build3, times, longestSource) => {
177678
+ const { entrypoint, id } = build3;
177593
177679
  const time = typeof times[id] === "string" ? times[id] : "";
177594
177680
  let pathColor = import_chalk98.default.cyan;
177595
- if (isFailed(build2)) {
177681
+ if (isFailed(build3)) {
177596
177682
  pathColor = import_chalk98.default.red;
177597
177683
  }
177598
177684
  const entry = entrypoint.padEnd(longestSource + padding);
177599
- const prefix = hasOutput(build2) ? "\u250C" : "\u2576";
177685
+ const prefix = hasOutput(build3) ? "\u250C" : "\u2576";
177600
177686
  return `${import_chalk98.default.grey(prefix)} ${pathColor(entry)}${time}`;
177601
177687
  };
177602
177688
  styleHiddenBuilds = (commonPath, buildGroup, times, longestSource, isHidden2 = false) => {
@@ -177688,7 +177774,7 @@ var init_builds = __esm({
177688
177774
  return nextList;
177689
177775
  };
177690
177776
  builds_default = (builds, times) => {
177691
- let path11 = builds.sort(sortByEntrypoint).map((build2) => [build2]);
177777
+ let path11 = builds.sort(sortByEntrypoint).map((build3) => [build3]);
177692
177778
  const highestLevel = builds.reduce((prev, curr) => {
177693
177779
  const partCounter = curr.entrypoint.split("/").length - 1;
177694
177780
  return partCounter > prev ? partCounter : prev;
@@ -177751,9 +177837,9 @@ var init_builds = __esm({
177751
177837
  finalBuildsLength++;
177752
177838
  }
177753
177839
  const outputs = [];
177754
- for (const build2 of buildGroup) {
177755
- if (Array.isArray(build2.output)) {
177756
- outputs.push(...build2.output);
177840
+ for (const build3 of buildGroup) {
177841
+ if (Array.isArray(build3.output)) {
177842
+ outputs.push(...build3.output);
177757
177843
  }
177758
177844
  }
177759
177845
  outputs.slice(0, MAX_OUTPUTS_PER_GROUP).forEach(
@@ -178088,8 +178174,8 @@ async function printDetails({
178088
178174
  }
178089
178175
  if (builds.length > 0) {
178090
178176
  const times = {};
178091
- for (const build2 of builds) {
178092
- const { id: id2, createdAt: createdAt2, readyStateAt } = build2;
178177
+ for (const build3 of builds) {
178178
+ const { id: id2, createdAt: createdAt2, readyStateAt } = build3;
178093
178179
  times[id2] = createdAt2 && readyStateAt ? elapsed(readyStateAt - createdAt2) : null;
178094
178180
  }
178095
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.5.0",
3
+ "version": "48.6.2",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -22,23 +22,24 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@vercel/blob": "1.0.2",
25
- "@vercel/build-utils": "12.1.3",
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.0.26",
29
- "@vercel/hono": "0.1.7",
30
- "@vercel/h3": "0.1.6",
31
- "@vercel/hydrogen": "1.2.4",
32
- "@vercel/next": "4.13.4",
33
- "@vercel/node": "5.4.1",
28
+ "@vercel/express": "0.1.1",
29
+ "@vercel/hono": "0.2.1",
30
+ "@vercel/h3": "0.1.7",
31
+ "@vercel/hydrogen": "1.3.0",
32
+ "@vercel/next": "4.14.1",
33
+ "@vercel/node": "5.5.0",
34
34
  "@vercel/python": "5.0.10",
35
- "@vercel/redwood": "2.3.6",
36
- "@vercel/remix-builder": "5.4.13",
35
+ "@vercel/redwood": "2.4.0",
36
+ "@vercel/remix-builder": "5.5.0",
37
37
  "@vercel/ruby": "2.2.1",
38
- "@vercel/static-build": "2.7.26",
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.0.4",
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.6.4",
90
- "@vercel/routing-utils": "5.2.0",
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": "ts-node ./src/index.ts",
184
+ "vercel": "pnpm build && node ./dist/vc.js",
184
185
  "vc": "pnpm vercel",
185
186
  "type-check": "tsc --noEmit"
186
187
  }