codetraxis 1.0.1 โ†’ 1.0.2

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 CHANGED
@@ -14,33 +14,19 @@ Open **http://localhost:3333** โ€” that's it.
14
14
 
15
15
  ---
16
16
 
17
- ## Why codetraxis?
17
+ ## ๐Ÿš€ Features
18
18
 
19
- | Problem | codetraxis |
20
- |---|---|
21
- | Switching between DevTools tabs | Everything in one UI |
22
- | Console logs disappearing on refresh | Persistent timeline |
23
- | Can't track full request lifecycle | Request + response + headers + duration |
24
- | No file tree in DevTools | Built-in live project explorer |
25
- | Hard to debug React Native / Expo | Works over WebSocket โ€” no browser required |
26
-
27
- ---
28
-
29
- ## Features
30
-
31
- | | Feature | Description |
32
- |---|---|---|
33
- | ๐Ÿ“ | **Live file tree** | Browse your project in real time โ€” respects `.gitignore` |
34
- | ๐Ÿงพ | **Code viewer** | Monaco-based syntax-highlighted file viewer |
35
- | ๐ŸŒ | **Network inspector** | `fetch` / `axios` / `XHR` โ€” method, URL, status, body, headers, duration |
36
- | ๐Ÿง  | **Console timeline** | `log` / `info` / `warn` / `error` โ€” persistent, in order |
37
- | โšก | **Real-time updates** | File changes pushed via WebSocket โ€” no refresh needed |
38
- | ๐Ÿ”Œ | **Any project** | React, React Native, Next.js, Expo, Vite, CRA, plain Node |
39
- | ๐Ÿ”’ | **100% local** | Bound to `127.0.0.1` โ€” no data ever leaves your machine |
19
+ * ๐Ÿ“ **Live file tree**: Browse your project in real time โ€” respects `.gitignore`.
20
+ * ๐Ÿงพ **Code viewer**: Monaco-based syntax-highlighted file viewer.
21
+ * ๐ŸŒ **Network inspector**: `fetch` / `axios` / `XHR` โ€” method, URL, status, body, headers, duration.
22
+ * ๐Ÿง  **Console timeline**: `log` / `info` / `warn` / `error` โ€” persistent, in order.
23
+ * โšก **Real-time updates**: File changes pushed via WebSocket โ€” no refresh needed.
24
+ * ๐Ÿ”Œ **Any project**: React, React Native, Next.js, Expo, Vite, CRA, plain Node.
25
+ * ๐Ÿ”’ **100% local**: Bound to `127.0.0.1` โ€” no data ever leaves your machine.
40
26
 
41
27
  ---
42
28
 
43
- ## Quick start
29
+ ## ๐Ÿ“ฆ Quick start
44
30
 
45
31
  ```bash
46
32
  # No install needed
@@ -50,66 +36,24 @@ npx codetraxis .
50
36
  npm install -g codetraxis
51
37
  codetraxis .
52
38
 
53
- # Point at a specific project
39
+ # Specific project
54
40
  codetraxis ~/projects/my-app
55
41
 
56
42
  # Custom port
57
43
  PORT=4000 codetraxis .
58
44
  ```
59
45
 
60
- Opens **`http://localhost:3333`** automatically.
61
-
62
- ---
63
-
64
- ## How it works
65
-
66
- ```
67
- Your App (React / React Native / Next.js / Expo / etc.)
68
- โ”‚
69
- โ”‚ codetraxisAgent โ† auto-injected into your entry file
70
- โ”‚ intercepts: console.* ยท fetch ยท axios ยท XMLHttpRequest
71
- โ”‚ sends events over WebSocket
72
- โ–ผ
73
- codetraxis server (Express + WS, 127.0.0.1:3333)
74
- โ”‚ serves the browser UI as static files
75
- โ”‚ exposes REST API + WebSocket endpoints
76
- โ”‚ watches your project for file changes
77
- โ–ผ
78
- Browser โ†’ http://localhost:3333
79
- file tree ยท code viewer ยท network inspector ยท console timeline
80
- ```
81
-
82
- ---
83
-
84
- ## CLI flags
85
-
86
- | Flag | Description |
87
- |---|---|
88
- | `[path]` | Target project directory (default: current dir) |
89
- | `--dev` | Dev mode โ€” starts `ts-node-dev` + Vite dev server separately |
90
- | `--help` | Show usage |
91
- | `PORT=XXXX` | Override default port `3333` via env var |
92
-
93
- If port `3333` is busy, codetraxis automatically finds the next available port.
94
-
95
- If `server/dist` is missing, codetraxis runs `npm run build` automatically before starting.
96
-
97
46
  ---
98
47
 
99
- ## Debug Agent
100
-
101
- Click **Install Agent** in the UI โ€” codetraxis automatically injects a lightweight agent into your project's entry file.
48
+ ## ๐Ÿ›  How it works
102
49
 
103
- The agent intercepts:
104
- - `console.log / info / warn / error`
105
- - `fetch` (web & React Native)
106
- - `XMLHttpRequest` (axios / RN networking)
107
-
108
- All events are sent over WebSocket and shown in real time.
50
+ 1. **Start the server**: Run `codetraxis` in your terminal. It spins up a local UI on port 3333.
51
+ 2. **Install the Agent**: Click **Install Agent** in the UI. A lightweight agent (`codetraxisAgent`) is safely injected into your project's entry file.
52
+ 3. **Debug**: The agent intercepts `console.*`, `fetch`, and `XMLHttpRequest` and sends events via WebSocket directly to your codetraxis dashboard.
109
53
 
110
54
  **Manual axios attachment** (for `axios.create()` instances):
111
55
 
112
- ```ts
56
+ ```typescript
113
57
  import { attachAxios } from "./codetraxisAgent";
114
58
 
115
59
  attachAxios(myAxiosInstance);
@@ -117,128 +61,31 @@ attachAxios(myAxiosInstance);
117
61
 
118
62
  ---
119
63
 
120
- ## Debug event types
121
-
122
- ```
123
- ConsoleEvent { type: "console", level: "log"|"info"|"warn"|"error", args[] }
124
- NetworkEvent { type: "network", transport: "fetch"|"xhr"|"axios",
125
- method, url, status, requestBody, responseBody, headers,
126
- duration, state: "pending"|"success"|"error" }
127
- ```
128
-
129
- ---
130
-
131
- ## WebSocket endpoints
132
-
133
- | Path | Purpose |
134
- |---|---|
135
- | `/agent` | Target app agent sends events here |
136
- | `/debug` | Browser viewer receives relayed events |
137
- | `/ws` | File watcher โ€” `tree_changed` / `file_changed` |
138
-
139
- ---
140
-
141
- ## Security
142
-
143
- codetraxis runs **fully locally** โ€” no data ever leaves your machine.
64
+ ## โš™๏ธ CLI Flags
144
65
 
145
- | What | Detail |
146
- |---|---|
147
- | Server bind | `127.0.0.1` only โ€” not reachable from other machines |
148
- | CORS | Localhost origins only โ€” external origins are blocked |
149
- | File access | Only within the directory you pass as argument |
150
- | On install | Nothing runs โ€” no `postinstall` script |
151
- | Telemetry | None. Zero. |
152
-
153
- ---
154
-
155
- ## Common issues
156
-
157
- | Issue | Fix |
66
+ | Flag | Description |
158
67
  |---|---|
159
- | White screen in browser | Run `npm run build` โ€” `client/dist` is missing |
160
- | `Cannot find module server/dist/index.js` | Run `npm run build` first |
161
- | Port already in use | codetraxis auto-picks the next free port |
162
- | Permission denied on CLI | `chmod +x bin/cli.js` |
68
+ | `[path]` | Target project directory (default: current dir) |
69
+ | `--dev` | Dev mode โ€” starts `ts-node-dev` + Vite dev server separately |
70
+ | `--help` | Show usage |
71
+ | `PORT=XXXX` | Override default port `3333` via env var |
163
72
 
164
73
  ---
165
74
 
166
- ## Build & develop
167
-
168
- ```bash
169
- # Build everything (server TS โ†’ JS + Vite โ†’ static)
170
- npm run build
171
-
172
- # Test locally as a real user would
173
- npm link
174
- codetraxis /path/to/some-project
75
+ ## ๐Ÿ”’ Security
175
76
 
176
- # Check what gets published
177
- npm pack --dry-run
178
-
179
- # Publish
180
- npm publish
181
- ```
182
-
183
- ### What gets published
184
-
185
- ```
186
- bin/ โ† CLI entry point
187
- server/dist/ โ† Compiled server JS
188
- client/dist/ โ† Built React app (static)
189
- ```
190
-
191
- Source files (`src/`, `tsconfig`, `.env`, `node_modules`) are **never** included.
77
+ codetraxis runs fully locally.
78
+ * **Server bind**: `127.0.0.1` only. Not reachable from external networks.
79
+ * **File access**: Restricted to the target directory.
80
+ * **Telemetry**: Zero. No data is collected or sent anywhere.
192
81
 
193
82
  ---
194
83
 
195
- ## Project structure
84
+ ## โ“ Common issues
196
85
 
197
- ```
198
- bin/
199
- cli.js โ† CLI entry point
200
-
201
- server/src/
202
- index.ts โ† HTTP server, routes, serves client/dist, starts watcher
203
- routes/
204
- tree.route.ts โ† GET /api/tree
205
- file.route.ts โ† GET /api/file
206
- agent.route.ts โ† POST/DELETE /api/agent
207
- utils/
208
- agent/
209
- agentInstaller.ts โ† Detects project type, injects codetraxisAgent
210
- debugHub.ts โ† WS relay: /agent (target) โ†” /debug (viewer)
211
- watcher/
212
- watcherService.ts โ† chokidar โ†’ broadcasts tree_changed / file_changed
213
- gitignoreWatcher.ts โ† Reloads .gitignore rules on change
214
- file/
215
- buildTree.ts โ† File tree JSON, respects .gitignore
216
- gitignoreLoader.ts โ† Parses .gitignore patterns
217
- git/
218
- getGitStatus.ts โ† Git status decorations
219
-
220
- client/src/
221
- pages/home/Home.tsx โ† Root layout
222
- components/home/
223
- leftMenu/ โ† Icon sidebar
224
- leftContentTree/ โ† File tree panel
225
- fileViewer/ โ† Monaco code viewer + preview
226
- debugPanel/ โ† Network & console timeline
227
- components/
228
- TypesPanel/ โ† Generate TS interfaces from JSON responses
229
- NetworkExpanded/ โ† Expanded network event view
230
- ConsoleExpanded/ โ† Expanded console event view
231
- topMenu/ โ† Project path + agent controls
232
- addAgentModal/ โ† Agent install modal
233
- removeAgentModal/ โ† Agent uninstall modal
234
- redux/
235
- treeSlice/ โ† File tree state
236
- fileSlice/ โ† Open file state
237
- debugSlice/ โ† Debug events (max 500, upsert by id)
238
- hooks/
239
- useDebugSocket.ts โ† ws://host/debug โ†’ Redux
240
- useProjectWatcher.ts โ† ws://host/ws โ†’ reload tree
241
- ```
86
+ * **White screen in browser?** Ensure you are running the latest version.
87
+ * **Port already in use?** codetraxis will automatically pick the next available port.
88
+ * **Permission denied?** Run `chmod +x bin/cli.js`.
242
89
 
243
90
  ---
244
91