bugg-lens-nestjs 0.2.0 → 0.2.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bugg-lens.module.d.ts","sourceRoot":"","sources":["../bugg-lens.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AAKxD,eAAO,MAAM,iBAAiB,eAA8B,CAAA;AAE5D,
|
|
1
|
+
{"version":3,"file":"bugg-lens.module.d.ts","sourceRoot":"","sources":["../bugg-lens.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AAKxD,eAAO,MAAM,iBAAiB,eAA8B,CAAA;AAE5D,qBAGa,cAAc;IACvB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa;CAmB3D"}
|
package/dist/bugg-lens.module.js
CHANGED
|
@@ -29,7 +29,6 @@ let BuggLensModule = BuggLensModule_1 = class BuggLensModule {
|
|
|
29
29
|
},
|
|
30
30
|
bugg_lens_1.BuggLens
|
|
31
31
|
],
|
|
32
|
-
controllers: [bugg_lens_controller_1.BuggLensController],
|
|
33
32
|
exports: [bugg_lens_1.BuggLens],
|
|
34
33
|
global: true,
|
|
35
34
|
};
|
|
@@ -37,6 +36,8 @@ let BuggLensModule = BuggLensModule_1 = class BuggLensModule {
|
|
|
37
36
|
};
|
|
38
37
|
exports.BuggLensModule = BuggLensModule;
|
|
39
38
|
exports.BuggLensModule = BuggLensModule = BuggLensModule_1 = __decorate([
|
|
40
|
-
(0, common_1.Module)({
|
|
39
|
+
(0, common_1.Module)({
|
|
40
|
+
controllers: [bugg_lens_controller_1.BuggLensController]
|
|
41
|
+
})
|
|
41
42
|
], BuggLensModule);
|
|
42
43
|
//# sourceMappingURL=bugg-lens.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bugg-lens.module.js","sourceRoot":"","sources":["../bugg-lens.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAGwB;AACxB,2CAAwD;AACxD,uCAA8C;AAC9C,mEAA8D;AAC9D,iEAA4D;AAE/C,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"bugg-lens.module.js","sourceRoot":"","sources":["../bugg-lens.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAGwB;AACxB,2CAAwD;AACxD,uCAA8C;AAC9C,mEAA8D;AAC9D,iEAA4D;AAE/C,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAKrD,IAAM,cAAc,sBAApB,MAAM,cAAc;IACvB,MAAM,CAAC,QAAQ,CAAC,OAAwB;QAEpC,OAAO;YACH,MAAM,EAAE,gBAAc;YACtB,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,yBAAiB;oBAC1B,QAAQ,EAAE,OAAO;iBACpB;gBACD;oBACI,OAAO,EAAE,sBAAe;oBACxB,QAAQ,EAAE,2CAAmB;iBAChC;gBACD,oBAAQ;aACX;YACD,OAAO,EAAE,CAAC,oBAAQ,CAAC;YACnB,MAAM,EAAE,IAAI;SACf,CAAC;IACN,CAAC;CACJ,CAAA;AApBY,wCAAc;yBAAd,cAAc;IAH1B,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,CAAC,yCAAkB,CAAC;KACpC,CAAC;GACW,cAAc,CAoB1B"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>BuggLens - Error Code Preview</title>
|
|
7
|
+
<!-- Tailwind CSS CDN -->
|
|
8
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
9
|
+
<!-- FontAwesome for Icons -->
|
|
10
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
|
|
11
|
+
<style>
|
|
12
|
+
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
font-family: 'Inter', sans-serif;
|
|
16
|
+
background-color: #0b0f19;
|
|
17
|
+
}
|
|
18
|
+
.code-font {
|
|
19
|
+
font-family: 'Fira Code', monospace;
|
|
20
|
+
}
|
|
21
|
+
/* Custom scrollbar styling */
|
|
22
|
+
::-webkit-scrollbar {
|
|
23
|
+
width: 8px;
|
|
24
|
+
height: 8px;
|
|
25
|
+
}
|
|
26
|
+
::-webkit-scrollbar-track {
|
|
27
|
+
background: #0f172a;
|
|
28
|
+
}
|
|
29
|
+
::-webkit-scrollbar-thumb {
|
|
30
|
+
background: #334155;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
}
|
|
33
|
+
::-webkit-scrollbar-thumb:hover {
|
|
34
|
+
background: #475569;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
</head>
|
|
38
|
+
<body class="text-slate-200 min-h-screen flex flex-col justify-between">
|
|
39
|
+
<!-- Header / Navbar -->
|
|
40
|
+
<header class="border-b border-slate-800 bg-slate-900/50 backdrop-blur sticky top-0 z-50 px-4 py-3">
|
|
41
|
+
<div class="max-w-7xl mx-auto flex items-center justify-between">
|
|
42
|
+
<div class="flex items-center gap-3">
|
|
43
|
+
<div
|
|
44
|
+
class="h-9 w-9 bg-rose-600 rounded-lg flex items-center justify-center shadow-lg shadow-rose-600/20"
|
|
45
|
+
>
|
|
46
|
+
<i class="fa-solid fa-bug text-white text-lg"></i>
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<h1 class="text-lg font-bold tracking-tight text-white flex items-center gap-2">
|
|
50
|
+
BuggLens
|
|
51
|
+
<span
|
|
52
|
+
class="text-xs bg-rose-500/10 text-rose-400 px-2 py-0.5 rounded-full font-medium border border-rose-500/20"
|
|
53
|
+
>Active Exception</span
|
|
54
|
+
>
|
|
55
|
+
</h1>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="flex items-center gap-3">
|
|
59
|
+
<span
|
|
60
|
+
class="text-xs text-slate-400 bg-slate-800 px-3 py-1.5 rounded-md border border-slate-700/50 font-mono"
|
|
61
|
+
>
|
|
62
|
+
routes/web.php:16
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</header>
|
|
67
|
+
|
|
68
|
+
<!-- Main Container -->
|
|
69
|
+
<main class="flex-grow max-w-7xl w-full mx-auto p-4 md:p-6 lg:p-8 flex flex-col gap-6">
|
|
70
|
+
<!-- Error Meta Info Card -->
|
|
71
|
+
<div class="bg-slate-900 border border-rose-900/30 rounded-xl overflow-hidden shadow-2xl">
|
|
72
|
+
<div
|
|
73
|
+
class="bg-rose-950/20 border-b border-rose-900/20 px-6 py-4 flex flex-col md:flex-row md:items-center justify-between gap-4"
|
|
74
|
+
>
|
|
75
|
+
<div class="flex items-start gap-4">
|
|
76
|
+
<div class="mt-1 p-2 bg-rose-500/10 text-rose-400 rounded-lg border border-rose-500/20">
|
|
77
|
+
<i class="fa-solid fa-triangle-exclamation text-xl"></i>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<div class="text-xs font-semibold text-rose-400 uppercase tracking-wider mb-0.5">
|
|
81
|
+
Fatal Exception
|
|
82
|
+
</div>
|
|
83
|
+
<h2 class="text-xl font-bold text-white tracking-tight">Exception: aaaa</h2>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div
|
|
87
|
+
class="text-xs text-slate-400 font-mono self-start md:self-center bg-slate-950/40 px-3 py-1.5 rounded-md border border-slate-800"
|
|
88
|
+
>
|
|
89
|
+
<i class="fa-regular fa-clock mr-1"></i> June 20, 2026, 3:46 AM JST
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<!-- Code Block Visualization Container -->
|
|
94
|
+
<div class="p-0 bg-[#0d1117] overflow-hidden">
|
|
95
|
+
<div class="flex items-center justify-between px-4 py-2 bg-[#161b22] border-b border-slate-800/60">
|
|
96
|
+
<div class="flex items-center gap-2">
|
|
97
|
+
<span class="h-3 w-3 rounded-full bg-rose-500"></span>
|
|
98
|
+
<span class="h-3 w-3 rounded-full bg-amber-500"></span>
|
|
99
|
+
<span class="h-3 w-3 rounded-full bg-emerald-500"></span>
|
|
100
|
+
<span class="text-xs text-slate-400 font-mono ml-2">routes/web.php</span>
|
|
101
|
+
</div>
|
|
102
|
+
<button
|
|
103
|
+
onclick="copyRawCode()"
|
|
104
|
+
class="text-xs text-slate-400 hover:text-white flex items-center gap-1.5 transition-colors duration-150 bg-slate-800/50 hover:bg-slate-800 px-2.5 py-1.5 rounded border border-slate-700/50"
|
|
105
|
+
>
|
|
106
|
+
<i class="fa-regular fa-copy"></i> Copy
|
|
107
|
+
</button>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<!-- Code Lines Box -->
|
|
111
|
+
<div class="overflow-x-auto py-4 code-font text-sm leading-relaxed" id="code-block-container">
|
|
112
|
+
<!-- Javascript generated code lines will reside here -->
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</main>
|
|
117
|
+
|
|
118
|
+
<!-- Footer -->
|
|
119
|
+
<footer class="border-t border-slate-900 bg-slate-950 py-4 text-center text-xs text-slate-500">
|
|
120
|
+
© 2026 BuggLens Inc. Fully Automated Error Tracking System.
|
|
121
|
+
</footer>
|
|
122
|
+
|
|
123
|
+
<script>
|
|
124
|
+
function renderSourceCode(sourceContext) {
|
|
125
|
+
const container = document.getElementById('code-block-container');
|
|
126
|
+
container.innerHTML = '';
|
|
127
|
+
|
|
128
|
+
sourceContext.forEach((item) => {
|
|
129
|
+
const lineWrapper = document.createElement('div');
|
|
130
|
+
|
|
131
|
+
// Set styling blocks based on whether the current line is the active error line
|
|
132
|
+
if (item.error) {
|
|
133
|
+
lineWrapper.className =
|
|
134
|
+
'flex items-stretch bg-rose-950/30 border-l-[4px] border-rose-500 py-1.5 relative group';
|
|
135
|
+
} else {
|
|
136
|
+
lineWrapper.className =
|
|
137
|
+
'flex items-stretch hover:bg-slate-900/40 border-l-[4px] border-transparent py-0.5 group transition-all';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const lineNumberSpan = document.createElement('span');
|
|
141
|
+
lineNumberSpan.className = `w-14 text-right pr-6 select-none flex-shrink-0 font-medium ${item.error ? 'text-rose-400 font-bold' : 'text-slate-600 group-hover:text-slate-400'}`;
|
|
142
|
+
lineNumberSpan.textContent = item.line;
|
|
143
|
+
|
|
144
|
+
const codeSpan = document.createElement('span');
|
|
145
|
+
codeSpan.className = `whitespace-pre pr-4 overflow-x-auto ${item.error ? 'text-rose-100 font-semibold' : 'text-slate-300'}`;
|
|
146
|
+
|
|
147
|
+
let codeHTML = escapeHTML(item.code);
|
|
148
|
+
|
|
149
|
+
if (item.error) {
|
|
150
|
+
codeHTML = codeHTML.replace(
|
|
151
|
+
/(throw\s+new\s+\w+)/g,
|
|
152
|
+
'<span class="text-rose-400 font-bold">$1</span>',
|
|
153
|
+
);
|
|
154
|
+
} else {
|
|
155
|
+
const tokenRegex =
|
|
156
|
+
/(\/\/.*)|(\/\*[\s\S]*?\*\/)|('(?:\\.|[^'\\])*')|("(?:\\.|[^"\\])*")|\b(use|return|require|Route|function)\b/g;
|
|
157
|
+
|
|
158
|
+
codeHTML = codeHTML.replace(
|
|
159
|
+
tokenRegex,
|
|
160
|
+
(match, comment, blockComment, singleStr, doubleStr, keyword) => {
|
|
161
|
+
if (comment || blockComment) {
|
|
162
|
+
return `<span class="text-slate-500 italic">${match}</span>`;
|
|
163
|
+
}
|
|
164
|
+
if (singleStr || doubleStr) {
|
|
165
|
+
return `<span class="text-emerald-400">${match}</span>`;
|
|
166
|
+
}
|
|
167
|
+
if (keyword) {
|
|
168
|
+
return `<span class="text-indigo-400">${match}</span>`;
|
|
169
|
+
}
|
|
170
|
+
return match;
|
|
171
|
+
},
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
codeSpan.innerHTML = codeHTML;
|
|
176
|
+
|
|
177
|
+
lineWrapper.appendChild(lineNumberSpan);
|
|
178
|
+
lineWrapper.appendChild(codeSpan);
|
|
179
|
+
|
|
180
|
+
// Add indicator badge inside viewport next to the line that threw the exception
|
|
181
|
+
if (item.error) {
|
|
182
|
+
const badge = document.createElement('span');
|
|
183
|
+
badge.className =
|
|
184
|
+
'absolute right-4 top-1/2 -translate-y-1/2 bg-rose-500/10 text-rose-400 border border-rose-500/30 text-[10px] uppercase font-bold tracking-wider px-2 py-0.5 rounded shadow-lg shadow-rose-950/50';
|
|
185
|
+
badge.innerHTML =
|
|
186
|
+
'<i class="fa-solid fa-circle text-[6px] mr-1 animate-pulse"></i> Exception Origin';
|
|
187
|
+
lineWrapper.appendChild(badge);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
container.appendChild(lineWrapper);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function escapeHTML(str) {
|
|
195
|
+
return str
|
|
196
|
+
.replace(/&/g, '&')
|
|
197
|
+
.replace(/</g, '<')
|
|
198
|
+
.replace(/>/g, '>')
|
|
199
|
+
.replace(/"/g, '"')
|
|
200
|
+
.replace(/'/g, ''');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function copyRawCode() {
|
|
204
|
+
const rawCode = sourceContext.map((item) => item.code).join('\n');
|
|
205
|
+
const el = document.createElement('textarea');
|
|
206
|
+
el.value = rawCode;
|
|
207
|
+
document.body.appendChild(el);
|
|
208
|
+
el.select();
|
|
209
|
+
document.execCommand('copy');
|
|
210
|
+
document.body.removeChild(el);
|
|
211
|
+
|
|
212
|
+
const notification = document.createElement('div');
|
|
213
|
+
notification.className =
|
|
214
|
+
'fixed bottom-6 right-6 bg-emerald-600 text-white font-medium px-4 py-2.5 rounded-lg shadow-2xl z-50 transition-opacity duration-300 flex items-center gap-2';
|
|
215
|
+
notification.innerHTML = '<i class="fa-solid fa-check"></i> Code copied to clipboard!';
|
|
216
|
+
document.body.appendChild(notification);
|
|
217
|
+
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
notification.style.opacity = '0';
|
|
220
|
+
setTimeout(() => notification.remove(), 300);
|
|
221
|
+
}, 2500);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
try {
|
|
225
|
+
const eventSource = new EventSource('debug');
|
|
226
|
+
|
|
227
|
+
eventSource.addEventListener('message', function (event) {
|
|
228
|
+
try {
|
|
229
|
+
const data = JSON.parse(e.data);
|
|
230
|
+
renderSourceCode(data);
|
|
231
|
+
} catch (err) {
|
|
232
|
+
console.error('Failed to parse incoming SSE message:', err);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
} catch (error) {
|
|
236
|
+
console.log(error);
|
|
237
|
+
}
|
|
238
|
+
</script>
|
|
239
|
+
</body>
|
|
240
|
+
</html>
|