@mks2508/better-logger 4.0.0 → 5.0.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.
Files changed (183) hide show
  1. package/CHANGELOG.json +67 -1
  2. package/package.json +28 -3
  3. package/packages/core/package.json +1 -1
  4. package/packages/exports/package.json +2 -2
  5. package/packages/styling/package.json +2 -2
  6. package/playground/demo-all.ts +95 -0
  7. package/playground/demo-box.ts +85 -0
  8. package/playground/demo-levels.ts +56 -0
  9. package/playground/demo-real-world.ts +98 -0
  10. package/playground/demo-spinner.ts +77 -0
  11. package/playground/demo-steps.ts +72 -0
  12. package/playground/demo-table.ts +83 -0
  13. package/src/Logger.ts +213 -8
  14. package/src/ScopedLogger.ts +43 -1
  15. package/src/cli-module.ts +21 -0
  16. package/src/cli-primitives/box.ts +86 -0
  17. package/src/cli-primitives/cli-table.ts +62 -0
  18. package/src/cli-primitives/divider.ts +17 -0
  19. package/src/cli-primitives/header.ts +18 -0
  20. package/src/cli-primitives/index.ts +13 -0
  21. package/src/cli-primitives/server-fallback.ts +54 -0
  22. package/src/cli-primitives/spinner.ts +133 -0
  23. package/src/cli-primitives/step.ts +22 -0
  24. package/src/constants.ts +14 -2
  25. package/src/index.ts +18 -1
  26. package/src/terminal/formatter.ts +16 -10
  27. package/src/types/core.ts +53 -0
  28. package/src/types/index.ts +4 -0
  29. package/vite.config.ts +33 -0
  30. package/bun.lock +0 -333
  31. package/dist/Logger.d.ts +0 -863
  32. package/dist/Logger.d.ts.map +0 -1
  33. package/dist/ScopedLogger.d.ts +0 -57
  34. package/dist/ScopedLogger.d.ts.map +0 -1
  35. package/dist/chunks/Logger-D-gmmgR2.js +0 -4458
  36. package/dist/chunks/Logger-D-gmmgR2.js.map +0 -1
  37. package/dist/chunks/Logger-D7cfaz15.js +0 -2
  38. package/dist/chunks/Logger-D7cfaz15.js.map +0 -1
  39. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +0 -33
  40. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +0 -1
  41. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +0 -2
  42. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +0 -1
  43. package/dist/chunks/environment-COWvu6Wz.js +0 -1577
  44. package/dist/chunks/environment-COWvu6Wz.js.map +0 -1
  45. package/dist/chunks/environment-C_8J-zQ_.js +0 -4
  46. package/dist/chunks/environment-C_8J-zQ_.js.map +0 -1
  47. package/dist/chunks/formatting-CYjT9yhO.js +0 -380
  48. package/dist/chunks/formatting-CYjT9yhO.js.map +0 -1
  49. package/dist/chunks/formatting-Cg5YhB9Y.js +0 -2
  50. package/dist/chunks/formatting-Cg5YhB9Y.js.map +0 -1
  51. package/dist/cli/CommandProcessor.d.ts +0 -100
  52. package/dist/cli/CommandProcessor.d.ts.map +0 -1
  53. package/dist/cli/commands/ConfigCommand.d.ts +0 -14
  54. package/dist/cli/commands/ConfigCommand.d.ts.map +0 -1
  55. package/dist/cli/commands/ExportCommand.d.ts +0 -48
  56. package/dist/cli/commands/ExportCommand.d.ts.map +0 -1
  57. package/dist/cli/commands/HistoryCommand.d.ts +0 -47
  58. package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
  59. package/dist/cli/commands/StatusCommand.d.ts +0 -30
  60. package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
  61. package/dist/cli/commands/ThemeCommand.d.ts +0 -30
  62. package/dist/cli/commands/ThemeCommand.d.ts.map +0 -1
  63. package/dist/cli/help.d.ts +0 -12
  64. package/dist/cli/help.d.ts.map +0 -1
  65. package/dist/cli/index.d.ts +0 -15
  66. package/dist/cli/index.d.ts.map +0 -1
  67. package/dist/constants.d.ts +0 -227
  68. package/dist/constants.d.ts.map +0 -1
  69. package/dist/core.cjs +0 -2
  70. package/dist/core.cjs.map +0 -1
  71. package/dist/core.d.ts +0 -127
  72. package/dist/core.d.ts.map +0 -1
  73. package/dist/core.js +0 -291
  74. package/dist/core.js.map +0 -1
  75. package/dist/example.d.ts +0 -18
  76. package/dist/example.d.ts.map +0 -1
  77. package/dist/exports-module.d.ts +0 -196
  78. package/dist/exports-module.d.ts.map +0 -1
  79. package/dist/exports.cjs +0 -2
  80. package/dist/exports.cjs.map +0 -1
  81. package/dist/exports.js +0 -238
  82. package/dist/exports.js.map +0 -1
  83. package/dist/handlers/AnalyticsLogHandler.d.ts +0 -8
  84. package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  85. package/dist/handlers/ExportLogHandler.d.ts +0 -100
  86. package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
  87. package/dist/handlers/FileLogHandler.d.ts +0 -33
  88. package/dist/handlers/FileLogHandler.d.ts.map +0 -1
  89. package/dist/handlers/RemoteLogHandler.d.ts +0 -11
  90. package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
  91. package/dist/handlers/index.d.ts +0 -8
  92. package/dist/handlers/index.d.ts.map +0 -1
  93. package/dist/hooks/HookManager.d.ts +0 -21
  94. package/dist/hooks/HookManager.d.ts.map +0 -1
  95. package/dist/hooks/index.d.ts +0 -2
  96. package/dist/hooks/index.d.ts.map +0 -1
  97. package/dist/index.cjs +0 -2
  98. package/dist/index.cjs.map +0 -1
  99. package/dist/index.d.ts +0 -153
  100. package/dist/index.d.ts.map +0 -1
  101. package/dist/index.js +0 -609
  102. package/dist/index.js.map +0 -1
  103. package/dist/main.d.ts +0 -2
  104. package/dist/main.d.ts.map +0 -1
  105. package/dist/serializers/SerializerRegistry.d.ts +0 -16
  106. package/dist/serializers/SerializerRegistry.d.ts.map +0 -1
  107. package/dist/serializers/index.d.ts +0 -2
  108. package/dist/serializers/index.d.ts.map +0 -1
  109. package/dist/styling/LogStyleBuilder.d.ts +0 -146
  110. package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
  111. package/dist/styling/SemanticStyles.d.ts +0 -178
  112. package/dist/styling/SemanticStyles.d.ts.map +0 -1
  113. package/dist/styling/SmartPresets.d.ts +0 -22
  114. package/dist/styling/SmartPresets.d.ts.map +0 -1
  115. package/dist/styling/StyleBuilder.d.ts +0 -140
  116. package/dist/styling/StyleBuilder.d.ts.map +0 -1
  117. package/dist/styling/StyleCache.d.ts +0 -42
  118. package/dist/styling/StyleCache.d.ts.map +0 -1
  119. package/dist/styling/banners.d.ts +0 -42
  120. package/dist/styling/banners.d.ts.map +0 -1
  121. package/dist/styling/index.d.ts +0 -10
  122. package/dist/styling/index.d.ts.map +0 -1
  123. package/dist/styling/themes.d.ts +0 -7
  124. package/dist/styling/themes.d.ts.map +0 -1
  125. package/dist/styling-module.d.ts +0 -178
  126. package/dist/styling-module.d.ts.map +0 -1
  127. package/dist/styling.cjs +0 -2
  128. package/dist/styling.cjs.map +0 -1
  129. package/dist/styling.js +0 -146
  130. package/dist/styling.js.map +0 -1
  131. package/dist/terminal/color-converter.d.ts +0 -73
  132. package/dist/terminal/color-converter.d.ts.map +0 -1
  133. package/dist/terminal/formatter.d.ts +0 -20
  134. package/dist/terminal/formatter.d.ts.map +0 -1
  135. package/dist/terminal/terminal-renderer.d.ts +0 -77
  136. package/dist/terminal/terminal-renderer.d.ts.map +0 -1
  137. package/dist/transports/ConsoleTransport.d.ts +0 -9
  138. package/dist/transports/ConsoleTransport.d.ts.map +0 -1
  139. package/dist/transports/FileTransport.d.ts +0 -15
  140. package/dist/transports/FileTransport.d.ts.map +0 -1
  141. package/dist/transports/HttpTransport.d.ts +0 -16
  142. package/dist/transports/HttpTransport.d.ts.map +0 -1
  143. package/dist/transports/TransportManager.d.ts +0 -14
  144. package/dist/transports/TransportManager.d.ts.map +0 -1
  145. package/dist/transports/index.d.ts +0 -5
  146. package/dist/transports/index.d.ts.map +0 -1
  147. package/dist/types/core.d.ts +0 -333
  148. package/dist/types/core.d.ts.map +0 -1
  149. package/dist/types/handlers.d.ts +0 -85
  150. package/dist/types/handlers.d.ts.map +0 -1
  151. package/dist/types/hooks.d.ts +0 -36
  152. package/dist/types/hooks.d.ts.map +0 -1
  153. package/dist/types/index.d.ts +0 -11
  154. package/dist/types/index.d.ts.map +0 -1
  155. package/dist/types/serializers.d.ts +0 -25
  156. package/dist/types/serializers.d.ts.map +0 -1
  157. package/dist/types/transports.d.ts +0 -47
  158. package/dist/types/transports.d.ts.map +0 -1
  159. package/dist/utils/adapter.d.ts +0 -48
  160. package/dist/utils/adapter.d.ts.map +0 -1
  161. package/dist/utils/ansi-colors.d.ts +0 -156
  162. package/dist/utils/ansi-colors.d.ts.map +0 -1
  163. package/dist/utils/environment-detector.d.ts +0 -45
  164. package/dist/utils/environment-detector.d.ts.map +0 -1
  165. package/dist/utils/environment.d.ts +0 -47
  166. package/dist/utils/environment.d.ts.map +0 -1
  167. package/dist/utils/formatting.d.ts +0 -58
  168. package/dist/utils/formatting.d.ts.map +0 -1
  169. package/dist/utils/index.d.ts +0 -8
  170. package/dist/utils/index.d.ts.map +0 -1
  171. package/dist/utils/opentui-detection.d.ts +0 -34
  172. package/dist/utils/opentui-detection.d.ts.map +0 -1
  173. package/dist/utils/output.d.ts +0 -46
  174. package/dist/utils/output.d.ts.map +0 -1
  175. package/dist/utils/stackTrace.d.ts +0 -6
  176. package/dist/utils/stackTrace.d.ts.map +0 -1
  177. package/dist/utils/timestamps.d.ts +0 -20
  178. package/dist/utils/timestamps.d.ts.map +0 -1
  179. package/dist/vite.svg +0 -1
  180. package/dist/writers/BufferWriter.d.ts +0 -96
  181. package/dist/writers/BufferWriter.d.ts.map +0 -1
  182. package/dist/writers/index.d.ts +0 -6
  183. package/dist/writers/index.d.ts.map +0 -1
@@ -1,42 +0,0 @@
1
- import { LogLevel, DevToolsTheme } from '../types/core.js';
2
- interface CacheKey {
3
- level: LogLevel | 'success';
4
- theme: DevToolsTheme;
5
- presetName?: string;
6
- hasPrefix: boolean;
7
- hasLocation: boolean;
8
- }
9
- interface CacheEntry {
10
- styles: string[];
11
- format: string;
12
- createdAt: number;
13
- hits: number;
14
- }
15
- export interface StyleCacheConfig {
16
- maxEntries?: number;
17
- ttl?: number;
18
- enabled?: boolean;
19
- }
20
- export declare class StyleCache {
21
- private cache;
22
- private config;
23
- private hitCount;
24
- private missCount;
25
- constructor(config?: StyleCacheConfig);
26
- private generateKey;
27
- get(key: CacheKey): CacheEntry | null;
28
- set(key: CacheKey, format: string, styles: string[]): void;
29
- clear(): void;
30
- getStats(): {
31
- size: number;
32
- maxSize: number;
33
- hitRate: number;
34
- hits: number;
35
- misses: number;
36
- };
37
- setEnabled(enabled: boolean): void;
38
- isEnabled(): boolean;
39
- }
40
- export declare function getStyleCache(): StyleCache;
41
- export {};
42
- //# sourceMappingURL=StyleCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StyleCache.d.ts","sourceRoot":"","sources":["../../src/styling/StyleCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEhE,UAAU,QAAQ;IACd,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,UAAU;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAQD,qBAAa,UAAU;IACnB,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAK;gBAEV,MAAM,GAAE,gBAAqB;IAIzC,OAAO,CAAC,WAAW;IAInB,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI;IAyBrC,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAoB1D,KAAK,IAAI,IAAI;IAMb,QAAQ,IAAI;QACR,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAClB;IAWD,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAOlC,SAAS,IAAI,OAAO;CAGvB;AAID,wBAAgB,aAAa,IAAI,UAAU,CAK1C"}
@@ -1,42 +0,0 @@
1
- import { BannerType, ThemeVariant } from '../types/index.js';
2
- /**
3
- * Banner variants for different display capabilities
4
- */
5
- export declare const BANNER_VARIANTS: {
6
- simple: {
7
- text: string;
8
- style: string;
9
- };
10
- ascii: {
11
- text: string;
12
- style: string;
13
- };
14
- unicode: {
15
- text: string;
16
- style: string;
17
- };
18
- svg: {
19
- text: string;
20
- style: string;
21
- };
22
- animated: {
23
- text: string;
24
- style: string;
25
- };
26
- };
27
- /**
28
- * Theme-specific banners for enhanced visual theming
29
- */
30
- export declare const THEME_BANNERS: Record<ThemeVariant, {
31
- simple: string;
32
- style: string;
33
- }>;
34
- /**
35
- * Feature detection for banner capabilities
36
- */
37
- export declare function detectBannerCapabilities(): BannerType;
38
- /**
39
- * Display initialization banner with advanced styling
40
- */
41
- export declare function displayInitBanner(bannerType?: BannerType): void;
42
- //# sourceMappingURL=banners.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"banners.d.ts","sourceRoot":"","sources":["../../src/styling/banners.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;CAoD3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAyBjF,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,UAAU,CA2BrD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAuC/D"}
@@ -1,10 +0,0 @@
1
- /**
2
- * @fileoverview Styling system exports for Advanced Logger
3
- */
4
- export { StyleBuilder, $, StylePresets } from './StyleBuilder.js';
5
- export { THEME_PRESETS } from './themes.js';
6
- export { BANNER_VARIANTS, THEME_BANNERS, detectBannerCapabilities, displayInitBanner } from './banners.js';
7
- export { TimestampStyler, LevelStyler, PrefixStyler, MessageStyler, LocationStyler } from './SemanticStyles.js';
8
- export { LogStyleBuilder, createLogStyleBuilder } from './LogStyleBuilder.js';
9
- export { SMART_PRESETS, getSmartPreset, getAvailablePresets, hasPreset, PRESET_DESCRIPTIONS } from './SmartPresets.js';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styling/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACH,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EACH,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACtB,MAAM,mBAAmB,CAAC"}
@@ -1,7 +0,0 @@
1
- import { ThemeVariant } from '../types/index.js';
2
- import { LevelStyleConfig } from '../utils/index.js';
3
- /**
4
- * Theme configurations for different visual styles
5
- */
6
- export declare const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>>;
7
- //# sourceMappingURL=themes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/styling/themes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAgOhF,CAAC"}
@@ -1,178 +0,0 @@
1
- import { Logger } from './Logger.js';
2
- import { StyleBuilder } from './styling/index.js';
3
- import { ThemeVariant, BannerType, StyleOptions } from './types/index.js';
4
- /**
5
- * Enhanced Logger with advanced styling capabilities
6
- *
7
- * @example
8
- * ```typescript
9
- * import { StyledLogger } from '@mks2508/better-logger/styling';
10
- *
11
- * const logger = new StyledLogger();
12
- * logger.setTheme('neon');
13
- * logger.logAnimated('🌟 Animated message!');
14
- * logger.logWithSVG('Custom SVG Logo', svgContent);
15
- * ```
16
- */
17
- export declare class StyledLogger extends Logger {
18
- /**
19
- * Log with SVG background image
20
- *
21
- * @param message - The message to log
22
- * @param svgContent - SVG content as string (optional)
23
- * @param options - Styling options
24
- *
25
- * @example
26
- * ```typescript
27
- * logger.logWithSVG('My App', '<svg>...</svg>', {
28
- * width: 400,
29
- * height: 80,
30
- * padding: '40px 200px'
31
- * });
32
- * ```
33
- */
34
- logWithSVG(message: string, svgContent?: string, options?: StyleOptions): void;
35
- /**
36
- * Log with animated background gradient
37
- *
38
- * @param message - The message to log
39
- * @param duration - Animation duration in seconds
40
- *
41
- * @example
42
- * ```typescript
43
- * logger.logAnimated('🚀 Loading...', 2);
44
- * ```
45
- */
46
- logAnimated(message: string, duration?: number): void;
47
- /**
48
- * Display banner with specified type
49
- *
50
- * @param bannerType - Type of banner to display
51
- *
52
- * @example
53
- * ```typescript
54
- * logger.showBanner('animated');
55
- * ```
56
- */
57
- showBanner(bannerType?: BannerType): void;
58
- /**
59
- * Set banner type for initialization display
60
- *
61
- * @param bannerType - Type of banner to display
62
- *
63
- * @example
64
- * ```typescript
65
- * logger.setBannerType('svg');
66
- * ```
67
- */
68
- setBannerType(bannerType: BannerType): void;
69
- /**
70
- * Sets the logger theme with visual banner
71
- *
72
- * @param theme - Theme variant to apply
73
- *
74
- * @example
75
- * ```typescript
76
- * logger.setTheme('cyberpunk'); // Shows themed banner
77
- * ```
78
- */
79
- setTheme(theme: ThemeVariant): void;
80
- }
81
- declare const styledLogger: StyledLogger;
82
- /**
83
- * Utility functions for creating custom styles
84
- *
85
- * @example
86
- * ```typescript
87
- * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';
88
- *
89
- * const myStyle = createStyle()
90
- * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
91
- * .color('white')
92
- * .padding('10px')
93
- * .build();
94
- *
95
- * console.log('%cCustom Message', myStyle);
96
- * ```
97
- */
98
- export declare const createStyle: () => StyleBuilder;
99
- /**
100
- * Pre-built style presets
101
- *
102
- * @example
103
- * ```typescript
104
- * import { stylePresets } from '@mks2508/better-logger/styling';
105
- *
106
- * console.log('%cSuccess!', stylePresets.success);
107
- * console.log('%cError!', stylePresets.error);
108
- * ```
109
- */
110
- export declare const stylePresets: {
111
- success: string;
112
- error: string;
113
- warning: string;
114
- info: string;
115
- accent: string;
116
- };
117
- /**
118
- * Available themes for the logger
119
- *
120
- * @example
121
- * ```typescript
122
- * import { themes } from '@mks2508/better-logger/styling';
123
- *
124
- * console.log('Available themes:', Object.keys(themes));
125
- * ```
126
- */
127
- export declare const themes: string[];
128
- /**
129
- * Available banner types
130
- *
131
- * @example
132
- * ```typescript
133
- * import { bannerTypes } from '@mks2508/better-logger/styling';
134
- *
135
- * console.log('Available banners:', bannerTypes);
136
- * ```
137
- */
138
- export declare const bannerTypes: string[];
139
- /**
140
- * Display initialization banner
141
- *
142
- * @param bannerType - Type of banner to display
143
- *
144
- * @example
145
- * ```typescript
146
- * import { showInitBanner } from '@mks2508/better-logger/styling';
147
- *
148
- * showInitBanner('animated');
149
- * ```
150
- */
151
- export declare const showInitBanner: (bannerType?: BannerType) => void;
152
- /**
153
- * Export individual styled logging methods
154
- */
155
- export declare const debug: (...args: any[]) => void;
156
- export declare const info: (...args: any[]) => void;
157
- export declare const warn: (...args: any[]) => void;
158
- export declare const error: (...args: any[]) => void;
159
- export declare const success: (...args: any[]) => void;
160
- export declare const critical: (...args: any[]) => void;
161
- export declare const trace: (...args: any[]) => void;
162
- export declare const table: (data: any, columns?: string[]) => void;
163
- export declare const group: (label: string, collapsed?: boolean) => void;
164
- export declare const groupEnd: () => void;
165
- export declare const time: (label: string) => void;
166
- export declare const timeEnd: (label: string) => void;
167
- export declare const setGlobalPrefix: (prefix: string) => void;
168
- export declare const scope: (prefix: string) => import('./ScopedLogger.js').ScopedLogger;
169
- export declare const setVerbosity: (level: any) => void;
170
- export declare const setTheme: (theme: ThemeVariant) => void;
171
- export declare const setBannerType: (bannerType: BannerType) => void;
172
- export declare const showBanner: (bannerType?: BannerType) => void;
173
- export declare const logWithSVG: (message: string, svgContent?: string, options?: StyleOptions) => void;
174
- export declare const logAnimated: (message: string, duration?: number) => void;
175
- export default styledLogger;
176
- export { StyleBuilder, StylePresets, THEME_PRESETS, THEME_BANNERS, BANNER_VARIANTS } from './styling/index.js';
177
- export type { ThemeVariant, BannerType, StyleOptions } from './types/index.js';
178
- //# sourceMappingURL=styling-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3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,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,eAAe,EAClB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACf,MAAM,kBAAkB,CAAC"}
package/dist/styling.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-D7cfaz15.js"),t=require("./chunks/environment-C_8J-zQ_.js");class StyledLogger extends e.Logger{logWithSVG(e,t,s={}){super.logWithSVG(e,t,s)}logAnimated(e,t=3){super.logAnimated(e,t)}showBanner(e){super.showBanner(e)}setBannerType(e){super.setBannerType(e)}setTheme(e){super.setTheme(e)}}const s=new StyledLogger,r={success:t.StylePresets.success().build(),error:t.StylePresets.error().build(),warning:t.StylePresets.warning().build(),info:t.StylePresets.info().build(),accent:t.StylePresets.accent().build()},o=Object.keys(e.THEME_PRESETS),n=Object.keys(e.BANNER_VARIANTS);exports.BANNER_VARIANTS=e.BANNER_VARIANTS,exports.THEME_BANNERS=e.THEME_BANNERS,exports.THEME_PRESETS=e.THEME_PRESETS,exports.StyleBuilder=t.StyleBuilder,exports.StylePresets=t.StylePresets,exports.StyledLogger=StyledLogger,exports.bannerTypes=n,exports.createStyle=()=>new t.StyleBuilder,exports.critical=(...e)=>s.critical(...e),exports.debug=(...e)=>s.debug(...e),exports.default=s,exports.error=(...e)=>s.error(...e),exports.group=(e,t)=>s.group(e,t),exports.groupEnd=()=>s.groupEnd(),exports.info=(...e)=>s.info(...e),exports.logAnimated=(e,t)=>s.logAnimated(e,t),exports.logWithSVG=(e,t,r)=>s.logWithSVG(e,t,r),exports.scope=e=>s.scope(e),exports.setBannerType=e=>s.setBannerType(e),exports.setGlobalPrefix=e=>s.setGlobalPrefix(e),exports.setTheme=e=>s.setTheme(e),exports.setVerbosity=e=>s.setVerbosity(e),exports.showBanner=e=>s.showBanner(e),exports.showInitBanner=t=>{e.displayInitBanner(t)},exports.stylePresets=r,exports.success=(...e)=>s.success(...e),exports.table=(e,t)=>s.table(e,t),exports.themes=o,exports.time=e=>s.time(e),exports.timeEnd=e=>s.timeEnd(e),exports.trace=(...e)=>s.trace(...e),exports.warn=(...e)=>s.warn(...e);
2
- //# sourceMappingURL=styling.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styling.cjs","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const scope = (prefix: string) => styledLogger.scope(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":["StyledLogger","Logger","logWithSVG","message","svgContent","options","super","logAnimated","duration","showBanner","bannerType","setBannerType","setTheme","theme","styledLogger","stylePresets","success","StylePresets","build","error","warning","info","accent","themes","Object","keys","THEME_PRESETS","bannerTypes","BANNER_VARIANTS","StyleBuilder","args","critical","debug","label","collapsed","group","groupEnd","prefix","scope","setGlobalPrefix","level","setVerbosity","displayInitBanner","data","columns","table","time","timeEnd","trace","warn"],"mappings":"yMAyCO,MAAMA,qBAAqBC,EAAAA,OAiB9B,UAAAC,CAAWC,EAAiBC,EAAqBC,EAAwB,CAAA,GACrEC,MAAMJ,WAAWC,EAASC,EAAYC,EAC1C,CAaA,WAAAE,CAAYJ,EAAiBK,EAAmB,GAC5CF,MAAMC,YAAYJ,EAASK,EAC/B,CAYA,UAAAC,CAAWC,GACPJ,MAAMG,WAAWC,EACrB,CAYA,aAAAC,CAAcD,GACVJ,MAAMK,cAAcD,EACxB,CAYA,QAAAE,CAASC,GACLP,MAAMM,SAASC,EACnB,EAIJ,MAAMC,EAAe,IAAId,aA+BZe,EAAe,CACxBC,QAASC,EAAAA,aAAaD,UAAUE,QAChCC,MAAOF,EAAAA,aAAaE,QAAQD,QAC5BE,QAASH,EAAAA,aAAaG,UAAUF,QAChCG,KAAMJ,EAAAA,aAAaI,OAAOH,QAC1BI,OAAQL,EAAAA,aAAaK,SAASJ,SAarBK,EAASC,OAAOC,KAAKC,EAAAA,eAYrBC,EAAcH,OAAOC,KAAKG,EAAAA,2RA3CZ,IAAM,IAAIC,EAAAA,8BAqEb,IAAIC,IAAgBhB,EAAaiB,YAAYD,iBALhD,IAAIA,IAAgBhB,EAAakB,SAASF,mCAG1C,IAAIA,IAAgBhB,EAAaK,SAASW,iBAK1C,CAACG,EAAeC,IAAwBpB,EAAaqB,MAAMF,EAAOC,oBAC/D,IAAMpB,EAAasB,wBARvB,IAAIN,IAAgBhB,EAAaO,QAAQS,uBAmBlC,CAAC3B,EAAiBK,IACzCM,EAAaP,YAAYJ,EAASK,sBAHZ,CAACL,EAAiBC,EAAqBC,IAC7DS,EAAaZ,WAAWC,EAASC,EAAYC,iBAN3BgC,GAAmBvB,EAAawB,MAAMD,yBAG9B3B,GAA2BI,EAAaH,cAAcD,2BAJpD2B,GAAmBvB,EAAayB,gBAAgBF,oBAGvDxB,GAAwBC,EAAaF,SAASC,wBAD1C2B,GAAe1B,EAAa2B,aAAaD,sBAG3C9B,GAA4BI,EAAaL,WAAWC,0BAxBhDA,IAC3BgC,EAAAA,kBAAkBhC,2CAUC,IAAIoB,IAAgBhB,EAAaE,WAAWc,iBAG9C,CAACa,EAAWC,IAAuB9B,EAAa+B,MAAMF,EAAMC,iCAG5DX,GAAkBnB,EAAagC,KAAKb,mBACjCA,GAAkBnB,EAAaiC,QAAQd,iBAL1C,IAAIH,IAAgBhB,EAAakC,SAASlB,gBAJ3C,IAAIA,IAAgBhB,EAAamC,QAAQnB"}
package/dist/styling.js DELETED
@@ -1,146 +0,0 @@
1
- import { L as Logger, T as THEME_PRESETS, B as BANNER_VARIANTS, o as displayInitBanner } from "./chunks/Logger-D-gmmgR2.js";
2
- import { a } from "./chunks/Logger-D-gmmgR2.js";
3
- import { S as StylePresets, b as StyleBuilder } from "./chunks/environment-COWvu6Wz.js";
4
- class StyledLogger extends Logger {
5
- /**
6
- * Log with SVG background image
7
- *
8
- * @param message - The message to log
9
- * @param svgContent - SVG content as string (optional)
10
- * @param options - Styling options
11
- *
12
- * @example
13
- * ```typescript
14
- * logger.logWithSVG('My App', '<svg>...</svg>', {
15
- * width: 400,
16
- * height: 80,
17
- * padding: '40px 200px'
18
- * });
19
- * ```
20
- */
21
- logWithSVG(message, svgContent, options = {}) {
22
- super.logWithSVG(message, svgContent, options);
23
- }
24
- /**
25
- * Log with animated background gradient
26
- *
27
- * @param message - The message to log
28
- * @param duration - Animation duration in seconds
29
- *
30
- * @example
31
- * ```typescript
32
- * logger.logAnimated('🚀 Loading...', 2);
33
- * ```
34
- */
35
- logAnimated(message, duration = 3) {
36
- super.logAnimated(message, duration);
37
- }
38
- /**
39
- * Display banner with specified type
40
- *
41
- * @param bannerType - Type of banner to display
42
- *
43
- * @example
44
- * ```typescript
45
- * logger.showBanner('animated');
46
- * ```
47
- */
48
- showBanner(bannerType) {
49
- super.showBanner(bannerType);
50
- }
51
- /**
52
- * Set banner type for initialization display
53
- *
54
- * @param bannerType - Type of banner to display
55
- *
56
- * @example
57
- * ```typescript
58
- * logger.setBannerType('svg');
59
- * ```
60
- */
61
- setBannerType(bannerType) {
62
- super.setBannerType(bannerType);
63
- }
64
- /**
65
- * Sets the logger theme with visual banner
66
- *
67
- * @param theme - Theme variant to apply
68
- *
69
- * @example
70
- * ```typescript
71
- * logger.setTheme('cyberpunk'); // Shows themed banner
72
- * ```
73
- */
74
- setTheme(theme) {
75
- super.setTheme(theme);
76
- }
77
- }
78
- const styledLogger = new StyledLogger();
79
- const createStyle = () => new StyleBuilder();
80
- const stylePresets = {
81
- success: StylePresets.success().build(),
82
- error: StylePresets.error().build(),
83
- warning: StylePresets.warning().build(),
84
- info: StylePresets.info().build(),
85
- accent: StylePresets.accent().build()
86
- };
87
- const themes = Object.keys(THEME_PRESETS);
88
- const bannerTypes = Object.keys(BANNER_VARIANTS);
89
- const showInitBanner = (bannerType) => {
90
- displayInitBanner(bannerType);
91
- };
92
- const debug = (...args) => styledLogger.debug(...args);
93
- const info = (...args) => styledLogger.info(...args);
94
- const warn = (...args) => styledLogger.warn(...args);
95
- const error = (...args) => styledLogger.error(...args);
96
- const success = (...args) => styledLogger.success(...args);
97
- const critical = (...args) => styledLogger.critical(...args);
98
- const trace = (...args) => styledLogger.trace(...args);
99
- const table = (data, columns) => styledLogger.table(data, columns);
100
- const group = (label, collapsed) => styledLogger.group(label, collapsed);
101
- const groupEnd = () => styledLogger.groupEnd();
102
- const time = (label) => styledLogger.time(label);
103
- const timeEnd = (label) => styledLogger.timeEnd(label);
104
- const setGlobalPrefix = (prefix) => styledLogger.setGlobalPrefix(prefix);
105
- const scope = (prefix) => styledLogger.scope(prefix);
106
- const setVerbosity = (level) => styledLogger.setVerbosity(level);
107
- const setTheme = (theme) => styledLogger.setTheme(theme);
108
- const setBannerType = (bannerType) => styledLogger.setBannerType(bannerType);
109
- const showBanner = (bannerType) => styledLogger.showBanner(bannerType);
110
- const logWithSVG = (message, svgContent, options) => styledLogger.logWithSVG(message, svgContent, options);
111
- const logAnimated = (message, duration) => styledLogger.logAnimated(message, duration);
112
- export {
113
- BANNER_VARIANTS,
114
- StyleBuilder,
115
- StylePresets,
116
- StyledLogger,
117
- a as THEME_BANNERS,
118
- THEME_PRESETS,
119
- bannerTypes,
120
- createStyle,
121
- critical,
122
- debug,
123
- styledLogger as default,
124
- error,
125
- group,
126
- groupEnd,
127
- info,
128
- logAnimated,
129
- logWithSVG,
130
- scope,
131
- setBannerType,
132
- setGlobalPrefix,
133
- setTheme,
134
- setVerbosity,
135
- showBanner,
136
- showInitBanner,
137
- stylePresets,
138
- success,
139
- table,
140
- themes,
141
- time,
142
- timeEnd,
143
- trace,
144
- warn
145
- };
146
- //# sourceMappingURL=styling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styling.js","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const scope = (prefix: string) => styledLogger.scope(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":[],"mappings":";;;AAyCO,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBrC,WAAW,SAAiB,YAAqB,UAAwB,CAAA,GAAU;AAC/E,UAAM,WAAW,SAAS,YAAY,OAAO;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,YAAY,SAAiB,WAAmB,GAAS;AACrD,UAAM,YAAY,SAAS,QAAQ;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,WAAW,YAA+B;AACtC,UAAM,WAAW,UAAU;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,cAAc,YAA8B;AACxC,UAAM,cAAc,UAAU;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,SAAS,OAA2B;AAChC,UAAM,SAAS,KAAK;AAAA,EACxB;AACJ;AAGA,MAAM,eAAe,IAAI,aAAA;AAkBlB,MAAM,cAAc,MAAM,IAAI,aAAA;AAa9B,MAAM,eAAe;AAAA,E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B,CAAC,eAA2B,aAAa,cAAc,UAAU;AACvF,MAAM,aAAa,CAAC,eAA4B,aAAa,WAAW,UAAU;AAClF,MAAM,aAAa,CAAC,SAAiB,YAAqB,YAC7D,aAAa,WAAW,SAAS,YAAY,OAAO;AACjD,MAAM,cAAc,CAAC,SAAiB,aACzC,aAAa,YAAY,SAAS,QAAQ;"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Color Converter - CSS colors to ANSI extended color codes
3
- * Supports 256-color and truecolor (24-bit) terminals
4
- */
5
- export type ColorCapability = 'full' | 'basic' | 'none';
6
- export interface RGB {
7
- r: number;
8
- g: number;
9
- b: number;
10
- }
11
- export declare function hexToRgb(hex: string): RGB;
12
- export declare function rgbToHex(r: number, g: number, b: number): string;
13
- export declare function hexTo256(hex: string): number;
14
- export declare function colorToHex(color: string): string;
15
- export declare function getANSIForeground(color: string, capability: ColorCapability): string;
16
- export declare function getANSIBackground(color: string, capability: ColorCapability): string;
17
- export declare function getANSI256Foreground(colorIndex: number): string;
18
- export declare function getANSI256Background(colorIndex: number): string;
19
- export declare function extractGradientColors(gradient: string): string[];
20
- export declare function gradientToSingleColor(gradient: string): string;
21
- export declare function cssColorToANSI(cssColor: string, capability: ColorCapability, isBackground?: boolean): string;
22
- export declare const ANSI: {
23
- reset: string;
24
- bold: string;
25
- dim: string;
26
- italic: string;
27
- underline: string;
28
- blink: string;
29
- inverse: string;
30
- hidden: string;
31
- strikethrough: string;
32
- fg: {
33
- black: string;
34
- red: string;
35
- green: string;
36
- yellow: string;
37
- blue: string;
38
- magenta: string;
39
- cyan: string;
40
- white: string;
41
- gray: string;
42
- brightRed: string;
43
- brightGreen: string;
44
- brightYellow: string;
45
- brightBlue: string;
46
- brightMagenta: string;
47
- brightCyan: string;
48
- brightWhite: string;
49
- };
50
- bg: {
51
- black: string;
52
- red: string;
53
- green: string;
54
- yellow: string;
55
- blue: string;
56
- magenta: string;
57
- cyan: string;
58
- white: string;
59
- gray: string;
60
- brightRed: string;
61
- brightGreen: string;
62
- brightYellow: string;
63
- brightBlue: string;
64
- brightMagenta: string;
65
- brightCyan: string;
66
- brightWhite: string;
67
- };
68
- rgb: (r: number, g: number, b: number) => string;
69
- bgRgb: (r: number, g: number, b: number) => string;
70
- color256: (n: number) => string;
71
- bgColor256: (n: number) => string;
72
- };
73
- //# sourceMappingURL=color-converter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"color-converter.d.ts","sourceRoot":"","sources":["../../src/terminal/color-converter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,GAAG;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAiED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAUzC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAc5C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBhD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAmBpF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAmBpF;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAiCD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAehE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAW9D;AAED,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,YAAY,GAAE,OAAe,GAC9B,MAAM,CAcR;AAED,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiDJ,MAAM,KAAK,MAAM,KAAK,MAAM;eAC1B,MAAM,KAAK,MAAM,KAAK,MAAM;kBACzB,MAAM;oBACJ,MAAM;CACzB,CAAC"}
@@ -1,20 +0,0 @@
1
- import { ColorCapability } from './color-converter.js';
2
- import { ColumnConfig, ColumnAlign, BadgeStyle, TimestampFormat, LogOptions } from '../types/index.js';
3
- export declare function stripAnsi(str: string): string;
4
- export declare function getVisibleLength(str: string): number;
5
- export declare function padToWidth(str: string, width: number, align?: ColumnAlign): string;
6
- export declare function formatWithRightAlign(leftContent: string, rightContent: string, maxWidth?: number): string;
7
- export declare function formatColumns(columns: ColumnConfig[], maxWidth?: number, colorCapability?: ColorCapability): string;
8
- export declare function formatKeyValue(obj: Record<string, unknown>, colorCapability?: ColorCapability, options?: {
9
- separator?: string;
10
- keyColor?: string;
11
- valueColor?: string;
12
- }): string;
13
- export declare function isKeyValueObject(obj: unknown): obj is Record<string, unknown>;
14
- export declare function formatBadge(badge: string, style?: BadgeStyle, colorCapability?: ColorCapability, color?: string): string;
15
- export declare function formatTimestamp(date?: Date, format?: TimestampFormat): string;
16
- export declare function formatRelativeTime(date: Date): string;
17
- export declare function formatElapsedTime(date: Date): string;
18
- export declare function resetStartTime(): void;
19
- export declare function applyLogOptions(message: string, options: LogOptions, colorCapability?: ColorCapability): string;
20
- //# sourceMappingURL=formatter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/terminal/formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,sBA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