next-plugin-agent-tail 0.3.1 → 0.3.3
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 +1 -1
- package/dist/index.mjs +9 -3
- package/package.json +2 -2
package/dist/handler.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { AgentTailScript } from "./script.mjs";
|
|
2
2
|
import { POST, pages_handler } from "./handler.mjs";
|
|
3
|
-
import
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { DEFAULT_OPTIONS, LogManager, SESSION_ENV_VAR, resolve_options } from "agent-tail-core";
|
|
4
5
|
|
|
5
6
|
//#region src/with-browser-logs.ts
|
|
6
7
|
function withAgentTail(next_config = {}, user_options) {
|
|
7
8
|
const options = resolve_options(user_options);
|
|
8
9
|
const log_manager = new LogManager(options);
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const parent_session = process.env[SESSION_ENV_VAR];
|
|
11
|
+
let log_path;
|
|
12
|
+
if (parent_session && fs.existsSync(parent_session)) log_path = log_manager.join_session(parent_session);
|
|
13
|
+
else {
|
|
14
|
+
const project_root = process.cwd();
|
|
15
|
+
log_path = log_manager.initialize(project_root);
|
|
16
|
+
}
|
|
11
17
|
return {
|
|
12
18
|
...next_config,
|
|
13
19
|
env: {
|
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.
|
|
4
|
+
"version": "0.3.3",
|
|
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,7 +38,7 @@
|
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"agent-tail-core": "^0.3.
|
|
41
|
+
"agent-tail-core": "^0.3.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"next": ">=13.0.0"
|