@mks2508/better-logger 0.14.0-alpha.2 → 0.18.2-alpha.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.
- package/README.md +50 -244
- package/dist/Logger.d.ts +662 -202
- package/dist/Logger.d.ts.map +1 -1
- package/dist/ScopedLogger.d.ts +434 -175
- package/dist/ScopedLogger.d.ts.map +1 -1
- package/dist/chunks/HookBridge-C-AvXmPD.cjs +504 -0
- package/dist/chunks/HookBridge-C-AvXmPD.cjs.map +1 -0
- package/dist/chunks/HookBridge-CI2PH79S.js +487 -0
- package/dist/chunks/HookBridge-CI2PH79S.js.map +1 -0
- package/dist/chunks/LogContext-BaMXleWj.cjs +105 -0
- package/dist/chunks/LogContext-BaMXleWj.cjs.map +1 -0
- package/dist/chunks/LogContext-DjlITOzZ.js +100 -0
- package/dist/chunks/LogContext-DjlITOzZ.js.map +1 -0
- package/dist/chunks/SerializerBridge-Ba43Mk7j.js +393 -0
- package/dist/chunks/SerializerBridge-Ba43Mk7j.js.map +1 -0
- package/dist/chunks/SerializerBridge-C4a9Z37F.cjs +410 -0
- package/dist/chunks/SerializerBridge-C4a9Z37F.cjs.map +1 -0
- package/dist/chunks/StyleManager-DQ6UNRB-.cjs +118 -0
- package/dist/chunks/StyleManager-DQ6UNRB-.cjs.map +1 -0
- package/dist/chunks/StyleManager-DjwAYbxE.js +113 -0
- package/dist/chunks/StyleManager-DjwAYbxE.js.map +1 -0
- package/dist/chunks/core-Blfi2klP.js +31 -0
- package/dist/chunks/core-Blfi2klP.js.map +1 -0
- package/dist/chunks/core-CqS_UBzJ.cjs +36 -0
- package/dist/chunks/core-CqS_UBzJ.cjs.map +1 -0
- package/dist/chunks/environment-detector-7NvnYUfr.js +110 -0
- package/dist/chunks/environment-detector-7NvnYUfr.js.map +1 -0
- package/dist/chunks/environment-detector-D-tHkKWA.cjs +163 -0
- package/dist/chunks/environment-detector-D-tHkKWA.cjs.map +1 -0
- package/dist/chunks/server-fallback-CaCPjWby.cjs +119 -0
- package/dist/chunks/server-fallback-CaCPjWby.cjs.map +1 -0
- package/dist/chunks/server-fallback-jj0T6XaK.js +114 -0
- package/dist/chunks/server-fallback-jj0T6XaK.js.map +1 -0
- package/dist/chunks/spinner-BHyYEXsM.cjs +1029 -0
- package/dist/chunks/spinner-BHyYEXsM.cjs.map +1 -0
- package/dist/chunks/spinner-BtkwpzYv.js +982 -0
- package/dist/chunks/spinner-BtkwpzYv.js.map +1 -0
- package/dist/chunks/styling-CRw3KQW4.js +1592 -0
- package/dist/chunks/styling-CRw3KQW4.js.map +1 -0
- package/dist/chunks/styling-Cel2wPRy.cjs +1645 -0
- package/dist/chunks/styling-Cel2wPRy.cjs.map +1 -0
- package/dist/chunks/transports-BGfwwakw.js +1237 -0
- package/dist/chunks/transports-BGfwwakw.js.map +1 -0
- package/dist/chunks/transports-yK6CL0Ml.cjs +1278 -0
- package/dist/chunks/transports-yK6CL0Ml.cjs.map +1 -0
- package/dist/chunks/utils-W_cxqriN.cjs +705 -0
- package/dist/chunks/utils-W_cxqriN.cjs.map +1 -0
- package/dist/chunks/utils-tKfBAWUM.js +586 -0
- package/dist/chunks/utils-tKfBAWUM.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +166 -19
- package/dist/cli/CommandProcessor.d.ts.map +1 -1
- package/dist/cli/commands/ConfigCommand.d.ts +36 -1
- package/dist/cli/commands/ConfigCommand.d.ts.map +1 -1
- package/dist/cli/commands/ExportCommand.d.ts +54 -26
- package/dist/cli/commands/ExportCommand.d.ts.map +1 -1
- package/dist/cli/commands/ThemeCommand.d.ts +62 -3
- package/dist/cli/commands/ThemeCommand.d.ts.map +1 -1
- package/dist/cli/help.d.ts +30 -2
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/index.d.ts +30 -4
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli-module.d.ts +13 -0
- package/dist/cli-module.d.ts.map +1 -0
- package/dist/cli.cjs +11 -0
- package/dist/cli.js +3 -0
- package/dist/constants.d.ts +16 -47
- package/dist/constants.d.ts.map +1 -1
- package/dist/context/LogContext.d.ts +245 -0
- package/dist/context/LogContext.d.ts.map +1 -0
- package/dist/context/index.d.ts +6 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context-module.d.ts +6 -0
- package/dist/context-module.d.ts.map +1 -0
- package/dist/context.cjs +3 -0
- package/dist/context.js +2 -0
- package/dist/core.cjs +304 -2
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +56 -34
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +281 -314
- package/dist/core.js.map +1 -1
- package/dist/hooks/HookBridge.d.ts +32 -0
- package/dist/hooks/HookBridge.d.ts.map +1 -0
- package/dist/hooks/HookManager.d.ts +319 -0
- package/dist/hooks/HookManager.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks-module.d.ts +7 -0
- package/dist/hooks-module.d.ts.map +1 -0
- package/dist/hooks.cjs +5 -0
- package/dist/hooks.js +2 -0
- package/dist/index.cjs +3402 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +42 -130
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3327 -158
- package/dist/index.js.map +1 -1
- package/dist/node-module.d.ts +10 -0
- package/dist/node-module.d.ts.map +1 -0
- package/dist/node.cjs +13 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.js +12 -0
- package/dist/node.js.map +1 -0
- package/dist/playground/TerminalBridge.d.ts +53 -0
- package/dist/playground/TerminalBridge.d.ts.map +1 -0
- package/dist/playground/box.d.ts +45 -0
- package/dist/playground/box.d.ts.map +1 -0
- package/dist/playground/cli-table.d.ts +50 -0
- package/dist/playground/cli-table.d.ts.map +1 -0
- package/dist/playground/divider.d.ts +29 -0
- package/dist/playground/divider.d.ts.map +1 -0
- package/dist/playground/header.d.ts +28 -0
- package/dist/playground/header.d.ts.map +1 -0
- package/dist/playground/index.d.ts +11 -0
- package/dist/playground/index.d.ts.map +1 -0
- package/dist/playground/server-fallback.d.ts +114 -0
- package/dist/playground/server-fallback.d.ts.map +1 -0
- package/dist/playground/spinner.d.ts +197 -0
- package/dist/playground/spinner.d.ts.map +1 -0
- package/dist/playground/step.d.ts +33 -0
- package/dist/playground/step.d.ts.map +1 -0
- package/dist/playground-module.d.ts +11 -0
- package/dist/playground-module.d.ts.map +1 -0
- package/dist/playground.cjs +9 -0
- package/dist/playground.js +2 -0
- package/dist/serializers/SerializerBridge.d.ts +28 -0
- package/dist/serializers/SerializerBridge.d.ts.map +1 -0
- package/dist/serializers/SerializerRegistry.d.ts +252 -0
- package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
- package/dist/serializers/index.d.ts +7 -0
- package/dist/serializers/index.d.ts.map +1 -0
- package/dist/serializers-module.d.ts +7 -0
- package/dist/serializers-module.d.ts.map +1 -0
- package/dist/serializers.cjs +5 -0
- package/dist/serializers.js +2 -0
- package/dist/styles/StyleManager.d.ts +190 -0
- package/dist/styles/StyleManager.d.ts.map +1 -0
- package/dist/styles/index.d.ts +7 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles-module.d.ts +7 -0
- package/dist/styles-module.d.ts.map +1 -0
- package/dist/styles.cjs +7 -0
- package/dist/styles.js +3 -0
- package/dist/styling/SmartPresets.d.ts +100 -6
- package/dist/styling/SmartPresets.d.ts.map +1 -1
- package/dist/styling/StyleBuilder.d.ts +453 -32
- package/dist/styling/StyleBuilder.d.ts.map +1 -1
- package/dist/styling/banners.d.ts +85 -5
- package/dist/styling/banners.d.ts.map +1 -1
- package/dist/styling/index.d.ts +8 -3
- package/dist/styling/index.d.ts.map +1 -1
- package/dist/styling/themes.d.ts +41 -2
- package/dist/styling/themes.d.ts.map +1 -1
- package/dist/terminal/color-converter.d.ts +73 -0
- package/dist/terminal/color-converter.d.ts.map +1 -0
- package/dist/terminal/formatter.d.ts +23 -0
- package/dist/terminal/formatter.d.ts.map +1 -0
- package/dist/transports/ConsoleTransport.d.ts +104 -0
- package/dist/transports/ConsoleTransport.d.ts.map +1 -0
- package/dist/transports/FileTransport.d.ts +137 -0
- package/dist/transports/FileTransport.d.ts.map +1 -0
- package/dist/transports/HttpTransport.d.ts +180 -0
- package/dist/transports/HttpTransport.d.ts.map +1 -0
- package/dist/transports/OtlpTransport.d.ts +165 -0
- package/dist/transports/OtlpTransport.d.ts.map +1 -0
- package/dist/transports/TransportBridge.d.ts +43 -0
- package/dist/transports/TransportBridge.d.ts.map +1 -0
- package/dist/transports/TransportManager.d.ts +251 -0
- package/dist/transports/TransportManager.d.ts.map +1 -0
- package/dist/transports/index.d.ts +6 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports-module.d.ts +10 -0
- package/dist/transports-module.d.ts.map +1 -0
- package/dist/transports.cjs +7 -0
- package/dist/transports.js +2 -0
- package/dist/types/core.d.ts +295 -17
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/handlers.d.ts +0 -67
- package/dist/types/handlers.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +138 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/serializers.d.ts +97 -0
- package/dist/types/serializers.d.ts.map +1 -0
- package/dist/types/transports.d.ts +132 -0
- package/dist/types/transports.d.ts.map +1 -0
- package/dist/utils/ansi-colors.d.ts +115 -0
- package/dist/utils/ansi-colors.d.ts.map +1 -0
- package/dist/utils/environment-detector.d.ts +53 -0
- package/dist/utils/environment-detector.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +9 -8
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/output.d.ts +14 -17
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/stackTrace.d.ts +2 -2
- package/dist/utils/stackTrace.d.ts.map +1 -1
- package/dist/utils/timestamps.d.ts +0 -12
- package/dist/utils/timestamps.d.ts.map +1 -1
- package/package.json +95 -21
- package/.claude/settings.local.json +0 -39
- package/.github/workflows/ci-quality.yml +0 -357
- package/.github/workflows/docs-demo.yml +0 -119
- package/.github/workflows/releases-core.yml +0 -512
- package/.github/workflows/releases-full.yml +0 -582
- package/.github/workflows-backup/ci.yml +0 -221
- package/.github/workflows-backup/nightly.yml +0 -196
- package/.github/workflows-backup/release-optimized.yml +0 -373
- package/.github/workflows-backup/release.yml +0 -269
- package/.release-notes-0.2.0.md +0 -129
- package/.yamllint +0 -28
- package/CHANGELOG.json +0 -865
- package/CLAUDE.md +0 -204
- package/bun.lock +0 -323
- package/demo.html +0 -847
- package/dist/.tsbuildinfo +0 -1
- package/dist/Logger.js +0 -1124
- package/dist/ScopedLogger.js +0 -426
- package/dist/chunks/Logger-Crw1woqR.js +0 -3464
- package/dist/chunks/Logger-Crw1woqR.js.map +0 -1
- package/dist/chunks/Logger-D_p3xnbq.js +0 -2
- package/dist/chunks/Logger-D_p3xnbq.js.map +0 -1
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +0 -33
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +0 -1
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +0 -2
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +0 -1
- package/dist/chunks/environment-Bxbnw4pd.js +0 -544
- package/dist/chunks/environment-Bxbnw4pd.js.map +0 -1
- package/dist/chunks/environment-Dm66zOML.js +0 -4
- package/dist/chunks/environment-Dm66zOML.js.map +0 -1
- package/dist/chunks/formatting-C0riPC5_.js +0 -95
- package/dist/chunks/formatting-C0riPC5_.js.map +0 -1
- package/dist/chunks/formatting-DNCAV66-.js +0 -2
- package/dist/chunks/formatting-DNCAV66-.js.map +0 -1
- package/dist/cli/CommandProcessor.js +0 -184
- package/dist/cli/commands/ConfigCommand.js +0 -88
- package/dist/cli/commands/ExportCommand.js +0 -243
- package/dist/cli/commands/HistoryCommand.d.ts +0 -50
- package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
- package/dist/cli/commands/HistoryCommand.js +0 -96
- package/dist/cli/commands/StatusCommand.d.ts +0 -33
- package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
- package/dist/cli/commands/StatusCommand.js +0 -93
- package/dist/cli/commands/ThemeCommand.js +0 -79
- package/dist/cli/help.js +0 -118
- package/dist/cli/index.js +0 -46
- package/dist/constants.js +0 -159
- package/dist/example.d.ts +0 -18
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -154
- package/dist/exports-module.d.ts +0 -203
- package/dist/exports-module.d.ts.map +0 -1
- package/dist/exports-module.js +0 -260
- package/dist/exports.cjs +0 -2
- package/dist/exports.cjs.map +0 -1
- package/dist/exports.js +0 -238
- package/dist/exports.js.map +0 -1
- package/dist/handlers/AnalyticsLogHandler.d.ts +0 -11
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
- package/dist/handlers/AnalyticsLogHandler.js +0 -19
- package/dist/handlers/ExportLogHandler.d.ts +0 -103
- package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
- package/dist/handlers/ExportLogHandler.js +0 -516
- package/dist/handlers/FileLogHandler.d.ts +0 -36
- package/dist/handlers/FileLogHandler.d.ts.map +0 -1
- package/dist/handlers/FileLogHandler.js +0 -156
- package/dist/handlers/RemoteLogHandler.d.ts +0 -14
- package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
- package/dist/handlers/RemoteLogHandler.js +0 -37
- package/dist/handlers/index.d.ts +0 -8
- package/dist/handlers/index.d.ts.map +0 -1
- package/dist/handlers/index.js +0 -7
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -139
- package/dist/styling/LogStyleBuilder.d.ts +0 -149
- package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
- package/dist/styling/LogStyleBuilder.js +0 -289
- package/dist/styling/SemanticStyles.d.ts +0 -181
- package/dist/styling/SemanticStyles.d.ts.map +0 -1
- package/dist/styling/SemanticStyles.js +0 -339
- package/dist/styling/SmartPresets.js +0 -276
- package/dist/styling/StyleBuilder.js +0 -280
- package/dist/styling/banners.js +0 -155
- package/dist/styling/index.js +0 -9
- package/dist/styling/themes.js +0 -231
- package/dist/styling-module.d.ts +0 -185
- package/dist/styling-module.d.ts.map +0 -1
- package/dist/styling-module.js +0 -199
- package/dist/styling.cjs +0 -2
- package/dist/styling.cjs.map +0 -1
- package/dist/styling.js +0 -146
- package/dist/styling.js.map +0 -1
- package/dist/types/Logger.d.ts +0 -700
- package/dist/types/Logger.d.ts.map +0 -1
- package/dist/types/ScopedLogger.d.ts +0 -310
- package/dist/types/ScopedLogger.d.ts.map +0 -1
- package/dist/types/cli/CommandProcessor.d.ts +0 -100
- package/dist/types/cli/CommandProcessor.d.ts.map +0 -1
- package/dist/types/cli/commands/ConfigCommand.d.ts +0 -14
- package/dist/types/cli/commands/ConfigCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/ExportCommand.d.ts +0 -48
- package/dist/types/cli/commands/ExportCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/HistoryCommand.d.ts +0 -47
- package/dist/types/cli/commands/HistoryCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/StatusCommand.d.ts +0 -30
- package/dist/types/cli/commands/StatusCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/ThemeCommand.d.ts +0 -30
- package/dist/types/cli/commands/ThemeCommand.d.ts.map +0 -1
- package/dist/types/cli/help.d.ts +0 -12
- package/dist/types/cli/help.d.ts.map +0 -1
- package/dist/types/cli/index.d.ts +0 -15
- package/dist/types/cli/index.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -119
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/core.js +0 -28
- package/dist/types/example.d.ts +0 -18
- package/dist/types/example.d.ts.map +0 -1
- package/dist/types/exports-module.d.ts +0 -196
- package/dist/types/exports-module.d.ts.map +0 -1
- package/dist/types/handlers/AnalyticsLogHandler.d.ts +0 -8
- package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/ExportLogHandler.d.ts +0 -100
- package/dist/types/handlers/ExportLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/FileLogHandler.d.ts +0 -33
- package/dist/types/handlers/FileLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/RemoteLogHandler.d.ts +0 -11
- package/dist/types/handlers/RemoteLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/index.d.ts +0 -8
- package/dist/types/handlers/index.d.ts.map +0 -1
- package/dist/types/handlers.js +0 -4
- package/dist/types/index.js +0 -4
- package/dist/types/main.d.ts +0 -2
- package/dist/types/main.d.ts.map +0 -1
- package/dist/types/styling/LogStyleBuilder.d.ts +0 -146
- package/dist/types/styling/LogStyleBuilder.d.ts.map +0 -1
- package/dist/types/styling/SemanticStyles.d.ts +0 -178
- package/dist/types/styling/SemanticStyles.d.ts.map +0 -1
- package/dist/types/styling/SmartPresets.d.ts +0 -22
- package/dist/types/styling/SmartPresets.d.ts.map +0 -1
- package/dist/types/styling/StyleBuilder.d.ts +0 -140
- package/dist/types/styling/StyleBuilder.d.ts.map +0 -1
- package/dist/types/styling/banners.d.ts +0 -42
- package/dist/types/styling/banners.d.ts.map +0 -1
- package/dist/types/styling/index.d.ts +0 -10
- package/dist/types/styling/index.d.ts.map +0 -1
- package/dist/types/styling/themes.d.ts +0 -7
- package/dist/types/styling/themes.d.ts.map +0 -1
- package/dist/types/styling-module.d.ts +0 -178
- package/dist/types/styling-module.d.ts.map +0 -1
- package/dist/types/types/core.d.ts +0 -221
- package/dist/types/types/core.d.ts.map +0 -1
- package/dist/types/types/handlers.d.ts +0 -85
- package/dist/types/types/handlers.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -7
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/environment.d.ts +0 -47
- package/dist/types/utils/environment.d.ts.map +0 -1
- package/dist/types/utils/formatting.d.ts +0 -37
- package/dist/types/utils/formatting.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -7
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/opentui-detection.d.ts +0 -34
- package/dist/types/utils/opentui-detection.d.ts.map +0 -1
- package/dist/types/utils/output.d.ts +0 -41
- package/dist/types/utils/output.d.ts.map +0 -1
- package/dist/types/utils/stackTrace.d.ts +0 -6
- package/dist/types/utils/stackTrace.d.ts.map +0 -1
- package/dist/types/utils/timestamps.d.ts +0 -20
- package/dist/types/utils/timestamps.d.ts.map +0 -1
- package/dist/utils/environment.d.ts +0 -47
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/environment.js +0 -85
- package/dist/utils/formatting.js +0 -117
- package/dist/utils/index.js +0 -6
- package/dist/utils/opentui-detection.d.ts +0 -34
- package/dist/utils/opentui-detection.d.ts.map +0 -1
- package/dist/utils/opentui-detection.js +0 -116
- package/dist/utils/output.js +0 -150
- package/dist/utils/stackTrace.js +0 -81
- package/dist/utils/timestamps.js +0 -71
- package/dist/vite.svg +0 -1
- package/docs/API.md +0 -691
- package/docs/CORE.md +0 -264
- package/docs/DEVELOPMENT.md +0 -731
- package/docs/EXPORTS.md +0 -467
- package/docs/PACKAGES.md +0 -244
- package/docs/STYLING.md +0 -405
- package/docs/_config.yml +0 -36
- package/docs/index.md +0 -179
- package/examples/README.md +0 -208
- package/examples/basic-logging.js +0 -75
- package/examples/data-export.js +0 -234
- package/examples/package.json +0 -16
- package/examples/performance-timing.js +0 -170
- package/examples/simplified-api.js +0 -124
- package/examples/styling-themes.js +0 -207
- package/index.html +0 -358
- package/packages/core/package.json +0 -57
- package/packages/exports/package.json +0 -41
- package/packages/nodejs-opentui/README.md +0 -232
- package/packages/nodejs-opentui/package.json +0 -72
- package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
- package/packages/nodejs-opentui/src/index.ts +0 -133
- package/packages/nodejs-opentui/src/types.ts +0 -158
- package/packages/nodejs-opentui/tsconfig.json +0 -20
- package/packages/styling/package.json +0 -41
- package/project-utils/README.md +0 -172
- package/project-utils/auto-release-gemini.ts +0 -1193
- package/project-utils/auto-release-ui.ts +0 -1329
- package/project-utils/commit-generator.ts +0 -1385
- package/project-utils/commit-ui.ts +0 -264
- package/project-utils/git-utils.ts +0 -199
- package/project-utils/github-release-manager.ts +0 -466
- package/project-utils/project-config.ts +0 -260
- package/project-utils/prompt-templates.js +0 -345
- package/project-utils/prompt-templates.ts +0 -422
- package/project-utils/version-manager.ts +0 -1078
- package/public/vite.svg +0 -1
- package/src/Logger.ts +0 -1276
- package/src/ScopedLogger.ts +0 -454
- package/src/cli/CommandProcessor.ts +0 -248
- package/src/cli/commands/ConfigCommand.ts +0 -93
- package/src/cli/commands/ExportCommand.ts +0 -276
- package/src/cli/commands/HistoryCommand.ts +0 -117
- package/src/cli/commands/StatusCommand.ts +0 -112
- package/src/cli/commands/ThemeCommand.ts +0 -88
- package/src/cli/help.ts +0 -127
- package/src/cli/index.ts +0 -71
- package/src/constants.ts +0 -171
- package/src/core.ts +0 -393
- package/src/example.ts +0 -210
- package/src/exports-module.ts +0 -311
- package/src/handlers/AnalyticsLogHandler.ts +0 -22
- package/src/handlers/ExportLogHandler.ts +0 -609
- package/src/handlers/FileLogHandler.ts +0 -169
- package/src/handlers/RemoteLogHandler.ts +0 -42
- package/src/handlers/index.ts +0 -8
- package/src/index.ts +0 -209
- package/src/main.ts +0 -196
- package/src/style.css +0 -96
- package/src/styling/LogStyleBuilder.ts +0 -355
- package/src/styling/SemanticStyles.ts +0 -380
- package/src/styling/SmartPresets.ts +0 -288
- package/src/styling/StyleBuilder.ts +0 -319
- package/src/styling/banners.ts +0 -168
- package/src/styling/index.ts +0 -27
- package/src/styling/themes.ts +0 -235
- package/src/styling-module.ts +0 -244
- package/src/types/core.ts +0 -236
- package/src/types/handlers.ts +0 -95
- package/src/types/index.ts +0 -35
- package/src/typescript.svg +0 -1
- package/src/utils/environment.ts +0 -94
- package/src/utils/formatting.ts +0 -142
- package/src/utils/index.ts +0 -21
- package/src/utils/opentui-detection.ts +0 -138
- package/src/utils/output.ts +0 -185
- package/src/utils/stackTrace.ts +0 -95
- package/src/utils/timestamps.ts +0 -80
- package/src/vite-env.d.ts +0 -1
- package/test-core-browser.html +0 -237
- package/test-core-node.js +0 -63
- package/tests/test-conflict-resolution.ts +0 -391
- package/tests/validate-workflows.sh +0 -131
- package/tests/yaml-autofix.sh +0 -146
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -223
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview File-based log handler for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';
|
|
6
|
-
import { isNode, isBrowser } from '../utils/environment.js';
|
|
7
|
-
import { safeSerialize } from '../utils/formatting.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Universal file-based log handler for persistent logging
|
|
11
|
-
* Works in both Node.js (real files) and browser (localStorage)
|
|
12
|
-
*/
|
|
13
|
-
export class FileLogHandler implements ILogHandler {
|
|
14
|
-
private filename: string;
|
|
15
|
-
private maxSize?: number;
|
|
16
|
-
private fs?: any; // Node.js fs module
|
|
17
|
-
|
|
18
|
-
constructor(filename: string = 'app.log', maxSize?: number) {
|
|
19
|
-
this.filename = filename;
|
|
20
|
-
this.maxSize = maxSize;
|
|
21
|
-
|
|
22
|
-
// Load Node.js fs module if in Node environment
|
|
23
|
-
if (isNode) {
|
|
24
|
-
try {
|
|
25
|
-
this.fs = require('fs');
|
|
26
|
-
} catch (error) {
|
|
27
|
-
console.warn('FileLogHandler: Unable to load fs module:', error);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): void {
|
|
33
|
-
const logEntry = {
|
|
34
|
-
timestamp: metadata.timestamp,
|
|
35
|
-
level: level.toUpperCase(),
|
|
36
|
-
prefix: metadata.prefix,
|
|
37
|
-
message,
|
|
38
|
-
args: args.slice(1).map(arg => safeSerialize(arg)),
|
|
39
|
-
location: metadata.stackInfo,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const logLine = this.formatLogLine(logEntry);
|
|
43
|
-
|
|
44
|
-
if (isNode && this.fs) {
|
|
45
|
-
this.writeToFileNode(logLine);
|
|
46
|
-
} else if (isBrowser) {
|
|
47
|
-
this.writeToFileLocal(logLine);
|
|
48
|
-
} else {
|
|
49
|
-
// Fallback - just console output
|
|
50
|
-
console.log(`[FILE-LOG] ${logLine}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Format log entry as a single line for file storage
|
|
56
|
-
*/
|
|
57
|
-
private formatLogLine(entry: any): string {
|
|
58
|
-
const parts = [
|
|
59
|
-
entry.timestamp,
|
|
60
|
-
`[${entry.level}]`,
|
|
61
|
-
entry.prefix ? `[${entry.prefix}]` : '',
|
|
62
|
-
entry.message
|
|
63
|
-
].filter(Boolean);
|
|
64
|
-
|
|
65
|
-
let line = parts.join(' ');
|
|
66
|
-
|
|
67
|
-
if (entry.args && entry.args.length > 0) {
|
|
68
|
-
line += ' ' + entry.args.map((arg: any) =>
|
|
69
|
-
typeof arg === 'object' ? JSON.stringify(arg) : String(arg)
|
|
70
|
-
).join(' ');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (entry.location) {
|
|
74
|
-
line += ` (${entry.location.file}:${entry.location.line}:${entry.location.column})`;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return line;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Write to actual file in Node.js environment
|
|
82
|
-
*/
|
|
83
|
-
private writeToFileNode(logLine: string): void {
|
|
84
|
-
if (!this.fs) return;
|
|
85
|
-
|
|
86
|
-
try {
|
|
87
|
-
// Check file size if maxSize is set
|
|
88
|
-
if (this.maxSize) {
|
|
89
|
-
try {
|
|
90
|
-
const stats = this.fs.statSync(this.filename);
|
|
91
|
-
if (stats.size > this.maxSize) {
|
|
92
|
-
// Simple rotation: backup current file and start fresh
|
|
93
|
-
const backupName = `${this.filename}.bak`;
|
|
94
|
-
this.fs.renameSync(this.filename, backupName);
|
|
95
|
-
}
|
|
96
|
-
} catch (error) {
|
|
97
|
-
// File doesn't exist yet, that's fine
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Append to file
|
|
102
|
-
this.fs.appendFileSync(this.filename, logLine + '\n', 'utf8');
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.error('FileLogHandler: Failed to write to file:', error);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Write to localStorage in browser environment
|
|
110
|
-
*/
|
|
111
|
-
private writeToFileLocal(logLine: string): void {
|
|
112
|
-
try {
|
|
113
|
-
const storageKey = `logger_${this.filename}`;
|
|
114
|
-
const existingLogs = localStorage.getItem(storageKey) || '';
|
|
115
|
-
|
|
116
|
-
let newLogs = existingLogs;
|
|
117
|
-
if (existingLogs.length > 0) {
|
|
118
|
-
newLogs += '\n';
|
|
119
|
-
}
|
|
120
|
-
newLogs += logLine;
|
|
121
|
-
|
|
122
|
-
// Simple size management - keep last 1000 lines max
|
|
123
|
-
if (this.maxSize || newLogs.split('\n').length > 1000) {
|
|
124
|
-
const lines = newLogs.split('\n');
|
|
125
|
-
const maxLines = this.maxSize ? Math.floor(this.maxSize / 100) : 1000;
|
|
126
|
-
if (lines.length > maxLines) {
|
|
127
|
-
newLogs = lines.slice(-maxLines).join('\n');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
localStorage.setItem(storageKey, newLogs);
|
|
132
|
-
} catch (error) {
|
|
133
|
-
console.error('FileLogHandler: Failed to write to localStorage:', error);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Get stored logs (useful for debugging)
|
|
139
|
-
*/
|
|
140
|
-
getLogs(): string | null {
|
|
141
|
-
if (isNode && this.fs) {
|
|
142
|
-
try {
|
|
143
|
-
return this.fs.readFileSync(this.filename, 'utf8');
|
|
144
|
-
} catch (error) {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
} else if (isBrowser) {
|
|
148
|
-
const storageKey = `logger_${this.filename}`;
|
|
149
|
-
return localStorage.getItem(storageKey);
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Clear stored logs
|
|
156
|
-
*/
|
|
157
|
-
clearLogs(): void {
|
|
158
|
-
if (isNode && this.fs) {
|
|
159
|
-
try {
|
|
160
|
-
this.fs.writeFileSync(this.filename, '', 'utf8');
|
|
161
|
-
} catch (error) {
|
|
162
|
-
console.error('FileLogHandler: Failed to clear file:', error);
|
|
163
|
-
}
|
|
164
|
-
} else if (isBrowser) {
|
|
165
|
-
const storageKey = `logger_${this.filename}`;
|
|
166
|
-
localStorage.removeItem(storageKey);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Remote log handler for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Remote log handler for sending logs to external services
|
|
9
|
-
*/
|
|
10
|
-
export class RemoteLogHandler implements ILogHandler {
|
|
11
|
-
private endpoint: string;
|
|
12
|
-
private apiKey?: string;
|
|
13
|
-
|
|
14
|
-
constructor(endpoint: string, apiKey?: string) {
|
|
15
|
-
this.endpoint = endpoint;
|
|
16
|
-
this.apiKey = apiKey;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): Promise<void> {
|
|
20
|
-
try {
|
|
21
|
-
const payload = {
|
|
22
|
-
timestamp: metadata.timestamp,
|
|
23
|
-
level,
|
|
24
|
-
message,
|
|
25
|
-
prefix: metadata.prefix,
|
|
26
|
-
location: metadata.stackInfo,
|
|
27
|
-
additional: args.slice(1),
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
await fetch(this.endpoint, {
|
|
31
|
-
method: 'POST',
|
|
32
|
-
headers: {
|
|
33
|
-
'Content-Type': 'application/json',
|
|
34
|
-
...(this.apiKey && { 'Authorization': `Bearer ${this.apiKey}` }),
|
|
35
|
-
},
|
|
36
|
-
body: JSON.stringify(payload),
|
|
37
|
-
});
|
|
38
|
-
} catch (error) {
|
|
39
|
-
// Silently fail to avoid infinite logging loops
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
package/src/handlers/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Log handlers exports for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export { FileLogHandler } from './FileLogHandler.js';
|
|
6
|
-
export { RemoteLogHandler } from './RemoteLogHandler.js';
|
|
7
|
-
export { AnalyticsLogHandler } from './AnalyticsLogHandler.js';
|
|
8
|
-
export { ExportLogHandler } from './ExportLogHandler.js';
|
package/src/index.ts
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Better Logger - Librería completa con todas las características
|
|
3
|
-
* @version 0.3.0
|
|
4
|
-
* @since 2024
|
|
5
|
-
*
|
|
6
|
-
* Punto de entrada principal que proporciona la experiencia completa de Better Logger
|
|
7
|
-
* con características avanzadas incluyendo estilos CSS, soporte SVG, animaciones,
|
|
8
|
-
* capacidades de exportación y logging remoto.
|
|
9
|
-
*
|
|
10
|
-
* @module @mks2508/better-logger
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// Main Logger class with all features
|
|
14
|
-
import { Logger } from './Logger.js';
|
|
15
|
-
import type {
|
|
16
|
-
LogLevel,
|
|
17
|
-
Verbosity,
|
|
18
|
-
ThemeVariant,
|
|
19
|
-
BannerType,
|
|
20
|
-
StyleOptions,
|
|
21
|
-
ILogHandler
|
|
22
|
-
} from './types/index.js';
|
|
23
|
-
|
|
24
|
-
// Create singleton instance with all features enabled
|
|
25
|
-
const logger = new Logger();
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Clase principal Logger con conjunto completo de características
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* // Importación y uso básico
|
|
32
|
-
* import { Logger } from '@mks2508/better-logger';
|
|
33
|
-
*
|
|
34
|
-
* const logger = new Logger();
|
|
35
|
-
* logger.preset('cyberpunk'); // Aplicar preset completo
|
|
36
|
-
* logger.info('¡Hola mundo!');
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // Logger con scope para componentes
|
|
40
|
-
* const auth = logger.component('Auth');
|
|
41
|
-
* auth.info('Usuario autenticando...');
|
|
42
|
-
* auth.success('Login exitoso');
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* // Logger para APIs con badges
|
|
46
|
-
* const api = logger.api('GraphQL');
|
|
47
|
-
* api.badges(['v2', 'cached']).info('Query ejecutada');
|
|
48
|
-
*
|
|
49
|
-
* @since 0.3.0
|
|
50
|
-
*/
|
|
51
|
-
export { Logger };
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Instancia singleton del logger lista para usar
|
|
55
|
-
* @default
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* // Uso directo sin crear instancia
|
|
59
|
-
* import logger from '@mks2508/better-logger';
|
|
60
|
-
*
|
|
61
|
-
* logger.info('Aplicación iniciada');
|
|
62
|
-
* logger.success('Conexión establecida');
|
|
63
|
-
* logger.warn('Memoria al 80%');
|
|
64
|
-
* logger.error('Fallo en conexión');
|
|
65
|
-
*/
|
|
66
|
-
export default logger;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Métodos de logging individuales (enlazados al singleton)
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* // Importar solo los métodos necesarios
|
|
73
|
-
* import { info, error, success } from '@mks2508/better-logger';
|
|
74
|
-
*
|
|
75
|
-
* info('Proceso iniciado');
|
|
76
|
-
* success('✓ Completado exitosamente');
|
|
77
|
-
* error('Error:', errorDetails);
|
|
78
|
-
*
|
|
79
|
-
* @since 0.3.0
|
|
80
|
-
*/
|
|
81
|
-
export const debug = (...args: any[]) => logger.debug(...args);
|
|
82
|
-
export const info = (...args: any[]) => logger.info(...args);
|
|
83
|
-
export const warn = (...args: any[]) => logger.warn(...args);
|
|
84
|
-
export const error = (...args: any[]) => logger.error(...args);
|
|
85
|
-
export const success = (...args: any[]) => logger.success(...args);
|
|
86
|
-
export const critical = (...args: any[]) => logger.critical(...args);
|
|
87
|
-
export const trace = (...args: any[]) => logger.trace(...args);
|
|
88
|
-
export const table = (data: any, columns?: string[]) => logger.table(data, columns);
|
|
89
|
-
export const group = (label: string, collapsed?: boolean) => logger.group(label, collapsed);
|
|
90
|
-
export const groupEnd = () => logger.groupEnd();
|
|
91
|
-
export const time = (label: string) => logger.time(label);
|
|
92
|
-
export const timeEnd = (label: string) => logger.timeEnd(label);
|
|
93
|
-
export const setGlobalPrefix = (prefix: string) => logger.setGlobalPrefix(prefix);
|
|
94
|
-
export const scope = (prefix: string) => logger.scope(prefix);
|
|
95
|
-
export const setVerbosity = (level: Verbosity) => logger.setVerbosity(level);
|
|
96
|
-
export const addHandler = (handler: ILogHandler) => logger.addHandler(handler);
|
|
97
|
-
export const setTheme = (theme: ThemeVariant) => logger.setTheme(theme);
|
|
98
|
-
export const setBannerType = (bannerType: BannerType) => logger.setBannerType(bannerType);
|
|
99
|
-
export const showBanner = (bannerType?: BannerType) => logger.showBanner(bannerType);
|
|
100
|
-
export const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) =>
|
|
101
|
-
logger.logWithSVG(message, svgContent, options);
|
|
102
|
-
export const logAnimated = (message: string, duration?: number) =>
|
|
103
|
-
logger.logAnimated(message, duration);
|
|
104
|
-
export const cli = (command: string) => logger.cli(command);
|
|
105
|
-
|
|
106
|
-
// Type exports
|
|
107
|
-
export type {
|
|
108
|
-
LogLevel,
|
|
109
|
-
Verbosity,
|
|
110
|
-
ThemeVariant,
|
|
111
|
-
BannerType,
|
|
112
|
-
StyleOptions,
|
|
113
|
-
ILogHandler,
|
|
114
|
-
LoggerConfig,
|
|
115
|
-
LogMetadata,
|
|
116
|
-
StackInfo,
|
|
117
|
-
TimerEntry
|
|
118
|
-
} from './types/index.js';
|
|
119
|
-
|
|
120
|
-
// Styling utilities
|
|
121
|
-
export {
|
|
122
|
-
StyleBuilder,
|
|
123
|
-
StylePresets,
|
|
124
|
-
THEME_PRESETS,
|
|
125
|
-
THEME_BANNERS,
|
|
126
|
-
BANNER_VARIANTS
|
|
127
|
-
} from './styling/index.js';
|
|
128
|
-
|
|
129
|
-
// Handler exports
|
|
130
|
-
export {
|
|
131
|
-
FileLogHandler,
|
|
132
|
-
RemoteLogHandler,
|
|
133
|
-
AnalyticsLogHandler
|
|
134
|
-
} from './handlers/index.js';
|
|
135
|
-
|
|
136
|
-
// Constants
|
|
137
|
-
export { DEFAULT_CONFIG } from './constants.js';
|
|
138
|
-
|
|
139
|
-
// Utility exports
|
|
140
|
-
export {
|
|
141
|
-
parseStackTrace,
|
|
142
|
-
formatTimestamp
|
|
143
|
-
} from './utils/index.js';
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Utilidades de estilo para crear estilos personalizados de consola
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* // Crear estilo personalizado
|
|
150
|
-
* import { createStyle, stylePresets } from '@mks2508/better-logger';
|
|
151
|
-
*
|
|
152
|
-
* const miEstilo = createStyle()
|
|
153
|
-
* .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
|
|
154
|
-
* .color('white')
|
|
155
|
-
* .padding('10px')
|
|
156
|
-
* .rounded('8px')
|
|
157
|
-
* .bold()
|
|
158
|
-
* .build();
|
|
159
|
-
*
|
|
160
|
-
* console.log('%cMensaje estilizado', miEstilo);
|
|
161
|
-
*
|
|
162
|
-
* @example
|
|
163
|
-
* // Usar presets predefinidos
|
|
164
|
-
* console.log('%cÉxito!', stylePresets.success);
|
|
165
|
-
* console.log('%cError!', stylePresets.error);
|
|
166
|
-
*
|
|
167
|
-
* @since 0.3.0
|
|
168
|
-
*/
|
|
169
|
-
import { StyleBuilder, StylePresets } from './styling/index.js';
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Crea una nueva instancia de StyleBuilder para estilos personalizados de consola
|
|
173
|
-
*
|
|
174
|
-
* @returns {StyleBuilder} Constructor de estilos encadenable
|
|
175
|
-
*
|
|
176
|
-
* @example
|
|
177
|
-
* const estilo = createStyle()
|
|
178
|
-
* .gradient('#667eea', '#764ba2')
|
|
179
|
-
* .color('white')
|
|
180
|
-
* .padding('8px 16px')
|
|
181
|
-
* .rounded('4px')
|
|
182
|
-
* .shadow('0 2px 4px rgba(0,0,0,0.2)')
|
|
183
|
-
* .build();
|
|
184
|
-
*
|
|
185
|
-
* @since 0.3.0
|
|
186
|
-
*/
|
|
187
|
-
export const createStyle = () => new StyleBuilder();
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Presets de estilo predefinidos para casos de uso comunes
|
|
191
|
-
*
|
|
192
|
-
* @constant {Object} stylePresets
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* console.log('%cOperación exitosa', stylePresets.success);
|
|
196
|
-
* console.log('%cAdvertencia', stylePresets.warning);
|
|
197
|
-
* console.log('%cError crítico', stylePresets.error);
|
|
198
|
-
* console.log('%cInformación', stylePresets.info);
|
|
199
|
-
* console.log('%cDestacado', stylePresets.accent);
|
|
200
|
-
*
|
|
201
|
-
* @since 0.3.0
|
|
202
|
-
*/
|
|
203
|
-
export const stylePresets = {
|
|
204
|
-
success: StylePresets.success().build(),
|
|
205
|
-
error: StylePresets.error().build(),
|
|
206
|
-
warning: StylePresets.warning().build(),
|
|
207
|
-
info: StylePresets.info().build(),
|
|
208
|
-
accent: StylePresets.accent().build(),
|
|
209
|
-
};
|
package/src/main.ts
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
debug,
|
|
3
|
-
info,
|
|
4
|
-
warn,
|
|
5
|
-
error,
|
|
6
|
-
success,
|
|
7
|
-
critical,
|
|
8
|
-
table,
|
|
9
|
-
group,
|
|
10
|
-
groupEnd,
|
|
11
|
-
time,
|
|
12
|
-
timeEnd,
|
|
13
|
-
trace,
|
|
14
|
-
scope,
|
|
15
|
-
cli,
|
|
16
|
-
setTheme,
|
|
17
|
-
setBannerType,
|
|
18
|
-
showBanner,
|
|
19
|
-
logWithSVG,
|
|
20
|
-
logAnimated,
|
|
21
|
-
createStyle,
|
|
22
|
-
stylePresets
|
|
23
|
-
} from './index.js';
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
demonstrateBanners,
|
|
27
|
-
demonstrateThemes,
|
|
28
|
-
demonstrateSVG,
|
|
29
|
-
demonstrateAnimations,
|
|
30
|
-
demonstrateCLI,
|
|
31
|
-
demonstrateExports,
|
|
32
|
-
demonstrateAllFeatures as demoAllFeatures
|
|
33
|
-
} from './example.js';
|
|
34
|
-
|
|
35
|
-
console.log('%cBetter Logger Demo Ready! 🚀',
|
|
36
|
-
'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 10px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;');
|
|
37
|
-
|
|
38
|
-
console.log('📋 Available test functions: testDebug(), testBanners(), testThemes(), and more!');
|
|
39
|
-
console.log('💻 CLI Available: cli("/help") for commands');
|
|
40
|
-
|
|
41
|
-
function testDebug() {
|
|
42
|
-
debug("This is a debug message.", { user: "test", id: 123 });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function testInfo() {
|
|
46
|
-
info("This is an info message with an object.", { data: "payload" });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function testWarn() {
|
|
50
|
-
warn("This is a warning message about a deprecated API.");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function testError() {
|
|
54
|
-
error("This is an error message.", new Error("Failed to fetch resource."));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function testSuccess() {
|
|
58
|
-
success("Operation completed successfully.");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function testCritical() {
|
|
62
|
-
critical("This is a CRITICAL message. System integrity compromised!");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function testTable() {
|
|
66
|
-
table([
|
|
67
|
-
{ feature: "Debug Log", status: "Implemented", priority: "Low" },
|
|
68
|
-
{ feature: "Info Log", status: "Implemented", priority: "Medium" },
|
|
69
|
-
{ feature: "Warning Log", status: "Implemented", priority: "High" },
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function testGrouping() {
|
|
74
|
-
group("User Authentication Flow", true); // Start collapsed
|
|
75
|
-
info("User 'testuser' attempting to log in...");
|
|
76
|
-
warn("Password nearing expiration.");
|
|
77
|
-
success("Login successful.");
|
|
78
|
-
groupEnd();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function testTiming() {
|
|
82
|
-
time("dataProcessing");
|
|
83
|
-
setTimeout(() => {
|
|
84
|
-
timeEnd("dataProcessing");
|
|
85
|
-
}, 750); // Simulate a 750ms operation
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function testScopedLogger() {
|
|
89
|
-
info("Demonstrating scoped loggers...");
|
|
90
|
-
const apiLogger = scope("API");
|
|
91
|
-
apiLogger.info("Fetching user data...");
|
|
92
|
-
const uiLogger = scope("UI");
|
|
93
|
-
uiLogger.debug("Rendering user profile component.");
|
|
94
|
-
apiLogger.success("User data fetched successfully.");
|
|
95
|
-
apiLogger.error("Failed to update settings.");
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function testTrace() {
|
|
99
|
-
function innerFunction() {
|
|
100
|
-
function deepFunction() {
|
|
101
|
-
trace("Trace from a deeply nested function.");
|
|
102
|
-
}
|
|
103
|
-
deepFunction();
|
|
104
|
-
}
|
|
105
|
-
innerFunction();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Visual feature tests
|
|
109
|
-
function testBanners() {
|
|
110
|
-
demonstrateBanners();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function testThemes() {
|
|
114
|
-
demonstrateThemes();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function testSVG() {
|
|
118
|
-
demonstrateSVG();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function testAnimations() {
|
|
122
|
-
demonstrateAnimations();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function testCLI() {
|
|
126
|
-
demonstrateCLI();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function testExports() {
|
|
130
|
-
demonstrateExports();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function testAllFeatures() {
|
|
134
|
-
group("🌟 Demonstrating Core Logger Features");
|
|
135
|
-
testDebug();
|
|
136
|
-
testInfo();
|
|
137
|
-
testWarn();
|
|
138
|
-
testError();
|
|
139
|
-
testSuccess();
|
|
140
|
-
testCritical();
|
|
141
|
-
testTable();
|
|
142
|
-
testGrouping();
|
|
143
|
-
testTiming();
|
|
144
|
-
testScopedLogger();
|
|
145
|
-
testTrace();
|
|
146
|
-
groupEnd();
|
|
147
|
-
|
|
148
|
-
setTimeout(() => {
|
|
149
|
-
info('🎨 Running visual features demo...');
|
|
150
|
-
demoAllFeatures();
|
|
151
|
-
}, 2000);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Expose functions to global scope for onclick attributes in index.html
|
|
155
|
-
if (typeof window !== 'undefined') {
|
|
156
|
-
// Core logging tests
|
|
157
|
-
(window as any).testDebug = testDebug;
|
|
158
|
-
(window as any).testInfo = testInfo;
|
|
159
|
-
(window as any).testWarn = testWarn;
|
|
160
|
-
(window as any).testError = testError;
|
|
161
|
-
(window as any).testSuccess = testSuccess;
|
|
162
|
-
(window as any).testCritical = testCritical;
|
|
163
|
-
(window as any).testTable = testTable;
|
|
164
|
-
(window as any).testGrouping = testGrouping;
|
|
165
|
-
(window as any).testTiming = testTiming;
|
|
166
|
-
(window as any).testScopedLogger = testScopedLogger;
|
|
167
|
-
(window as any).testTrace = testTrace;
|
|
168
|
-
(window as any).testAllFeatures = testAllFeatures;
|
|
169
|
-
|
|
170
|
-
// Visual feature tests
|
|
171
|
-
(window as any).testBanners = testBanners;
|
|
172
|
-
(window as any).testThemes = testThemes;
|
|
173
|
-
(window as any).testSVG = testSVG;
|
|
174
|
-
(window as any).testAnimations = testAnimations;
|
|
175
|
-
(window as any).testCLI = testCLI;
|
|
176
|
-
(window as any).testExports = testExports;
|
|
177
|
-
|
|
178
|
-
// Direct access to library functions
|
|
179
|
-
(window as any).cli = cli;
|
|
180
|
-
(window as any).setTheme = setTheme;
|
|
181
|
-
(window as any).setBannerType = setBannerType;
|
|
182
|
-
(window as any).showBanner = showBanner;
|
|
183
|
-
(window as any).logWithSVG = logWithSVG;
|
|
184
|
-
(window as any).logAnimated = logAnimated;
|
|
185
|
-
(window as any).createStyle = createStyle;
|
|
186
|
-
(window as any).stylePresets = stylePresets;
|
|
187
|
-
|
|
188
|
-
// Display welcome info
|
|
189
|
-
setTimeout(() => {
|
|
190
|
-
console.log('%c💡 Quick Start Guide', stylePresets.info);
|
|
191
|
-
console.log('🎨 Visual: testBanners(), testThemes(), testSVG(), testAnimations()');
|
|
192
|
-
console.log('📊 Core: testTable(), testGrouping(), testTiming(), testTrace()');
|
|
193
|
-
console.log('💻 CLI: cli("/help") - Try commands like "/theme neon", "/banner ascii"');
|
|
194
|
-
console.log('🌟 Full Demo: testAllFeatures()');
|
|
195
|
-
}, 1000);
|
|
196
|
-
}
|