@mks2508/better-logger 5.0.1 → 5.0.2

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 (310) hide show
  1. package/dist/Logger.d.ts +976 -0
  2. package/dist/Logger.d.ts.map +1 -0
  3. package/dist/ScopedLogger.d.ts +74 -0
  4. package/dist/ScopedLogger.d.ts.map +1 -0
  5. package/dist/chunks/Logger-CKqzXDh3.js +2 -0
  6. package/dist/chunks/Logger-CKqzXDh3.js.map +1 -0
  7. package/dist/chunks/Logger-D_vuKP4l.js +4511 -0
  8. package/dist/chunks/Logger-D_vuKP4l.js.map +1 -0
  9. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  10. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  11. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  12. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  13. package/dist/chunks/cli-module-B-njrTWb.js +2 -0
  14. package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
  15. package/dist/chunks/cli-module-Cx7qotPY.js +390 -0
  16. package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
  17. package/dist/chunks/color-converter-CCSQRztd.js +2 -0
  18. package/dist/chunks/color-converter-CCSQRztd.js.map +1 -0
  19. package/dist/chunks/color-converter-_Xdmsy7E.js +462 -0
  20. package/dist/chunks/color-converter-_Xdmsy7E.js.map +1 -0
  21. package/dist/chunks/environment-C1xxvc8l.js +1127 -0
  22. package/dist/chunks/environment-C1xxvc8l.js.map +1 -0
  23. package/dist/chunks/environment-Cprkw3g9.js +4 -0
  24. package/dist/chunks/environment-Cprkw3g9.js.map +1 -0
  25. package/dist/chunks/formatting-DMJxYq9o.js +380 -0
  26. package/dist/chunks/formatting-DMJxYq9o.js.map +1 -0
  27. package/dist/chunks/formatting-DpKxCsXq.js +2 -0
  28. package/dist/chunks/formatting-DpKxCsXq.js.map +1 -0
  29. package/dist/cli/CommandProcessor.d.ts +100 -0
  30. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  31. package/dist/cli/commands/ConfigCommand.d.ts +14 -0
  32. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  33. package/dist/cli/commands/ExportCommand.d.ts +48 -0
  34. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  35. package/dist/cli/commands/HistoryCommand.d.ts +47 -0
  36. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  37. package/dist/cli/commands/StatusCommand.d.ts +30 -0
  38. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  39. package/dist/cli/commands/ThemeCommand.d.ts +30 -0
  40. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  41. package/dist/cli/help.d.ts +12 -0
  42. package/dist/cli/help.d.ts.map +1 -0
  43. package/dist/cli/index.d.ts +15 -0
  44. package/dist/cli/index.d.ts.map +1 -0
  45. package/{src/cli-module.ts → dist/cli-module.d.ts} +2 -8
  46. package/dist/cli-module.d.ts.map +1 -0
  47. package/dist/cli-primitives/box.d.ts +11 -0
  48. package/dist/cli-primitives/box.d.ts.map +1 -0
  49. package/dist/cli-primitives/cli-table.d.ts +11 -0
  50. package/dist/cli-primitives/cli-table.d.ts.map +1 -0
  51. package/dist/cli-primitives/divider.d.ts +11 -0
  52. package/dist/cli-primitives/divider.d.ts.map +1 -0
  53. package/dist/cli-primitives/header.d.ts +12 -0
  54. package/dist/cli-primitives/header.d.ts.map +1 -0
  55. package/{src/cli-primitives/index.ts → dist/cli-primitives/index.d.ts} +1 -1
  56. package/dist/cli-primitives/index.d.ts.map +1 -0
  57. package/dist/cli-primitives/server-fallback.d.ts +25 -0
  58. package/dist/cli-primitives/server-fallback.d.ts.map +1 -0
  59. package/dist/cli-primitives/spinner.d.ts +47 -0
  60. package/dist/cli-primitives/spinner.d.ts.map +1 -0
  61. package/dist/cli-primitives/step.d.ts +11 -0
  62. package/dist/cli-primitives/step.d.ts.map +1 -0
  63. package/dist/cli.cjs +2 -0
  64. package/dist/cli.cjs.map +1 -0
  65. package/dist/cli.js +12 -0
  66. package/dist/cli.js.map +1 -0
  67. package/dist/constants.d.ts +235 -0
  68. package/dist/constants.d.ts.map +1 -0
  69. package/dist/core.cjs +2 -0
  70. package/dist/core.cjs.map +1 -0
  71. package/dist/core.d.ts +127 -0
  72. package/dist/core.d.ts.map +1 -0
  73. package/dist/core.js +291 -0
  74. package/dist/core.js.map +1 -0
  75. package/dist/example.d.ts +18 -0
  76. package/dist/example.d.ts.map +1 -0
  77. package/dist/exports-module.d.ts +196 -0
  78. package/dist/exports-module.d.ts.map +1 -0
  79. package/dist/exports.cjs +2 -0
  80. package/dist/exports.cjs.map +1 -0
  81. package/dist/exports.js +238 -0
  82. package/dist/exports.js.map +1 -0
  83. package/dist/handlers/AnalyticsLogHandler.d.ts +8 -0
  84. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  85. package/dist/handlers/ExportLogHandler.d.ts +100 -0
  86. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  87. package/dist/handlers/FileLogHandler.d.ts +33 -0
  88. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  89. package/dist/handlers/RemoteLogHandler.d.ts +11 -0
  90. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  91. package/{src/handlers/index.ts → dist/handlers/index.d.ts} +2 -2
  92. package/dist/handlers/index.d.ts.map +1 -0
  93. package/dist/hooks/HookManager.d.ts +21 -0
  94. package/dist/hooks/HookManager.d.ts.map +1 -0
  95. package/{src/hooks/index.ts → dist/hooks/index.d.ts} +1 -0
  96. package/dist/hooks/index.d.ts.map +1 -0
  97. package/dist/index.cjs +2 -0
  98. package/dist/index.cjs.map +1 -0
  99. package/dist/index.d.ts +161 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +627 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/main.d.ts +2 -0
  104. package/dist/main.d.ts.map +1 -0
  105. package/dist/serializers/SerializerRegistry.d.ts +16 -0
  106. package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
  107. package/{src/serializers/index.ts → dist/serializers/index.d.ts} +1 -0
  108. package/dist/serializers/index.d.ts.map +1 -0
  109. package/dist/styling/LogStyleBuilder.d.ts +146 -0
  110. package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
  111. package/dist/styling/SemanticStyles.d.ts +178 -0
  112. package/dist/styling/SemanticStyles.d.ts.map +1 -0
  113. package/dist/styling/SmartPresets.d.ts +22 -0
  114. package/dist/styling/SmartPresets.d.ts.map +1 -0
  115. package/dist/styling/StyleBuilder.d.ts +140 -0
  116. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  117. package/dist/styling/StyleCache.d.ts +42 -0
  118. package/dist/styling/StyleCache.d.ts.map +1 -0
  119. package/dist/styling/banners.d.ts +42 -0
  120. package/dist/styling/banners.d.ts.map +1 -0
  121. package/dist/styling/index.d.ts +10 -0
  122. package/dist/styling/index.d.ts.map +1 -0
  123. package/dist/styling/themes.d.ts +7 -0
  124. package/dist/styling/themes.d.ts.map +1 -0
  125. package/dist/styling-module.d.ts +178 -0
  126. package/dist/styling-module.d.ts.map +1 -0
  127. package/dist/styling.cjs +2 -0
  128. package/dist/styling.cjs.map +1 -0
  129. package/dist/styling.js +146 -0
  130. package/dist/styling.js.map +1 -0
  131. package/dist/terminal/color-converter.d.ts +73 -0
  132. package/dist/terminal/color-converter.d.ts.map +1 -0
  133. package/dist/terminal/formatter.d.ts +20 -0
  134. package/dist/terminal/formatter.d.ts.map +1 -0
  135. package/dist/terminal/terminal-renderer.d.ts +77 -0
  136. package/dist/terminal/terminal-renderer.d.ts.map +1 -0
  137. package/dist/transports/ConsoleTransport.d.ts +9 -0
  138. package/dist/transports/ConsoleTransport.d.ts.map +1 -0
  139. package/dist/transports/FileTransport.d.ts +15 -0
  140. package/dist/transports/FileTransport.d.ts.map +1 -0
  141. package/dist/transports/HttpTransport.d.ts +16 -0
  142. package/dist/transports/HttpTransport.d.ts.map +1 -0
  143. package/dist/transports/TransportManager.d.ts +14 -0
  144. package/dist/transports/TransportManager.d.ts.map +1 -0
  145. package/{src/transports/index.ts → dist/transports/index.d.ts} +1 -0
  146. package/dist/transports/index.d.ts.map +1 -0
  147. package/{src/types/core.ts → dist/types/core.d.ts} +25 -62
  148. package/dist/types/core.d.ts.map +1 -0
  149. package/{src/types/handlers.ts → dist/types/handlers.d.ts} +5 -15
  150. package/dist/types/handlers.d.ts.map +1 -0
  151. package/{src/types/hooks.ts → dist/types/hooks.d.ts} +3 -12
  152. package/dist/types/hooks.d.ts.map +1 -0
  153. package/dist/types/index.d.ts +11 -0
  154. package/dist/types/index.d.ts.map +1 -0
  155. package/{src/types/serializers.ts → dist/types/serializers.d.ts} +1 -6
  156. package/dist/types/serializers.d.ts.map +1 -0
  157. package/{src/types/transports.ts → dist/types/transports.d.ts} +2 -7
  158. package/dist/types/transports.d.ts.map +1 -0
  159. package/dist/utils/adapter.d.ts +48 -0
  160. package/dist/utils/adapter.d.ts.map +1 -0
  161. package/dist/utils/ansi-colors.d.ts +156 -0
  162. package/dist/utils/ansi-colors.d.ts.map +1 -0
  163. package/dist/utils/environment-detector.d.ts +45 -0
  164. package/dist/utils/environment-detector.d.ts.map +1 -0
  165. package/dist/utils/environment.d.ts +47 -0
  166. package/dist/utils/environment.d.ts.map +1 -0
  167. package/dist/utils/formatting.d.ts +58 -0
  168. package/dist/utils/formatting.d.ts.map +1 -0
  169. package/dist/utils/index.d.ts +8 -0
  170. package/dist/utils/index.d.ts.map +1 -0
  171. package/dist/utils/opentui-detection.d.ts +34 -0
  172. package/dist/utils/opentui-detection.d.ts.map +1 -0
  173. package/dist/utils/output.d.ts +46 -0
  174. package/dist/utils/output.d.ts.map +1 -0
  175. package/dist/utils/stackTrace.d.ts +6 -0
  176. package/dist/utils/stackTrace.d.ts.map +1 -0
  177. package/dist/utils/timestamps.d.ts +20 -0
  178. package/dist/utils/timestamps.d.ts.map +1 -0
  179. package/{src/writers/BufferWriter.ts → dist/writers/BufferWriter.d.ts} +16 -77
  180. package/dist/writers/BufferWriter.d.ts.map +1 -0
  181. package/{src/writers/index.ts → dist/writers/index.d.ts} +1 -1
  182. package/dist/writers/index.d.ts.map +1 -0
  183. package/package.json +5 -1
  184. package/.claude/settings.local.json +0 -48
  185. package/.github/workflows/ci-quality.yml +0 -357
  186. package/.github/workflows/docs-demo.yml +0 -119
  187. package/.github/workflows/releases-core.yml +0 -512
  188. package/.github/workflows/releases-full.yml +0 -582
  189. package/.github/workflows-backup/ci.yml +0 -221
  190. package/.github/workflows-backup/nightly.yml +0 -196
  191. package/.github/workflows-backup/release-optimized.yml +0 -373
  192. package/.github/workflows-backup/release.yml +0 -269
  193. package/.release-notes-0.2.0.md +0 -129
  194. package/.yamllint +0 -28
  195. package/CHANGELOG.json +0 -1120
  196. package/CHANGELOG.md +0 -209
  197. package/CLAUDE.md +0 -217
  198. package/demo.html +0 -847
  199. package/docs/API.md +0 -918
  200. package/docs/CORE.md +0 -264
  201. package/docs/DEVELOPMENT.md +0 -731
  202. package/docs/EXPORTS.md +0 -467
  203. package/docs/PACKAGES.md +0 -244
  204. package/docs/STYLING.md +0 -405
  205. package/docs/_config.yml +0 -36
  206. package/docs/index.md +0 -179
  207. package/examples/README.md +0 -208
  208. package/examples/basic-logging.js +0 -75
  209. package/examples/data-export.js +0 -234
  210. package/examples/package.json +0 -16
  211. package/examples/performance-timing.js +0 -170
  212. package/examples/simplified-api.js +0 -124
  213. package/examples/styling-themes.js +0 -207
  214. package/index.html +0 -358
  215. package/packages/core/package.json +0 -57
  216. package/packages/exports/package.json +0 -41
  217. package/packages/nodejs-opentui/README.md +0 -232
  218. package/packages/nodejs-opentui/package.json +0 -72
  219. package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
  220. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
  221. package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
  222. package/packages/nodejs-opentui/src/index.ts +0 -133
  223. package/packages/nodejs-opentui/src/types.ts +0 -158
  224. package/packages/nodejs-opentui/tsconfig.json +0 -20
  225. package/packages/styling/package.json +0 -41
  226. package/playground/demo-all.ts +0 -95
  227. package/playground/demo-box.ts +0 -85
  228. package/playground/demo-levels.ts +0 -56
  229. package/playground/demo-real-world.ts +0 -98
  230. package/playground/demo-spinner.ts +0 -77
  231. package/playground/demo-steps.ts +0 -72
  232. package/playground/demo-table.ts +0 -83
  233. package/project-utils/README.md +0 -172
  234. package/project-utils/auto-release-gemini.ts +0 -1193
  235. package/project-utils/auto-release-ui.ts +0 -1329
  236. package/project-utils/commit-generator.ts +0 -1385
  237. package/project-utils/commit-ui.ts +0 -264
  238. package/project-utils/git-utils.ts +0 -199
  239. package/project-utils/github-release-manager.ts +0 -466
  240. package/project-utils/project-config.ts +0 -260
  241. package/project-utils/prompt-templates.js +0 -345
  242. package/project-utils/prompt-templates.ts +0 -422
  243. package/project-utils/version-manager.ts +0 -1078
  244. package/src/Logger.ts +0 -1858
  245. package/src/ScopedLogger.ts +0 -256
  246. package/src/cli/CommandProcessor.ts +0 -248
  247. package/src/cli/commands/ConfigCommand.ts +0 -93
  248. package/src/cli/commands/ExportCommand.ts +0 -276
  249. package/src/cli/commands/HistoryCommand.ts +0 -117
  250. package/src/cli/commands/StatusCommand.ts +0 -112
  251. package/src/cli/commands/ThemeCommand.ts +0 -88
  252. package/src/cli/help.ts +0 -127
  253. package/src/cli/index.ts +0 -71
  254. package/src/cli-primitives/box.ts +0 -86
  255. package/src/cli-primitives/cli-table.ts +0 -62
  256. package/src/cli-primitives/divider.ts +0 -17
  257. package/src/cli-primitives/header.ts +0 -18
  258. package/src/cli-primitives/server-fallback.ts +0 -54
  259. package/src/cli-primitives/spinner.ts +0 -133
  260. package/src/cli-primitives/step.ts +0 -22
  261. package/src/constants.ts +0 -313
  262. package/src/core.ts +0 -397
  263. package/src/example.ts +0 -210
  264. package/src/exports-module.ts +0 -311
  265. package/src/handlers/AnalyticsLogHandler.ts +0 -22
  266. package/src/handlers/ExportLogHandler.ts +0 -610
  267. package/src/handlers/FileLogHandler.ts +0 -169
  268. package/src/handlers/RemoteLogHandler.ts +0 -42
  269. package/src/hooks/HookManager.ts +0 -177
  270. package/src/index.ts +0 -395
  271. package/src/main.ts +0 -196
  272. package/src/serializers/SerializerRegistry.ts +0 -173
  273. package/src/style.css +0 -96
  274. package/src/styling/LogStyleBuilder.ts +0 -355
  275. package/src/styling/SemanticStyles.ts +0 -380
  276. package/src/styling/SmartPresets.ts +0 -288
  277. package/src/styling/StyleBuilder.ts +0 -319
  278. package/src/styling/StyleCache.ts +0 -131
  279. package/src/styling/banners.ts +0 -168
  280. package/src/styling/index.ts +0 -27
  281. package/src/styling/themes.ts +0 -235
  282. package/src/styling-module.ts +0 -244
  283. package/src/terminal/color-converter.ts +0 -315
  284. package/src/terminal/formatter.ts +0 -242
  285. package/src/terminal/terminal-renderer.ts +0 -342
  286. package/src/transports/ConsoleTransport.ts +0 -28
  287. package/src/transports/FileTransport.ts +0 -53
  288. package/src/transports/HttpTransport.ts +0 -56
  289. package/src/transports/TransportManager.ts +0 -130
  290. package/src/types/index.ts +0 -83
  291. package/src/typescript.svg +0 -1
  292. package/src/utils/adapter.ts +0 -291
  293. package/src/utils/ansi-colors.ts +0 -333
  294. package/src/utils/environment-detector.ts +0 -170
  295. package/src/utils/environment.ts +0 -94
  296. package/src/utils/formatting.ts +0 -332
  297. package/src/utils/index.ts +0 -33
  298. package/src/utils/opentui-detection.ts +0 -138
  299. package/src/utils/output.ts +0 -227
  300. package/src/utils/stackTrace.ts +0 -144
  301. package/src/utils/timestamps.ts +0 -80
  302. package/src/vite-env.d.ts +0 -1
  303. package/test-core-browser.html +0 -237
  304. package/test-core-node.js +0 -63
  305. package/tests/test-conflict-resolution.ts +0 -391
  306. package/tests/validate-workflows.sh +0 -131
  307. package/tests/yaml-autofix.sh +0 -146
  308. package/tsconfig.json +0 -50
  309. package/vite.config.ts +0 -256
  310. /package/{public → dist}/vite.svg +0 -0
@@ -1,319 +0,0 @@
1
- /**
2
- * @fileoverview StyleBuilder class for Advanced Logger
3
- */
4
-
5
- /**
6
- * Utility class for creating dynamic console styles with method chaining
7
- */
8
- export class StyleBuilder {
9
- private styles: string[] = [];
10
-
11
- constructor(baseStyle = '') {
12
- if (baseStyle) this.styles.push(baseStyle);
13
- }
14
-
15
- /**
16
- * Add background color or gradient
17
- */
18
- bg(background: string): StyleBuilder {
19
- this.styles.push(`background: ${background}`);
20
- return this;
21
- }
22
-
23
- /**
24
- * Add text color
25
- */
26
- color(color: string): StyleBuilder {
27
- this.styles.push(`color: ${color}`);
28
- return this;
29
- }
30
-
31
- /**
32
- * Add border styling
33
- */
34
- border(border: string): StyleBuilder {
35
- this.styles.push(`border: ${border}`);
36
- return this;
37
- }
38
-
39
- /**
40
- * Add box shadow
41
- */
42
- shadow(shadow: string): StyleBuilder {
43
- this.styles.push(`box-shadow: ${shadow}`);
44
- return this;
45
- }
46
-
47
- /**
48
- * Add padding
49
- */
50
- padding(padding: string): StyleBuilder {
51
- this.styles.push(`padding: ${padding}`);
52
- return this;
53
- }
54
-
55
- /**
56
- * Add margin
57
- */
58
- margin(margin: string): StyleBuilder {
59
- this.styles.push(`margin: ${margin}`);
60
- return this;
61
- }
62
-
63
- /**
64
- * Add border radius
65
- */
66
- rounded(radius: string = '4px'): StyleBuilder {
67
- this.styles.push(`border-radius: ${radius}`);
68
- return this;
69
- }
70
-
71
- /**
72
- * Add font weight
73
- */
74
- bold(): StyleBuilder {
75
- this.styles.push('font-weight: bold');
76
- return this;
77
- }
78
-
79
- /**
80
- * Add font styling
81
- */
82
- font(font: string): StyleBuilder {
83
- this.styles.push(`font-family: ${font}`);
84
- return this;
85
- }
86
-
87
- /**
88
- * Set monospace font family (alias for common monospace fonts)
89
- */
90
- mono(): StyleBuilder {
91
- return this.font('Monaco, Consolas, "Courier New", monospace');
92
- }
93
-
94
- /**
95
- * Set system font family (alias for system fonts)
96
- */
97
- system(): StyleBuilder {
98
- return this.font('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');
99
- }
100
-
101
- /**
102
- * Add font size
103
- */
104
- size(size: string): StyleBuilder {
105
- this.styles.push(`font-size: ${size}`);
106
- return this;
107
- }
108
-
109
- /**
110
- * Add line height
111
- */
112
- lineHeight(height: string): StyleBuilder {
113
- this.styles.push(`line-height: ${height}`);
114
- return this;
115
- }
116
-
117
- /**
118
- * Add text decoration
119
- */
120
- underline(): StyleBuilder {
121
- this.styles.push('text-decoration: underline');
122
- return this;
123
- }
124
-
125
- /**
126
- * Add text transform
127
- */
128
- uppercase(): StyleBuilder {
129
- this.styles.push('text-transform: uppercase');
130
- return this;
131
- }
132
-
133
- /**
134
- * Add opacity
135
- */
136
- opacity(value: number): StyleBuilder {
137
- this.styles.push(`opacity: ${value}`);
138
- return this;
139
- }
140
-
141
- /**
142
- * Add display property
143
- */
144
- display(value: string): StyleBuilder {
145
- this.styles.push(`display: ${value}`);
146
- return this;
147
- }
148
-
149
- /**
150
- * Add position property
151
- */
152
- position(value: string): StyleBuilder {
153
- this.styles.push(`position: ${value}`);
154
- return this;
155
- }
156
-
157
- /**
158
- * Add transform property
159
- */
160
- transform(value: string): StyleBuilder {
161
- this.styles.push(`transform: ${value}`);
162
- return this;
163
- }
164
-
165
- /**
166
- * Add animation property
167
- */
168
- animation(value: string): StyleBuilder {
169
- this.styles.push(`animation: ${value}`);
170
- return this;
171
- }
172
-
173
- /**
174
- * Add transition property
175
- */
176
- transition(value: string): StyleBuilder {
177
- this.styles.push(`transition: ${value}`);
178
- return this;
179
- }
180
-
181
- /**
182
- * Add cursor property
183
- */
184
- cursor(value: string): StyleBuilder {
185
- this.styles.push(`cursor: ${value}`);
186
- return this;
187
- }
188
-
189
- /**
190
- * Add any custom CSS property
191
- */
192
- custom(property: string, value: string): StyleBuilder {
193
- this.styles.push(`${property}: ${value}`);
194
- return this;
195
- }
196
-
197
- /**
198
- * Add any CSS property (alias for custom)
199
- */
200
- css(property: string, value: string): StyleBuilder {
201
- return this.custom(property, value);
202
- }
203
-
204
- /**
205
- * Build the final CSS string
206
- */
207
- build(): string {
208
- return this.styles.join('; ');
209
- }
210
-
211
- /**
212
- * Clear all styles and start fresh
213
- */
214
- clear(): StyleBuilder {
215
- this.styles = [];
216
- return this;
217
- }
218
-
219
- /**
220
- * Clone this StyleBuilder with the same styles
221
- */
222
- clone(): StyleBuilder {
223
- const cloned = new StyleBuilder();
224
- cloned.styles = [...this.styles];
225
- return cloned;
226
- }
227
-
228
- /**
229
- * Merge another StyleBuilder's styles into this one
230
- */
231
- merge(other: StyleBuilder): StyleBuilder {
232
- this.styles.push(...other.styles);
233
- return this;
234
- }
235
- }
236
-
237
- /**
238
- * Proxy-based dynamic styler for chainable console styling
239
- */
240
- function createStyler(): any {
241
- const builder = new StyleBuilder();
242
- return new Proxy(builder, {
243
- get(target: StyleBuilder, prop: string) {
244
- if (prop in target) {
245
- const method = (target as any)[prop];
246
- if (typeof method === 'function') {
247
- return method.bind(target);
248
- }
249
- return method;
250
- }
251
- return undefined;
252
- }
253
- });
254
- }
255
-
256
- /**
257
- * Dynamic styler instance for external use
258
- */
259
- export const $ = createStyler();
260
-
261
- /**
262
- * Pre-defined style presets for common use cases
263
- */
264
- export const StylePresets = {
265
- success: () => new StyleBuilder()
266
- .bg('linear-gradient(135deg, #00b894 0%, #00a085 100%)')
267
- .color('#ffffff')
268
- .padding('4px 8px')
269
- .rounded('4px')
270
- .bold(),
271
-
272
- error: () => new StyleBuilder()
273
- .bg('linear-gradient(135deg, #e84393 0%, #d63031 100%)')
274
- .color('#ffffff')
275
- .padding('4px 8px')
276
- .rounded('4px')
277
- .bold(),
278
-
279
- warning: () => new StyleBuilder()
280
- .bg('linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)')
281
- .color('#2d3436')
282
- .padding('4px 8px')
283
- .rounded('4px')
284
- .bold(),
285
-
286
- info: () => new StyleBuilder()
287
- .bg('linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)')
288
- .color('#ffffff')
289
- .padding('4px 8px')
290
- .rounded('4px')
291
- .bold(),
292
-
293
- debug: () => new StyleBuilder()
294
- .bg('linear-gradient(135deg, #667eea 0%, #764ba2 100%)')
295
- .color('#ffffff')
296
- .padding('4px 8px')
297
- .rounded('4px')
298
- .bold(),
299
-
300
- muted: () => new StyleBuilder()
301
- .color('#6c757d')
302
- .font('Monaco, Consolas, monospace')
303
- .size('12px'),
304
-
305
- accent: () => new StyleBuilder()
306
- .bg('#f8f9fa')
307
- .color('#495057')
308
- .padding('2px 6px')
309
- .rounded('3px')
310
- .border('1px solid #dee2e6'),
311
-
312
- neon: () => new StyleBuilder()
313
- .bg('linear-gradient(135deg, #0f3460 0%, #e94560 100%)')
314
- .color('#00ffff')
315
- .padding('4px 8px')
316
- .rounded('4px')
317
- .bold()
318
- .shadow('0 0 10px rgba(0, 255, 255, 0.5)'),
319
- };
@@ -1,131 +0,0 @@
1
- import type { LogLevel, DevToolsTheme } from '../types/core.js';
2
-
3
- interface CacheKey {
4
- level: LogLevel | 'success';
5
- theme: DevToolsTheme;
6
- presetName?: string;
7
- hasPrefix: boolean;
8
- hasLocation: boolean;
9
- }
10
-
11
- interface CacheEntry {
12
- styles: string[];
13
- format: string;
14
- createdAt: number;
15
- hits: number;
16
- }
17
-
18
- export interface StyleCacheConfig {
19
- maxEntries?: number;
20
- ttl?: number;
21
- enabled?: boolean;
22
- }
23
-
24
- const DEFAULT_CONFIG: Required<StyleCacheConfig> = {
25
- maxEntries: 100,
26
- ttl: 5 * 60 * 1000,
27
- enabled: true
28
- };
29
-
30
- export class StyleCache {
31
- private cache: Map<string, CacheEntry> = new Map();
32
- private config: Required<StyleCacheConfig>;
33
- private hitCount = 0;
34
- private missCount = 0;
35
-
36
- constructor(config: StyleCacheConfig = {}) {
37
- this.config = { ...DEFAULT_CONFIG, ...config };
38
- }
39
-
40
- private generateKey(key: CacheKey): string {
41
- return `${key.level}:${key.theme}:${key.presetName || 'default'}:${key.hasPrefix}:${key.hasLocation}`;
42
- }
43
-
44
- get(key: CacheKey): CacheEntry | null {
45
- if (!this.config.enabled) return null;
46
-
47
- const cacheKey = this.generateKey(key);
48
- const entry = this.cache.get(cacheKey);
49
-
50
- if (!entry) {
51
- this.missCount++;
52
- return null;
53
- }
54
-
55
- if (Date.now() - entry.createdAt > this.config.ttl) {
56
- this.cache.delete(cacheKey);
57
- this.missCount++;
58
- return null;
59
- }
60
-
61
- entry.hits++;
62
- this.cache.delete(cacheKey);
63
- this.cache.set(cacheKey, entry);
64
- this.hitCount++;
65
-
66
- return entry;
67
- }
68
-
69
- set(key: CacheKey, format: string, styles: string[]): void {
70
- if (!this.config.enabled) return;
71
-
72
- const cacheKey = this.generateKey(key);
73
-
74
- if (this.cache.size >= this.config.maxEntries) {
75
- const firstKey = this.cache.keys().next().value;
76
- if (firstKey) {
77
- this.cache.delete(firstKey);
78
- }
79
- }
80
-
81
- this.cache.set(cacheKey, {
82
- format,
83
- styles: [...styles],
84
- createdAt: Date.now(),
85
- hits: 0
86
- });
87
- }
88
-
89
- clear(): void {
90
- this.cache.clear();
91
- this.hitCount = 0;
92
- this.missCount = 0;
93
- }
94
-
95
- getStats(): {
96
- size: number;
97
- maxSize: number;
98
- hitRate: number;
99
- hits: number;
100
- misses: number;
101
- } {
102
- const total = this.hitCount + this.missCount;
103
- return {
104
- size: this.cache.size,
105
- maxSize: this.config.maxEntries,
106
- hitRate: total > 0 ? this.hitCount / total : 0,
107
- hits: this.hitCount,
108
- misses: this.missCount
109
- };
110
- }
111
-
112
- setEnabled(enabled: boolean): void {
113
- this.config.enabled = enabled;
114
- if (!enabled) {
115
- this.clear();
116
- }
117
- }
118
-
119
- isEnabled(): boolean {
120
- return this.config.enabled;
121
- }
122
- }
123
-
124
- let _styleCache: StyleCache | null = null;
125
-
126
- export function getStyleCache(): StyleCache {
127
- if (!_styleCache) {
128
- _styleCache = new StyleCache();
129
- }
130
- return _styleCache;
131
- }
@@ -1,168 +0,0 @@
1
- /**
2
- * @fileoverview Banner configurations for Advanced Logger
3
- */
4
-
5
- import type { BannerType, ThemeVariant } from '../types/index.js';
6
-
7
- /**
8
- * Banner variants for different display capabilities
9
- */
10
- export const BANNER_VARIANTS = {
11
- simple: {
12
- text: '🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀',
13
- style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;'
14
- },
15
- ascii: {
16
- text: `
17
- ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____
18
- / _ \\ / __ \\| | / / / _ \\ | \\ | |/ ____| ____| _ \\ | | / _ \\ / ____| ___| _ | _ \\
19
- / /_\\ \\ / / _\` | |/ / / /_\\ \\ | \\| | | | |__ | | | | | | / / \\ \\| | __| |_ | |_| | |_) |
20
- | _ || | (_| | < | _ | | . \` | | | __| | | | | | | | | | | | |_ | _| | /| _ <
21
- | | | |\\ \\__,_|_|\\_\\ | | | | | |\\ | |___| |____| |_| | | |__\\ \\_/ /| |__| | |___| |\\ \\| |_) |
22
- \\_| |_/ \\____/ \\_| |_/ |_| \\_|\\_____|______|____/ |_____/\\___/ \\_____|_____|_| \\_|____/
23
-
24
- Advanced Logger v2.0.0 - Console Excellence`,
25
- style: 'font-family: "Courier New", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'
26
- },
27
- unicode: {
28
- text: `
29
- ╔══════════════════════════════════════════════════════════════════════════╗
30
- ║ 🚀 ADVANCED LOGGER v2.0.0 ║
31
- ║ State-of-the-art Console Styling ║
32
- ╚══════════════════════════════════════════════════════════════════════════╝`,
33
- style: 'font-family: "Courier New", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'
34
- },
35
- svg: {
36
- text: ' ',
37
- style: `
38
- background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>🚀 ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>");
39
- background-repeat: no-repeat;
40
- background-size: 400px 80px;
41
- padding: 40px 200px;
42
- color: transparent;
43
- display: inline-block;
44
- border-radius: 8px;
45
- `
46
- },
47
- animated: {
48
- text: ' 🚀 ADVANCED LOGGER v2.0.0 ',
49
- style: `
50
- background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);
51
- background-size: 400% 400%;
52
- color: white;
53
- padding: 15px 25px;
54
- border-radius: 10px;
55
- font-weight: bold;
56
- font-size: 14px;
57
- font-family: monospace;
58
- animation: gradientShift 3s ease infinite;
59
- display: inline-block;
60
- `
61
- }
62
- };
63
-
64
- /**
65
- * Theme-specific banners for enhanced visual theming
66
- */
67
- export const THEME_BANNERS: Record<ThemeVariant, { simple: string; style: string }> = {
68
- default: {
69
- simple: '🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀',
70
- style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;'
71
- },
72
- dark: {
73
- simple: '🌙 ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence 🌙',
74
- style: 'background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;'
75
- },
76
- neon: {
77
- simple: '⚡ ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience ⚡',
78
- style: 'background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;'
79
- },
80
- minimal: {
81
- simple: 'ADVANCED LOGGER v2.0.0 - Clean Console Styling',
82
- style: 'background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;'
83
- },
84
- light: {
85
- simple: '☀️ ADVANCED LOGGER v2.0.0 - Bright Console Styling ☀️',
86
- style: 'background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;'
87
- },
88
- cyberpunk: {
89
- simple: '🤖 ADVANCED LOGGER v2.0.0 - Neural Console Interface 🤖',
90
- style: 'background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;'
91
- }
92
- };
93
-
94
- /**
95
- * Feature detection for banner capabilities
96
- */
97
- export function detectBannerCapabilities(): BannerType {
98
- // Try to detect browser capabilities
99
- const userAgent = navigator.userAgent;
100
- const isChrome = /Chrome/.test(userAgent);
101
- const isFirefox = /Firefox/.test(userAgent);
102
- const isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);
103
-
104
- // Check for SVG support (most modern browsers)
105
- const supportsSVG = !!document.createElementNS &&
106
- !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
107
-
108
- // Check for CSS animation support
109
- const supportsAnimations = typeof document !== 'undefined' &&
110
- 'animationName' in document.createElement('div').style;
111
-
112
- // Progressive enhancement
113
- if (supportsAnimations && isChrome) {
114
- return 'animated';
115
- } else if (supportsSVG && (isChrome || isFirefox)) {
116
- return 'svg';
117
- } else if (isChrome || isFirefox) {
118
- return 'unicode';
119
- } else if (isSafari) {
120
- return 'ascii';
121
- }
122
-
123
- return 'simple';
124
- }
125
-
126
- /**
127
- * Display initialization banner with advanced styling
128
- */
129
- export function displayInitBanner(bannerType?: BannerType): void {
130
- const selectedType = bannerType || detectBannerCapabilities();
131
- const banner = BANNER_VARIANTS[selectedType];
132
-
133
- // Add CSS animation keyframes if needed
134
- if (selectedType === 'animated') {
135
- const style = document.createElement('style');
136
- style.textContent = `
137
- @keyframes gradientShift {
138
- 0% { background-position: 0% 50%; }
139
- 50% { background-position: 100% 50%; }
140
- 100% { background-position: 0% 50%; }
141
- }
142
- `;
143
- document.head.appendChild(style);
144
- }
145
-
146
- console.log(`%c${banner.text}`, banner.style);
147
-
148
- // Show feature highlights
149
- const features = [
150
- '🎨 Advanced CSS Console Styling',
151
- '📍 Automatic Stack Trace Parsing',
152
- '🔧 Scoped Loggers & Prefixes',
153
- '⚡ Performance Timers',
154
- '🎯 Verbosity Filtering',
155
- '🔌 Extensible Handlers',
156
- '📱 Modern TypeScript Patterns',
157
- '📤 Export & Clipboard Support'
158
- ];
159
-
160
- console.group(`%c✨ Features`, 'background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;');
161
-
162
- features.forEach(feature => {
163
- console.log(`%c${feature}`, 'color: #6c757d; font-size: 13px;');
164
- });
165
-
166
- console.groupEnd();
167
- console.log(''); // Add spacing
168
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * @fileoverview Styling system exports for Advanced Logger
3
- */
4
-
5
- export { StyleBuilder, $, StylePresets } from './StyleBuilder.js';
6
- export { THEME_PRESETS } from './themes.js';
7
- export {
8
- BANNER_VARIANTS,
9
- THEME_BANNERS,
10
- detectBannerCapabilities,
11
- displayInitBanner
12
- } from './banners.js';
13
- export {
14
- TimestampStyler,
15
- LevelStyler,
16
- PrefixStyler,
17
- MessageStyler,
18
- LocationStyler
19
- } from './SemanticStyles.js';
20
- export { LogStyleBuilder, createLogStyleBuilder } from './LogStyleBuilder.js';
21
- export {
22
- SMART_PRESETS,
23
- getSmartPreset,
24
- getAvailablePresets,
25
- hasPreset,
26
- PRESET_DESCRIPTIONS
27
- } from './SmartPresets.js';