@mks2508/better-logger 0.14.0-alpha.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/dist/Logger.d.ts +12 -16
  3. package/dist/Logger.d.ts.map +1 -1
  4. package/dist/ScopedLogger.d.ts +1 -9
  5. package/dist/chunks/{Logger-D_p3xnbq.js → Logger-C9zTFYBh.js} +2 -2
  6. package/dist/chunks/Logger-C9zTFYBh.js.map +1 -0
  7. package/dist/chunks/{Logger-Crw1woqR.js → Logger-Th9SfADL.js} +50 -17
  8. package/dist/chunks/Logger-Th9SfADL.js.map +1 -0
  9. package/dist/chunks/ScopedLogger-HgV_J-ug.js +2 -0
  10. package/dist/chunks/ScopedLogger-HgV_J-ug.js.map +1 -0
  11. package/dist/chunks/ScopedLogger-uAAeJkfA.js +361 -0
  12. package/dist/chunks/ScopedLogger-uAAeJkfA.js.map +1 -0
  13. package/dist/chunks/environment-5I5unY89.js +4 -0
  14. package/dist/chunks/environment-5I5unY89.js.map +1 -0
  15. package/dist/chunks/{environment-Bxbnw4pd.js → environment-wXLQvk5g.js} +103 -11
  16. package/dist/chunks/environment-wXLQvk5g.js.map +1 -0
  17. package/dist/chunks/formatting-CiFnwe1I.js +2 -0
  18. package/dist/chunks/formatting-CiFnwe1I.js.map +1 -0
  19. package/dist/chunks/formatting-DIhpRCCk.js +380 -0
  20. package/dist/chunks/formatting-DIhpRCCk.js.map +1 -0
  21. package/dist/cli/CommandProcessor.d.ts +1 -4
  22. package/dist/cli/commands/ConfigCommand.d.ts +2 -5
  23. package/dist/cli/commands/ExportCommand.d.ts +2 -5
  24. package/dist/cli/commands/HistoryCommand.d.ts +2 -5
  25. package/dist/cli/commands/StatusCommand.d.ts +2 -5
  26. package/dist/cli/commands/ThemeCommand.d.ts +2 -5
  27. package/dist/cli/help.d.ts +2 -5
  28. package/dist/cli/index.d.ts +1 -1
  29. package/dist/constants.d.ts +110 -5
  30. package/dist/constants.d.ts.map +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.cjs.map +1 -1
  33. package/dist/core.d.ts +1 -8
  34. package/dist/core.d.ts.map +1 -1
  35. package/dist/core.js +281 -307
  36. package/dist/core.js.map +1 -1
  37. package/dist/exports-module.d.ts +1 -8
  38. package/dist/exports.cjs +1 -1
  39. package/dist/exports.js +2 -2
  40. package/dist/handlers/AnalyticsLogHandler.d.ts +1 -4
  41. package/dist/handlers/ExportLogHandler.d.ts +1 -4
  42. package/dist/handlers/ExportLogHandler.d.ts.map +1 -1
  43. package/dist/handlers/FileLogHandler.d.ts +1 -4
  44. package/dist/handlers/RemoteLogHandler.d.ts +1 -4
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.ts +8 -41
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +246 -159
  50. package/dist/index.js.map +1 -1
  51. package/dist/styling/LogStyleBuilder.d.ts +2 -5
  52. package/dist/styling/SemanticStyles.d.ts +0 -3
  53. package/dist/styling/SmartPresets.d.ts +1 -4
  54. package/dist/styling/banners.d.ts +1 -4
  55. package/dist/styling/themes.d.ts +2 -5
  56. package/dist/styling-module.d.ts +1 -8
  57. package/dist/styling.cjs +1 -1
  58. package/dist/styling.js +3 -3
  59. package/dist/types/core.d.ts +13 -0
  60. package/dist/types/core.d.ts.map +1 -1
  61. package/dist/types/handlers.d.ts +1 -4
  62. package/dist/types/index.d.ts +1 -1
  63. package/dist/types/index.d.ts.map +1 -1
  64. package/dist/utils/ansi-colors.d.ts +156 -0
  65. package/dist/utils/ansi-colors.d.ts.map +1 -0
  66. package/dist/utils/formatting.d.ts +20 -2
  67. package/dist/utils/formatting.d.ts.map +1 -1
  68. package/dist/utils/index.d.ts +1 -0
  69. package/dist/utils/index.d.ts.map +1 -1
  70. package/dist/utils/output.d.ts +1 -4
  71. package/dist/utils/stackTrace.d.ts +1 -4
  72. package/package.json +2 -1
  73. package/src/Logger.ts +102 -64
  74. package/src/constants.ts +131 -1
  75. package/src/core.ts +11 -7
  76. package/src/handlers/ExportLogHandler.ts +2 -1
  77. package/src/index.ts +62 -27
  78. package/src/styling/SemanticStyles.ts +1 -1
  79. package/src/types/core.ts +15 -1
  80. package/src/types/index.ts +1 -0
  81. package/src/utils/ansi-colors.ts +333 -0
  82. package/src/utils/formatting.ts +196 -6
  83. package/src/utils/index.ts +23 -11
  84. package/vite.config.ts +1 -1
  85. package/dist/.tsbuildinfo +0 -1
  86. package/dist/Logger.js +0 -1124
  87. package/dist/ScopedLogger.js +0 -426
  88. package/dist/chunks/Logger-Crw1woqR.js.map +0 -1
  89. package/dist/chunks/Logger-D_p3xnbq.js.map +0 -1
  90. package/dist/chunks/environment-Bxbnw4pd.js.map +0 -1
  91. package/dist/chunks/environment-Dm66zOML.js +0 -4
  92. package/dist/chunks/environment-Dm66zOML.js.map +0 -1
  93. package/dist/chunks/formatting-C0riPC5_.js +0 -95
  94. package/dist/chunks/formatting-C0riPC5_.js.map +0 -1
  95. package/dist/chunks/formatting-DNCAV66-.js +0 -2
  96. package/dist/chunks/formatting-DNCAV66-.js.map +0 -1
  97. package/dist/cli/CommandProcessor.js +0 -184
  98. package/dist/cli/commands/ConfigCommand.js +0 -88
  99. package/dist/cli/commands/ExportCommand.js +0 -243
  100. package/dist/cli/commands/HistoryCommand.js +0 -96
  101. package/dist/cli/commands/StatusCommand.js +0 -93
  102. package/dist/cli/commands/ThemeCommand.js +0 -79
  103. package/dist/cli/help.js +0 -118
  104. package/dist/cli/index.js +0 -46
  105. package/dist/constants.js +0 -159
  106. package/dist/example.js +0 -154
  107. package/dist/exports-module.js +0 -260
  108. package/dist/handlers/AnalyticsLogHandler.js +0 -19
  109. package/dist/handlers/ExportLogHandler.js +0 -516
  110. package/dist/handlers/FileLogHandler.js +0 -156
  111. package/dist/handlers/RemoteLogHandler.js +0 -37
  112. package/dist/handlers/index.js +0 -7
  113. package/dist/main.js +0 -139
  114. package/dist/styling/LogStyleBuilder.js +0 -289
  115. package/dist/styling/SemanticStyles.js +0 -339
  116. package/dist/styling/SmartPresets.js +0 -276
  117. package/dist/styling/StyleBuilder.js +0 -280
  118. package/dist/styling/banners.js +0 -155
  119. package/dist/styling/index.js +0 -9
  120. package/dist/styling/themes.js +0 -231
  121. package/dist/styling-module.js +0 -199
  122. package/dist/types/Logger.d.ts +0 -700
  123. package/dist/types/Logger.d.ts.map +0 -1
  124. package/dist/types/ScopedLogger.d.ts +0 -310
  125. package/dist/types/ScopedLogger.d.ts.map +0 -1
  126. package/dist/types/cli/CommandProcessor.d.ts +0 -100
  127. package/dist/types/cli/CommandProcessor.d.ts.map +0 -1
  128. package/dist/types/cli/commands/ConfigCommand.d.ts +0 -14
  129. package/dist/types/cli/commands/ConfigCommand.d.ts.map +0 -1
  130. package/dist/types/cli/commands/ExportCommand.d.ts +0 -48
  131. package/dist/types/cli/commands/ExportCommand.d.ts.map +0 -1
  132. package/dist/types/cli/commands/HistoryCommand.d.ts +0 -47
  133. package/dist/types/cli/commands/HistoryCommand.d.ts.map +0 -1
  134. package/dist/types/cli/commands/StatusCommand.d.ts +0 -30
  135. package/dist/types/cli/commands/StatusCommand.d.ts.map +0 -1
  136. package/dist/types/cli/commands/ThemeCommand.d.ts +0 -30
  137. package/dist/types/cli/commands/ThemeCommand.d.ts.map +0 -1
  138. package/dist/types/cli/help.d.ts +0 -12
  139. package/dist/types/cli/help.d.ts.map +0 -1
  140. package/dist/types/cli/index.d.ts +0 -15
  141. package/dist/types/cli/index.d.ts.map +0 -1
  142. package/dist/types/constants.d.ts +0 -119
  143. package/dist/types/constants.d.ts.map +0 -1
  144. package/dist/types/core.js +0 -28
  145. package/dist/types/example.d.ts +0 -18
  146. package/dist/types/example.d.ts.map +0 -1
  147. package/dist/types/exports-module.d.ts +0 -196
  148. package/dist/types/exports-module.d.ts.map +0 -1
  149. package/dist/types/handlers/AnalyticsLogHandler.d.ts +0 -8
  150. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  151. package/dist/types/handlers/ExportLogHandler.d.ts +0 -100
  152. package/dist/types/handlers/ExportLogHandler.d.ts.map +0 -1
  153. package/dist/types/handlers/FileLogHandler.d.ts +0 -33
  154. package/dist/types/handlers/FileLogHandler.d.ts.map +0 -1
  155. package/dist/types/handlers/RemoteLogHandler.d.ts +0 -11
  156. package/dist/types/handlers/RemoteLogHandler.d.ts.map +0 -1
  157. package/dist/types/handlers/index.d.ts +0 -8
  158. package/dist/types/handlers/index.d.ts.map +0 -1
  159. package/dist/types/handlers.js +0 -4
  160. package/dist/types/index.js +0 -4
  161. package/dist/types/main.d.ts +0 -2
  162. package/dist/types/main.d.ts.map +0 -1
  163. package/dist/types/styling/LogStyleBuilder.d.ts +0 -146
  164. package/dist/types/styling/LogStyleBuilder.d.ts.map +0 -1
  165. package/dist/types/styling/SemanticStyles.d.ts +0 -178
  166. package/dist/types/styling/SemanticStyles.d.ts.map +0 -1
  167. package/dist/types/styling/SmartPresets.d.ts +0 -22
  168. package/dist/types/styling/SmartPresets.d.ts.map +0 -1
  169. package/dist/types/styling/StyleBuilder.d.ts +0 -140
  170. package/dist/types/styling/StyleBuilder.d.ts.map +0 -1
  171. package/dist/types/styling/banners.d.ts +0 -42
  172. package/dist/types/styling/banners.d.ts.map +0 -1
  173. package/dist/types/styling/index.d.ts +0 -10
  174. package/dist/types/styling/index.d.ts.map +0 -1
  175. package/dist/types/styling/themes.d.ts +0 -7
  176. package/dist/types/styling/themes.d.ts.map +0 -1
  177. package/dist/types/styling-module.d.ts +0 -178
  178. package/dist/types/styling-module.d.ts.map +0 -1
  179. package/dist/types/types/core.d.ts +0 -221
  180. package/dist/types/types/core.d.ts.map +0 -1
  181. package/dist/types/types/handlers.d.ts +0 -85
  182. package/dist/types/types/handlers.d.ts.map +0 -1
  183. package/dist/types/types/index.d.ts +0 -7
  184. package/dist/types/types/index.d.ts.map +0 -1
  185. package/dist/types/utils/environment.d.ts +0 -47
  186. package/dist/types/utils/environment.d.ts.map +0 -1
  187. package/dist/types/utils/formatting.d.ts +0 -37
  188. package/dist/types/utils/formatting.d.ts.map +0 -1
  189. package/dist/types/utils/index.d.ts +0 -7
  190. package/dist/types/utils/index.d.ts.map +0 -1
  191. package/dist/types/utils/opentui-detection.d.ts +0 -34
  192. package/dist/types/utils/opentui-detection.d.ts.map +0 -1
  193. package/dist/types/utils/output.d.ts +0 -41
  194. package/dist/types/utils/output.d.ts.map +0 -1
  195. package/dist/types/utils/stackTrace.d.ts +0 -6
  196. package/dist/types/utils/stackTrace.d.ts.map +0 -1
  197. package/dist/types/utils/timestamps.d.ts +0 -20
  198. package/dist/types/utils/timestamps.d.ts.map +0 -1
  199. package/dist/utils/environment.js +0 -85
  200. package/dist/utils/formatting.js +0 -117
  201. package/dist/utils/index.js +0 -6
  202. package/dist/utils/opentui-detection.js +0 -116
  203. package/dist/utils/output.js +0 -150
  204. package/dist/utils/stackTrace.js +0 -81
  205. package/dist/utils/timestamps.js +0 -71
@@ -1,199 +0,0 @@
1
- /**
2
- * @fileoverview Styling Module - Advanced visual features for Better Logger
3
- * @version 0.0.1
4
- *
5
- * This module provides advanced styling features including SVG support, CSS animations,
6
- * themed banners, and visual enhancements for console logging.
7
- */
8
- // Import core logger
9
- import { Logger } from './Logger.js';
10
- // Styling imports
11
- import { StyleBuilder, StylePresets, THEME_PRESETS, displayInitBanner, BANNER_VARIANTS } from './styling/index.js';
12
- /**
13
- * Enhanced Logger with advanced styling capabilities
14
- *
15
- * @example
16
- * ```typescript
17
- * import { StyledLogger } from '@mks2508/better-logger/styling';
18
- *
19
- * const logger = new StyledLogger();
20
- * logger.setTheme('neon');
21
- * logger.logAnimated('🌟 Animated message!');
22
- * logger.logWithSVG('Custom SVG Logo', svgContent);
23
- * ```
24
- */
25
- export class StyledLogger extends Logger {
26
- /**
27
- * Log with SVG background image
28
- *
29
- * @param message - The message to log
30
- * @param svgContent - SVG content as string (optional)
31
- * @param options - Styling options
32
- *
33
- * @example
34
- * ```typescript
35
- * logger.logWithSVG('My App', '<svg>...</svg>', {
36
- * width: 400,
37
- * height: 80,
38
- * padding: '40px 200px'
39
- * });
40
- * ```
41
- */
42
- logWithSVG(message, svgContent, options = {}) {
43
- super.logWithSVG(message, svgContent, options);
44
- }
45
- /**
46
- * Log with animated background gradient
47
- *
48
- * @param message - The message to log
49
- * @param duration - Animation duration in seconds
50
- *
51
- * @example
52
- * ```typescript
53
- * logger.logAnimated('🚀 Loading...', 2);
54
- * ```
55
- */
56
- logAnimated(message, duration = 3) {
57
- super.logAnimated(message, duration);
58
- }
59
- /**
60
- * Display banner with specified type
61
- *
62
- * @param bannerType - Type of banner to display
63
- *
64
- * @example
65
- * ```typescript
66
- * logger.showBanner('animated');
67
- * ```
68
- */
69
- showBanner(bannerType) {
70
- super.showBanner(bannerType);
71
- }
72
- /**
73
- * Set banner type for initialization display
74
- *
75
- * @param bannerType - Type of banner to display
76
- *
77
- * @example
78
- * ```typescript
79
- * logger.setBannerType('svg');
80
- * ```
81
- */
82
- setBannerType(bannerType) {
83
- super.setBannerType(bannerType);
84
- }
85
- /**
86
- * Sets the logger theme with visual banner
87
- *
88
- * @param theme - Theme variant to apply
89
- *
90
- * @example
91
- * ```typescript
92
- * logger.setTheme('cyberpunk'); // Shows themed banner
93
- * ```
94
- */
95
- setTheme(theme) {
96
- super.setTheme(theme);
97
- }
98
- }
99
- // Create singleton instance
100
- const styledLogger = new StyledLogger();
101
- /**
102
- * Utility functions for creating custom styles
103
- *
104
- * @example
105
- * ```typescript
106
- * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';
107
- *
108
- * const myStyle = createStyle()
109
- * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
110
- * .color('white')
111
- * .padding('10px')
112
- * .build();
113
- *
114
- * console.log('%cCustom Message', myStyle);
115
- * ```
116
- */
117
- export const createStyle = () => new StyleBuilder();
118
- /**
119
- * Pre-built style presets
120
- *
121
- * @example
122
- * ```typescript
123
- * import { stylePresets } from '@mks2508/better-logger/styling';
124
- *
125
- * console.log('%cSuccess!', stylePresets.success);
126
- * console.log('%cError!', stylePresets.error);
127
- * ```
128
- */
129
- export const stylePresets = {
130
- success: StylePresets.success().build(),
131
- error: StylePresets.error().build(),
132
- warning: StylePresets.warning().build(),
133
- info: StylePresets.info().build(),
134
- accent: StylePresets.accent().build(),
135
- };
136
- /**
137
- * Available themes for the logger
138
- *
139
- * @example
140
- * ```typescript
141
- * import { themes } from '@mks2508/better-logger/styling';
142
- *
143
- * console.log('Available themes:', Object.keys(themes));
144
- * ```
145
- */
146
- export const themes = Object.keys(THEME_PRESETS);
147
- /**
148
- * Available banner types
149
- *
150
- * @example
151
- * ```typescript
152
- * import { bannerTypes } from '@mks2508/better-logger/styling';
153
- *
154
- * console.log('Available banners:', bannerTypes);
155
- * ```
156
- */
157
- export const bannerTypes = Object.keys(BANNER_VARIANTS);
158
- /**
159
- * Display initialization banner
160
- *
161
- * @param bannerType - Type of banner to display
162
- *
163
- * @example
164
- * ```typescript
165
- * import { showInitBanner } from '@mks2508/better-logger/styling';
166
- *
167
- * showInitBanner('animated');
168
- * ```
169
- */
170
- export const showInitBanner = (bannerType) => {
171
- displayInitBanner(bannerType);
172
- };
173
- /**
174
- * Export individual styled logging methods
175
- */
176
- export const debug = (...args) => styledLogger.debug(...args);
177
- export const info = (...args) => styledLogger.info(...args);
178
- export const warn = (...args) => styledLogger.warn(...args);
179
- export const error = (...args) => styledLogger.error(...args);
180
- export const success = (...args) => styledLogger.success(...args);
181
- export const critical = (...args) => styledLogger.critical(...args);
182
- export const trace = (...args) => styledLogger.trace(...args);
183
- export const table = (data, columns) => styledLogger.table(data, columns);
184
- export const group = (label, collapsed) => styledLogger.group(label, collapsed);
185
- export const groupEnd = () => styledLogger.groupEnd();
186
- export const time = (label) => styledLogger.time(label);
187
- export const timeEnd = (label) => styledLogger.timeEnd(label);
188
- export const setGlobalPrefix = (prefix) => styledLogger.setGlobalPrefix(prefix);
189
- export const scope = (prefix) => styledLogger.scope(prefix);
190
- export const setVerbosity = (level) => styledLogger.setVerbosity(level);
191
- export const setTheme = (theme) => styledLogger.setTheme(theme);
192
- export const setBannerType = (bannerType) => styledLogger.setBannerType(bannerType);
193
- export const showBanner = (bannerType) => styledLogger.showBanner(bannerType);
194
- export const logWithSVG = (message, svgContent, options) => styledLogger.logWithSVG(message, svgContent, options);
195
- export const logAnimated = (message, duration) => styledLogger.logAnimated(message, duration);
196
- // Export the singleton as default
197
- export default styledLogger;
198
- // Re-export styling utilities
199
- export { StyleBuilder, StylePresets, THEME_PRESETS, THEME_BANNERS, BANNER_VARIANTS } from './styling/index.js';