@vercel/next 4.15.22 → 4.15.23

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.
@@ -9711,6 +9711,17 @@ async function handleStaticOutputs(outputs, {
9711
9711
  );
9712
9712
  }
9713
9713
  var vercelConfig = JSON.parse(process.env.NEXT_ADAPTER_VERCEL_CONFIG || "{}");
9714
+ async function writeDeterministicRoutesManifest(distDir) {
9715
+ const manifest = require(import_node_path.default.join(distDir, "routes-manifest.json"));
9716
+ manifest.headers = [];
9717
+ delete manifest.deploymentId;
9718
+ const outputManifestPath = import_node_path.default.join(
9719
+ distDir,
9720
+ "routes-manifest-deterministic.json"
9721
+ );
9722
+ await import_promises.default.writeFile(outputManifestPath, JSON.stringify(manifest));
9723
+ return outputManifestPath;
9724
+ }
9714
9725
  async function handleNodeOutputs(nodeOutputs, {
9715
9726
  config,
9716
9727
  distDir,
@@ -9738,6 +9749,14 @@ async function handleNodeOutputs(nodeOutputs, {
9738
9749
  break;
9739
9750
  }
9740
9751
  }
9752
+ const routesManifestDeterministicRelativePath = import_node_path.default.posix.relative(
9753
+ repoRoot,
9754
+ await writeDeterministicRoutesManifest(distDir)
9755
+ );
9756
+ const routesManifestRelativePath = import_node_path.default.posix.join(
9757
+ import_node_path.default.posix.relative(repoRoot, distDir),
9758
+ "routes-manifest.json"
9759
+ );
9741
9760
  await Promise.all(
9742
9761
  nodeOutputs.map(async (output) => {
9743
9762
  await fsSema.acquire();
@@ -9762,6 +9781,9 @@ async function handleNodeOutputs(nodeOutputs, {
9762
9781
  files[import_node_path.default.posix.relative(repoRoot, notFoundOutput.filePath)] = import_node_path.default.posix.relative(repoRoot, notFoundOutput.filePath);
9763
9782
  }
9764
9783
  }
9784
+ if (files[routesManifestRelativePath]) {
9785
+ files[routesManifestRelativePath] = routesManifestDeterministicRelativePath;
9786
+ }
9765
9787
  const handlerFilePath = import_node_path.default.join(
9766
9788
  functionDir,
9767
9789
  handlerRelativeDir,
Binary file
@@ -60,17 +60,16 @@ const getHandlerSource = (ctx) => `
60
60
  staticRoutes: staticRoutesRaw,
61
61
  i18n
62
62
  } = require("./" + path.posix.join(relativeDistDir, "routes-manifest.json"));
63
- const hydrateRoutesManifestItem = (item) => {
64
- return {
65
- ...item,
66
- namedRegex: new RegExp(item.namedRegex || item.regex)
67
- };
68
- };
69
63
  const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
70
64
  function escapeStringRegexp(str) {
71
65
  return str.replace(matchOperatorsRegex, "\\$&");
72
66
  }
73
- const dynamicRoutes = dynamicRoutesRaw.map(hydrateRoutesManifestItem);
67
+ const dynamicRoutes = dynamicRoutesRaw.map((item) => {
68
+ return {
69
+ ...item,
70
+ namedRegex: new RegExp(item.namedRegex || item.regex)
71
+ };
72
+ });
74
73
  const staticRoutes = staticRoutesRaw.map((route) => {
75
74
  return {
76
75
  ...route,
package/dist/index.js CHANGED
@@ -15098,11 +15098,11 @@ ${JSON.stringify(
15098
15098
  }
15099
15099
  const updatedManifestFiles = {};
15100
15100
  if (isCorrectManifests) {
15101
- for (const manifest of mayFilterManifests ? [
15101
+ for (const manifest of [
15102
15102
  "routes-manifest.json",
15103
15103
  "server/pages-manifest.json",
15104
- ...appPathRoutesManifest ? ["server/app-paths-manifest.json"] : []
15105
- ] : ["routes-manifest.json"]) {
15104
+ ...mayFilterManifests && appPathRoutesManifest ? ["server/app-paths-manifest.json"] : []
15105
+ ]) {
15106
15106
  const fsPath = import_path5.default.join(entryPath, outputDirectory, manifest);
15107
15107
  const relativePath = import_path5.default.relative(baseDir, fsPath);
15108
15108
  delete group.pseudoLayer[relativePath];
@@ -15117,8 +15117,8 @@ ${JSON.stringify(
15117
15117
  if (i18n) {
15118
15118
  for (const locale of i18n.locales) {
15119
15119
  const locale404Key = `/${locale}/404`;
15120
- if (manifestData[locale404Key] === `pages/${locale}/404.html`) {
15121
- manifestData[locale404Key] = lambdaPages["404.js"] && !lambdaAppPaths["404.js"] ? `pages/404.js` : "pages/_error.js";
15120
+ if (manifestData[locale404Key]?.endsWith("/404.html")) {
15121
+ manifestData[locale404Key] = lambdaPages["404.js"] && !lambdaAppPaths["404.js"] ? "pages/404.js" : "pages/_error.js";
15122
15122
  }
15123
15123
  }
15124
15124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.15.22",
3
+ "version": "4.15.23",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -16,7 +16,7 @@
16
16
  "@vercel/nft": "1.1.1"
17
17
  },
18
18
  "devDependencies": {
19
- "@next-community/adapter-vercel": "0.0.1-beta.3",
19
+ "@next-community/adapter-vercel": "0.0.1-beta.4",
20
20
  "@types/aws-lambda": "8.10.19",
21
21
  "@types/buffer-crc32": "0.2.0",
22
22
  "@types/bytes": "3.1.1",
@@ -53,7 +53,7 @@
53
53
  "test-listen": "1.1.0",
54
54
  "text-table": "0.2.0",
55
55
  "webpack-sources": "3.2.3",
56
- "@vercel/build-utils": "13.3.0",
56
+ "@vercel/build-utils": "13.3.1",
57
57
  "@vercel/routing-utils": "5.3.2"
58
58
  },
59
59
  "scripts": {