@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
@@ -28,72 +28,97 @@ __export(request_context_exports, {
28
28
  module.exports = __toCommonJS(request_context_exports);
29
29
  var import_node_async_hooks = require("node:async_hooks");
30
30
 
31
- // node_modules/@netlify/functions/dist/chunk-HYMERDCV.mjs
32
- var import_process = require("process");
33
- var systemLogTag = "__nfSystemLog";
34
- var serializeError = (error) => {
35
- const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
36
- return {
37
- error: error.message,
38
- error_cause: cause,
39
- error_stack: error.stack
40
- };
31
+ // node_modules/@netlify/functions/dist/chunk-C6P2IO65.mjs
32
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
33
+ var __esm = (fn, res) => function __init() {
34
+ return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
41
35
  };
42
- var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
43
- LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
44
- LogLevel2[LogLevel2["Log"] = 2] = "Log";
45
- LogLevel2[LogLevel2["Error"] = 3] = "Error";
46
- return LogLevel2;
47
- })(LogLevel || {});
48
- var SystemLogger = class _SystemLogger {
49
- fields;
50
- logLevel;
51
- constructor(fields = {}, logLevel = 2) {
52
- this.fields = fields;
53
- this.logLevel = logLevel;
54
- }
55
- doLog(logger, message) {
56
- if (import_process.env.NETLIFY_DEV && !import_process.env.NETLIFY_ENABLE_SYSTEM_LOGGING) {
57
- return;
58
- }
59
- logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }));
60
- }
61
- log(message) {
62
- if (this.logLevel > 2) {
63
- return;
64
- }
65
- this.doLog(console.log, message);
66
- }
67
- debug(message) {
68
- if (this.logLevel > 1) {
69
- return;
70
- }
71
- this.doLog(console.debug, message);
72
- }
73
- error(message) {
74
- if (this.logLevel > 3) {
75
- return;
76
- }
77
- this.doLog(console.error, message);
78
- }
79
- withLogLevel(level) {
80
- return new _SystemLogger(this.fields, level);
81
- }
82
- withFields(fields) {
83
- return new _SystemLogger(
84
- {
85
- ...this.fields,
86
- ...fields
87
- },
88
- this.logLevel
89
- );
36
+
37
+ // node_modules/@netlify/functions/dist/chunk-ATZ7N7EG.mjs
38
+ var import_process = require("process");
39
+ var systemLogTag;
40
+ var serializeError;
41
+ var LogLevel;
42
+ var SystemLogger;
43
+ var systemLogger;
44
+ var init_system_logger = __esm({
45
+ "src/lib/system_logger.ts"() {
46
+ systemLogTag = "__nfSystemLog";
47
+ serializeError = (error) => {
48
+ const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
49
+ return {
50
+ error: error.message,
51
+ error_cause: cause,
52
+ error_stack: error.stack
53
+ };
54
+ };
55
+ LogLevel = /* @__PURE__ */ ((LogLevel2) => {
56
+ LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
57
+ LogLevel2[LogLevel2["Log"] = 2] = "Log";
58
+ LogLevel2[LogLevel2["Error"] = 3] = "Error";
59
+ return LogLevel2;
60
+ })(LogLevel || {});
61
+ SystemLogger = class _SystemLogger {
62
+ fields;
63
+ logLevel;
64
+ constructor(fields = {}, logLevel = 2) {
65
+ this.fields = fields;
66
+ this.logLevel = logLevel;
67
+ }
68
+ doLog(logger, message) {
69
+ if (import_process.env.NETLIFY_DEV && !import_process.env.NETLIFY_ENABLE_SYSTEM_LOGGING) {
70
+ return;
71
+ }
72
+ logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }));
73
+ }
74
+ log(message) {
75
+ if (this.logLevel > 2) {
76
+ return;
77
+ }
78
+ this.doLog(console.log, message);
79
+ }
80
+ debug(message) {
81
+ if (this.logLevel > 1) {
82
+ return;
83
+ }
84
+ this.doLog(console.debug, message);
85
+ }
86
+ error(message) {
87
+ if (this.logLevel > 3) {
88
+ return;
89
+ }
90
+ this.doLog(console.error, message);
91
+ }
92
+ withLogLevel(level) {
93
+ return new _SystemLogger(this.fields, level);
94
+ }
95
+ withFields(fields) {
96
+ return new _SystemLogger(
97
+ {
98
+ ...this.fields,
99
+ ...fields
100
+ },
101
+ this.logLevel
102
+ );
103
+ }
104
+ withError(error) {
105
+ const fields = error instanceof Error ? serializeError(error) : { error };
106
+ return this.withFields(fields);
107
+ }
108
+ };
109
+ systemLogger = new SystemLogger();
90
110
  }
91
- withError(error) {
92
- const fields = error instanceof Error ? serializeError(error) : { error };
93
- return this.withFields(fields);
111
+ });
112
+
113
+ // node_modules/@netlify/functions/dist/chunk-7ANA32NV.mjs
114
+ var init_internal = __esm({
115
+ "src/internal.ts"() {
116
+ init_system_logger();
94
117
  }
95
- };
96
- var systemLogger = new SystemLogger();
118
+ });
119
+
120
+ // node_modules/@netlify/functions/dist/internal.mjs
121
+ init_internal();
97
122
 
98
123
  // src/run/handlers/request-context.cts
99
124
  function createRequestContext(request, context) {
@@ -6,12 +6,12 @@
6
6
 
7
7
  import {
8
8
  getTracer
9
- } from "../../esm-chunks/chunk-KBX7SJLC.js";
9
+ } from "../../esm-chunks/chunk-NEZW7TGG.js";
10
10
  import {
11
11
  createRequestContext,
12
12
  getLogger,
13
13
  getRequestContext
14
- } from "../../esm-chunks/chunk-NDSDIXRD.js";
14
+ } from "../../esm-chunks/chunk-LVXJQ2G2.js";
15
15
  import {
16
16
  adjustDateHeader,
17
17
  setCacheControlHeaders,
@@ -23,9 +23,9 @@ import "../../esm-chunks/chunk-K4RDUZYO.js";
23
23
  import {
24
24
  nextResponseProxy
25
25
  } from "../../esm-chunks/chunk-XS27YRA5.js";
26
- import "../../esm-chunks/chunk-TYCYFZ22.js";
27
26
  import "../../esm-chunks/chunk-5QSXBV7L.js";
28
27
  import "../../esm-chunks/chunk-GNGHTHMQ.js";
28
+ import "../../esm-chunks/chunk-TYCYFZ22.js";
29
29
  import {
30
30
  __commonJS,
31
31
  __toESM
@@ -3124,7 +3124,7 @@ function setupWaitUntil() {
3124
3124
  }
3125
3125
 
3126
3126
  // src/run/handlers/server.ts
3127
- var nextImportPromise = import("../../esm-chunks/next-4L47PQSM.js");
3127
+ var nextImportPromise = import("../../esm-chunks/next-H2VMRX5P.js");
3128
3128
  setupWaitUntil();
3129
3129
  var nextHandler;
3130
3130
  var nextConfig;
@@ -848,66 +848,97 @@ function handleFn(span, opts, fn) {
848
848
  // src/run/handlers/request-context.cts
849
849
  var import_node_async_hooks = require("node:async_hooks");
850
850
 
851
- // node_modules/@netlify/functions/dist/chunk-HYMERDCV.mjs
852
- var import_process = require("process");
853
- var systemLogTag = "__nfSystemLog";
854
- var serializeError = (error) => {
855
- const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
856
- return {
857
- error: error.message,
858
- error_cause: cause,
859
- error_stack: error.stack
860
- };
851
+ // node_modules/@netlify/functions/dist/chunk-C6P2IO65.mjs
852
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
853
+ var __esm = (fn, res) => function __init() {
854
+ return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
861
855
  };
862
- var SystemLogger = class _SystemLogger {
863
- fields;
864
- logLevel;
865
- constructor(fields = {}, logLevel = 2) {
866
- this.fields = fields;
867
- this.logLevel = logLevel;
868
- }
869
- doLog(logger, message) {
870
- if (import_process.env.NETLIFY_DEV && !import_process.env.NETLIFY_ENABLE_SYSTEM_LOGGING) {
871
- return;
872
- }
873
- logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }));
874
- }
875
- log(message) {
876
- if (this.logLevel > 2) {
877
- return;
878
- }
879
- this.doLog(console.log, message);
880
- }
881
- debug(message) {
882
- if (this.logLevel > 1) {
883
- return;
884
- }
885
- this.doLog(console.debug, message);
886
- }
887
- error(message) {
888
- if (this.logLevel > 3) {
889
- return;
890
- }
891
- this.doLog(console.error, message);
892
- }
893
- withLogLevel(level) {
894
- return new _SystemLogger(this.fields, level);
895
- }
896
- withFields(fields) {
897
- return new _SystemLogger(
898
- {
899
- ...this.fields,
900
- ...fields
901
- },
902
- this.logLevel
903
- );
856
+
857
+ // node_modules/@netlify/functions/dist/chunk-ATZ7N7EG.mjs
858
+ var import_process = require("process");
859
+ var systemLogTag;
860
+ var serializeError;
861
+ var LogLevel;
862
+ var SystemLogger;
863
+ var systemLogger;
864
+ var init_system_logger = __esm({
865
+ "src/lib/system_logger.ts"() {
866
+ systemLogTag = "__nfSystemLog";
867
+ serializeError = (error) => {
868
+ const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
869
+ return {
870
+ error: error.message,
871
+ error_cause: cause,
872
+ error_stack: error.stack
873
+ };
874
+ };
875
+ LogLevel = /* @__PURE__ */ ((LogLevel2) => {
876
+ LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
877
+ LogLevel2[LogLevel2["Log"] = 2] = "Log";
878
+ LogLevel2[LogLevel2["Error"] = 3] = "Error";
879
+ return LogLevel2;
880
+ })(LogLevel || {});
881
+ SystemLogger = class _SystemLogger {
882
+ fields;
883
+ logLevel;
884
+ constructor(fields = {}, logLevel = 2) {
885
+ this.fields = fields;
886
+ this.logLevel = logLevel;
887
+ }
888
+ doLog(logger, message) {
889
+ if (import_process.env.NETLIFY_DEV && !import_process.env.NETLIFY_ENABLE_SYSTEM_LOGGING) {
890
+ return;
891
+ }
892
+ logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }));
893
+ }
894
+ log(message) {
895
+ if (this.logLevel > 2) {
896
+ return;
897
+ }
898
+ this.doLog(console.log, message);
899
+ }
900
+ debug(message) {
901
+ if (this.logLevel > 1) {
902
+ return;
903
+ }
904
+ this.doLog(console.debug, message);
905
+ }
906
+ error(message) {
907
+ if (this.logLevel > 3) {
908
+ return;
909
+ }
910
+ this.doLog(console.error, message);
911
+ }
912
+ withLogLevel(level) {
913
+ return new _SystemLogger(this.fields, level);
914
+ }
915
+ withFields(fields) {
916
+ return new _SystemLogger(
917
+ {
918
+ ...this.fields,
919
+ ...fields
920
+ },
921
+ this.logLevel
922
+ );
923
+ }
924
+ withError(error) {
925
+ const fields = error instanceof Error ? serializeError(error) : { error };
926
+ return this.withFields(fields);
927
+ }
928
+ };
929
+ systemLogger = new SystemLogger();
904
930
  }
905
- withError(error) {
906
- const fields = error instanceof Error ? serializeError(error) : { error };
907
- return this.withFields(fields);
931
+ });
932
+
933
+ // node_modules/@netlify/functions/dist/chunk-7ANA32NV.mjs
934
+ var init_internal = __esm({
935
+ "src/internal.ts"() {
936
+ init_system_logger();
908
937
  }
909
- };
910
- var systemLogger = new SystemLogger();
938
+ });
939
+
940
+ // node_modules/@netlify/functions/dist/internal.mjs
941
+ init_internal();
911
942
 
912
943
  // src/run/handlers/request-context.cts
913
944
  var REQUEST_CONTEXT_GLOBAL_KEY = Symbol.for("nf-request-context-async-local-storage");
@@ -6,7 +6,7 @@
6
6
 
7
7
  import {
8
8
  getLogger
9
- } from "../../esm-chunks/chunk-NDSDIXRD.js";
9
+ } from "../../esm-chunks/chunk-LVXJQ2G2.js";
10
10
  import {
11
11
  esm_exports,
12
12
  init_esm
@@ -68868,7 +68868,7 @@ var import_sdk_trace_node = __toESM(require_src20(), 1);
68868
68868
  var import_semantic_conventions = __toESM(require_src(), 1);
68869
68869
  var {
68870
68870
  default: { version, name }
68871
- } = await import("../../esm-chunks/package-LCNINN36.js");
68871
+ } = await import("../../esm-chunks/package-36IBNZ37.js");
68872
68872
  var sdk = new import_sdk_node.NodeSDK({
68873
68873
  resource: new import_resources.Resource({
68874
68874
  [import_semantic_conventions.SEMRESATTRS_SERVICE_NAME]: name,
@@ -27,66 +27,97 @@ module.exports = __toCommonJS(wait_until_exports);
27
27
  // src/run/handlers/request-context.cts
28
28
  var import_node_async_hooks = require("node:async_hooks");
29
29
 
30
- // node_modules/@netlify/functions/dist/chunk-HYMERDCV.mjs
31
- var import_process = require("process");
32
- var systemLogTag = "__nfSystemLog";
33
- var serializeError = (error) => {
34
- const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
35
- return {
36
- error: error.message,
37
- error_cause: cause,
38
- error_stack: error.stack
39
- };
30
+ // node_modules/@netlify/functions/dist/chunk-C6P2IO65.mjs
31
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
32
+ var __esm = (fn, res) => function __init() {
33
+ return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
40
34
  };
41
- var SystemLogger = class _SystemLogger {
42
- fields;
43
- logLevel;
44
- constructor(fields = {}, logLevel = 2) {
45
- this.fields = fields;
46
- this.logLevel = logLevel;
47
- }
48
- doLog(logger, message) {
49
- if (import_process.env.NETLIFY_DEV && !import_process.env.NETLIFY_ENABLE_SYSTEM_LOGGING) {
50
- return;
51
- }
52
- logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }));
53
- }
54
- log(message) {
55
- if (this.logLevel > 2) {
56
- return;
57
- }
58
- this.doLog(console.log, message);
59
- }
60
- debug(message) {
61
- if (this.logLevel > 1) {
62
- return;
63
- }
64
- this.doLog(console.debug, message);
65
- }
66
- error(message) {
67
- if (this.logLevel > 3) {
68
- return;
69
- }
70
- this.doLog(console.error, message);
71
- }
72
- withLogLevel(level) {
73
- return new _SystemLogger(this.fields, level);
74
- }
75
- withFields(fields) {
76
- return new _SystemLogger(
77
- {
78
- ...this.fields,
79
- ...fields
80
- },
81
- this.logLevel
82
- );
35
+
36
+ // node_modules/@netlify/functions/dist/chunk-ATZ7N7EG.mjs
37
+ var import_process = require("process");
38
+ var systemLogTag;
39
+ var serializeError;
40
+ var LogLevel;
41
+ var SystemLogger;
42
+ var systemLogger;
43
+ var init_system_logger = __esm({
44
+ "src/lib/system_logger.ts"() {
45
+ systemLogTag = "__nfSystemLog";
46
+ serializeError = (error) => {
47
+ const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
48
+ return {
49
+ error: error.message,
50
+ error_cause: cause,
51
+ error_stack: error.stack
52
+ };
53
+ };
54
+ LogLevel = /* @__PURE__ */ ((LogLevel2) => {
55
+ LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
56
+ LogLevel2[LogLevel2["Log"] = 2] = "Log";
57
+ LogLevel2[LogLevel2["Error"] = 3] = "Error";
58
+ return LogLevel2;
59
+ })(LogLevel || {});
60
+ SystemLogger = class _SystemLogger {
61
+ fields;
62
+ logLevel;
63
+ constructor(fields = {}, logLevel = 2) {
64
+ this.fields = fields;
65
+ this.logLevel = logLevel;
66
+ }
67
+ doLog(logger, message) {
68
+ if (import_process.env.NETLIFY_DEV && !import_process.env.NETLIFY_ENABLE_SYSTEM_LOGGING) {
69
+ return;
70
+ }
71
+ logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }));
72
+ }
73
+ log(message) {
74
+ if (this.logLevel > 2) {
75
+ return;
76
+ }
77
+ this.doLog(console.log, message);
78
+ }
79
+ debug(message) {
80
+ if (this.logLevel > 1) {
81
+ return;
82
+ }
83
+ this.doLog(console.debug, message);
84
+ }
85
+ error(message) {
86
+ if (this.logLevel > 3) {
87
+ return;
88
+ }
89
+ this.doLog(console.error, message);
90
+ }
91
+ withLogLevel(level) {
92
+ return new _SystemLogger(this.fields, level);
93
+ }
94
+ withFields(fields) {
95
+ return new _SystemLogger(
96
+ {
97
+ ...this.fields,
98
+ ...fields
99
+ },
100
+ this.logLevel
101
+ );
102
+ }
103
+ withError(error) {
104
+ const fields = error instanceof Error ? serializeError(error) : { error };
105
+ return this.withFields(fields);
106
+ }
107
+ };
108
+ systemLogger = new SystemLogger();
83
109
  }
84
- withError(error) {
85
- const fields = error instanceof Error ? serializeError(error) : { error };
86
- return this.withFields(fields);
110
+ });
111
+
112
+ // node_modules/@netlify/functions/dist/chunk-7ANA32NV.mjs
113
+ var init_internal = __esm({
114
+ "src/internal.ts"() {
115
+ init_system_logger();
87
116
  }
88
- };
89
- var systemLogger = new SystemLogger();
117
+ });
118
+
119
+ // node_modules/@netlify/functions/dist/internal.mjs
120
+ init_internal();
90
121
 
91
122
  // src/run/handlers/request-context.cts
92
123
  var REQUEST_CONTEXT_GLOBAL_KEY = Symbol.for("nf-request-context-async-local-storage");