@vercel/next 4.0.10 → 4.0.11
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/index.js +49 -41
- package/package.json +5 -3
package/dist/index.js
CHANGED
@@ -514,6 +514,9 @@ var require_superstatic = __commonJS({
|
|
514
514
|
if (r.missing) {
|
515
515
|
route.missing = r.missing;
|
516
516
|
}
|
517
|
+
if (r.statusCode) {
|
518
|
+
route.status = r.statusCode;
|
519
|
+
}
|
517
520
|
return route;
|
518
521
|
} catch (e) {
|
519
522
|
throw new Error(`Failed to parse rewrite: ${JSON.stringify(r)}`);
|
@@ -11332,6 +11335,46 @@ async function getVariantsManifest(entryPath, outputDirectory) {
|
|
11332
11335
|
);
|
11333
11336
|
return variantsManifest;
|
11334
11337
|
}
|
11338
|
+
async function getServerlessPages(params) {
|
11339
|
+
const appDir = import_path2.default.join(params.pagesDir, "../app");
|
11340
|
+
const [pages, appPaths, middlewareManifest] = await Promise.all([
|
11341
|
+
(0, import_build_utils.glob)("**/!(_middleware).js", params.pagesDir),
|
11342
|
+
params.appPathRoutesManifest ? Promise.all([
|
11343
|
+
(0, import_build_utils.glob)("**/page.js", appDir),
|
11344
|
+
(0, import_build_utils.glob)("**/route.js", appDir),
|
11345
|
+
(0, import_build_utils.glob)("**/_not-found.js", appDir)
|
11346
|
+
]).then((items) => Object.assign(...items)) : Promise.resolve({}),
|
11347
|
+
getMiddlewareManifest(params.entryPath, params.outputDirectory)
|
11348
|
+
]);
|
11349
|
+
const normalizedAppPaths = {};
|
11350
|
+
if (params.appPathRoutesManifest) {
|
11351
|
+
for (const [entry, normalizedEntry] of Object.entries(
|
11352
|
+
params.appPathRoutesManifest
|
11353
|
+
)) {
|
11354
|
+
const normalizedPath = `${import_path2.default.join(
|
11355
|
+
".",
|
11356
|
+
normalizedEntry === "/" ? "/index" : normalizedEntry
|
11357
|
+
)}.js`;
|
11358
|
+
const globPath = `${import_path2.default.posix.join(".", entry)}.js`;
|
11359
|
+
if (appPaths[globPath]) {
|
11360
|
+
normalizedAppPaths[normalizedPath] = appPaths[globPath];
|
11361
|
+
}
|
11362
|
+
}
|
11363
|
+
}
|
11364
|
+
for (const edgeFunctionFile of Object.keys(
|
11365
|
+
middlewareManifest?.functions ?? {}
|
11366
|
+
)) {
|
11367
|
+
let edgePath = middlewareManifest?.functions?.[edgeFunctionFile].name || edgeFunctionFile;
|
11368
|
+
edgePath = normalizeEdgeFunctionPath(
|
11369
|
+
edgePath,
|
11370
|
+
params.appPathRoutesManifest || {}
|
11371
|
+
);
|
11372
|
+
edgePath = (edgePath || "index") + ".js";
|
11373
|
+
delete normalizedAppPaths[edgePath];
|
11374
|
+
delete pages[edgePath];
|
11375
|
+
}
|
11376
|
+
return { pages, appPaths: normalizedAppPaths };
|
11377
|
+
}
|
11335
11378
|
|
11336
11379
|
// src/create-serverless-config.ts
|
11337
11380
|
function getCustomData(importName, target) {
|
@@ -11830,6 +11873,10 @@ async function serverBuild({
|
|
11830
11873
|
appBuildTraces = await (0, import_build_utils2.glob)("**/*.js.nft.json", appDir);
|
11831
11874
|
appRscPrefetches = await (0, import_build_utils2.glob)(`**/*${RSC_PREFETCH_SUFFIX}`, appDir);
|
11832
11875
|
const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || RSC_CONTENT_TYPE;
|
11876
|
+
if (appRscPrefetches["index.prefetch.rsc"]) {
|
11877
|
+
appRscPrefetches["__index.prefetch.rsc"] = appRscPrefetches["index.prefetch.rsc"];
|
11878
|
+
delete appRscPrefetches["index.prefetch.rsc"];
|
11879
|
+
}
|
11833
11880
|
for (const value of Object.values(appRscPrefetches)) {
|
11834
11881
|
if (!value.contentType) {
|
11835
11882
|
value.contentType = rscContentTypeHeader;
|
@@ -12950,7 +12997,7 @@ async function serverBuild({
|
|
12950
12997
|
dest: import_path4.default.posix.join(
|
12951
12998
|
"/",
|
12952
12999
|
entryDirectory,
|
12953
|
-
`/
|
13000
|
+
`/__index${RSC_PREFETCH_SUFFIX}`
|
12954
13001
|
),
|
12955
13002
|
headers: { vary: rscVaryHeader },
|
12956
13003
|
continue: true,
|
@@ -13037,7 +13084,7 @@ async function serverBuild({
|
|
13037
13084
|
src: import_path4.default.posix.join(
|
13038
13085
|
"/",
|
13039
13086
|
entryDirectory,
|
13040
|
-
`/
|
13087
|
+
`/__index${RSC_PREFETCH_SUFFIX}`
|
13041
13088
|
),
|
13042
13089
|
dest: import_path4.default.posix.join("/", entryDirectory, "/index.rsc"),
|
13043
13090
|
has: [
|
@@ -15266,45 +15313,6 @@ var prepareCache = async ({
|
|
15266
15313
|
(0, import_build_utils3.debug)("Cache file manifest produced");
|
15267
15314
|
return cache;
|
15268
15315
|
};
|
15269
|
-
async function getServerlessPages(params) {
|
15270
|
-
const [pages, appPaths, middlewareManifest] = await Promise.all([
|
15271
|
-
(0, import_build_utils3.glob)("**/!(_middleware).js", params.pagesDir),
|
15272
|
-
params.appPathRoutesManifest ? Promise.all([
|
15273
|
-
(0, import_build_utils3.glob)("**/page.js", import_path5.default.join(params.pagesDir, "../app")),
|
15274
|
-
(0, import_build_utils3.glob)("**/route.js", import_path5.default.join(params.pagesDir, "../app")),
|
15275
|
-
(0, import_build_utils3.glob)("**/_not-found.js", import_path5.default.join(params.pagesDir, "../app"))
|
15276
|
-
]).then((items) => Object.assign(...items)) : Promise.resolve({}),
|
15277
|
-
getMiddlewareManifest(params.entryPath, params.outputDirectory)
|
15278
|
-
]);
|
15279
|
-
const normalizedAppPaths = {};
|
15280
|
-
if (params.appPathRoutesManifest) {
|
15281
|
-
for (const [entry, normalizedEntry] of Object.entries(
|
15282
|
-
params.appPathRoutesManifest
|
15283
|
-
)) {
|
15284
|
-
const normalizedPath = `${import_path5.default.join(
|
15285
|
-
".",
|
15286
|
-
normalizedEntry === "/" ? "/index" : normalizedEntry
|
15287
|
-
)}.js`;
|
15288
|
-
const globPath = `${import_path5.default.join(".", entry)}.js`;
|
15289
|
-
if (appPaths[globPath]) {
|
15290
|
-
normalizedAppPaths[normalizedPath] = appPaths[globPath];
|
15291
|
-
}
|
15292
|
-
}
|
15293
|
-
}
|
15294
|
-
for (const edgeFunctionFile of Object.keys(
|
15295
|
-
middlewareManifest?.functions ?? {}
|
15296
|
-
)) {
|
15297
|
-
let edgePath = middlewareManifest?.functions?.[edgeFunctionFile].name || edgeFunctionFile;
|
15298
|
-
edgePath = normalizeEdgeFunctionPath(
|
15299
|
-
edgePath,
|
15300
|
-
params.appPathRoutesManifest || {}
|
15301
|
-
);
|
15302
|
-
edgePath = (edgePath || "index") + ".js";
|
15303
|
-
delete normalizedAppPaths[edgePath];
|
15304
|
-
delete pages[edgePath];
|
15305
|
-
}
|
15306
|
-
return { pages, appPaths: normalizedAppPaths };
|
15307
|
-
}
|
15308
15316
|
// Annotate the CommonJS export names for ESM import in node:
|
15309
15317
|
0 && (module.exports = {
|
15310
15318
|
MAX_AGE_ONE_YEAR,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.11",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"@types/text-table": "0.2.1",
|
32
32
|
"@types/webpack-sources": "3.2.0",
|
33
33
|
"@vercel/build-utils": "7.2.2",
|
34
|
-
"@vercel/routing-utils": "3.
|
34
|
+
"@vercel/routing-utils": "3.1.0",
|
35
35
|
"async-sema": "3.0.1",
|
36
36
|
"buffer-crc32": "0.2.13",
|
37
37
|
"bytes": "3.1.2",
|
@@ -60,7 +60,9 @@
|
|
60
60
|
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand --testTimeout=360000",
|
61
61
|
"test-unit": "pnpm test test/unit/",
|
62
62
|
"test-next-local": "pnpm test test/integration/*.test.js test/integration/*.test.ts",
|
63
|
+
"test-next-local-legacy": "pnpm test test/integration/legacy/*.test.js",
|
63
64
|
"test-next-local:middleware": "pnpm test test/integration/middleware.test.ts",
|
64
|
-
"test-e2e": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js"
|
65
|
+
"test-e2e": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js",
|
66
|
+
"type-check": "tsc --noEmit"
|
65
67
|
}
|
66
68
|
}
|