@loglayer/transport-simple-pretty-terminal 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -106,9 +106,6 @@ var pastel = {
106
106
  dataKeyColor: _chalk2.default.rgb(173, 216, 230)
107
107
  };
108
108
 
109
- // src/views/SimpleView.ts
110
- var _wrapansi = require('wrap-ansi'); var _wrapansi2 = _interopRequireDefault(_wrapansi);
111
-
112
109
  // src/vendor/prettyjson.js
113
110
 
114
111
 
@@ -389,14 +386,7 @@ var SimpleView = class {
389
386
  this.collapseArrays = config.collapseArrays !== false;
390
387
  this.flattenNestedObjects = config.flattenNestedObjects !== false;
391
388
  this.runtime = config.runtime;
392
- if (this.runtime === "node") {
393
- this.termWidth = _optionalChain([process, 'optionalAccess', _ => _.stdout, 'optionalAccess', _2 => _2.columns]) || 120;
394
- } else {
395
- this.termWidth = 120;
396
- }
397
- }
398
- updateTerminalWidth(width) {
399
- this.termWidth = width;
389
+ this.includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;
400
390
  }
401
391
  getConfig() {
402
392
  return this.config;
@@ -407,30 +397,55 @@ var SimpleView = class {
407
397
  /**
408
398
  * Writes a message to the appropriate output based on runtime
409
399
  */
410
- writeMessage(message, level) {
400
+ writeMessage(message, level, data) {
411
401
  if (this.runtime === "node") {
412
- _optionalChain([process, 'optionalAccess', _3 => _3.stdout, 'optionalAccess', _4 => _4.write, 'optionalCall', _5 => _5(`${message}
402
+ _optionalChain([process, 'optionalAccess', _ => _.stdout, 'optionalAccess', _2 => _2.write, 'optionalCall', _3 => _3(`${message}
413
403
  `)]);
414
404
  } else {
405
+ const shouldIncludeData = this.includeDataInBrowserConsole && data !== void 0;
415
406
  switch (level) {
416
407
  case "trace":
417
- console.debug(message);
408
+ if (shouldIncludeData) {
409
+ console.debug(message, data);
410
+ } else {
411
+ console.debug(message);
412
+ }
418
413
  break;
419
414
  case "debug":
420
- console.debug(message);
415
+ if (shouldIncludeData) {
416
+ console.debug(message, data);
417
+ } else {
418
+ console.debug(message);
419
+ }
421
420
  break;
422
421
  case "info":
423
- console.info(message);
422
+ if (shouldIncludeData) {
423
+ console.info(message, data);
424
+ } else {
425
+ console.info(message);
426
+ }
424
427
  break;
425
428
  case "warn":
426
- console.warn(message);
429
+ if (shouldIncludeData) {
430
+ console.warn(message, data);
431
+ } else {
432
+ console.warn(message);
433
+ }
427
434
  break;
428
435
  case "error":
429
436
  case "fatal":
430
- console.error(message);
437
+ if (shouldIncludeData) {
438
+ console.error(message, data);
439
+ } else {
440
+ console.error(message);
441
+ }
431
442
  break;
432
443
  default:
433
- console.log(message);
444
+ if (shouldIncludeData) {
445
+ console.log(message, data);
446
+ } else {
447
+ console.log(message);
448
+ }
434
449
  break;
435
450
  }
436
451
  }
@@ -443,10 +458,11 @@ var SimpleView = class {
443
458
  const chevron = levelColor(`\u25B6 ${entry.level.toUpperCase()} `);
444
459
  const message = entry.message || "(no message)";
445
460
  const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor, this.timestampFormat);
461
+ const parsedData = entry.data ? JSON.parse(entry.data) : void 0;
446
462
  switch (this.viewMode) {
447
463
  case "message-only": {
448
464
  const condensedLine = `${timestamp} ${chevron}${message}`;
449
- this.writeMessage(_wrapansi2.default.call(void 0, condensedLine, this.termWidth, { hard: true }), entry.level);
465
+ this.writeMessage(condensedLine, entry.level, parsedData);
450
466
  break;
451
467
  }
452
468
  case "inline": {
@@ -459,13 +475,13 @@ var SimpleView = class {
459
475
  this.collapseArrays
460
476
  ) : "";
461
477
  const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : ""}${message}${fullData ? ` ${fullData}` : ""}`;
462
- this.writeMessage(expandedLine, entry.level);
478
+ this.writeMessage(expandedLine, entry.level, parsedData);
463
479
  break;
464
480
  }
465
481
  case "expanded": {
466
482
  const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : "";
467
483
  const firstLine = `${timestamp} ${chevron}${logId ? `${logId} ` : ""}${message}`;
468
- this.writeMessage(_wrapansi2.default.call(void 0, firstLine, this.termWidth, { hard: true }), entry.level);
484
+ this.writeMessage(firstLine, entry.level, parsedData);
469
485
  if (entry.data) {
470
486
  const jsonLines = render(JSON.parse(entry.data), {
471
487
  defaultIndentation: 2,
@@ -482,9 +498,7 @@ var SimpleView = class {
482
498
  collapseArrays: this.collapseArrays
483
499
  }).split("\n");
484
500
  for (const line of jsonLines) {
485
- if (line.trim() === "") {
486
- this.writeMessage(" ", entry.level);
487
- } else {
501
+ if (line.trim() !== "") {
488
502
  this.writeMessage(` ${line}`, entry.level);
489
503
  }
490
504
  }
@@ -495,7 +509,7 @@ var SimpleView = class {
495
509
  const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : "";
496
510
  const fullData = entry.data ? formatInlineData(JSON.parse(entry.data), this.config.config, this.maxInlineDepth, true, this.collapseArrays) : "";
497
511
  const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : ""}${message}${fullData ? ` ${fullData}` : ""}`;
498
- this.writeMessage(_wrapansi2.default.call(void 0, expandedLine, this.termWidth, { hard: true }), entry.level);
512
+ this.writeMessage(expandedLine, entry.level, parsedData);
499
513
  break;
500
514
  }
501
515
  }
@@ -508,8 +522,6 @@ var SimplePrettyTerminalTransport = class extends _transport.LoggerlessTransport
508
522
 
509
523
  /** Configuration options */
510
524
 
511
- /** Current terminal width in characters */
512
-
513
525
  /**
514
526
  * Creates a new SimplePrettyTerminalTransport instance.
515
527
  *
@@ -529,6 +541,7 @@ var SimplePrettyTerminalTransport = class extends _transport.LoggerlessTransport
529
541
  const collapseArrays = config.collapseArrays !== false;
530
542
  const flattenNestedObjects = config.flattenNestedObjects !== false;
531
543
  const runtime = config.runtime;
544
+ const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;
532
545
  const viewConfig = {
533
546
  colors: {
534
547
  trace: _chalk2.default.gray,
@@ -549,11 +562,6 @@ var SimplePrettyTerminalTransport = class extends _transport.LoggerlessTransport
549
562
  dataValueColor: theme.dataValueColor || _chalk2.default.white,
550
563
  dataKeyColor: theme.dataKeyColor || _chalk2.default.dim
551
564
  };
552
- if (runtime === "node") {
553
- this.termWidth = _optionalChain([process, 'optionalAccess', _6 => _6.stdout, 'optionalAccess', _7 => _7.columns]) || 80;
554
- } else {
555
- this.termWidth = 80;
556
- }
557
565
  this.renderer = new SimpleView({
558
566
  viewMode,
559
567
  maxInlineDepth,
@@ -562,14 +570,9 @@ var SimplePrettyTerminalTransport = class extends _transport.LoggerlessTransport
562
570
  collapseArrays,
563
571
  flattenNestedObjects,
564
572
  runtime,
573
+ includeDataInBrowserConsole,
565
574
  config: viewConfig
566
575
  });
567
- if (runtime === "node" && _optionalChain([process, 'optionalAccess', _8 => _8.stdout, 'optionalAccess', _9 => _9.on])) {
568
- process.stdout.on("resize", () => {
569
- this.termWidth = _optionalChain([process, 'optionalAccess', _10 => _10.stdout, 'optionalAccess', _11 => _11.columns]) || 80;
570
- this.renderer.updateTerminalWidth(this.termWidth);
571
- });
572
- }
573
576
  }
574
577
  /**
575
578
  * Generates a random ID for each log entry.
@@ -642,6 +645,7 @@ var SimplePrettyTerminalTransport = class extends _transport.LoggerlessTransport
642
645
  collapseArrays: this.config.collapseArrays !== false,
643
646
  flattenNestedObjects: this.config.flattenNestedObjects !== false,
644
647
  runtime,
648
+ includeDataInBrowserConsole: this.config.includeDataInBrowserConsole || false,
645
649
  config: viewConfig
646
650
  });
647
651
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/loglayer/loglayer/packages/transports/simple-pretty-terminal/dist/index.cjs","../src/SimplePrettyTerminalTransport.ts","../src/themes.ts","../src/views/SimpleView.ts","../src/vendor/prettyjson.js","../src/vendor/utils.js","../src/views/utils.ts","../src/index.ts"],"names":["chalk"],"mappings":"AAAA;ACyBA,gDAAoC;AACpC,uGAAkB;ADvBlB;AACA;AEJA;AAiBO,IAAM,UAAA,EAAuC;AA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ACF;AD4bkB;AACA;AOxoBJ;AAYE;AACH,EAAA;AACb;AP+nBkB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/loglayer/loglayer/packages/transports/simple-pretty-terminal/dist/index.cjs","sourcesContent":[null,"/**\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 { 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 /** Current terminal width in characters */\n private termWidth: number;\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\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 // Set terminal width based on runtime\n if (runtime === \"node\") {\n this.termWidth = process?.stdout?.columns || 80;\n } else {\n // For browser, use a reasonable default width\n this.termWidth = 80;\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 config: viewConfig,\n });\n\n // Update terminal width when window is resized (Node.js only)\n if (runtime === \"node\" && process?.stdout?.on) {\n process.stdout.on(\"resize\", () => {\n this.termWidth = process?.stdout?.columns || 80;\n this.renderer.updateTerminalWidth(this.termWidth);\n });\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 * 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: messages.join(\" \"),\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 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 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","import wrap from \"wrap-ansi\";\nimport 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 termWidth: number;\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\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\n // Set terminal width based on runtime\n if (this.runtime === \"node\") {\n this.termWidth = process?.stdout?.columns || 120;\n } else {\n // For browser, use a reasonable default width\n this.termWidth = 120;\n }\n }\n\n public updateTerminalWidth(width: number): void {\n this.termWidth = width;\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): 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 switch (level) {\n case \"trace\":\n console.debug(message);\n break;\n case \"debug\":\n console.debug(message);\n break;\n case \"info\":\n console.info(message);\n break;\n case \"warn\":\n console.warn(message);\n break;\n case \"error\":\n case \"fatal\":\n console.error(message);\n break;\n default:\n console.log(message);\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 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(wrap(condensedLine, this.termWidth, { hard: true }), entry.level);\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);\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(wrap(firstLine, this.termWidth, { hard: true }), entry.level);\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 // Skip empty lines\n if (line.trim() === \"\") {\n this.writeMessage(\" \", entry.level);\n } else {\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(wrap(expandedLine, this.termWidth, { hard: true }), entry.level);\n break;\n }\n }\n }\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","/**\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","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 { 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"]}
1
+ {"version":3,"sources":["/home/runner/work/loglayer/loglayer/packages/transports/simple-pretty-terminal/dist/index.cjs","../src/SimplePrettyTerminalTransport.ts","../src/themes.ts","../src/vendor/prettyjson.js","../src/vendor/utils.js","../src/views/utils.ts","../src/views/SimpleView.ts","../src/index.ts"],"names":["chalk"],"mappings":"AAAA;ACyBA,gDAAoC;AACpC,uGAAkB;ADvBlB;AACA;AEJA;AAiBO,IAAM,UAAA,EAAuC;AAAA,EAClD,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,eAAA,CAAM,GAAA,CAAI,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;AAAA;AAAA,IAC9B,KAAA,EAAO,eAAA,CAAM,GAAA,CAAI,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;AAAA;AAAA,IAC9B,IAAA,EAAM,eAAA,CAAM,GAAA,CAAI,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;AAAA;AAAA,IAC7B,IAAA,EAAM,eAAA,CAAM,GAAA,CAAI,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;AAAA;AAAA,IAC7B,KAAA,EAAO,eAAA,CAAM,GAAA,CAAI,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;AAAA;AAAA,IAC9B,KAAA,EAAO,eAAA,CAAM,KA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;AAAA;AAAA;AAAA;AAAA;AAU6B,EAAA;AACf,IAAA;AACd,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAee,EAAA;AAEJ,IAAA;AACA,MAAA;AACT,IAAA;AAEc,IAAA;AACH,MAAA;AACE,MAAA;AACJ,MAAA;AACE,MAAA;AACH,MAAA;AACR,IAAA;AAEc,IAAA;AACP,IAAA;AACT,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOY,EAAA;AACD,IAAA;AACP,MAAA;AACF,IAAA;AAGc,IAAA;AACR,IAAA;AACA,IAAA;AACI,MAAA;AACCA,QAAAA;AACAA,QAAAA;AACDA,QAAAA;AACAA,QAAAA;AACCA,QAAAA;AACAA,QAAAA;AACE,QAAA;AACX,MAAA;AACY,MAAA;AACZ,MAAA;AACA,MAAA;AACF,IAAA;AAEK,IAAA;AACH,MAAA;AACA,MAAA;AACW,MAAA;AACX,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACQ,MAAA;AACT,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsC,EAAA;AACxB,IAAA;AACd,EAAA;AACF;ADgdkB;AACA;AO5oBJ;AAYE;AACH,EAAA;AACb;APmoBkB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/loglayer/loglayer/packages/transports/simple-pretty-terminal/dist/index.cjs","sourcesContent":[null,"/**\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 { 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 * 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: messages.join(\" \"),\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 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","// @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","/**\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","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","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"]}
package/dist/index.d.cts CHANGED
@@ -75,6 +75,8 @@ interface SimplePrettyTerminalConfig extends LoggerlessTransportConfig {
75
75
  flattenNestedObjects?: boolean;
76
76
  /** Runtime environment for output */
77
77
  runtime: Runtime;
78
+ /** Whether to include data object as second parameter in browser console calls for better debugging. Defaults to false */
79
+ includeDataInBrowserConsole?: boolean;
78
80
  }
79
81
 
80
82
  /**
@@ -115,8 +117,6 @@ declare class SimplePrettyTerminalTransport extends LoggerlessTransport {
115
117
  private renderer;
116
118
  /** Configuration options */
117
119
  private config;
118
- /** Current terminal width in characters */
119
- private termWidth;
120
120
  /**
121
121
  * Creates a new SimplePrettyTerminalTransport instance.
122
122
  *
package/dist/index.d.ts CHANGED
@@ -75,6 +75,8 @@ interface SimplePrettyTerminalConfig extends LoggerlessTransportConfig {
75
75
  flattenNestedObjects?: boolean;
76
76
  /** Runtime environment for output */
77
77
  runtime: Runtime;
78
+ /** Whether to include data object as second parameter in browser console calls for better debugging. Defaults to false */
79
+ includeDataInBrowserConsole?: boolean;
78
80
  }
79
81
 
80
82
  /**
@@ -115,8 +117,6 @@ declare class SimplePrettyTerminalTransport extends LoggerlessTransport {
115
117
  private renderer;
116
118
  /** Configuration options */
117
119
  private config;
118
- /** Current terminal width in characters */
119
- private termWidth;
120
120
  /**
121
121
  * Creates a new SimplePrettyTerminalTransport instance.
122
122
  *
package/dist/index.js CHANGED
@@ -106,9 +106,6 @@ var pastel = {
106
106
  dataKeyColor: chalk.rgb(173, 216, 230)
107
107
  };
108
108
 
109
- // src/views/SimpleView.ts
110
- import wrap from "wrap-ansi";
111
-
112
109
  // src/vendor/prettyjson.js
113
110
  import chalk2 from "chalk";
114
111
 
@@ -371,7 +368,6 @@ function formatInlineData(data, config, maxDepth, expanded = false, collapseArra
371
368
 
372
369
  // src/views/SimpleView.ts
373
370
  var SimpleView = class {
374
- termWidth;
375
371
  config;
376
372
  viewMode;
377
373
  maxInlineDepth;
@@ -380,6 +376,7 @@ var SimpleView = class {
380
376
  collapseArrays;
381
377
  flattenNestedObjects;
382
378
  runtime;
379
+ includeDataInBrowserConsole;
383
380
  constructor(config) {
384
381
  this.config = config;
385
382
  this.viewMode = config.viewMode;
@@ -389,14 +386,7 @@ var SimpleView = class {
389
386
  this.collapseArrays = config.collapseArrays !== false;
390
387
  this.flattenNestedObjects = config.flattenNestedObjects !== false;
391
388
  this.runtime = config.runtime;
392
- if (this.runtime === "node") {
393
- this.termWidth = process?.stdout?.columns || 120;
394
- } else {
395
- this.termWidth = 120;
396
- }
397
- }
398
- updateTerminalWidth(width) {
399
- this.termWidth = width;
389
+ this.includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;
400
390
  }
401
391
  getConfig() {
402
392
  return this.config;
@@ -407,30 +397,55 @@ var SimpleView = class {
407
397
  /**
408
398
  * Writes a message to the appropriate output based on runtime
409
399
  */
410
- writeMessage(message, level) {
400
+ writeMessage(message, level, data) {
411
401
  if (this.runtime === "node") {
412
402
  process?.stdout?.write?.(`${message}
413
403
  `);
414
404
  } else {
405
+ const shouldIncludeData = this.includeDataInBrowserConsole && data !== void 0;
415
406
  switch (level) {
416
407
  case "trace":
417
- console.debug(message);
408
+ if (shouldIncludeData) {
409
+ console.debug(message, data);
410
+ } else {
411
+ console.debug(message);
412
+ }
418
413
  break;
419
414
  case "debug":
420
- console.debug(message);
415
+ if (shouldIncludeData) {
416
+ console.debug(message, data);
417
+ } else {
418
+ console.debug(message);
419
+ }
421
420
  break;
422
421
  case "info":
423
- console.info(message);
422
+ if (shouldIncludeData) {
423
+ console.info(message, data);
424
+ } else {
425
+ console.info(message);
426
+ }
424
427
  break;
425
428
  case "warn":
426
- console.warn(message);
429
+ if (shouldIncludeData) {
430
+ console.warn(message, data);
431
+ } else {
432
+ console.warn(message);
433
+ }
427
434
  break;
428
435
  case "error":
429
436
  case "fatal":
430
- console.error(message);
437
+ if (shouldIncludeData) {
438
+ console.error(message, data);
439
+ } else {
440
+ console.error(message);
441
+ }
431
442
  break;
432
443
  default:
433
- console.log(message);
444
+ if (shouldIncludeData) {
445
+ console.log(message, data);
446
+ } else {
447
+ console.log(message);
448
+ }
434
449
  break;
435
450
  }
436
451
  }
@@ -443,10 +458,11 @@ var SimpleView = class {
443
458
  const chevron = levelColor(`\u25B6 ${entry.level.toUpperCase()} `);
444
459
  const message = entry.message || "(no message)";
445
460
  const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor, this.timestampFormat);
461
+ const parsedData = entry.data ? JSON.parse(entry.data) : void 0;
446
462
  switch (this.viewMode) {
447
463
  case "message-only": {
448
464
  const condensedLine = `${timestamp} ${chevron}${message}`;
449
- this.writeMessage(wrap(condensedLine, this.termWidth, { hard: true }), entry.level);
465
+ this.writeMessage(condensedLine, entry.level, parsedData);
450
466
  break;
451
467
  }
452
468
  case "inline": {
@@ -459,13 +475,13 @@ var SimpleView = class {
459
475
  this.collapseArrays
460
476
  ) : "";
461
477
  const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : ""}${message}${fullData ? ` ${fullData}` : ""}`;
462
- this.writeMessage(expandedLine, entry.level);
478
+ this.writeMessage(expandedLine, entry.level, parsedData);
463
479
  break;
464
480
  }
465
481
  case "expanded": {
466
482
  const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : "";
467
483
  const firstLine = `${timestamp} ${chevron}${logId ? `${logId} ` : ""}${message}`;
468
- this.writeMessage(wrap(firstLine, this.termWidth, { hard: true }), entry.level);
484
+ this.writeMessage(firstLine, entry.level, parsedData);
469
485
  if (entry.data) {
470
486
  const jsonLines = render(JSON.parse(entry.data), {
471
487
  defaultIndentation: 2,
@@ -482,9 +498,7 @@ var SimpleView = class {
482
498
  collapseArrays: this.collapseArrays
483
499
  }).split("\n");
484
500
  for (const line of jsonLines) {
485
- if (line.trim() === "") {
486
- this.writeMessage(" ", entry.level);
487
- } else {
501
+ if (line.trim() !== "") {
488
502
  this.writeMessage(` ${line}`, entry.level);
489
503
  }
490
504
  }
@@ -495,7 +509,7 @@ var SimpleView = class {
495
509
  const logId = this.showLogId ? this.config.config.logIdColor(`[${entry.id}]`) : "";
496
510
  const fullData = entry.data ? formatInlineData(JSON.parse(entry.data), this.config.config, this.maxInlineDepth, true, this.collapseArrays) : "";
497
511
  const expandedLine = `${timestamp} ${chevron}${logId ? `${logId} ` : ""}${message}${fullData ? ` ${fullData}` : ""}`;
498
- this.writeMessage(wrap(expandedLine, this.termWidth, { hard: true }), entry.level);
512
+ this.writeMessage(expandedLine, entry.level, parsedData);
499
513
  break;
500
514
  }
501
515
  }
@@ -508,8 +522,6 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
508
522
  renderer;
509
523
  /** Configuration options */
510
524
  config;
511
- /** Current terminal width in characters */
512
- termWidth;
513
525
  /**
514
526
  * Creates a new SimplePrettyTerminalTransport instance.
515
527
  *
@@ -529,6 +541,7 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
529
541
  const collapseArrays = config.collapseArrays !== false;
530
542
  const flattenNestedObjects = config.flattenNestedObjects !== false;
531
543
  const runtime = config.runtime;
544
+ const includeDataInBrowserConsole = config.includeDataInBrowserConsole || false;
532
545
  const viewConfig = {
533
546
  colors: {
534
547
  trace: chalk4.gray,
@@ -549,11 +562,6 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
549
562
  dataValueColor: theme.dataValueColor || chalk4.white,
550
563
  dataKeyColor: theme.dataKeyColor || chalk4.dim
551
564
  };
552
- if (runtime === "node") {
553
- this.termWidth = process?.stdout?.columns || 80;
554
- } else {
555
- this.termWidth = 80;
556
- }
557
565
  this.renderer = new SimpleView({
558
566
  viewMode,
559
567
  maxInlineDepth,
@@ -562,14 +570,9 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
562
570
  collapseArrays,
563
571
  flattenNestedObjects,
564
572
  runtime,
573
+ includeDataInBrowserConsole,
565
574
  config: viewConfig
566
575
  });
567
- if (runtime === "node" && process?.stdout?.on) {
568
- process.stdout.on("resize", () => {
569
- this.termWidth = process?.stdout?.columns || 80;
570
- this.renderer.updateTerminalWidth(this.termWidth);
571
- });
572
- }
573
576
  }
574
577
  /**
575
578
  * Generates a random ID for each log entry.
@@ -642,6 +645,7 @@ var SimplePrettyTerminalTransport = class extends LoggerlessTransport {
642
645
  collapseArrays: this.config.collapseArrays !== false,
643
646
  flattenNestedObjects: this.config.flattenNestedObjects !== false,
644
647
  runtime,
648
+ includeDataInBrowserConsole: this.config.includeDataInBrowserConsole || false,
645
649
  config: viewConfig
646
650
  });
647
651
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/SimplePrettyTerminalTransport.ts","../src/themes.ts","../src/views/SimpleView.ts","../src/vendor/prettyjson.js","../src/vendor/utils.js","../src/views/utils.ts","../src/index.ts"],"sourcesContent":["/**\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 { 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 /** Current terminal width in characters */\n private termWidth: number;\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\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 // Set terminal width based on runtime\n if (runtime === \"node\") {\n this.termWidth = process?.stdout?.columns || 80;\n } else {\n // For browser, use a reasonable default width\n this.termWidth = 80;\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 config: viewConfig,\n });\n\n // Update terminal width when window is resized (Node.js only)\n if (runtime === \"node\" && process?.stdout?.on) {\n process.stdout.on(\"resize\", () => {\n this.termWidth = process?.stdout?.columns || 80;\n this.renderer.updateTerminalWidth(this.termWidth);\n });\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 * 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: messages.join(\" \"),\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 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 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","import wrap from \"wrap-ansi\";\nimport 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 termWidth: number;\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\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\n // Set terminal width based on runtime\n if (this.runtime === \"node\") {\n this.termWidth = process?.stdout?.columns || 120;\n } else {\n // For browser, use a reasonable default width\n this.termWidth = 120;\n }\n }\n\n public updateTerminalWidth(width: number): void {\n this.termWidth = width;\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): 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 switch (level) {\n case \"trace\":\n console.debug(message);\n break;\n case \"debug\":\n console.debug(message);\n break;\n case \"info\":\n console.info(message);\n break;\n case \"warn\":\n console.warn(message);\n break;\n case \"error\":\n case \"fatal\":\n console.error(message);\n break;\n default:\n console.log(message);\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 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(wrap(condensedLine, this.termWidth, { hard: true }), entry.level);\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);\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(wrap(firstLine, this.termWidth, { hard: true }), entry.level);\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 // Skip empty lines\n if (line.trim() === \"\") {\n this.writeMessage(\" \", entry.level);\n } else {\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(wrap(expandedLine, this.termWidth, { hard: true }), entry.level);\n break;\n }\n }\n }\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","/**\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","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 { 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":";AAyBA,SAAS,2BAA2B;AACpC,OAAOA,YAAW;;;AC1BlB,OAAO,WAAW;AAiBX,IAAM,YAAuC;AAAA,EAClD,QAAQ;AAAA,IACN,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC9B,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC9B,MAAM,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC7B,MAAM,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC7B,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC9B,OAAO,MAAM,MAAM,KAAK,KAAK,GAAG,EAAE;AAAA;AAAA,EACpC;AAAA,EACA,YAAY,MAAM,IAAI,IAAI,IAAI,GAAG;AAAA;AAAA,EACjC,gBAAgB,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;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AAAA,MACA,gBAAgB,KAAK,OAAO,kBAAkB;AAAA,MAC9C,WAAW,KAAK,OAAO,aAAa;AAAA,MACpC,iBAAiB,KAAK,OAAO,mBAAmB;AAAA,MAChD,gBAAgB,KAAK,OAAO,mBAAmB;AAAA,MAC/C,sBAAsB,KAAK,OAAO,yBAAyB;AAAA,MAC3D;AAAA,MACA,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,cAAsC;AACpC,WAAO,KAAK,SAAS,YAAY;AAAA,EACnC;AACF;;;AM3MA,cAAc;AAYP,SAAS,wBAAwB,QAAoC;AAC1E,SAAO,IAAI,8BAA8B,MAAM;AACjD;","names":["chalk","chalk","chalk","chalk","chalk"]}
1
+ {"version":3,"sources":["../src/SimplePrettyTerminalTransport.ts","../src/themes.ts","../src/vendor/prettyjson.js","../src/vendor/utils.js","../src/views/utils.ts","../src/views/SimpleView.ts","../src/index.ts"],"sourcesContent":["/**\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 { 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 * 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: messages.join(\" \"),\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 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","// @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","/**\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","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","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":";AAyBA,SAAS,2BAA2B;AACpC,OAAOA,YAAW;;;AC1BlB,OAAO,WAAW;AAiBX,IAAM,YAAuC;AAAA,EAClD,QAAQ;AAAA,IACN,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC9B,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC9B,MAAM,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC7B,MAAM,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC7B,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG;AAAA;AAAA,IAC9B,OAA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M,cAAcA,OAAM;AAAA,MACtC,gBAAgB,MAAM,kBAAkBA,OAAM;AAAA,MAC9C,cAAc,MAAM,gBAAgBA,OAAM;AAAA,IAC5C;AAEA,SAAK,WAAW,IAAI,WAAW;AAAA,MAC7B;AAAA,MACA,gBAAgB,KAAK,OAAO,kBAAkB;AAAA,MAC9C,WAAW,KAAK,OAAO,aAAa;AAAA,MACpC,iBAAiB,KAAK,OAAO,mBAAmB;AAAA,MAChD,gBAAgB,KAAK,OAAO,mBAAmB;AAAA,MAC/C,sBAAsB,KAAK,OAAO,yBAAyB;AAAA,MAC3D;AAAA,MACA,6BAA6B,KAAK,OAAO,+BAA+B;AAAA,MACxE,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,cAAsC;AACpC,WAAO,KAAK,SAAS,YAAY;AAAA,EACnC;AACF;;;AM3LA,cAAc;AAYP,SAAS,wBAAwB,QAAoC;AAC1E,SAAO,IAAI,8BAA8B,MAAM;AACjD;","names":["chalk","chalk","chalk","chalk","chalk"]}
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": "2.1.0",
4
+ "version": "2.2.1",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -36,7 +36,6 @@
36
36
  "dependencies": {
37
37
  "chalk": "5.4.1",
38
38
  "date-fns": "3.6.0",
39
- "wrap-ansi": "9.0.0",
40
39
  "@loglayer/transport": "2.2.1"
41
40
  },
42
41
  "devDependencies": {