@loglayer/transport-simple-pretty-terminal 3.1.0 → 3.3.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 +32 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -25
- package/dist/index.js.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,14 +20,12 @@ 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 sprintf_js = require("sprintf-js");
|
|
33
28
|
let date_fns = require("date-fns");
|
|
34
|
-
|
|
35
29
|
//#region src/themes.ts
|
|
36
30
|
/**
|
|
37
31
|
* Moonlight - A dark theme with cool blue tones
|
|
@@ -169,7 +163,6 @@ const pastel = {
|
|
|
169
163
|
dataValueColor: chalk.default.rgb(105, 105, 105),
|
|
170
164
|
dataKeyColor: chalk.default.rgb(173, 216, 230)
|
|
171
165
|
};
|
|
172
|
-
|
|
173
166
|
//#endregion
|
|
174
167
|
//#region src/vendor/utils.js
|
|
175
168
|
/**
|
|
@@ -195,7 +188,6 @@ function isIsoStringDate(isoString) {
|
|
|
195
188
|
const testDate = new Date(isoString);
|
|
196
189
|
return !Number.isNaN(testDate.getTime());
|
|
197
190
|
}
|
|
198
|
-
|
|
199
191
|
//#endregion
|
|
200
192
|
//#region src/vendor/prettyjson.js
|
|
201
193
|
const conflictChars = /[^\w\s\n\r\v\t.,]/i;
|
|
@@ -362,7 +354,6 @@ function render(data, options, indentation) {
|
|
|
362
354
|
options = validateOptionsAndSetDefaults(options);
|
|
363
355
|
return renderToArray(data, options, indentation).join("\n");
|
|
364
356
|
}
|
|
365
|
-
|
|
366
357
|
//#endregion
|
|
367
358
|
//#region src/views/utils.ts
|
|
368
359
|
/**
|
|
@@ -434,7 +425,6 @@ function formatInlineData(data, config, maxDepth, expanded = false, collapseArra
|
|
|
434
425
|
traverse(data);
|
|
435
426
|
return pairs.join(" ");
|
|
436
427
|
}
|
|
437
|
-
|
|
438
428
|
//#endregion
|
|
439
429
|
//#region src/views/SimpleView.ts
|
|
440
430
|
/**
|
|
@@ -561,7 +551,6 @@ var SimpleView = class {
|
|
|
561
551
|
}
|
|
562
552
|
}
|
|
563
553
|
};
|
|
564
|
-
|
|
565
554
|
//#endregion
|
|
566
555
|
//#region src/SimplePrettyTerminalTransport.ts
|
|
567
556
|
/**
|
|
@@ -595,6 +584,21 @@ var SimplePrettyTerminalTransport = class extends _loglayer_transport.Loggerless
|
|
|
595
584
|
const collapseArrays = config.collapseArrays !== false;
|
|
596
585
|
const flattenNestedObjects = config.flattenNestedObjects !== false;
|
|
597
586
|
const runtime = config.runtime;
|
|
587
|
+
const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;
|
|
588
|
+
const viewConfig = {
|
|
589
|
+
colors: {
|
|
590
|
+
trace: chalk.default.gray,
|
|
591
|
+
debug: chalk.default.blue,
|
|
592
|
+
info: chalk.default.green,
|
|
593
|
+
warn: chalk.default.yellow,
|
|
594
|
+
error: chalk.default.red,
|
|
595
|
+
fatal: chalk.default.bgRed.white,
|
|
596
|
+
...theme.colors
|
|
597
|
+
},
|
|
598
|
+
logIdColor: theme.logIdColor || chalk.default.dim,
|
|
599
|
+
dataValueColor: theme.dataValueColor || chalk.default.white,
|
|
600
|
+
dataKeyColor: theme.dataKeyColor || chalk.default.dim
|
|
601
|
+
};
|
|
598
602
|
this.renderer = new SimpleView({
|
|
599
603
|
viewMode,
|
|
600
604
|
maxInlineDepth,
|
|
@@ -603,21 +607,8 @@ var SimplePrettyTerminalTransport = class extends _loglayer_transport.Loggerless
|
|
|
603
607
|
collapseArrays,
|
|
604
608
|
flattenNestedObjects,
|
|
605
609
|
runtime,
|
|
606
|
-
includeDataInBrowserConsole
|
|
607
|
-
config:
|
|
608
|
-
colors: {
|
|
609
|
-
trace: chalk.default.gray,
|
|
610
|
-
debug: chalk.default.blue,
|
|
611
|
-
info: chalk.default.green,
|
|
612
|
-
warn: chalk.default.yellow,
|
|
613
|
-
error: chalk.default.red,
|
|
614
|
-
fatal: chalk.default.bgRed.white,
|
|
615
|
-
...theme.colors
|
|
616
|
-
},
|
|
617
|
-
logIdColor: theme.logIdColor || chalk.default.dim,
|
|
618
|
-
dataValueColor: theme.dataValueColor || chalk.default.white,
|
|
619
|
-
dataKeyColor: theme.dataKeyColor || chalk.default.dim
|
|
620
|
-
}
|
|
610
|
+
includeDataInBrowserConsole,
|
|
611
|
+
config: viewConfig
|
|
621
612
|
});
|
|
622
613
|
}
|
|
623
614
|
/**
|
|
@@ -718,13 +709,11 @@ var SimplePrettyTerminalTransport = class extends _loglayer_transport.Loggerless
|
|
|
718
709
|
return this.renderer.getViewMode();
|
|
719
710
|
}
|
|
720
711
|
};
|
|
721
|
-
|
|
722
712
|
//#endregion
|
|
723
713
|
//#region src/index.ts
|
|
724
714
|
function getSimplePrettyTerminal(config) {
|
|
725
715
|
return new SimplePrettyTerminalTransport(config);
|
|
726
716
|
}
|
|
727
|
-
|
|
728
717
|
//#endregion
|
|
729
718
|
exports.SimplePrettyTerminalTransport = SimplePrettyTerminalTransport;
|
|
730
719
|
exports.getSimplePrettyTerminal = getSimplePrettyTerminal;
|
|
@@ -733,11 +722,13 @@ exports.nature = nature;
|
|
|
733
722
|
exports.neon = neon;
|
|
734
723
|
exports.pastel = pastel;
|
|
735
724
|
exports.sunlight = sunlight;
|
|
736
|
-
Object.keys(chalk).forEach(function
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
725
|
+
Object.keys(chalk).forEach(function(k) {
|
|
726
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
727
|
+
enumerable: true,
|
|
728
|
+
get: function() {
|
|
729
|
+
return chalk[k];
|
|
730
|
+
}
|
|
731
|
+
});
|
|
741
732
|
});
|
|
742
733
|
|
|
743
734
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["Utils.indent","Utils.getMaxIndexLength","prettyjson\n .render","LoggerlessTransport"],"sources":["../src/themes.ts","../src/vendor/utils.js","../src/vendor/prettyjson.js","../src/views/utils.ts","../src/views/SimpleView.ts","../src/SimplePrettyTerminalTransport.ts","../src/index.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport type { SimplePrettyTerminalTheme } from \"./types.js\";\n\n/**\n * Moonlight - A dark theme with cool blue tones\n * Inspired by moonlit nights and modern IDEs\n *\n * Color Palette:\n * - Primary: Cool blues and soft greens\n * - Accents: Warm yellows and soft reds\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - Night-time coding sessions\n * - Environments where eye strain is a concern\n */\nexport const moonlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(114, 135, 153), // Muted blue-grey for less important info\n debug: chalk.rgb(130, 170, 255), // Soft blue that pops but doesn't strain\n info: chalk.rgb(195, 232, 141), // Sage green for good readability\n warn: chalk.rgb(255, 203, 107), // Warm yellow, less harsh than pure yellow\n error: chalk.rgb(247, 118, 142), // Soft red that stands out without being aggressive\n fatal: chalk.bgRgb(247, 118, 142).white, // Inverted soft red for maximum visibility\n },\n logIdColor: chalk.rgb(84, 98, 117), // Darker blue-grey for secondary information\n dataValueColor: chalk.rgb(209, 219, 231), // Light grey-blue for primary content\n dataKeyColor: chalk.rgb(130, 170, 255), // Matching debug blue for consistency\n};\n\n/**\n * Sunlight - A light theme with warm tones\n * Inspired by daylight reading and paper documentation\n *\n * Color Palette:\n * - Primary: Deep, rich colors that contrast well with white\n * - Accents: Earth tones and deep jewel tones\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Daytime coding sessions\n * - High-glare environments\n * - Printed documentation\n */\nexport const sunlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(110, 110, 110), // Dark grey for subtle information\n debug: chalk.rgb(32, 96, 159), // Deep blue for strong contrast on white\n info: chalk.rgb(35, 134, 54), // Forest green, easier on the eyes than bright green\n warn: chalk.rgb(176, 95, 0), // Brown-orange for natural warning color\n error: chalk.rgb(191, 0, 0), // Deep red for clear visibility on light backgrounds\n fatal: chalk.bgRgb(191, 0, 0).white, // White on deep red for critical issues\n },\n logIdColor: chalk.rgb(110, 110, 110),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(32, 96, 159),\n};\n\n/**\n * Neon - A dark theme with vibrant cyberpunk colors\n * Inspired by neon-lit cityscapes and retro-futuristic aesthetics\n *\n * Color Palette:\n * - Primary: Electric blues and hot pinks\n * - Accents: Bright purples and cyber greens\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - High-contrast preferences\n * - Modern, tech-focused applications\n */\nexport const neon: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(108, 108, 255), // Electric blue\n debug: chalk.rgb(255, 82, 246), // Hot pink\n info: chalk.rgb(0, 255, 163), // Cyber green\n warn: chalk.rgb(255, 231, 46), // Electric yellow\n error: chalk.rgb(255, 53, 91), // Neon red\n fatal: chalk.bgRgb(255, 53, 91).rgb(0, 255, 163), // Neon red bg with cyber green text\n },\n logIdColor: chalk.rgb(187, 134, 252), // Bright purple\n dataValueColor: chalk.rgb(255, 255, 255), // Pure white\n dataKeyColor: chalk.rgb(0, 255, 240), // Cyan\n};\n\n/**\n * Nature - A light theme with organic, earthy colors\n * Inspired by forest landscapes and natural elements\n *\n * Color Palette:\n * - Primary: Deep forest greens and rich browns\n * - Accents: Autumn reds and golden yellows\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Nature-inspired interfaces\n * - Applications focusing on readability\n */\nexport const nature: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(101, 115, 126), // Slate grey\n debug: chalk.rgb(34, 139, 34), // Forest green\n info: chalk.rgb(46, 139, 87), // Sea green\n warn: chalk.rgb(218, 165, 32), // Golden rod\n error: chalk.rgb(139, 69, 19), // Saddle brown\n fatal: chalk.bgRgb(139, 69, 19).white, // Brown background with white text\n },\n logIdColor: chalk.rgb(101, 115, 126),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(34, 139, 34),\n};\n\n/**\n * Pastel - A soft, calming theme with gentle colors\n * Inspired by watercolor paintings and soft aesthetics\n *\n * Color Palette:\n * - Primary: Soft pastels and muted tones\n * - Accents: Gentle pinks and light blues\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Long coding sessions\n * - Reduced visual stress\n */\nexport const pastel: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(200, 200, 200), // Light grey\n debug: chalk.rgb(173, 216, 230), // Light blue\n info: chalk.rgb(144, 238, 144), // Light green\n warn: chalk.rgb(255, 218, 185), // Peach\n error: chalk.rgb(255, 182, 193), // Light pink\n fatal: chalk.bgRgb(255, 182, 193).rgb(105, 105, 105), // Light pink bg with dim grey text\n },\n logIdColor: chalk.rgb(200, 200, 200),\n dataValueColor: chalk.rgb(105, 105, 105),\n dataKeyColor: chalk.rgb(173, 216, 230),\n};\n","/**\n * Creates a string with the same length as `numSpaces` parameter\n **/\nexport function indent(numSpaces) {\n return new Array(numSpaces + 1).join(\" \");\n}\n\n/**\n * Gets the string length of the longer index in a hash\n **/\nexport function getMaxIndexLength(input) {\n var maxWidth = 0;\n\n Object.getOwnPropertyNames(input).forEach((key) => {\n // Skip undefined values.\n if (input[key] === undefined) {\n return;\n }\n\n maxWidth = Math.max(maxWidth, key.length);\n });\n return maxWidth;\n}\n\nexport function isIsoStringDate(isoString) {\n if (typeof isoString !== \"string\") {\n return false;\n }\n // More flexible regex that handles:\n // - Optional milliseconds\n // - Optional timezone offset or Z\n // - Optional T separator (space also valid)\n if (!/^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$/.test(isoString)) {\n return false;\n }\n const testDate = new Date(isoString);\n return !Number.isNaN(testDate.getTime());\n}\n","// @ts-nocheck\nimport chalk from \"chalk\";\nimport * as Utils from \"./utils.js\";\nimport { isIsoStringDate } from \"./utils.js\";\n\nconst conflictChars = /[^\\w\\s\\n\\r\\v\\t.,]/i;\n\n// Helper function to detect if an object should be printed or ignored\nconst isPrintable = (input, options) => input !== undefined || options.renderUndefined;\n\n// Helper function to detect if an object can be directly serializable\nconst isSerializable = (input, onlyPrimitives, options) => {\n if (\n typeof input === \"boolean\" ||\n typeof input === \"number\" ||\n typeof input === \"function\" ||\n input === null ||\n input === undefined ||\n input instanceof Date\n ) {\n return true;\n }\n if (typeof input === \"string\" && input.indexOf(\"\\n\") === -1) {\n return true;\n }\n\n if (options.inlineArrays && !onlyPrimitives) {\n if (Array.isArray(input) && isSerializable(input[0], true, options)) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Function} colorFn\n * @param {PrettyJSONOptions} options\n */\nconst getColorRenderer = (colorFn, options) => {\n if (options.noColor) {\n return (text) => text;\n }\n\n if (typeof colorFn !== \"function\") {\n return (text) => text;\n }\n\n return colorFn;\n};\n\nconst addColorToData = (input, options) => {\n if (options.noColor) {\n return input;\n }\n\n if (input instanceof Date) {\n return getColorRenderer(options.dateColor, options)(input.toISOString());\n }\n if (typeof input === \"string\") {\n if (isIsoStringDate(input)) {\n return getColorRenderer(options.dateColor, options)(input);\n }\n // Print strings in regular terminal color\n return getColorRenderer(options.stringColor, options)(input);\n }\n\n const sInput = `${input}`;\n\n if (typeof input === \"boolean\") {\n return getColorRenderer(options.booleanColor, options)(sInput);\n }\n if (input === null || input === undefined) {\n return getColorRenderer(options.nullUndefinedColor, options)(sInput);\n }\n if (typeof input === \"number\") {\n if (input >= 0) {\n return getColorRenderer(options.positiveNumberColor, options)(sInput);\n }\n return getColorRenderer(options.negativeNumberColor, options)(sInput);\n }\n if (typeof input === \"function\") {\n return \"function() {}\";\n }\n\n if (Array.isArray(input)) {\n return input.join(\", \");\n }\n\n return sInput;\n};\n\nconst colorMultilineString = (options, line) => getColorRenderer(options.multilineStringColor, options)(line);\n\nconst indentLines = (string, spaces, options) => {\n let lines = string.split(\"\\n\");\n lines = lines.map((line) => Utils.indent(spaces) + colorMultilineString(options, line));\n return lines.join(\"\\n\");\n};\n\nconst renderToArray = (data, options, indentation) => {\n if (typeof data === \"string\" && data.match(conflictChars) && options.escape) {\n data = JSON.stringify(data);\n }\n\n if (!isPrintable(data, options)) {\n return [];\n }\n\n if (isSerializable(data, false, options)) {\n return [Utils.indent(indentation) + addColorToData(data, options)];\n }\n\n // Unserializable string means it's multiline\n if (typeof data === \"string\") {\n return [\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n indentLines(data, indentation + options.defaultIndentation, options),\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n ];\n }\n\n if (Array.isArray(data)) {\n // If the array is empty, render the `emptyArrayMsg`\n if (data.length === 0) {\n return [Utils.indent(indentation) + options.emptyArrayMsg];\n }\n\n // If arrays should be collapsed and there's data, show [...]\n if (options.collapseArrays && data.length > 0) {\n return [`${Utils.indent(indentation)}[... ${data.length} items]`];\n }\n\n const outputArray = [];\n\n data.forEach((element) => {\n if (!isPrintable(element, options)) {\n return;\n }\n\n // Prepend the dash at the beginning of each array's element line\n let line = \"- \";\n line = getColorRenderer(options.dashColor, options)(line);\n line = Utils.indent(indentation) + line;\n\n // If the element of the array is a string, bool, number, or null\n // render it in the same line\n if (isSerializable(element, false, options)) {\n line += renderToArray(element, options, 0)[0];\n outputArray.push(line);\n\n // If the element is an array or object, render it in next line\n } else {\n outputArray.push(line);\n outputArray.push.apply(outputArray, renderToArray(element, options, indentation + options.defaultIndentation));\n }\n });\n\n return outputArray;\n }\n\n if (data instanceof Error) {\n return renderToArray(\n {\n message: data.message,\n stack: data.stack.split(\"\\n\"),\n },\n options,\n indentation,\n );\n }\n\n // If values alignment is enabled, get the size of the longest index\n // to align all the values\n const maxIndexLength = options.noAlign ? 0 : Utils.getMaxIndexLength(data);\n let key;\n const output = [];\n\n Object.getOwnPropertyNames(data).forEach((i) => {\n if (!isPrintable(data[i], options)) {\n return;\n }\n\n // Prepend the index at the beginning of the line\n key = `${i}: `;\n key = getColorRenderer(options.keysColor, options)(key);\n key = Utils.indent(indentation) + key;\n\n // If the value is serializable, render it in the same line\n if (isSerializable(data[i], false, options)) {\n const nextIndentation = options.noAlign ? 0 : maxIndexLength - i.length;\n key += renderToArray(data[i], options, nextIndentation)[0];\n output.push(key);\n\n // If the index is an array or object, render it in next line\n } else {\n output.push(key);\n output.push.apply(output, renderToArray(data[i], options, indentation + options.defaultIndentation));\n }\n });\n return output;\n};\n/**\n * @typedef {Object} PrettyJSONOptions\n * @property {Function} [stringColor=null] Chalk color function for strings\n * @property {Function} [multilineStringColor=null] Chalk color function for multiline strings\n * @property {Function} [keysColor=chalk.green] Chalk color function for keys in hashes\n * @property {Function} [dashColor=chalk.green] Chalk color function for dashes in arrays\n * @property {Function} [numberColor=chalk.blue] Default Chalk color function for numbers\n * @property {Function} [positiveNumberColor=numberColor] Chalk color function for positive numbers\n * @property {Function} [negativeNumberColor=numberColor] Chalk color function for negative numbers\n * @property {Function} [booleanColor=chalk.cyan] Chalk color function for boolean values\n * @property {Function} [nullUndefinedColor=chalk.grey] Chalk color function for null || undefined\n * @property {Function} [dateColor=chalk.magenta] Chalk color function for Date objects\n * @property {number} [defaultIndentation=2] Indentation spaces per object level\n * @property {string} [emptyArrayMsg=\"(empty array)\"] Replace empty strings with\n * @property {boolean} [noColor] Flag to disable colors\n * @property {boolean} [noAlign] Flag to disable alignment\n * @property {boolean} [escape] Flag to escape printed content\n * @property {boolean} [collapseArrays] Flag to collapse arrays\n */\n/**\n * Mutating function that ensures we have a valid options object\n * @param {PrettyJSONOptions} options\n * @returns PrettyJSONOptions\n */\nconst validateOptionsAndSetDefaults = (options) => {\n options = options || {};\n options.emptyArrayMsg = options.emptyArrayMsg || \"(empty array)\";\n options.keysColor = options.keysColor || chalk.green;\n options.dashColor = options.dashColor || chalk.green;\n options.booleanColor = options.booleanColor || chalk.cyan;\n options.nullUndefinedColor = options.nullUndefinedColor || chalk.grey;\n options.numberColor = options.numberColor || chalk.blue;\n options.positiveNumberColor = options.positiveNumberColor || options.numberColor;\n options.negativeNumberColor = options.negativeNumberColor || options.numberColor;\n options.dateColor = options.dateColor || chalk.magenta;\n options.defaultIndentation = options.defaultIndentation || 2;\n options.noColor = !!options.noColor;\n options.noAlign = !!options.noAlign;\n options.escape = !!options.escape;\n options.renderUndefined = !!options.renderUndefined;\n options.collapseArrays = !!options.collapseArrays;\n\n options.stringColor = options.stringColor || null;\n options.multilineStringColor = options.multilineStringColor || options.stringColor || null;\n\n return options;\n};\n/**\n * ### Render function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * stringColor: 'grey', // Color for strings\n * multilineStringColor: 'cyan' // Color for multiline strings\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n * @returns string with the rendered data\n */\nexport function render(data, options, indentation) {\n // Default values\n indentation = indentation || 0;\n options = validateOptionsAndSetDefaults(options);\n\n return renderToArray(data, options, indentation).join(\"\\n\");\n}\n\n/**\n * ### Render from string function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n */\nexport function renderString(data, options, indentation) {\n let output = \"\";\n let parsedData;\n // If the input is not a string or if it's empty, just return an empty string\n if (typeof data !== \"string\" || data === \"\") {\n return \"\";\n }\n\n // Remove non-JSON characters from the beginning string\n if (data[0] !== \"{\" && data[0] !== \"[\") {\n let beginingOfJson;\n if (data.indexOf(\"{\") === -1) {\n beginingOfJson = data.indexOf(\"[\");\n } else if (data.indexOf(\"[\") === -1) {\n beginingOfJson = data.indexOf(\"{\");\n } else if (data.indexOf(\"{\") < data.indexOf(\"[\")) {\n beginingOfJson = data.indexOf(\"{\");\n } else {\n beginingOfJson = data.indexOf(\"[\");\n }\n output += `${data.substr(0, beginingOfJson)}\\n`;\n data = data.substr(beginingOfJson);\n }\n\n try {\n parsedData = JSON.parse(data);\n } catch (_e) {\n // Return an error in case of an invalid JSON\n return `${chalk.red(\"Error:\")} Not valid JSON!`;\n }\n\n // Call the real render() method\n output += exports.render(parsedData, options, indentation);\n return output;\n}\n","import chalk from \"chalk\";\nimport { format } from \"date-fns\";\nimport type { ColorConfig, ViewConfig } from \"../types.js\";\n\n/**\n * Formats a timestamp into a readable string.\n *\n * @param timestamp - Unix timestamp in milliseconds\n * @param colorFn - Chalk function to color the timestamp\n * @param timestampFormat - Custom format string (date-fns) or function. Defaults to \"HH:mm:ss.SSS\"\n * @returns Formatted timestamp string\n */\nexport function formatTimestamp(\n timestamp: number,\n colorFn: typeof chalk.white,\n timestampFormat: string | ((timestamp: number) => string) = \"HH:mm:ss.SSS\",\n): string {\n let formattedTime: string;\n\n if (typeof timestampFormat === \"function\") {\n formattedTime = timestampFormat(timestamp);\n } else {\n const date = new Date(timestamp);\n formattedTime = format(date, timestampFormat);\n }\n\n return colorFn(`[${formattedTime}]`);\n}\n\n/**\n * Gets the appropriate color function for a log level.\n *\n * @param level - Log level string\n * @param colors - Color configuration object\n * @returns Chalk function for the log level\n */\nexport function getLevelColor(level: string, colors: ColorConfig): typeof chalk.white {\n const levelLower = level.toLowerCase();\n\n switch (levelLower) {\n case \"trace\":\n return colors.trace || chalk.white;\n case \"debug\":\n return colors.debug || chalk.white;\n case \"info\":\n return colors.info || chalk.white;\n case \"warn\":\n return colors.warn || chalk.white;\n case \"error\":\n return colors.error || chalk.white;\n case \"fatal\":\n return colors.fatal || chalk.white;\n default:\n return colors.info || chalk.white;\n }\n}\n\n/**\n * Formats a value for display.\n */\nexport function formatValue(value: any, expanded = false, collapseArrays = true): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return value.toString();\n if (value === null) return \"null\";\n if (value === undefined) return \"undefined\";\n if (Array.isArray(value)) return expanded ? JSON.stringify(value) : collapseArrays ? \"[...]\" : value.toString();\n if (typeof value === \"object\") return expanded ? JSON.stringify(value) : \"{...}\";\n return value.toString();\n}\n\n/**\n * Formats structured data for inline display with depth limiting.\n *\n * @param data - The data to format\n * @param config - View configuration for colors\n * @param maxDepth - Maximum depth for nested objects\n * @param expanded - Whether to show full depth (for inline view mode)\n * @param collapseArrays - Whether to collapse arrays to summary format\n * @returns Formatted data string\n */\nexport function formatInlineData(\n data: any,\n config: Required<ViewConfig>,\n maxDepth: number,\n expanded = false,\n collapseArrays = true,\n): string {\n if (!data) return \"\";\n\n const pairs: string[] = [];\n const traverse = (obj: any, prefix = \"\", depth = 0) => {\n if (!expanded && depth >= maxDepth) return;\n\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n if (expanded) {\n pairs.push(`${config.dataKeyColor(fullKey)}=${config.dataValueColor(JSON.stringify(value))}`);\n } else {\n traverse(value, fullKey, depth + 1);\n }\n } else {\n pairs.push(\n `${config.dataKeyColor(fullKey)}=${config.dataValueColor(formatValue(value, expanded, collapseArrays))}`,\n );\n }\n }\n };\n\n traverse(data);\n const result = pairs.join(\" \");\n // Remove truncation - inline view should show complete data without truncation\n return result;\n}\n","import type { LogEntry, PrettyTerminalViewMode, Runtime, SimpleViewConfig } from \"../types.js\";\nimport * as prettyjson from \"../vendor/prettyjson.js\";\nimport { formatInlineData, formatTimestamp, getLevelColor } from \"./utils.js\";\n\n/**\n * Handles rendering of the simple view mode.\n * Supports three display modes:\n * - Message-only: Shows timestamp, level and message\n * - Inline: Shows all details with complete data inline\n * - Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimpleView {\n private config: SimpleViewConfig;\n private viewMode: PrettyTerminalViewMode;\n private maxInlineDepth: number;\n private showLogId: boolean;\n private timestampFormat: string | ((timestamp: number) => string);\n private collapseArrays: boolean;\n private flattenNestedObjects: boolean;\n private runtime: Runtime;\n private includeDataInBrowserConsole: boolean;\n\n constructor(config: SimpleViewConfig) {\n this.config = config;\n this.viewMode = config.viewMode;\n this.maxInlineDepth = config.maxInlineDepth;\n this.showLogId = config.showLogId;\n this.timestampFormat = config.timestampFormat;\n this.collapseArrays = config.collapseArrays !== false;\n this.flattenNestedObjects = config.flattenNestedObjects !== false;\n this.runtime = config.runtime;\n this.includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n }\n\n public getConfig(): SimpleViewConfig {\n return this.config;\n }\n\n public getViewMode(): PrettyTerminalViewMode {\n return this.viewMode;\n }\n\n /**\n * Writes a message to the appropriate output based on runtime\n */\n private writeMessage(message: string, level?: string, data?: any): void {\n if (this.runtime === \"node\") {\n // Use process.stdout.write for Node.js\n process?.stdout?.write?.(`${message}\\n`);\n } else {\n // Use appropriate console method based on log level for browser\n const shouldIncludeData = this.includeDataInBrowserConsole && data !== undefined;\n\n switch (level) {\n case \"trace\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"debug\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"info\":\n if (shouldIncludeData) {\n console.info(message, data);\n } else {\n console.info(message);\n }\n break;\n case \"warn\":\n if (shouldIncludeData) {\n console.warn(message, data);\n } else {\n console.warn(message);\n }\n break;\n case \"error\":\n case \"fatal\":\n if (shouldIncludeData) {\n console.error(message, data);\n } else {\n console.error(message);\n }\n break;\n default:\n if (shouldIncludeData) {\n console.log(message, data);\n } else {\n console.log(message);\n }\n break;\n }\n }\n }\n\n /**\n * Renders a single log entry based on the current view mode\n */\n public renderLogLine(entry: LogEntry): void {\n const levelColor = getLevelColor(entry.level, this.config.config.colors);\n const chevron = levelColor(`▶ ${entry.level.toUpperCase()} `);\n const message = entry.message || \"(no message)\";\n const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor, this.timestampFormat);\n\n // Parse data for browser console inclusion\n const parsedData = entry.data ? JSON.parse(entry.data) : undefined;\n\n switch (this.viewMode) {\n case \"message-only\": {\n // Message-only view shows timestamp, level and message\n const condensedLine = `${timestamp} ${chevron}${message}`;\n this.writeMessage(condensedLine, entry.level, parsedData);\n break;\n }\n\n case \"inline\": {\n // Inline view shows all details with complete data inline\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(\n JSON.parse(entry.data),\n this.config.config,\n this.maxInlineDepth,\n !this.flattenNestedObjects,\n this.collapseArrays,\n )\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n // Don't wrap inline mode to preserve full content\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n\n case \"expanded\": {\n // Expanded view shows timestamp, level, and message on first line, with data on indented separate lines\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const firstLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}`;\n this.writeMessage(firstLine, entry.level, parsedData);\n\n if (entry.data) {\n const jsonLines = prettyjson\n .render(JSON.parse(entry.data), {\n defaultIndentation: 2,\n keysColor: this.config.config.dataKeyColor,\n dashColor: this.config.config.dataKeyColor,\n numberColor: this.config.config.dataValueColor,\n stringColor: this.config.config.dataValueColor,\n multilineStringColor: this.config.config.dataValueColor,\n positiveNumberColor: this.config.config.dataValueColor,\n negativeNumberColor: this.config.config.dataValueColor,\n booleanColor: this.config.config.dataValueColor,\n nullUndefinedColor: this.config.config.dataValueColor,\n dateColor: this.config.config.dataValueColor,\n collapseArrays: this.collapseArrays,\n })\n .split(\"\\n\");\n\n // Add each line with proper indentation (2 spaces at the beginning)\n for (const line of jsonLines) {\n if (line.trim() !== \"\") {\n this.writeMessage(` ${line}`, entry.level);\n }\n }\n }\n break;\n }\n\n default: {\n // Default to full view for any unexpected view modes\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(JSON.parse(entry.data), this.config.config, this.maxInlineDepth, true, this.collapseArrays)\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n }\n }\n}\n","/**\n * A transport for LogLayer that provides simple pretty terminal output.\n * This transport displays logs with theming and formatting but without interactive features.\n *\n * Features:\n * - Real-time log display with color-coded levels\n * - Configurable themes and colors\n * - Three view modes: inline, message-only, expanded\n * - JSON data pretty printing\n * - No interactive features (no keyboard navigation, no input)\n * - Browser and Node.js runtime support\n *\n * Usage:\n * ```typescript\n * const transport = new SimplePrettyTerminalTransport({\n * maxInlineDepth: 4,\n * maxInlineLength: 120,\n * theme: customTheme,\n * viewMode: \"inline\",\n * runtime: \"node\" // or \"browser\"\n * });\n * ```\n */\n\nimport type { LogLayerTransportParams } from \"@loglayer/transport\";\nimport { LoggerlessTransport } from \"@loglayer/transport\";\nimport chalk from \"chalk\";\nimport { sprintf } from \"sprintf-js\";\nimport { moonlight } from \"./themes.js\";\nimport type { PrettyTerminalViewMode, SimplePrettyTerminalConfig } from \"./types.js\";\nimport { SimpleView } from \"./views/SimpleView.js\";\n\n/**\n * Main transport class that handles simple pretty terminal output.\n * This class provides the display functionality of PrettyTerminal without interactive features.\n *\n * The transport supports three view modes:\n * 1. Inline: Shows all information with complete data structures inline (no truncation)\n * 2. Message-only: Shows only the timestamp, log level and message for a cleaner output (no data shown)\n * 3. Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimplePrettyTerminalTransport extends LoggerlessTransport {\n /** Handles rendering and formatting of logs */\n private renderer: SimpleView;\n\n /** Configuration options */\n private config: SimplePrettyTerminalConfig;\n\n /**\n * Creates a new SimplePrettyTerminalTransport instance.\n *\n * @param config - Configuration options for the transport\n */\n constructor(config: SimplePrettyTerminalConfig) {\n super(config);\n\n // Store configuration\n this.config = config;\n\n // If transport is disabled, don't initialize anything\n if (config.enabled === false) {\n return;\n }\n\n // Initialize configuration with defaults\n const maxInlineDepth = config.maxInlineDepth || 4;\n const theme = config.theme || moonlight;\n const viewMode = config.viewMode || \"inline\";\n const showLogId = config.showLogId || false;\n const timestampFormat = config.timestampFormat || \"HH:mm:ss.SSS\";\n const collapseArrays = config.collapseArrays !== false; // Default to true\n const flattenNestedObjects = config.flattenNestedObjects !== false; // Default to true\n const runtime = config.runtime;\n const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n\n // Initialize view configuration with defaults\n const viewConfig = {\n colors: {\n trace: chalk.gray, // Lowest level, used for verbose output\n debug: chalk.blue, // Debug information\n info: chalk.green, // Normal operation\n warn: chalk.yellow, // Warning conditions\n error: chalk.red, // Error conditions\n fatal: chalk.bgRed.white, // Critical errors\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n // Initialize the renderer\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth,\n showLogId,\n timestampFormat,\n collapseArrays,\n flattenNestedObjects,\n runtime,\n includeDataInBrowserConsole,\n config: viewConfig,\n });\n }\n\n /**\n * Generates a random ID for each log entry.\n * Uses base36 encoding for compact, readable IDs.\n *\n * @returns A 6-character string ID\n * @example\n * \"a1b2c3\" // Example generated ID\n */\n private generateId(): string {\n return Math.random().toString(36).substring(2, 8);\n }\n\n /**\n * Applies sprintf formatting to messages if enabled and applicable.\n * If the first message is a format string and there are additional arguments,\n * formats them using sprintf-js.\n *\n * @param messages - Array of message strings\n * @returns Formatted message string\n */\n private formatMessages(messages: any[]): string {\n if (!this.config.enableSprintf || messages.length < 2) {\n return messages.join(\" \");\n }\n\n const [format, ...args] = messages;\n\n // Only apply sprintf if the first argument is a string\n if (typeof format !== \"string\") {\n return messages.join(\" \");\n }\n\n try {\n return sprintf(format, ...args);\n } catch (_error) {\n // If sprintf fails, return original messages joined\n return messages.join(\" \");\n }\n }\n\n /**\n * Main transport method that receives logs from LogLayer.\n * This method is called for each log event and handles:\n * - Generating a unique ID for the log\n * - Converting the log data to a storable format\n * - Rendering the log using the SimpleView renderer\n *\n * @param logLevel - The severity level of the log\n * @param messages - Array of message strings to be joined\n * @param data - Additional structured data to be logged\n * @param hasData - Whether the log includes additional data\n * @returns The original messages array\n */\n shipToLogger({ logLevel, messages, data, hasData }: LogLayerTransportParams): any[] {\n // If transport is disabled, return messages without processing\n if (this.config.enabled === false) {\n return messages;\n }\n\n const entry = {\n id: this.generateId(),\n timestamp: Date.now(),\n level: logLevel,\n message: this.formatMessages(messages),\n data: hasData ? JSON.stringify(data) : null,\n };\n\n this.renderer.renderLogLine(entry);\n return messages;\n }\n\n /**\n * Changes the view mode for log display.\n *\n * @param viewMode - The new view mode to use\n */\n setViewMode(viewMode: PrettyTerminalViewMode): void {\n if (this.config.enabled === false) {\n return;\n }\n\n // Rebuild the viewConfig as in the constructor\n const theme = this.config.theme || moonlight;\n const runtime = this.config.runtime;\n const viewConfig = {\n colors: {\n trace: chalk.gray,\n debug: chalk.blue,\n info: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n fatal: chalk.bgRed.white,\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth: this.config.maxInlineDepth || 4,\n showLogId: this.config.showLogId || false,\n timestampFormat: this.config.timestampFormat || \"HH:mm:ss.SSS\",\n collapseArrays: this.config.collapseArrays !== false,\n flattenNestedObjects: this.config.flattenNestedObjects !== false,\n runtime,\n includeDataInBrowserConsole: this.config.includeDataInBrowserConsole || false,\n config: viewConfig,\n });\n }\n\n /**\n * Gets the current view mode.\n *\n * @returns The current view mode\n */\n getViewMode(): PrettyTerminalViewMode {\n return this.renderer.getViewMode();\n }\n}\n","import { SimplePrettyTerminalTransport } from \"./SimplePrettyTerminalTransport.js\";\nimport type {\n PrettyTerminalViewMode,\n Runtime,\n SimplePrettyTerminalConfig,\n SimplePrettyTerminalTheme,\n} from \"./types.js\";\n\n// Export chalk for custom theme creation\nexport * from \"chalk\";\n\n// Export the main transport class (for advanced usage)\nexport { SimplePrettyTerminalTransport };\n\n// Export all built-in themes\nexport * from \"./themes.js\";\n\n// Export essential types for configuration and custom themes\nexport type { SimplePrettyTerminalConfig, SimplePrettyTerminalTheme, PrettyTerminalViewMode, Runtime };\n\n// Main convenience function for creating the transport\nexport function getSimplePrettyTerminal(config: SimplePrettyTerminalConfig) {\n return new SimplePrettyTerminalTransport(config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,YAAuC;CAClD,QAAQ;EACN,OAAO,cAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,OAAO,cAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,MAAM,cAAM,IAAI,KAAK,KAAK,IAAI;EAC9B,MAAM,cAAM,IAAI,KAAK,KAAK,IAAI;EAC9B,OAAO,cAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,OAAO,cAAM,MAAM,KAAK,KAAK,IAAI,CAAC;EACnC;CACD,YAAY,cAAM,IAAI,IAAI,IAAI,IAAI;CAClC,gBAAgB,cAAM,IAAI,KAAK,KAAK,IAAI;CACxC,cAAc,cAAM,IAAI,KAAK,KAAK,IAAI;CACvC;;;;;;;;;;;;;;;;AAiBD,MAAa,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C7B;GACA,gBAAgB,KAAK,OAAO,kBAAkB;GAC9C,WAAW,KAAK,OAAO,aAAa;GACpC,iBAAiB,KAAK,OAAO,mBAAmB;GAChD,gBAAgB,KAAK,OAAO,mBAAmB;GAC/C,sBAAsB,KAAK,OAAO,yBAAyB;GAC3D;GACA,6BAA6B,KAAK,OAAO,+BAA+B;GACxE,QAAQ;GACT,CAAC;;;;;;;CAQJ,cAAsC;AACpC,SAAO,KAAK,SAAS,aAAa;;;;;;AC1MtC,SAAgB,wBAAwB,QAAoC;AAC1E,QAAO,IAAI,8BAA8B,OAAO"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Utils.indent","Utils.getMaxIndexLength","prettyjson\n .render","LoggerlessTransport"],"sources":["../src/themes.ts","../src/vendor/utils.js","../src/vendor/prettyjson.js","../src/views/utils.ts","../src/views/SimpleView.ts","../src/SimplePrettyTerminalTransport.ts","../src/index.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport type { SimplePrettyTerminalTheme } from \"./types.js\";\n\n/**\n * Moonlight - A dark theme with cool blue tones\n * Inspired by moonlit nights and modern IDEs\n *\n * Color Palette:\n * - Primary: Cool blues and soft greens\n * - Accents: Warm yellows and soft reds\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - Night-time coding sessions\n * - Environments where eye strain is a concern\n */\nexport const moonlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(114, 135, 153), // Muted blue-grey for less important info\n debug: chalk.rgb(130, 170, 255), // Soft blue that pops but doesn't strain\n info: chalk.rgb(195, 232, 141), // Sage green for good readability\n warn: chalk.rgb(255, 203, 107), // Warm yellow, less harsh than pure yellow\n error: chalk.rgb(247, 118, 142), // Soft red that stands out without being aggressive\n fatal: chalk.bgRgb(247, 118, 142).white, // Inverted soft red for maximum visibility\n },\n logIdColor: chalk.rgb(84, 98, 117), // Darker blue-grey for secondary information\n dataValueColor: chalk.rgb(209, 219, 231), // Light grey-blue for primary content\n dataKeyColor: chalk.rgb(130, 170, 255), // Matching debug blue for consistency\n};\n\n/**\n * Sunlight - A light theme with warm tones\n * Inspired by daylight reading and paper documentation\n *\n * Color Palette:\n * - Primary: Deep, rich colors that contrast well with white\n * - Accents: Earth tones and deep jewel tones\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Daytime coding sessions\n * - High-glare environments\n * - Printed documentation\n */\nexport const sunlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(110, 110, 110), // Dark grey for subtle information\n debug: chalk.rgb(32, 96, 159), // Deep blue for strong contrast on white\n info: chalk.rgb(35, 134, 54), // Forest green, easier on the eyes than bright green\n warn: chalk.rgb(176, 95, 0), // Brown-orange for natural warning color\n error: chalk.rgb(191, 0, 0), // Deep red for clear visibility on light backgrounds\n fatal: chalk.bgRgb(191, 0, 0).white, // White on deep red for critical issues\n },\n logIdColor: chalk.rgb(110, 110, 110),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(32, 96, 159),\n};\n\n/**\n * Neon - A dark theme with vibrant cyberpunk colors\n * Inspired by neon-lit cityscapes and retro-futuristic aesthetics\n *\n * Color Palette:\n * - Primary: Electric blues and hot pinks\n * - Accents: Bright purples and cyber greens\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - High-contrast preferences\n * - Modern, tech-focused applications\n */\nexport const neon: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(108, 108, 255), // Electric blue\n debug: chalk.rgb(255, 82, 246), // Hot pink\n info: chalk.rgb(0, 255, 163), // Cyber green\n warn: chalk.rgb(255, 231, 46), // Electric yellow\n error: chalk.rgb(255, 53, 91), // Neon red\n fatal: chalk.bgRgb(255, 53, 91).rgb(0, 255, 163), // Neon red bg with cyber green text\n },\n logIdColor: chalk.rgb(187, 134, 252), // Bright purple\n dataValueColor: chalk.rgb(255, 255, 255), // Pure white\n dataKeyColor: chalk.rgb(0, 255, 240), // Cyan\n};\n\n/**\n * Nature - A light theme with organic, earthy colors\n * Inspired by forest landscapes and natural elements\n *\n * Color Palette:\n * - Primary: Deep forest greens and rich browns\n * - Accents: Autumn reds and golden yellows\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Nature-inspired interfaces\n * - Applications focusing on readability\n */\nexport const nature: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(101, 115, 126), // Slate grey\n debug: chalk.rgb(34, 139, 34), // Forest green\n info: chalk.rgb(46, 139, 87), // Sea green\n warn: chalk.rgb(218, 165, 32), // Golden rod\n error: chalk.rgb(139, 69, 19), // Saddle brown\n fatal: chalk.bgRgb(139, 69, 19).white, // Brown background with white text\n },\n logIdColor: chalk.rgb(101, 115, 126),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(34, 139, 34),\n};\n\n/**\n * Pastel - A soft, calming theme with gentle colors\n * Inspired by watercolor paintings and soft aesthetics\n *\n * Color Palette:\n * - Primary: Soft pastels and muted tones\n * - Accents: Gentle pinks and light blues\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Long coding sessions\n * - Reduced visual stress\n */\nexport const pastel: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(200, 200, 200), // Light grey\n debug: chalk.rgb(173, 216, 230), // Light blue\n info: chalk.rgb(144, 238, 144), // Light green\n warn: chalk.rgb(255, 218, 185), // Peach\n error: chalk.rgb(255, 182, 193), // Light pink\n fatal: chalk.bgRgb(255, 182, 193).rgb(105, 105, 105), // Light pink bg with dim grey text\n },\n logIdColor: chalk.rgb(200, 200, 200),\n dataValueColor: chalk.rgb(105, 105, 105),\n dataKeyColor: chalk.rgb(173, 216, 230),\n};\n","/**\n * Creates a string with the same length as `numSpaces` parameter\n **/\nexport function indent(numSpaces) {\n return new Array(numSpaces + 1).join(\" \");\n}\n\n/**\n * Gets the string length of the longer index in a hash\n **/\nexport function getMaxIndexLength(input) {\n var maxWidth = 0;\n\n Object.getOwnPropertyNames(input).forEach((key) => {\n // Skip undefined values.\n if (input[key] === undefined) {\n return;\n }\n\n maxWidth = Math.max(maxWidth, key.length);\n });\n return maxWidth;\n}\n\nexport function isIsoStringDate(isoString) {\n if (typeof isoString !== \"string\") {\n return false;\n }\n // More flexible regex that handles:\n // - Optional milliseconds\n // - Optional timezone offset or Z\n // - Optional T separator (space also valid)\n if (!/^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$/.test(isoString)) {\n return false;\n }\n const testDate = new Date(isoString);\n return !Number.isNaN(testDate.getTime());\n}\n","// @ts-nocheck\nimport chalk from \"chalk\";\nimport * as Utils from \"./utils.js\";\nimport { isIsoStringDate } from \"./utils.js\";\n\nconst conflictChars = /[^\\w\\s\\n\\r\\v\\t.,]/i;\n\n// Helper function to detect if an object should be printed or ignored\nconst isPrintable = (input, options) => input !== undefined || options.renderUndefined;\n\n// Helper function to detect if an object can be directly serializable\nconst isSerializable = (input, onlyPrimitives, options) => {\n if (\n typeof input === \"boolean\" ||\n typeof input === \"number\" ||\n typeof input === \"function\" ||\n input === null ||\n input === undefined ||\n input instanceof Date\n ) {\n return true;\n }\n if (typeof input === \"string\" && input.indexOf(\"\\n\") === -1) {\n return true;\n }\n\n if (options.inlineArrays && !onlyPrimitives) {\n if (Array.isArray(input) && isSerializable(input[0], true, options)) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Function} colorFn\n * @param {PrettyJSONOptions} options\n */\nconst getColorRenderer = (colorFn, options) => {\n if (options.noColor) {\n return (text) => text;\n }\n\n if (typeof colorFn !== \"function\") {\n return (text) => text;\n }\n\n return colorFn;\n};\n\nconst addColorToData = (input, options) => {\n if (options.noColor) {\n return input;\n }\n\n if (input instanceof Date) {\n return getColorRenderer(options.dateColor, options)(input.toISOString());\n }\n if (typeof input === \"string\") {\n if (isIsoStringDate(input)) {\n return getColorRenderer(options.dateColor, options)(input);\n }\n // Print strings in regular terminal color\n return getColorRenderer(options.stringColor, options)(input);\n }\n\n const sInput = `${input}`;\n\n if (typeof input === \"boolean\") {\n return getColorRenderer(options.booleanColor, options)(sInput);\n }\n if (input === null || input === undefined) {\n return getColorRenderer(options.nullUndefinedColor, options)(sInput);\n }\n if (typeof input === \"number\") {\n if (input >= 0) {\n return getColorRenderer(options.positiveNumberColor, options)(sInput);\n }\n return getColorRenderer(options.negativeNumberColor, options)(sInput);\n }\n if (typeof input === \"function\") {\n return \"function() {}\";\n }\n\n if (Array.isArray(input)) {\n return input.join(\", \");\n }\n\n return sInput;\n};\n\nconst colorMultilineString = (options, line) => getColorRenderer(options.multilineStringColor, options)(line);\n\nconst indentLines = (string, spaces, options) => {\n let lines = string.split(\"\\n\");\n lines = lines.map((line) => Utils.indent(spaces) + colorMultilineString(options, line));\n return lines.join(\"\\n\");\n};\n\nconst renderToArray = (data, options, indentation) => {\n if (typeof data === \"string\" && data.match(conflictChars) && options.escape) {\n data = JSON.stringify(data);\n }\n\n if (!isPrintable(data, options)) {\n return [];\n }\n\n if (isSerializable(data, false, options)) {\n return [Utils.indent(indentation) + addColorToData(data, options)];\n }\n\n // Unserializable string means it's multiline\n if (typeof data === \"string\") {\n return [\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n indentLines(data, indentation + options.defaultIndentation, options),\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n ];\n }\n\n if (Array.isArray(data)) {\n // If the array is empty, render the `emptyArrayMsg`\n if (data.length === 0) {\n return [Utils.indent(indentation) + options.emptyArrayMsg];\n }\n\n // If arrays should be collapsed and there's data, show [...]\n if (options.collapseArrays && data.length > 0) {\n return [`${Utils.indent(indentation)}[... ${data.length} items]`];\n }\n\n const outputArray = [];\n\n data.forEach((element) => {\n if (!isPrintable(element, options)) {\n return;\n }\n\n // Prepend the dash at the beginning of each array's element line\n let line = \"- \";\n line = getColorRenderer(options.dashColor, options)(line);\n line = Utils.indent(indentation) + line;\n\n // If the element of the array is a string, bool, number, or null\n // render it in the same line\n if (isSerializable(element, false, options)) {\n line += renderToArray(element, options, 0)[0];\n outputArray.push(line);\n\n // If the element is an array or object, render it in next line\n } else {\n outputArray.push(line);\n outputArray.push.apply(outputArray, renderToArray(element, options, indentation + options.defaultIndentation));\n }\n });\n\n return outputArray;\n }\n\n if (data instanceof Error) {\n return renderToArray(\n {\n message: data.message,\n stack: data.stack.split(\"\\n\"),\n },\n options,\n indentation,\n );\n }\n\n // If values alignment is enabled, get the size of the longest index\n // to align all the values\n const maxIndexLength = options.noAlign ? 0 : Utils.getMaxIndexLength(data);\n let key;\n const output = [];\n\n Object.getOwnPropertyNames(data).forEach((i) => {\n if (!isPrintable(data[i], options)) {\n return;\n }\n\n // Prepend the index at the beginning of the line\n key = `${i}: `;\n key = getColorRenderer(options.keysColor, options)(key);\n key = Utils.indent(indentation) + key;\n\n // If the value is serializable, render it in the same line\n if (isSerializable(data[i], false, options)) {\n const nextIndentation = options.noAlign ? 0 : maxIndexLength - i.length;\n key += renderToArray(data[i], options, nextIndentation)[0];\n output.push(key);\n\n // If the index is an array or object, render it in next line\n } else {\n output.push(key);\n output.push.apply(output, renderToArray(data[i], options, indentation + options.defaultIndentation));\n }\n });\n return output;\n};\n/**\n * @typedef {Object} PrettyJSONOptions\n * @property {Function} [stringColor=null] Chalk color function for strings\n * @property {Function} [multilineStringColor=null] Chalk color function for multiline strings\n * @property {Function} [keysColor=chalk.green] Chalk color function for keys in hashes\n * @property {Function} [dashColor=chalk.green] Chalk color function for dashes in arrays\n * @property {Function} [numberColor=chalk.blue] Default Chalk color function for numbers\n * @property {Function} [positiveNumberColor=numberColor] Chalk color function for positive numbers\n * @property {Function} [negativeNumberColor=numberColor] Chalk color function for negative numbers\n * @property {Function} [booleanColor=chalk.cyan] Chalk color function for boolean values\n * @property {Function} [nullUndefinedColor=chalk.grey] Chalk color function for null || undefined\n * @property {Function} [dateColor=chalk.magenta] Chalk color function for Date objects\n * @property {number} [defaultIndentation=2] Indentation spaces per object level\n * @property {string} [emptyArrayMsg=\"(empty array)\"] Replace empty strings with\n * @property {boolean} [noColor] Flag to disable colors\n * @property {boolean} [noAlign] Flag to disable alignment\n * @property {boolean} [escape] Flag to escape printed content\n * @property {boolean} [collapseArrays] Flag to collapse arrays\n */\n/**\n * Mutating function that ensures we have a valid options object\n * @param {PrettyJSONOptions} options\n * @returns PrettyJSONOptions\n */\nconst validateOptionsAndSetDefaults = (options) => {\n options = options || {};\n options.emptyArrayMsg = options.emptyArrayMsg || \"(empty array)\";\n options.keysColor = options.keysColor || chalk.green;\n options.dashColor = options.dashColor || chalk.green;\n options.booleanColor = options.booleanColor || chalk.cyan;\n options.nullUndefinedColor = options.nullUndefinedColor || chalk.grey;\n options.numberColor = options.numberColor || chalk.blue;\n options.positiveNumberColor = options.positiveNumberColor || options.numberColor;\n options.negativeNumberColor = options.negativeNumberColor || options.numberColor;\n options.dateColor = options.dateColor || chalk.magenta;\n options.defaultIndentation = options.defaultIndentation || 2;\n options.noColor = !!options.noColor;\n options.noAlign = !!options.noAlign;\n options.escape = !!options.escape;\n options.renderUndefined = !!options.renderUndefined;\n options.collapseArrays = !!options.collapseArrays;\n\n options.stringColor = options.stringColor || null;\n options.multilineStringColor = options.multilineStringColor || options.stringColor || null;\n\n return options;\n};\n/**\n * ### Render function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * stringColor: 'grey', // Color for strings\n * multilineStringColor: 'cyan' // Color for multiline strings\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n * @returns string with the rendered data\n */\nexport function render(data, options, indentation) {\n // Default values\n indentation = indentation || 0;\n options = validateOptionsAndSetDefaults(options);\n\n return renderToArray(data, options, indentation).join(\"\\n\");\n}\n\n/**\n * ### Render from string function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n */\nexport function renderString(data, options, indentation) {\n let output = \"\";\n let parsedData;\n // If the input is not a string or if it's empty, just return an empty string\n if (typeof data !== \"string\" || data === \"\") {\n return \"\";\n }\n\n // Remove non-JSON characters from the beginning string\n if (data[0] !== \"{\" && data[0] !== \"[\") {\n let beginingOfJson;\n if (data.indexOf(\"{\") === -1) {\n beginingOfJson = data.indexOf(\"[\");\n } else if (data.indexOf(\"[\") === -1) {\n beginingOfJson = data.indexOf(\"{\");\n } else if (data.indexOf(\"{\") < data.indexOf(\"[\")) {\n beginingOfJson = data.indexOf(\"{\");\n } else {\n beginingOfJson = data.indexOf(\"[\");\n }\n output += `${data.substr(0, beginingOfJson)}\\n`;\n data = data.substr(beginingOfJson);\n }\n\n try {\n parsedData = JSON.parse(data);\n } catch (_e) {\n // Return an error in case of an invalid JSON\n return `${chalk.red(\"Error:\")} Not valid JSON!`;\n }\n\n // Call the real render() method\n output += exports.render(parsedData, options, indentation);\n return output;\n}\n","import chalk from \"chalk\";\nimport { format } from \"date-fns\";\nimport type { ColorConfig, ViewConfig } from \"../types.js\";\n\n/**\n * Formats a timestamp into a readable string.\n *\n * @param timestamp - Unix timestamp in milliseconds\n * @param colorFn - Chalk function to color the timestamp\n * @param timestampFormat - Custom format string (date-fns) or function. Defaults to \"HH:mm:ss.SSS\"\n * @returns Formatted timestamp string\n */\nexport function formatTimestamp(\n timestamp: number,\n colorFn: typeof chalk.white,\n timestampFormat: string | ((timestamp: number) => string) = \"HH:mm:ss.SSS\",\n): string {\n let formattedTime: string;\n\n if (typeof timestampFormat === \"function\") {\n formattedTime = timestampFormat(timestamp);\n } else {\n const date = new Date(timestamp);\n formattedTime = format(date, timestampFormat);\n }\n\n return colorFn(`[${formattedTime}]`);\n}\n\n/**\n * Gets the appropriate color function for a log level.\n *\n * @param level - Log level string\n * @param colors - Color configuration object\n * @returns Chalk function for the log level\n */\nexport function getLevelColor(level: string, colors: ColorConfig): typeof chalk.white {\n const levelLower = level.toLowerCase();\n\n switch (levelLower) {\n case \"trace\":\n return colors.trace || chalk.white;\n case \"debug\":\n return colors.debug || chalk.white;\n case \"info\":\n return colors.info || chalk.white;\n case \"warn\":\n return colors.warn || chalk.white;\n case \"error\":\n return colors.error || chalk.white;\n case \"fatal\":\n return colors.fatal || chalk.white;\n default:\n return colors.info || chalk.white;\n }\n}\n\n/**\n * Formats a value for display.\n */\nexport function formatValue(value: any, expanded = false, collapseArrays = true): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return value.toString();\n if (value === null) return \"null\";\n if (value === undefined) return \"undefined\";\n if (Array.isArray(value)) return expanded ? JSON.stringify(value) : collapseArrays ? \"[...]\" : value.toString();\n if (typeof value === \"object\") return expanded ? JSON.stringify(value) : \"{...}\";\n return value.toString();\n}\n\n/**\n * Formats structured data for inline display with depth limiting.\n *\n * @param data - The data to format\n * @param config - View configuration for colors\n * @param maxDepth - Maximum depth for nested objects\n * @param expanded - Whether to show full depth (for inline view mode)\n * @param collapseArrays - Whether to collapse arrays to summary format\n * @returns Formatted data string\n */\nexport function formatInlineData(\n data: any,\n config: Required<ViewConfig>,\n maxDepth: number,\n expanded = false,\n collapseArrays = true,\n): string {\n if (!data) return \"\";\n\n const pairs: string[] = [];\n const traverse = (obj: any, prefix = \"\", depth = 0) => {\n if (!expanded && depth >= maxDepth) return;\n\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n if (expanded) {\n pairs.push(`${config.dataKeyColor(fullKey)}=${config.dataValueColor(JSON.stringify(value))}`);\n } else {\n traverse(value, fullKey, depth + 1);\n }\n } else {\n pairs.push(\n `${config.dataKeyColor(fullKey)}=${config.dataValueColor(formatValue(value, expanded, collapseArrays))}`,\n );\n }\n }\n };\n\n traverse(data);\n const result = pairs.join(\" \");\n // Remove truncation - inline view should show complete data without truncation\n return result;\n}\n","import type { LogEntry, PrettyTerminalViewMode, Runtime, SimpleViewConfig } from \"../types.js\";\nimport * as prettyjson from \"../vendor/prettyjson.js\";\nimport { formatInlineData, formatTimestamp, getLevelColor } from \"./utils.js\";\n\n/**\n * Handles rendering of the simple view mode.\n * Supports three display modes:\n * - Message-only: Shows timestamp, level and message\n * - Inline: Shows all details with complete data inline\n * - Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimpleView {\n private config: SimpleViewConfig;\n private viewMode: PrettyTerminalViewMode;\n private maxInlineDepth: number;\n private showLogId: boolean;\n private timestampFormat: string | ((timestamp: number) => string);\n private collapseArrays: boolean;\n private flattenNestedObjects: boolean;\n private runtime: Runtime;\n private includeDataInBrowserConsole: boolean;\n\n constructor(config: SimpleViewConfig) {\n this.config = config;\n this.viewMode = config.viewMode;\n this.maxInlineDepth = config.maxInlineDepth;\n this.showLogId = config.showLogId;\n this.timestampFormat = config.timestampFormat;\n this.collapseArrays = config.collapseArrays !== false;\n this.flattenNestedObjects = config.flattenNestedObjects !== false;\n this.runtime = config.runtime;\n this.includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n }\n\n public getConfig(): SimpleViewConfig {\n return this.config;\n }\n\n public getViewMode(): PrettyTerminalViewMode {\n return this.viewMode;\n }\n\n /**\n * Writes a message to the appropriate output based on runtime\n */\n private writeMessage(message: string, level?: string, data?: any): void {\n if (this.runtime === \"node\") {\n // Use process.stdout.write for Node.js\n process?.stdout?.write?.(`${message}\\n`);\n } else {\n // Use appropriate console method based on log level for browser\n const shouldIncludeData = this.includeDataInBrowserConsole && data !== undefined;\n\n switch (level) {\n case \"trace\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"debug\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"info\":\n if (shouldIncludeData) {\n console.info(message, data);\n } else {\n console.info(message);\n }\n break;\n case \"warn\":\n if (shouldIncludeData) {\n console.warn(message, data);\n } else {\n console.warn(message);\n }\n break;\n case \"error\":\n case \"fatal\":\n if (shouldIncludeData) {\n console.error(message, data);\n } else {\n console.error(message);\n }\n break;\n default:\n if (shouldIncludeData) {\n console.log(message, data);\n } else {\n console.log(message);\n }\n break;\n }\n }\n }\n\n /**\n * Renders a single log entry based on the current view mode\n */\n public renderLogLine(entry: LogEntry): void {\n const levelColor = getLevelColor(entry.level, this.config.config.colors);\n const chevron = levelColor(`▶ ${entry.level.toUpperCase()} `);\n const message = entry.message || \"(no message)\";\n const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor, this.timestampFormat);\n\n // Parse data for browser console inclusion\n const parsedData = entry.data ? JSON.parse(entry.data) : undefined;\n\n switch (this.viewMode) {\n case \"message-only\": {\n // Message-only view shows timestamp, level and message\n const condensedLine = `${timestamp} ${chevron}${message}`;\n this.writeMessage(condensedLine, entry.level, parsedData);\n break;\n }\n\n case \"inline\": {\n // Inline view shows all details with complete data inline\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(\n JSON.parse(entry.data),\n this.config.config,\n this.maxInlineDepth,\n !this.flattenNestedObjects,\n this.collapseArrays,\n )\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n // Don't wrap inline mode to preserve full content\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n\n case \"expanded\": {\n // Expanded view shows timestamp, level, and message on first line, with data on indented separate lines\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const firstLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}`;\n this.writeMessage(firstLine, entry.level, parsedData);\n\n if (entry.data) {\n const jsonLines = prettyjson\n .render(JSON.parse(entry.data), {\n defaultIndentation: 2,\n keysColor: this.config.config.dataKeyColor,\n dashColor: this.config.config.dataKeyColor,\n numberColor: this.config.config.dataValueColor,\n stringColor: this.config.config.dataValueColor,\n multilineStringColor: this.config.config.dataValueColor,\n positiveNumberColor: this.config.config.dataValueColor,\n negativeNumberColor: this.config.config.dataValueColor,\n booleanColor: this.config.config.dataValueColor,\n nullUndefinedColor: this.config.config.dataValueColor,\n dateColor: this.config.config.dataValueColor,\n collapseArrays: this.collapseArrays,\n })\n .split(\"\\n\");\n\n // Add each line with proper indentation (2 spaces at the beginning)\n for (const line of jsonLines) {\n if (line.trim() !== \"\") {\n this.writeMessage(` ${line}`, entry.level);\n }\n }\n }\n break;\n }\n\n default: {\n // Default to full view for any unexpected view modes\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(JSON.parse(entry.data), this.config.config, this.maxInlineDepth, true, this.collapseArrays)\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n }\n }\n}\n","/**\n * A transport for LogLayer that provides simple pretty terminal output.\n * This transport displays logs with theming and formatting but without interactive features.\n *\n * Features:\n * - Real-time log display with color-coded levels\n * - Configurable themes and colors\n * - Three view modes: inline, message-only, expanded\n * - JSON data pretty printing\n * - No interactive features (no keyboard navigation, no input)\n * - Browser and Node.js runtime support\n *\n * Usage:\n * ```typescript\n * const transport = new SimplePrettyTerminalTransport({\n * maxInlineDepth: 4,\n * maxInlineLength: 120,\n * theme: customTheme,\n * viewMode: \"inline\",\n * runtime: \"node\" // or \"browser\"\n * });\n * ```\n */\n\nimport type { LogLayerTransportParams } from \"@loglayer/transport\";\nimport { LoggerlessTransport } from \"@loglayer/transport\";\nimport chalk from \"chalk\";\nimport { sprintf } from \"sprintf-js\";\nimport { moonlight } from \"./themes.js\";\nimport type { PrettyTerminalViewMode, SimplePrettyTerminalConfig } from \"./types.js\";\nimport { SimpleView } from \"./views/SimpleView.js\";\n\n/**\n * Main transport class that handles simple pretty terminal output.\n * This class provides the display functionality of PrettyTerminal without interactive features.\n *\n * The transport supports three view modes:\n * 1. Inline: Shows all information with complete data structures inline (no truncation)\n * 2. Message-only: Shows only the timestamp, log level and message for a cleaner output (no data shown)\n * 3. Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimplePrettyTerminalTransport extends LoggerlessTransport {\n /** Handles rendering and formatting of logs */\n private renderer: SimpleView;\n\n /** Configuration options */\n private config: SimplePrettyTerminalConfig;\n\n /**\n * Creates a new SimplePrettyTerminalTransport instance.\n *\n * @param config - Configuration options for the transport\n */\n constructor(config: SimplePrettyTerminalConfig) {\n super(config);\n\n // Store configuration\n this.config = config;\n\n // If transport is disabled, don't initialize anything\n if (config.enabled === false) {\n return;\n }\n\n // Initialize configuration with defaults\n const maxInlineDepth = config.maxInlineDepth || 4;\n const theme = config.theme || moonlight;\n const viewMode = config.viewMode || \"inline\";\n const showLogId = config.showLogId || false;\n const timestampFormat = config.timestampFormat || \"HH:mm:ss.SSS\";\n const collapseArrays = config.collapseArrays !== false; // Default to true\n const flattenNestedObjects = config.flattenNestedObjects !== false; // Default to true\n const runtime = config.runtime;\n const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n\n // Initialize view configuration with defaults\n const viewConfig = {\n colors: {\n trace: chalk.gray, // Lowest level, used for verbose output\n debug: chalk.blue, // Debug information\n info: chalk.green, // Normal operation\n warn: chalk.yellow, // Warning conditions\n error: chalk.red, // Error conditions\n fatal: chalk.bgRed.white, // Critical errors\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n // Initialize the renderer\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth,\n showLogId,\n timestampFormat,\n collapseArrays,\n flattenNestedObjects,\n runtime,\n includeDataInBrowserConsole,\n config: viewConfig,\n });\n }\n\n /**\n * Generates a random ID for each log entry.\n * Uses base36 encoding for compact, readable IDs.\n *\n * @returns A 6-character string ID\n * @example\n * \"a1b2c3\" // Example generated ID\n */\n private generateId(): string {\n return Math.random().toString(36).substring(2, 8);\n }\n\n /**\n * Applies sprintf formatting to messages if enabled and applicable.\n * If the first message is a format string and there are additional arguments,\n * formats them using sprintf-js.\n *\n * @param messages - Array of message strings\n * @returns Formatted message string\n */\n private formatMessages(messages: any[]): string {\n if (!this.config.enableSprintf || messages.length < 2) {\n return messages.join(\" \");\n }\n\n const [format, ...args] = messages;\n\n // Only apply sprintf if the first argument is a string\n if (typeof format !== \"string\") {\n return messages.join(\" \");\n }\n\n try {\n return sprintf(format, ...args);\n } catch (_error) {\n // If sprintf fails, return original messages joined\n return messages.join(\" \");\n }\n }\n\n /**\n * Main transport method that receives logs from LogLayer.\n * This method is called for each log event and handles:\n * - Generating a unique ID for the log\n * - Converting the log data to a storable format\n * - Rendering the log using the SimpleView renderer\n *\n * @param logLevel - The severity level of the log\n * @param messages - Array of message strings to be joined\n * @param data - Additional structured data to be logged\n * @param hasData - Whether the log includes additional data\n * @returns The original messages array\n */\n shipToLogger({ logLevel, messages, data, hasData }: LogLayerTransportParams): any[] {\n // If transport is disabled, return messages without processing\n if (this.config.enabled === false) {\n return messages;\n }\n\n const entry = {\n id: this.generateId(),\n timestamp: Date.now(),\n level: logLevel,\n message: this.formatMessages(messages),\n data: hasData ? JSON.stringify(data) : null,\n };\n\n this.renderer.renderLogLine(entry);\n return messages;\n }\n\n /**\n * Changes the view mode for log display.\n *\n * @param viewMode - The new view mode to use\n */\n setViewMode(viewMode: PrettyTerminalViewMode): void {\n if (this.config.enabled === false) {\n return;\n }\n\n // Rebuild the viewConfig as in the constructor\n const theme = this.config.theme || moonlight;\n const runtime = this.config.runtime;\n const viewConfig = {\n colors: {\n trace: chalk.gray,\n debug: chalk.blue,\n info: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n fatal: chalk.bgRed.white,\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth: this.config.maxInlineDepth || 4,\n showLogId: this.config.showLogId || false,\n timestampFormat: this.config.timestampFormat || \"HH:mm:ss.SSS\",\n collapseArrays: this.config.collapseArrays !== false,\n flattenNestedObjects: this.config.flattenNestedObjects !== false,\n runtime,\n includeDataInBrowserConsole: this.config.includeDataInBrowserConsole || false,\n config: viewConfig,\n });\n }\n\n /**\n * Gets the current view mode.\n *\n * @returns The current view mode\n */\n getViewMode(): PrettyTerminalViewMode {\n return this.renderer.getViewMode();\n }\n}\n","import { SimplePrettyTerminalTransport } from \"./SimplePrettyTerminalTransport.js\";\nimport type {\n PrettyTerminalViewMode,\n Runtime,\n SimplePrettyTerminalConfig,\n SimplePrettyTerminalTheme,\n} from \"./types.js\";\n\n// Export chalk for custom theme creation\nexport * from \"chalk\";\n// Export all built-in themes\nexport * from \"./themes.js\";\n// Export essential types for configuration and custom themes\nexport type { PrettyTerminalViewMode, Runtime, SimplePrettyTerminalConfig, SimplePrettyTerminalTheme };\n// Export the main transport class (for advanced usage)\nexport { SimplePrettyTerminalTransport };\n\n// Main convenience function for creating the transport\nexport function getSimplePrettyTerminal(config: SimplePrettyTerminalConfig) {\n return new SimplePrettyTerminalTransport(config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAA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AA6B,KAAK,OAAO,+BAA+B;GACxE,QAAQ;EACV,CAAC;CACH;;;;;;CAOA,cAAsC;EACpC,OAAO,KAAK,SAAS,YAAY;CACnC;AACF;;;AC/MA,SAAgB,wBAAwB,QAAoC;CAC1E,OAAO,IAAI,8BAA8B,MAAM;AACjD"}
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,7 @@ import { LoggerlessTransport } from "@loglayer/transport";
|
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { sprintf } from "sprintf-js";
|
|
4
4
|
import { format } from "date-fns";
|
|
5
|
-
|
|
6
|
-
export * from "chalk"
|
|
7
|
-
|
|
5
|
+
export * from "chalk";
|
|
8
6
|
//#region src/themes.ts
|
|
9
7
|
/**
|
|
10
8
|
* Moonlight - A dark theme with cool blue tones
|
|
@@ -142,7 +140,6 @@ const pastel = {
|
|
|
142
140
|
dataValueColor: chalk.rgb(105, 105, 105),
|
|
143
141
|
dataKeyColor: chalk.rgb(173, 216, 230)
|
|
144
142
|
};
|
|
145
|
-
|
|
146
143
|
//#endregion
|
|
147
144
|
//#region src/vendor/utils.js
|
|
148
145
|
/**
|
|
@@ -168,7 +165,6 @@ function isIsoStringDate(isoString) {
|
|
|
168
165
|
const testDate = new Date(isoString);
|
|
169
166
|
return !Number.isNaN(testDate.getTime());
|
|
170
167
|
}
|
|
171
|
-
|
|
172
168
|
//#endregion
|
|
173
169
|
//#region src/vendor/prettyjson.js
|
|
174
170
|
const conflictChars = /[^\w\s\n\r\v\t.,]/i;
|
|
@@ -335,7 +331,6 @@ function render(data, options, indentation) {
|
|
|
335
331
|
options = validateOptionsAndSetDefaults(options);
|
|
336
332
|
return renderToArray(data, options, indentation).join("\n");
|
|
337
333
|
}
|
|
338
|
-
|
|
339
334
|
//#endregion
|
|
340
335
|
//#region src/views/utils.ts
|
|
341
336
|
/**
|
|
@@ -407,7 +402,6 @@ function formatInlineData(data, config, maxDepth, expanded = false, collapseArra
|
|
|
407
402
|
traverse(data);
|
|
408
403
|
return pairs.join(" ");
|
|
409
404
|
}
|
|
410
|
-
|
|
411
405
|
//#endregion
|
|
412
406
|
//#region src/views/SimpleView.ts
|
|
413
407
|
/**
|
|
@@ -534,7 +528,6 @@ var SimpleView = class {
|
|
|
534
528
|
}
|
|
535
529
|
}
|
|
536
530
|
};
|
|
537
|
-
|
|
538
531
|
//#endregion
|
|
539
532
|
//#region src/SimplePrettyTerminalTransport.ts
|
|
540
533
|
/**
|
|
@@ -568,6 +561,21 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
|
|
|
568
561
|
const collapseArrays = config.collapseArrays !== false;
|
|
569
562
|
const flattenNestedObjects = config.flattenNestedObjects !== false;
|
|
570
563
|
const runtime = config.runtime;
|
|
564
|
+
const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;
|
|
565
|
+
const viewConfig = {
|
|
566
|
+
colors: {
|
|
567
|
+
trace: chalk.gray,
|
|
568
|
+
debug: chalk.blue,
|
|
569
|
+
info: chalk.green,
|
|
570
|
+
warn: chalk.yellow,
|
|
571
|
+
error: chalk.red,
|
|
572
|
+
fatal: chalk.bgRed.white,
|
|
573
|
+
...theme.colors
|
|
574
|
+
},
|
|
575
|
+
logIdColor: theme.logIdColor || chalk.dim,
|
|
576
|
+
dataValueColor: theme.dataValueColor || chalk.white,
|
|
577
|
+
dataKeyColor: theme.dataKeyColor || chalk.dim
|
|
578
|
+
};
|
|
571
579
|
this.renderer = new SimpleView({
|
|
572
580
|
viewMode,
|
|
573
581
|
maxInlineDepth,
|
|
@@ -576,21 +584,8 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
|
|
|
576
584
|
collapseArrays,
|
|
577
585
|
flattenNestedObjects,
|
|
578
586
|
runtime,
|
|
579
|
-
includeDataInBrowserConsole
|
|
580
|
-
config:
|
|
581
|
-
colors: {
|
|
582
|
-
trace: chalk.gray,
|
|
583
|
-
debug: chalk.blue,
|
|
584
|
-
info: chalk.green,
|
|
585
|
-
warn: chalk.yellow,
|
|
586
|
-
error: chalk.red,
|
|
587
|
-
fatal: chalk.bgRed.white,
|
|
588
|
-
...theme.colors
|
|
589
|
-
},
|
|
590
|
-
logIdColor: theme.logIdColor || chalk.dim,
|
|
591
|
-
dataValueColor: theme.dataValueColor || chalk.white,
|
|
592
|
-
dataKeyColor: theme.dataKeyColor || chalk.dim
|
|
593
|
-
}
|
|
587
|
+
includeDataInBrowserConsole,
|
|
588
|
+
config: viewConfig
|
|
594
589
|
});
|
|
595
590
|
}
|
|
596
591
|
/**
|
|
@@ -691,13 +686,12 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
|
|
|
691
686
|
return this.renderer.getViewMode();
|
|
692
687
|
}
|
|
693
688
|
};
|
|
694
|
-
|
|
695
689
|
//#endregion
|
|
696
690
|
//#region src/index.ts
|
|
697
691
|
function getSimplePrettyTerminal(config) {
|
|
698
692
|
return new SimplePrettyTerminalTransport(config);
|
|
699
693
|
}
|
|
700
|
-
|
|
701
694
|
//#endregion
|
|
702
695
|
export { SimplePrettyTerminalTransport, getSimplePrettyTerminal, moonlight, nature, neon, pastel, sunlight };
|
|
696
|
+
|
|
703
697
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Utils.indent","Utils.getMaxIndexLength","prettyjson\n .render"],"sources":["../src/themes.ts","../src/vendor/utils.js","../src/vendor/prettyjson.js","../src/views/utils.ts","../src/views/SimpleView.ts","../src/SimplePrettyTerminalTransport.ts","../src/index.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport type { SimplePrettyTerminalTheme } from \"./types.js\";\n\n/**\n * Moonlight - A dark theme with cool blue tones\n * Inspired by moonlit nights and modern IDEs\n *\n * Color Palette:\n * - Primary: Cool blues and soft greens\n * - Accents: Warm yellows and soft reds\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - Night-time coding sessions\n * - Environments where eye strain is a concern\n */\nexport const moonlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(114, 135, 153), // Muted blue-grey for less important info\n debug: chalk.rgb(130, 170, 255), // Soft blue that pops but doesn't strain\n info: chalk.rgb(195, 232, 141), // Sage green for good readability\n warn: chalk.rgb(255, 203, 107), // Warm yellow, less harsh than pure yellow\n error: chalk.rgb(247, 118, 142), // Soft red that stands out without being aggressive\n fatal: chalk.bgRgb(247, 118, 142).white, // Inverted soft red for maximum visibility\n },\n logIdColor: chalk.rgb(84, 98, 117), // Darker blue-grey for secondary information\n dataValueColor: chalk.rgb(209, 219, 231), // Light grey-blue for primary content\n dataKeyColor: chalk.rgb(130, 170, 255), // Matching debug blue for consistency\n};\n\n/**\n * Sunlight - A light theme with warm tones\n * Inspired by daylight reading and paper documentation\n *\n * Color Palette:\n * - Primary: Deep, rich colors that contrast well with white\n * - Accents: Earth tones and deep jewel tones\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Daytime coding sessions\n * - High-glare environments\n * - Printed documentation\n */\nexport const sunlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(110, 110, 110), // Dark grey for subtle information\n debug: chalk.rgb(32, 96, 159), // Deep blue for strong contrast on white\n info: chalk.rgb(35, 134, 54), // Forest green, easier on the eyes than bright green\n warn: chalk.rgb(176, 95, 0), // Brown-orange for natural warning color\n error: chalk.rgb(191, 0, 0), // Deep red for clear visibility on light backgrounds\n fatal: chalk.bgRgb(191, 0, 0).white, // White on deep red for critical issues\n },\n logIdColor: chalk.rgb(110, 110, 110),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(32, 96, 159),\n};\n\n/**\n * Neon - A dark theme with vibrant cyberpunk colors\n * Inspired by neon-lit cityscapes and retro-futuristic aesthetics\n *\n * Color Palette:\n * - Primary: Electric blues and hot pinks\n * - Accents: Bright purples and cyber greens\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - High-contrast preferences\n * - Modern, tech-focused applications\n */\nexport const neon: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(108, 108, 255), // Electric blue\n debug: chalk.rgb(255, 82, 246), // Hot pink\n info: chalk.rgb(0, 255, 163), // Cyber green\n warn: chalk.rgb(255, 231, 46), // Electric yellow\n error: chalk.rgb(255, 53, 91), // Neon red\n fatal: chalk.bgRgb(255, 53, 91).rgb(0, 255, 163), // Neon red bg with cyber green text\n },\n logIdColor: chalk.rgb(187, 134, 252), // Bright purple\n dataValueColor: chalk.rgb(255, 255, 255), // Pure white\n dataKeyColor: chalk.rgb(0, 255, 240), // Cyan\n};\n\n/**\n * Nature - A light theme with organic, earthy colors\n * Inspired by forest landscapes and natural elements\n *\n * Color Palette:\n * - Primary: Deep forest greens and rich browns\n * - Accents: Autumn reds and golden yellows\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Nature-inspired interfaces\n * - Applications focusing on readability\n */\nexport const nature: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(101, 115, 126), // Slate grey\n debug: chalk.rgb(34, 139, 34), // Forest green\n info: chalk.rgb(46, 139, 87), // Sea green\n warn: chalk.rgb(218, 165, 32), // Golden rod\n error: chalk.rgb(139, 69, 19), // Saddle brown\n fatal: chalk.bgRgb(139, 69, 19).white, // Brown background with white text\n },\n logIdColor: chalk.rgb(101, 115, 126),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(34, 139, 34),\n};\n\n/**\n * Pastel - A soft, calming theme with gentle colors\n * Inspired by watercolor paintings and soft aesthetics\n *\n * Color Palette:\n * - Primary: Soft pastels and muted tones\n * - Accents: Gentle pinks and light blues\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Long coding sessions\n * - Reduced visual stress\n */\nexport const pastel: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(200, 200, 200), // Light grey\n debug: chalk.rgb(173, 216, 230), // Light blue\n info: chalk.rgb(144, 238, 144), // Light green\n warn: chalk.rgb(255, 218, 185), // Peach\n error: chalk.rgb(255, 182, 193), // Light pink\n fatal: chalk.bgRgb(255, 182, 193).rgb(105, 105, 105), // Light pink bg with dim grey text\n },\n logIdColor: chalk.rgb(200, 200, 200),\n dataValueColor: chalk.rgb(105, 105, 105),\n dataKeyColor: chalk.rgb(173, 216, 230),\n};\n","/**\n * Creates a string with the same length as `numSpaces` parameter\n **/\nexport function indent(numSpaces) {\n return new Array(numSpaces + 1).join(\" \");\n}\n\n/**\n * Gets the string length of the longer index in a hash\n **/\nexport function getMaxIndexLength(input) {\n var maxWidth = 0;\n\n Object.getOwnPropertyNames(input).forEach((key) => {\n // Skip undefined values.\n if (input[key] === undefined) {\n return;\n }\n\n maxWidth = Math.max(maxWidth, key.length);\n });\n return maxWidth;\n}\n\nexport function isIsoStringDate(isoString) {\n if (typeof isoString !== \"string\") {\n return false;\n }\n // More flexible regex that handles:\n // - Optional milliseconds\n // - Optional timezone offset or Z\n // - Optional T separator (space also valid)\n if (!/^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$/.test(isoString)) {\n return false;\n }\n const testDate = new Date(isoString);\n return !Number.isNaN(testDate.getTime());\n}\n","// @ts-nocheck\nimport chalk from \"chalk\";\nimport * as Utils from \"./utils.js\";\nimport { isIsoStringDate } from \"./utils.js\";\n\nconst conflictChars = /[^\\w\\s\\n\\r\\v\\t.,]/i;\n\n// Helper function to detect if an object should be printed or ignored\nconst isPrintable = (input, options) => input !== undefined || options.renderUndefined;\n\n// Helper function to detect if an object can be directly serializable\nconst isSerializable = (input, onlyPrimitives, options) => {\n if (\n typeof input === \"boolean\" ||\n typeof input === \"number\" ||\n typeof input === \"function\" ||\n input === null ||\n input === undefined ||\n input instanceof Date\n ) {\n return true;\n }\n if (typeof input === \"string\" && input.indexOf(\"\\n\") === -1) {\n return true;\n }\n\n if (options.inlineArrays && !onlyPrimitives) {\n if (Array.isArray(input) && isSerializable(input[0], true, options)) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Function} colorFn\n * @param {PrettyJSONOptions} options\n */\nconst getColorRenderer = (colorFn, options) => {\n if (options.noColor) {\n return (text) => text;\n }\n\n if (typeof colorFn !== \"function\") {\n return (text) => text;\n }\n\n return colorFn;\n};\n\nconst addColorToData = (input, options) => {\n if (options.noColor) {\n return input;\n }\n\n if (input instanceof Date) {\n return getColorRenderer(options.dateColor, options)(input.toISOString());\n }\n if (typeof input === \"string\") {\n if (isIsoStringDate(input)) {\n return getColorRenderer(options.dateColor, options)(input);\n }\n // Print strings in regular terminal color\n return getColorRenderer(options.stringColor, options)(input);\n }\n\n const sInput = `${input}`;\n\n if (typeof input === \"boolean\") {\n return getColorRenderer(options.booleanColor, options)(sInput);\n }\n if (input === null || input === undefined) {\n return getColorRenderer(options.nullUndefinedColor, options)(sInput);\n }\n if (typeof input === \"number\") {\n if (input >= 0) {\n return getColorRenderer(options.positiveNumberColor, options)(sInput);\n }\n return getColorRenderer(options.negativeNumberColor, options)(sInput);\n }\n if (typeof input === \"function\") {\n return \"function() {}\";\n }\n\n if (Array.isArray(input)) {\n return input.join(\", \");\n }\n\n return sInput;\n};\n\nconst colorMultilineString = (options, line) => getColorRenderer(options.multilineStringColor, options)(line);\n\nconst indentLines = (string, spaces, options) => {\n let lines = string.split(\"\\n\");\n lines = lines.map((line) => Utils.indent(spaces) + colorMultilineString(options, line));\n return lines.join(\"\\n\");\n};\n\nconst renderToArray = (data, options, indentation) => {\n if (typeof data === \"string\" && data.match(conflictChars) && options.escape) {\n data = JSON.stringify(data);\n }\n\n if (!isPrintable(data, options)) {\n return [];\n }\n\n if (isSerializable(data, false, options)) {\n return [Utils.indent(indentation) + addColorToData(data, options)];\n }\n\n // Unserializable string means it's multiline\n if (typeof data === \"string\") {\n return [\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n indentLines(data, indentation + options.defaultIndentation, options),\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n ];\n }\n\n if (Array.isArray(data)) {\n // If the array is empty, render the `emptyArrayMsg`\n if (data.length === 0) {\n return [Utils.indent(indentation) + options.emptyArrayMsg];\n }\n\n // If arrays should be collapsed and there's data, show [...]\n if (options.collapseArrays && data.length > 0) {\n return [`${Utils.indent(indentation)}[... ${data.length} items]`];\n }\n\n const outputArray = [];\n\n data.forEach((element) => {\n if (!isPrintable(element, options)) {\n return;\n }\n\n // Prepend the dash at the beginning of each array's element line\n let line = \"- \";\n line = getColorRenderer(options.dashColor, options)(line);\n line = Utils.indent(indentation) + line;\n\n // If the element of the array is a string, bool, number, or null\n // render it in the same line\n if (isSerializable(element, false, options)) {\n line += renderToArray(element, options, 0)[0];\n outputArray.push(line);\n\n // If the element is an array or object, render it in next line\n } else {\n outputArray.push(line);\n outputArray.push.apply(outputArray, renderToArray(element, options, indentation + options.defaultIndentation));\n }\n });\n\n return outputArray;\n }\n\n if (data instanceof Error) {\n return renderToArray(\n {\n message: data.message,\n stack: data.stack.split(\"\\n\"),\n },\n options,\n indentation,\n );\n }\n\n // If values alignment is enabled, get the size of the longest index\n // to align all the values\n const maxIndexLength = options.noAlign ? 0 : Utils.getMaxIndexLength(data);\n let key;\n const output = [];\n\n Object.getOwnPropertyNames(data).forEach((i) => {\n if (!isPrintable(data[i], options)) {\n return;\n }\n\n // Prepend the index at the beginning of the line\n key = `${i}: `;\n key = getColorRenderer(options.keysColor, options)(key);\n key = Utils.indent(indentation) + key;\n\n // If the value is serializable, render it in the same line\n if (isSerializable(data[i], false, options)) {\n const nextIndentation = options.noAlign ? 0 : maxIndexLength - i.length;\n key += renderToArray(data[i], options, nextIndentation)[0];\n output.push(key);\n\n // If the index is an array or object, render it in next line\n } else {\n output.push(key);\n output.push.apply(output, renderToArray(data[i], options, indentation + options.defaultIndentation));\n }\n });\n return output;\n};\n/**\n * @typedef {Object} PrettyJSONOptions\n * @property {Function} [stringColor=null] Chalk color function for strings\n * @property {Function} [multilineStringColor=null] Chalk color function for multiline strings\n * @property {Function} [keysColor=chalk.green] Chalk color function for keys in hashes\n * @property {Function} [dashColor=chalk.green] Chalk color function for dashes in arrays\n * @property {Function} [numberColor=chalk.blue] Default Chalk color function for numbers\n * @property {Function} [positiveNumberColor=numberColor] Chalk color function for positive numbers\n * @property {Function} [negativeNumberColor=numberColor] Chalk color function for negative numbers\n * @property {Function} [booleanColor=chalk.cyan] Chalk color function for boolean values\n * @property {Function} [nullUndefinedColor=chalk.grey] Chalk color function for null || undefined\n * @property {Function} [dateColor=chalk.magenta] Chalk color function for Date objects\n * @property {number} [defaultIndentation=2] Indentation spaces per object level\n * @property {string} [emptyArrayMsg=\"(empty array)\"] Replace empty strings with\n * @property {boolean} [noColor] Flag to disable colors\n * @property {boolean} [noAlign] Flag to disable alignment\n * @property {boolean} [escape] Flag to escape printed content\n * @property {boolean} [collapseArrays] Flag to collapse arrays\n */\n/**\n * Mutating function that ensures we have a valid options object\n * @param {PrettyJSONOptions} options\n * @returns PrettyJSONOptions\n */\nconst validateOptionsAndSetDefaults = (options) => {\n options = options || {};\n options.emptyArrayMsg = options.emptyArrayMsg || \"(empty array)\";\n options.keysColor = options.keysColor || chalk.green;\n options.dashColor = options.dashColor || chalk.green;\n options.booleanColor = options.booleanColor || chalk.cyan;\n options.nullUndefinedColor = options.nullUndefinedColor || chalk.grey;\n options.numberColor = options.numberColor || chalk.blue;\n options.positiveNumberColor = options.positiveNumberColor || options.numberColor;\n options.negativeNumberColor = options.negativeNumberColor || options.numberColor;\n options.dateColor = options.dateColor || chalk.magenta;\n options.defaultIndentation = options.defaultIndentation || 2;\n options.noColor = !!options.noColor;\n options.noAlign = !!options.noAlign;\n options.escape = !!options.escape;\n options.renderUndefined = !!options.renderUndefined;\n options.collapseArrays = !!options.collapseArrays;\n\n options.stringColor = options.stringColor || null;\n options.multilineStringColor = options.multilineStringColor || options.stringColor || null;\n\n return options;\n};\n/**\n * ### Render function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * stringColor: 'grey', // Color for strings\n * multilineStringColor: 'cyan' // Color for multiline strings\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n * @returns string with the rendered data\n */\nexport function render(data, options, indentation) {\n // Default values\n indentation = indentation || 0;\n options = validateOptionsAndSetDefaults(options);\n\n return renderToArray(data, options, indentation).join(\"\\n\");\n}\n\n/**\n * ### Render from string function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n */\nexport function renderString(data, options, indentation) {\n let output = \"\";\n let parsedData;\n // If the input is not a string or if it's empty, just return an empty string\n if (typeof data !== \"string\" || data === \"\") {\n return \"\";\n }\n\n // Remove non-JSON characters from the beginning string\n if (data[0] !== \"{\" && data[0] !== \"[\") {\n let beginingOfJson;\n if (data.indexOf(\"{\") === -1) {\n beginingOfJson = data.indexOf(\"[\");\n } else if (data.indexOf(\"[\") === -1) {\n beginingOfJson = data.indexOf(\"{\");\n } else if (data.indexOf(\"{\") < data.indexOf(\"[\")) {\n beginingOfJson = data.indexOf(\"{\");\n } else {\n beginingOfJson = data.indexOf(\"[\");\n }\n output += `${data.substr(0, beginingOfJson)}\\n`;\n data = data.substr(beginingOfJson);\n }\n\n try {\n parsedData = JSON.parse(data);\n } catch (_e) {\n // Return an error in case of an invalid JSON\n return `${chalk.red(\"Error:\")} Not valid JSON!`;\n }\n\n // Call the real render() method\n output += exports.render(parsedData, options, indentation);\n return output;\n}\n","import chalk from \"chalk\";\nimport { format } from \"date-fns\";\nimport type { ColorConfig, ViewConfig } from \"../types.js\";\n\n/**\n * Formats a timestamp into a readable string.\n *\n * @param timestamp - Unix timestamp in milliseconds\n * @param colorFn - Chalk function to color the timestamp\n * @param timestampFormat - Custom format string (date-fns) or function. Defaults to \"HH:mm:ss.SSS\"\n * @returns Formatted timestamp string\n */\nexport function formatTimestamp(\n timestamp: number,\n colorFn: typeof chalk.white,\n timestampFormat: string | ((timestamp: number) => string) = \"HH:mm:ss.SSS\",\n): string {\n let formattedTime: string;\n\n if (typeof timestampFormat === \"function\") {\n formattedTime = timestampFormat(timestamp);\n } else {\n const date = new Date(timestamp);\n formattedTime = format(date, timestampFormat);\n }\n\n return colorFn(`[${formattedTime}]`);\n}\n\n/**\n * Gets the appropriate color function for a log level.\n *\n * @param level - Log level string\n * @param colors - Color configuration object\n * @returns Chalk function for the log level\n */\nexport function getLevelColor(level: string, colors: ColorConfig): typeof chalk.white {\n const levelLower = level.toLowerCase();\n\n switch (levelLower) {\n case \"trace\":\n return colors.trace || chalk.white;\n case \"debug\":\n return colors.debug || chalk.white;\n case \"info\":\n return colors.info || chalk.white;\n case \"warn\":\n return colors.warn || chalk.white;\n case \"error\":\n return colors.error || chalk.white;\n case \"fatal\":\n return colors.fatal || chalk.white;\n default:\n return colors.info || chalk.white;\n }\n}\n\n/**\n * Formats a value for display.\n */\nexport function formatValue(value: any, expanded = false, collapseArrays = true): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return value.toString();\n if (value === null) return \"null\";\n if (value === undefined) return \"undefined\";\n if (Array.isArray(value)) return expanded ? JSON.stringify(value) : collapseArrays ? \"[...]\" : value.toString();\n if (typeof value === \"object\") return expanded ? JSON.stringify(value) : \"{...}\";\n return value.toString();\n}\n\n/**\n * Formats structured data for inline display with depth limiting.\n *\n * @param data - The data to format\n * @param config - View configuration for colors\n * @param maxDepth - Maximum depth for nested objects\n * @param expanded - Whether to show full depth (for inline view mode)\n * @param collapseArrays - Whether to collapse arrays to summary format\n * @returns Formatted data string\n */\nexport function formatInlineData(\n data: any,\n config: Required<ViewConfig>,\n maxDepth: number,\n expanded = false,\n collapseArrays = true,\n): string {\n if (!data) return \"\";\n\n const pairs: string[] = [];\n const traverse = (obj: any, prefix = \"\", depth = 0) => {\n if (!expanded && depth >= maxDepth) return;\n\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n if (expanded) {\n pairs.push(`${config.dataKeyColor(fullKey)}=${config.dataValueColor(JSON.stringify(value))}`);\n } else {\n traverse(value, fullKey, depth + 1);\n }\n } else {\n pairs.push(\n `${config.dataKeyColor(fullKey)}=${config.dataValueColor(formatValue(value, expanded, collapseArrays))}`,\n );\n }\n }\n };\n\n traverse(data);\n const result = pairs.join(\" \");\n // Remove truncation - inline view should show complete data without truncation\n return result;\n}\n","import type { LogEntry, PrettyTerminalViewMode, Runtime, SimpleViewConfig } from \"../types.js\";\nimport * as prettyjson from \"../vendor/prettyjson.js\";\nimport { formatInlineData, formatTimestamp, getLevelColor } from \"./utils.js\";\n\n/**\n * Handles rendering of the simple view mode.\n * Supports three display modes:\n * - Message-only: Shows timestamp, level and message\n * - Inline: Shows all details with complete data inline\n * - Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimpleView {\n private config: SimpleViewConfig;\n private viewMode: PrettyTerminalViewMode;\n private maxInlineDepth: number;\n private showLogId: boolean;\n private timestampFormat: string | ((timestamp: number) => string);\n private collapseArrays: boolean;\n private flattenNestedObjects: boolean;\n private runtime: Runtime;\n private includeDataInBrowserConsole: boolean;\n\n constructor(config: SimpleViewConfig) {\n this.config = config;\n this.viewMode = config.viewMode;\n this.maxInlineDepth = config.maxInlineDepth;\n this.showLogId = config.showLogId;\n this.timestampFormat = config.timestampFormat;\n this.collapseArrays = config.collapseArrays !== false;\n this.flattenNestedObjects = config.flattenNestedObjects !== false;\n this.runtime = config.runtime;\n this.includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n }\n\n public getConfig(): SimpleViewConfig {\n return this.config;\n }\n\n public getViewMode(): PrettyTerminalViewMode {\n return this.viewMode;\n }\n\n /**\n * Writes a message to the appropriate output based on runtime\n */\n private writeMessage(message: string, level?: string, data?: any): void {\n if (this.runtime === \"node\") {\n // Use process.stdout.write for Node.js\n process?.stdout?.write?.(`${message}\\n`);\n } else {\n // Use appropriate console method based on log level for browser\n const shouldIncludeData = this.includeDataInBrowserConsole && data !== undefined;\n\n switch (level) {\n case \"trace\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"debug\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"info\":\n if (shouldIncludeData) {\n console.info(message, data);\n } else {\n console.info(message);\n }\n break;\n case \"warn\":\n if (shouldIncludeData) {\n console.warn(message, data);\n } else {\n console.warn(message);\n }\n break;\n case \"error\":\n case \"fatal\":\n if (shouldIncludeData) {\n console.error(message, data);\n } else {\n console.error(message);\n }\n break;\n default:\n if (shouldIncludeData) {\n console.log(message, data);\n } else {\n console.log(message);\n }\n break;\n }\n }\n }\n\n /**\n * Renders a single log entry based on the current view mode\n */\n public renderLogLine(entry: LogEntry): void {\n const levelColor = getLevelColor(entry.level, this.config.config.colors);\n const chevron = levelColor(`▶ ${entry.level.toUpperCase()} `);\n const message = entry.message || \"(no message)\";\n const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor, this.timestampFormat);\n\n // Parse data for browser console inclusion\n const parsedData = entry.data ? JSON.parse(entry.data) : undefined;\n\n switch (this.viewMode) {\n case \"message-only\": {\n // Message-only view shows timestamp, level and message\n const condensedLine = `${timestamp} ${chevron}${message}`;\n this.writeMessage(condensedLine, entry.level, parsedData);\n break;\n }\n\n case \"inline\": {\n // Inline view shows all details with complete data inline\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(\n JSON.parse(entry.data),\n this.config.config,\n this.maxInlineDepth,\n !this.flattenNestedObjects,\n this.collapseArrays,\n )\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n // Don't wrap inline mode to preserve full content\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n\n case \"expanded\": {\n // Expanded view shows timestamp, level, and message on first line, with data on indented separate lines\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const firstLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}`;\n this.writeMessage(firstLine, entry.level, parsedData);\n\n if (entry.data) {\n const jsonLines = prettyjson\n .render(JSON.parse(entry.data), {\n defaultIndentation: 2,\n keysColor: this.config.config.dataKeyColor,\n dashColor: this.config.config.dataKeyColor,\n numberColor: this.config.config.dataValueColor,\n stringColor: this.config.config.dataValueColor,\n multilineStringColor: this.config.config.dataValueColor,\n positiveNumberColor: this.config.config.dataValueColor,\n negativeNumberColor: this.config.config.dataValueColor,\n booleanColor: this.config.config.dataValueColor,\n nullUndefinedColor: this.config.config.dataValueColor,\n dateColor: this.config.config.dataValueColor,\n collapseArrays: this.collapseArrays,\n })\n .split(\"\\n\");\n\n // Add each line with proper indentation (2 spaces at the beginning)\n for (const line of jsonLines) {\n if (line.trim() !== \"\") {\n this.writeMessage(` ${line}`, entry.level);\n }\n }\n }\n break;\n }\n\n default: {\n // Default to full view for any unexpected view modes\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(JSON.parse(entry.data), this.config.config, this.maxInlineDepth, true, this.collapseArrays)\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n }\n }\n}\n","/**\n * A transport for LogLayer that provides simple pretty terminal output.\n * This transport displays logs with theming and formatting but without interactive features.\n *\n * Features:\n * - Real-time log display with color-coded levels\n * - Configurable themes and colors\n * - Three view modes: inline, message-only, expanded\n * - JSON data pretty printing\n * - No interactive features (no keyboard navigation, no input)\n * - Browser and Node.js runtime support\n *\n * Usage:\n * ```typescript\n * const transport = new SimplePrettyTerminalTransport({\n * maxInlineDepth: 4,\n * maxInlineLength: 120,\n * theme: customTheme,\n * viewMode: \"inline\",\n * runtime: \"node\" // or \"browser\"\n * });\n * ```\n */\n\nimport type { LogLayerTransportParams } from \"@loglayer/transport\";\nimport { LoggerlessTransport } from \"@loglayer/transport\";\nimport chalk from \"chalk\";\nimport { sprintf } from \"sprintf-js\";\nimport { moonlight } from \"./themes.js\";\nimport type { PrettyTerminalViewMode, SimplePrettyTerminalConfig } from \"./types.js\";\nimport { SimpleView } from \"./views/SimpleView.js\";\n\n/**\n * Main transport class that handles simple pretty terminal output.\n * This class provides the display functionality of PrettyTerminal without interactive features.\n *\n * The transport supports three view modes:\n * 1. Inline: Shows all information with complete data structures inline (no truncation)\n * 2. Message-only: Shows only the timestamp, log level and message for a cleaner output (no data shown)\n * 3. Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimplePrettyTerminalTransport extends LoggerlessTransport {\n /** Handles rendering and formatting of logs */\n private renderer: SimpleView;\n\n /** Configuration options */\n private config: SimplePrettyTerminalConfig;\n\n /**\n * Creates a new SimplePrettyTerminalTransport instance.\n *\n * @param config - Configuration options for the transport\n */\n constructor(config: SimplePrettyTerminalConfig) {\n super(config);\n\n // Store configuration\n this.config = config;\n\n // If transport is disabled, don't initialize anything\n if (config.enabled === false) {\n return;\n }\n\n // Initialize configuration with defaults\n const maxInlineDepth = config.maxInlineDepth || 4;\n const theme = config.theme || moonlight;\n const viewMode = config.viewMode || \"inline\";\n const showLogId = config.showLogId || false;\n const timestampFormat = config.timestampFormat || \"HH:mm:ss.SSS\";\n const collapseArrays = config.collapseArrays !== false; // Default to true\n const flattenNestedObjects = config.flattenNestedObjects !== false; // Default to true\n const runtime = config.runtime;\n const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n\n // Initialize view configuration with defaults\n const viewConfig = {\n colors: {\n trace: chalk.gray, // Lowest level, used for verbose output\n debug: chalk.blue, // Debug information\n info: chalk.green, // Normal operation\n warn: chalk.yellow, // Warning conditions\n error: chalk.red, // Error conditions\n fatal: chalk.bgRed.white, // Critical errors\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n // Initialize the renderer\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth,\n showLogId,\n timestampFormat,\n collapseArrays,\n flattenNestedObjects,\n runtime,\n includeDataInBrowserConsole,\n config: viewConfig,\n });\n }\n\n /**\n * Generates a random ID for each log entry.\n * Uses base36 encoding for compact, readable IDs.\n *\n * @returns A 6-character string ID\n * @example\n * \"a1b2c3\" // Example generated ID\n */\n private generateId(): string {\n return Math.random().toString(36).substring(2, 8);\n }\n\n /**\n * Applies sprintf formatting to messages if enabled and applicable.\n * If the first message is a format string and there are additional arguments,\n * formats them using sprintf-js.\n *\n * @param messages - Array of message strings\n * @returns Formatted message string\n */\n private formatMessages(messages: any[]): string {\n if (!this.config.enableSprintf || messages.length < 2) {\n return messages.join(\" \");\n }\n\n const [format, ...args] = messages;\n\n // Only apply sprintf if the first argument is a string\n if (typeof format !== \"string\") {\n return messages.join(\" \");\n }\n\n try {\n return sprintf(format, ...args);\n } catch (_error) {\n // If sprintf fails, return original messages joined\n return messages.join(\" \");\n }\n }\n\n /**\n * Main transport method that receives logs from LogLayer.\n * This method is called for each log event and handles:\n * - Generating a unique ID for the log\n * - Converting the log data to a storable format\n * - Rendering the log using the SimpleView renderer\n *\n * @param logLevel - The severity level of the log\n * @param messages - Array of message strings to be joined\n * @param data - Additional structured data to be logged\n * @param hasData - Whether the log includes additional data\n * @returns The original messages array\n */\n shipToLogger({ logLevel, messages, data, hasData }: LogLayerTransportParams): any[] {\n // If transport is disabled, return messages without processing\n if (this.config.enabled === false) {\n return messages;\n }\n\n const entry = {\n id: this.generateId(),\n timestamp: Date.now(),\n level: logLevel,\n message: this.formatMessages(messages),\n data: hasData ? JSON.stringify(data) : null,\n };\n\n this.renderer.renderLogLine(entry);\n return messages;\n }\n\n /**\n * Changes the view mode for log display.\n *\n * @param viewMode - The new view mode to use\n */\n setViewMode(viewMode: PrettyTerminalViewMode): void {\n if (this.config.enabled === false) {\n return;\n }\n\n // Rebuild the viewConfig as in the constructor\n const theme = this.config.theme || moonlight;\n const runtime = this.config.runtime;\n const viewConfig = {\n colors: {\n trace: chalk.gray,\n debug: chalk.blue,\n info: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n fatal: chalk.bgRed.white,\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth: this.config.maxInlineDepth || 4,\n showLogId: this.config.showLogId || false,\n timestampFormat: this.config.timestampFormat || \"HH:mm:ss.SSS\",\n collapseArrays: this.config.collapseArrays !== false,\n flattenNestedObjects: this.config.flattenNestedObjects !== false,\n runtime,\n includeDataInBrowserConsole: this.config.includeDataInBrowserConsole || false,\n config: viewConfig,\n });\n }\n\n /**\n * Gets the current view mode.\n *\n * @returns The current view mode\n */\n getViewMode(): PrettyTerminalViewMode {\n return this.renderer.getViewMode();\n }\n}\n","import { SimplePrettyTerminalTransport } from \"./SimplePrettyTerminalTransport.js\";\nimport type {\n PrettyTerminalViewMode,\n Runtime,\n SimplePrettyTerminalConfig,\n SimplePrettyTerminalTheme,\n} from \"./types.js\";\n\n// Export chalk for custom theme creation\nexport * from \"chalk\";\n\n// Export the main transport class (for advanced usage)\nexport { SimplePrettyTerminalTransport };\n\n// Export all built-in themes\nexport * from \"./themes.js\";\n\n// Export essential types for configuration and custom themes\nexport type { SimplePrettyTerminalConfig, SimplePrettyTerminalTheme, PrettyTerminalViewMode, Runtime };\n\n// Main convenience function for creating the transport\nexport function getSimplePrettyTerminal(config: SimplePrettyTerminalConfig) {\n return new SimplePrettyTerminalTransport(config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,YAAuC;CAClD,QAAQ;EACN,OAAO,MAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,OAAO,MAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,MAAM,MAAM,IAAI,KAAK,KAAK,IAAI;EAC9B,MAAM,MAAM,IAAI,KAAK,KAAK,IAAI;EAC9B,OAAO,MAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,OAAO,MAAM,MAAM,KAAK,KAAK,IAAI,CAAC;EACnC;CACD,YAAY,MAAM,IAAI,IAAI,IAAI,IAAI;CAClC,gBAAgB,MAAM,IAAI,KAAK,KAAK,IAAI;CACxC,cAAc,MAAM,IAAI,KAAK,KAAK,IAAI;CACvC;;;;;;;;;;;;;;;;AAiBD,MAAa,WAAsC;CACjD,QAAQ;EACN,OAAO,MAAM,IAAI,KAAK,KAAK,IAAI;EAC/B,OAAO,MAAM,IAAI,IAAI,IAAI,IAAI;EAC7B,MAAM,MAAM,IAAI,IAAI,KAAK,GAAG;EAC5B,MAAM,MAAM,IAAI,KAAK,IAAI,EAAE;EAC3B,OAAO,MAAM,IAAI,KAAK,GAAG,EAAE;EAC3B,OAAO,MAAM,MAAM,KAAK,GAAG,EAAE,CAAC;EAC/B;CACD,YAAY,MAAM,IAAI,KAAK,KAAK,IAAI;CACpC,gBAAgB,MAAM,IAAI,GAAG,GAAG,EAAE;CAClC,cAAc,MAAM,IAAI,I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index.js","names":["Utils.indent","Utils.getMaxIndexLength","prettyjson\n .render"],"sources":["../src/themes.ts","../src/vendor/utils.js","../src/vendor/prettyjson.js","../src/views/utils.ts","../src/views/SimpleView.ts","../src/SimplePrettyTerminalTransport.ts","../src/index.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport type { SimplePrettyTerminalTheme } from \"./types.js\";\n\n/**\n * Moonlight - A dark theme with cool blue tones\n * Inspired by moonlit nights and modern IDEs\n *\n * Color Palette:\n * - Primary: Cool blues and soft greens\n * - Accents: Warm yellows and soft reds\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - Night-time coding sessions\n * - Environments where eye strain is a concern\n */\nexport const moonlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(114, 135, 153), // Muted blue-grey for less important info\n debug: chalk.rgb(130, 170, 255), // Soft blue that pops but doesn't strain\n info: chalk.rgb(195, 232, 141), // Sage green for good readability\n warn: chalk.rgb(255, 203, 107), // Warm yellow, less harsh than pure yellow\n error: chalk.rgb(247, 118, 142), // Soft red that stands out without being aggressive\n fatal: chalk.bgRgb(247, 118, 142).white, // Inverted soft red for maximum visibility\n },\n logIdColor: chalk.rgb(84, 98, 117), // Darker blue-grey for secondary information\n dataValueColor: chalk.rgb(209, 219, 231), // Light grey-blue for primary content\n dataKeyColor: chalk.rgb(130, 170, 255), // Matching debug blue for consistency\n};\n\n/**\n * Sunlight - A light theme with warm tones\n * Inspired by daylight reading and paper documentation\n *\n * Color Palette:\n * - Primary: Deep, rich colors that contrast well with white\n * - Accents: Earth tones and deep jewel tones\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Daytime coding sessions\n * - High-glare environments\n * - Printed documentation\n */\nexport const sunlight: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(110, 110, 110), // Dark grey for subtle information\n debug: chalk.rgb(32, 96, 159), // Deep blue for strong contrast on white\n info: chalk.rgb(35, 134, 54), // Forest green, easier on the eyes than bright green\n warn: chalk.rgb(176, 95, 0), // Brown-orange for natural warning color\n error: chalk.rgb(191, 0, 0), // Deep red for clear visibility on light backgrounds\n fatal: chalk.bgRgb(191, 0, 0).white, // White on deep red for critical issues\n },\n logIdColor: chalk.rgb(110, 110, 110),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(32, 96, 159),\n};\n\n/**\n * Neon - A dark theme with vibrant cyberpunk colors\n * Inspired by neon-lit cityscapes and retro-futuristic aesthetics\n *\n * Color Palette:\n * - Primary: Electric blues and hot pinks\n * - Accents: Bright purples and cyber greens\n * - Background: Assumes dark terminal (black or very dark grey)\n *\n * Best used with:\n * - Dark terminal themes\n * - High-contrast preferences\n * - Modern, tech-focused applications\n */\nexport const neon: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(108, 108, 255), // Electric blue\n debug: chalk.rgb(255, 82, 246), // Hot pink\n info: chalk.rgb(0, 255, 163), // Cyber green\n warn: chalk.rgb(255, 231, 46), // Electric yellow\n error: chalk.rgb(255, 53, 91), // Neon red\n fatal: chalk.bgRgb(255, 53, 91).rgb(0, 255, 163), // Neon red bg with cyber green text\n },\n logIdColor: chalk.rgb(187, 134, 252), // Bright purple\n dataValueColor: chalk.rgb(255, 255, 255), // Pure white\n dataKeyColor: chalk.rgb(0, 255, 240), // Cyan\n};\n\n/**\n * Nature - A light theme with organic, earthy colors\n * Inspired by forest landscapes and natural elements\n *\n * Color Palette:\n * - Primary: Deep forest greens and rich browns\n * - Accents: Autumn reds and golden yellows\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Nature-inspired interfaces\n * - Applications focusing on readability\n */\nexport const nature: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(101, 115, 126), // Slate grey\n debug: chalk.rgb(34, 139, 34), // Forest green\n info: chalk.rgb(46, 139, 87), // Sea green\n warn: chalk.rgb(218, 165, 32), // Golden rod\n error: chalk.rgb(139, 69, 19), // Saddle brown\n fatal: chalk.bgRgb(139, 69, 19).white, // Brown background with white text\n },\n logIdColor: chalk.rgb(101, 115, 126),\n dataValueColor: chalk.rgb(0, 0, 0),\n dataKeyColor: chalk.rgb(34, 139, 34),\n};\n\n/**\n * Pastel - A soft, calming theme with gentle colors\n * Inspired by watercolor paintings and soft aesthetics\n *\n * Color Palette:\n * - Primary: Soft pastels and muted tones\n * - Accents: Gentle pinks and light blues\n * - Background: Assumes light terminal (white or very light grey)\n *\n * Best used with:\n * - Light terminal themes\n * - Long coding sessions\n * - Reduced visual stress\n */\nexport const pastel: SimplePrettyTerminalTheme = {\n colors: {\n trace: chalk.rgb(200, 200, 200), // Light grey\n debug: chalk.rgb(173, 216, 230), // Light blue\n info: chalk.rgb(144, 238, 144), // Light green\n warn: chalk.rgb(255, 218, 185), // Peach\n error: chalk.rgb(255, 182, 193), // Light pink\n fatal: chalk.bgRgb(255, 182, 193).rgb(105, 105, 105), // Light pink bg with dim grey text\n },\n logIdColor: chalk.rgb(200, 200, 200),\n dataValueColor: chalk.rgb(105, 105, 105),\n dataKeyColor: chalk.rgb(173, 216, 230),\n};\n","/**\n * Creates a string with the same length as `numSpaces` parameter\n **/\nexport function indent(numSpaces) {\n return new Array(numSpaces + 1).join(\" \");\n}\n\n/**\n * Gets the string length of the longer index in a hash\n **/\nexport function getMaxIndexLength(input) {\n var maxWidth = 0;\n\n Object.getOwnPropertyNames(input).forEach((key) => {\n // Skip undefined values.\n if (input[key] === undefined) {\n return;\n }\n\n maxWidth = Math.max(maxWidth, key.length);\n });\n return maxWidth;\n}\n\nexport function isIsoStringDate(isoString) {\n if (typeof isoString !== \"string\") {\n return false;\n }\n // More flexible regex that handles:\n // - Optional milliseconds\n // - Optional timezone offset or Z\n // - Optional T separator (space also valid)\n if (!/^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$/.test(isoString)) {\n return false;\n }\n const testDate = new Date(isoString);\n return !Number.isNaN(testDate.getTime());\n}\n","// @ts-nocheck\nimport chalk from \"chalk\";\nimport * as Utils from \"./utils.js\";\nimport { isIsoStringDate } from \"./utils.js\";\n\nconst conflictChars = /[^\\w\\s\\n\\r\\v\\t.,]/i;\n\n// Helper function to detect if an object should be printed or ignored\nconst isPrintable = (input, options) => input !== undefined || options.renderUndefined;\n\n// Helper function to detect if an object can be directly serializable\nconst isSerializable = (input, onlyPrimitives, options) => {\n if (\n typeof input === \"boolean\" ||\n typeof input === \"number\" ||\n typeof input === \"function\" ||\n input === null ||\n input === undefined ||\n input instanceof Date\n ) {\n return true;\n }\n if (typeof input === \"string\" && input.indexOf(\"\\n\") === -1) {\n return true;\n }\n\n if (options.inlineArrays && !onlyPrimitives) {\n if (Array.isArray(input) && isSerializable(input[0], true, options)) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Function} colorFn\n * @param {PrettyJSONOptions} options\n */\nconst getColorRenderer = (colorFn, options) => {\n if (options.noColor) {\n return (text) => text;\n }\n\n if (typeof colorFn !== \"function\") {\n return (text) => text;\n }\n\n return colorFn;\n};\n\nconst addColorToData = (input, options) => {\n if (options.noColor) {\n return input;\n }\n\n if (input instanceof Date) {\n return getColorRenderer(options.dateColor, options)(input.toISOString());\n }\n if (typeof input === \"string\") {\n if (isIsoStringDate(input)) {\n return getColorRenderer(options.dateColor, options)(input);\n }\n // Print strings in regular terminal color\n return getColorRenderer(options.stringColor, options)(input);\n }\n\n const sInput = `${input}`;\n\n if (typeof input === \"boolean\") {\n return getColorRenderer(options.booleanColor, options)(sInput);\n }\n if (input === null || input === undefined) {\n return getColorRenderer(options.nullUndefinedColor, options)(sInput);\n }\n if (typeof input === \"number\") {\n if (input >= 0) {\n return getColorRenderer(options.positiveNumberColor, options)(sInput);\n }\n return getColorRenderer(options.negativeNumberColor, options)(sInput);\n }\n if (typeof input === \"function\") {\n return \"function() {}\";\n }\n\n if (Array.isArray(input)) {\n return input.join(\", \");\n }\n\n return sInput;\n};\n\nconst colorMultilineString = (options, line) => getColorRenderer(options.multilineStringColor, options)(line);\n\nconst indentLines = (string, spaces, options) => {\n let lines = string.split(\"\\n\");\n lines = lines.map((line) => Utils.indent(spaces) + colorMultilineString(options, line));\n return lines.join(\"\\n\");\n};\n\nconst renderToArray = (data, options, indentation) => {\n if (typeof data === \"string\" && data.match(conflictChars) && options.escape) {\n data = JSON.stringify(data);\n }\n\n if (!isPrintable(data, options)) {\n return [];\n }\n\n if (isSerializable(data, false, options)) {\n return [Utils.indent(indentation) + addColorToData(data, options)];\n }\n\n // Unserializable string means it's multiline\n if (typeof data === \"string\") {\n return [\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n indentLines(data, indentation + options.defaultIndentation, options),\n Utils.indent(indentation) + colorMultilineString(options, '\"\"\"'),\n ];\n }\n\n if (Array.isArray(data)) {\n // If the array is empty, render the `emptyArrayMsg`\n if (data.length === 0) {\n return [Utils.indent(indentation) + options.emptyArrayMsg];\n }\n\n // If arrays should be collapsed and there's data, show [...]\n if (options.collapseArrays && data.length > 0) {\n return [`${Utils.indent(indentation)}[... ${data.length} items]`];\n }\n\n const outputArray = [];\n\n data.forEach((element) => {\n if (!isPrintable(element, options)) {\n return;\n }\n\n // Prepend the dash at the beginning of each array's element line\n let line = \"- \";\n line = getColorRenderer(options.dashColor, options)(line);\n line = Utils.indent(indentation) + line;\n\n // If the element of the array is a string, bool, number, or null\n // render it in the same line\n if (isSerializable(element, false, options)) {\n line += renderToArray(element, options, 0)[0];\n outputArray.push(line);\n\n // If the element is an array or object, render it in next line\n } else {\n outputArray.push(line);\n outputArray.push.apply(outputArray, renderToArray(element, options, indentation + options.defaultIndentation));\n }\n });\n\n return outputArray;\n }\n\n if (data instanceof Error) {\n return renderToArray(\n {\n message: data.message,\n stack: data.stack.split(\"\\n\"),\n },\n options,\n indentation,\n );\n }\n\n // If values alignment is enabled, get the size of the longest index\n // to align all the values\n const maxIndexLength = options.noAlign ? 0 : Utils.getMaxIndexLength(data);\n let key;\n const output = [];\n\n Object.getOwnPropertyNames(data).forEach((i) => {\n if (!isPrintable(data[i], options)) {\n return;\n }\n\n // Prepend the index at the beginning of the line\n key = `${i}: `;\n key = getColorRenderer(options.keysColor, options)(key);\n key = Utils.indent(indentation) + key;\n\n // If the value is serializable, render it in the same line\n if (isSerializable(data[i], false, options)) {\n const nextIndentation = options.noAlign ? 0 : maxIndexLength - i.length;\n key += renderToArray(data[i], options, nextIndentation)[0];\n output.push(key);\n\n // If the index is an array or object, render it in next line\n } else {\n output.push(key);\n output.push.apply(output, renderToArray(data[i], options, indentation + options.defaultIndentation));\n }\n });\n return output;\n};\n/**\n * @typedef {Object} PrettyJSONOptions\n * @property {Function} [stringColor=null] Chalk color function for strings\n * @property {Function} [multilineStringColor=null] Chalk color function for multiline strings\n * @property {Function} [keysColor=chalk.green] Chalk color function for keys in hashes\n * @property {Function} [dashColor=chalk.green] Chalk color function for dashes in arrays\n * @property {Function} [numberColor=chalk.blue] Default Chalk color function for numbers\n * @property {Function} [positiveNumberColor=numberColor] Chalk color function for positive numbers\n * @property {Function} [negativeNumberColor=numberColor] Chalk color function for negative numbers\n * @property {Function} [booleanColor=chalk.cyan] Chalk color function for boolean values\n * @property {Function} [nullUndefinedColor=chalk.grey] Chalk color function for null || undefined\n * @property {Function} [dateColor=chalk.magenta] Chalk color function for Date objects\n * @property {number} [defaultIndentation=2] Indentation spaces per object level\n * @property {string} [emptyArrayMsg=\"(empty array)\"] Replace empty strings with\n * @property {boolean} [noColor] Flag to disable colors\n * @property {boolean} [noAlign] Flag to disable alignment\n * @property {boolean} [escape] Flag to escape printed content\n * @property {boolean} [collapseArrays] Flag to collapse arrays\n */\n/**\n * Mutating function that ensures we have a valid options object\n * @param {PrettyJSONOptions} options\n * @returns PrettyJSONOptions\n */\nconst validateOptionsAndSetDefaults = (options) => {\n options = options || {};\n options.emptyArrayMsg = options.emptyArrayMsg || \"(empty array)\";\n options.keysColor = options.keysColor || chalk.green;\n options.dashColor = options.dashColor || chalk.green;\n options.booleanColor = options.booleanColor || chalk.cyan;\n options.nullUndefinedColor = options.nullUndefinedColor || chalk.grey;\n options.numberColor = options.numberColor || chalk.blue;\n options.positiveNumberColor = options.positiveNumberColor || options.numberColor;\n options.negativeNumberColor = options.negativeNumberColor || options.numberColor;\n options.dateColor = options.dateColor || chalk.magenta;\n options.defaultIndentation = options.defaultIndentation || 2;\n options.noColor = !!options.noColor;\n options.noAlign = !!options.noAlign;\n options.escape = !!options.escape;\n options.renderUndefined = !!options.renderUndefined;\n options.collapseArrays = !!options.collapseArrays;\n\n options.stringColor = options.stringColor || null;\n options.multilineStringColor = options.multilineStringColor || options.stringColor || null;\n\n return options;\n};\n/**\n * ### Render function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * stringColor: 'grey', // Color for strings\n * multilineStringColor: 'cyan' // Color for multiline strings\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n * @returns string with the rendered data\n */\nexport function render(data, options, indentation) {\n // Default values\n indentation = indentation || 0;\n options = validateOptionsAndSetDefaults(options);\n\n return renderToArray(data, options, indentation).join(\"\\n\");\n}\n\n/**\n * ### Render from string function\n * *Parameters:*\n *\n * @param {*} data: Data to render\n * @param {PrettyJSONOptions} options: Hash of different options\n * @param {*} indentation **`indentation`**: Base indentation of the output\n *\n * *Example of options hash:*\n *\n * {\n * emptyArrayMsg: '(empty)', // Rendered message on empty strings\n * keysColor: 'blue', // Color for keys in hashes\n * dashColor: 'red', // Color for the dashes in arrays\n * defaultIndentation: 2 // Indentation on nested objects\n * }\n */\nexport function renderString(data, options, indentation) {\n let output = \"\";\n let parsedData;\n // If the input is not a string or if it's empty, just return an empty string\n if (typeof data !== \"string\" || data === \"\") {\n return \"\";\n }\n\n // Remove non-JSON characters from the beginning string\n if (data[0] !== \"{\" && data[0] !== \"[\") {\n let beginingOfJson;\n if (data.indexOf(\"{\") === -1) {\n beginingOfJson = data.indexOf(\"[\");\n } else if (data.indexOf(\"[\") === -1) {\n beginingOfJson = data.indexOf(\"{\");\n } else if (data.indexOf(\"{\") < data.indexOf(\"[\")) {\n beginingOfJson = data.indexOf(\"{\");\n } else {\n beginingOfJson = data.indexOf(\"[\");\n }\n output += `${data.substr(0, beginingOfJson)}\\n`;\n data = data.substr(beginingOfJson);\n }\n\n try {\n parsedData = JSON.parse(data);\n } catch (_e) {\n // Return an error in case of an invalid JSON\n return `${chalk.red(\"Error:\")} Not valid JSON!`;\n }\n\n // Call the real render() method\n output += exports.render(parsedData, options, indentation);\n return output;\n}\n","import chalk from \"chalk\";\nimport { format } from \"date-fns\";\nimport type { ColorConfig, ViewConfig } from \"../types.js\";\n\n/**\n * Formats a timestamp into a readable string.\n *\n * @param timestamp - Unix timestamp in milliseconds\n * @param colorFn - Chalk function to color the timestamp\n * @param timestampFormat - Custom format string (date-fns) or function. Defaults to \"HH:mm:ss.SSS\"\n * @returns Formatted timestamp string\n */\nexport function formatTimestamp(\n timestamp: number,\n colorFn: typeof chalk.white,\n timestampFormat: string | ((timestamp: number) => string) = \"HH:mm:ss.SSS\",\n): string {\n let formattedTime: string;\n\n if (typeof timestampFormat === \"function\") {\n formattedTime = timestampFormat(timestamp);\n } else {\n const date = new Date(timestamp);\n formattedTime = format(date, timestampFormat);\n }\n\n return colorFn(`[${formattedTime}]`);\n}\n\n/**\n * Gets the appropriate color function for a log level.\n *\n * @param level - Log level string\n * @param colors - Color configuration object\n * @returns Chalk function for the log level\n */\nexport function getLevelColor(level: string, colors: ColorConfig): typeof chalk.white {\n const levelLower = level.toLowerCase();\n\n switch (levelLower) {\n case \"trace\":\n return colors.trace || chalk.white;\n case \"debug\":\n return colors.debug || chalk.white;\n case \"info\":\n return colors.info || chalk.white;\n case \"warn\":\n return colors.warn || chalk.white;\n case \"error\":\n return colors.error || chalk.white;\n case \"fatal\":\n return colors.fatal || chalk.white;\n default:\n return colors.info || chalk.white;\n }\n}\n\n/**\n * Formats a value for display.\n */\nexport function formatValue(value: any, expanded = false, collapseArrays = true): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return value.toString();\n if (value === null) return \"null\";\n if (value === undefined) return \"undefined\";\n if (Array.isArray(value)) return expanded ? JSON.stringify(value) : collapseArrays ? \"[...]\" : value.toString();\n if (typeof value === \"object\") return expanded ? JSON.stringify(value) : \"{...}\";\n return value.toString();\n}\n\n/**\n * Formats structured data for inline display with depth limiting.\n *\n * @param data - The data to format\n * @param config - View configuration for colors\n * @param maxDepth - Maximum depth for nested objects\n * @param expanded - Whether to show full depth (for inline view mode)\n * @param collapseArrays - Whether to collapse arrays to summary format\n * @returns Formatted data string\n */\nexport function formatInlineData(\n data: any,\n config: Required<ViewConfig>,\n maxDepth: number,\n expanded = false,\n collapseArrays = true,\n): string {\n if (!data) return \"\";\n\n const pairs: string[] = [];\n const traverse = (obj: any, prefix = \"\", depth = 0) => {\n if (!expanded && depth >= maxDepth) return;\n\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n if (expanded) {\n pairs.push(`${config.dataKeyColor(fullKey)}=${config.dataValueColor(JSON.stringify(value))}`);\n } else {\n traverse(value, fullKey, depth + 1);\n }\n } else {\n pairs.push(\n `${config.dataKeyColor(fullKey)}=${config.dataValueColor(formatValue(value, expanded, collapseArrays))}`,\n );\n }\n }\n };\n\n traverse(data);\n const result = pairs.join(\" \");\n // Remove truncation - inline view should show complete data without truncation\n return result;\n}\n","import type { LogEntry, PrettyTerminalViewMode, Runtime, SimpleViewConfig } from \"../types.js\";\nimport * as prettyjson from \"../vendor/prettyjson.js\";\nimport { formatInlineData, formatTimestamp, getLevelColor } from \"./utils.js\";\n\n/**\n * Handles rendering of the simple view mode.\n * Supports three display modes:\n * - Message-only: Shows timestamp, level and message\n * - Inline: Shows all details with complete data inline\n * - Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimpleView {\n private config: SimpleViewConfig;\n private viewMode: PrettyTerminalViewMode;\n private maxInlineDepth: number;\n private showLogId: boolean;\n private timestampFormat: string | ((timestamp: number) => string);\n private collapseArrays: boolean;\n private flattenNestedObjects: boolean;\n private runtime: Runtime;\n private includeDataInBrowserConsole: boolean;\n\n constructor(config: SimpleViewConfig) {\n this.config = config;\n this.viewMode = config.viewMode;\n this.maxInlineDepth = config.maxInlineDepth;\n this.showLogId = config.showLogId;\n this.timestampFormat = config.timestampFormat;\n this.collapseArrays = config.collapseArrays !== false;\n this.flattenNestedObjects = config.flattenNestedObjects !== false;\n this.runtime = config.runtime;\n this.includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n }\n\n public getConfig(): SimpleViewConfig {\n return this.config;\n }\n\n public getViewMode(): PrettyTerminalViewMode {\n return this.viewMode;\n }\n\n /**\n * Writes a message to the appropriate output based on runtime\n */\n private writeMessage(message: string, level?: string, data?: any): void {\n if (this.runtime === \"node\") {\n // Use process.stdout.write for Node.js\n process?.stdout?.write?.(`${message}\\n`);\n } else {\n // Use appropriate console method based on log level for browser\n const shouldIncludeData = this.includeDataInBrowserConsole && data !== undefined;\n\n switch (level) {\n case \"trace\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"debug\":\n if (shouldIncludeData) {\n console.debug(message, data);\n } else {\n console.debug(message);\n }\n break;\n case \"info\":\n if (shouldIncludeData) {\n console.info(message, data);\n } else {\n console.info(message);\n }\n break;\n case \"warn\":\n if (shouldIncludeData) {\n console.warn(message, data);\n } else {\n console.warn(message);\n }\n break;\n case \"error\":\n case \"fatal\":\n if (shouldIncludeData) {\n console.error(message, data);\n } else {\n console.error(message);\n }\n break;\n default:\n if (shouldIncludeData) {\n console.log(message, data);\n } else {\n console.log(message);\n }\n break;\n }\n }\n }\n\n /**\n * Renders a single log entry based on the current view mode\n */\n public renderLogLine(entry: LogEntry): void {\n const levelColor = getLevelColor(entry.level, this.config.config.colors);\n const chevron = levelColor(`▶ ${entry.level.toUpperCase()} `);\n const message = entry.message || \"(no message)\";\n const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor, this.timestampFormat);\n\n // Parse data for browser console inclusion\n const parsedData = entry.data ? JSON.parse(entry.data) : undefined;\n\n switch (this.viewMode) {\n case \"message-only\": {\n // Message-only view shows timestamp, level and message\n const condensedLine = `${timestamp} ${chevron}${message}`;\n this.writeMessage(condensedLine, entry.level, parsedData);\n break;\n }\n\n case \"inline\": {\n // Inline view shows all details with complete data inline\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(\n JSON.parse(entry.data),\n this.config.config,\n this.maxInlineDepth,\n !this.flattenNestedObjects,\n this.collapseArrays,\n )\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n // Don't wrap inline mode to preserve full content\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n\n case \"expanded\": {\n // Expanded view shows timestamp, level, and message on first line, with data on indented separate lines\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const firstLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}`;\n this.writeMessage(firstLine, entry.level, parsedData);\n\n if (entry.data) {\n const jsonLines = prettyjson\n .render(JSON.parse(entry.data), {\n defaultIndentation: 2,\n keysColor: this.config.config.dataKeyColor,\n dashColor: this.config.config.dataKeyColor,\n numberColor: this.config.config.dataValueColor,\n stringColor: this.config.config.dataValueColor,\n multilineStringColor: this.config.config.dataValueColor,\n positiveNumberColor: this.config.config.dataValueColor,\n negativeNumberColor: this.config.config.dataValueColor,\n booleanColor: this.config.config.dataValueColor,\n nullUndefinedColor: this.config.config.dataValueColor,\n dateColor: this.config.config.dataValueColor,\n collapseArrays: this.collapseArrays,\n })\n .split(\"\\n\");\n\n // Add each line with proper indentation (2 spaces at the beginning)\n for (const line of jsonLines) {\n if (line.trim() !== \"\") {\n this.writeMessage(` ${line}`, entry.level);\n }\n }\n }\n break;\n }\n\n default: {\n // Default to full view for any unexpected view modes\n const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : \"\";\n const fullData = entry.data\n ? formatInlineData(JSON.parse(entry.data), this.config.config, this.maxInlineDepth, true, this.collapseArrays)\n : \"\";\n const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : \"\"}${message}${fullData ? ` ${fullData}` : \"\"}`;\n this.writeMessage(expandedLine, entry.level, parsedData);\n break;\n }\n }\n }\n}\n","/**\n * A transport for LogLayer that provides simple pretty terminal output.\n * This transport displays logs with theming and formatting but without interactive features.\n *\n * Features:\n * - Real-time log display with color-coded levels\n * - Configurable themes and colors\n * - Three view modes: inline, message-only, expanded\n * - JSON data pretty printing\n * - No interactive features (no keyboard navigation, no input)\n * - Browser and Node.js runtime support\n *\n * Usage:\n * ```typescript\n * const transport = new SimplePrettyTerminalTransport({\n * maxInlineDepth: 4,\n * maxInlineLength: 120,\n * theme: customTheme,\n * viewMode: \"inline\",\n * runtime: \"node\" // or \"browser\"\n * });\n * ```\n */\n\nimport type { LogLayerTransportParams } from \"@loglayer/transport\";\nimport { LoggerlessTransport } from \"@loglayer/transport\";\nimport chalk from \"chalk\";\nimport { sprintf } from \"sprintf-js\";\nimport { moonlight } from \"./themes.js\";\nimport type { PrettyTerminalViewMode, SimplePrettyTerminalConfig } from \"./types.js\";\nimport { SimpleView } from \"./views/SimpleView.js\";\n\n/**\n * Main transport class that handles simple pretty terminal output.\n * This class provides the display functionality of PrettyTerminal without interactive features.\n *\n * The transport supports three view modes:\n * 1. Inline: Shows all information with complete data structures inline (no truncation)\n * 2. Message-only: Shows only the timestamp, log level and message for a cleaner output (no data shown)\n * 3. Expanded: Shows timestamp, level, and message on first line, with data on indented separate lines\n */\nexport class SimplePrettyTerminalTransport extends LoggerlessTransport {\n /** Handles rendering and formatting of logs */\n private renderer: SimpleView;\n\n /** Configuration options */\n private config: SimplePrettyTerminalConfig;\n\n /**\n * Creates a new SimplePrettyTerminalTransport instance.\n *\n * @param config - Configuration options for the transport\n */\n constructor(config: SimplePrettyTerminalConfig) {\n super(config);\n\n // Store configuration\n this.config = config;\n\n // If transport is disabled, don't initialize anything\n if (config.enabled === false) {\n return;\n }\n\n // Initialize configuration with defaults\n const maxInlineDepth = config.maxInlineDepth || 4;\n const theme = config.theme || moonlight;\n const viewMode = config.viewMode || \"inline\";\n const showLogId = config.showLogId || false;\n const timestampFormat = config.timestampFormat || \"HH:mm:ss.SSS\";\n const collapseArrays = config.collapseArrays !== false; // Default to true\n const flattenNestedObjects = config.flattenNestedObjects !== false; // Default to true\n const runtime = config.runtime;\n const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;\n\n // Initialize view configuration with defaults\n const viewConfig = {\n colors: {\n trace: chalk.gray, // Lowest level, used for verbose output\n debug: chalk.blue, // Debug information\n info: chalk.green, // Normal operation\n warn: chalk.yellow, // Warning conditions\n error: chalk.red, // Error conditions\n fatal: chalk.bgRed.white, // Critical errors\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n // Initialize the renderer\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth,\n showLogId,\n timestampFormat,\n collapseArrays,\n flattenNestedObjects,\n runtime,\n includeDataInBrowserConsole,\n config: viewConfig,\n });\n }\n\n /**\n * Generates a random ID for each log entry.\n * Uses base36 encoding for compact, readable IDs.\n *\n * @returns A 6-character string ID\n * @example\n * \"a1b2c3\" // Example generated ID\n */\n private generateId(): string {\n return Math.random().toString(36).substring(2, 8);\n }\n\n /**\n * Applies sprintf formatting to messages if enabled and applicable.\n * If the first message is a format string and there are additional arguments,\n * formats them using sprintf-js.\n *\n * @param messages - Array of message strings\n * @returns Formatted message string\n */\n private formatMessages(messages: any[]): string {\n if (!this.config.enableSprintf || messages.length < 2) {\n return messages.join(\" \");\n }\n\n const [format, ...args] = messages;\n\n // Only apply sprintf if the first argument is a string\n if (typeof format !== \"string\") {\n return messages.join(\" \");\n }\n\n try {\n return sprintf(format, ...args);\n } catch (_error) {\n // If sprintf fails, return original messages joined\n return messages.join(\" \");\n }\n }\n\n /**\n * Main transport method that receives logs from LogLayer.\n * This method is called for each log event and handles:\n * - Generating a unique ID for the log\n * - Converting the log data to a storable format\n * - Rendering the log using the SimpleView renderer\n *\n * @param logLevel - The severity level of the log\n * @param messages - Array of message strings to be joined\n * @param data - Additional structured data to be logged\n * @param hasData - Whether the log includes additional data\n * @returns The original messages array\n */\n shipToLogger({ logLevel, messages, data, hasData }: LogLayerTransportParams): any[] {\n // If transport is disabled, return messages without processing\n if (this.config.enabled === false) {\n return messages;\n }\n\n const entry = {\n id: this.generateId(),\n timestamp: Date.now(),\n level: logLevel,\n message: this.formatMessages(messages),\n data: hasData ? JSON.stringify(data) : null,\n };\n\n this.renderer.renderLogLine(entry);\n return messages;\n }\n\n /**\n * Changes the view mode for log display.\n *\n * @param viewMode - The new view mode to use\n */\n setViewMode(viewMode: PrettyTerminalViewMode): void {\n if (this.config.enabled === false) {\n return;\n }\n\n // Rebuild the viewConfig as in the constructor\n const theme = this.config.theme || moonlight;\n const runtime = this.config.runtime;\n const viewConfig = {\n colors: {\n trace: chalk.gray,\n debug: chalk.blue,\n info: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n fatal: chalk.bgRed.white,\n ...theme.colors,\n },\n logIdColor: theme.logIdColor || chalk.dim,\n dataValueColor: theme.dataValueColor || chalk.white,\n dataKeyColor: theme.dataKeyColor || chalk.dim,\n };\n\n this.renderer = new SimpleView({\n viewMode,\n maxInlineDepth: this.config.maxInlineDepth || 4,\n showLogId: this.config.showLogId || false,\n timestampFormat: this.config.timestampFormat || \"HH:mm:ss.SSS\",\n collapseArrays: this.config.collapseArrays !== false,\n flattenNestedObjects: this.config.flattenNestedObjects !== false,\n runtime,\n includeDataInBrowserConsole: this.config.includeDataInBrowserConsole || false,\n config: viewConfig,\n });\n }\n\n /**\n * Gets the current view mode.\n *\n * @returns The current view mode\n */\n getViewMode(): PrettyTerminalViewMode {\n return this.renderer.getViewMode();\n }\n}\n","import { SimplePrettyTerminalTransport } from \"./SimplePrettyTerminalTransport.js\";\nimport type {\n PrettyTerminalViewMode,\n Runtime,\n SimplePrettyTerminalConfig,\n SimplePrettyTerminalTheme,\n} from \"./types.js\";\n\n// Export chalk for custom theme creation\nexport * from \"chalk\";\n// Export all built-in themes\nexport * from \"./themes.js\";\n// Export essential types for configuration and custom themes\nexport type { PrettyTerminalViewMode, Runtime, SimplePrettyTerminalConfig, SimplePrettyTerminalTheme };\n// Export the main transport class (for advanced usage)\nexport { SimplePrettyTerminalTransport };\n\n// Main convenience function for creating the transport\nexport function getSimplePrettyTerminal(config: SimplePrettyTerminalConfig) {\n return new SimplePrettyTerminalTransport(config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,YAAuC;CAClD,QAAQ;EACN,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;EAC9B,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;EAC9B,MAAM,MAAM,IAAI,KAAK,KAAK,GAAG;EAC7B,MAAM,MAAM,IAAI,KAAK,KAAK,GAAG;EAC7B,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;EAC9B,OAAO,MAAM,MAAM,KAAK,KAAK,GAAG,EAAE;CACpC;CACA,YAAY,MAAM,IAAI,IAAI,IAAI,GAAG;CACjC,gBAAgB,MAAM,IAAI,KAAK,KAAK,GAAG;CACvC,cAAc,MAAM,IAAI,KAAK,KAAK,GAAG;AACvC;;;;;;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cAAc,MAAM;GACtC,gBAAgB,MAAM,kBAAkB,MAAM;GAC9C,cAAc,MAAM,gBAAgB,MAAM;EAC5C;EAEA,KAAK,WAAW,IAAI,WAAW;GAC7B;GACA,gBAAgB,KAAK,OAAO,kBAAkB;GAC9C,WAAW,KAAK,OAAO,aAAa;GACpC,iBAAiB,KAAK,OAAO,mBAAmB;GAChD,gBAAgB,KAAK,OAAO,mBAAmB;GAC/C,sBAAsB,KAAK,OAAO,yBAAyB;GAC3D;GACA,6BAA6B,KAAK,OAAO,+BAA+B;GACxE,QAAQ;EACV,CAAC;CACH;;;;;;CAOA,cAAsC;EACpC,OAAO,KAAK,SAAS,YAAY;CACnC;AACF;;;AC/MA,SAAgB,wBAAwB,QAAoC;CAC1E,OAAO,IAAI,8BAA8B,MAAM;AACjD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loglayer/transport-simple-pretty-terminal",
|
|
3
3
|
"description": "Pretty log output in the terminal / browser / Next.js for the LogLayer logging library.",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"chalk": "5.6.2",
|
|
39
|
-
"date-fns": "4.
|
|
39
|
+
"date-fns": "4.3.0",
|
|
40
40
|
"sprintf-js": "1.1.3",
|
|
41
|
-
"@loglayer/transport": "3.
|
|
41
|
+
"@loglayer/transport": "3.3.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/chalk": "2.2.4",
|
|
45
45
|
"@types/express": "5.0.6",
|
|
46
|
-
"@types/node": "25.
|
|
46
|
+
"@types/node": "25.9.1",
|
|
47
47
|
"@types/sprintf-js": "1.1.4",
|
|
48
48
|
"express": "5.2.1",
|
|
49
49
|
"serialize-error": "13.0.1",
|
|
50
|
-
"tsdown": "0.
|
|
51
|
-
"tsx": "4.
|
|
52
|
-
"typescript": "
|
|
53
|
-
"vitest": "4.
|
|
50
|
+
"tsdown": "0.22.1",
|
|
51
|
+
"tsx": "4.22.3",
|
|
52
|
+
"typescript": "6.0.3",
|
|
53
|
+
"vitest": "4.1.7",
|
|
54
54
|
"@internal/tsconfig": "2.1.0",
|
|
55
|
-
"loglayer": "9.
|
|
55
|
+
"loglayer": "9.4.0"
|
|
56
56
|
},
|
|
57
57
|
"bugs": "https://github.com/loglayer/loglayer/issues",
|
|
58
58
|
"files": [
|