@netlify/plugin-nextjs 5.11.0 → 5.11.1
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 +43 -13
- 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-PFLHY2KD.js → chunk-F7NTXMLE.js} +25 -9
- package/dist/run/handlers/tags-handler.cjs +1 -1
- package/edge-runtime/lib/routing.ts +12 -2
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "../../esm-chunks/chunk-YUXQHOYO.js";
|
|
14
14
|
import {
|
|
15
15
|
require_semver
|
|
16
|
-
} from "../../esm-chunks/chunk-
|
|
16
|
+
} from "../../esm-chunks/chunk-F7NTXMLE.js";
|
|
17
17
|
import {
|
|
18
18
|
__toESM
|
|
19
19
|
} from "../../esm-chunks/chunk-6BT4RYQJ.js";
|
|
@@ -59,6 +59,12 @@ var Queue = class {
|
|
|
59
59
|
this.#size--;
|
|
60
60
|
return current.value;
|
|
61
61
|
}
|
|
62
|
+
peek() {
|
|
63
|
+
if (!this.#head) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
return this.#head.value;
|
|
67
|
+
}
|
|
62
68
|
clear() {
|
|
63
69
|
this.#head = void 0;
|
|
64
70
|
this.#tail = void 0;
|
|
@@ -74,24 +80,29 @@ var Queue = class {
|
|
|
74
80
|
current = current.next;
|
|
75
81
|
}
|
|
76
82
|
}
|
|
83
|
+
*drain() {
|
|
84
|
+
while (this.#head) {
|
|
85
|
+
yield this.dequeue();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
77
88
|
};
|
|
78
89
|
|
|
79
90
|
// node_modules/p-limit/index.js
|
|
80
|
-
import { AsyncResource } from "async_hooks";
|
|
81
91
|
function pLimit(concurrency) {
|
|
82
|
-
|
|
83
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
84
|
-
}
|
|
92
|
+
validateConcurrency(concurrency);
|
|
85
93
|
const queue = new Queue();
|
|
86
94
|
let activeCount = 0;
|
|
87
|
-
const
|
|
88
|
-
activeCount
|
|
89
|
-
if (queue.size > 0) {
|
|
95
|
+
const resumeNext = () => {
|
|
96
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
90
97
|
queue.dequeue()();
|
|
98
|
+
activeCount++;
|
|
91
99
|
}
|
|
92
100
|
};
|
|
101
|
+
const next = () => {
|
|
102
|
+
activeCount--;
|
|
103
|
+
resumeNext();
|
|
104
|
+
};
|
|
93
105
|
const run = async (function_, resolve, arguments_) => {
|
|
94
|
-
activeCount++;
|
|
95
106
|
const result = (async () => function_(...arguments_))();
|
|
96
107
|
resolve(result);
|
|
97
108
|
try {
|
|
@@ -101,13 +112,15 @@ function pLimit(concurrency) {
|
|
|
101
112
|
next();
|
|
102
113
|
};
|
|
103
114
|
const enqueue = (function_, resolve, arguments_) => {
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
new Promise((internalResolve) => {
|
|
116
|
+
queue.enqueue(internalResolve);
|
|
117
|
+
}).then(
|
|
118
|
+
run.bind(void 0, function_, resolve, arguments_)
|
|
106
119
|
);
|
|
107
120
|
(async () => {
|
|
108
121
|
await Promise.resolve();
|
|
109
|
-
if (activeCount < concurrency
|
|
110
|
-
|
|
122
|
+
if (activeCount < concurrency) {
|
|
123
|
+
resumeNext();
|
|
111
124
|
}
|
|
112
125
|
})();
|
|
113
126
|
};
|
|
@@ -125,10 +138,27 @@ function pLimit(concurrency) {
|
|
|
125
138
|
value() {
|
|
126
139
|
queue.clear();
|
|
127
140
|
}
|
|
141
|
+
},
|
|
142
|
+
concurrency: {
|
|
143
|
+
get: () => concurrency,
|
|
144
|
+
set(newConcurrency) {
|
|
145
|
+
validateConcurrency(newConcurrency);
|
|
146
|
+
concurrency = newConcurrency;
|
|
147
|
+
queueMicrotask(() => {
|
|
148
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
149
|
+
resumeNext();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
128
153
|
}
|
|
129
154
|
});
|
|
130
155
|
return generator;
|
|
131
156
|
}
|
|
157
|
+
function validateConcurrency(concurrency) {
|
|
158
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
159
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
132
162
|
|
|
133
163
|
// src/build/content/prerendered.ts
|
|
134
164
|
var import_semver = __toESM(require_semver(), 1);
|
|
@@ -61,6 +61,7 @@ var require_re = __commonJS({
|
|
|
61
61
|
var re = exports.re = [];
|
|
62
62
|
var safeRe = exports.safeRe = [];
|
|
63
63
|
var src = exports.src = [];
|
|
64
|
+
var safeSrc = exports.safeSrc = [];
|
|
64
65
|
var t = exports.t = {};
|
|
65
66
|
var R = 0;
|
|
66
67
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
@@ -81,6 +82,7 @@ var require_re = __commonJS({
|
|
|
81
82
|
debug(name, index, value);
|
|
82
83
|
t[name] = index;
|
|
83
84
|
src[index] = value;
|
|
85
|
+
safeSrc[index] = safe;
|
|
84
86
|
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
85
87
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
86
88
|
};
|
|
@@ -177,7 +179,7 @@ var require_semver = __commonJS({
|
|
|
177
179
|
"node_modules/semver/classes/semver.js"(exports, module) {
|
|
178
180
|
var debug = require_debug();
|
|
179
181
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
180
|
-
var { safeRe: re, t } = require_re();
|
|
182
|
+
var { safeRe: re, safeSrc: src, t } = require_re();
|
|
181
183
|
var parseOptions = require_parse_options();
|
|
182
184
|
var { compareIdentifiers } = require_identifiers();
|
|
183
185
|
var SemVer = class _SemVer {
|
|
@@ -317,6 +319,18 @@ var require_semver = __commonJS({
|
|
|
317
319
|
// preminor will bump the version up to the next minor release, and immediately
|
|
318
320
|
// down to pre-release. premajor and prepatch work the same way.
|
|
319
321
|
inc(release, identifier, identifierBase) {
|
|
322
|
+
if (release.startsWith("pre")) {
|
|
323
|
+
if (!identifier && identifierBase === false) {
|
|
324
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
325
|
+
}
|
|
326
|
+
if (identifier) {
|
|
327
|
+
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
|
|
328
|
+
const match = `-${identifier}`.match(r);
|
|
329
|
+
if (!match || match[1] !== identifier) {
|
|
330
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
320
334
|
switch (release) {
|
|
321
335
|
case "premajor":
|
|
322
336
|
this.prerelease.length = 0;
|
|
@@ -344,6 +358,12 @@ var require_semver = __commonJS({
|
|
|
344
358
|
}
|
|
345
359
|
this.inc("pre", identifier, identifierBase);
|
|
346
360
|
break;
|
|
361
|
+
case "release":
|
|
362
|
+
if (this.prerelease.length === 0) {
|
|
363
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
364
|
+
}
|
|
365
|
+
this.prerelease.length = 0;
|
|
366
|
+
break;
|
|
347
367
|
case "major":
|
|
348
368
|
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
349
369
|
this.major++;
|
|
@@ -369,9 +389,6 @@ var require_semver = __commonJS({
|
|
|
369
389
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
370
390
|
case "pre": {
|
|
371
391
|
const base = Number(identifierBase) ? 1 : 0;
|
|
372
|
-
if (!identifier && identifierBase === false) {
|
|
373
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
374
|
-
}
|
|
375
392
|
if (this.prerelease.length === 0) {
|
|
376
393
|
this.prerelease = [base];
|
|
377
394
|
} else {
|
|
@@ -506,13 +523,12 @@ var require_diff = __commonJS({
|
|
|
506
523
|
if (!lowVersion.patch && !lowVersion.minor) {
|
|
507
524
|
return "major";
|
|
508
525
|
}
|
|
509
|
-
if (highVersion
|
|
526
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
527
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
528
|
+
return "minor";
|
|
529
|
+
}
|
|
510
530
|
return "patch";
|
|
511
531
|
}
|
|
512
|
-
if (highVersion.minor) {
|
|
513
|
-
return "minor";
|
|
514
|
-
}
|
|
515
|
-
return "major";
|
|
516
532
|
}
|
|
517
533
|
const prefix = highHasPre ? "pre" : "";
|
|
518
534
|
if (v1.major !== v2.major) {
|
|
@@ -86,7 +86,7 @@ var pipeline = (0, import_node_util.promisify)(import_node_stream.pipeline);
|
|
|
86
86
|
|
|
87
87
|
// package.json
|
|
88
88
|
var name = "@netlify/plugin-nextjs";
|
|
89
|
-
var version = "5.11.
|
|
89
|
+
var version = "5.11.1";
|
|
90
90
|
|
|
91
91
|
// src/run/handlers/tags-handler.cts
|
|
92
92
|
var import_storage = require("../storage/storage.cjs");
|
|
@@ -424,14 +424,24 @@ export interface MiddlewareMatcher {
|
|
|
424
424
|
missing?: RouteHas[]
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
const decodeMaybeEncodedPath = (path: string): string => {
|
|
428
|
+
try {
|
|
429
|
+
return decodeURIComponent(path)
|
|
430
|
+
} catch {
|
|
431
|
+
return path
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
427
435
|
export function getMiddlewareRouteMatcher(matchers: MiddlewareMatcher[]): MiddlewareRouteMatch {
|
|
428
436
|
return (
|
|
429
|
-
|
|
437
|
+
unsafePathname: string | null | undefined,
|
|
430
438
|
req: Pick<Request, 'headers' | 'url'>,
|
|
431
439
|
query: Params,
|
|
432
440
|
) => {
|
|
441
|
+
const pathname = decodeMaybeEncodedPath(unsafePathname ?? '')
|
|
442
|
+
|
|
433
443
|
for (const matcher of matchers) {
|
|
434
|
-
const routeMatch = new RegExp(matcher.regexp).exec(pathname
|
|
444
|
+
const routeMatch = new RegExp(matcher.regexp).exec(pathname)
|
|
435
445
|
if (!routeMatch) {
|
|
436
446
|
continue
|
|
437
447
|
}
|