@mks2508/better-logger 5.0.0 → 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 (162) hide show
  1. package/dist/chunks/{Logger-Cbi1f10o.js → Logger-CKqzXDh3.js} +2 -2
  2. package/dist/chunks/{Logger-Cbi1f10o.js.map → Logger-CKqzXDh3.js.map} +1 -1
  3. package/dist/chunks/{Logger-BZ7B7OXE.js → Logger-D_vuKP4l.js} +2 -2
  4. package/dist/chunks/{Logger-BZ7B7OXE.js.map → Logger-D_vuKP4l.js.map} +1 -1
  5. package/dist/chunks/cli-module-B-njrTWb.js +2 -0
  6. package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
  7. package/dist/chunks/{cli-module-ClIJmaT8.js → cli-module-Cx7qotPY.js} +16 -9
  8. package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
  9. package/dist/cli.cjs +1 -1
  10. package/dist/cli.js +1 -1
  11. package/dist/exports.cjs +1 -1
  12. package/dist/exports.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +3 -3
  15. package/dist/styling.cjs +1 -1
  16. package/dist/styling.js +2 -2
  17. package/dist/terminal/formatter.d.ts.map +1 -1
  18. package/package.json +5 -1
  19. package/.claude/settings.local.json +0 -48
  20. package/.github/workflows/ci-quality.yml +0 -357
  21. package/.github/workflows/docs-demo.yml +0 -119
  22. package/.github/workflows/releases-core.yml +0 -512
  23. package/.github/workflows/releases-full.yml +0 -582
  24. package/.github/workflows-backup/ci.yml +0 -221
  25. package/.github/workflows-backup/nightly.yml +0 -196
  26. package/.github/workflows-backup/release-optimized.yml +0 -373
  27. package/.github/workflows-backup/release.yml +0 -269
  28. package/.release-notes-0.2.0.md +0 -129
  29. package/.yamllint +0 -28
  30. package/CHANGELOG.json +0 -1076
  31. package/CHANGELOG.md +0 -209
  32. package/CLAUDE.md +0 -217
  33. package/bun.lock +0 -333
  34. package/demo.html +0 -847
  35. package/dist/chunks/cli-module-CadqgZ1Z.js +0 -2
  36. package/dist/chunks/cli-module-CadqgZ1Z.js.map +0 -1
  37. package/dist/chunks/cli-module-ClIJmaT8.js.map +0 -1
  38. package/docs/API.md +0 -918
  39. package/docs/CORE.md +0 -264
  40. package/docs/DEVELOPMENT.md +0 -731
  41. package/docs/EXPORTS.md +0 -467
  42. package/docs/PACKAGES.md +0 -244
  43. package/docs/STYLING.md +0 -405
  44. package/docs/_config.yml +0 -36
  45. package/docs/index.md +0 -179
  46. package/examples/README.md +0 -208
  47. package/examples/basic-logging.js +0 -75
  48. package/examples/data-export.js +0 -234
  49. package/examples/package.json +0 -16
  50. package/examples/performance-timing.js +0 -170
  51. package/examples/simplified-api.js +0 -124
  52. package/examples/styling-themes.js +0 -207
  53. package/index.html +0 -358
  54. package/packages/core/package.json +0 -57
  55. package/packages/exports/package.json +0 -41
  56. package/packages/nodejs-opentui/README.md +0 -232
  57. package/packages/nodejs-opentui/package.json +0 -72
  58. package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
  59. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
  60. package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
  61. package/packages/nodejs-opentui/src/index.ts +0 -133
  62. package/packages/nodejs-opentui/src/types.ts +0 -158
  63. package/packages/nodejs-opentui/tsconfig.json +0 -20
  64. package/packages/styling/package.json +0 -41
  65. package/playground/demo-all.ts +0 -95
  66. package/playground/demo-box.ts +0 -85
  67. package/playground/demo-levels.ts +0 -56
  68. package/playground/demo-real-world.ts +0 -98
  69. package/playground/demo-spinner.ts +0 -77
  70. package/playground/demo-steps.ts +0 -72
  71. package/playground/demo-table.ts +0 -83
  72. package/project-utils/README.md +0 -172
  73. package/project-utils/auto-release-gemini.ts +0 -1193
  74. package/project-utils/auto-release-ui.ts +0 -1329
  75. package/project-utils/commit-generator.ts +0 -1385
  76. package/project-utils/commit-ui.ts +0 -264
  77. package/project-utils/git-utils.ts +0 -199
  78. package/project-utils/github-release-manager.ts +0 -466
  79. package/project-utils/project-config.ts +0 -260
  80. package/project-utils/prompt-templates.js +0 -345
  81. package/project-utils/prompt-templates.ts +0 -422
  82. package/project-utils/version-manager.ts +0 -1078
  83. package/public/vite.svg +0 -1
  84. package/src/Logger.ts +0 -1858
  85. package/src/ScopedLogger.ts +0 -256
  86. package/src/cli/CommandProcessor.ts +0 -248
  87. package/src/cli/commands/ConfigCommand.ts +0 -93
  88. package/src/cli/commands/ExportCommand.ts +0 -276
  89. package/src/cli/commands/HistoryCommand.ts +0 -117
  90. package/src/cli/commands/StatusCommand.ts +0 -112
  91. package/src/cli/commands/ThemeCommand.ts +0 -88
  92. package/src/cli/help.ts +0 -127
  93. package/src/cli/index.ts +0 -71
  94. package/src/cli-module.ts +0 -21
  95. package/src/cli-primitives/box.ts +0 -86
  96. package/src/cli-primitives/cli-table.ts +0 -62
  97. package/src/cli-primitives/divider.ts +0 -17
  98. package/src/cli-primitives/header.ts +0 -18
  99. package/src/cli-primitives/index.ts +0 -13
  100. package/src/cli-primitives/server-fallback.ts +0 -54
  101. package/src/cli-primitives/spinner.ts +0 -133
  102. package/src/cli-primitives/step.ts +0 -22
  103. package/src/constants.ts +0 -313
  104. package/src/core.ts +0 -397
  105. package/src/example.ts +0 -210
  106. package/src/exports-module.ts +0 -311
  107. package/src/handlers/AnalyticsLogHandler.ts +0 -22
  108. package/src/handlers/ExportLogHandler.ts +0 -610
  109. package/src/handlers/FileLogHandler.ts +0 -169
  110. package/src/handlers/RemoteLogHandler.ts +0 -42
  111. package/src/handlers/index.ts +0 -8
  112. package/src/hooks/HookManager.ts +0 -177
  113. package/src/hooks/index.ts +0 -1
  114. package/src/index.ts +0 -395
  115. package/src/main.ts +0 -196
  116. package/src/serializers/SerializerRegistry.ts +0 -173
  117. package/src/serializers/index.ts +0 -1
  118. package/src/style.css +0 -96
  119. package/src/styling/LogStyleBuilder.ts +0 -355
  120. package/src/styling/SemanticStyles.ts +0 -380
  121. package/src/styling/SmartPresets.ts +0 -288
  122. package/src/styling/StyleBuilder.ts +0 -319
  123. package/src/styling/StyleCache.ts +0 -131
  124. package/src/styling/banners.ts +0 -168
  125. package/src/styling/index.ts +0 -27
  126. package/src/styling/themes.ts +0 -235
  127. package/src/styling-module.ts +0 -244
  128. package/src/terminal/color-converter.ts +0 -315
  129. package/src/terminal/formatter.ts +0 -236
  130. package/src/terminal/terminal-renderer.ts +0 -342
  131. package/src/transports/ConsoleTransport.ts +0 -28
  132. package/src/transports/FileTransport.ts +0 -53
  133. package/src/transports/HttpTransport.ts +0 -56
  134. package/src/transports/TransportManager.ts +0 -130
  135. package/src/transports/index.ts +0 -4
  136. package/src/types/core.ts +0 -417
  137. package/src/types/handlers.ts +0 -95
  138. package/src/types/hooks.ts +0 -45
  139. package/src/types/index.ts +0 -83
  140. package/src/types/serializers.ts +0 -30
  141. package/src/types/transports.ts +0 -52
  142. package/src/typescript.svg +0 -1
  143. package/src/utils/adapter.ts +0 -291
  144. package/src/utils/ansi-colors.ts +0 -333
  145. package/src/utils/environment-detector.ts +0 -170
  146. package/src/utils/environment.ts +0 -94
  147. package/src/utils/formatting.ts +0 -332
  148. package/src/utils/index.ts +0 -33
  149. package/src/utils/opentui-detection.ts +0 -138
  150. package/src/utils/output.ts +0 -227
  151. package/src/utils/stackTrace.ts +0 -144
  152. package/src/utils/timestamps.ts +0 -80
  153. package/src/vite-env.d.ts +0 -1
  154. package/src/writers/BufferWriter.ts +0 -157
  155. package/src/writers/index.ts +0 -6
  156. package/test-core-browser.html +0 -237
  157. package/test-core-node.js +0 -63
  158. package/tests/test-conflict-resolution.ts +0 -391
  159. package/tests/validate-workflows.sh +0 -131
  160. package/tests/yaml-autofix.sh +0 -146
  161. package/tsconfig.json +0 -50
  162. package/vite.config.ts +0 -256
@@ -1,235 +0,0 @@
1
- /**
2
- * @fileoverview Theme presets for Advanced Logger
3
- */
4
-
5
- import type { ThemeVariant } from '../types/index.js';
6
- import type { LevelStyleConfig } from '../utils/index.js';
7
-
8
- /**
9
- * Theme configurations for different visual styles
10
- */
11
- export const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>> = {
12
- default: {
13
- debug: {
14
- emoji: '🐞', label: 'DEBUG',
15
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
16
- color: '#ffffff', border: '1px solid #667eea',
17
- shadow: '0 2px 4px rgba(102, 126, 234, 0.3)',
18
- },
19
- info: {
20
- emoji: 'ℹ️', label: 'INFO',
21
- background: 'linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)',
22
- color: '#ffffff', border: '1px solid #74b9ff',
23
- shadow: '0 2px 4px rgba(116, 185, 255, 0.3)',
24
- },
25
- warn: {
26
- emoji: '⚠️', label: 'WARN',
27
- background: 'linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)',
28
- color: '#2d3436', border: '1px solid #fdcb6e',
29
- shadow: '0 2px 4px rgba(253, 203, 110, 0.3)',
30
- },
31
- error: {
32
- emoji: '❌', label: 'ERROR',
33
- background: 'linear-gradient(135deg, #e84393 0%, #d63031 100%)',
34
- color: '#ffffff', border: '1px solid #e84393',
35
- shadow: '0 2px 4px rgba(232, 67, 147, 0.3)',
36
- },
37
- success: {
38
- emoji: '✅', label: 'SUCCESS',
39
- background: 'linear-gradient(135deg, #00b894 0%, #00a085 100%)',
40
- color: '#ffffff', border: '1px solid #00b894',
41
- shadow: '0 2px 4px rgba(0, 184, 148, 0.3)',
42
- },
43
- critical: {
44
- emoji: '🔥', label: 'CRITICAL',
45
- background: 'linear-gradient(135deg, #ff3838 0%, #ff1744 100%)',
46
- color: '#ffffff', border: '2px solid #ff3838',
47
- shadow: '0 4px 8px rgba(255, 56, 56, 0.5)',
48
- },
49
- },
50
- dark: {
51
- debug: {
52
- emoji: '🌙', label: 'DEBUG',
53
- background: 'linear-gradient(135deg, #2d3748 0%, #4a5568 100%)',
54
- color: '#e2e8f0', border: '1px solid #4a5568',
55
- shadow: '0 2px 4px rgba(45, 55, 72, 0.8)',
56
- },
57
- info: {
58
- emoji: '💡', label: 'INFO',
59
- background: 'linear-gradient(135deg, #1a202c 0%, #2d3748 100%)',
60
- color: '#90cdf4', border: '1px solid #3182ce',
61
- shadow: '0 2px 4px rgba(26, 32, 44, 0.8)',
62
- },
63
- warn: {
64
- emoji: '⚡', label: 'WARN',
65
- background: 'linear-gradient(135deg, #744210 0%, #975a16 100%)',
66
- color: '#faf089', border: '1px solid #d69e2e',
67
- shadow: '0 2px 4px rgba(116, 66, 16, 0.8)',
68
- },
69
- error: {
70
- emoji: '💀', label: 'ERROR',
71
- background: 'linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)',
72
- color: '#feb2b2', border: '1px solid #e53e3e',
73
- shadow: '0 2px 4px rgba(116, 42, 42, 0.8)',
74
- },
75
- success: {
76
- emoji: '🎯', label: 'SUCCESS',
77
- background: 'linear-gradient(135deg, #276749 0%, #2f855a 100%)',
78
- color: '#9ae6b4', border: '1px solid #38a169',
79
- shadow: '0 2px 4px rgba(39, 103, 73, 0.8)',
80
- },
81
- critical: {
82
- emoji: '💥', label: 'CRITICAL',
83
- background: 'linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)',
84
- color: '#ffffff', border: '2px solid #ff0000',
85
- shadow: '0 4px 8px rgba(255, 0, 0, 0.9)',
86
- },
87
- },
88
- neon: {
89
- debug: {
90
- emoji: '⚡', label: 'DEBUG',
91
- background: 'linear-gradient(135deg, #0f3460 0%, #e94560 100%)',
92
- color: '#00ffff', border: '1px solid #00ffff',
93
- shadow: '0 0 10px rgba(0, 255, 255, 0.5)',
94
- },
95
- info: {
96
- emoji: '🔮', label: 'INFO',
97
- background: 'linear-gradient(135deg, #16213e 0%, #0f3460 100%)',
98
- color: '#00ff41', border: '1px solid #00ff41',
99
- shadow: '0 0 10px rgba(0, 255, 65, 0.5)',
100
- },
101
- warn: {
102
- emoji: '⚠️', label: 'WARN',
103
- background: 'linear-gradient(135deg, #533a03 0%, #e94560 100%)',
104
- color: '#ffff00', border: '1px solid #ffff00',
105
- shadow: '0 0 10px rgba(255, 255, 0, 0.5)',
106
- },
107
- error: {
108
- emoji: '💥', label: 'ERROR',
109
- background: 'linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)',
110
- color: '#ff073a', border: '1px solid #ff073a',
111
- shadow: '0 0 10px rgba(255, 7, 58, 0.8)',
112
- },
113
- success: {
114
- emoji: '✨', label: 'SUCCESS',
115
- background: 'linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)',
116
- color: '#39ff14', border: '1px solid #39ff14',
117
- shadow: '0 0 10px rgba(57, 255, 20, 0.8)',
118
- },
119
- critical: {
120
- emoji: '🌟', label: 'CRITICAL',
121
- background: 'linear-gradient(135deg, #000000 0%, #ff0080 100%)',
122
- color: '#ff0080', border: '2px solid #ff0080',
123
- shadow: '0 0 20px rgba(255, 0, 128, 1)',
124
- },
125
- },
126
- minimal: {
127
- debug: {
128
- emoji: '', label: 'DEBUG',
129
- background: '#f7fafc', color: '#4a5568',
130
- border: '1px solid #e2e8f0', shadow: 'none',
131
- },
132
- info: {
133
- emoji: '', label: 'INFO',
134
- background: '#ebf8ff', color: '#2b6cb0',
135
- border: '1px solid #bee3f8', shadow: 'none',
136
- },
137
- warn: {
138
- emoji: '', label: 'WARN',
139
- background: '#fffbf0', color: '#c05621',
140
- border: '1px solid #fed7aa', shadow: 'none',
141
- },
142
- error: {
143
- emoji: '', label: 'ERROR',
144
- background: '#fef5f5', color: '#c53030',
145
- border: '1px solid #fca5a5', shadow: 'none',
146
- },
147
- success: {
148
- emoji: '', label: 'SUCCESS',
149
- background: '#f0fff4', color: '#2f855a',
150
- border: '1px solid #9ae6b4', shadow: 'none',
151
- },
152
- critical: {
153
- emoji: '', label: 'CRITICAL',
154
- background: '#fef5f5', color: '#e53e3e',
155
- border: '2px solid #f56565', shadow: 'none',
156
- },
157
- },
158
- // Additional theme variants can be added here
159
- light: {
160
- debug: {
161
- emoji: '🔍', label: 'DEBUG',
162
- background: 'linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)',
163
- color: '#1565c0', border: '1px solid #90caf9',
164
- shadow: '0 1px 3px rgba(33, 150, 243, 0.2)',
165
- },
166
- info: {
167
- emoji: 'ℹ️', label: 'INFO',
168
- background: 'linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)',
169
- color: '#7b1fa2', border: '1px solid #ce93d8',
170
- shadow: '0 1px 3px rgba(156, 39, 176, 0.2)',
171
- },
172
- warn: {
173
- emoji: '⚠️', label: 'WARN',
174
- background: 'linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)',
175
- color: '#f57c00', border: '1px solid #ffcc02',
176
- shadow: '0 1px 3px rgba(255, 152, 0, 0.2)',
177
- },
178
- error: {
179
- emoji: '❌', label: 'ERROR',
180
- background: 'linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)',
181
- color: '#d32f2f', border: '1px solid #f44336',
182
- shadow: '0 1px 3px rgba(244, 67, 54, 0.2)',
183
- },
184
- success: {
185
- emoji: '✅', label: 'SUCCESS',
186
- background: 'linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)',
187
- color: '#388e3c', border: '1px solid #4caf50',
188
- shadow: '0 1px 3px rgba(76, 175, 80, 0.2)',
189
- },
190
- critical: {
191
- emoji: '🚨', label: 'CRITICAL',
192
- background: 'linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)',
193
- color: '#c2185b', border: '2px solid #e91e63',
194
- shadow: '0 2px 6px rgba(233, 30, 99, 0.3)',
195
- },
196
- },
197
- cyberpunk: {
198
- debug: {
199
- emoji: '🤖', label: 'DEBUG',
200
- background: 'linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)',
201
- color: '#00d4aa', border: '1px solid #00d4aa',
202
- shadow: '0 0 15px rgba(0, 212, 170, 0.4)',
203
- },
204
- info: {
205
- emoji: '🔗', label: 'INFO',
206
- background: 'linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)',
207
- color: '#00b4d8', border: '1px solid #00b4d8',
208
- shadow: '0 0 15px rgba(0, 180, 216, 0.4)',
209
- },
210
- warn: {
211
- emoji: '⚡', label: 'WARN',
212
- background: 'linear-gradient(135deg, #f72585 0%, #b5179e 100%)',
213
- color: '#ffff3f', border: '1px solid #ffff3f',
214
- shadow: '0 0 15px rgba(255, 255, 63, 0.4)',
215
- },
216
- error: {
217
- emoji: '💀', label: 'ERROR',
218
- background: 'linear-gradient(135deg, #7209b7 0%, #480ca8 100%)',
219
- color: '#ff006e', border: '1px solid #ff006e',
220
- shadow: '0 0 15px rgba(255, 0, 110, 0.6)',
221
- },
222
- success: {
223
- emoji: '⚡', label: 'SUCCESS',
224
- background: 'linear-gradient(135deg, #003566 0%, #001d3d 100%)',
225
- color: '#00f5ff', border: '1px solid #00f5ff',
226
- shadow: '0 0 15px rgba(0, 245, 255, 0.4)',
227
- },
228
- critical: {
229
- emoji: '💥', label: 'CRITICAL',
230
- background: 'linear-gradient(135deg, #000000 0%, #ff0040 100%)',
231
- color: '#ff0040', border: '2px solid #ff0040',
232
- shadow: '0 0 25px rgba(255, 0, 64, 0.8)',
233
- },
234
- },
235
- };
@@ -1,244 +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
-
9
- // Import core logger
10
- import { Logger } from './Logger.js';
11
-
12
- // Styling imports
13
- import {
14
- StyleBuilder,
15
- StylePresets,
16
- THEME_PRESETS,
17
- THEME_BANNERS,
18
- displayInitBanner,
19
- BANNER_VARIANTS
20
- } from './styling/index.js';
21
-
22
- // Types
23
- import type {
24
- ThemeVariant,
25
- BannerType,
26
- StyleOptions
27
- } from './types/index.js';
28
-
29
- /**
30
- * Enhanced Logger with advanced styling capabilities
31
- *
32
- * @example
33
- * ```typescript
34
- * import { StyledLogger } from '@mks2508/better-logger/styling';
35
- *
36
- * const logger = new StyledLogger();
37
- * logger.setTheme('neon');
38
- * logger.logAnimated('🌟 Animated message!');
39
- * logger.logWithSVG('Custom SVG Logo', svgContent);
40
- * ```
41
- */
42
- export class StyledLogger extends Logger {
43
- /**
44
- * Log with SVG background image
45
- *
46
- * @param message - The message to log
47
- * @param svgContent - SVG content as string (optional)
48
- * @param options - Styling options
49
- *
50
- * @example
51
- * ```typescript
52
- * logger.logWithSVG('My App', '<svg>...</svg>', {
53
- * width: 400,
54
- * height: 80,
55
- * padding: '40px 200px'
56
- * });
57
- * ```
58
- */
59
- logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {
60
- super.logWithSVG(message, svgContent, options);
61
- }
62
-
63
- /**
64
- * Log with animated background gradient
65
- *
66
- * @param message - The message to log
67
- * @param duration - Animation duration in seconds
68
- *
69
- * @example
70
- * ```typescript
71
- * logger.logAnimated('🚀 Loading...', 2);
72
- * ```
73
- */
74
- logAnimated(message: string, duration: number = 3): void {
75
- super.logAnimated(message, duration);
76
- }
77
-
78
- /**
79
- * Display banner with specified type
80
- *
81
- * @param bannerType - Type of banner to display
82
- *
83
- * @example
84
- * ```typescript
85
- * logger.showBanner('animated');
86
- * ```
87
- */
88
- showBanner(bannerType?: BannerType): void {
89
- super.showBanner(bannerType);
90
- }
91
-
92
- /**
93
- * Set banner type for initialization display
94
- *
95
- * @param bannerType - Type of banner to display
96
- *
97
- * @example
98
- * ```typescript
99
- * logger.setBannerType('svg');
100
- * ```
101
- */
102
- setBannerType(bannerType: BannerType): void {
103
- super.setBannerType(bannerType);
104
- }
105
-
106
- /**
107
- * Sets the logger theme with visual banner
108
- *
109
- * @param theme - Theme variant to apply
110
- *
111
- * @example
112
- * ```typescript
113
- * logger.setTheme('cyberpunk'); // Shows themed banner
114
- * ```
115
- */
116
- setTheme(theme: ThemeVariant): void {
117
- super.setTheme(theme);
118
- }
119
- }
120
-
121
- // Create singleton instance
122
- const styledLogger = new StyledLogger();
123
-
124
- /**
125
- * Utility functions for creating custom styles
126
- *
127
- * @example
128
- * ```typescript
129
- * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';
130
- *
131
- * const myStyle = createStyle()
132
- * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
133
- * .color('white')
134
- * .padding('10px')
135
- * .build();
136
- *
137
- * console.log('%cCustom Message', myStyle);
138
- * ```
139
- */
140
- export const createStyle = () => new StyleBuilder();
141
-
142
- /**
143
- * Pre-built style presets
144
- *
145
- * @example
146
- * ```typescript
147
- * import { stylePresets } from '@mks2508/better-logger/styling';
148
- *
149
- * console.log('%cSuccess!', stylePresets.success);
150
- * console.log('%cError!', stylePresets.error);
151
- * ```
152
- */
153
- export const stylePresets = {
154
- success: StylePresets.success().build(),
155
- error: StylePresets.error().build(),
156
- warning: StylePresets.warning().build(),
157
- info: StylePresets.info().build(),
158
- accent: StylePresets.accent().build(),
159
- };
160
-
161
- /**
162
- * Available themes for the logger
163
- *
164
- * @example
165
- * ```typescript
166
- * import { themes } from '@mks2508/better-logger/styling';
167
- *
168
- * console.log('Available themes:', Object.keys(themes));
169
- * ```
170
- */
171
- export const themes = Object.keys(THEME_PRESETS);
172
-
173
- /**
174
- * Available banner types
175
- *
176
- * @example
177
- * ```typescript
178
- * import { bannerTypes } from '@mks2508/better-logger/styling';
179
- *
180
- * console.log('Available banners:', bannerTypes);
181
- * ```
182
- */
183
- export const bannerTypes = Object.keys(BANNER_VARIANTS);
184
-
185
- /**
186
- * Display initialization banner
187
- *
188
- * @param bannerType - Type of banner to display
189
- *
190
- * @example
191
- * ```typescript
192
- * import { showInitBanner } from '@mks2508/better-logger/styling';
193
- *
194
- * showInitBanner('animated');
195
- * ```
196
- */
197
- export const showInitBanner = (bannerType?: BannerType) => {
198
- displayInitBanner(bannerType);
199
- };
200
-
201
- /**
202
- * Export individual styled logging methods
203
- */
204
- export const debug = (...args: any[]) => styledLogger.debug(...args);
205
- export const info = (...args: any[]) => styledLogger.info(...args);
206
- export const warn = (...args: any[]) => styledLogger.warn(...args);
207
- export const error = (...args: any[]) => styledLogger.error(...args);
208
- export const success = (...args: any[]) => styledLogger.success(...args);
209
- export const critical = (...args: any[]) => styledLogger.critical(...args);
210
- export const trace = (...args: any[]) => styledLogger.trace(...args);
211
- export const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);
212
- export const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);
213
- export const groupEnd = () => styledLogger.groupEnd();
214
- export const time = (label: string) => styledLogger.time(label);
215
- export const timeEnd = (label: string) => styledLogger.timeEnd(label);
216
- export const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);
217
- export const scope = (prefix: string) => styledLogger.scope(prefix);
218
- export const setVerbosity = (level: any) => styledLogger.setVerbosity(level);
219
- export const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);
220
- export const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);
221
- export const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);
222
- export const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) =>
223
- styledLogger.logWithSVG(message, svgContent, options);
224
- export const logAnimated = (message: string, duration?: number) =>
225
- styledLogger.logAnimated(message, duration);
226
-
227
- // Export the singleton as default
228
- export default styledLogger;
229
-
230
- // Re-export styling utilities
231
- export {
232
- StyleBuilder,
233
- StylePresets,
234
- THEME_PRESETS,
235
- THEME_BANNERS,
236
- BANNER_VARIANTS
237
- } from './styling/index.js';
238
-
239
- // Re-export types
240
- export type {
241
- ThemeVariant,
242
- BannerType,
243
- StyleOptions
244
- } from './types/index.js';