@mks2508/better-logger 0.0.2-alpha.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/.claude/settings.local.json +18 -2
  2. package/.github/workflows/ci-quality.yml +357 -0
  3. package/.github/workflows/docs-demo.yml +119 -0
  4. package/.github/workflows/releases-core.yml +512 -0
  5. package/.github/workflows/releases-full.yml +582 -0
  6. package/.github/{workflows → workflows-backup}/ci.yml +12 -110
  7. package/.github/workflows-backup/nightly.yml +196 -0
  8. package/.github/workflows-backup/release-optimized.yml +373 -0
  9. package/.release-notes-0.2.0.md +129 -0
  10. package/.yamllint +28 -0
  11. package/CHANGELOG.json +783 -0
  12. package/CLAUDE.md +92 -1
  13. package/README.md +198 -490
  14. package/bun.lock +323 -0
  15. package/demo.html +9 -2
  16. package/dist/.tsbuildinfo +1 -0
  17. package/dist/Logger.d.ts +272 -0
  18. package/dist/Logger.d.ts.map +1 -0
  19. package/dist/Logger.js +680 -0
  20. package/dist/ScopedLogger.d.ts +126 -0
  21. package/dist/ScopedLogger.d.ts.map +1 -0
  22. package/dist/ScopedLogger.js +234 -0
  23. package/dist/chunks/Logger-BpeuYIxR.js +2 -0
  24. package/dist/chunks/Logger-BpeuYIxR.js.map +1 -0
  25. package/dist/chunks/Logger-Didxtr23.js +3275 -0
  26. package/dist/chunks/Logger-Didxtr23.js.map +1 -0
  27. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  28. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  29. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  30. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  31. package/dist/chunks/environment-Bxbnw4pd.js +544 -0
  32. package/dist/chunks/environment-Bxbnw4pd.js.map +1 -0
  33. package/dist/chunks/environment-Dm66zOML.js +4 -0
  34. package/dist/chunks/environment-Dm66zOML.js.map +1 -0
  35. package/dist/chunks/formatting-C0riPC5_.js +95 -0
  36. package/dist/chunks/formatting-C0riPC5_.js.map +1 -0
  37. package/dist/chunks/formatting-DNCAV66-.js +2 -0
  38. package/dist/chunks/formatting-DNCAV66-.js.map +1 -0
  39. package/dist/cli/CommandProcessor.d.ts +103 -0
  40. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  41. package/dist/cli/CommandProcessor.js +184 -0
  42. package/dist/cli/commands/ConfigCommand.d.ts +17 -0
  43. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  44. package/dist/cli/commands/ConfigCommand.js +88 -0
  45. package/dist/cli/commands/ExportCommand.d.ts +51 -0
  46. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  47. package/dist/cli/commands/ExportCommand.js +243 -0
  48. package/dist/cli/commands/HistoryCommand.d.ts +50 -0
  49. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  50. package/dist/cli/commands/HistoryCommand.js +96 -0
  51. package/dist/cli/commands/StatusCommand.d.ts +33 -0
  52. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  53. package/dist/cli/commands/StatusCommand.js +93 -0
  54. package/dist/cli/commands/ThemeCommand.d.ts +33 -0
  55. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  56. package/dist/cli/commands/ThemeCommand.js +79 -0
  57. package/dist/cli/help.d.ts +15 -0
  58. package/dist/cli/help.d.ts.map +1 -0
  59. package/dist/cli/help.js +118 -0
  60. package/dist/cli/index.d.ts +15 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +46 -0
  63. package/dist/constants.d.ts +122 -0
  64. package/dist/constants.d.ts.map +1 -0
  65. package/dist/constants.js +159 -0
  66. package/dist/core.cjs +1 -1
  67. package/dist/core.cjs.map +1 -1
  68. package/dist/core.d.ts +134 -0
  69. package/dist/core.d.ts.map +1 -0
  70. package/dist/core.js +315 -242
  71. package/dist/core.js.map +1 -1
  72. package/dist/example.d.ts +18 -0
  73. package/dist/example.d.ts.map +1 -0
  74. package/dist/example.js +154 -0
  75. package/dist/exports-module.d.ts +203 -0
  76. package/dist/exports-module.d.ts.map +1 -0
  77. package/dist/exports-module.js +260 -0
  78. package/dist/exports.cjs +1 -1
  79. package/dist/exports.cjs.map +1 -1
  80. package/dist/exports.js +5 -4
  81. package/dist/exports.js.map +1 -1
  82. package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
  83. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  84. package/dist/handlers/AnalyticsLogHandler.js +19 -0
  85. package/dist/handlers/ExportLogHandler.d.ts +103 -0
  86. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  87. package/dist/handlers/ExportLogHandler.js +516 -0
  88. package/dist/handlers/FileLogHandler.d.ts +36 -0
  89. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  90. package/dist/handlers/FileLogHandler.js +156 -0
  91. package/dist/handlers/RemoteLogHandler.d.ts +14 -0
  92. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  93. package/dist/handlers/RemoteLogHandler.js +37 -0
  94. package/dist/handlers/index.d.ts +8 -0
  95. package/dist/handlers/index.d.ts.map +1 -0
  96. package/dist/handlers/index.js +7 -0
  97. package/dist/index.cjs +1 -1
  98. package/dist/index.cjs.map +1 -1
  99. package/dist/index.d.ts +86 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +89 -103
  102. package/dist/index.js.map +1 -1
  103. package/dist/main.d.ts +2 -0
  104. package/dist/main.d.ts.map +1 -0
  105. package/dist/main.js +139 -0
  106. package/dist/styling/LogStyleBuilder.d.ts +149 -0
  107. package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
  108. package/dist/styling/LogStyleBuilder.js +289 -0
  109. package/dist/styling/SemanticStyles.d.ts +181 -0
  110. package/dist/styling/SemanticStyles.d.ts.map +1 -0
  111. package/dist/styling/SemanticStyles.js +339 -0
  112. package/dist/styling/SmartPresets.d.ts +25 -0
  113. package/dist/styling/SmartPresets.d.ts.map +1 -0
  114. package/dist/styling/SmartPresets.js +276 -0
  115. package/dist/styling/StyleBuilder.d.ts +140 -0
  116. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  117. package/dist/styling/StyleBuilder.js +280 -0
  118. package/dist/styling/banners.d.ts +45 -0
  119. package/dist/styling/banners.d.ts.map +1 -0
  120. package/dist/styling/banners.js +155 -0
  121. package/dist/styling/index.d.ts +10 -0
  122. package/dist/styling/index.d.ts.map +1 -0
  123. package/dist/styling/index.js +9 -0
  124. package/dist/styling/themes.d.ts +10 -0
  125. package/dist/styling/themes.d.ts.map +1 -0
  126. package/dist/styling/themes.js +231 -0
  127. package/dist/styling-module.d.ts +185 -0
  128. package/dist/styling-module.d.ts.map +1 -0
  129. package/dist/styling-module.js +199 -0
  130. package/dist/styling.cjs +1 -1
  131. package/dist/styling.cjs.map +1 -1
  132. package/dist/styling.js +6 -6
  133. package/dist/styling.js.map +1 -1
  134. package/dist/types/Logger.d.ts +268 -0
  135. package/dist/types/Logger.d.ts.map +1 -0
  136. package/dist/types/ScopedLogger.d.ts +123 -0
  137. package/dist/types/ScopedLogger.d.ts.map +1 -0
  138. package/dist/types/cli/CommandProcessor.d.ts +100 -0
  139. package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
  140. package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
  141. package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
  142. package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
  143. package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
  144. package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
  145. package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
  146. package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
  147. package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
  148. package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
  149. package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
  150. package/dist/types/cli/help.d.ts +12 -0
  151. package/dist/types/cli/help.d.ts.map +1 -0
  152. package/dist/types/cli/index.d.ts +15 -0
  153. package/dist/types/cli/index.d.ts.map +1 -0
  154. package/dist/types/constants.d.ts +119 -0
  155. package/dist/types/constants.d.ts.map +1 -0
  156. package/dist/types/core.d.ts +125 -211
  157. package/dist/types/core.d.ts.map +1 -0
  158. package/dist/types/core.js +13 -0
  159. package/dist/types/example.d.ts +18 -0
  160. package/dist/types/example.d.ts.map +1 -0
  161. package/dist/types/exports-module.d.ts +196 -0
  162. package/dist/types/exports-module.d.ts.map +1 -0
  163. package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
  164. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  165. package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
  166. package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
  167. package/dist/types/handlers/FileLogHandler.d.ts +33 -0
  168. package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
  169. package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
  170. package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
  171. package/dist/types/handlers/index.d.ts +8 -0
  172. package/dist/types/handlers/index.d.ts.map +1 -0
  173. package/dist/types/handlers.d.ts +88 -0
  174. package/dist/types/handlers.d.ts.map +1 -0
  175. package/dist/types/handlers.js +4 -0
  176. package/dist/types/index.d.ts +7 -675
  177. package/dist/types/index.d.ts.map +1 -0
  178. package/dist/types/index.js +4 -0
  179. package/dist/types/main.d.ts +2 -0
  180. package/dist/types/main.d.ts.map +1 -0
  181. package/dist/types/styling/LogStyleBuilder.d.ts +146 -0
  182. package/dist/types/styling/LogStyleBuilder.d.ts.map +1 -0
  183. package/dist/types/styling/SemanticStyles.d.ts +178 -0
  184. package/dist/types/styling/SemanticStyles.d.ts.map +1 -0
  185. package/dist/types/styling/SmartPresets.d.ts +22 -0
  186. package/dist/types/styling/SmartPresets.d.ts.map +1 -0
  187. package/dist/types/styling/StyleBuilder.d.ts +140 -0
  188. package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
  189. package/dist/types/styling/banners.d.ts +42 -0
  190. package/dist/types/styling/banners.d.ts.map +1 -0
  191. package/dist/types/styling/index.d.ts +10 -0
  192. package/dist/types/styling/index.d.ts.map +1 -0
  193. package/dist/types/styling/themes.d.ts +7 -0
  194. package/dist/types/styling/themes.d.ts.map +1 -0
  195. package/dist/types/styling-module.d.ts +178 -0
  196. package/dist/types/styling-module.d.ts.map +1 -0
  197. package/dist/types/types/core.d.ts +125 -0
  198. package/dist/types/types/core.d.ts.map +1 -0
  199. package/dist/types/types/handlers.d.ts +85 -0
  200. package/dist/types/types/handlers.d.ts.map +1 -0
  201. package/dist/types/types/index.d.ts +7 -0
  202. package/dist/types/types/index.d.ts.map +1 -0
  203. package/dist/types/utils/environment.d.ts +47 -0
  204. package/dist/types/utils/environment.d.ts.map +1 -0
  205. package/dist/types/utils/formatting.d.ts +37 -0
  206. package/dist/types/utils/formatting.d.ts.map +1 -0
  207. package/dist/types/utils/index.d.ts +7 -0
  208. package/dist/types/utils/index.d.ts.map +1 -0
  209. package/dist/types/utils/opentui-detection.d.ts +34 -0
  210. package/dist/types/utils/opentui-detection.d.ts.map +1 -0
  211. package/dist/types/utils/output.d.ts +41 -0
  212. package/dist/types/utils/output.d.ts.map +1 -0
  213. package/dist/types/utils/stackTrace.d.ts +6 -0
  214. package/dist/types/utils/stackTrace.d.ts.map +1 -0
  215. package/dist/types/utils/timestamps.d.ts +20 -0
  216. package/dist/types/utils/timestamps.d.ts.map +1 -0
  217. package/dist/utils/environment.d.ts +47 -0
  218. package/dist/utils/environment.d.ts.map +1 -0
  219. package/dist/utils/environment.js +85 -0
  220. package/dist/utils/formatting.d.ts +40 -0
  221. package/dist/utils/formatting.d.ts.map +1 -0
  222. package/dist/utils/formatting.js +117 -0
  223. package/dist/utils/index.d.ts +7 -0
  224. package/dist/utils/index.d.ts.map +1 -0
  225. package/dist/utils/index.js +6 -0
  226. package/dist/utils/opentui-detection.d.ts +34 -0
  227. package/dist/utils/opentui-detection.d.ts.map +1 -0
  228. package/dist/utils/opentui-detection.js +116 -0
  229. package/dist/utils/output.d.ts +44 -0
  230. package/dist/utils/output.d.ts.map +1 -0
  231. package/dist/utils/output.js +150 -0
  232. package/dist/utils/stackTrace.d.ts +9 -0
  233. package/dist/utils/stackTrace.d.ts.map +1 -0
  234. package/dist/utils/stackTrace.js +81 -0
  235. package/dist/utils/timestamps.d.ts +20 -0
  236. package/dist/utils/timestamps.d.ts.map +1 -0
  237. package/dist/utils/timestamps.js +71 -0
  238. package/docs/API.md +691 -0
  239. package/docs/CORE.md +10 -10
  240. package/docs/DEVELOPMENT.md +731 -0
  241. package/docs/PACKAGES.md +244 -0
  242. package/docs/_config.yml +36 -0
  243. package/docs/index.md +179 -0
  244. package/examples/README.md +208 -0
  245. package/examples/basic-logging.js +75 -0
  246. package/examples/data-export.js +234 -0
  247. package/examples/package.json +16 -0
  248. package/examples/performance-timing.js +170 -0
  249. package/examples/simplified-api.js +124 -0
  250. package/examples/styling-themes.js +207 -0
  251. package/package.json +37 -21
  252. package/packages/core/package.json +57 -0
  253. package/packages/exports/package.json +41 -0
  254. package/packages/nodejs-opentui/README.md +232 -0
  255. package/packages/nodejs-opentui/package.json +72 -0
  256. package/packages/nodejs-opentui/src/LogRenderer.ts +171 -0
  257. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +178 -0
  258. package/packages/nodejs-opentui/src/components/LogBadge.tsx +131 -0
  259. package/packages/nodejs-opentui/src/index.ts +133 -0
  260. package/packages/nodejs-opentui/src/types.ts +158 -0
  261. package/packages/nodejs-opentui/tsconfig.json +20 -0
  262. package/packages/styling/package.json +41 -0
  263. package/project-utils/README.md +172 -0
  264. package/project-utils/auto-release-gemini.ts +1193 -0
  265. package/project-utils/auto-release-ui.ts +1329 -0
  266. package/project-utils/commit-generator.ts +1385 -0
  267. package/project-utils/commit-ui.ts +264 -0
  268. package/project-utils/git-utils.ts +199 -0
  269. package/project-utils/github-release-manager.ts +466 -0
  270. package/project-utils/project-config.ts +260 -0
  271. package/project-utils/prompt-templates.js +345 -0
  272. package/project-utils/prompt-templates.ts +422 -0
  273. package/project-utils/version-manager.ts +1078 -0
  274. package/src/Logger.ts +251 -16
  275. package/src/ScopedLogger.ts +262 -0
  276. package/src/cli/CommandProcessor.ts +173 -2
  277. package/src/cli/commands/HistoryCommand.ts +117 -0
  278. package/src/cli/index.ts +12 -0
  279. package/src/constants.ts +84 -2
  280. package/src/core.ts +119 -46
  281. package/src/example.ts +4 -4
  282. package/src/exports-module.ts +1 -1
  283. package/src/handlers/ExportLogHandler.ts +141 -0
  284. package/src/handlers/FileLogHandler.ts +144 -5
  285. package/src/index.ts +1 -1
  286. package/src/main.ts +3 -3
  287. package/src/styling/LogStyleBuilder.ts +355 -0
  288. package/src/styling/SemanticStyles.ts +380 -0
  289. package/src/styling/SmartPresets.ts +288 -0
  290. package/src/styling/StyleBuilder.ts +14 -0
  291. package/src/styling/index.ts +16 -1
  292. package/src/styling-module.ts +1 -1
  293. package/src/types/core.ts +60 -0
  294. package/src/types/index.ts +6 -0
  295. package/src/utils/environment.ts +94 -0
  296. package/src/utils/formatting.ts +142 -0
  297. package/src/utils/index.ts +3 -0
  298. package/src/utils/opentui-detection.ts +138 -0
  299. package/src/utils/output.ts +66 -8
  300. package/test-core-browser.html +237 -0
  301. package/test-core-node.js +63 -0
  302. package/tests/test-conflict-resolution.ts +391 -0
  303. package/tests/validate-workflows.sh +131 -0
  304. package/tests/yaml-autofix.sh +146 -0
  305. package/vite.config.ts +189 -50
  306. package/.npmrc.bak +0 -1
  307. package/dist/chunks/Logger-BQhMKy_T.js +0 -2
  308. package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
  309. package/dist/chunks/Logger-BrFKFZcD.js +0 -978
  310. package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
  311. package/dist/chunks/core-2opW4Pi3.js +0 -194
  312. package/dist/chunks/core-2opW4Pi3.js.map +0 -1
  313. package/dist/chunks/core-DyugwSYZ.js +0 -4
  314. package/dist/chunks/core-DyugwSYZ.js.map +0 -1
  315. package/dist/chunks/exports-BNP3R7dp.js +0 -421
  316. package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
  317. package/dist/chunks/exports-U1xLBXrY.js +0 -2
  318. package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
  319. package/dist/chunks/styling-DhUDzwlE.js +0 -654
  320. package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
  321. package/dist/chunks/styling-tmRDI28D.js +0 -2
  322. package/dist/chunks/styling-tmRDI28D.js.map +0 -1
  323. package/dist/types/exports.d.ts +0 -600
  324. package/dist/types/styling.d.ts +0 -751
  325. package/src/Logger.ts.backup +0 -1684
  326. /package/.github/{workflows → workflows-backup}/release.yml +0 -0
@@ -0,0 +1,207 @@
1
+ /**
2
+ * Styling and Themes Example
3
+ *
4
+ * Demonstrates visual styling capabilities including:
5
+ * - Theme switching and customization
6
+ * - Custom style creation with StyleBuilder
7
+ * - Banner display variations
8
+ * - SVG background integration
9
+ * - Pre-built style presets
10
+ *
11
+ * Run: node examples/styling-themes.js
12
+ * Note: Best viewed in browser console for full visual effects
13
+ */
14
+
15
+ import { Logger } from '@mks2508/better-logger';
16
+ import {
17
+ setTheme,
18
+ showBanner,
19
+ createStyle,
20
+ stylePresets,
21
+ logAnimated,
22
+ logWithSVG
23
+ } from '@mks2508/better-logger/styling';
24
+
25
+ console.log('🎨 Better Logger - Styling and Themes Example\n');
26
+
27
+ const logger = new Logger({ prefix: 'STYLE' });
28
+
29
+ // Theme demonstration
30
+ console.log('🌈 Testing different themes:');
31
+
32
+ const themes = ['default', 'dark', 'neon', 'cyberpunk', 'retro'];
33
+
34
+ for (const theme of themes) {
35
+ setTheme(theme);
36
+ logger.info(`Theme changed to: ${theme}`);
37
+
38
+ // Show some logs in this theme
39
+ logger.success(`${theme} theme is active!`);
40
+ logger.warn(`Warning message in ${theme} theme`);
41
+ logger.error(`Error message in ${theme} theme`);
42
+
43
+ console.log(''); // Add spacing
44
+ }
45
+
46
+ // Banner demonstrations
47
+ console.log('\n🎭 Testing different banner types:');
48
+
49
+ const bannerTypes = ['simple', 'ascii', 'unicode', 'svg', 'animated'];
50
+
51
+ bannerTypes.forEach((type, index) => {
52
+ setTimeout(() => {
53
+ console.log(`\n--- ${type.toUpperCase()} BANNER ---`);
54
+ showBanner(type);
55
+ logger.info(`Showing ${type} banner style`);
56
+ }, index * 1000);
57
+ });
58
+
59
+ // Wait for banners, then continue
60
+ setTimeout(() => {
61
+ console.log('\n✨ Testing custom style creation:');
62
+
63
+ // Create custom styles using StyleBuilder
64
+ const headerStyle = createStyle()
65
+ .bg('linear-gradient(135deg, #667eea, #764ba2)')
66
+ .color('white')
67
+ .padding('12px 24px')
68
+ .rounded('8px')
69
+ .bold()
70
+ .shadow('0 4px 15px rgba(102, 126, 234, 0.3)')
71
+ .build();
72
+
73
+ const alertStyle = createStyle()
74
+ .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
75
+ .color('#333')
76
+ .padding('10px 20px')
77
+ .border('2px solid #ff5252')
78
+ .rounded('25px')
79
+ .bold()
80
+ .animation('pulse 1s ease-in-out infinite')
81
+ .build();
82
+
83
+ const codeStyle = createStyle()
84
+ .backgroundColor('#2c3e50')
85
+ .color('#ecf0f1')
86
+ .padding('8px 12px')
87
+ .font('Monaco, Consolas, monospace')
88
+ .border('1px solid #34495e')
89
+ .rounded('4px')
90
+ .build();
91
+
92
+ console.log('%cCustom Header Style', headerStyle);
93
+ console.log('%cCustom Alert Style', alertStyle);
94
+ console.log('%cCustom Code Style', codeStyle);
95
+
96
+ // Using pre-built style presets
97
+ console.log('\n🎯 Testing style presets:');
98
+
99
+ console.log('%c✅ Success Preset', stylePresets.success);
100
+ console.log('%c❌ Error Preset', stylePresets.error);
101
+ console.log('%c⚠️ Warning Preset', stylePresets.warning);
102
+ console.log('%cℹ️ Info Preset', stylePresets.info);
103
+ console.log('%c🎯 Accent Preset', stylePresets.accent);
104
+
105
+ // Advanced styling combinations
106
+ console.log('\n🔧 Advanced styling combinations:');
107
+
108
+ const gradientButton = createStyle()
109
+ .bg('linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c)')
110
+ .color('white')
111
+ .padding('15px 30px')
112
+ .rounded('50px')
113
+ .bold()
114
+ .shadow('0 8px 25px rgba(102, 126, 234, 0.4)')
115
+ .animation('backgroundMove 3s ease infinite')
116
+ .css('background-size', '400% 400%')
117
+ .build();
118
+
119
+ console.log('%c🚀 Gradient Button Style', gradientButton);
120
+
121
+ const glassMorphism = createStyle()
122
+ .bg('rgba(255, 255, 255, 0.1)')
123
+ .color('#333')
124
+ .padding('20px')
125
+ .rounded('15px')
126
+ .border('1px solid rgba(255, 255, 255, 0.2)')
127
+ .css('backdrop-filter', 'blur(10px)')
128
+ .shadow('0 8px 32px rgba(0, 0, 0, 0.1)')
129
+ .build();
130
+
131
+ console.log('%c🪟 Glass Morphism Style', glassMorphism);
132
+
133
+ // SVG background demonstration (works in browser)
134
+ if (typeof document !== 'undefined') {
135
+ console.log('\n🖼️ Testing SVG backgrounds:');
136
+
137
+ const brandSVG = `
138
+ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'>
139
+ <defs>
140
+ <linearGradient id='brandGrad' x1='0%' y1='0%' x2='100%' y2='0%'>
141
+ <stop offset='0%' style='stop-color:#667eea'/>
142
+ <stop offset='100%' style='stop-color:#764ba2'/>
143
+ </linearGradient>
144
+ </defs>
145
+ <rect width='100%' height='100%' fill='url(#brandGrad)' rx='8'/>
146
+ <text x='200' y='45' text-anchor='middle' fill='white'
147
+ font-family='Arial' font-size='18' font-weight='bold'>
148
+ BETTER LOGGER
149
+ </text>
150
+ </svg>
151
+ `;
152
+
153
+ logWithSVG('Custom SVG Background!', brandSVG, {
154
+ width: 400,
155
+ height: 80,
156
+ padding: '40px 200px'
157
+ });
158
+
159
+ // Animated logging (browser only)
160
+ console.log('\n✨ Testing animated logging:');
161
+
162
+ logAnimated('🌟 This message has animated gradients!', 3);
163
+
164
+ setTimeout(() => {
165
+ logAnimated('🎉 Animation completed!', 2);
166
+ }, 3500);
167
+ }
168
+
169
+ // Style combinations for different contexts
170
+ console.log('\n📱 Context-specific styling:');
171
+
172
+ const mobileStyle = createStyle()
173
+ .bg('#007AFF')
174
+ .color('white')
175
+ .padding('8px 16px')
176
+ .rounded('18px')
177
+ .fontSize('14px')
178
+ .build();
179
+
180
+ const desktopStyle = createStyle()
181
+ .bg('linear-gradient(135deg, #74b9ff, #0984e3)')
182
+ .color('white')
183
+ .padding('12px 24px')
184
+ .rounded('8px')
185
+ .fontSize('16px')
186
+ .shadow('0 4px 12px rgba(116, 185, 255, 0.3)')
187
+ .build();
188
+
189
+ const terminalStyle = createStyle()
190
+ .backgroundColor('#1e1e1e')
191
+ .color('#00ff00')
192
+ .padding('6px 12px')
193
+ .font('Fira Code, Monaco, monospace')
194
+ .border('1px solid #333')
195
+ .build();
196
+
197
+ console.log('%c📱 Mobile Style', mobileStyle);
198
+ console.log('%c🖥️ Desktop Style', desktopStyle);
199
+ console.log('%c💻 Terminal Style', terminalStyle);
200
+
201
+ console.log('\n✅ Styling and themes examples completed!');
202
+
203
+ // Reset to default theme
204
+ setTheme('default');
205
+ logger.info('Theme reset to default');
206
+
207
+ }, 6000); // Wait for banner demonstrations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mks2508/better-logger",
3
- "version": "0.0.2-alpha.2",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface",
6
6
  "main": "dist/index.js",
@@ -27,37 +27,53 @@
27
27
  "url": "https://github.com/MKS2508/advanced-logger/issues"
28
28
  },
29
29
  "homepage": "https://mks2508.github.io/advanced-logger/",
30
- "publishConfig": {
31
- "registry": "https://registry.npmjs.org/"
32
- },
33
30
  "scripts": {
34
31
  "dev": "vite",
35
- "build": "tsc && vite build",
36
- "build:watch": "vite build --watch",
37
- "build:analyze": "vite build --mode analyze",
38
- "preview": "vite preview",
32
+ "build": "tsc && BUILD_MODE=full vite build",
33
+ "build:full": "tsc && BUILD_MODE=full vite build",
34
+ "build:core": "tsc && BUILD_MODE=core vite build",
35
+ "build:styling": "tsc && BUILD_MODE=styling vite build",
36
+ "build:exports": "tsc && BUILD_MODE=exports vite build",
37
+ "build:all": "npm run build:full && npm run build:core && npm run build:styling && npm run build:exports",
39
38
  "clean": "rm -rf dist node_modules/.vite",
40
39
  "type-check": "tsc --noEmit",
41
- "lint": "echo 'Linting with ESLint...' && exit 0",
42
- "lint:fix": "echo 'Fixing with ESLint...' && exit 0",
43
40
  "test": "echo 'Running tests...' && exit 0",
44
- "test:watch": "echo 'Running tests in watch mode...' && exit 0",
45
- "test:coverage": "echo 'Running tests with coverage...' && exit 0",
46
41
  "test:performance": "echo 'Running performance benchmarks...' && exit 0",
47
42
  "test:visual": "echo 'Running visual tests...' && exit 0",
48
- "prepublishOnly": "npm run clean && npm run type-check && npm run build",
49
- "release": "npm version patch && npm publish --access public",
50
- "release:minor": "npm version minor && npm publish --access public",
51
- "release:major": "npm version major && npm publish --access public",
52
- "release:alpha": "npm version prerelease --preid=alpha && npm publish --access public --tag alpha",
53
- "release:beta": "npm version prerelease --preid=beta && npm publish --access public --tag beta",
54
- "demo:serve": "python3 -m http.server 8080",
43
+ "test:workflows": "bun tests/test-conflict-resolution.ts",
44
+ "lint:yaml": "yamllint -c .yamllint .github/workflows/",
45
+ "fix:yaml": "./tests/yaml-autofix.sh",
46
+ "validate:workflows": "./tests/validate-workflows.sh",
55
47
  "size-limit": "echo 'Checking bundle sizes...' && ls -la dist/",
56
48
  "ci:install": "npm ci",
57
- "ci:build": "npm run build",
49
+ "ci:build": "npm run build:all",
58
50
  "ci:test": "npm run test",
59
51
  "ci:publish": "npm publish --access public --ignore-scripts",
60
- "ci:publish:github": "npm publish --registry=https://npm.pkg.github.com --access public --ignore-scripts"
52
+ "ci:publish:github": "npm publish --registry=https://npm.pkg.github.com --access public --ignore-scripts",
53
+ "commit:auto": "bun project-utils/commit-generator.ts --auto-approve --quiet",
54
+ "commit:ui": "bun project-utils/commit-ui.ts",
55
+ "version:auto": "bun project-utils/version-manager.ts --auto-approve",
56
+ "version:patch": "bun project-utils/version-manager.ts --type patch --auto-approve",
57
+ "version:minor": "bun project-utils/version-manager.ts --type minor --auto-approve",
58
+ "version:major": "bun project-utils/version-manager.ts --type major --auto-approve",
59
+ "version:alpha": "bun project-utils/version-manager.ts --prefix alpha --auto-approve",
60
+ "version:beta": "bun project-utils/version-manager.ts --prefix beta --auto-approve",
61
+ "version:stable": "bun project-utils/version-manager.ts --prefix '' --auto-approve",
62
+ "release:github": "bun project-utils/github-release-manager.ts --auto-approve",
63
+ "release:full": "npm run version:auto && npm run build:all && npm run release:github && npm run ci:publish",
64
+ "release:auto": "bun project-utils/auto-release-gemini.ts --ai --auto-approve",
65
+ "release:ui": "bun project-utils/auto-release-ui.ts",
66
+ "release:hotfix": "bun project-utils/auto-release-ui.ts --hotfix",
67
+ "release:feature": "bun project-utils/auto-release-ui.ts --feature",
68
+ "release:alpha": "bun project-utils/auto-release-ui.ts --alpha",
69
+ "release:major": "bun project-utils/auto-release-ui.ts --major",
70
+ "publish:core": "cd packages/core && npm publish --access public",
71
+ "publish:styling": "cd packages/styling && npm publish --access public",
72
+ "publish:exports": "cd packages/exports && npm publish --access public",
73
+ "publish:all-packages": "npm run publish:core && npm run publish:styling && npm run publish:exports",
74
+ "workflow:full": "npm run commit:auto && npm run release:full",
75
+ "workflow:commit": "npm run commit:auto",
76
+ "workflow:release": "npm run version:auto && npm run build:all && npm run release:github"
61
77
  },
62
78
  "devDependencies": {
63
79
  "terser": "^5.43.1",
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@mks2508/better-logger-core",
3
+ "version": "0.13.0-alpha.1",
4
+ "type": "module",
5
+ "description": "Universal core logging functionality for Better Logger - Works in both Node.js and browser environments",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "browser": "dist/index.umd.js",
9
+ "types": "dist/types/core.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "node": {
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ },
16
+ "browser": {
17
+ "import": "./dist/index.js",
18
+ "require": "./dist/index.umd.js"
19
+ },
20
+ "default": "./dist/index.js"
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
24
+ "keywords": [
25
+ "logger",
26
+ "console",
27
+ "core",
28
+ "typescript",
29
+ "browser",
30
+ "nodejs",
31
+ "universal",
32
+ "debug",
33
+ "isomorphic"
34
+ ],
35
+ "author": "MKS2508",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/MKS2508/advanced-logger.git",
40
+ "directory": "packages/core"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/MKS2508/advanced-logger/issues"
44
+ },
45
+ "homepage": "https://mks2508.github.io/advanced-logger/",
46
+ "publishConfig": {
47
+ "access": "public",
48
+ "registry": "https://registry.npmjs.org/"
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "README.md"
53
+ ],
54
+ "engines": {
55
+ "node": ">=14.0.0"
56
+ }
57
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@mks2508/better-logger-exports",
3
+ "version": "0.13.0-alpha.1",
4
+ "type": "module",
5
+ "description": "Export handlers for Better Logger - File, Remote, Analytics and custom log destinations",
6
+ "main": "dist/index.js",
7
+ "types": "dist/types/exports-module.d.ts",
8
+ "keywords": [
9
+ "logger",
10
+ "console",
11
+ "exports",
12
+ "handlers",
13
+ "file",
14
+ "remote",
15
+ "analytics",
16
+ "typescript",
17
+ "browser"
18
+ ],
19
+ "author": "MKS2508",
20
+ "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/MKS2508/advanced-logger.git",
24
+ "directory": "packages/exports"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/MKS2508/advanced-logger/issues"
28
+ },
29
+ "homepage": "https://mks2508.github.io/advanced-logger/",
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "registry": "https://registry.npmjs.org/"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md"
37
+ ],
38
+ "peerDependencies": {
39
+ "@mks2508/better-logger-core": "^0.13.0-alpha.1"
40
+ }
41
+ }
@@ -0,0 +1,232 @@
1
+ # @mks2508/better-logger-nodejs-opentui
2
+
3
+ Rich terminal logging with OpenTUI - Enhanced Tier 2 Package
4
+
5
+ ## Overview
6
+
7
+ This package extends the Advanced Logger with [OpenTUI](https://github.com/sst/opentui) capabilities, providing beautiful, interactive terminal user interfaces for your logs. While OpenTUI is still experimental, it offers cutting-edge terminal UI features that transform console logging into rich visual experiences.
8
+
9
+ ## Features
10
+
11
+ - 🎨 **Rich Visual Components**: Beautiful badges, styled text, and visual elements
12
+ - ⚡ **Performance**: Built on OpenTUI's high-performance rendering engine
13
+ - 🔧 **Easy Integration**: Drop-in enhancement for existing loggers
14
+ - 🎯 **Tier 2 Enhanced**: Focused on essential rich logging without complexity
15
+ - 📱 **Auto-fallback**: Gracefully falls back to standard logging if OpenTUI unavailable
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install @mks2508/better-logger-nodejs-opentui
21
+ ```
22
+
23
+ **Dependencies:**
24
+ - `@opentui/core ^0.1.2`
25
+ - `@opentui/react ^0.1.2` (for future components)
26
+ - `@mks2508/better-logger-core ^0.12.0` (peer dependency)
27
+
28
+ ## Quick Start
29
+
30
+ ### Option 1: Quick Setup (Recommended)
31
+
32
+ ```typescript
33
+ import { quickSetup } from '@mks2508/better-logger-nodejs-opentui';
34
+
35
+ // One line setup - enhances default logger
36
+ const logger = await quickSetup();
37
+
38
+ logger?.info('🚀 OpenTUI enhanced logging is ready!');
39
+ logger?.warn('⚠️ This will look amazing in terminal');
40
+ logger?.error('❌ Rich error display with badges');
41
+ logger?.critical('🚨 Critical alerts with animations');
42
+ ```
43
+
44
+ ### Option 2: Manual Integration
45
+
46
+ ```typescript
47
+ import logger from '@mks2508/better-logger-core';
48
+ import { createOpenTUILogger } from '@mks2508/better-logger-nodejs-opentui';
49
+
50
+ // Create and add OpenTUI handler
51
+ const openTUIHandler = await createOpenTUILogger({
52
+ renderer: {
53
+ animated: true,
54
+ theme: 'auto',
55
+ components: {
56
+ badges: true
57
+ }
58
+ }
59
+ });
60
+
61
+ if (openTUIHandler) {
62
+ logger.addHandler(openTUIHandler);
63
+ logger.info('Rich terminal logging enabled!');
64
+ } else {
65
+ logger.info('Fallback to standard logging');
66
+ }
67
+ ```
68
+
69
+ ### Option 3: Enhance Existing Logger
70
+
71
+ ```typescript
72
+ import { enhanceLoggerWithOpenTUI } from '@mks2508/better-logger-nodejs-opentui';
73
+ import myLogger from './my-logger';
74
+
75
+ // Enhance any logger that has addHandler method
76
+ const enhanced = await enhanceLoggerWithOpenTUI(myLogger, {
77
+ renderer: { animated: true, theme: 'dark' }
78
+ });
79
+
80
+ if (enhanced) {
81
+ myLogger.info('Now with OpenTUI superpowers! 💫');
82
+ }
83
+ ```
84
+
85
+ ## Configuration
86
+
87
+ ### OpenTUIRendererOptions
88
+
89
+ ```typescript
90
+ interface OpenTUIRendererOptions {
91
+ interactive?: boolean; // false (Tier 2 - basic for now)
92
+ animated?: boolean; // true - Enable animations
93
+ theme?: 'light' | 'dark' | 'auto'; // 'auto' - Adapt to terminal
94
+ dashboard?: boolean; // false (reserved for Tier 3)
95
+ maxHistory?: number; // 100 - Max log entries to keep
96
+ components?: {
97
+ badges?: boolean; // true - Show level badges
98
+ progressBars?: boolean; // false (Tier 2 - keeping simple)
99
+ tables?: boolean; // false (Tier 2)
100
+ charts?: boolean; // false (Tier 2)
101
+ };
102
+ }
103
+ ```
104
+
105
+ ### Examples
106
+
107
+ **Animated Logging:**
108
+ ```typescript
109
+ const handler = await createOpenTUILogger({
110
+ renderer: {
111
+ animated: true,
112
+ theme: 'dark'
113
+ }
114
+ });
115
+
116
+ logger.addHandler(handler);
117
+
118
+ logger.critical('🚨 This badge pulses with animation!');
119
+ logger.error('❌ Error badges shake to grab attention');
120
+ logger.warn('⚠️ Warning badges pulse subtly');
121
+ ```
122
+
123
+ **Scoped Logging with Prefixes:**
124
+ ```typescript
125
+ const apiLogger = logger.scope('API');
126
+ const dbLogger = logger.scope('DATABASE');
127
+
128
+ apiLogger.info('Request started'); // [ℹ️ INFO] [API] Request started
129
+ dbLogger.error('Connection failed'); // [❌ ERROR] [DATABASE] Connection failed
130
+ ```
131
+
132
+ ## Visual Features
133
+
134
+ ### Log Level Badges
135
+
136
+ Each log level gets a distinctive badge with icon and styling:
137
+
138
+ - 🔍 **DEBUG** - Gray badge, subtle
139
+ - ℹ️ **INFO** - Blue badge, informative
140
+ - ⚠️ **WARN** - Yellow badge, pulses
141
+ - ❌ **ERROR** - Red badge, shakes
142
+ - 🚨 **CRITICAL** - Dark red badge, strong pulse
143
+
144
+ ### Animations (Tier 2)
145
+
146
+ - **Pulse**: Warning and critical levels
147
+ - **Shake**: Error level for attention
148
+ - **None**: Debug and info for clean output
149
+
150
+ ### Auto-Fallback
151
+
152
+ If OpenTUI is not available, the handler automatically falls back to enhanced plain text:
153
+
154
+ ```
155
+ [10:30:45] 🚨 [CRITICAL] [API] Database connection lost
156
+ [10:30:46] ❌ [ERROR] [AUTH] Login failed for user@example.com
157
+ at AuthService.validateUser (auth.js:45:12)
158
+ ```
159
+
160
+ ## API Reference
161
+
162
+ ### Classes
163
+
164
+ - **`OpenTUILogHandler`** - Main log handler implementing `ILogHandler`
165
+ - **`OpenTUILogRenderer`** - Core rendering engine using OpenTUI
166
+
167
+ ### Functions
168
+
169
+ - **`createOpenTUILogger(config?)`** - Factory function for handlers
170
+ - **`enhanceLoggerWithOpenTUI(logger, config?)`** - Enhance existing logger
171
+ - **`quickSetup()`** - One-line setup for default logger
172
+ - **`isOpenTUIAvailable()`** - Check if OpenTUI is available
173
+
174
+ ### Types
175
+
176
+ All TypeScript interfaces are exported for custom implementations:
177
+ - `OpenTUILogEntry`, `OpenTUIRendererOptions`, `LogComponentStyle`, etc.
178
+
179
+ ## Performance
180
+
181
+ - **Graceful Degradation**: Zero impact if OpenTUI unavailable
182
+ - **Efficient Rendering**: Leverages OpenTUI's optimized terminal rendering
183
+ - **Memory Management**: Configurable log history limits
184
+ - **Fast Fallback**: Instant fallback to console logging if needed
185
+
186
+ ## Troubleshooting
187
+
188
+ ### OpenTUI Not Available
189
+
190
+ If you see "OpenTUI not available, falling back to standard logging":
191
+
192
+ 1. **Check Installation**: Ensure `@opentui/core` is installed
193
+ 2. **Node Version**: Requires Node.js ≥16.0.0
194
+ 3. **Terminal Support**: Some terminals may not fully support OpenTUI features
195
+ 4. **Permissions**: Ensure terminal has proper rendering permissions
196
+
197
+ ### Debugging
198
+
199
+ ```typescript
200
+ // Check handler status
201
+ const handler = await createOpenTUILogger();
202
+ console.log('Handler stats:', handler?.getStats());
203
+
204
+ // Enable debug logging
205
+ process.env.DEBUG = 'opentui:*';
206
+ ```
207
+
208
+ ## Roadmap
209
+
210
+ ### Current: Tier 2 Enhanced ✅
211
+ - Rich badges with icons and animations
212
+ - Auto-fallback to plain text
213
+ - Basic OpenTUI integration
214
+
215
+ ### Future: Tier 3 Interactive
216
+ - Live dashboard with filtering
217
+ - Real-time log statistics
218
+ - Interactive components (click, select)
219
+ - Progress bars and charts
220
+ - 3D log visualizations
221
+
222
+ ## Contributing
223
+
224
+ This package is part of the Advanced Logger ecosystem. See the main repository for contributing guidelines.
225
+
226
+ ## License
227
+
228
+ MIT - See LICENSE file for details
229
+
230
+ ---
231
+
232
+ **Note**: OpenTUI is experimental and not production-ready. This package provides fallback mechanisms to ensure reliability in all environments.
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@mks2508/better-logger-nodejs-opentui",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "OpenTUI-powered rich terminal logging with interactive components and animations",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/types/index.d.ts"
13
+ },
14
+ "./components": {
15
+ "import": "./dist/components.js",
16
+ "types": "./dist/types/components.d.ts"
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "keywords": [
21
+ "logger",
22
+ "terminal",
23
+ "tui",
24
+ "opentui",
25
+ "interactive",
26
+ "animated",
27
+ "console",
28
+ "nodejs",
29
+ "rich-logging",
30
+ "dashboard"
31
+ ],
32
+ "author": "MKS2508",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/MKS2508/advanced-logger.git",
37
+ "directory": "packages/nodejs-opentui"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/MKS2508/advanced-logger/issues"
41
+ },
42
+ "homepage": "https://mks2508.github.io/advanced-logger/",
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
46
+ },
47
+ "files": [
48
+ "dist",
49
+ "README.md"
50
+ ],
51
+ "engines": {
52
+ "node": ">=16.0.0"
53
+ },
54
+ "dependencies": {
55
+ "@opentui/core": "^0.1.2",
56
+ "@opentui/react": "^0.1.2"
57
+ },
58
+ "devDependencies": {
59
+ "@types/react": "^18.0.0",
60
+ "react": "^18.0.0"
61
+ },
62
+ "peerDependencies": {
63
+ "@mks2508/better-logger-core": "^0.12.0"
64
+ },
65
+ "scripts": {
66
+ "build": "tsc && npm run build:rollup",
67
+ "build:rollup": "echo 'Rollup build placeholder'",
68
+ "dev": "tsc --watch",
69
+ "clean": "rm -rf dist",
70
+ "type-check": "tsc --noEmit"
71
+ }
72
+ }