vercel 48.6.0 → 48.6.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.
Files changed (2) hide show
  1. package/dist/index.js +90 -19
  2. package/package.json +10 -9
package/dist/index.js CHANGED
@@ -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.0",
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.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",
@@ -133025,7 +133025,7 @@ var require_superstatic = __commonJS2({
133025
133025
  convertTrailingSlash: () => convertTrailingSlash,
133026
133026
  getCleanUrls: () => getCleanUrls2,
133027
133027
  pathToRegexp: () => pathToRegexp,
133028
- sourceToRegex: () => 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 } = sourceToRegex(r.source);
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 } = sourceToRegex(r.source);
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 } = sourceToRegex(h.source);
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 sourceToRegex(source) {
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");
@@ -145938,11 +145939,8 @@ var init_unzip = __esm({
145938
145939
  // src/util/build/write-build-result.ts
145939
145940
  async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, builder, builderPkg, vercelConfig, standalone = false) {
145940
145941
  let version2 = builder.version;
145941
- if ("experimentalVersion" in builder && process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" && "name" in builder && builder.name === "express") {
145942
- version2 = builder.experimentalVersion;
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(
@@ -146087,6 +146085,37 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
146087
146085
  }
146088
146086
  async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2, vercelConfig, standalone = false) {
146089
146087
  const { output: output2 } = buildResult;
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
+ build2,
146111
+ vercelConfig,
146112
+ standalone
146113
+ );
146114
+ } catch (error3) {
146115
+ output_manager_default.error(`Failed to read routes.json: ${error3}`);
146116
+ }
146117
+ }
146118
+ }
146090
146119
  const src = build2.src;
146091
146120
  if (typeof src !== "string") {
146092
146121
  throw new Error(`Expected "build.src" to be a string`);
@@ -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
  }
@@ -148339,11 +148369,6 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148339
148369
  try {
148340
148370
  buildResult = await builderSpan.trace(
148341
148371
  () => {
148342
- if (process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" && "name" in builder && builder.name === "express" && "experimentalBuild" in builder && typeof builder.experimentalBuild === "function") {
148343
- return builder.experimentalBuild(buildOptions);
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);
148346
- }
148347
148372
  return builder.build(buildOptions);
148348
148373
  }
148349
148374
  );
@@ -148377,6 +148402,49 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148377
148402
  });
148378
148403
  }
148379
148404
  }
148405
+ const backendBuilders = [
148406
+ "@vercel/express",
148407
+ "@vercel/hono",
148408
+ "@vercel/fastify"
148409
+ ];
148410
+ const isBackendBuilder = build2.use && backendBuilders.includes(build2.use);
148411
+ if (process.env.VERCEL_EXPERIMENTAL_ROUTES_JSON === "1") {
148412
+ if ("output" in buildResult && buildResult.output && isBackendBuilder) {
148413
+ const routesJsonPath = (0, import_path27.join)(outputDir, "..", "routes.json");
148414
+ if ((0, import_fs_extra18.existsSync)(routesJsonPath)) {
148415
+ try {
148416
+ const routesJson = await readJSONFile(routesJsonPath);
148417
+ if (routesJson && typeof routesJson === "object" && "routes" in routesJson && Array.isArray(routesJson.routes)) {
148418
+ const convertedRoutes = [];
148419
+ for (const route of routesJson.routes) {
148420
+ if (typeof route.source !== "string") {
148421
+ continue;
148422
+ }
148423
+ const { src } = (0, import_routing_utils2.sourceToRegex)(route.source);
148424
+ const newRoute = {
148425
+ src,
148426
+ dest: route.source
148427
+ };
148428
+ if (route.methods) {
148429
+ newRoute.methods = route.methods;
148430
+ }
148431
+ if (route.source === "/") {
148432
+ continue;
148433
+ }
148434
+ convertedRoutes.push(newRoute);
148435
+ }
148436
+ buildResult.routes = [
148437
+ { handle: "filesystem" },
148438
+ ...convertedRoutes,
148439
+ { src: "/(.*)", dest: "/" }
148440
+ ];
148441
+ }
148442
+ } catch (error3) {
148443
+ output_manager_default.error(`Failed to read routes.json: ${error3}`);
148444
+ }
148445
+ }
148446
+ }
148447
+ }
148380
148448
  buildResults.set(build2, buildResult);
148381
148449
  let buildOutputLength = 0;
148382
148450
  if ("output" in buildResult) {
@@ -169475,7 +169543,7 @@ async function getBuildMatches(vercelConfig, cwd, devServer, fileList) {
169475
169543
  if (src[0] === "/") {
169476
169544
  src = src.substring(1);
169477
169545
  }
169478
- if (buildConfig.config?.framework === "hono" || buildConfig.config?.framework === "express" || buildConfig.config?.framework === "h3" || buildConfig.config?.framework === "nestjs" || buildConfig.config?.framework === "fastify") {
169546
+ if ((0, import_build_utils16.isBackendFramework)(buildConfig.config?.framework)) {
169479
169547
  src = "package.json";
169480
169548
  }
169481
169549
  if (buildConfig.config?.framework === "fastapi" || buildConfig.config?.framework === "flask") {
@@ -171133,6 +171201,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
171133
171201
  return defaults;
171134
171202
  }
171135
171203
  }
171204
+ if ((0, import_build_utils17.isExperimentalBackendsEnabled)()) {
171205
+ return "npx @vercel/cervel dev";
171206
+ }
171136
171207
  }
171137
171208
  return void 0;
171138
171209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "48.6.0",
3
+ "version": "48.6.3",
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.0",
29
- "@vercel/hono": "0.2.0",
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.0",
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.0",
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.0",
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
  }