@browdacode/adonisjs-debugbar 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +187 -2
- package/build/configure.d.ts +3 -0
- package/build/configure.d.ts.map +1 -0
- package/build/configure.js +14 -0
- package/build/configure.js.map +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +9 -0
- package/build/index.js.map +1 -0
- package/build/providers/debugbar_provider.d.ts +14 -0
- package/build/providers/debugbar_provider.d.ts.map +1 -0
- package/build/providers/debugbar_provider.js +177 -0
- package/build/providers/debugbar_provider.js.map +1 -0
- package/build/services/debugbar.d.ts +4 -0
- package/build/services/debugbar.d.ts.map +1 -0
- package/build/services/debugbar.js +7 -0
- package/build/services/debugbar.js.map +1 -0
- package/build/src/collectors/context_collectors.d.ts +21 -0
- package/build/src/collectors/context_collectors.d.ts.map +1 -0
- package/build/src/collectors/context_collectors.js +183 -0
- package/build/src/collectors/context_collectors.js.map +1 -0
- package/build/src/config.d.ts +8 -0
- package/build/src/config.d.ts.map +1 -0
- package/build/src/config.js +51 -0
- package/build/src/config.js.map +1 -0
- package/build/src/context/request_tracker.d.ts +34 -0
- package/build/src/context/request_tracker.d.ts.map +1 -0
- package/build/src/context/request_tracker.js +21 -0
- package/build/src/context/request_tracker.js.map +1 -0
- package/build/src/debugbar.d.ts +105 -0
- package/build/src/debugbar.d.ts.map +1 -0
- package/build/src/debugbar.js +606 -0
- package/build/src/debugbar.js.map +1 -0
- package/build/src/hooks/runtime_hooks.d.ts +37 -0
- package/build/src/hooks/runtime_hooks.d.ts.map +1 -0
- package/build/src/hooks/runtime_hooks.js +279 -0
- package/build/src/hooks/runtime_hooks.js.map +1 -0
- package/build/src/middleware/debugbar_middleware.d.ts +10 -0
- package/build/src/middleware/debugbar_middleware.d.ts.map +1 -0
- package/build/src/middleware/debugbar_middleware.js +114 -0
- package/build/src/middleware/debugbar_middleware.js.map +1 -0
- package/build/src/storage/file_storage.d.ts +21 -0
- package/build/src/storage/file_storage.d.ts.map +1 -0
- package/build/src/storage/file_storage.js +102 -0
- package/build/src/storage/file_storage.js.map +1 -0
- package/build/src/storage/memory_storage.d.ts +19 -0
- package/build/src/storage/memory_storage.d.ts.map +1 -0
- package/build/src/storage/memory_storage.js +75 -0
- package/build/src/storage/memory_storage.js.map +1 -0
- package/build/src/types.d.ts +282 -0
- package/build/src/types.d.ts.map +1 -0
- package/build/src/types.js +2 -0
- package/build/src/types.js.map +1 -0
- package/build/src/ui/render_script.d.ts +10 -0
- package/build/src/ui/render_script.d.ts.map +1 -0
- package/build/src/ui/render_script.js +990 -0
- package/build/src/ui/render_script.js.map +1 -0
- package/build/src/ui/styles.d.ts +5 -0
- package/build/src/ui/styles.d.ts.map +1 -0
- package/build/src/ui/styles.js +540 -0
- package/build/src/ui/styles.js.map +1 -0
- package/build/src/utils/mask.d.ts +19 -0
- package/build/src/utils/mask.d.ts.map +1 -0
- package/build/src/utils/mask.js +155 -0
- package/build/src/utils/mask.js.map +1 -0
- package/build/stubs/config/debugbar.stub +49 -0
- package/build/stubs/main.d.ts +2 -0
- package/build/stubs/main.d.ts.map +1 -0
- package/build/stubs/main.js +4 -0
- package/build/stubs/main.js.map +1 -0
- package/build/tests/debugbar.test.d.ts +2 -0
- package/build/tests/debugbar.test.d.ts.map +1 -0
- package/build/tests/debugbar.test.js +521 -0
- package/build/tests/debugbar.test.js.map +1 -0
- package/package.json +80 -4
- package/stubs/config/debugbar.stub +49 -0
- package/stubs/main.ts +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Houssam OUATMANI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,188 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @browdacode/adonisjs-debugbar
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A **Nuxt DevTools-inspired**, **AdonisJS-branded** debug bar & full-page profiler for **AdonisJS 7**, built with **JetBrains Mono** (contextual ligatures enabled), Shadow DOM isolation, and Symfony Profiler-grade collectors.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Nuxt-style Floating Pill & Resizable Drawer** — Official AdonisJS branding (`#5943FF` / `#0D0D10`), Dark & Light themes with `localStorage` persistence, and Shadow DOM isolation.
|
|
10
|
+
- **JetBrains Mono with Active Ligatures** — `font-variant-ligatures: contextual common-ligatures` and `font-feature-settings: "liga" 1, "calt" 1`.
|
|
11
|
+
- **Standalone Profiler (`/__debugbar`)** — Full-screen profiler dashboard for inspecting HTML, API, XHR, and background requests.
|
|
12
|
+
- **Real-time SSE Live Stream (`/__debugbar/api/stream`)** — Incoming `fetch` / API / webhook requests appear live in the history dropdown with a `LIVE` indicator.
|
|
13
|
+
- **Redirect Tracking (`302` → `GET`)** — Automatically links `3xx` redirects to the subsequent `GET` request with a one-click **Inspect Previous Request** banner.
|
|
14
|
+
- **SQL / Lucid Collector** — Captures `db:query` events, bindings, duration, application caller stack frame, slow-query warnings, **N+1 / duplicate detection**, **Copy w/ Bindings**, and live **`EXPLAIN`** plans.
|
|
15
|
+
- **Edge.js & Inertia.js Collector** — Tracks rendered views, layouts (`@layouts.*`), components (`@form`, `@!button`, etc.), partials, render duration, and explicit template state.
|
|
16
|
+
- **Validation Errors Collector** — Captures VineJS `E_VALIDATION_ERROR` exceptions and `session.flashMessages` (`inputErrorsBag` / `errorsBag` / `errors`) without masking validation messages.
|
|
17
|
+
- **Auth & Session** — Guard, authenticated user, session ID/driver, session values, flash messages, and cookies.
|
|
18
|
+
- **Logs & Events** — Automatically hooks Pino (`ctx.logger` & `logger`) and `@adonisjs/events` (`emitter.onAny`, including class-based `Event.dispatch()`).
|
|
19
|
+
- **Mail, Cache, Redis & Drive** — Captures outgoing emails (`mail:sending` / `mail:sent`), cache hits/misses/hit-ratio, Redis commands, and Drive operations.
|
|
20
|
+
- **Timeline Waterfall** — Visual breakdown of SQL queries, view renders, and custom `startMeasure` / `stopMeasure` spans.
|
|
21
|
+
- **Routes & Exceptions** — Searchable AdonisJS route table (current route highlighted) and full exception stack traces.
|
|
22
|
+
- **Optional File Persistence (`FileStorage`)** — Persist request profiles in JSONL across dev server restarts.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- **Node.js** `>= 24.0.0`
|
|
29
|
+
- **AdonisJS** `^7.0.0` (`@adonisjs/core`)
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @browdacode/adonisjs-debugbar
|
|
37
|
+
node ace configure @browdacode/adonisjs-debugbar
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Running `node ace configure @browdacode/adonisjs-debugbar` automatically:
|
|
41
|
+
1. Publishes `config/debugbar.ts`
|
|
42
|
+
2. Registers `@browdacode/adonisjs-debugbar/debugbar_provider` in `adonisrc.ts`
|
|
43
|
+
3. Registers `@browdacode/adonisjs-debugbar/debugbar_middleware` in `start/kernel.ts`
|
|
44
|
+
|
|
45
|
+
### Manual Setup (if needed)
|
|
46
|
+
|
|
47
|
+
In `adonisrc.ts`:
|
|
48
|
+
```ts
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
providers: [
|
|
51
|
+
// ...
|
|
52
|
+
() => import('@browdacode/adonisjs-debugbar/debugbar_provider'),
|
|
53
|
+
],
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
In `start/kernel.ts`:
|
|
58
|
+
```ts
|
|
59
|
+
router.use([
|
|
60
|
+
// ...
|
|
61
|
+
() => import('@browdacode/adonisjs-debugbar/debugbar_middleware'),
|
|
62
|
+
])
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Enable Lucid SQL Queries
|
|
66
|
+
|
|
67
|
+
For `@adonisjs/lucid` to emit `db:query` events, ensure `debug: app.inDev` is enabled in `config/database.ts`:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
connections: {
|
|
71
|
+
postgres: {
|
|
72
|
+
client: 'pg',
|
|
73
|
+
connection: { /* ... */ },
|
|
74
|
+
debug: app.inDev,
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Configuration (`config/debugbar.ts`)
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import app from '@adonisjs/core/services/app'
|
|
85
|
+
import { defineConfig } from '@browdacode/adonisjs-debugbar'
|
|
86
|
+
|
|
87
|
+
export default defineConfig({
|
|
88
|
+
enabled: app.inDev,
|
|
89
|
+
routePrefix: '/__debugbar',
|
|
90
|
+
maxRequests: 50,
|
|
91
|
+
slowQueryThresholdMs: 100,
|
|
92
|
+
detectDuplicateQueries: true,
|
|
93
|
+
injectHtml: true,
|
|
94
|
+
storage: 'memory', // 'memory' | 'file'
|
|
95
|
+
storagePath: 'tmp/debugbar/requests.jsonl',
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
| Option | Type | Default | Description |
|
|
100
|
+
| --- | --- | --- | --- |
|
|
101
|
+
| `enabled` | `boolean` | `app.inDev` | Enables/disables the debugbar and its routes. |
|
|
102
|
+
| `routePrefix` | `string` | `'/__debugbar'` | Base URL for the standalone profiler and API endpoints. |
|
|
103
|
+
| `maxRequests` | `number` | `50` | Maximum number of request profiles retained. |
|
|
104
|
+
| `slowQueryThresholdMs` | `number` | `100` | Threshold (ms) above which SQL queries are flagged `SLOW`. |
|
|
105
|
+
| `detectDuplicateQueries` | `boolean` | `true` | Detects repeated normalized SQL queries (N+1). |
|
|
106
|
+
| `maskKeys` | `string[]` | `DEFAULT_MASK_KEYS` | Keys masked as `********` in headers, body, session, auth, and logs. |
|
|
107
|
+
| `ignorePaths` | `(string \| RegExp)[]` | `DEFAULT_IGNORE_PATHS` | Paths excluded from profiling (assets, Vite HMR, `/__debugbar`). |
|
|
108
|
+
| `captureLogs` | `boolean` | `true` | Captures Pino logs (`ctx.logger` / `logger`). |
|
|
109
|
+
| `captureSql` | `boolean` | `true` | Captures Lucid `db:query` events. |
|
|
110
|
+
| `captureEvents` | `boolean` | `true` | Captures AdonisJS emitter events. |
|
|
111
|
+
| `injectHtml` | `boolean` | `true` | Injects the Web Component UI into `text/html` responses. |
|
|
112
|
+
| `storage` | `'memory' \| 'file'` | `'memory'` | Storage backend (`'file'` persists profiles as JSONL). |
|
|
113
|
+
| `storagePath` | `string` | `'tmp/debugbar/requests.jsonl'` | File path used when `storage: 'file'`. |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Programmatic API
|
|
118
|
+
|
|
119
|
+
Import the `debugbar` service anywhere in your AdonisJS 7 application:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import debugbar from '@browdacode/adonisjs-debugbar/services/debugbar'
|
|
123
|
+
|
|
124
|
+
// Custom logs
|
|
125
|
+
debugbar.info('Checkout started', { cartId: 42 })
|
|
126
|
+
debugbar.warn('Inventory low', { sku: 'ABC-123' })
|
|
127
|
+
|
|
128
|
+
// Custom timeline spans
|
|
129
|
+
debugbar.startMeasure('stripe', 'Stripe Payment Intent')
|
|
130
|
+
await stripe.paymentIntents.create(/* ... */)
|
|
131
|
+
debugbar.stopMeasure('stripe')
|
|
132
|
+
|
|
133
|
+
// Manual Cache / Drive / Validation recording (optional)
|
|
134
|
+
debugbar.recordCache('hit', 'users:page:1', 'cache', { durationMs: 1.4, store: 'redis' })
|
|
135
|
+
debugbar.recordDrive('put', 'avatars/1.png', 's3', { sizeBytes: 4096, durationMs: 12 })
|
|
136
|
+
debugbar.recordValidationErrors([{ field: 'email', rule: 'email', message: 'Invalid email' }])
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Keyboard Shortcuts
|
|
142
|
+
|
|
143
|
+
| Shortcut | Action |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| `Ctrl+Shift+D` / `Cmd+Shift+D` | Toggle the debugbar drawer |
|
|
146
|
+
| `Esc` | Close the debugbar drawer |
|
|
147
|
+
| `←` / `→` | Switch between tabs |
|
|
148
|
+
| `1` – `9` | Jump directly to tab 1–9 |
|
|
149
|
+
| `/` | Focus search input in `SQL`, `Logs`, or `Routes` |
|
|
150
|
+
| `t` | Toggle Dark / Light theme |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Endpoints
|
|
155
|
+
|
|
156
|
+
When enabled, the provider registers the following routes under `routePrefix` (default `/__debugbar`):
|
|
157
|
+
|
|
158
|
+
- `GET /__debugbar` — Standalone full-page Profiler UI
|
|
159
|
+
- `GET /__debugbar/api/requests` — List captured request summaries
|
|
160
|
+
- `GET /__debugbar/api/requests/:id` — Fetch a full `RequestProfile`
|
|
161
|
+
- `GET /__debugbar/api/stream` — Real-time Server-Sent Events (SSE) stream
|
|
162
|
+
- `GET /__debugbar/api/explain?requestId=...&queryId=...` — Execute `EXPLAIN` on a captured `SELECT` query
|
|
163
|
+
- `DELETE /__debugbar/api/requests` & `GET /__debugbar/api/clear` — Clear captured history
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Security
|
|
168
|
+
|
|
169
|
+
- Disabled by default in production (`enabled: app.inDev`).
|
|
170
|
+
- Sensitive keys (`password`, `token`, `secret`, `authorization`, `cookie`, `api_key`, `credit_card`, etc.) are recursively masked as `********` while preserving human-readable validation messages.
|
|
171
|
+
- `EXPLAIN` endpoint strictly permits `SELECT` queries only.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Publishing
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
npm run typecheck
|
|
179
|
+
npm run build
|
|
180
|
+
npm test
|
|
181
|
+
npm publish --access public
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT © 2026 **Houssam OUATMANI** — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../configure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAA;AAG9D,wBAAsB,SAAS,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { stubsRoot } from './stubs/main.js';
|
|
2
|
+
export async function configure(command) {
|
|
3
|
+
const codemods = await command.createCodemods();
|
|
4
|
+
await codemods.makeUsingStub(stubsRoot, 'config/debugbar.stub', {});
|
|
5
|
+
await codemods.updateRcFile((rcFile) => {
|
|
6
|
+
rcFile.addProvider('@browdacode/adonisjs-debugbar/debugbar_provider');
|
|
7
|
+
});
|
|
8
|
+
await codemods.registerMiddleware('router', [
|
|
9
|
+
{
|
|
10
|
+
path: '@browdacode/adonisjs-debugbar/debugbar_middleware',
|
|
11
|
+
},
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=configure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAkB;IAChD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAA;IAE/C,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,sBAAsB,EAAE,EAAE,CAAC,CAAA;IAEnE,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC,MAA+C,EAAE,EAAE;QAC9E,MAAM,CAAC,WAAW,CAAC,iDAAiD,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;IAEF,MAAM,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,EAAE;QAC1C;YACE,IAAI,EAAE,mDAAmD;SAC1D;KACF,CAAC,CAAA;AACJ,CAAC"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { configure } from './configure.js';
|
|
2
|
+
export { stubsRoot } from './stubs/main.js';
|
|
3
|
+
export { defineConfig, DEFAULT_IGNORE_PATHS, DEFAULT_MASK_KEYS } from './src/config.js';
|
|
4
|
+
export { Debugbar } from './src/debugbar.js';
|
|
5
|
+
export { MemoryStorage } from './src/storage/memory_storage.js';
|
|
6
|
+
export { FileStorage } from './src/storage/file_storage.js';
|
|
7
|
+
export { RequestTracker } from './src/context/request_tracker.js';
|
|
8
|
+
export * from './src/types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,cAAc,gBAAgB,CAAA"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { configure } from './configure.js';
|
|
2
|
+
export { stubsRoot } from './stubs/main.js';
|
|
3
|
+
export { defineConfig, DEFAULT_IGNORE_PATHS, DEFAULT_MASK_KEYS } from './src/config.js';
|
|
4
|
+
export { Debugbar } from './src/debugbar.js';
|
|
5
|
+
export { MemoryStorage } from './src/storage/memory_storage.js';
|
|
6
|
+
export { FileStorage } from './src/storage/file_storage.js';
|
|
7
|
+
export { RequestTracker } from './src/context/request_tracker.js';
|
|
8
|
+
export * from './src/types.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Debugbar } from '../src/debugbar.js';
|
|
2
|
+
declare module '@adonisjs/core/types' {
|
|
3
|
+
interface ContainerBindings {
|
|
4
|
+
debugbar: Debugbar;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export default class DebugbarProvider {
|
|
8
|
+
protected app: any;
|
|
9
|
+
constructor(app: any);
|
|
10
|
+
private get appService();
|
|
11
|
+
register(): void;
|
|
12
|
+
boot(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=debugbar_provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugbar_provider.d.ts","sourceRoot":"","sources":["../../providers/debugbar_provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAK7C,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAiB,iBAAiB;QAChC,QAAQ,EAAE,QAAQ,CAAA;KACnB;CACF;AAED,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACvB,SAAS,CAAC,GAAG,EAAE,GAAG;gBAAR,GAAG,EAAE,GAAG;IAE9B,OAAO,KAAK,UAAU,GAErB;IAED,QAAQ,IAAI,IAAI;IAWV,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAyI5B"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Debugbar } from '../src/debugbar.js';
|
|
2
|
+
import { hookEdgeInstance, hookLogger, resolveHostEdge } from '../src/hooks/runtime_hooks.js';
|
|
3
|
+
import { renderDebugbarHtml } from '../src/ui/render_script.js';
|
|
4
|
+
export default class DebugbarProvider {
|
|
5
|
+
app;
|
|
6
|
+
constructor(app) {
|
|
7
|
+
this.app = app;
|
|
8
|
+
}
|
|
9
|
+
get appService() {
|
|
10
|
+
return this.app;
|
|
11
|
+
}
|
|
12
|
+
register() {
|
|
13
|
+
this.appService.container.singleton('debugbar', () => {
|
|
14
|
+
const config = this.appService.config.get('debugbar', {});
|
|
15
|
+
const defaultEnabled = config.enabled ?? this.appService.inDev;
|
|
16
|
+
return new Debugbar({
|
|
17
|
+
...config,
|
|
18
|
+
enabled: defaultEnabled,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async boot() {
|
|
23
|
+
const debugbar = await this.appService.container.make('debugbar');
|
|
24
|
+
if (!debugbar.isEnabled()) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const emitter = await this.appService.container.make('emitter');
|
|
28
|
+
debugbar.hookEmitter(emitter);
|
|
29
|
+
try {
|
|
30
|
+
const logger = await this.appService.container.make('logger');
|
|
31
|
+
hookLogger(logger, debugbar);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Logger binding may not be present in minimal setups
|
|
35
|
+
}
|
|
36
|
+
const hostEdge = await resolveHostEdge();
|
|
37
|
+
if (hostEdge) {
|
|
38
|
+
hookEdgeInstance(hostEdge, debugbar);
|
|
39
|
+
}
|
|
40
|
+
const router = await this.appService.container.make('router');
|
|
41
|
+
const prefix = debugbar.config.routePrefix;
|
|
42
|
+
router.get(prefix, async ({ response }) => {
|
|
43
|
+
const latest = debugbar.storage.latest() ?? createEmptyProfile();
|
|
44
|
+
const snippet = renderDebugbarHtml(latest, prefix, true);
|
|
45
|
+
const html = `<!doctype html>
|
|
46
|
+
<html lang="en">
|
|
47
|
+
<head>
|
|
48
|
+
<meta charset="utf-8" />
|
|
49
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
50
|
+
<title>AdonisJS Debugbar Profiler</title>
|
|
51
|
+
<style>
|
|
52
|
+
html, body {
|
|
53
|
+
margin: 0;
|
|
54
|
+
padding: 0;
|
|
55
|
+
min-height: 100vh;
|
|
56
|
+
background: #0d0d10;
|
|
57
|
+
color: #ffffff;
|
|
58
|
+
font-family: 'JetBrains Mono', monospace;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
${snippet}
|
|
64
|
+
</body>
|
|
65
|
+
</html>`;
|
|
66
|
+
return response.type('text/html; charset=utf-8').send(html);
|
|
67
|
+
});
|
|
68
|
+
router.get(`${prefix}/api/requests`, async ({ response }) => {
|
|
69
|
+
return response.json({
|
|
70
|
+
requests: debugbar.listSummaries(),
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
router.get(`${prefix}/api/requests/:id`, async ({ params, response }) => {
|
|
74
|
+
const profile = debugbar.getProfile(params.id);
|
|
75
|
+
if (!profile) {
|
|
76
|
+
return response.notFound({ error: 'Request profile not found' });
|
|
77
|
+
}
|
|
78
|
+
return response.json(profile);
|
|
79
|
+
});
|
|
80
|
+
router.delete(`${prefix}/api/requests`, async ({ response }) => {
|
|
81
|
+
debugbar.clear();
|
|
82
|
+
return response.json({ cleared: true });
|
|
83
|
+
});
|
|
84
|
+
router.get(`${prefix}/api/clear`, async ({ response }) => {
|
|
85
|
+
debugbar.clear();
|
|
86
|
+
return response.json({ cleared: true });
|
|
87
|
+
});
|
|
88
|
+
router.get(`${prefix}/api/stream`, async ({ request, response }) => {
|
|
89
|
+
const rawRes = response.response;
|
|
90
|
+
rawRes.writeHead(200, {
|
|
91
|
+
'Content-Type': 'text/event-stream; charset=utf-8',
|
|
92
|
+
'Cache-Control': 'no-cache, no-transform',
|
|
93
|
+
Connection: 'keep-alive',
|
|
94
|
+
'X-Accel-Buffering': 'no',
|
|
95
|
+
});
|
|
96
|
+
rawRes.write(': connected\n\n');
|
|
97
|
+
const unsubscribe = debugbar.subscribe((summary) => {
|
|
98
|
+
if (!rawRes.writableEnded) {
|
|
99
|
+
rawRes.write(`event: request\ndata: ${JSON.stringify(summary)}\n\n`);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const heartbeat = setInterval(() => {
|
|
103
|
+
if (!rawRes.writableEnded) {
|
|
104
|
+
rawRes.write(': ping\n\n');
|
|
105
|
+
}
|
|
106
|
+
}, 25_000);
|
|
107
|
+
await new Promise((resolve) => {
|
|
108
|
+
request.request.on('close', () => {
|
|
109
|
+
clearInterval(heartbeat);
|
|
110
|
+
unsubscribe();
|
|
111
|
+
if (!rawRes.writableEnded)
|
|
112
|
+
rawRes.end();
|
|
113
|
+
resolve();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
router.get(`${prefix}/api/explain`, async ({ request, response }) => {
|
|
118
|
+
const { requestId, queryId } = request.qs();
|
|
119
|
+
if (!requestId || !queryId) {
|
|
120
|
+
return response.badRequest({ error: 'Missing requestId or queryId' });
|
|
121
|
+
}
|
|
122
|
+
const profile = debugbar.getProfile(String(requestId));
|
|
123
|
+
const query = profile?.sql.queries.find((q) => q.id === String(queryId));
|
|
124
|
+
if (!query) {
|
|
125
|
+
return response.notFound({ error: 'SQL query not found' });
|
|
126
|
+
}
|
|
127
|
+
if (!/^\s*select\b/i.test(query.sql)) {
|
|
128
|
+
return response.badRequest({ error: 'EXPLAIN is only supported for SELECT queries' });
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
const db = await this.appService.container.make('lucid.db');
|
|
132
|
+
const conn = typeof db?.connection === 'function' ? db.connection(query.connection) : db;
|
|
133
|
+
const result = await conn.rawQuery(`EXPLAIN ${query.sql}`, query.bindings ?? []);
|
|
134
|
+
const rows = result?.rows ?? result?.[0] ?? result;
|
|
135
|
+
return response.json({ sql: `EXPLAIN ${query.sql}`, plan: rows });
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
return response.status(500).json({
|
|
139
|
+
error: err?.message ? String(err.message) : 'Failed to execute EXPLAIN',
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function createEmptyProfile() {
|
|
146
|
+
return {
|
|
147
|
+
id: 'empty',
|
|
148
|
+
timestamp: Date.now(),
|
|
149
|
+
method: 'GET',
|
|
150
|
+
url: '/__debugbar',
|
|
151
|
+
path: '/__debugbar',
|
|
152
|
+
statusCode: 200,
|
|
153
|
+
durationMs: 0,
|
|
154
|
+
memory: process.memoryUsage(),
|
|
155
|
+
request: { headers: {}, query: {}, params: {}, body: undefined },
|
|
156
|
+
response: { headers: {} },
|
|
157
|
+
sql: { queries: [], totalDurationMs: 0, duplicateCount: 0, slowCount: 0 },
|
|
158
|
+
session: { available: false, values: {}, flashMessages: {}, cookies: {} },
|
|
159
|
+
auth: { available: false, authenticated: false },
|
|
160
|
+
logs: [],
|
|
161
|
+
timeline: [],
|
|
162
|
+
events: [],
|
|
163
|
+
routes: [],
|
|
164
|
+
views: [],
|
|
165
|
+
mails: [],
|
|
166
|
+
cache: [],
|
|
167
|
+
drive: [],
|
|
168
|
+
validation: { count: 0, source: 'none', errors: [] },
|
|
169
|
+
app: {
|
|
170
|
+
nodeVersion: process.version,
|
|
171
|
+
env: process.env.NODE_ENV ?? 'development',
|
|
172
|
+
platform: `${process.platform} (${process.arch})`,
|
|
173
|
+
uptimeSec: Math.round(process.uptime()),
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=debugbar_provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugbar_provider.js","sourceRoot":"","sources":["../../providers/debugbar_provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE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AAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;SACxC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugbar.d.ts","sourceRoot":"","sources":["../../services/debugbar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAElD,QAAA,IAAI,QAAQ,EAAE,QAAQ,CAAA;AAMtB,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugbar.js","sourceRoot":"","sources":["../../services/debugbar.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,6BAA6B,CAAA;AAG7C,IAAI,QAAkB,CAAA;AAEtB,MAAM,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;IAC1B,QAAQ,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HttpContext } from '@adonisjs/core/http';
|
|
2
|
+
import type { AuthData, DebugbarConfig, RouteInfo, SessionData, ValidationErrorEntry } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Collects session, flash messages, and cookies from HttpContext if @adonisjs/session is active.
|
|
5
|
+
*/
|
|
6
|
+
export declare function collectSession(ctx: HttpContext, config: DebugbarConfig): SessionData;
|
|
7
|
+
/**
|
|
8
|
+
* Collects authentication state and sanitized user details if @adonisjs/auth is active.
|
|
9
|
+
*/
|
|
10
|
+
export declare function collectAuth(ctx: HttpContext, config: DebugbarConfig): AuthData;
|
|
11
|
+
/**
|
|
12
|
+
* Collects registered routes from AdonisJS Router and marks the matched route.
|
|
13
|
+
*/
|
|
14
|
+
export declare function collectRoutes(router: unknown, currentPattern?: string): RouteInfo[];
|
|
15
|
+
export declare function formatHandler(handler: unknown): string;
|
|
16
|
+
/**
|
|
17
|
+
* Extracts VineJS / AdonisJS validation errors from session flashMessages
|
|
18
|
+
* (`errorsBag`, `inputErrorsBag`, `errors`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function collectFlashValidationErrors(flashMessages: Record<string, unknown>): ValidationErrorEntry[];
|
|
21
|
+
//# sourceMappingURL=context_collectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context_collectors.d.ts","sourceRoot":"","sources":["../../../src/collectors/context_collectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,WAAW,EACX,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAGpB;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,GAAG,WAAW,CAmCpF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,GAAG,QAAQ,CA6B9E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAkCnF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAWtD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,EAAE,CAmD3G"}
|