@netlify/plugin-nextjs 5.9.1 → 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.
@@ -7,14 +7,14 @@
7
7
  import {
8
8
  copyFetchContent,
9
9
  copyPrerenderedContent
10
- } from "../../esm-chunks/chunk-BVYZSEV6.js";
11
- import "../../esm-chunks/chunk-TYCYFZ22.js";
10
+ } from "../../esm-chunks/chunk-J4D25YDX.js";
12
11
  import "../../esm-chunks/chunk-5QSXBV7L.js";
13
12
  import "../../esm-chunks/chunk-GNGHTHMQ.js";
14
13
  import "../../esm-chunks/chunk-ZSVHJNNY.js";
15
14
  import "../../esm-chunks/chunk-KGYJQ2U2.js";
16
15
  import "../../esm-chunks/chunk-ZENB67PD.js";
17
16
  import "../../esm-chunks/chunk-APO262HE.js";
17
+ import "../../esm-chunks/chunk-TYCYFZ22.js";
18
18
  import "../../esm-chunks/chunk-OEQOKJGE.js";
19
19
  export {
20
20
  copyFetchContent,
@@ -10,14 +10,14 @@ import {
10
10
  copyStaticExport,
11
11
  publishStaticDir,
12
12
  unpublishStaticDir
13
- } from "../../esm-chunks/chunk-HWMLYAVP.js";
14
- import "../../esm-chunks/chunk-TYCYFZ22.js";
13
+ } from "../../esm-chunks/chunk-NTLBFRPA.js";
15
14
  import "../../esm-chunks/chunk-5QSXBV7L.js";
16
15
  import "../../esm-chunks/chunk-GNGHTHMQ.js";
17
16
  import "../../esm-chunks/chunk-ZSVHJNNY.js";
18
17
  import "../../esm-chunks/chunk-KGYJQ2U2.js";
19
18
  import "../../esm-chunks/chunk-ZENB67PD.js";
20
19
  import "../../esm-chunks/chunk-APO262HE.js";
20
+ import "../../esm-chunks/chunk-TYCYFZ22.js";
21
21
  import "../../esm-chunks/chunk-OEQOKJGE.js";
22
22
  export {
23
23
  copyStaticAssets,
@@ -0,0 +1,147 @@
1
+
2
+ var require = await (async () => {
3
+ var { createRequire } = await import("node:module");
4
+ return createRequire(import.meta.url);
5
+ })();
6
+
7
+
8
+ // src/run/handlers/request-context.cts
9
+ import { AsyncLocalStorage } from "node:async_hooks";
10
+
11
+ // node_modules/@netlify/functions/dist/chunk-C6P2IO65.mjs
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+
17
+ // node_modules/@netlify/functions/dist/chunk-ATZ7N7EG.mjs
18
+ import { env } from "process";
19
+ var systemLogTag;
20
+ var serializeError;
21
+ var LogLevel;
22
+ var SystemLogger;
23
+ var systemLogger;
24
+ var init_system_logger = __esm({
25
+ "src/lib/system_logger.ts"() {
26
+ systemLogTag = "__nfSystemLog";
27
+ serializeError = (error) => {
28
+ const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause;
29
+ return {
30
+ error: error.message,
31
+ error_cause: cause,
32
+ error_stack: error.stack
33
+ };
34
+ };
35
+ LogLevel = /* @__PURE__ */ ((LogLevel2) => {
36
+ LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
37
+ LogLevel2[LogLevel2["Log"] = 2] = "Log";
38
+ LogLevel2[LogLevel2["Error"] = 3] = "Error";
39
+ return LogLevel2;
40
+ })(LogLevel || {});
41
+ 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 (env.NETLIFY_DEV && !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
+ );
83
+ }
84
+ withError(error) {
85
+ const fields = error instanceof Error ? serializeError(error) : { error };
86
+ return this.withFields(fields);
87
+ }
88
+ };
89
+ systemLogger = new SystemLogger();
90
+ }
91
+ });
92
+
93
+ // node_modules/@netlify/functions/dist/chunk-7ANA32NV.mjs
94
+ var init_internal = __esm({
95
+ "src/internal.ts"() {
96
+ init_system_logger();
97
+ }
98
+ });
99
+
100
+ // node_modules/@netlify/functions/dist/internal.mjs
101
+ init_internal();
102
+
103
+ // src/run/handlers/request-context.cts
104
+ function createRequestContext(request, context) {
105
+ const backgroundWorkPromises = [];
106
+ return {
107
+ captureServerTiming: request?.headers.has("x-next-debug-logging") ?? false,
108
+ trackBackgroundWork: (promise) => {
109
+ if (context?.waitUntil) {
110
+ context.waitUntil(promise);
111
+ } else {
112
+ backgroundWorkPromises.push(promise);
113
+ }
114
+ },
115
+ get backgroundWorkPromise() {
116
+ return Promise.allSettled(backgroundWorkPromises);
117
+ },
118
+ logger: systemLogger.withLogLevel(
119
+ request?.headers.has("x-nf-debug-logging") || request?.headers.has("x-next-debug-logging") ? LogLevel.Debug : LogLevel.Log
120
+ )
121
+ };
122
+ }
123
+ var REQUEST_CONTEXT_GLOBAL_KEY = Symbol.for("nf-request-context-async-local-storage");
124
+ var requestContextAsyncLocalStorage;
125
+ function getRequestContextAsyncLocalStorage() {
126
+ if (requestContextAsyncLocalStorage) {
127
+ return requestContextAsyncLocalStorage;
128
+ }
129
+ const extendedGlobalThis = globalThis;
130
+ if (extendedGlobalThis[REQUEST_CONTEXT_GLOBAL_KEY]) {
131
+ return extendedGlobalThis[REQUEST_CONTEXT_GLOBAL_KEY];
132
+ }
133
+ const storage = new AsyncLocalStorage();
134
+ requestContextAsyncLocalStorage = storage;
135
+ extendedGlobalThis[REQUEST_CONTEXT_GLOBAL_KEY] = storage;
136
+ return storage;
137
+ }
138
+ var getRequestContext = () => getRequestContextAsyncLocalStorage().getStore();
139
+ function getLogger() {
140
+ return getRequestContext()?.logger ?? systemLogger;
141
+ }
142
+
143
+ export {
144
+ createRequestContext,
145
+ getRequestContext,
146
+ getLogger
147
+ };
@@ -6,7 +6,7 @@
6
6
 
7
7
  import {
8
8
  getRequestContext
9
- } from "./chunk-NDSDIXRD.js";
9
+ } from "./chunk-LVXJQ2G2.js";
10
10
  import {
11
11
  wrapTracer
12
12
  } from "./chunk-5QSXBV7L.js";
@@ -6,10 +6,10 @@
6
6
 
7
7
  import {
8
8
  getTracer
9
- } from "./chunk-KBX7SJLC.js";
9
+ } from "./chunk-NEZW7TGG.js";
10
10
  import {
11
11
  getRequestContext
12
- } from "./chunk-NDSDIXRD.js";
12
+ } from "./chunk-LVXJQ2G2.js";
13
13
  import {
14
14
  getRegionalBlobStore
15
15
  } from "./chunk-K4RDUZYO.js";
@@ -478,7 +478,6 @@ var import_fs_monkey = __toESM(require_lib());
478
478
  import fs from "fs/promises";
479
479
  import { relative, resolve } from "path";
480
480
  process.env.NODE_ENV = "production";
481
- console.time("import next server");
482
481
  var { getRequestHandlers } = __require("next/dist/server/lib/start-server.js");
483
482
  var ResponseCache = __require("next/dist/server/response-cache/index.js").default;
484
483
  var originalGet = ResponseCache.prototype.get;
@@ -523,7 +522,6 @@ ResponseCache.prototype.get = function get(...getArgs) {
523
522
  }
524
523
  return originalGet.apply(this, getArgs);
525
524
  };
526
- console.timeEnd("import next server");
527
525
  async function getMockedRequestHandler(...args) {
528
526
  const tracer = getTracer();
529
527
  return tracer.withActiveSpan("mocked request handler", async () => {
@@ -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.9.1";
11
+ var version = "5.9.2";
12
12
  var description = "Run Next.js seamlessly on Netlify";
13
13
  var main = "./dist/index.js";
14
14
  var type = "module";
@@ -62,7 +62,7 @@ var devDependencies = {
62
62
  "@netlify/edge-bundler": "^12.2.3",
63
63
  "@netlify/edge-functions": "^2.11.0",
64
64
  "@netlify/eslint-config-node": "^7.0.1",
65
- "@netlify/functions": "^2.8.2",
65
+ "@netlify/functions": "^3.0.0",
66
66
  "@netlify/serverless-functions-api": "^1.30.1",
67
67
  "@netlify/zip-it-and-ship-it": "^9.41.0",
68
68
  "@opentelemetry/api": "^1.8.0",
package/dist/index.js CHANGED
@@ -4,17 +4,6 @@
4
4
  return createRequire(import.meta.url);
5
5
  })();
6
6
 
7
- import {
8
- copyPrerenderedContent
9
- } from "./esm-chunks/chunk-BVYZSEV6.js";
10
- import {
11
- copyStaticAssets,
12
- copyStaticContent,
13
- copyStaticExport,
14
- publishStaticDir,
15
- unpublishStaticDir
16
- } from "./esm-chunks/chunk-HWMLYAVP.js";
17
- import "./esm-chunks/chunk-TYCYFZ22.js";
18
7
  import {
19
8
  clearStaleEdgeHandlers,
20
9
  createEdgeHandlers
@@ -23,7 +12,17 @@ import {
23
12
  clearStaleServerHandlers,
24
13
  createServerHandler
25
14
  } from "./esm-chunks/chunk-DLVROEVU.js";
15
+ import {
16
+ copyPrerenderedContent
17
+ } from "./esm-chunks/chunk-J4D25YDX.js";
26
18
  import "./esm-chunks/chunk-IJZEDP6B.js";
19
+ import {
20
+ copyStaticAssets,
21
+ copyStaticContent,
22
+ copyStaticExport,
23
+ publishStaticDir,
24
+ unpublishStaticDir
25
+ } from "./esm-chunks/chunk-NTLBFRPA.js";
27
26
  import {
28
27
  wrapTracer
29
28
  } from "./esm-chunks/chunk-5QSXBV7L.js";
@@ -49,6 +48,7 @@ import {
49
48
  import "./esm-chunks/chunk-KGYJQ2U2.js";
50
49
  import "./esm-chunks/chunk-ZENB67PD.js";
51
50
  import "./esm-chunks/chunk-APO262HE.js";
51
+ import "./esm-chunks/chunk-TYCYFZ22.js";
52
52
  import "./esm-chunks/chunk-UYKENJEU.js";
53
53
  import "./esm-chunks/chunk-OEQOKJGE.js";
54
54