@loglayer/transport-pretty-terminal 6.0.1 → 6.2.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/dist/index.cjs +23 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -7,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
20
16
|
}
|
|
21
17
|
return to;
|
|
22
18
|
};
|
|
@@ -24,18 +20,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
20
|
value: mod,
|
|
25
21
|
enumerable: true
|
|
26
22
|
}) : target, mod));
|
|
27
|
-
|
|
28
23
|
//#endregion
|
|
29
24
|
let _loglayer_transport = require("@loglayer/transport");
|
|
30
25
|
let chalk = require("chalk");
|
|
31
|
-
chalk = __toESM(chalk);
|
|
26
|
+
chalk = __toESM(chalk, 1);
|
|
32
27
|
let wrap_ansi = require("wrap-ansi");
|
|
33
|
-
wrap_ansi = __toESM(wrap_ansi);
|
|
28
|
+
wrap_ansi = __toESM(wrap_ansi, 1);
|
|
34
29
|
let cli_truncate = require("cli-truncate");
|
|
35
|
-
cli_truncate = __toESM(cli_truncate);
|
|
30
|
+
cli_truncate = __toESM(cli_truncate, 1);
|
|
36
31
|
let keypress = require("keypress");
|
|
37
|
-
keypress = __toESM(keypress);
|
|
38
|
-
|
|
32
|
+
keypress = __toESM(keypress, 1);
|
|
39
33
|
//#region src/vendor/utils.js
|
|
40
34
|
/**
|
|
41
35
|
* Creates a string with the same length as `numSpaces` parameter
|
|
@@ -60,7 +54,6 @@ function isIsoStringDate(isoString) {
|
|
|
60
54
|
const testDate = new Date(isoString);
|
|
61
55
|
return !Number.isNaN(testDate.getTime());
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
//#endregion
|
|
65
58
|
//#region src/vendor/prettyjson.js
|
|
66
59
|
const conflictChars = /[^\w\s\n\r\v\t.,]/i;
|
|
@@ -227,7 +220,6 @@ function render(data, options, indentation) {
|
|
|
227
220
|
options = validateOptionsAndSetDefaults(options);
|
|
228
221
|
return renderToArray(data, options, indentation).join("\n");
|
|
229
222
|
}
|
|
230
|
-
|
|
231
223
|
//#endregion
|
|
232
224
|
//#region src/views/utils.ts
|
|
233
225
|
/**
|
|
@@ -275,7 +267,6 @@ function formatInlineData(data, config, maxDepth, maxLength, expanded = false) {
|
|
|
275
267
|
const result = pairs.join(" ");
|
|
276
268
|
return expanded ? result : (0, cli_truncate.default)(result, maxLength);
|
|
277
269
|
}
|
|
278
|
-
|
|
279
270
|
//#endregion
|
|
280
271
|
//#region src/views/DetailView.ts
|
|
281
272
|
/**
|
|
@@ -392,7 +383,6 @@ var DetailView = class {
|
|
|
392
383
|
return Math.max(0, this.detailViewContent.length - availableHeight);
|
|
393
384
|
}
|
|
394
385
|
};
|
|
395
|
-
|
|
396
386
|
//#endregion
|
|
397
387
|
//#region src/views/SelectionView.ts
|
|
398
388
|
/**
|
|
@@ -446,7 +436,6 @@ var SelectionView = class {
|
|
|
446
436
|
}
|
|
447
437
|
}
|
|
448
438
|
};
|
|
449
|
-
|
|
450
439
|
//#endregion
|
|
451
440
|
//#region src/views/SimpleView.ts
|
|
452
441
|
/**
|
|
@@ -499,7 +488,6 @@ var SimpleView = class {
|
|
|
499
488
|
throw new Error("SimpleView.render() should not be called directly. Use renderLogLine() instead.");
|
|
500
489
|
}
|
|
501
490
|
};
|
|
502
|
-
|
|
503
491
|
//#endregion
|
|
504
492
|
//#region src/LogRenderer.ts
|
|
505
493
|
/**
|
|
@@ -685,7 +673,6 @@ var LogRenderer = class {
|
|
|
685
673
|
return this.viewMode;
|
|
686
674
|
}
|
|
687
675
|
};
|
|
688
|
-
|
|
689
676
|
//#endregion
|
|
690
677
|
//#region src/LogStorage.ts
|
|
691
678
|
/**
|
|
@@ -809,7 +796,6 @@ var LogStorage = class {
|
|
|
809
796
|
this.db.close();
|
|
810
797
|
}
|
|
811
798
|
};
|
|
812
|
-
|
|
813
799
|
//#endregion
|
|
814
800
|
//#region src/themes.ts
|
|
815
801
|
/**
|
|
@@ -1109,7 +1095,6 @@ const pastel = {
|
|
|
1109
1095
|
}
|
|
1110
1096
|
}
|
|
1111
1097
|
};
|
|
1112
|
-
|
|
1113
1098
|
//#endregion
|
|
1114
1099
|
//#region src/UIManager.ts
|
|
1115
1100
|
/**
|
|
@@ -1141,6 +1126,8 @@ const pastel = {
|
|
|
1141
1126
|
* Handles all keyboard input and view transitions.
|
|
1142
1127
|
*/
|
|
1143
1128
|
var UIManager = class {
|
|
1129
|
+
renderer;
|
|
1130
|
+
storage;
|
|
1144
1131
|
/** Whether the UI is in log selection mode */
|
|
1145
1132
|
isSelectionMode = false;
|
|
1146
1133
|
/** Whether the UI is showing detailed log view */
|
|
@@ -1239,7 +1226,8 @@ var UIManager = class {
|
|
|
1239
1226
|
}
|
|
1240
1227
|
const totalCount = this.filterText ? this.storage.getFilteredLogCount(this.filterText) : this.storage.getLogCount();
|
|
1241
1228
|
if (totalCount !== this.logs.length) {
|
|
1242
|
-
|
|
1229
|
+
const storedLogs = this.filterText ? this.storage.searchLogs(this.filterText) : this.storage.getAllLogs();
|
|
1230
|
+
this.logs = storedLogs;
|
|
1243
1231
|
const entry = this.logs[this.selectedIndex];
|
|
1244
1232
|
const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
|
|
1245
1233
|
const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
|
|
@@ -1328,7 +1316,8 @@ var UIManager = class {
|
|
|
1328
1316
|
this.isSelectionMode = true;
|
|
1329
1317
|
this.filterText = "";
|
|
1330
1318
|
this.isPaused = true;
|
|
1331
|
-
|
|
1319
|
+
const storedLogs = this.storage.getAllLogs();
|
|
1320
|
+
this.logs = storedLogs;
|
|
1332
1321
|
this.selectedIndex = key.name === "up" ? Math.max(0, this.logs.length - 1) : Math.max(0, this.logs.length - 1);
|
|
1333
1322
|
this.renderer.renderSelectionView(this.logs, this.selectedIndex, this.filterText, this.selectionBuffer.length);
|
|
1334
1323
|
this.startSelectionViewPolling();
|
|
@@ -1518,7 +1507,6 @@ var UIManager = class {
|
|
|
1518
1507
|
}
|
|
1519
1508
|
}
|
|
1520
1509
|
};
|
|
1521
|
-
|
|
1522
1510
|
//#endregion
|
|
1523
1511
|
//#region src/PrettyTerminalTransport.ts
|
|
1524
1512
|
/**
|
|
@@ -1669,20 +1657,18 @@ var PrettyTerminalTransport = class PrettyTerminalTransport extends _loglayer_tr
|
|
|
1669
1657
|
return messages;
|
|
1670
1658
|
}
|
|
1671
1659
|
};
|
|
1672
|
-
|
|
1673
1660
|
//#endregion
|
|
1674
1661
|
//#region src/index.ts
|
|
1675
1662
|
function getPrettyTerminal(config) {
|
|
1676
1663
|
return PrettyTerminalTransport.getInstance(config);
|
|
1677
1664
|
}
|
|
1678
|
-
|
|
1679
1665
|
//#endregion
|
|
1680
1666
|
exports.PrettyTerminalTransport = PrettyTerminalTransport;
|
|
1681
|
-
Object.defineProperty(exports,
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1667
|
+
Object.defineProperty(exports, "chalk", {
|
|
1668
|
+
enumerable: true,
|
|
1669
|
+
get: function() {
|
|
1670
|
+
return chalk;
|
|
1671
|
+
}
|
|
1686
1672
|
});
|
|
1687
1673
|
exports.getPrettyTerminal = getPrettyTerminal;
|
|
1688
1674
|
exports.moonlight = moonlight;
|
|
@@ -1690,4 +1676,5 @@ exports.nature = nature;
|
|
|
1690
1676
|
exports.neon = neon;
|
|
1691
1677
|
exports.pastel = pastel;
|
|
1692
1678
|
exports.sunlight = sunlight;
|
|
1679
|
+
|
|
1693
1680
|
//# sourceMappingURL=index.cjs.map
|