@vercel/next 4.17.6 → 4.19.0

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 +63 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -940,14 +940,23 @@ var require_superstatic = __commonJS({
940
940
  normalizeHasKeys(r.has);
941
941
  normalizeHasKeys(r.missing);
942
942
  try {
943
- const dest = replaceSegments(
943
+ const interpolate = (value) => replaceSegments(
944
944
  segments,
945
945
  hasSegments,
946
- r.destination,
946
+ value,
947
947
  false,
948
948
  internalParamNames
949
949
  );
950
- const route = { src, dest, check: true };
950
+ let route;
951
+ if (typeof r.destination === "string") {
952
+ route = { src, dest: interpolate(r.destination), check: true };
953
+ } else {
954
+ const destination = { ...r.destination };
955
+ if (typeof destination.path === "string") {
956
+ destination.path = interpolate(destination.path);
957
+ }
958
+ route = { src, destination };
959
+ }
951
960
  if (typeof r.env !== "undefined") {
952
961
  route.env = r.env;
953
962
  }
@@ -12512,6 +12521,13 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12512
12521
  message: "invariant: isOmitted and isFallback cannot both be true"
12513
12522
  });
12514
12523
  }
12524
+ const routeIsDynamic = Boolean(isFallback || isBlocking || isOmitted);
12525
+ let hasFallback;
12526
+ if (isFallback) {
12527
+ hasFallback = true;
12528
+ } else if (isBlocking || isOmitted) {
12529
+ hasFallback = false;
12530
+ }
12515
12531
  let routeFileNoExt = routeKey === "/" ? "/index" : routeKey;
12516
12532
  let origRouteFileNoExt = routeFileNoExt;
12517
12533
  const { isLocalePrefixed } = prerenderManifest;
@@ -12612,6 +12628,15 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12612
12628
  }
12613
12629
  const isOmittedOrNotFound = isOmitted || isNotFound;
12614
12630
  let htmlFallbackFsRef = null;
12631
+ let htmlSize;
12632
+ if (appDir) {
12633
+ try {
12634
+ htmlSize = import_fs_extra3.default.statSync(
12635
+ import_path3.default.join(appDir, `${routeFileNoExt}.html`)
12636
+ ).size;
12637
+ } catch {
12638
+ }
12639
+ }
12615
12640
  let postponedPrerender;
12616
12641
  let postponedState = null;
12617
12642
  let didPostpone = false;
@@ -12889,6 +12914,9 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12889
12914
  allowHeader,
12890
12915
  partialFallback: partialFallback || void 0,
12891
12916
  hasPostponed,
12917
+ hasFallback,
12918
+ htmlSize,
12919
+ isDynamicRoute: routeIsDynamic,
12892
12920
  ...isNotFound ? {
12893
12921
  initialStatus: 404
12894
12922
  } : {},
@@ -12923,6 +12951,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12923
12951
  allowHeader,
12924
12952
  partialFallback: void 0,
12925
12953
  hasPostponed,
12954
+ hasFallback,
12955
+ isDynamicRoute: routeIsDynamic,
12926
12956
  ...isNotFound ? {
12927
12957
  initialStatus: 404
12928
12958
  } : {},
@@ -12978,6 +13008,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12978
13008
  allowHeader,
12979
13009
  partialFallback: void 0,
12980
13010
  hasPostponed,
13011
+ hasFallback,
13012
+ isDynamicRoute: routeIsDynamic,
12981
13013
  chain: {
12982
13014
  outputPath: normalizePathData(outputPathData),
12983
13015
  headers: routesManifest.ppr.chain.headers
@@ -13045,6 +13077,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
13045
13077
  allowHeader,
13046
13078
  partialFallback: void 0,
13047
13079
  hasPostponed,
13080
+ hasFallback,
13081
+ isDynamicRoute: routeIsDynamic,
13048
13082
  // These routes are always only static, so they should not
13049
13083
  // permit any bypass unless it's for preview
13050
13084
  bypassToken: prerenderManifest.bypassToken,
@@ -16607,6 +16641,7 @@ var build = async (buildOptions) => {
16607
16641
  const nodeVersion = await (0, import_build_utils3.getNodeVersion)(entryPath, void 0, config, meta);
16608
16642
  const {
16609
16643
  cliType,
16644
+ lockfilePath,
16610
16645
  lockfileVersion,
16611
16646
  packageJsonPackageManager,
16612
16647
  turboSupportsCorepackHome
@@ -16826,6 +16861,21 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
16826
16861
  if (buildCallback) {
16827
16862
  await buildCallback(buildOptions);
16828
16863
  }
16864
+ try {
16865
+ await (0, import_build_utils3.generateProjectManifest)({
16866
+ workPath,
16867
+ nodeVersion,
16868
+ cliType,
16869
+ lockfilePath,
16870
+ lockfileVersion,
16871
+ framework: config.framework ?? void 0,
16872
+ serviceType: buildOptions.service ? (0, import_build_utils3.getReportedServiceType)(buildOptions.service) : void 0
16873
+ });
16874
+ } catch (err) {
16875
+ (0, import_build_utils3.debug)(
16876
+ `Failed to write next manifest: ${err instanceof Error ? err.message : String(err)}`
16877
+ );
16878
+ }
16829
16879
  let buildOutputVersion;
16830
16880
  try {
16831
16881
  const data = await (0, import_fs_extra6.readJSON)(
@@ -18634,11 +18684,13 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
18634
18684
  ...deploymentId && { deploymentId }
18635
18685
  };
18636
18686
  };
18687
+ var packageManifestDiagnostics = (0, import_build_utils3.createDiagnostics)("node");
18637
18688
  var diagnostics = async ({
18638
18689
  config,
18639
18690
  entrypoint,
18640
18691
  workPath,
18641
- repoRootPath
18692
+ repoRootPath,
18693
+ ...rest
18642
18694
  }) => {
18643
18695
  const entryDirectory = import_path6.default.dirname(entrypoint);
18644
18696
  const entryPath = import_path6.default.join(workPath, entryDirectory);
@@ -18649,6 +18701,13 @@ var diagnostics = async ({
18649
18701
  `Reading diagnostics file in diagnosticsEntrypoint=${diagnosticsEntrypoint}`
18650
18702
  );
18651
18703
  return {
18704
+ ...await packageManifestDiagnostics({
18705
+ config,
18706
+ entrypoint,
18707
+ workPath,
18708
+ repoRootPath,
18709
+ ...rest
18710
+ }),
18652
18711
  // Collect output in `.next/diagnostics`
18653
18712
  ...await (0, import_build_utils3.glob)(
18654
18713
  "*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.17.6",
3
+ "version": "4.19.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -53,8 +53,8 @@
53
53
  "text-table": "0.2.0",
54
54
  "vitest": "2.0.3",
55
55
  "webpack-sources": "3.2.3",
56
- "@vercel/routing-utils": "6.2.0",
57
- "@vercel/build-utils": "13.28.0"
56
+ "@vercel/build-utils": "13.30.0",
57
+ "@vercel/routing-utils": "6.3.0"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "node build.mjs",