vercel 48.10.6 → 48.10.8

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 +13 -3
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -146551,7 +146551,7 @@ async function writeBuildResultV3(args2) {
146551
146551
  } = args2;
146552
146552
  const { output: output2 } = buildResult;
146553
146553
  const routesJsonPath = (0, import_path21.join)(workPath, ".vercel", "routes.json");
146554
- if ((0, import_build_utils11.isBackendBuilder)(build2) && (0, import_fs_extra12.existsSync)(routesJsonPath)) {
146554
+ if (((0, import_build_utils11.isBackendBuilder)(build2) || build2.use === "@vercel/python") && (0, import_fs_extra12.existsSync)(routesJsonPath)) {
146555
146555
  try {
146556
146556
  const newOutput = {
146557
146557
  index: output2
@@ -148889,13 +148889,15 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148889
148889
  });
148890
148890
  }
148891
148891
  }
148892
- if ("output" in buildResult && buildResult.output && (0, import_build_utils13.isBackendBuilder)(build2)) {
148892
+ if ("output" in buildResult && buildResult.output && ((0, import_build_utils13.isBackendBuilder)(build2) || build2.use === "@vercel/python")) {
148893
148893
  const routesJsonPath = (0, import_path27.join)(workPath, ".vercel", "routes.json");
148894
148894
  if ((0, import_fs_extra18.existsSync)(routesJsonPath)) {
148895
148895
  try {
148896
148896
  const routesJson = await readJSONFile(routesJsonPath);
148897
148897
  if (routesJson && typeof routesJson === "object" && "routes" in routesJson && Array.isArray(routesJson.routes)) {
148898
+ const indexLambda = "index" in buildResult.output ? buildResult.output["index"] : void 0;
148898
148899
  const convertedRoutes = [];
148900
+ const convertedOutputs = indexLambda ? { index: indexLambda } : {};
148899
148901
  for (const route of routesJson.routes) {
148900
148902
  if (typeof route.source !== "string") {
148901
148903
  continue;
@@ -148911,6 +148913,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148911
148913
  if (route.source === "/") {
148912
148914
  continue;
148913
148915
  }
148916
+ if (indexLambda) {
148917
+ convertedOutputs[route.source] = indexLambda;
148918
+ }
148914
148919
  convertedRoutes.push(newRoute);
148915
148920
  }
148916
148921
  buildResult.routes = [
@@ -148918,6 +148923,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
148918
148923
  ...convertedRoutes,
148919
148924
  { src: "/(.*)", dest: "/" }
148920
148925
  ];
148926
+ if (indexLambda) {
148927
+ buildResult.output = convertedOutputs;
148928
+ }
148921
148929
  }
148922
148930
  } catch (error3) {
148923
148931
  output_manager_default.error(`Failed to read routes.json: ${error3}`);
@@ -151045,7 +151053,9 @@ async function getDeploymentUrlAndToken(client2, commandName, path11, options) {
151045
151053
  output_manager_default.error("Failed to get project information");
151046
151054
  return 1;
151047
151055
  }
151048
- const target = linkedProject.project.latestDeployments?.[0]?.url;
151056
+ const preferredAlias = linkedProject.project.targets?.production?.alias?.[0];
151057
+ const backupAlias = linkedProject.project.latestDeployments?.[0]?.url;
151058
+ const target = preferredAlias || backupAlias;
151049
151059
  let baseUrl;
151050
151060
  if (deploymentFlag) {
151051
151061
  const accountId = scope.team?.id || scope.user.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "48.10.6",
3
+ "version": "48.10.8",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -24,7 +24,7 @@
24
24
  "@vercel/blob": "1.0.2",
25
25
  "@vercel/build-utils": "13.1.0",
26
26
  "@vercel/elysia": "0.1.6",
27
- "@vercel/express": "0.1.10",
27
+ "@vercel/express": "0.1.11",
28
28
  "@vercel/fastify": "0.1.9",
29
29
  "@vercel/fun": "1.2.0",
30
30
  "@vercel/go": "3.2.3",
@@ -40,8 +40,8 @@
40
40
  "@vercel/static-build": "2.8.8",
41
41
  "chokidar": "4.0.0",
42
42
  "jose": "5.9.6",
43
- "@vercel/backends": "0.0.9",
44
- "@vercel/detect-agent": "1.0.0"
43
+ "@vercel/detect-agent": "1.0.0",
44
+ "@vercel/backends": "0.0.10"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@alex_neo/jest-expect-message": "1.0.5",
@@ -170,8 +170,8 @@
170
170
  "xdg-app-paths": "5.1.0",
171
171
  "yauzl-promise": "2.1.3",
172
172
  "@vercel-internals/constants": "1.0.4",
173
- "@vercel-internals/get-package-json": "1.0.0",
174
- "@vercel-internals/types": "3.0.6"
173
+ "@vercel-internals/types": "3.0.6",
174
+ "@vercel-internals/get-package-json": "1.0.0"
175
175
  },
176
176
  "scripts": {
177
177
  "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",