vite-plugin-agent-tail 0.0.1 → 0.1.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 +47 -0
- package/package.json +13 -4
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# vite-plugin-agent-tail
|
|
2
|
+
|
|
3
|
+
Vite plugin for [agent-tail](https://agent-tail.vercel.app/) — captures browser `console.log`, `console.warn`, `console.error`, unhandled errors, and unhandled promise rejections to log files on disk during development.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D vite-plugin-agent-tail
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// vite.config.ts
|
|
15
|
+
import { defineConfig } from "vite"
|
|
16
|
+
import { browser_logs } from "vite-plugin-agent-tail"
|
|
17
|
+
|
|
18
|
+
export default defineConfig({
|
|
19
|
+
plugins: [browser_logs()],
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then in another terminal:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
tail -f tmp/logs/latest/browser.log
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## How it works
|
|
30
|
+
|
|
31
|
+
The plugin injects a small script into your HTML that intercepts console methods, batches the output, and sends it to the dev server via `sendBeacon`. Logs are written to a timestamped session directory with a `latest` symlink for easy access.
|
|
32
|
+
|
|
33
|
+
## Pair with the CLI
|
|
34
|
+
|
|
35
|
+
Use both the plugin and the CLI to get browser console logs *and* server output in one place:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx agent-tail-core run 'fe: npm run dev' 'api: uvicorn main:app'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Docs
|
|
42
|
+
|
|
43
|
+
Full documentation and configuration options at **[agent-tail.vercel.app](https://agent-tail.vercel.app/)**
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-agent-tail",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"description": "Vite plugin for agent-tail — pipes browser console logs to files on disk during development.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/gillkyle/agent-tail",
|
|
9
|
+
"url": "git+https://github.com/gillkyle/agent-tail.git",
|
|
10
10
|
"directory": "packages/vite-plugin"
|
|
11
11
|
},
|
|
12
12
|
"author": "Kyle Gill",
|
|
13
|
-
"keywords": [
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vite",
|
|
15
|
+
"vite-plugin",
|
|
16
|
+
"browser-logs",
|
|
17
|
+
"console",
|
|
18
|
+
"logging"
|
|
19
|
+
],
|
|
14
20
|
"exports": {
|
|
15
21
|
".": {
|
|
16
22
|
"import": "./dist/index.mjs",
|
|
@@ -19,7 +25,10 @@
|
|
|
19
25
|
},
|
|
20
26
|
"main": "./dist/index.mjs",
|
|
21
27
|
"types": "./dist/index.d.mts",
|
|
22
|
-
"files": [
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
23
32
|
"scripts": {
|
|
24
33
|
"build": "tsdown",
|
|
25
34
|
"typecheck": "tsc --noEmit"
|