@netlify/plugin-nextjs 5.9.0 → 5.9.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.
Files changed (35) hide show
  1. package/dist/build/content/prerendered.js +2 -2
  2. package/dist/build/content/static.js +2 -2
  3. package/dist/build/functions/edge.js +1 -1
  4. package/dist/esm-chunks/{chunk-BFYMHE3E.js → chunk-HGXG447M.js} +13 -0
  5. package/dist/esm-chunks/chunk-LVXJQ2G2.js +147 -0
  6. package/dist/esm-chunks/{chunk-KBX7SJLC.js → chunk-NEZW7TGG.js} +1 -1
  7. package/dist/esm-chunks/{next-4L47PQSM.js → next-H2VMRX5P.js} +2 -4
  8. package/dist/esm-chunks/{package-LCNINN36.js → package-36IBNZ37.js} +2 -2
  9. package/dist/index.js +4 -4
  10. package/dist/run/handlers/cache.cjs +251 -139
  11. package/dist/run/handlers/request-context.cjs +88 -63
  12. package/dist/run/handlers/server.js +4 -4
  13. package/dist/run/handlers/tracer.cjs +88 -57
  14. package/dist/run/handlers/tracing.js +2 -2
  15. package/dist/run/handlers/wait-until.cjs +88 -57
  16. package/dist/run/next.cjs +88 -59
  17. package/edge-runtime/lib/middleware.ts +1 -1
  18. package/edge-runtime/lib/response.ts +5 -2
  19. package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter.js +1218 -0
  20. package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter_bg.wasm +0 -0
  21. package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts +80 -0
  22. package/edge-runtime/vendor/deno.land/x/{html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.d.ts → htmlrewriter@v1.0.0/src/types.d.ts} +8 -25
  23. package/edge-runtime/vendor/import_map.json +0 -2
  24. package/edge-runtime/vendor.ts +1 -1
  25. package/package.json +1 -1
  26. package/dist/esm-chunks/chunk-NDSDIXRD.js +0 -122
  27. package/edge-runtime/vendor/deno.land/std@0.134.0/fmt/colors.ts +0 -536
  28. package/edge-runtime/vendor/deno.land/std@0.134.0/testing/_diff.ts +0 -360
  29. package/edge-runtime/vendor/deno.land/std@0.134.0/testing/asserts.ts +0 -866
  30. package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +0 -133
  31. package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +0 -112
  32. package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +0 -974
  33. package/edge-runtime/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +0 -50
  34. package/dist/esm-chunks/{chunk-BVYZSEV6.js → chunk-J4D25YDX.js} +3 -3
  35. package/dist/esm-chunks/{chunk-HWMLYAVP.js → chunk-NTLBFRPA.js} +3 -3
@@ -1,536 +0,0 @@
1
- // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
2
- // A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors
3
- // on npm.
4
- // This module is browser compatible.
5
-
6
- /**
7
- * ```ts
8
- * import { bgBlue, red, bold } from "https://deno.land/std@$STD_VERSION/fmt/colors.ts";
9
- * console.log(bgBlue(red(bold("Hello world!"))));
10
- * ```
11
- *
12
- * This module supports `NO_COLOR` environmental variable disabling any coloring
13
- * if `NO_COLOR` is set.
14
- *
15
- * @module
16
- */
17
- // This module is browser compatible.
18
-
19
- // deno-lint-ignore no-explicit-any
20
- const { Deno } = globalThis as any;
21
- const noColor = typeof Deno?.noColor === "boolean"
22
- ? Deno.noColor as boolean
23
- : true;
24
-
25
- interface Code {
26
- open: string;
27
- close: string;
28
- regexp: RegExp;
29
- }
30
-
31
- /** RGB 8-bits per channel. Each in range `0->255` or `0x00->0xff` */
32
- interface Rgb {
33
- r: number;
34
- g: number;
35
- b: number;
36
- }
37
-
38
- let enabled = !noColor;
39
-
40
- /**
41
- * Set changing text color to enabled or disabled
42
- * @param value
43
- */
44
- export function setColorEnabled(value: boolean): void {
45
- if (noColor) {
46
- return;
47
- }
48
-
49
- enabled = value;
50
- }
51
-
52
- /** Get whether text color change is enabled or disabled. */
53
- export function getColorEnabled(): boolean {
54
- return enabled;
55
- }
56
-
57
- /**
58
- * Builds color code
59
- * @param open
60
- * @param close
61
- */
62
- function code(open: number[], close: number): Code {
63
- return {
64
- open: `\x1b[${open.join(";")}m`,
65
- close: `\x1b[${close}m`,
66
- regexp: new RegExp(`\\x1b\\[${close}m`, "g"),
67
- };
68
- }
69
-
70
- /**
71
- * Applies color and background based on color code and its associated text
72
- * @param str text to apply color settings to
73
- * @param code color code to apply
74
- */
75
- function run(str: string, code: Code): string {
76
- return enabled
77
- ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
78
- : str;
79
- }
80
-
81
- /**
82
- * Reset the text modified
83
- * @param str text to reset
84
- */
85
- export function reset(str: string): string {
86
- return run(str, code([0], 0));
87
- }
88
-
89
- /**
90
- * Make the text bold.
91
- * @param str text to make bold
92
- */
93
- export function bold(str: string): string {
94
- return run(str, code([1], 22));
95
- }
96
-
97
- /**
98
- * The text emits only a small amount of light.
99
- * @param str text to dim
100
- */
101
- export function dim(str: string): string {
102
- return run(str, code([2], 22));
103
- }
104
-
105
- /**
106
- * Make the text italic.
107
- * @param str text to make italic
108
- */
109
- export function italic(str: string): string {
110
- return run(str, code([3], 23));
111
- }
112
-
113
- /**
114
- * Make the text underline.
115
- * @param str text to underline
116
- */
117
- export function underline(str: string): string {
118
- return run(str, code([4], 24));
119
- }
120
-
121
- /**
122
- * Invert background color and text color.
123
- * @param str text to invert its color
124
- */
125
- export function inverse(str: string): string {
126
- return run(str, code([7], 27));
127
- }
128
-
129
- /**
130
- * Make the text hidden.
131
- * @param str text to hide
132
- */
133
- export function hidden(str: string): string {
134
- return run(str, code([8], 28));
135
- }
136
-
137
- /**
138
- * Put horizontal line through the center of the text.
139
- * @param str text to strike through
140
- */
141
- export function strikethrough(str: string): string {
142
- return run(str, code([9], 29));
143
- }
144
-
145
- /**
146
- * Set text color to black.
147
- * @param str text to make black
148
- */
149
- export function black(str: string): string {
150
- return run(str, code([30], 39));
151
- }
152
-
153
- /**
154
- * Set text color to red.
155
- * @param str text to make red
156
- */
157
- export function red(str: string): string {
158
- return run(str, code([31], 39));
159
- }
160
-
161
- /**
162
- * Set text color to green.
163
- * @param str text to make green
164
- */
165
- export function green(str: string): string {
166
- return run(str, code([32], 39));
167
- }
168
-
169
- /**
170
- * Set text color to yellow.
171
- * @param str text to make yellow
172
- */
173
- export function yellow(str: string): string {
174
- return run(str, code([33], 39));
175
- }
176
-
177
- /**
178
- * Set text color to blue.
179
- * @param str text to make blue
180
- */
181
- export function blue(str: string): string {
182
- return run(str, code([34], 39));
183
- }
184
-
185
- /**
186
- * Set text color to magenta.
187
- * @param str text to make magenta
188
- */
189
- export function magenta(str: string): string {
190
- return run(str, code([35], 39));
191
- }
192
-
193
- /**
194
- * Set text color to cyan.
195
- * @param str text to make cyan
196
- */
197
- export function cyan(str: string): string {
198
- return run(str, code([36], 39));
199
- }
200
-
201
- /**
202
- * Set text color to white.
203
- * @param str text to make white
204
- */
205
- export function white(str: string): string {
206
- return run(str, code([37], 39));
207
- }
208
-
209
- /**
210
- * Set text color to gray.
211
- * @param str text to make gray
212
- */
213
- export function gray(str: string): string {
214
- return brightBlack(str);
215
- }
216
-
217
- /**
218
- * Set text color to bright black.
219
- * @param str text to make bright-black
220
- */
221
- export function brightBlack(str: string): string {
222
- return run(str, code([90], 39));
223
- }
224
-
225
- /**
226
- * Set text color to bright red.
227
- * @param str text to make bright-red
228
- */
229
- export function brightRed(str: string): string {
230
- return run(str, code([91], 39));
231
- }
232
-
233
- /**
234
- * Set text color to bright green.
235
- * @param str text to make bright-green
236
- */
237
- export function brightGreen(str: string): string {
238
- return run(str, code([92], 39));
239
- }
240
-
241
- /**
242
- * Set text color to bright yellow.
243
- * @param str text to make bright-yellow
244
- */
245
- export function brightYellow(str: string): string {
246
- return run(str, code([93], 39));
247
- }
248
-
249
- /**
250
- * Set text color to bright blue.
251
- * @param str text to make bright-blue
252
- */
253
- export function brightBlue(str: string): string {
254
- return run(str, code([94], 39));
255
- }
256
-
257
- /**
258
- * Set text color to bright magenta.
259
- * @param str text to make bright-magenta
260
- */
261
- export function brightMagenta(str: string): string {
262
- return run(str, code([95], 39));
263
- }
264
-
265
- /**
266
- * Set text color to bright cyan.
267
- * @param str text to make bright-cyan
268
- */
269
- export function brightCyan(str: string): string {
270
- return run(str, code([96], 39));
271
- }
272
-
273
- /**
274
- * Set text color to bright white.
275
- * @param str text to make bright-white
276
- */
277
- export function brightWhite(str: string): string {
278
- return run(str, code([97], 39));
279
- }
280
-
281
- /**
282
- * Set background color to black.
283
- * @param str text to make its background black
284
- */
285
- export function bgBlack(str: string): string {
286
- return run(str, code([40], 49));
287
- }
288
-
289
- /**
290
- * Set background color to red.
291
- * @param str text to make its background red
292
- */
293
- export function bgRed(str: string): string {
294
- return run(str, code([41], 49));
295
- }
296
-
297
- /**
298
- * Set background color to green.
299
- * @param str text to make its background green
300
- */
301
- export function bgGreen(str: string): string {
302
- return run(str, code([42], 49));
303
- }
304
-
305
- /**
306
- * Set background color to yellow.
307
- * @param str text to make its background yellow
308
- */
309
- export function bgYellow(str: string): string {
310
- return run(str, code([43], 49));
311
- }
312
-
313
- /**
314
- * Set background color to blue.
315
- * @param str text to make its background blue
316
- */
317
- export function bgBlue(str: string): string {
318
- return run(str, code([44], 49));
319
- }
320
-
321
- /**
322
- * Set background color to magenta.
323
- * @param str text to make its background magenta
324
- */
325
- export function bgMagenta(str: string): string {
326
- return run(str, code([45], 49));
327
- }
328
-
329
- /**
330
- * Set background color to cyan.
331
- * @param str text to make its background cyan
332
- */
333
- export function bgCyan(str: string): string {
334
- return run(str, code([46], 49));
335
- }
336
-
337
- /**
338
- * Set background color to white.
339
- * @param str text to make its background white
340
- */
341
- export function bgWhite(str: string): string {
342
- return run(str, code([47], 49));
343
- }
344
-
345
- /**
346
- * Set background color to bright black.
347
- * @param str text to make its background bright-black
348
- */
349
- export function bgBrightBlack(str: string): string {
350
- return run(str, code([100], 49));
351
- }
352
-
353
- /**
354
- * Set background color to bright red.
355
- * @param str text to make its background bright-red
356
- */
357
- export function bgBrightRed(str: string): string {
358
- return run(str, code([101], 49));
359
- }
360
-
361
- /**
362
- * Set background color to bright green.
363
- * @param str text to make its background bright-green
364
- */
365
- export function bgBrightGreen(str: string): string {
366
- return run(str, code([102], 49));
367
- }
368
-
369
- /**
370
- * Set background color to bright yellow.
371
- * @param str text to make its background bright-yellow
372
- */
373
- export function bgBrightYellow(str: string): string {
374
- return run(str, code([103], 49));
375
- }
376
-
377
- /**
378
- * Set background color to bright blue.
379
- * @param str text to make its background bright-blue
380
- */
381
- export function bgBrightBlue(str: string): string {
382
- return run(str, code([104], 49));
383
- }
384
-
385
- /**
386
- * Set background color to bright magenta.
387
- * @param str text to make its background bright-magenta
388
- */
389
- export function bgBrightMagenta(str: string): string {
390
- return run(str, code([105], 49));
391
- }
392
-
393
- /**
394
- * Set background color to bright cyan.
395
- * @param str text to make its background bright-cyan
396
- */
397
- export function bgBrightCyan(str: string): string {
398
- return run(str, code([106], 49));
399
- }
400
-
401
- /**
402
- * Set background color to bright white.
403
- * @param str text to make its background bright-white
404
- */
405
- export function bgBrightWhite(str: string): string {
406
- return run(str, code([107], 49));
407
- }
408
-
409
- /* Special Color Sequences */
410
-
411
- /**
412
- * Clam and truncate color codes
413
- * @param n
414
- * @param max number to truncate to
415
- * @param min number to truncate from
416
- */
417
- function clampAndTruncate(n: number, max = 255, min = 0): number {
418
- return Math.trunc(Math.max(Math.min(n, max), min));
419
- }
420
-
421
- /**
422
- * Set text color using paletted 8bit colors.
423
- * https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
424
- * @param str text color to apply paletted 8bit colors to
425
- * @param color code
426
- */
427
- export function rgb8(str: string, color: number): string {
428
- return run(str, code([38, 5, clampAndTruncate(color)], 39));
429
- }
430
-
431
- /**
432
- * Set background color using paletted 8bit colors.
433
- * https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
434
- * @param str text color to apply paletted 8bit background colors to
435
- * @param color code
436
- */
437
- export function bgRgb8(str: string, color: number): string {
438
- return run(str, code([48, 5, clampAndTruncate(color)], 49));
439
- }
440
-
441
- /**
442
- * Set text color using 24bit rgb.
443
- * `color` can be a number in range `0x000000` to `0xffffff` or
444
- * an `Rgb`.
445
- *
446
- * To produce the color magenta:
447
- *
448
- * ```ts
449
- * import { rgb24 } from "./colors.ts";
450
- * rgb24("foo", 0xff00ff);
451
- * rgb24("foo", {r: 255, g: 0, b: 255});
452
- * ```
453
- * @param str text color to apply 24bit rgb to
454
- * @param color code
455
- */
456
- export function rgb24(str: string, color: number | Rgb): string {
457
- if (typeof color === "number") {
458
- return run(
459
- str,
460
- code(
461
- [38, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff],
462
- 39,
463
- ),
464
- );
465
- }
466
- return run(
467
- str,
468
- code(
469
- [
470
- 38,
471
- 2,
472
- clampAndTruncate(color.r),
473
- clampAndTruncate(color.g),
474
- clampAndTruncate(color.b),
475
- ],
476
- 39,
477
- ),
478
- );
479
- }
480
-
481
- /**
482
- * Set background color using 24bit rgb.
483
- * `color` can be a number in range `0x000000` to `0xffffff` or
484
- * an `Rgb`.
485
- *
486
- * To produce the color magenta:
487
- *
488
- * ```ts
489
- * import { bgRgb24 } from "./colors.ts";
490
- * bgRgb24("foo", 0xff00ff);
491
- * bgRgb24("foo", {r: 255, g: 0, b: 255});
492
- * ```
493
- * @param str text color to apply 24bit rgb to
494
- * @param color code
495
- */
496
- export function bgRgb24(str: string, color: number | Rgb): string {
497
- if (typeof color === "number") {
498
- return run(
499
- str,
500
- code(
501
- [48, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff],
502
- 49,
503
- ),
504
- );
505
- }
506
- return run(
507
- str,
508
- code(
509
- [
510
- 48,
511
- 2,
512
- clampAndTruncate(color.r),
513
- clampAndTruncate(color.g),
514
- clampAndTruncate(color.b),
515
- ],
516
- 49,
517
- ),
518
- );
519
- }
520
-
521
- // https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
522
- const ANSI_PATTERN = new RegExp(
523
- [
524
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
525
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",
526
- ].join("|"),
527
- "g",
528
- );
529
-
530
- /**
531
- * Remove ANSI escape codes from the string.
532
- * @param string to remove ANSI escape codes from
533
- */
534
- export function stripColor(string: string): string {
535
- return string.replace(ANSI_PATTERN, "");
536
- }