@netlify/plugin-nextjs 5.7.1 → 5.7.2
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/build/content/prerendered.js +2 -1
- package/dist/build/content/server.js +1 -1
- package/dist/build/plugin-context.js +1 -1
- package/dist/build/verification.js +1 -1
- package/dist/esm-chunks/{chunk-EFGWM7RS.js → chunk-APO262HE.js} +28 -4
- package/dist/esm-chunks/{package-GZ5FMVI4.js → package-NNKZAPVX.js} +6 -6
- package/dist/run/handlers/tracing.js +26 -2
- package/dist/run/headers.js +2 -2
- package/dist/run/regional-blob-store.cjs +10 -4
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "../../esm-chunks/chunk-FHR56UHE.js";
|
|
17
17
|
import {
|
|
18
18
|
require_semver
|
|
19
|
-
} from "../../esm-chunks/chunk-
|
|
19
|
+
} from "../../esm-chunks/chunk-APO262HE.js";
|
|
20
20
|
import {
|
|
21
21
|
__toESM
|
|
22
22
|
} from "../../esm-chunks/chunk-OEQOKJGE.js";
|
|
@@ -210,6 +210,7 @@ var copyPrerenderedContent = async (ctx) => {
|
|
|
210
210
|
const key = routeToFilePath(route);
|
|
211
211
|
let value;
|
|
212
212
|
switch (true) {
|
|
213
|
+
// Parallel route default layout has no prerendered page
|
|
213
214
|
case (meta.dataRoute?.endsWith("/default.rsc") && !existsSync(join(ctx.publishDir, "server/app", `${key}.html`))):
|
|
214
215
|
return;
|
|
215
216
|
case meta.dataRoute?.endsWith(".json"):
|
|
@@ -336,6 +336,8 @@ var require_semver = __commonJS({
|
|
|
336
336
|
this.inc("patch", identifier, identifierBase);
|
|
337
337
|
this.inc("pre", identifier, identifierBase);
|
|
338
338
|
break;
|
|
339
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
340
|
+
// prepatch.
|
|
339
341
|
case "prerelease":
|
|
340
342
|
if (this.prerelease.length === 0) {
|
|
341
343
|
this.inc("patch", identifier, identifierBase);
|
|
@@ -363,6 +365,8 @@ var require_semver = __commonJS({
|
|
|
363
365
|
}
|
|
364
366
|
this.prerelease = [];
|
|
365
367
|
break;
|
|
368
|
+
// This probably shouldn't be used publicly.
|
|
369
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
366
370
|
case "pre": {
|
|
367
371
|
const base = Number(identifierBase) ? 1 : 0;
|
|
368
372
|
if (!identifier && identifierBase === false) {
|
|
@@ -811,6 +815,7 @@ var require_lrucache = __commonJS({
|
|
|
811
815
|
// node_modules/semver/classes/range.js
|
|
812
816
|
var require_range = __commonJS({
|
|
813
817
|
"node_modules/semver/classes/range.js"(exports, module) {
|
|
818
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
814
819
|
var Range = class _Range {
|
|
815
820
|
constructor(range, options) {
|
|
816
821
|
options = parseOptions(options);
|
|
@@ -824,13 +829,13 @@ var require_range = __commonJS({
|
|
|
824
829
|
if (range instanceof Comparator) {
|
|
825
830
|
this.raw = range.value;
|
|
826
831
|
this.set = [[range]];
|
|
827
|
-
this.
|
|
832
|
+
this.formatted = void 0;
|
|
828
833
|
return this;
|
|
829
834
|
}
|
|
830
835
|
this.options = options;
|
|
831
836
|
this.loose = !!options.loose;
|
|
832
837
|
this.includePrerelease = !!options.includePrerelease;
|
|
833
|
-
this.raw = range.trim().
|
|
838
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
834
839
|
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
835
840
|
if (!this.set.length) {
|
|
836
841
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
@@ -849,10 +854,27 @@ var require_range = __commonJS({
|
|
|
849
854
|
}
|
|
850
855
|
}
|
|
851
856
|
}
|
|
852
|
-
this.
|
|
857
|
+
this.formatted = void 0;
|
|
858
|
+
}
|
|
859
|
+
get range() {
|
|
860
|
+
if (this.formatted === void 0) {
|
|
861
|
+
this.formatted = "";
|
|
862
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
863
|
+
if (i > 0) {
|
|
864
|
+
this.formatted += "||";
|
|
865
|
+
}
|
|
866
|
+
const comps = this.set[i];
|
|
867
|
+
for (let k = 0; k < comps.length; k++) {
|
|
868
|
+
if (k > 0) {
|
|
869
|
+
this.formatted += " ";
|
|
870
|
+
}
|
|
871
|
+
this.formatted += comps[k].toString().trim();
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
return this.formatted;
|
|
853
876
|
}
|
|
854
877
|
format() {
|
|
855
|
-
this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
|
|
856
878
|
return this.range;
|
|
857
879
|
}
|
|
858
880
|
toString() {
|
|
@@ -1388,6 +1410,7 @@ var require_min_version = __commonJS({
|
|
|
1388
1410
|
compver.prerelease.push(0);
|
|
1389
1411
|
}
|
|
1390
1412
|
compver.raw = compver.format();
|
|
1413
|
+
/* fallthrough */
|
|
1391
1414
|
case "":
|
|
1392
1415
|
case ">=":
|
|
1393
1416
|
if (!setMin || gt(compver, setMin)) {
|
|
@@ -1397,6 +1420,7 @@ var require_min_version = __commonJS({
|
|
|
1397
1420
|
case "<":
|
|
1398
1421
|
case "<=":
|
|
1399
1422
|
break;
|
|
1423
|
+
/* istanbul ignore next */
|
|
1400
1424
|
default:
|
|
1401
1425
|
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1402
1426
|
}
|
|
@@ -8,7 +8,7 @@ import "./chunk-OEQOKJGE.js";
|
|
|
8
8
|
|
|
9
9
|
// package.json
|
|
10
10
|
var name = "@netlify/plugin-nextjs";
|
|
11
|
-
var version = "5.7.
|
|
11
|
+
var version = "5.7.2";
|
|
12
12
|
var description = "Run Next.js seamlessly on Netlify";
|
|
13
13
|
var main = "./dist/index.js";
|
|
14
14
|
var type = "module";
|
|
@@ -57,14 +57,14 @@ var bugs = {
|
|
|
57
57
|
var homepage = "https://github.com/netlify/next-runtime#readme";
|
|
58
58
|
var devDependencies = {
|
|
59
59
|
"@fastly/http-compute-js": "1.1.4",
|
|
60
|
-
"@netlify/blobs": "^7.
|
|
61
|
-
"@netlify/build": "^29.
|
|
62
|
-
"@netlify/edge-bundler": "^12.
|
|
60
|
+
"@netlify/blobs": "^7.4.0",
|
|
61
|
+
"@netlify/build": "^29.54.2",
|
|
62
|
+
"@netlify/edge-bundler": "^12.2.3",
|
|
63
63
|
"@netlify/edge-functions": "^2.10.0",
|
|
64
64
|
"@netlify/eslint-config-node": "^7.0.1",
|
|
65
65
|
"@netlify/functions": "^2.8.1",
|
|
66
66
|
"@netlify/serverless-functions-api": "^1.23.0",
|
|
67
|
-
"@netlify/zip-it-and-ship-it": "^9.
|
|
67
|
+
"@netlify/zip-it-and-ship-it": "^9.39.0",
|
|
68
68
|
"@opentelemetry/api": "^1.8.0",
|
|
69
69
|
"@opentelemetry/exporter-trace-otlp-http": "^0.51.0",
|
|
70
70
|
"@opentelemetry/resources": "^1.24.0",
|
|
@@ -78,7 +78,7 @@ var devDependencies = {
|
|
|
78
78
|
"@vercel/nft": "^0.27.0",
|
|
79
79
|
cheerio: "^1.0.0-rc.12",
|
|
80
80
|
"clean-package": "^2.2.0",
|
|
81
|
-
esbuild: "^0.
|
|
81
|
+
esbuild: "^0.23.0",
|
|
82
82
|
execa: "^8.0.1",
|
|
83
83
|
"fast-glob": "^3.3.2",
|
|
84
84
|
"fs-monkey": "^1.0.6",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../../esm-chunks/chunk-GNGHTHMQ.js";
|
|
11
11
|
import {
|
|
12
12
|
require_semver
|
|
13
|
-
} from "../../esm-chunks/chunk-
|
|
13
|
+
} from "../../esm-chunks/chunk-APO262HE.js";
|
|
14
14
|
import {
|
|
15
15
|
__commonJS,
|
|
16
16
|
__esm,
|
|
@@ -30409,6 +30409,7 @@ var require_reader = __commonJS({
|
|
|
30409
30409
|
case 5:
|
|
30410
30410
|
this.skip(4);
|
|
30411
30411
|
break;
|
|
30412
|
+
/* istanbul ignore next */
|
|
30412
30413
|
default:
|
|
30413
30414
|
throw Error("invalid wire type " + wireType + " at offset " + this.pos);
|
|
30414
30415
|
}
|
|
@@ -44014,6 +44015,7 @@ var require_converter = __commonJS({
|
|
|
44014
44015
|
break;
|
|
44015
44016
|
case "uint64":
|
|
44016
44017
|
isUnsigned = true;
|
|
44018
|
+
// eslint-disable-next-line no-fallthrough
|
|
44017
44019
|
case "int64":
|
|
44018
44020
|
case "sint64":
|
|
44019
44021
|
case "fixed64":
|
|
@@ -44085,6 +44087,7 @@ var require_converter = __commonJS({
|
|
|
44085
44087
|
break;
|
|
44086
44088
|
case "uint64":
|
|
44087
44089
|
isUnsigned = true;
|
|
44090
|
+
// eslint-disable-next-line no-fallthrough
|
|
44088
44091
|
case "int64":
|
|
44089
44092
|
case "sint64":
|
|
44090
44093
|
case "fixed64":
|
|
@@ -45632,6 +45635,7 @@ var require_parse = __commonJS({
|
|
|
45632
45635
|
break;
|
|
45633
45636
|
case "public":
|
|
45634
45637
|
next();
|
|
45638
|
+
// eslint-disable-next-line no-fallthrough
|
|
45635
45639
|
default:
|
|
45636
45640
|
whichImports = imports || (imports = []);
|
|
45637
45641
|
break;
|
|
@@ -45809,6 +45813,7 @@ var require_parse = __commonJS({
|
|
|
45809
45813
|
case "enum":
|
|
45810
45814
|
parseEnum(type, token2);
|
|
45811
45815
|
break;
|
|
45816
|
+
/* istanbul ignore next */
|
|
45812
45817
|
default:
|
|
45813
45818
|
throw illegal(token2);
|
|
45814
45819
|
}
|
|
@@ -47368,6 +47373,7 @@ var require_descriptor2 = __commonJS({
|
|
|
47368
47373
|
fieldType = fromDescriptorType(descriptor.type);
|
|
47369
47374
|
var fieldRule;
|
|
47370
47375
|
switch (descriptor.label) {
|
|
47376
|
+
// 0 is reserved for errors
|
|
47371
47377
|
case 1:
|
|
47372
47378
|
fieldRule = void 0;
|
|
47373
47379
|
break;
|
|
@@ -47429,7 +47435,9 @@ var require_descriptor2 = __commonJS({
|
|
|
47429
47435
|
} else {
|
|
47430
47436
|
switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) {
|
|
47431
47437
|
case 10:
|
|
47438
|
+
// group
|
|
47432
47439
|
case 11:
|
|
47440
|
+
// type
|
|
47433
47441
|
case 14:
|
|
47434
47442
|
descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type;
|
|
47435
47443
|
break;
|
|
@@ -47552,6 +47560,7 @@ var require_descriptor2 = __commonJS({
|
|
|
47552
47560
|
};
|
|
47553
47561
|
function fromDescriptorType(type) {
|
|
47554
47562
|
switch (type) {
|
|
47563
|
+
// 0 is reserved for errors
|
|
47555
47564
|
case 1:
|
|
47556
47565
|
return "double";
|
|
47557
47566
|
case 2:
|
|
@@ -47588,18 +47597,31 @@ var require_descriptor2 = __commonJS({
|
|
|
47588
47597
|
function packableDescriptorType(type) {
|
|
47589
47598
|
switch (type) {
|
|
47590
47599
|
case 1:
|
|
47600
|
+
// double
|
|
47591
47601
|
case 2:
|
|
47602
|
+
// float
|
|
47592
47603
|
case 3:
|
|
47604
|
+
// int64
|
|
47593
47605
|
case 4:
|
|
47606
|
+
// uint64
|
|
47594
47607
|
case 5:
|
|
47608
|
+
// int32
|
|
47595
47609
|
case 6:
|
|
47610
|
+
// fixed64
|
|
47596
47611
|
case 7:
|
|
47612
|
+
// fixed32
|
|
47597
47613
|
case 8:
|
|
47614
|
+
// bool
|
|
47598
47615
|
case 13:
|
|
47616
|
+
// uint32
|
|
47599
47617
|
case 14:
|
|
47618
|
+
// enum (!)
|
|
47600
47619
|
case 15:
|
|
47620
|
+
// sfixed32
|
|
47601
47621
|
case 16:
|
|
47622
|
+
// sfixed64
|
|
47602
47623
|
case 17:
|
|
47624
|
+
// sint32
|
|
47603
47625
|
case 18:
|
|
47604
47626
|
return true;
|
|
47605
47627
|
}
|
|
@@ -47607,6 +47629,7 @@ var require_descriptor2 = __commonJS({
|
|
|
47607
47629
|
}
|
|
47608
47630
|
function toDescriptorType(type, resolvedType) {
|
|
47609
47631
|
switch (type) {
|
|
47632
|
+
// 0 is reserved for errors
|
|
47610
47633
|
case "double":
|
|
47611
47634
|
return 1;
|
|
47612
47635
|
case "float":
|
|
@@ -50243,6 +50266,7 @@ var require_subchannel_call = __commonJS({
|
|
|
50243
50266
|
}
|
|
50244
50267
|
this.trace("Received server headers:\n" + headersString);
|
|
50245
50268
|
switch (headers[":status"]) {
|
|
50269
|
+
// TODO(murgatroid99): handle 100 and 101
|
|
50246
50270
|
case 400:
|
|
50247
50271
|
this.mappedStatusCode = constants_1.Status.INTERNAL;
|
|
50248
50272
|
break;
|
|
@@ -67385,7 +67409,7 @@ var import_semantic_conventions = __toESM(require_src(), 1);
|
|
|
67385
67409
|
import { getLogger } from "./request-context.cjs";
|
|
67386
67410
|
var {
|
|
67387
67411
|
default: { version, name }
|
|
67388
|
-
} = await import("../../esm-chunks/package-
|
|
67412
|
+
} = await import("../../esm-chunks/package-NNKZAPVX.js");
|
|
67389
67413
|
var sdk = new import_sdk_node.NodeSDK({
|
|
67390
67414
|
resource: new import_resources.Resource({
|
|
67391
67415
|
[import_semantic_conventions.SEMRESATTRS_SERVICE_NAME]: name,
|
package/dist/run/headers.js
CHANGED
|
@@ -146,7 +146,7 @@ var setCacheControlHeaders = (headers, request, requestContext) => {
|
|
|
146
146
|
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {
|
|
147
147
|
const cdnCacheControl = (
|
|
148
148
|
// if we are serving already stale response, instruct edge to not attempt to cache that response
|
|
149
|
-
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate" : `s-maxage=${requestContext.routeHandlerRevalidate === false ? 31536e3 : requestContext.routeHandlerRevalidate}, stale-while-revalidate=31536000, durable`
|
|
149
|
+
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate, durable" : `s-maxage=${requestContext.routeHandlerRevalidate === false ? 31536e3 : requestContext.routeHandlerRevalidate}, stale-while-revalidate=31536000, durable`
|
|
150
150
|
);
|
|
151
151
|
headers.set("netlify-cdn-cache-control", cdnCacheControl);
|
|
152
152
|
return;
|
|
@@ -159,7 +159,7 @@ var setCacheControlHeaders = (headers, request, requestContext) => {
|
|
|
159
159
|
]);
|
|
160
160
|
const cdnCacheControl = (
|
|
161
161
|
// if we are serving already stale response, instruct edge to not attempt to cache that response
|
|
162
|
-
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate" : [
|
|
162
|
+
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate, durable" : [
|
|
163
163
|
...getHeaderValueArray(cacheControl).map(
|
|
164
164
|
(value) => value === "stale-while-revalidate" ? "stale-while-revalidate=31536000" : value
|
|
165
165
|
),
|
|
@@ -328,7 +328,11 @@ var Store = class _Store {
|
|
|
328
328
|
this.client = options.client;
|
|
329
329
|
if ("deployID" in options) {
|
|
330
330
|
_Store.validateDeployID(options.deployID);
|
|
331
|
-
|
|
331
|
+
let name = DEPLOY_STORE_PREFIX + options.deployID;
|
|
332
|
+
if (options.name) {
|
|
333
|
+
name += `:${options.name}`;
|
|
334
|
+
}
|
|
335
|
+
this.name = name;
|
|
332
336
|
} else if (options.name.startsWith(LEGACY_STORE_INTERNAL_PREFIX)) {
|
|
333
337
|
const storeName = options.name.slice(LEGACY_STORE_INTERNAL_PREFIX.length);
|
|
334
338
|
_Store.validateStoreName(storeName);
|
|
@@ -558,8 +562,9 @@ var Store = class _Store {
|
|
|
558
562
|
};
|
|
559
563
|
}
|
|
560
564
|
};
|
|
561
|
-
var getDeployStore = (
|
|
565
|
+
var getDeployStore = (input = {}) => {
|
|
562
566
|
const context = getEnvironmentContext();
|
|
567
|
+
const options = typeof input === "string" ? { name: input } : input;
|
|
563
568
|
const deployID = options.deployID ?? context.deployID;
|
|
564
569
|
if (!deployID) {
|
|
565
570
|
throw new MissingBlobsEnvironmentError(["deployID"]);
|
|
@@ -581,14 +586,15 @@ var getDeployStore = (options = {}) => {
|
|
|
581
586
|
clientOptions.region = options.experimentalRegion;
|
|
582
587
|
}
|
|
583
588
|
const client = new Client(clientOptions);
|
|
584
|
-
return new Store({ client, deployID });
|
|
589
|
+
return new Store({ client, deployID, name: options.name });
|
|
585
590
|
};
|
|
586
591
|
|
|
587
592
|
// src/run/regional-blob-store.cts
|
|
588
593
|
var fetchBeforeNextPatchedIt = globalThis.fetch;
|
|
589
594
|
var getRegionalBlobStore = (args = {}) => {
|
|
595
|
+
const options = typeof args === "string" ? { name: args } : args;
|
|
590
596
|
return getDeployStore({
|
|
591
|
-
...
|
|
597
|
+
...options,
|
|
592
598
|
fetch: fetchBeforeNextPatchedIt,
|
|
593
599
|
experimentalRegion: process.env.USE_REGIONAL_BLOBS?.toUpperCase() === "TRUE" ? "context" : void 0
|
|
594
600
|
});
|