@netlify/plugin-nextjs 5.11.6 → 5.12.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.
@@ -109,6 +109,9 @@ var copyNextServerCode = async (ctx) => {
109
109
  }
110
110
  return;
111
111
  }
112
+ if (path === "server/functions-config-manifest.json") {
113
+ await verifyFunctionsConfigManifest(join(srcDir, path));
114
+ }
112
115
  await cp(srcPath, destPath, { recursive: true, force: true });
113
116
  })
114
117
  );
@@ -246,6 +249,15 @@ var replaceMiddlewareManifest = async (sourcePath, destPath) => {
246
249
  const newData = JSON.stringify(newManifest);
247
250
  await writeFile(destPath, newData);
248
251
  };
252
+ var verifyFunctionsConfigManifest = async (sourcePath) => {
253
+ const data = await readFile(sourcePath, "utf8");
254
+ const manifest = JSON.parse(data);
255
+ if (manifest.functions["/_middleware"]) {
256
+ throw new Error(
257
+ "Node.js middleware is not yet supported.\n\nFuture @netlify/plugin-nextjs release will support node middleware with following limitations:\n - usage of C++ Addons (https://nodejs.org/api/addons.html) not supported (for example `bcrypt` npm module will not be supported, but `bcryptjs` will be supported),\n - usage of Filesystem (https://nodejs.org/api/fs.html) not supported."
258
+ );
259
+ }
260
+ };
249
261
  var verifyHandlerDirStructure = async (ctx) => {
250
262
  const { nextConfig } = JSON.parse(
251
263
  await readFile(join(ctx.serverHandlerDir, RUN_CONFIG_FILE), "utf-8")
@@ -92,6 +92,7 @@ var require_constants = __commonJS({
92
92
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
93
93
  // Replace globs with equivalent patterns to reduce parsing time.
94
94
  REPLACEMENTS: {
95
+ __proto__: null,
95
96
  "***": "*",
96
97
  "**/**": "**",
97
98
  "**/**/**": "**"
package/dist/index.js CHANGED
@@ -31,14 +31,24 @@ import {
31
31
  verifyNetlifyFormsWorkaround,
32
32
  verifyPublishDir
33
33
  } from "./build/verification.js";
34
+ var skipPlugin = process.env.NETLIFY_NEXT_PLUGIN_SKIP === "true" || process.env.NETLIFY_NEXT_PLUGIN_SKIP === "1";
35
+ var skipText = "Skipping Next.js plugin due to NETLIFY_NEXT_PLUGIN_SKIP environment variable.";
34
36
  var tracer = wrapTracer(trace.getTracer("Next.js runtime"));
35
37
  var onPreDev = async (options) => {
38
+ if (skipPlugin) {
39
+ console.warn(skipText);
40
+ return;
41
+ }
36
42
  await tracer.withActiveSpan("onPreDev", async () => {
37
43
  const context = new PluginContext(options);
38
44
  await rm(context.blobDir, { recursive: true, force: true });
39
45
  });
40
46
  };
41
47
  var onPreBuild = async (options) => {
48
+ if (skipPlugin) {
49
+ console.warn(skipText);
50
+ return;
51
+ }
42
52
  await tracer.withActiveSpan("onPreBuild", async () => {
43
53
  process.env.NEXT_PRIVATE_STANDALONE = "true";
44
54
  const ctx = new PluginContext(options);
@@ -51,6 +61,10 @@ var onPreBuild = async (options) => {
51
61
  });
52
62
  };
53
63
  var onBuild = async (options) => {
64
+ if (skipPlugin) {
65
+ console.warn(skipText);
66
+ return;
67
+ }
54
68
  await tracer.withActiveSpan("onBuild", async (span) => {
55
69
  const ctx = new PluginContext(options);
56
70
  verifyPublishDir(ctx);
@@ -75,11 +89,19 @@ var onBuild = async (options) => {
75
89
  });
76
90
  };
77
91
  var onPostBuild = async (options) => {
92
+ if (skipPlugin) {
93
+ console.warn(skipText);
94
+ return;
95
+ }
78
96
  await tracer.withActiveSpan("onPostBuild", async () => {
79
97
  await publishStaticDir(new PluginContext(options));
80
98
  });
81
99
  };
82
100
  var onSuccess = async () => {
101
+ if (skipPlugin) {
102
+ console.warn(skipText);
103
+ return;
104
+ }
83
105
  await tracer.withActiveSpan("onSuccess", async () => {
84
106
  const prewarm = [process.env.DEPLOY_URL, process.env.DEPLOY_PRIME_URL, process.env.URL].filter(
85
107
  // If running locally then the deploy ID is a placeholder value. Filtering for `https://0--` removes it.
@@ -89,6 +111,10 @@ var onSuccess = async () => {
89
111
  });
90
112
  };
91
113
  var onEnd = async (options) => {
114
+ if (skipPlugin) {
115
+ console.warn(skipText);
116
+ return;
117
+ }
92
118
  await tracer.withActiveSpan("onEnd", async () => {
93
119
  await unpublishStaticDir(new PluginContext(options));
94
120
  });
@@ -86,7 +86,7 @@ var pipeline = (0, import_util.promisify)(import_stream.pipeline);
86
86
 
87
87
  // package.json
88
88
  var name = "@netlify/plugin-nextjs";
89
- var version = "5.11.6";
89
+ var version = "5.12.1";
90
90
 
91
91
  // src/run/handlers/tags-handler.cts
92
92
  var import_storage = require("../storage/storage.cjs");
@@ -0,0 +1,5 @@
1
+ {
2
+ "modules": {
3
+ "https://deno.land/std@0.175.0/node/internal_binding/_timingSafeEqual.ts": {}
4
+ }
5
+ }
@@ -14,3 +14,11 @@ import 'https://deno.land/x/path_to_regexp@v6.2.1/index.ts'
14
14
  import 'https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts'
15
15
 
16
16
  import 'https://v1-7-0--edge-utils.netlify.app/logger/mod.ts'
17
+
18
+ // Types
19
+ import 'https://deno.land/std@0.175.0/node/_global.d.ts'
20
+ import 'https://deno.land/std@0.175.0/node/_events.d.ts'
21
+ import 'https://deno.land/std@0.175.0/node/_stream.d.ts'
22
+ import 'https://deno.land/std@0.175.0/node/internal/buffer.d.ts'
23
+ import 'https://deno.land/std@0.175.0/types.d.ts'
24
+ import 'https://deno.land/x/htmlrewriter@v1.0.0/src/types.d.ts'
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "5.11.6",
3
+ "version": "5.12.1",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",
9
9
  "edge-runtime",
10
+ "!edge-runtime/deno.json",
11
+ "!edge-runtime/deno.lock",
10
12
  "manifest.yml"
11
13
  ],
12
14
  "engines": {
@@ -1,6 +0,0 @@
1
- {
2
- "imports": {
3
- "https://deno.land/": "./deno.land/",
4
- "https://v1-7-0--edge-utils.netlify.app/": "./v1-7-0--edge-utils.netlify.app/"
5
- }
6
- }