@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
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
const require_styling = require("./styling-Cel2wPRy.cjs");
|
|
2
|
+
const require_environment_detector = require("./environment-detector-D-tHkKWA.cjs");
|
|
3
|
+
//#region src/utils/stackTrace.ts
|
|
4
|
+
/**
|
|
5
|
+
* Comprueba si un nombre de archivo corresponde a un archivo minificado/bundle
|
|
6
|
+
*/
|
|
7
|
+
function isMinifiedFile(filename) {
|
|
8
|
+
return [
|
|
9
|
+
/\.min\.js$/,
|
|
10
|
+
/\.bundle\.js$/,
|
|
11
|
+
/\.chunk\.js$/,
|
|
12
|
+
/-[\w\d]{8,}\.js$/,
|
|
13
|
+
/Logger-[A-Za-z0-9]+\.js$/,
|
|
14
|
+
/node_modules/,
|
|
15
|
+
/dist\//,
|
|
16
|
+
/build\//,
|
|
17
|
+
/\.mjs$/
|
|
18
|
+
].some((pattern) => pattern.test(filename));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extrae un nombre de archivo limpio a partir de la ruta completa
|
|
22
|
+
*/
|
|
23
|
+
function extractCleanFilename(fullPath) {
|
|
24
|
+
return (fullPath.split(/[/\\]/).pop() || fullPath).replace(/\.min\.js$/, ".js").replace(/\.bundle\.js$/, ".js").replace(/\.chunk\.js$/, ".js").replace(/-[\w\d]{8,}\.js$/, ".js").replace(/Logger-[A-Za-z0-9]+\.js$/, "logger.ts");
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parsea el stack trace actual para extraer la información del caller
|
|
28
|
+
*/
|
|
29
|
+
function parseStackTrace() {
|
|
30
|
+
try {
|
|
31
|
+
const stack = (/* @__PURE__ */ new Error()).stack;
|
|
32
|
+
if (!stack) return null;
|
|
33
|
+
const lines = stack.split("\n").filter((line) => line.trim());
|
|
34
|
+
for (let i = 1; i < lines.length; i++) {
|
|
35
|
+
const line = lines[i];
|
|
36
|
+
if (!line) continue;
|
|
37
|
+
if (line.includes("parseStackTrace") || line.includes("Logger.") || line.includes(".log(") || line.includes("createStyledOutput")) continue;
|
|
38
|
+
let match;
|
|
39
|
+
const chromeMatch = line.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);
|
|
40
|
+
if (chromeMatch) {
|
|
41
|
+
const filename = chromeMatch[2];
|
|
42
|
+
if (filename && isMinifiedFile(filename)) continue;
|
|
43
|
+
match = chromeMatch;
|
|
44
|
+
} else {
|
|
45
|
+
const firefoxMatch = line.match(/(.+?)@(.+?):(\d+):(\d+)$/);
|
|
46
|
+
if (firefoxMatch) {
|
|
47
|
+
const filename = firefoxMatch[2];
|
|
48
|
+
if (filename && isMinifiedFile(filename)) continue;
|
|
49
|
+
match = firefoxMatch;
|
|
50
|
+
} else {
|
|
51
|
+
const safariMatch = line.match(/(\S+)?@(.+?):(\d+):(\d+)$/);
|
|
52
|
+
if (safariMatch) {
|
|
53
|
+
const filename = safariMatch[2];
|
|
54
|
+
if (filename && isMinifiedFile(filename)) continue;
|
|
55
|
+
match = safariMatch;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!match) continue;
|
|
60
|
+
const [, functionName, file, lineStr, columnStr] = match;
|
|
61
|
+
if (!file) continue;
|
|
62
|
+
const cleanFileName = extractCleanFilename(file).split("?")[0];
|
|
63
|
+
if (!cleanFileName) continue;
|
|
64
|
+
const lineNum = lineStr ? parseInt(lineStr, 10) : 0;
|
|
65
|
+
const columnNum = columnStr ? parseInt(columnStr, 10) : 0;
|
|
66
|
+
const cleanFunction = functionName && functionName.trim() ? functionName.trim() : void 0;
|
|
67
|
+
return {
|
|
68
|
+
file: cleanFileName ? cleanFileName : "unknown",
|
|
69
|
+
line: lineNum,
|
|
70
|
+
column: columnNum,
|
|
71
|
+
function: cleanFunction
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
} catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/utils/timestamps.ts
|
|
81
|
+
/**
|
|
82
|
+
* @fileoverview Timestamp utilities for Advanced Logger
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* Formats the timestamp using modern Date API
|
|
86
|
+
*/
|
|
87
|
+
function formatTimestamp() {
|
|
88
|
+
try {
|
|
89
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
90
|
+
} catch {
|
|
91
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/constants.ts
|
|
96
|
+
/**
|
|
97
|
+
* Default configuration values
|
|
98
|
+
*/
|
|
99
|
+
const DEFAULT_CONFIG = {
|
|
100
|
+
verbosity: "info",
|
|
101
|
+
enableColors: true,
|
|
102
|
+
enableTimestamps: true,
|
|
103
|
+
enableStackTrace: true,
|
|
104
|
+
theme: "default",
|
|
105
|
+
bannerType: "simple",
|
|
106
|
+
bufferSize: 1e3,
|
|
107
|
+
autoDetectTheme: true,
|
|
108
|
+
outputFormat: "auto"
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Basic level styles for core module (minimal CSS styling)
|
|
112
|
+
*/
|
|
113
|
+
const LEVEL_STYLES = {
|
|
114
|
+
trace: {
|
|
115
|
+
emoji: "🔬",
|
|
116
|
+
label: "TRACE",
|
|
117
|
+
background: "linear-gradient(90deg, #495057, #343a40)",
|
|
118
|
+
color: "#dee2e6",
|
|
119
|
+
border: "1px solid #495057",
|
|
120
|
+
shadow: "0 1px 2px rgba(73, 80, 87, 0.3)"
|
|
121
|
+
},
|
|
122
|
+
debug: {
|
|
123
|
+
emoji: "🔍",
|
|
124
|
+
label: "DEBUG",
|
|
125
|
+
background: "linear-gradient(90deg, #6c757d, #495057)",
|
|
126
|
+
color: "#ffffff",
|
|
127
|
+
border: "1px solid #6c757d",
|
|
128
|
+
shadow: "0 2px 4px rgba(108, 117, 125, 0.3)"
|
|
129
|
+
},
|
|
130
|
+
info: {
|
|
131
|
+
emoji: "ℹ️",
|
|
132
|
+
label: "INFO",
|
|
133
|
+
background: "linear-gradient(90deg, #007bff, #0056b3)",
|
|
134
|
+
color: "#ffffff",
|
|
135
|
+
border: "1px solid #007bff",
|
|
136
|
+
shadow: "0 2px 4px rgba(0, 123, 255, 0.3)"
|
|
137
|
+
},
|
|
138
|
+
warn: {
|
|
139
|
+
emoji: "⚠️",
|
|
140
|
+
label: "WARN",
|
|
141
|
+
background: "linear-gradient(90deg, #ffc107, #e0a800)",
|
|
142
|
+
color: "#000000",
|
|
143
|
+
border: "1px solid #ffc107",
|
|
144
|
+
shadow: "0 2px 4px rgba(255, 193, 7, 0.3)"
|
|
145
|
+
},
|
|
146
|
+
error: {
|
|
147
|
+
emoji: "❌",
|
|
148
|
+
label: "ERROR",
|
|
149
|
+
background: "linear-gradient(90deg, #dc3545, #c82333)",
|
|
150
|
+
color: "#ffffff",
|
|
151
|
+
border: "1px solid #dc3545",
|
|
152
|
+
shadow: "0 2px 4px rgba(220, 53, 69, 0.3)"
|
|
153
|
+
},
|
|
154
|
+
critical: {
|
|
155
|
+
emoji: "🚨",
|
|
156
|
+
label: "CRITICAL",
|
|
157
|
+
background: "linear-gradient(90deg, #8B0000, #FF0000)",
|
|
158
|
+
color: "#ffffff",
|
|
159
|
+
border: "2px solid #FF0000",
|
|
160
|
+
shadow: "0 4px 8px rgba(255, 0, 0, 0.4)"
|
|
161
|
+
},
|
|
162
|
+
success: {
|
|
163
|
+
emoji: "✅",
|
|
164
|
+
label: "SUCCESS",
|
|
165
|
+
background: "linear-gradient(90deg, #28a745, #1e7e34)",
|
|
166
|
+
color: "#ffffff",
|
|
167
|
+
border: "1px solid #28a745",
|
|
168
|
+
shadow: "0 2px 4px rgba(40, 167, 69, 0.3)"
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Adaptive color configurations for DevTools theme compatibility
|
|
173
|
+
*/
|
|
174
|
+
const ADAPTIVE_COLORS = {
|
|
175
|
+
timestamp: {
|
|
176
|
+
light: "#666666",
|
|
177
|
+
dark: "#a0a0a0"
|
|
178
|
+
},
|
|
179
|
+
messageText: {
|
|
180
|
+
light: "#2d3748",
|
|
181
|
+
dark: "#f7fafc"
|
|
182
|
+
},
|
|
183
|
+
prefix: {
|
|
184
|
+
light: "#2d3748",
|
|
185
|
+
dark: "#e2e8f0"
|
|
186
|
+
},
|
|
187
|
+
prefixBackground: {
|
|
188
|
+
light: "#2d3748",
|
|
189
|
+
dark: "#4a5568"
|
|
190
|
+
},
|
|
191
|
+
location: {
|
|
192
|
+
light: "#718096",
|
|
193
|
+
dark: "#a0aec0"
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* CLI log level to internal verbosity mapping
|
|
198
|
+
*/
|
|
199
|
+
const CLI_LEVEL_MAP = {
|
|
200
|
+
silent: {
|
|
201
|
+
verbosity: "silent",
|
|
202
|
+
showPrimitives: false
|
|
203
|
+
},
|
|
204
|
+
quiet: {
|
|
205
|
+
verbosity: "error",
|
|
206
|
+
showPrimitives: false
|
|
207
|
+
},
|
|
208
|
+
normal: {
|
|
209
|
+
verbosity: "info",
|
|
210
|
+
showPrimitives: true
|
|
211
|
+
},
|
|
212
|
+
verbose: {
|
|
213
|
+
verbosity: "debug",
|
|
214
|
+
showPrimitives: true
|
|
215
|
+
},
|
|
216
|
+
debug: {
|
|
217
|
+
verbosity: "debug",
|
|
218
|
+
showPrimitives: true
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/utils/ansi-colors.ts
|
|
223
|
+
/**
|
|
224
|
+
* Códigos de color ANSI para estilos en terminal
|
|
225
|
+
*/
|
|
226
|
+
const ANSI_CODES = {
|
|
227
|
+
black: 30,
|
|
228
|
+
red: 31,
|
|
229
|
+
green: 32,
|
|
230
|
+
yellow: 33,
|
|
231
|
+
blue: 34,
|
|
232
|
+
magenta: 35,
|
|
233
|
+
cyan: 36,
|
|
234
|
+
white: 37,
|
|
235
|
+
brightBlack: 90,
|
|
236
|
+
brightRed: 91,
|
|
237
|
+
brightGreen: 92,
|
|
238
|
+
brightYellow: 93,
|
|
239
|
+
brightBlue: 94,
|
|
240
|
+
brightMagenta: 95,
|
|
241
|
+
brightCyan: 96,
|
|
242
|
+
brightWhite: 97,
|
|
243
|
+
bgBlack: 40,
|
|
244
|
+
bgRed: 41,
|
|
245
|
+
bgGreen: 42,
|
|
246
|
+
bgYellow: 43,
|
|
247
|
+
bgBlue: 44,
|
|
248
|
+
bgMagenta: 45,
|
|
249
|
+
bgCyan: 46,
|
|
250
|
+
bgWhite: 47,
|
|
251
|
+
bgBrightBlack: 100,
|
|
252
|
+
bgBrightRed: 101,
|
|
253
|
+
bgBrightGreen: 102,
|
|
254
|
+
bgBrightYellow: 103,
|
|
255
|
+
bgBrightBlue: 104,
|
|
256
|
+
bgBrightMagenta: 105,
|
|
257
|
+
bgBrightCyan: 106,
|
|
258
|
+
bgBrightWhite: 107,
|
|
259
|
+
reset: 0,
|
|
260
|
+
bold: 1,
|
|
261
|
+
dim: 2,
|
|
262
|
+
italic: 3,
|
|
263
|
+
underline: 4,
|
|
264
|
+
blink: 5,
|
|
265
|
+
inverse: 7,
|
|
266
|
+
hidden: 8,
|
|
267
|
+
strikethrough: 9,
|
|
268
|
+
resetBold: 22,
|
|
269
|
+
resetDim: 22,
|
|
270
|
+
resetItalic: 23,
|
|
271
|
+
resetUnderline: 24,
|
|
272
|
+
resetBlink: 25,
|
|
273
|
+
resetInverse: 27,
|
|
274
|
+
resetHidden: 28,
|
|
275
|
+
resetStrikethrough: 29
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Presets de colores ANSI para los distintos niveles de log
|
|
279
|
+
*/
|
|
280
|
+
const ANSI_LEVEL_STYLES = {
|
|
281
|
+
trace: {
|
|
282
|
+
color: ANSI_CODES.brightBlack,
|
|
283
|
+
styles: [ANSI_CODES.dim],
|
|
284
|
+
emoji: "🔬"
|
|
285
|
+
},
|
|
286
|
+
debug: {
|
|
287
|
+
color: ANSI_CODES.brightBlack,
|
|
288
|
+
styles: [ANSI_CODES.dim],
|
|
289
|
+
emoji: "🔍"
|
|
290
|
+
},
|
|
291
|
+
info: {
|
|
292
|
+
color: ANSI_CODES.blue,
|
|
293
|
+
styles: [ANSI_CODES.bold],
|
|
294
|
+
emoji: "ℹ️"
|
|
295
|
+
},
|
|
296
|
+
warn: {
|
|
297
|
+
color: ANSI_CODES.yellow,
|
|
298
|
+
background: ANSI_CODES.bgYellow,
|
|
299
|
+
styles: [ANSI_CODES.bold, ANSI_CODES.black],
|
|
300
|
+
emoji: "⚠️"
|
|
301
|
+
},
|
|
302
|
+
error: {
|
|
303
|
+
color: ANSI_CODES.red,
|
|
304
|
+
background: ANSI_CODES.bgRed,
|
|
305
|
+
styles: [ANSI_CODES.bold],
|
|
306
|
+
emoji: "❌"
|
|
307
|
+
},
|
|
308
|
+
critical: {
|
|
309
|
+
color: ANSI_CODES.white,
|
|
310
|
+
background: ANSI_CODES.bgRed,
|
|
311
|
+
styles: [ANSI_CODES.bold, ANSI_CODES.blink],
|
|
312
|
+
emoji: "🚨"
|
|
313
|
+
},
|
|
314
|
+
success: {
|
|
315
|
+
color: ANSI_CODES.green,
|
|
316
|
+
background: ANSI_CODES.bgGreen,
|
|
317
|
+
styles: [ANSI_CODES.bold],
|
|
318
|
+
emoji: "✅"
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Crea una secuencia de escape ANSI
|
|
323
|
+
*/
|
|
324
|
+
function ansi(code) {
|
|
325
|
+
return `\x1b[${(Array.isArray(code) ? code : [code]).join(";")}m`;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Aplica estilos ANSI al texto
|
|
329
|
+
*/
|
|
330
|
+
function ansiStyle(text, codes) {
|
|
331
|
+
if (!require_environment_detector.supportsANSI()) return text;
|
|
332
|
+
return `${ansi(codes)}${text}${ansi(ANSI_CODES.reset)}`;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Aplica color al texto
|
|
336
|
+
*/
|
|
337
|
+
function ansiColor(text, color) {
|
|
338
|
+
return ansiStyle(text, [color]);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Aplica color de fondo al texto
|
|
342
|
+
*/
|
|
343
|
+
function ansiBackground(text, bg, color) {
|
|
344
|
+
if (color) return ansiStyle(text, [color, bg]);
|
|
345
|
+
return ansiStyle(text, [bg]);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Pone el texto en bold
|
|
349
|
+
*/
|
|
350
|
+
function ansiBold(text) {
|
|
351
|
+
return ansiStyle(text, [ANSI_CODES.bold]);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Aplica dim al texto
|
|
355
|
+
*/
|
|
356
|
+
function ansiDim(text) {
|
|
357
|
+
return ansiStyle(text, [ANSI_CODES.dim]);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Subraya el texto
|
|
361
|
+
*/
|
|
362
|
+
function ansiUnderline(text) {
|
|
363
|
+
return ansiStyle(text, [ANSI_CODES.underline]);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Formatters especializados para distintos contextos
|
|
367
|
+
*/
|
|
368
|
+
/**
|
|
369
|
+
* Formatea el timestamp para terminal
|
|
370
|
+
*/
|
|
371
|
+
function formatTimestampANSI(timestamp) {
|
|
372
|
+
return ansiColor(timestamp, ANSI_CODES.brightBlack);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Formatea el nivel de log para terminal
|
|
376
|
+
*/
|
|
377
|
+
function formatLogLevelANSI(level, useEmojis = true) {
|
|
378
|
+
const style = ANSI_LEVEL_STYLES[level];
|
|
379
|
+
const emoji = useEmojis ? style.emoji : "";
|
|
380
|
+
const label = level.toUpperCase().padEnd(8);
|
|
381
|
+
if (!require_environment_detector.supportsANSI()) return `${emoji} ${label}`;
|
|
382
|
+
let codes = [style.color, ...style.styles];
|
|
383
|
+
if (style.background) codes.push(style.background);
|
|
384
|
+
return ansiStyle(`${emoji} ${label}`, codes);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Formatea el mensaje de success para terminal
|
|
388
|
+
*/
|
|
389
|
+
function formatSuccessANSI(message, useEmojis = true) {
|
|
390
|
+
const style = ANSI_LEVEL_STYLES.success;
|
|
391
|
+
const emoji = useEmojis ? style.emoji : "";
|
|
392
|
+
if (!require_environment_detector.supportsANSI()) return `${emoji} SUCCESS: ${message}`;
|
|
393
|
+
return `${ansiStyle(`${emoji} SUCCESS:`, [style.color, ...style.styles])} ${message}`;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Formatea el prefix para terminal
|
|
397
|
+
*/
|
|
398
|
+
function formatPrefixANSI(prefix) {
|
|
399
|
+
if (!require_environment_detector.supportsANSI()) return `[${prefix}]`;
|
|
400
|
+
return ansiStyle(`[${prefix}]`, [ANSI_CODES.cyan, ANSI_CODES.bold]);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Formatea la ubicación del archivo para terminal
|
|
404
|
+
*/
|
|
405
|
+
function formatLocationANSI(location) {
|
|
406
|
+
if (!require_environment_detector.supportsANSI()) return `(${location})`;
|
|
407
|
+
return ansiColor(`(${location})`, ANSI_CODES.brightBlack);
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/utils/output.ts
|
|
411
|
+
/**
|
|
412
|
+
* Detecta la preferencia de theme actual de DevTools
|
|
413
|
+
*/
|
|
414
|
+
function detectDevToolsTheme() {
|
|
415
|
+
try {
|
|
416
|
+
if (typeof window === "undefined" || !window.matchMedia) return "light";
|
|
417
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
418
|
+
} catch (error) {
|
|
419
|
+
console.warn("Failed to detect DevTools theme:", error);
|
|
420
|
+
return "light";
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Obtiene el color adaptativo según el theme actual de DevTools
|
|
425
|
+
*/
|
|
426
|
+
function getAdaptiveColor(colors, theme) {
|
|
427
|
+
return colors[theme ?? detectDevToolsTheme()];
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Registra un listener de cambios de theme para actualizaciones dinámicas
|
|
431
|
+
*/
|
|
432
|
+
function setupThemeChangeListener(callback) {
|
|
433
|
+
try {
|
|
434
|
+
if (typeof window === "undefined" || !window.matchMedia) return null;
|
|
435
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
436
|
+
const handler = (e) => {
|
|
437
|
+
callback(e.matches ? "dark" : "light");
|
|
438
|
+
};
|
|
439
|
+
if (mediaQuery.addEventListener) {
|
|
440
|
+
mediaQuery.addEventListener("change", handler);
|
|
441
|
+
return () => mediaQuery.removeEventListener("change", handler);
|
|
442
|
+
} else if (mediaQuery.addListener) {
|
|
443
|
+
mediaQuery.addListener(handler);
|
|
444
|
+
return () => mediaQuery.removeListener?.(handler);
|
|
445
|
+
}
|
|
446
|
+
return null;
|
|
447
|
+
} catch (error) {
|
|
448
|
+
console.warn("Failed to set up theme change listener:", error);
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Crea output estilizado para consola con múltiples formatters `%c`
|
|
454
|
+
* Se adapta automáticamente al entorno (browser o terminal)
|
|
455
|
+
*/
|
|
456
|
+
function createStyledOutput(level, levelStyles, prefix, message, stackInfo, autoDetectTheme = true, presetStyles, presetName) {
|
|
457
|
+
const levelConfig = levelStyles[level] ?? {
|
|
458
|
+
emoji: "📝",
|
|
459
|
+
label: level.toUpperCase(),
|
|
460
|
+
background: "#6c757d",
|
|
461
|
+
color: "#ffffff",
|
|
462
|
+
border: "1px solid #6c757d",
|
|
463
|
+
shadow: "none"
|
|
464
|
+
};
|
|
465
|
+
const timestamp = formatTimestamp();
|
|
466
|
+
if (require_environment_detector.getEnvironment() !== "browser" && require_environment_detector.supportsANSI()) return createTerminalOutput(level, message, timestamp, prefix, stackInfo);
|
|
467
|
+
const currentTheme = autoDetectTheme ? detectDevToolsTheme() : "light";
|
|
468
|
+
const timestampStyle = new require_styling.StyleBuilder().color(getAdaptiveColor(ADAPTIVE_COLORS.timestamp, currentTheme)).size("11px").font("Monaco, Consolas, monospace").build();
|
|
469
|
+
const levelStyle = new require_styling.StyleBuilder().bg(levelConfig.background).color(levelConfig.color).border(levelConfig.border).shadow(levelConfig.shadow).padding("2px 8px").rounded("4px").bold().font("Monaco, Consolas, monospace").size("12px").build();
|
|
470
|
+
const prefixStyle = new require_styling.StyleBuilder().bg(getAdaptiveColor(ADAPTIVE_COLORS.prefixBackground, currentTheme)).color(getAdaptiveColor(ADAPTIVE_COLORS.prefix, currentTheme)).padding("2px 6px").rounded("3px").bold().font("Monaco, Consolas, monospace").size("11px").build();
|
|
471
|
+
const messageStyle = new require_styling.StyleBuilder().color(getAdaptiveColor(ADAPTIVE_COLORS.messageText, currentTheme)).font("system-ui, -apple-system, sans-serif").size("14px").build();
|
|
472
|
+
const locationStyle = new require_styling.StyleBuilder().color(getAdaptiveColor(ADAPTIVE_COLORS.location, currentTheme)).size("11px").font("Monaco, Consolas, monospace").build();
|
|
473
|
+
let format = `%c${timestamp.slice(11, 23)} %c${levelConfig.emoji} ${levelConfig.label}`;
|
|
474
|
+
const styles = [timestampStyle, levelStyle];
|
|
475
|
+
if (prefix) {
|
|
476
|
+
format += ` %c${prefix}`;
|
|
477
|
+
styles.push(prefixStyle);
|
|
478
|
+
}
|
|
479
|
+
format += ` %c${message}`;
|
|
480
|
+
styles.push(messageStyle);
|
|
481
|
+
if (stackInfo) {
|
|
482
|
+
format += ` %c(${stackInfo.file}:${stackInfo.line}:${stackInfo.column})`;
|
|
483
|
+
styles.push(locationStyle);
|
|
484
|
+
}
|
|
485
|
+
return [format, ...styles];
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Construye una línea apta para terminal usando los helpers ANSI. Se usa
|
|
489
|
+
* cuando el runtime no es browser pero soporta códigos ANSI (TTY, terminal moderna).
|
|
490
|
+
*
|
|
491
|
+
* Layout: `[HH:MM:SS.mmm] [LEVEL] [prefix] message (file:line)`
|
|
492
|
+
*/
|
|
493
|
+
function createTerminalOutput(level, message, timestamp, prefix, stackInfo) {
|
|
494
|
+
const ts = timestamp?.slice(11, 23) ?? "";
|
|
495
|
+
const location = stackInfo ? `${stackInfo.file}:${stackInfo.line}:${stackInfo.column}` : void 0;
|
|
496
|
+
const parts = [];
|
|
497
|
+
parts.push(formatTimestampANSI(`[${ts}]`));
|
|
498
|
+
parts.push(formatLogLevelANSI(level));
|
|
499
|
+
if (prefix) parts.push(formatPrefixANSI(prefix));
|
|
500
|
+
parts.push(message);
|
|
501
|
+
if (location) parts.push(formatLocationANSI(`(${location})`));
|
|
502
|
+
return [parts.join(" ") + "\n"];
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region src/utils/formatting.ts
|
|
506
|
+
/**
|
|
507
|
+
* Crea output en texto plano para cualquier entorno
|
|
508
|
+
* Sin colores ni estilos — máxima compatibilidad
|
|
509
|
+
*/
|
|
510
|
+
function createPlainOutput(level, message, prefix, stackInfo) {
|
|
511
|
+
let output = `[${formatTimestamp().slice(11, 23)}] [${level.toUpperCase()}]`;
|
|
512
|
+
if (prefix) output += ` [${prefix}]`;
|
|
513
|
+
output += ` ${message}`;
|
|
514
|
+
if (stackInfo) output += ` (${stackInfo.file}:${stackInfo.line}:${stackInfo.column})`;
|
|
515
|
+
return output;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Obtiene el método de console adecuado para el nivel
|
|
519
|
+
* Usa distintos métodos de console para mejor semántica
|
|
520
|
+
*/
|
|
521
|
+
function getConsoleMethod(level) {
|
|
522
|
+
switch (level) {
|
|
523
|
+
case "debug": return "log";
|
|
524
|
+
case "info": return "info";
|
|
525
|
+
case "warn": return "warn";
|
|
526
|
+
case "error":
|
|
527
|
+
case "critical": return "error";
|
|
528
|
+
default: return "log";
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Crea un objeto simple de log entry para los handlers
|
|
533
|
+
*/
|
|
534
|
+
function createLogEntry(level, message, args, prefix, stackInfo) {
|
|
535
|
+
return {
|
|
536
|
+
timestamp: formatTimestamp(),
|
|
537
|
+
level: level.toUpperCase(),
|
|
538
|
+
prefix,
|
|
539
|
+
message,
|
|
540
|
+
args: args.slice(1),
|
|
541
|
+
location: stackInfo ? {
|
|
542
|
+
file: stackInfo.file,
|
|
543
|
+
line: stackInfo.line,
|
|
544
|
+
column: stackInfo.column,
|
|
545
|
+
function: stackInfo.function
|
|
546
|
+
} : void 0,
|
|
547
|
+
raw: args
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Formatea datos para visualización en tabla como texto plano
|
|
552
|
+
*/
|
|
553
|
+
function formatTablePlain(data, columns) {
|
|
554
|
+
try {
|
|
555
|
+
if (Array.isArray(data)) {
|
|
556
|
+
if (data.length === 0) return "[Empty Array]";
|
|
557
|
+
if (typeof data[0] !== "object") return data.map((item, i) => `${i}: ${item}`).join("\n");
|
|
558
|
+
const keys = columns || Object.keys(data[0] || {});
|
|
559
|
+
return [keys.join(" "), ...data.map((item) => keys.map((key) => String(item[key] || "")).join(" "))].join("\n");
|
|
560
|
+
}
|
|
561
|
+
if (typeof data === "object" && data !== null) return Object.entries(data).map(([key, value]) => `${key}: ${value}`).join("\n");
|
|
562
|
+
return String(data);
|
|
563
|
+
} catch (error) {
|
|
564
|
+
return `[Error al formatear la tabla: ${error}]`;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Serialización segura de objetos para logging
|
|
569
|
+
*/
|
|
570
|
+
function safeSerialize(obj, maxDepth = 3, currentDepth = 0) {
|
|
571
|
+
if (currentDepth >= maxDepth) return "[Max Depth Reached]";
|
|
572
|
+
if (obj === null) return null;
|
|
573
|
+
if (obj === void 0) return "[undefined]";
|
|
574
|
+
if (typeof obj === "function") return "[Function]";
|
|
575
|
+
if (obj instanceof Error) return `[Error: ${obj.message}]`;
|
|
576
|
+
if (obj instanceof Date) return obj.toISOString();
|
|
577
|
+
if (typeof obj !== "object") return obj;
|
|
578
|
+
if (Array.isArray(obj)) return obj.map((item) => safeSerialize(item, maxDepth, currentDepth + 1));
|
|
579
|
+
const result = {};
|
|
580
|
+
for (const [key, value] of Object.entries(obj)) result[key] = safeSerialize(value, maxDepth, currentDepth + 1);
|
|
581
|
+
return result;
|
|
582
|
+
}
|
|
583
|
+
//#endregion
|
|
584
|
+
Object.defineProperty(exports, "CLI_LEVEL_MAP", {
|
|
585
|
+
enumerable: true,
|
|
586
|
+
get: function() {
|
|
587
|
+
return CLI_LEVEL_MAP;
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
Object.defineProperty(exports, "DEFAULT_CONFIG", {
|
|
591
|
+
enumerable: true,
|
|
592
|
+
get: function() {
|
|
593
|
+
return DEFAULT_CONFIG;
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
Object.defineProperty(exports, "LEVEL_STYLES", {
|
|
597
|
+
enumerable: true,
|
|
598
|
+
get: function() {
|
|
599
|
+
return LEVEL_STYLES;
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
Object.defineProperty(exports, "ansiBackground", {
|
|
603
|
+
enumerable: true,
|
|
604
|
+
get: function() {
|
|
605
|
+
return ansiBackground;
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
Object.defineProperty(exports, "ansiBold", {
|
|
609
|
+
enumerable: true,
|
|
610
|
+
get: function() {
|
|
611
|
+
return ansiBold;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
Object.defineProperty(exports, "ansiColor", {
|
|
615
|
+
enumerable: true,
|
|
616
|
+
get: function() {
|
|
617
|
+
return ansiColor;
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
Object.defineProperty(exports, "ansiDim", {
|
|
621
|
+
enumerable: true,
|
|
622
|
+
get: function() {
|
|
623
|
+
return ansiDim;
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
Object.defineProperty(exports, "ansiStyle", {
|
|
627
|
+
enumerable: true,
|
|
628
|
+
get: function() {
|
|
629
|
+
return ansiStyle;
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
Object.defineProperty(exports, "ansiUnderline", {
|
|
633
|
+
enumerable: true,
|
|
634
|
+
get: function() {
|
|
635
|
+
return ansiUnderline;
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
Object.defineProperty(exports, "createLogEntry", {
|
|
639
|
+
enumerable: true,
|
|
640
|
+
get: function() {
|
|
641
|
+
return createLogEntry;
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
Object.defineProperty(exports, "createPlainOutput", {
|
|
645
|
+
enumerable: true,
|
|
646
|
+
get: function() {
|
|
647
|
+
return createPlainOutput;
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
Object.defineProperty(exports, "createStyledOutput", {
|
|
651
|
+
enumerable: true,
|
|
652
|
+
get: function() {
|
|
653
|
+
return createStyledOutput;
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
Object.defineProperty(exports, "formatLogLevelANSI", {
|
|
657
|
+
enumerable: true,
|
|
658
|
+
get: function() {
|
|
659
|
+
return formatLogLevelANSI;
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
Object.defineProperty(exports, "formatSuccessANSI", {
|
|
663
|
+
enumerable: true,
|
|
664
|
+
get: function() {
|
|
665
|
+
return formatSuccessANSI;
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
Object.defineProperty(exports, "formatTablePlain", {
|
|
669
|
+
enumerable: true,
|
|
670
|
+
get: function() {
|
|
671
|
+
return formatTablePlain;
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
Object.defineProperty(exports, "formatTimestamp", {
|
|
675
|
+
enumerable: true,
|
|
676
|
+
get: function() {
|
|
677
|
+
return formatTimestamp;
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
Object.defineProperty(exports, "getConsoleMethod", {
|
|
681
|
+
enumerable: true,
|
|
682
|
+
get: function() {
|
|
683
|
+
return getConsoleMethod;
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
Object.defineProperty(exports, "parseStackTrace", {
|
|
687
|
+
enumerable: true,
|
|
688
|
+
get: function() {
|
|
689
|
+
return parseStackTrace;
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
Object.defineProperty(exports, "safeSerialize", {
|
|
693
|
+
enumerable: true,
|
|
694
|
+
get: function() {
|
|
695
|
+
return safeSerialize;
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
Object.defineProperty(exports, "setupThemeChangeListener", {
|
|
699
|
+
enumerable: true,
|
|
700
|
+
get: function() {
|
|
701
|
+
return setupThemeChangeListener;
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
//# sourceMappingURL=utils-W_cxqriN.cjs.map
|