@mks2508/better-logger 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Logger.d.ts +976 -0
- package/dist/Logger.d.ts.map +1 -0
- package/dist/ScopedLogger.d.ts +74 -0
- package/dist/ScopedLogger.d.ts.map +1 -0
- package/dist/chunks/Logger-CKqzXDh3.js +2 -0
- package/dist/chunks/Logger-CKqzXDh3.js.map +1 -0
- package/dist/chunks/Logger-D_vuKP4l.js +4511 -0
- package/dist/chunks/Logger-D_vuKP4l.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
- package/dist/chunks/cli-module-B-njrTWb.js +2 -0
- package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
- package/dist/chunks/cli-module-Cx7qotPY.js +390 -0
- package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
- package/dist/chunks/color-converter-CCSQRztd.js +2 -0
- package/dist/chunks/color-converter-CCSQRztd.js.map +1 -0
- package/dist/chunks/color-converter-_Xdmsy7E.js +462 -0
- package/dist/chunks/color-converter-_Xdmsy7E.js.map +1 -0
- package/dist/chunks/environment-C1xxvc8l.js +1127 -0
- package/dist/chunks/environment-C1xxvc8l.js.map +1 -0
- package/dist/chunks/environment-Cprkw3g9.js +4 -0
- package/dist/chunks/environment-Cprkw3g9.js.map +1 -0
- package/dist/chunks/formatting-DMJxYq9o.js +380 -0
- package/dist/chunks/formatting-DMJxYq9o.js.map +1 -0
- package/dist/chunks/formatting-DpKxCsXq.js +2 -0
- package/dist/chunks/formatting-DpKxCsXq.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +100 -0
- package/dist/cli/CommandProcessor.d.ts.map +1 -0
- package/dist/cli/commands/ConfigCommand.d.ts +14 -0
- package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/dist/cli/commands/ExportCommand.d.ts +48 -0
- package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
- package/dist/cli/commands/HistoryCommand.d.ts +47 -0
- package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
- package/dist/cli/commands/StatusCommand.d.ts +30 -0
- package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
- package/dist/cli/commands/ThemeCommand.d.ts +30 -0
- package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
- package/dist/cli/help.d.ts +12 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/{src/cli-module.ts → dist/cli-module.d.ts} +2 -8
- package/dist/cli-module.d.ts.map +1 -0
- package/dist/cli-primitives/box.d.ts +11 -0
- package/dist/cli-primitives/box.d.ts.map +1 -0
- package/dist/cli-primitives/cli-table.d.ts +11 -0
- package/dist/cli-primitives/cli-table.d.ts.map +1 -0
- package/dist/cli-primitives/divider.d.ts +11 -0
- package/dist/cli-primitives/divider.d.ts.map +1 -0
- package/dist/cli-primitives/header.d.ts +12 -0
- package/dist/cli-primitives/header.d.ts.map +1 -0
- package/{src/cli-primitives/index.ts → dist/cli-primitives/index.d.ts} +1 -1
- package/dist/cli-primitives/index.d.ts.map +1 -0
- package/dist/cli-primitives/server-fallback.d.ts +25 -0
- package/dist/cli-primitives/server-fallback.d.ts.map +1 -0
- package/dist/cli-primitives/spinner.d.ts +47 -0
- package/dist/cli-primitives/spinner.d.ts.map +1 -0
- package/dist/cli-primitives/step.d.ts +11 -0
- package/dist/cli-primitives/step.d.ts.map +1 -0
- package/dist/cli.cjs +2 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +235 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/core.cjs +2 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.ts +127 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +291 -0
- package/dist/core.js.map +1 -0
- package/dist/example.d.ts +18 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/exports-module.d.ts +196 -0
- package/dist/exports-module.d.ts.map +1 -0
- package/dist/exports.cjs +2 -0
- package/dist/exports.cjs.map +1 -0
- package/dist/exports.js +238 -0
- package/dist/exports.js.map +1 -0
- package/dist/handlers/AnalyticsLogHandler.d.ts +8 -0
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
- package/dist/handlers/ExportLogHandler.d.ts +100 -0
- package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
- package/dist/handlers/FileLogHandler.d.ts +33 -0
- package/dist/handlers/FileLogHandler.d.ts.map +1 -0
- package/dist/handlers/RemoteLogHandler.d.ts +11 -0
- package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
- package/{src/handlers/index.ts → dist/handlers/index.d.ts} +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/hooks/HookManager.d.ts +21 -0
- package/dist/hooks/HookManager.d.ts.map +1 -0
- package/{src/hooks/index.ts → dist/hooks/index.d.ts} +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +627 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/serializers/SerializerRegistry.d.ts +16 -0
- package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
- package/{src/serializers/index.ts → dist/serializers/index.d.ts} +1 -0
- package/dist/serializers/index.d.ts.map +1 -0
- package/dist/styling/LogStyleBuilder.d.ts +146 -0
- package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
- package/dist/styling/SemanticStyles.d.ts +178 -0
- package/dist/styling/SemanticStyles.d.ts.map +1 -0
- package/dist/styling/SmartPresets.d.ts +22 -0
- package/dist/styling/SmartPresets.d.ts.map +1 -0
- package/dist/styling/StyleBuilder.d.ts +140 -0
- package/dist/styling/StyleBuilder.d.ts.map +1 -0
- package/dist/styling/StyleCache.d.ts +42 -0
- package/dist/styling/StyleCache.d.ts.map +1 -0
- package/dist/styling/banners.d.ts +42 -0
- package/dist/styling/banners.d.ts.map +1 -0
- package/dist/styling/index.d.ts +10 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/themes.d.ts +7 -0
- package/dist/styling/themes.d.ts.map +1 -0
- package/dist/styling-module.d.ts +178 -0
- package/dist/styling-module.d.ts.map +1 -0
- package/dist/styling.cjs +2 -0
- package/dist/styling.cjs.map +1 -0
- package/dist/styling.js +146 -0
- package/dist/styling.js.map +1 -0
- 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 +20 -0
- package/dist/terminal/formatter.d.ts.map +1 -0
- package/dist/terminal/terminal-renderer.d.ts +77 -0
- package/dist/terminal/terminal-renderer.d.ts.map +1 -0
- package/dist/transports/ConsoleTransport.d.ts +9 -0
- package/dist/transports/ConsoleTransport.d.ts.map +1 -0
- package/dist/transports/FileTransport.d.ts +15 -0
- package/dist/transports/FileTransport.d.ts.map +1 -0
- package/dist/transports/HttpTransport.d.ts +16 -0
- package/dist/transports/HttpTransport.d.ts.map +1 -0
- package/dist/transports/TransportManager.d.ts +14 -0
- package/dist/transports/TransportManager.d.ts.map +1 -0
- package/{src/transports/index.ts → dist/transports/index.d.ts} +1 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/{src/types/core.ts → dist/types/core.d.ts} +25 -62
- package/dist/types/core.d.ts.map +1 -0
- package/{src/types/handlers.ts → dist/types/handlers.d.ts} +5 -15
- package/dist/types/handlers.d.ts.map +1 -0
- package/{src/types/hooks.ts → dist/types/hooks.d.ts} +3 -12
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/{src/types/serializers.ts → dist/types/serializers.d.ts} +1 -6
- package/dist/types/serializers.d.ts.map +1 -0
- package/{src/types/transports.ts → dist/types/transports.d.ts} +2 -7
- package/dist/types/transports.d.ts.map +1 -0
- package/dist/utils/adapter.d.ts +48 -0
- package/dist/utils/adapter.d.ts.map +1 -0
- package/dist/utils/ansi-colors.d.ts +156 -0
- package/dist/utils/ansi-colors.d.ts.map +1 -0
- package/dist/utils/environment-detector.d.ts +45 -0
- package/dist/utils/environment-detector.d.ts.map +1 -0
- package/dist/utils/environment.d.ts +47 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +58 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/opentui-detection.d.ts +34 -0
- package/dist/utils/opentui-detection.d.ts.map +1 -0
- package/dist/utils/output.d.ts +46 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/stackTrace.d.ts +6 -0
- package/dist/utils/stackTrace.d.ts.map +1 -0
- package/dist/utils/timestamps.d.ts +20 -0
- package/dist/utils/timestamps.d.ts.map +1 -0
- package/{src/writers/BufferWriter.ts → dist/writers/BufferWriter.d.ts} +16 -77
- package/dist/writers/BufferWriter.d.ts.map +1 -0
- package/{src/writers/index.ts → dist/writers/index.d.ts} +1 -1
- package/dist/writers/index.d.ts.map +1 -0
- package/package.json +5 -1
- package/.claude/settings.local.json +0 -48
- 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 -1120
- package/CHANGELOG.md +0 -209
- package/CLAUDE.md +0 -217
- package/demo.html +0 -847
- package/docs/API.md +0 -918
- 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/playground/demo-all.ts +0 -95
- package/playground/demo-box.ts +0 -85
- package/playground/demo-levels.ts +0 -56
- package/playground/demo-real-world.ts +0 -98
- package/playground/demo-spinner.ts +0 -77
- package/playground/demo-steps.ts +0 -72
- package/playground/demo-table.ts +0 -83
- 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/src/Logger.ts +0 -1858
- package/src/ScopedLogger.ts +0 -256
- 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/cli-primitives/box.ts +0 -86
- package/src/cli-primitives/cli-table.ts +0 -62
- package/src/cli-primitives/divider.ts +0 -17
- package/src/cli-primitives/header.ts +0 -18
- package/src/cli-primitives/server-fallback.ts +0 -54
- package/src/cli-primitives/spinner.ts +0 -133
- package/src/cli-primitives/step.ts +0 -22
- package/src/constants.ts +0 -313
- package/src/core.ts +0 -397
- 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 -610
- package/src/handlers/FileLogHandler.ts +0 -169
- package/src/handlers/RemoteLogHandler.ts +0 -42
- package/src/hooks/HookManager.ts +0 -177
- package/src/index.ts +0 -395
- package/src/main.ts +0 -196
- package/src/serializers/SerializerRegistry.ts +0 -173
- 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/StyleCache.ts +0 -131
- 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/terminal/color-converter.ts +0 -315
- package/src/terminal/formatter.ts +0 -242
- package/src/terminal/terminal-renderer.ts +0 -342
- package/src/transports/ConsoleTransport.ts +0 -28
- package/src/transports/FileTransport.ts +0 -53
- package/src/transports/HttpTransport.ts +0 -56
- package/src/transports/TransportManager.ts +0 -130
- package/src/types/index.ts +0 -83
- package/src/typescript.svg +0 -1
- package/src/utils/adapter.ts +0 -291
- package/src/utils/ansi-colors.ts +0 -333
- package/src/utils/environment-detector.ts +0 -170
- package/src/utils/environment.ts +0 -94
- package/src/utils/formatting.ts +0 -332
- package/src/utils/index.ts +0 -33
- package/src/utils/opentui-detection.ts +0 -138
- package/src/utils/output.ts +0 -227
- package/src/utils/stackTrace.ts +0 -144
- 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 -256
- /package/{public → dist}/vite.svg +0 -0
package/test-core-browser.html
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Core Logger Browser Test</title>
|
|
7
|
-
<style>
|
|
8
|
-
body {
|
|
9
|
-
font-family: system-ui, sans-serif;
|
|
10
|
-
max-width: 800px;
|
|
11
|
-
margin: 0 auto;
|
|
12
|
-
padding: 20px;
|
|
13
|
-
background-color: #f5f5f5;
|
|
14
|
-
}
|
|
15
|
-
.test-section {
|
|
16
|
-
background: white;
|
|
17
|
-
margin: 20px 0;
|
|
18
|
-
padding: 20px;
|
|
19
|
-
border-radius: 8px;
|
|
20
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
21
|
-
}
|
|
22
|
-
button {
|
|
23
|
-
background: #007bff;
|
|
24
|
-
color: white;
|
|
25
|
-
border: none;
|
|
26
|
-
padding: 10px 20px;
|
|
27
|
-
margin: 5px;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
}
|
|
31
|
-
button:hover { background: #0056b3; }
|
|
32
|
-
.console-note {
|
|
33
|
-
background: #e9ecef;
|
|
34
|
-
padding: 10px;
|
|
35
|
-
border-left: 4px solid #007bff;
|
|
36
|
-
margin: 10px 0;
|
|
37
|
-
}
|
|
38
|
-
.success { color: #28a745; font-weight: bold; }
|
|
39
|
-
.error { color: #dc3545; font-weight: bold; }
|
|
40
|
-
</style>
|
|
41
|
-
</head>
|
|
42
|
-
<body>
|
|
43
|
-
<h1>🧪 Core Logger Browser Test</h1>
|
|
44
|
-
|
|
45
|
-
<div class="console-note">
|
|
46
|
-
<strong>📋 Instructions:</strong> Open your browser's Developer Console (F12) to see the log output.
|
|
47
|
-
All tests will show styled output in browser console with CSS formatting.
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div class="test-section">
|
|
51
|
-
<h2>Environment Detection</h2>
|
|
52
|
-
<button onclick="testEnvironment()">Test Environment Detection</button>
|
|
53
|
-
<div id="env-info"></div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div class="test-section">
|
|
57
|
-
<h2>Basic Logging</h2>
|
|
58
|
-
<button onclick="testBasicLogging()">Test Basic Levels</button>
|
|
59
|
-
<p>Check console for styled output with gradients and colors.</p>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<div class="test-section">
|
|
63
|
-
<h2>Scoped Logger</h2>
|
|
64
|
-
<button onclick="testScopedLogger()">Test Scoped Logging</button>
|
|
65
|
-
<p>Should show prefixed messages in console.</p>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div class="test-section">
|
|
69
|
-
<h2>Advanced Features</h2>
|
|
70
|
-
<button onclick="testAdvancedFeatures()">Test Tables & Groups</button>
|
|
71
|
-
<p>Should use native browser console.table() and grouping.</p>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div class="test-section">
|
|
75
|
-
<h2>Performance Timers</h2>
|
|
76
|
-
<button onclick="testTimers()">Test Timers</button>
|
|
77
|
-
<p>Should measure and log execution time.</p>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div class="test-section">
|
|
81
|
-
<h2>Custom Handlers</h2>
|
|
82
|
-
<button onclick="testHandlers()">Test Custom Handler</button>
|
|
83
|
-
<p>Should trigger custom handler alongside console output.</p>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<div class="test-section">
|
|
87
|
-
<h2>Results</h2>
|
|
88
|
-
<div id="results"></div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<script type="module">
|
|
92
|
-
// Import the core logger
|
|
93
|
-
import logger from './packages/core/dist/index.js';
|
|
94
|
-
|
|
95
|
-
// Make logger available globally for tests
|
|
96
|
-
window.logger = logger;
|
|
97
|
-
window.testResults = [];
|
|
98
|
-
|
|
99
|
-
// Test functions
|
|
100
|
-
window.testEnvironment = function() {
|
|
101
|
-
console.log('=== Environment Detection Test ===');
|
|
102
|
-
|
|
103
|
-
const info = {
|
|
104
|
-
userAgent: navigator.userAgent,
|
|
105
|
-
platform: navigator.platform,
|
|
106
|
-
language: navigator.language,
|
|
107
|
-
cookiesEnabled: navigator.cookieEnabled,
|
|
108
|
-
onLine: navigator.onLine,
|
|
109
|
-
colorScheme: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
logger.info('Browser environment detected');
|
|
113
|
-
logger.info('User Agent: ' + info.userAgent);
|
|
114
|
-
logger.info('Platform: ' + info.platform);
|
|
115
|
-
logger.info('Color Scheme: ' + info.colorScheme);
|
|
116
|
-
|
|
117
|
-
document.getElementById('env-info').innerHTML = `
|
|
118
|
-
<p><strong>Platform:</strong> ${info.platform}</p>
|
|
119
|
-
<p><strong>Color Scheme:</strong> ${info.colorScheme}</p>
|
|
120
|
-
<p class="success">✅ Environment detection working</p>
|
|
121
|
-
`;
|
|
122
|
-
|
|
123
|
-
window.testResults.push('Environment: ✅ Passed');
|
|
124
|
-
updateResults();
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
window.testBasicLogging = function() {
|
|
128
|
-
console.log('=== Basic Logging Test ===');
|
|
129
|
-
|
|
130
|
-
logger.debug('Debug message - should be styled with gray gradient');
|
|
131
|
-
logger.info('Info message - should be styled with blue gradient');
|
|
132
|
-
logger.warn('Warning message - should be styled with yellow gradient');
|
|
133
|
-
logger.error('Error message - should be styled with red gradient');
|
|
134
|
-
logger.critical('Critical message - should be styled with dark red gradient');
|
|
135
|
-
|
|
136
|
-
console.log('Check above for styled console output with gradients and colors');
|
|
137
|
-
window.testResults.push('Basic Logging: ✅ Passed');
|
|
138
|
-
updateResults();
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
window.testScopedLogger = function() {
|
|
142
|
-
console.log('=== Scoped Logger Test ===');
|
|
143
|
-
|
|
144
|
-
const apiLogger = logger.scope('API');
|
|
145
|
-
const dbLogger = logger.scope('DATABASE');
|
|
146
|
-
|
|
147
|
-
apiLogger.info('API request started');
|
|
148
|
-
apiLogger.warn('API rate limit warning');
|
|
149
|
-
apiLogger.error('API request failed');
|
|
150
|
-
|
|
151
|
-
dbLogger.info('Database connection established');
|
|
152
|
-
dbLogger.warn('Slow query detected');
|
|
153
|
-
|
|
154
|
-
window.testResults.push('Scoped Logging: ✅ Passed');
|
|
155
|
-
updateResults();
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
window.testAdvancedFeatures = function() {
|
|
159
|
-
console.log('=== Advanced Features Test ===');
|
|
160
|
-
|
|
161
|
-
// Test table
|
|
162
|
-
const sampleData = [
|
|
163
|
-
{ name: 'Alice', age: 25, role: 'Developer' },
|
|
164
|
-
{ name: 'Bob', age: 30, role: 'Designer' },
|
|
165
|
-
{ name: 'Carol', age: 28, role: 'Manager' }
|
|
166
|
-
];
|
|
167
|
-
|
|
168
|
-
logger.table(sampleData);
|
|
169
|
-
|
|
170
|
-
// Test groups
|
|
171
|
-
logger.group('Database Operations');
|
|
172
|
-
logger.info('Connecting to database');
|
|
173
|
-
logger.info('Executing complex query');
|
|
174
|
-
logger.group('Transaction Details', true); // collapsed
|
|
175
|
-
logger.info('Transaction started');
|
|
176
|
-
logger.info('Updating records');
|
|
177
|
-
logger.groupEnd();
|
|
178
|
-
logger.info('Transaction completed');
|
|
179
|
-
logger.groupEnd();
|
|
180
|
-
|
|
181
|
-
window.testResults.push('Advanced Features: ✅ Passed');
|
|
182
|
-
updateResults();
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
window.testTimers = function() {
|
|
186
|
-
console.log('=== Performance Timers Test ===');
|
|
187
|
-
|
|
188
|
-
logger.time('operation-1');
|
|
189
|
-
logger.time('operation-2');
|
|
190
|
-
|
|
191
|
-
setTimeout(() => {
|
|
192
|
-
logger.timeEnd('operation-1');
|
|
193
|
-
|
|
194
|
-
setTimeout(() => {
|
|
195
|
-
logger.timeEnd('operation-2');
|
|
196
|
-
window.testResults.push('Timers: ✅ Passed');
|
|
197
|
-
updateResults();
|
|
198
|
-
}, 150);
|
|
199
|
-
}, 100);
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
window.testHandlers = function() {
|
|
203
|
-
console.log('=== Custom Handlers Test ===');
|
|
204
|
-
|
|
205
|
-
let handlerCalled = false;
|
|
206
|
-
const testHandler = {
|
|
207
|
-
handle: (level, message, args, metadata) => {
|
|
208
|
-
console.log('🔧 Custom handler received:', { level, message, timestamp: metadata.timestamp });
|
|
209
|
-
handlerCalled = true;
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
logger.addHandler(testHandler);
|
|
214
|
-
logger.info('This message should trigger the custom handler');
|
|
215
|
-
|
|
216
|
-
setTimeout(() => {
|
|
217
|
-
if (handlerCalled) {
|
|
218
|
-
window.testResults.push('Custom Handlers: ✅ Passed');
|
|
219
|
-
} else {
|
|
220
|
-
window.testResults.push('Custom Handlers: ❌ Failed');
|
|
221
|
-
}
|
|
222
|
-
updateResults();
|
|
223
|
-
}, 50);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
function updateResults() {
|
|
227
|
-
const resultsDiv = document.getElementById('results');
|
|
228
|
-
resultsDiv.innerHTML = '<h3>Test Results:</h3>' +
|
|
229
|
-
window.testResults.map(result => `<p>${result}</p>`).join('');
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Auto-run environment test
|
|
233
|
-
console.log('🚀 Core Logger Browser Test Started');
|
|
234
|
-
console.log('📍 Check console output for styled logs with CSS gradients');
|
|
235
|
-
</script>
|
|
236
|
-
</body>
|
|
237
|
-
</html>
|
package/test-core-node.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Test script for core logger in Node.js environment
|
|
5
|
-
*/
|
|
6
|
-
console.log('=== Testing Core Logger in Node.js ===\n');
|
|
7
|
-
|
|
8
|
-
// Test ES module import
|
|
9
|
-
import logger from './packages/core/dist/index.js';
|
|
10
|
-
|
|
11
|
-
console.log('Environment detection:');
|
|
12
|
-
console.log('- Runtime:', process.versions.node ? 'Node.js' : 'Unknown');
|
|
13
|
-
console.log('- Colors supported:', process.stdout.isTTY);
|
|
14
|
-
console.log('- File system available:', 'Yes (Node.js)');
|
|
15
|
-
console.log();
|
|
16
|
-
|
|
17
|
-
console.log('Testing basic logging:');
|
|
18
|
-
logger.info('Hello from Node.js!');
|
|
19
|
-
logger.warn('This is a warning message');
|
|
20
|
-
logger.error('This is an error message');
|
|
21
|
-
logger.critical('This should work in Node.js (critical level)');
|
|
22
|
-
console.log();
|
|
23
|
-
|
|
24
|
-
console.log('Testing scoped logger:');
|
|
25
|
-
const apiLogger = logger.scope('API');
|
|
26
|
-
apiLogger.info('API request started');
|
|
27
|
-
apiLogger.error('API request failed');
|
|
28
|
-
console.log();
|
|
29
|
-
|
|
30
|
-
console.log('Testing timers:');
|
|
31
|
-
logger.time('test-operation');
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
logger.timeEnd('test-operation');
|
|
34
|
-
console.log();
|
|
35
|
-
|
|
36
|
-
console.log('Testing table (Node.js plain text):');
|
|
37
|
-
const data = [
|
|
38
|
-
{ name: 'Alice', age: 25, role: 'Developer' },
|
|
39
|
-
{ name: 'Bob', age: 30, role: 'Designer' },
|
|
40
|
-
{ name: 'Carol', age: 28, role: 'Manager' }
|
|
41
|
-
];
|
|
42
|
-
logger.table(data);
|
|
43
|
-
console.log();
|
|
44
|
-
|
|
45
|
-
console.log('Testing groups:');
|
|
46
|
-
logger.group('Database Operations');
|
|
47
|
-
logger.info('Connecting to database');
|
|
48
|
-
logger.info('Executing query');
|
|
49
|
-
logger.groupEnd();
|
|
50
|
-
console.log();
|
|
51
|
-
|
|
52
|
-
console.log('Testing custom handler (mock):');
|
|
53
|
-
const mockHandler = {
|
|
54
|
-
handle: (level, message, args, metadata) => {
|
|
55
|
-
console.log(`Custom handler received: [${level.toUpperCase()}] ${message}`);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
logger.addHandler(mockHandler);
|
|
59
|
-
logger.info('This should trigger custom handler');
|
|
60
|
-
console.log();
|
|
61
|
-
|
|
62
|
-
console.log('✅ Node.js tests completed successfully!');
|
|
63
|
-
}, 100);
|
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Script de Testing para Validación de Resolución de Conflictos
|
|
5
|
-
* Simula escenarios de conflictos de git y valida que la resolución automática funcione
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { execSync, spawnSync } from 'child_process';
|
|
9
|
-
import { existsSync, writeFileSync, readFileSync } from 'fs';
|
|
10
|
-
import { join } from 'path';
|
|
11
|
-
|
|
12
|
-
interface TestResult {
|
|
13
|
-
name: string;
|
|
14
|
-
passed: boolean;
|
|
15
|
-
message: string;
|
|
16
|
-
duration: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
class ConflictResolutionTester {
|
|
20
|
-
private projectRoot: string;
|
|
21
|
-
private testBranch: string = 'test-conflict-resolution';
|
|
22
|
-
private results: TestResult[] = [];
|
|
23
|
-
|
|
24
|
-
constructor() {
|
|
25
|
-
this.projectRoot = process.cwd();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
private log(message: string): void {
|
|
29
|
-
console.log(`🧪 ${message}`);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
private logSuccess(message: string): void {
|
|
33
|
-
console.log(`✅ ${message}`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
private logError(message: string): void {
|
|
37
|
-
console.log(`❌ ${message}`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private logWarning(message: string): void {
|
|
41
|
-
console.log(`⚠️ ${message}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
private async gitCommand(args: string[]): Promise<string> {
|
|
45
|
-
const result = spawnSync('git', args, {
|
|
46
|
-
cwd: this.projectRoot,
|
|
47
|
-
encoding: 'utf-8',
|
|
48
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
if (result.status !== 0) {
|
|
52
|
-
const error = result.stderr || 'Git command failed';
|
|
53
|
-
throw new Error(`Git error: ${error}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return (result.stdout || '').trim();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private async runTest(testName: string, testFn: () => Promise<void>): Promise<void> {
|
|
60
|
-
const startTime = Date.now();
|
|
61
|
-
this.log(`Ejecutando: ${testName}`);
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
await testFn();
|
|
65
|
-
const duration = Date.now() - startTime;
|
|
66
|
-
this.results.push({
|
|
67
|
-
name: testName,
|
|
68
|
-
passed: true,
|
|
69
|
-
message: 'Test pasó exitosamente',
|
|
70
|
-
duration
|
|
71
|
-
});
|
|
72
|
-
this.logSuccess(`${testName} - PASSED (${duration}ms)`);
|
|
73
|
-
} catch (error) {
|
|
74
|
-
const duration = Date.now() - startTime;
|
|
75
|
-
this.results.push({
|
|
76
|
-
name: testName,
|
|
77
|
-
passed: false,
|
|
78
|
-
message: error instanceof Error ? error.message : String(error),
|
|
79
|
-
duration
|
|
80
|
-
});
|
|
81
|
-
this.logError(`${testName} - FAILED (${duration}ms): ${error}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Test 1: Validar detección de contexto de release
|
|
87
|
-
*/
|
|
88
|
-
private async testReleaseContextDetection(): Promise<void> {
|
|
89
|
-
// Simular archivos de release
|
|
90
|
-
const testFiles = ['package.json', 'CHANGELOG.json', 'packages/core/package.json'];
|
|
91
|
-
|
|
92
|
-
// Stage archivos relacionados con release
|
|
93
|
-
for (const file of testFiles) {
|
|
94
|
-
if (existsSync(join(this.projectRoot, file))) {
|
|
95
|
-
await this.gitCommand(['add', file]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Verificar que commit-generator detecta contexto de release
|
|
100
|
-
const testEnv = {
|
|
101
|
-
...process.env,
|
|
102
|
-
RELEASE_WORKFLOW: 'true',
|
|
103
|
-
GITHUB_WORKFLOW: 'test-workflow'
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Note: Este test es conceptual ya que necesitaríamos importar la clase CommitGenerator
|
|
107
|
-
// En un entorno real, podríamos extraer la lógica de detección a una función utilitaria
|
|
108
|
-
this.log('Detección de contexto de release - conceptualmente validado');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Test 2: Validar concurrency control en workflows
|
|
113
|
-
*/
|
|
114
|
-
private async testConcurrencyControl(): Promise<void> {
|
|
115
|
-
const workflowFiles = [
|
|
116
|
-
'.github/workflows/releases-full.yml',
|
|
117
|
-
'.github/workflows/releases-core.yml'
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
for (const workflowFile of workflowFiles) {
|
|
121
|
-
const fullPath = join(this.projectRoot, workflowFile);
|
|
122
|
-
if (existsSync(fullPath)) {
|
|
123
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
124
|
-
|
|
125
|
-
// Verificar que contiene concurrency control
|
|
126
|
-
if (!content.includes('concurrency:')) {
|
|
127
|
-
throw new Error(`${workflowFile} no contiene concurrency control`);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (!content.includes('group: release-pipeline-')) {
|
|
131
|
-
throw new Error(`${workflowFile} no contiene group correcto`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (!content.includes('cancel-in-progress: true')) {
|
|
135
|
-
throw new Error(`${workflowFile} no contiene cancel-in-progress`);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
this.log(`✓ ${workflowFile} - Concurrency control validado`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Test 3: Validar estrategia pull-rebase-push en workflows
|
|
145
|
-
*/
|
|
146
|
-
private async testPullRebasePushStrategy(): Promise<void> {
|
|
147
|
-
const workflowFiles = [
|
|
148
|
-
'.github/workflows/releases-full.yml',
|
|
149
|
-
'.github/workflows/releases-core.yml'
|
|
150
|
-
];
|
|
151
|
-
|
|
152
|
-
for (const workflowFile of workflowFiles) {
|
|
153
|
-
const fullPath = join(this.projectRoot, workflowFile);
|
|
154
|
-
if (existsSync(fullPath)) {
|
|
155
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
156
|
-
|
|
157
|
-
// Verificar elementos de la estrategia
|
|
158
|
-
const requiredElements = [
|
|
159
|
-
'git fetch origin main',
|
|
160
|
-
'git rebase origin/main',
|
|
161
|
-
'git rebase --abort',
|
|
162
|
-
'git reset --hard origin/main',
|
|
163
|
-
'MAX_RETRIES=3',
|
|
164
|
-
'RETRY_COUNT=0'
|
|
165
|
-
];
|
|
166
|
-
|
|
167
|
-
for (const element of requiredElements) {
|
|
168
|
-
if (!content.includes(element)) {
|
|
169
|
-
throw new Error(`${workflowFile} no contiene: ${element}`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
this.log(`✓ ${workflowFile} - Estrategia pull-rebase-push validada`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Test 4: Validar integración de project-utils
|
|
180
|
-
*/
|
|
181
|
-
private async testProjectUtilsIntegration(): Promise<void> {
|
|
182
|
-
const workflowFiles = [
|
|
183
|
-
'.github/workflows/releases-full.yml',
|
|
184
|
-
'.github/workflows/releases-core.yml'
|
|
185
|
-
];
|
|
186
|
-
|
|
187
|
-
for (const workflowFile of workflowFiles) {
|
|
188
|
-
const fullPath = join(this.projectRoot, workflowFile);
|
|
189
|
-
if (existsSync(fullPath)) {
|
|
190
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
191
|
-
|
|
192
|
-
// Verificar elementos de integración
|
|
193
|
-
const requiredElements = [
|
|
194
|
-
'bun project-utils/commit-generator.ts',
|
|
195
|
-
'RELEASE_WORKFLOW=true',
|
|
196
|
-
'GITHUB_WORKFLOW=',
|
|
197
|
-
'--auto-approve',
|
|
198
|
-
'--quiet',
|
|
199
|
-
'estrategia de fallback'
|
|
200
|
-
];
|
|
201
|
-
|
|
202
|
-
for (const element of requiredElements) {
|
|
203
|
-
if (!content.includes(element)) {
|
|
204
|
-
throw new Error(`${workflowFile} no contiene integración: ${element}`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
this.log(`✓ ${workflowFile} - Integración project-utils validada`);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Test 5: Validar que commit-generator tiene funciones anti-conflictos
|
|
215
|
-
*/
|
|
216
|
-
private async testCommitGeneratorAntiConflict(): Promise<void> {
|
|
217
|
-
const commitGeneratorPath = join(this.projectRoot, 'project-utils/commit-generator.ts');
|
|
218
|
-
|
|
219
|
-
if (!existsSync(commitGeneratorPath)) {
|
|
220
|
-
throw new Error('commit-generator.ts no existe');
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const content = readFileSync(commitGeneratorPath, 'utf-8');
|
|
224
|
-
|
|
225
|
-
const requiredMethods = [
|
|
226
|
-
'isReleaseWorkflowContext',
|
|
227
|
-
'handleReleaseWorkflowCommit',
|
|
228
|
-
'hasReleaseRelatedFiles',
|
|
229
|
-
'hasUnpushedCommits',
|
|
230
|
-
'getAllStagedFiles',
|
|
231
|
-
'analyzeConflictType',
|
|
232
|
-
'getConflictedFiles',
|
|
233
|
-
'autoResolveConflicts',
|
|
234
|
-
'createSafetyBackup',
|
|
235
|
-
'getCurrentBranch'
|
|
236
|
-
];
|
|
237
|
-
|
|
238
|
-
for (const method of requiredMethods) {
|
|
239
|
-
if (!content.includes(method)) {
|
|
240
|
-
throw new Error(`commit-generator.ts no contiene método: ${method}`);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// Verificar lógica específica
|
|
245
|
-
const requiredLogic = [
|
|
246
|
-
'GITHUB_ACTIONS === \'true\'',
|
|
247
|
-
'RELEASE_WORKFLOW === \'true\'',
|
|
248
|
-
'git fetch origin',
|
|
249
|
-
'git rebase',
|
|
250
|
-
'MAX_RETRIES=3',
|
|
251
|
-
'releasePatterns',
|
|
252
|
-
'conflictType:',
|
|
253
|
-
'canAutoResolve',
|
|
254
|
-
'requiresManualIntervention',
|
|
255
|
-
'backup-before-conflict-resolution',
|
|
256
|
-
'type-check'
|
|
257
|
-
];
|
|
258
|
-
|
|
259
|
-
for (const logic of requiredLogic) {
|
|
260
|
-
if (!content.includes(logic)) {
|
|
261
|
-
throw new Error(`commit-generator.ts no contiene lógica: ${logic}`);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
this.log('✓ commit-generator.ts - Funciones anti-conflictos validadas');
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Test 6: Simular escenario de conflicto (test conceptual)
|
|
270
|
-
*/
|
|
271
|
-
private async testConflictSimulation(): Promise<void> {
|
|
272
|
-
this.log('Simulación de conflicto - test conceptual');
|
|
273
|
-
|
|
274
|
-
// En un entorno real, esto crearía una situación de conflicto y verificaría la resolución
|
|
275
|
-
// Por ahora, validamos que todos los componentes estén en su lugar
|
|
276
|
-
|
|
277
|
-
const components = [
|
|
278
|
-
'project-utils/commit-generator.ts',
|
|
279
|
-
'.github/workflows/releases-full.yml',
|
|
280
|
-
'.github/workflows/releases-core.yml'
|
|
281
|
-
];
|
|
282
|
-
|
|
283
|
-
for (const component of components) {
|
|
284
|
-
if (!existsSync(join(this.projectRoot, component))) {
|
|
285
|
-
throw new Error(`Componente faltante: ${component}`);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
this.log('✓ Todos los componentes están presentes para resolución de conflictos');
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Ejecuta todos los tests
|
|
294
|
-
*/
|
|
295
|
-
async runAllTests(): Promise<void> {
|
|
296
|
-
this.log('🚀 Iniciando testing de resolución de conflictos...\n');
|
|
297
|
-
|
|
298
|
-
await this.runTest(
|
|
299
|
-
'Detección de contexto de release',
|
|
300
|
-
() => this.testReleaseContextDetection()
|
|
301
|
-
);
|
|
302
|
-
|
|
303
|
-
await this.runTest(
|
|
304
|
-
'Concurrency control en workflows',
|
|
305
|
-
() => this.testConcurrencyControl()
|
|
306
|
-
);
|
|
307
|
-
|
|
308
|
-
await this.runTest(
|
|
309
|
-
'Estrategia pull-rebase-push',
|
|
310
|
-
() => this.testPullRebasePushStrategy()
|
|
311
|
-
);
|
|
312
|
-
|
|
313
|
-
await this.runTest(
|
|
314
|
-
'Integración project-utils',
|
|
315
|
-
() => this.testProjectUtilsIntegration()
|
|
316
|
-
);
|
|
317
|
-
|
|
318
|
-
await this.runTest(
|
|
319
|
-
'Funciones anti-conflictos en commit-generator',
|
|
320
|
-
() => this.testCommitGeneratorAntiConflict()
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
await this.runTest(
|
|
324
|
-
'Simulación de conflicto',
|
|
325
|
-
() => this.testConflictSimulation()
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
this.printResults();
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
private printResults(): void {
|
|
332
|
-
const passed = this.results.filter(r => r.passed).length;
|
|
333
|
-
const failed = this.results.filter(r => r.passed === false).length;
|
|
334
|
-
const totalDuration = this.results.reduce((sum, r) => sum + r.duration, 0);
|
|
335
|
-
|
|
336
|
-
console.log('\n' + '='.repeat(60));
|
|
337
|
-
console.log('📊 RESUMEN DE TESTING - RESOLUCIÓN DE CONFLICTOS');
|
|
338
|
-
console.log('='.repeat(60));
|
|
339
|
-
console.log(`✅ Tests pasados: ${passed}`);
|
|
340
|
-
console.log(`❌ Tests fallidos: ${failed}`);
|
|
341
|
-
console.log(`⏱️ Duración total: ${totalDuration}ms`);
|
|
342
|
-
console.log('='.repeat(60));
|
|
343
|
-
|
|
344
|
-
if (failed > 0) {
|
|
345
|
-
console.log('\n❌ TESTS FALLIDOS:');
|
|
346
|
-
this.results
|
|
347
|
-
.filter(r => !r.passed)
|
|
348
|
-
.forEach(r => {
|
|
349
|
-
console.log(` - ${r.name}: ${r.message}`);
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
if (passed === this.results.length) {
|
|
354
|
-
console.log('\n🎉 TODOS LOS TESTS PASARON - Resolución de conflictos implementada correctamente');
|
|
355
|
-
process.exit(0);
|
|
356
|
-
} else {
|
|
357
|
-
console.log('\n⚠️ ALGUNOS TESTS FALLARON - Revisar implementación');
|
|
358
|
-
process.exit(1);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// Ejecutar tests si se llama directamente
|
|
364
|
-
if (import.meta.main) {
|
|
365
|
-
const tester = new ConflictResolutionTester();
|
|
366
|
-
|
|
367
|
-
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
368
|
-
console.log(`
|
|
369
|
-
🧪 Test de Resolución de Conflictos
|
|
370
|
-
|
|
371
|
-
Valida que la implementación de resolución automática de conflictos esté correcta.
|
|
372
|
-
|
|
373
|
-
Uso:
|
|
374
|
-
bun project-utils/test-conflict-resolution.ts
|
|
375
|
-
|
|
376
|
-
Tests incluidos:
|
|
377
|
-
1. Detección de contexto de release
|
|
378
|
-
2. Concurrency control en workflows
|
|
379
|
-
3. Estrategia pull-rebase-push
|
|
380
|
-
4. Integración project-utils
|
|
381
|
-
5. Funciones anti-conflictos
|
|
382
|
-
6. Simulación de conflicto
|
|
383
|
-
|
|
384
|
-
Opciones:
|
|
385
|
-
--help, -h Mostrar esta ayuda
|
|
386
|
-
`);
|
|
387
|
-
process.exit(0);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
await tester.runAllTests();
|
|
391
|
-
}
|