vibex-sh 0.2.3 → 0.2.4
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/index.js +0 -17
- package/package.json +3 -2
package/index.js
CHANGED
|
@@ -427,19 +427,14 @@ async function main() {
|
|
|
427
427
|
socket.on('connect', () => {
|
|
428
428
|
isConnected = true;
|
|
429
429
|
console.log(' ✓ Connected to server\n');
|
|
430
|
-
console.error(`[CLI DEBUG] Socket connected, socket.id: ${socket.id}`);
|
|
431
|
-
console.error(`[CLI DEBUG] About to emit join-session for: ${sessionId}`);
|
|
432
430
|
// Rejoin session on reconnect
|
|
433
431
|
socket.emit('join-session', sessionId);
|
|
434
|
-
console.error(`[CLI DEBUG] ✅ join-session emitted, waiting 100ms before setting hasJoinedSession`);
|
|
435
432
|
// Wait a tiny bit for join-session to be processed
|
|
436
433
|
setTimeout(() => {
|
|
437
434
|
hasJoinedSession = true;
|
|
438
|
-
console.error(`[CLI DEBUG] hasJoinedSession set to true, processing ${logQueue.length} queued logs`);
|
|
439
435
|
// Process any queued logs
|
|
440
436
|
while (logQueue.length > 0) {
|
|
441
437
|
const logData = logQueue.shift();
|
|
442
|
-
console.error(`[CLI DEBUG] Emitting queued cli-emit (connect) for sessionId: ${sessionId}`);
|
|
443
438
|
socket.emit('cli-emit', {
|
|
444
439
|
sessionId,
|
|
445
440
|
...logData,
|
|
@@ -474,7 +469,6 @@ async function main() {
|
|
|
474
469
|
// Process any queued logs
|
|
475
470
|
while (logQueue.length > 0) {
|
|
476
471
|
const logData = logQueue.shift();
|
|
477
|
-
console.error(`[CLI DEBUG] Emitting queued cli-emit (reconnect) for sessionId: ${sessionId}`);
|
|
478
472
|
socket.emit('cli-emit', {
|
|
479
473
|
sessionId,
|
|
480
474
|
...logData,
|
|
@@ -581,10 +575,8 @@ async function main() {
|
|
|
581
575
|
});
|
|
582
576
|
|
|
583
577
|
rl.on('line', (line) => {
|
|
584
|
-
console.error(`[CLI DEBUG] Received line from stdin: "${line}"`);
|
|
585
578
|
const trimmedLine = line.trim();
|
|
586
579
|
if (!trimmedLine) {
|
|
587
|
-
console.error(`[CLI DEBUG] Line is empty, skipping`);
|
|
588
580
|
return;
|
|
589
581
|
}
|
|
590
582
|
|
|
@@ -596,31 +588,22 @@ async function main() {
|
|
|
596
588
|
payload: parsed,
|
|
597
589
|
timestamp: Date.now(),
|
|
598
590
|
};
|
|
599
|
-
console.error(`[CLI DEBUG] Parsed as JSON log`);
|
|
600
591
|
} catch (e) {
|
|
601
592
|
logData = {
|
|
602
593
|
type: 'text',
|
|
603
594
|
payload: trimmedLine,
|
|
604
595
|
timestamp: Date.now(),
|
|
605
596
|
};
|
|
606
|
-
console.error(`[CLI DEBUG] Parsed as text log`);
|
|
607
597
|
}
|
|
608
598
|
|
|
609
|
-
console.error(`[CLI DEBUG] Connection state - isConnected: ${isConnected}, hasJoinedSession: ${hasJoinedSession}, socket.connected: ${socket?.connected}`);
|
|
610
|
-
|
|
611
599
|
// If connected and joined session, send immediately; otherwise queue it
|
|
612
600
|
if (isConnected && hasJoinedSession && socket.connected) {
|
|
613
|
-
console.error(`[CLI DEBUG] ✅ Ready to emit - Emitting cli-emit for sessionId: ${sessionId}`);
|
|
614
|
-
console.error(`[CLI DEBUG] Log data:`, JSON.stringify(logData, null, 2));
|
|
615
601
|
socket.emit('cli-emit', {
|
|
616
602
|
sessionId,
|
|
617
603
|
...logData,
|
|
618
604
|
});
|
|
619
|
-
console.error(`[CLI DEBUG] ✅ cli-emit event emitted successfully`);
|
|
620
605
|
} else {
|
|
621
|
-
console.error(`[CLI DEBUG] ⏸️ Queueing log - isConnected: ${isConnected}, hasJoinedSession: ${hasJoinedSession}, socket.connected: ${socket?.connected}`);
|
|
622
606
|
logQueue.push(logData);
|
|
623
|
-
console.error(`[CLI DEBUG] Queue now has ${logQueue.length} items`);
|
|
624
607
|
}
|
|
625
608
|
});
|
|
626
609
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibex-sh",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Zero-config observability CLI - pipe logs and visualize instantly",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"homepage": "https://vibex.sh",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"commander": "^11.1.0",
|
|
30
|
-
"socket.io-client": "^4.7.2"
|
|
30
|
+
"socket.io-client": "^4.7.2",
|
|
31
|
+
"vibex-sh": "^0.2.3"
|
|
31
32
|
}
|
|
32
33
|
}
|