next-plugin-agent-tail 0.2.0 → 0.3.0
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/README.md +4 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/script.d.mts +6 -6
- package/dist/script.mjs +4 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,22 +12,22 @@ npm install -D next-plugin-agent-tail
|
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
// next.config.ts
|
|
15
|
-
import {
|
|
15
|
+
import { withAgentTail } from "next-plugin-agent-tail"
|
|
16
16
|
|
|
17
|
-
export default
|
|
17
|
+
export default withAgentTail({
|
|
18
18
|
// your Next.js config
|
|
19
19
|
})
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
23
|
// app/layout.tsx
|
|
24
|
-
import {
|
|
24
|
+
import { AgentTailScript } from "next-plugin-agent-tail/script"
|
|
25
25
|
|
|
26
26
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
27
27
|
return (
|
|
28
28
|
<html>
|
|
29
29
|
<head>
|
|
30
|
-
{process.env.NODE_ENV === "development" && <
|
|
30
|
+
{process.env.NODE_ENV === "development" && <AgentTailScript />}
|
|
31
31
|
</head>
|
|
32
32
|
<body>{children}</body>
|
|
33
33
|
</html>
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { POST, pages_handler } from "./handler.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { AgentTailScript } from "./script.mjs";
|
|
3
3
|
import { BrowserLogsOptions, BrowserLogsOptions as BrowserLogsOptions$1, DEFAULT_OPTIONS, LogEntry, ResolvedOptions } from "agent-tail-core";
|
|
4
4
|
|
|
5
5
|
//#region src/with-browser-logs.d.ts
|
|
@@ -8,6 +8,6 @@ interface NextConfig {
|
|
|
8
8
|
webpack?: (config: any, context: any) => any;
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
}
|
|
11
|
-
declare function
|
|
11
|
+
declare function withAgentTail(next_config?: NextConfig, user_options?: BrowserLogsOptions$1): NextConfig;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { type BrowserLogsOptions,
|
|
13
|
+
export { AgentTailScript, type BrowserLogsOptions, DEFAULT_OPTIONS, type LogEntry, POST, type ResolvedOptions, pages_handler, withAgentTail };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentTailScript } from "./script.mjs";
|
|
2
2
|
import { POST, pages_handler } from "./handler.mjs";
|
|
3
3
|
import { DEFAULT_OPTIONS, LogManager, resolve_options } from "agent-tail-core";
|
|
4
4
|
|
|
5
5
|
//#region src/with-browser-logs.ts
|
|
6
|
-
function
|
|
6
|
+
function withAgentTail(next_config = {}, user_options) {
|
|
7
7
|
const options = resolve_options(user_options);
|
|
8
8
|
const log_manager = new LogManager(options);
|
|
9
9
|
const project_root = process.cwd();
|
|
@@ -24,4 +24,4 @@ function with_browser_logs(next_config = {}, user_options) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
export {
|
|
27
|
+
export { AgentTailScript, DEFAULT_OPTIONS, POST, pages_handler, withAgentTail };
|
package/dist/script.d.mts
CHANGED
|
@@ -2,28 +2,28 @@ import { BrowserLogsOptions } from "agent-tail-core";
|
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/script.d.ts
|
|
5
|
-
interface
|
|
5
|
+
interface AgentTailScriptProps {
|
|
6
6
|
options?: BrowserLogsOptions;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* React component that injects the browser log capture script.
|
|
10
10
|
*
|
|
11
11
|
* Usage in app/layout.tsx:
|
|
12
|
-
* import {
|
|
12
|
+
* import { AgentTailScript } from "next-plugin-agent-tail/script"
|
|
13
13
|
*
|
|
14
14
|
* export default function RootLayout({ children }) {
|
|
15
15
|
* return (
|
|
16
16
|
* <html>
|
|
17
17
|
* <head>
|
|
18
|
-
* {process.env.NODE_ENV === "development" && <
|
|
18
|
+
* {process.env.NODE_ENV === "development" && <AgentTailScript />}
|
|
19
19
|
* </head>
|
|
20
20
|
* <body>{children}</body>
|
|
21
21
|
* </html>
|
|
22
22
|
* )
|
|
23
23
|
* }
|
|
24
24
|
*/
|
|
25
|
-
declare function
|
|
25
|
+
declare function AgentTailScript({
|
|
26
26
|
options: user_options
|
|
27
|
-
}?:
|
|
27
|
+
}?: AgentTailScriptProps): react_jsx_runtime0.JSX.Element;
|
|
28
28
|
//#endregion
|
|
29
|
-
export {
|
|
29
|
+
export { AgentTailScript };
|
package/dist/script.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { generate_client_script, resolve_options } from "agent-tail-core";
|
|
2
|
-
import "react";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
|
|
5
4
|
//#region src/script.tsx
|
|
@@ -7,20 +6,20 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
6
|
* React component that injects the browser log capture script.
|
|
8
7
|
*
|
|
9
8
|
* Usage in app/layout.tsx:
|
|
10
|
-
* import {
|
|
9
|
+
* import { AgentTailScript } from "next-plugin-agent-tail/script"
|
|
11
10
|
*
|
|
12
11
|
* export default function RootLayout({ children }) {
|
|
13
12
|
* return (
|
|
14
13
|
* <html>
|
|
15
14
|
* <head>
|
|
16
|
-
* {process.env.NODE_ENV === "development" && <
|
|
15
|
+
* {process.env.NODE_ENV === "development" && <AgentTailScript />}
|
|
17
16
|
* </head>
|
|
18
17
|
* <body>{children}</body>
|
|
19
18
|
* </html>
|
|
20
19
|
* )
|
|
21
20
|
* }
|
|
22
21
|
*/
|
|
23
|
-
function
|
|
22
|
+
function AgentTailScript({ options: user_options } = {}) {
|
|
24
23
|
return /* @__PURE__ */ jsx("script", {
|
|
25
24
|
dangerouslySetInnerHTML: { __html: generate_client_script(resolve_options(user_options)) },
|
|
26
25
|
suppressHydrationWarning: true
|
|
@@ -28,4 +27,4 @@ function BrowserLogsScript({ options: user_options } = {}) {
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
//#endregion
|
|
31
|
-
export {
|
|
30
|
+
export { AgentTailScript };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-plugin-agent-tail",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
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.
|
|
41
|
+
"agent-tail-core": "^0.3.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"next": ">=13.0.0"
|