next-plugin-agent-tail 0.3.6 → 0.3.8

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/handler.mjs CHANGED
@@ -9,10 +9,10 @@ import { format_log_line, should_exclude } from "agent-tail-core";
9
9
  * export { POST } from "next-plugin-browser-logs/handler"
10
10
  */
11
11
  async function POST(request) {
12
- const log_path = process.env.__BROWSER_LOGS_PATH;
12
+ const log_path = process.env.AGENT_TAIL_LOG_PATH;
13
13
  if (!log_path) return new Response("Browser logs not configured", { status: 500 });
14
14
  try {
15
- const excludes = JSON.parse(process.env.__BROWSER_LOGS_EXCLUDES || "[]");
15
+ const excludes = JSON.parse(process.env.AGENT_TAIL_EXCLUDES || "[]");
16
16
  let entries = await request.json();
17
17
  if (excludes.length) entries = entries.filter((e) => !should_exclude(e.args.join(" "), excludes));
18
18
  const lines = entries.map(format_log_line).join("");
@@ -33,13 +33,13 @@ function pages_handler(req, res) {
33
33
  res.status(405).end();
34
34
  return;
35
35
  }
36
- const log_path = process.env.__BROWSER_LOGS_PATH;
36
+ const log_path = process.env.AGENT_TAIL_LOG_PATH;
37
37
  if (!log_path) {
38
38
  res.status(500).end();
39
39
  return;
40
40
  }
41
41
  try {
42
- const excludes = JSON.parse(process.env.__BROWSER_LOGS_EXCLUDES || "[]");
42
+ const excludes = JSON.parse(process.env.AGENT_TAIL_EXCLUDES || "[]");
43
43
  let entries = typeof req.body === "string" ? JSON.parse(req.body) : req.body;
44
44
  if (excludes.length) entries = entries.filter((e) => !should_exclude(e.args.join(" "), excludes));
45
45
  const lines = entries.map(format_log_line).join("");
package/dist/index.mjs CHANGED
@@ -14,19 +14,19 @@ function withAgentTail(next_config = {}, user_options) {
14
14
  const project_root = process.cwd();
15
15
  log_path = log_manager.initialize(project_root);
16
16
  }
17
- return {
17
+ const result = {
18
18
  ...next_config,
19
19
  env: {
20
20
  ...next_config.env,
21
- __BROWSER_LOGS_ENDPOINT: options.endpoint,
22
- __BROWSER_LOGS_PATH: log_path,
23
- __BROWSER_LOGS_EXCLUDES: JSON.stringify(options.excludes)
24
- },
25
- webpack(config, context) {
26
- if (typeof next_config.webpack === "function") config = next_config.webpack(config, context);
27
- return config;
21
+ AGENT_TAIL_ENDPOINT: options.endpoint,
22
+ AGENT_TAIL_LOG_PATH: log_path,
23
+ AGENT_TAIL_EXCLUDES: JSON.stringify(options.excludes)
28
24
  }
29
25
  };
26
+ if (typeof next_config.webpack === "function") result.webpack = (config, context) => {
27
+ return next_config.webpack(config, context);
28
+ };
29
+ return result;
30
30
  }
31
31
 
32
32
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "next-plugin-agent-tail",
3
3
  "type": "module",
4
- "version": "0.3.6",
4
+ "version": "0.3.8",
5
5
  "description": "Next.js plugin for agent-tail — pipes browser console logs to files on disk during development.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -38,13 +38,13 @@
38
38
  "README.md"
39
39
  ],
40
40
  "dependencies": {
41
- "agent-tail-core": "^0.3.6"
41
+ "agent-tail-core": "^0.3.8"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "next": ">=13.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "next": "^15.0.0",
47
+ "next": "^16.0.0",
48
48
  "tsdown": "^0.18.1",
49
49
  "react": "^19.0.0",
50
50
  "@types/react": "^19.0.0"