@vercel/next 4.15.22 → 4.15.24
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.
- package/dist/adapter/index.js +22 -0
- package/dist/adapter/mappings.wasm +0 -0
- package/dist/adapter/node-handler.js +6 -7
- package/dist/index.js +7 -6
- package/package.json +3 -3
package/dist/adapter/index.js
CHANGED
|
@@ -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(
|
|
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
|
|
15101
|
+
for (const manifest of [
|
|
15102
15102
|
"routes-manifest.json",
|
|
15103
15103
|
"server/pages-manifest.json",
|
|
15104
|
-
...appPathRoutesManifest ? ["server/app-paths-manifest.json"] : []
|
|
15105
|
-
]
|
|
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]
|
|
15121
|
-
manifestData[locale404Key] = lambdaPages["404.js"] && !lambdaAppPaths["404.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
|
}
|
|
@@ -16434,6 +16434,7 @@ var SERVER_BUILD_MINIMUM_NEXT_VERSION = "v10.0.9-canary.4";
|
|
|
16434
16434
|
var BEFORE_FILES_CONTINUE_NEXT_VERSION = "v10.2.3-canary.1";
|
|
16435
16435
|
var REDIRECTS_NO_STATIC_NEXT_VERSION = "v11.0.2-canary.15";
|
|
16436
16436
|
var IS_APP_CLIENT_SEGMENT_CACHE_ENABLED_VERSION = "v16.0.0";
|
|
16437
|
+
var MINIMUM_NEXT_ADAPTER_VERSION = "v16.2.0-canary.28";
|
|
16437
16438
|
var MAX_AGE_ONE_YEAR = 31536e3;
|
|
16438
16439
|
async function readPackageJson(entryPath) {
|
|
16439
16440
|
const packagePath = import_path6.default.join(entryPath, "package.json");
|
|
@@ -16713,7 +16714,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16713
16714
|
}
|
|
16714
16715
|
if (
|
|
16715
16716
|
// integration tests expect outputs object
|
|
16716
|
-
!process.env.NEXT_BUILDER_INTEGRATION && process.env.NEXT_ENABLE_ADAPTER
|
|
16717
|
+
!process.env.NEXT_BUILDER_INTEGRATION && process.env.NEXT_ENABLE_ADAPTER && import_semver5.default.gte(nextVersion, MINIMUM_NEXT_ADAPTER_VERSION)
|
|
16717
16718
|
) {
|
|
16718
16719
|
env.NEXT_ADAPTER_PATH = import_path6.default.join(__dirname, "adapter/index.js");
|
|
16719
16720
|
env.NEXT_ADAPTER_VERCEL_CONFIG = JSON.stringify(config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/next",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.24",
|
|
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.
|
|
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.
|
|
56
|
+
"@vercel/build-utils": "13.3.2",
|
|
57
57
|
"@vercel/routing-utils": "5.3.2"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|