@vercel/next 4.7.1 → 4.7.3
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 +22 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -11641,6 +11641,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11641
11641
|
}
|
11642
11642
|
routes.forEach((route) => {
|
11643
11643
|
const { initialRevalidateSeconds, dataRoute, srcRoute } = manifest.routes[route];
|
11644
|
+
let initialExpireSeconds;
|
11644
11645
|
let initialStatus;
|
11645
11646
|
let initialHeaders;
|
11646
11647
|
let experimentalBypassFor;
|
@@ -11648,6 +11649,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11648
11649
|
let allowHeader;
|
11649
11650
|
let renderingMode;
|
11650
11651
|
if (manifest.version === 4) {
|
11652
|
+
initialExpireSeconds = manifest.routes[route].initialExpireSeconds;
|
11651
11653
|
initialStatus = manifest.routes[route].initialStatus;
|
11652
11654
|
initialHeaders = manifest.routes[route].initialHeaders;
|
11653
11655
|
experimentalBypassFor = manifest.routes[route].experimentalBypassFor;
|
@@ -11660,6 +11662,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11660
11662
|
}
|
11661
11663
|
ret.staticRoutes[route] = {
|
11662
11664
|
initialRevalidate: initialRevalidateSeconds === false ? false : Math.max(1, initialRevalidateSeconds),
|
11665
|
+
initialExpire: initialExpireSeconds,
|
11663
11666
|
dataRoute,
|
11664
11667
|
prefetchDataRoute,
|
11665
11668
|
srcRoute,
|
@@ -11679,6 +11682,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11679
11682
|
let fallbackHeaders;
|
11680
11683
|
let renderingMode = "STATIC" /* STATIC */;
|
11681
11684
|
let fallbackRevalidate;
|
11685
|
+
let fallbackExpire;
|
11682
11686
|
let fallbackRootParams;
|
11683
11687
|
let allowHeader;
|
11684
11688
|
let fallbackSourceRoute;
|
@@ -11692,6 +11696,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11692
11696
|
// using the `experimentalPPR` flag.
|
11693
11697
|
(manifest.dynamicRoutes[lazyRoute].experimentalPPR ? "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ : "STATIC" /* STATIC */);
|
11694
11698
|
fallbackRevalidate = manifest.dynamicRoutes[lazyRoute].fallbackRevalidate;
|
11699
|
+
fallbackExpire = manifest.dynamicRoutes[lazyRoute].fallbackExpire;
|
11695
11700
|
fallbackRootParams = manifest.dynamicRoutes[lazyRoute].fallbackRootParams;
|
11696
11701
|
allowHeader = manifest.dynamicRoutes[lazyRoute].allowHeader;
|
11697
11702
|
fallbackSourceRoute = manifest.dynamicRoutes[lazyRoute].fallbackSourceRoute;
|
@@ -11708,6 +11713,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11708
11713
|
prefetchDataRoute,
|
11709
11714
|
prefetchDataRouteRegex,
|
11710
11715
|
fallbackRevalidate,
|
11716
|
+
fallbackExpire,
|
11711
11717
|
fallbackRootParams,
|
11712
11718
|
fallbackSourceRoute,
|
11713
11719
|
renderingMode,
|
@@ -11783,7 +11789,10 @@ async function getSourceFilePathFromPage({
|
|
11783
11789
|
}) {
|
11784
11790
|
const usesSrcDir = await usesSrcDirectory(workPath);
|
11785
11791
|
const extensionsToTry = pageExtensions || ["js", "jsx", "ts", "tsx"];
|
11786
|
-
for (const pageType of [
|
11792
|
+
for (const pageType of [
|
11793
|
+
// middleware is not nested in pages/app
|
11794
|
+
...page === "middleware" ? [""] : ["pages", "app"]
|
11795
|
+
]) {
|
11787
11796
|
let fsPath = import_path2.default.join(workPath, pageType, page);
|
11788
11797
|
if (usesSrcDir) {
|
11789
11798
|
fsPath = import_path2.default.join(workPath, "src", pageType, page);
|
@@ -12174,6 +12183,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12174
12183
|
}
|
12175
12184
|
const isNotFound = prerenderManifest.notFoundRoutes.includes(routeKey);
|
12176
12185
|
let initialRevalidate;
|
12186
|
+
let initialExpire;
|
12177
12187
|
let srcRoute;
|
12178
12188
|
let dataRoute;
|
12179
12189
|
let prefetchDataRoute;
|
@@ -12209,6 +12219,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12209
12219
|
const pr = prerenderManifest.staticRoutes[routeKey];
|
12210
12220
|
({
|
12211
12221
|
initialRevalidate,
|
12222
|
+
initialExpire,
|
12212
12223
|
srcRoute,
|
12213
12224
|
dataRoute,
|
12214
12225
|
initialHeaders,
|
@@ -12227,6 +12238,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12227
12238
|
fallbackStatus,
|
12228
12239
|
fallbackHeaders,
|
12229
12240
|
fallbackRevalidate,
|
12241
|
+
fallbackExpire,
|
12230
12242
|
fallbackSourceRoute
|
12231
12243
|
} = prerenderManifest.fallbackRoutes[routeKey];
|
12232
12244
|
if (fallbackStatus) {
|
@@ -12240,6 +12252,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12240
12252
|
}
|
12241
12253
|
if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && typeof fallbackRevalidate !== "undefined") {
|
12242
12254
|
initialRevalidate = fallbackRevalidate;
|
12255
|
+
initialExpire = fallbackExpire;
|
12243
12256
|
}
|
12244
12257
|
}
|
12245
12258
|
}
|
@@ -12488,6 +12501,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12488
12501
|
}
|
12489
12502
|
prerenders[outputPathPage] = new import_build_utils.Prerender({
|
12490
12503
|
expiration: initialRevalidate,
|
12504
|
+
staleExpiration: initialExpire,
|
12491
12505
|
lambda,
|
12492
12506
|
allowQuery: htmlAllowQuery,
|
12493
12507
|
fallback: htmlFsRef,
|
@@ -12523,6 +12537,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12523
12537
|
}
|
12524
12538
|
const prerender = new import_build_utils.Prerender({
|
12525
12539
|
expiration: initialRevalidate,
|
12540
|
+
staleExpiration: initialExpire,
|
12526
12541
|
lambda,
|
12527
12542
|
allowQuery,
|
12528
12543
|
fallback: jsonFsRef,
|
@@ -12582,6 +12597,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
12582
12597
|
}
|
12583
12598
|
prerenders[outputSegmentPath] = new import_build_utils.Prerender({
|
12584
12599
|
expiration: initialRevalidate,
|
12600
|
+
staleExpiration: initialExpire,
|
12585
12601
|
lambda,
|
12586
12602
|
allowQuery,
|
12587
12603
|
fallback,
|
@@ -15974,7 +15990,11 @@ var build = async (buildOptions) => {
|
|
15974
15990
|
(0, import_build_utils3.debug)("Found NPM_AUTH_TOKEN in environment, creating .npmrc");
|
15975
15991
|
await writeNpmRc(entryPath, process.env.NPM_AUTH_TOKEN);
|
15976
15992
|
}
|
15977
|
-
const { detectedPackageManager } = (0, import_build_utils3.detectPackageManager)(
|
15993
|
+
const { detectedPackageManager } = (0, import_build_utils3.detectPackageManager)(
|
15994
|
+
cliType,
|
15995
|
+
lockfileVersion,
|
15996
|
+
config.projectSettings?.createdAt
|
15997
|
+
) ?? {};
|
15978
15998
|
const trimmedInstallCommand = installCommand?.trim();
|
15979
15999
|
const shouldRunInstallCommand = (
|
15980
16000
|
// Case 1: We have a zero config install
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "4.7.
|
3
|
+
"version": "4.7.3",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"@types/semver": "6.0.0",
|
31
31
|
"@types/text-table": "0.2.1",
|
32
32
|
"@types/webpack-sources": "3.2.0",
|
33
|
-
"@vercel/build-utils": "10.2
|
33
|
+
"@vercel/build-utils": "10.3.2",
|
34
34
|
"@vercel/routing-utils": "5.0.4",
|
35
35
|
"async-sema": "3.0.1",
|
36
36
|
"buffer-crc32": "0.2.13",
|