@mks2508/better-logger 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{Logger-Cbi1f10o.js → Logger-CKqzXDh3.js} +2 -2
- package/dist/chunks/{Logger-Cbi1f10o.js.map → Logger-CKqzXDh3.js.map} +1 -1
- package/dist/chunks/{Logger-BZ7B7OXE.js → Logger-D_vuKP4l.js} +2 -2
- package/dist/chunks/{Logger-BZ7B7OXE.js.map → Logger-D_vuKP4l.js.map} +1 -1
- 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-ClIJmaT8.js → cli-module-Cx7qotPY.js} +16 -9
- package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/exports.cjs +1 -1
- package/dist/exports.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/styling.cjs +1 -1
- package/dist/styling.js +2 -2
- package/dist/terminal/formatter.d.ts.map +1 -1
- 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 -1076
- package/CHANGELOG.md +0 -209
- package/CLAUDE.md +0 -217
- package/bun.lock +0 -333
- package/demo.html +0 -847
- package/dist/chunks/cli-module-CadqgZ1Z.js +0 -2
- package/dist/chunks/cli-module-CadqgZ1Z.js.map +0 -1
- package/dist/chunks/cli-module-ClIJmaT8.js.map +0 -1
- 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/public/vite.svg +0 -1
- 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-module.ts +0 -21
- 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/index.ts +0 -13
- 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/handlers/index.ts +0 -8
- package/src/hooks/HookManager.ts +0 -177
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -395
- package/src/main.ts +0 -196
- package/src/serializers/SerializerRegistry.ts +0 -173
- package/src/serializers/index.ts +0 -1
- 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 -236
- 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/transports/index.ts +0 -4
- package/src/types/core.ts +0 -417
- package/src/types/handlers.ts +0 -95
- package/src/types/hooks.ts +0 -45
- package/src/types/index.ts +0 -83
- package/src/types/serializers.ts +0 -30
- package/src/types/transports.ts +0 -52
- 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/src/writers/BufferWriter.ts +0 -157
- package/src/writers/index.ts +0 -6
- 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
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuración centralizada del proyecto Better Logger
|
|
3
|
-
* Define componentes, tipos de trabajo, y otras configuraciones compartidas
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface ProjectComponent {
|
|
7
|
-
id: string
|
|
8
|
-
name: string
|
|
9
|
-
description: string
|
|
10
|
-
buildCommand?: string
|
|
11
|
-
testCommand?: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface WorkTypeConfig {
|
|
15
|
-
id: string
|
|
16
|
-
name: string
|
|
17
|
-
description: string
|
|
18
|
-
emoji: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const PROJECT_COMPONENTS: ProjectComponent[] = [
|
|
22
|
-
{
|
|
23
|
-
id: "core",
|
|
24
|
-
name: "Core",
|
|
25
|
-
description: "Core logging functionality and Logger class",
|
|
26
|
-
buildCommand: "build:core",
|
|
27
|
-
testCommand: "test:core"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: "styling",
|
|
31
|
-
name: "Styling",
|
|
32
|
-
description: "Visual features, themes, and CSS styling system",
|
|
33
|
-
buildCommand: "build:styling",
|
|
34
|
-
testCommand: "test:styling"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: "exports",
|
|
38
|
-
name: "Exports",
|
|
39
|
-
description: "Export handlers and remote logging capabilities",
|
|
40
|
-
buildCommand: "build:exports",
|
|
41
|
-
testCommand: "test:exports"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "cli",
|
|
45
|
-
name: "CLI",
|
|
46
|
-
description: "Command-line interface and utilities",
|
|
47
|
-
buildCommand: "build:cli",
|
|
48
|
-
testCommand: "test:cli"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "docs",
|
|
52
|
-
name: "Documentation",
|
|
53
|
-
description: "Documentation, README files, and guides"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: "tests",
|
|
57
|
-
name: "Tests",
|
|
58
|
-
description: "Test suites, fixtures, and testing utilities"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: "examples",
|
|
62
|
-
name: "Examples",
|
|
63
|
-
description: "Usage examples and sample applications"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: "workflows",
|
|
67
|
-
name: "Workflows",
|
|
68
|
-
description: "GitHub Actions workflows and CI/CD configuration"
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
export const WORK_TYPES: WorkTypeConfig[] = [
|
|
73
|
-
{
|
|
74
|
-
id: "feature",
|
|
75
|
-
name: "Feature",
|
|
76
|
-
description: "New functionality or capabilities",
|
|
77
|
-
emoji: "✨"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: "fix",
|
|
81
|
-
name: "Fix",
|
|
82
|
-
description: "Bug fixes and issue resolution",
|
|
83
|
-
emoji: "🐛"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: "refactor",
|
|
87
|
-
name: "Refactor",
|
|
88
|
-
description: "Code improvements without functional changes",
|
|
89
|
-
emoji: "♻️"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "docs",
|
|
93
|
-
name: "Documentation",
|
|
94
|
-
description: "Documentation updates and improvements",
|
|
95
|
-
emoji: "📝"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: "test",
|
|
99
|
-
name: "Tests",
|
|
100
|
-
description: "Testing improvements and new test cases",
|
|
101
|
-
emoji: "🧪"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: "chore",
|
|
105
|
-
name: "Chore",
|
|
106
|
-
description: "Maintenance tasks and dependency updates",
|
|
107
|
-
emoji: "🔧"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: "perf",
|
|
111
|
-
name: "Performance",
|
|
112
|
-
description: "Performance improvements and optimizations",
|
|
113
|
-
emoji: "⚡"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
id: "style",
|
|
117
|
-
name: "Style",
|
|
118
|
-
description: "Code style and formatting changes",
|
|
119
|
-
emoji: "💄"
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
|
|
123
|
-
export const BUILD_MODES = [
|
|
124
|
-
{
|
|
125
|
-
id: "full",
|
|
126
|
-
name: "Full Build",
|
|
127
|
-
description: "Complete bundle with all modules",
|
|
128
|
-
modules: ["core", "styling", "exports", "cli"]
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: "core",
|
|
132
|
-
name: "Core Only",
|
|
133
|
-
description: "Essential logging functionality (minimal size)",
|
|
134
|
-
modules: ["core"]
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: "styling",
|
|
138
|
-
name: "Styling Bundle",
|
|
139
|
-
description: "Core + visual features and theming",
|
|
140
|
-
modules: ["core", "styling"]
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: "exports",
|
|
144
|
-
name: "Exports Bundle",
|
|
145
|
-
description: "Core + export handlers and remote logging",
|
|
146
|
-
modules: ["core", "exports"]
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
id: "selective",
|
|
150
|
-
name: "Selective",
|
|
151
|
-
description: "Choose specific modules to include",
|
|
152
|
-
modules: [] // User selects
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: "skip",
|
|
156
|
-
name: "Skip Build",
|
|
157
|
-
description: "Use existing build artifacts",
|
|
158
|
-
modules: []
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
|
|
162
|
-
export const VERSION_PREFIXES = [
|
|
163
|
-
{
|
|
164
|
-
id: "stable",
|
|
165
|
-
name: "Stable",
|
|
166
|
-
description: "Production-ready release",
|
|
167
|
-
npmTag: "latest"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
id: "alpha",
|
|
171
|
-
name: "Alpha",
|
|
172
|
-
description: "Early testing and development",
|
|
173
|
-
npmTag: "alpha"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
id: "beta",
|
|
177
|
-
name: "Beta",
|
|
178
|
-
description: "Feature-complete testing phase",
|
|
179
|
-
npmTag: "beta"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
id: "rc",
|
|
183
|
-
name: "Release Candidate",
|
|
184
|
-
description: "Final testing before stable release",
|
|
185
|
-
npmTag: "next"
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
id: "pre-alpha",
|
|
189
|
-
name: "Pre-Alpha",
|
|
190
|
-
description: "Experimental and unstable features",
|
|
191
|
-
npmTag: "experimental"
|
|
192
|
-
}
|
|
193
|
-
]
|
|
194
|
-
|
|
195
|
-
export const PERFORMANCE_IMPACTS = [
|
|
196
|
-
{
|
|
197
|
-
id: "none",
|
|
198
|
-
name: "None",
|
|
199
|
-
description: "No performance impact expected"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
id: "minor",
|
|
203
|
-
name: "Minor",
|
|
204
|
-
description: "Small performance improvements or negligible impact"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
id: "major",
|
|
208
|
-
name: "Major",
|
|
209
|
-
description: "Significant performance changes or optimizations"
|
|
210
|
-
}
|
|
211
|
-
]
|
|
212
|
-
|
|
213
|
-
// Helper functions
|
|
214
|
-
export function getComponentById(id: string): ProjectComponent | undefined {
|
|
215
|
-
return PROJECT_COMPONENTS.find(c => c.id === id)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export function getWorkTypeById(id: string): WorkTypeConfig | undefined {
|
|
219
|
-
return WORK_TYPES.find(w => w.id === id)
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export function getComponentIds(): string[] {
|
|
223
|
-
return PROJECT_COMPONENTS.map(c => c.id)
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export function getWorkTypeIds(): string[] {
|
|
227
|
-
return WORK_TYPES.map(w => w.id)
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export function getBuildModeById(id: string) {
|
|
231
|
-
return BUILD_MODES.find(b => b.id === id)
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export function getVersionPrefixById(id: string) {
|
|
235
|
-
return VERSION_PREFIXES.find(v => v.id === id)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export function formatComponentsList(componentIds: string[]): string {
|
|
239
|
-
const components = componentIds
|
|
240
|
-
.map(id => getComponentById(id))
|
|
241
|
-
.filter(Boolean)
|
|
242
|
-
.map(c => c!.name)
|
|
243
|
-
|
|
244
|
-
if (components.length === 0) return "none"
|
|
245
|
-
if (components.length === 1) return components[0]
|
|
246
|
-
if (components.length === 2) return components.join(" and ")
|
|
247
|
-
|
|
248
|
-
return components.slice(0, -1).join(", ") + ", and " + components[components.length - 1]
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Project metadata
|
|
252
|
-
export const PROJECT_INFO = {
|
|
253
|
-
name: "@mks2508/better-logger",
|
|
254
|
-
displayName: "Better Logger",
|
|
255
|
-
description: "State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface",
|
|
256
|
-
author: "MKS2508",
|
|
257
|
-
license: "MIT",
|
|
258
|
-
homepage: "https://mks2508.github.io/advanced-logger/",
|
|
259
|
-
repository: "https://github.com/MKS2508/advanced-logger.git"
|
|
260
|
-
}
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plantillas de prompts estandarizadas para Gemini CLI
|
|
3
|
-
* @description Asegura respuestas consistentes y parseables en todos los scripts
|
|
4
|
-
* @author TPV EL Haido
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Configuración base del proyecto OpenTUI
|
|
8
|
-
*/
|
|
9
|
-
export const TPV_PROJECT_CONFIG = {
|
|
10
|
-
name: 'OpenTUI',
|
|
11
|
-
description: 'Modern Terminal User Interface Framework',
|
|
12
|
-
version: '0.1.0',
|
|
13
|
-
techStack: ['TypeScript', 'Node.js', 'Terminal UI', 'CLI'],
|
|
14
|
-
targetPlatform: 'Cross-platform (macOS, Linux, Windows)',
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Prefijo estándar para todos los prompts de Gemini
|
|
18
|
-
*/
|
|
19
|
-
const STANDARD_PROMPT_PREFIX = `# Sistema de Análisis Inteligente - OpenTUI
|
|
20
|
-
|
|
21
|
-
Eres un asistente especializado en análisis de código y automatización para el proyecto OpenTUI. Tu función es proporcionar respuestas estructuradas, precisas y consistentes que puedan ser parseadas automáticamente.
|
|
22
|
-
|
|
23
|
-
## REGLAS CRÍTICAS DE FORMATO
|
|
24
|
-
|
|
25
|
-
1. **FORMATO DE RESPUESTA OBLIGATORIO**: Todas tus respuestas deben seguir exactamente el formato especificado más abajo.
|
|
26
|
-
2. **CONSISTENCIA**: Mantén la misma estructura sin importar la complejidad del análisis.
|
|
27
|
-
3. **PARSEABLE**: El formato debe ser fácil de procesar automáticamente con expresiones regulares.
|
|
28
|
-
4. **BLOQUES MARKDOWN**: Usa \`\`\`markdown para bloques de código cuando se especifique.
|
|
29
|
-
5. **SECCIONES TÉCNICAS**: Siempre incluye las secciones <technical> y <changelog> cuando sea aplicable.
|
|
30
|
-
|
|
31
|
-
## Contexto del Proyecto
|
|
32
|
-
**Nombre**: ${TPV_PROJECT_CONFIG.name}
|
|
33
|
-
**Descripción**: ${TPV_PROJECT_CONFIG.description}
|
|
34
|
-
**Versión Actual**: ${TPV_PROJECT_CONFIG.version}
|
|
35
|
-
**Stack Tecnológico**: ${TPV_PROJECT_CONFIG.techStack.join(', ')}
|
|
36
|
-
**Plataforma Objetivo**: ${TPV_PROJECT_CONFIG.targetPlatform}
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
`;
|
|
40
|
-
/**
|
|
41
|
-
* Sufijo estándar con instrucciones de formato
|
|
42
|
-
*/
|
|
43
|
-
const STANDARD_PROMPT_SUFFIX = `
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## INSTRUCCIONES FINALES
|
|
48
|
-
|
|
49
|
-
1. **Lee cuidadosamente** toda la información proporcionada
|
|
50
|
-
2. **Analiza el contexto** y los datos específicos
|
|
51
|
-
3. **Genera una respuesta** siguiendo EXACTAMENTE el formato especificado
|
|
52
|
-
4. **Mantén consistencia** en la estructura y sintaxis
|
|
53
|
-
5. **No desvíes** del formato requerido bajo ninguna circunstancia
|
|
54
|
-
|
|
55
|
-
**IMPORTANTE**: La respuesta debe ser parseada automáticamente. Cualquier desviación del formato especificado causará errores en el sistema.`;
|
|
56
|
-
/**
|
|
57
|
-
* Genera prompt para análisis de commits
|
|
58
|
-
*/
|
|
59
|
-
export function createCommitPrompt(config) {
|
|
60
|
-
const { data, specificContext } = config;
|
|
61
|
-
return `${STANDARD_PROMPT_PREFIX}
|
|
62
|
-
|
|
63
|
-
# ANÁLISIS DE COMMITS
|
|
64
|
-
|
|
65
|
-
## Datos del Análisis
|
|
66
|
-
${JSON.stringify(data, null, 2)}
|
|
67
|
-
|
|
68
|
-
## Contexto Adicional
|
|
69
|
-
${specificContext || 'Ninguno proporcionado'}
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## FORMATO DE RESPUESTA REQUERIDO
|
|
74
|
-
|
|
75
|
-
Tu respuesta debe seguir EXACTAMENTE esta estructura:
|
|
76
|
-
|
|
77
|
-
### **ANÁLISIS PRINCIPAL**
|
|
78
|
-
|
|
79
|
-
[Descripción general de los cambios detectados]
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
### **Propuesta de Commit #1**
|
|
84
|
-
|
|
85
|
-
\`\`\`markdown
|
|
86
|
-
[prefijo](área - descripción breve)
|
|
87
|
-
|
|
88
|
-
[Descripción completa en castellano de QUÉ se logró y POR QUÉ]
|
|
89
|
-
|
|
90
|
-
<technical>
|
|
91
|
-
[Detalles técnicos específicos: archivos modificados, funciones añadidas, refactorizaciones, etc.]
|
|
92
|
-
</technical>
|
|
93
|
-
|
|
94
|
-
<changelog>
|
|
95
|
-
## [Tipo] [Emoji]
|
|
96
|
-
[Entrada para changelog de la app, optimizada para mostrar al usuario]
|
|
97
|
-
</changelog>
|
|
98
|
-
\`\`\`
|
|
99
|
-
|
|
100
|
-
### **Propuesta de Commit #2** (solo si es necesario)
|
|
101
|
-
|
|
102
|
-
[Repetir formato anterior]
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
**DECISIÓN**: [Explicación breve de por qué uno o múltiples commits]
|
|
107
|
-
|
|
108
|
-
${STANDARD_PROMPT_SUFFIX}`;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Genera prompt para asistente de workflow
|
|
112
|
-
*/
|
|
113
|
-
export function createWorkflowPrompt(config) {
|
|
114
|
-
const { data, specificContext } = config;
|
|
115
|
-
return `${STANDARD_PROMPT_PREFIX}
|
|
116
|
-
|
|
117
|
-
# ASISTENTE DE WORKFLOW
|
|
118
|
-
|
|
119
|
-
## Solicitud del Usuario
|
|
120
|
-
"${specificContext}"
|
|
121
|
-
|
|
122
|
-
## Contexto del Proyecto Actual
|
|
123
|
-
${JSON.stringify(data, null, 2)}
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## FORMATO DE RESPUESTA REQUERIDO
|
|
128
|
-
|
|
129
|
-
\`\`\`markdown
|
|
130
|
-
🎯 **ANÁLISIS**: [Descripción del tipo de trabajo detectado]
|
|
131
|
-
📊 **IMPACTO**: [Áreas afectadas y alcance del cambio]
|
|
132
|
-
🚀 **RECOMENDACIÓN**: [Tipo de versión y estrategia recomendada]
|
|
133
|
-
|
|
134
|
-
## 🖥️ COMANDOS PARA macOS
|
|
135
|
-
\`\`\`bash
|
|
136
|
-
# [Descripción del primer comando]
|
|
137
|
-
[comando exacto con parámetros]
|
|
138
|
-
|
|
139
|
-
# [Descripción del segundo comando]
|
|
140
|
-
[segundo comando exacto]
|
|
141
|
-
\`\`\`
|
|
142
|
-
|
|
143
|
-
## 🐧 COMANDOS PARA LINUX ARM (después de macOS)
|
|
144
|
-
\`\`\`bash
|
|
145
|
-
# SSH y preparación
|
|
146
|
-
ssh user@raspberry-pi
|
|
147
|
-
git pull origin master && bun install
|
|
148
|
-
|
|
149
|
-
# [Descripción del build ARM]
|
|
150
|
-
[comandos específicos de ARM]
|
|
151
|
-
\`\`\`
|
|
152
|
-
|
|
153
|
-
## ✅ VERIFICACIONES AUTOMÁTICAS
|
|
154
|
-
- [Lista de verificaciones que se ejecutarán]
|
|
155
|
-
\`\`\`
|
|
156
|
-
|
|
157
|
-
${STANDARD_PROMPT_SUFFIX}`;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Genera prompt para releases automáticas
|
|
161
|
-
*/
|
|
162
|
-
export function createReleasePrompt(config) {
|
|
163
|
-
const { data, specificContext } = config;
|
|
164
|
-
return `${STANDARD_PROMPT_PREFIX}
|
|
165
|
-
|
|
166
|
-
# ANÁLISIS DE RELEASE
|
|
167
|
-
|
|
168
|
-
## Información de la Release
|
|
169
|
-
${JSON.stringify(data, null, 2)}
|
|
170
|
-
|
|
171
|
-
## Contexto Específico
|
|
172
|
-
${specificContext || 'Release automática'}
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## FORMATO DE RESPUESTA REQUERIDO
|
|
177
|
-
|
|
178
|
-
\`\`\`markdown
|
|
179
|
-
# 📦 ANÁLISIS DE RELEASE
|
|
180
|
-
|
|
181
|
-
## 🎯 RESUMEN
|
|
182
|
-
[Descripción de los cambios principales incluidos en esta release]
|
|
183
|
-
|
|
184
|
-
## 📋 CHANGELOG GENERADO
|
|
185
|
-
|
|
186
|
-
### ✨ Features
|
|
187
|
-
[Lista de nuevas funcionalidades]
|
|
188
|
-
|
|
189
|
-
### 🐛 Fixes
|
|
190
|
-
[Lista de correcciones de bugs]
|
|
191
|
-
|
|
192
|
-
### 🚀 Improvements
|
|
193
|
-
[Lista de mejoras]
|
|
194
|
-
|
|
195
|
-
### 🔧 Technical
|
|
196
|
-
[Cambios técnicos internos]
|
|
197
|
-
|
|
198
|
-
## 🏷️ INFORMACIÓN DE VERSIÓN
|
|
199
|
-
- **Versión**: [versión calculada]
|
|
200
|
-
- **Prefijo**: [alpha/beta/rc/stable]
|
|
201
|
-
- **Canal OTA**: [dev/beta/stable]
|
|
202
|
-
- **Tipo de cambio**: [major/minor/patch]
|
|
203
|
-
|
|
204
|
-
## 📝 NOTAS DE RELEASE
|
|
205
|
-
[Texto descriptivo para usuarios finales]
|
|
206
|
-
\`\`\`
|
|
207
|
-
|
|
208
|
-
${STANDARD_PROMPT_SUFFIX}`;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Parser genérico para respuestas de Gemini
|
|
212
|
-
*/
|
|
213
|
-
export class GeminiResponseParser {
|
|
214
|
-
/**
|
|
215
|
-
* Extrae múltiples propuestas de commit del formato estándar
|
|
216
|
-
*/
|
|
217
|
-
static parseCommitProposals(response) {
|
|
218
|
-
const proposals = [];
|
|
219
|
-
// Buscar todas las propuestas con el formato: ### **Propuesta de Commit #N**
|
|
220
|
-
const proposalPattern = /###\s*\*\*Propuesta de Commit #\d+\*\*/g;
|
|
221
|
-
const proposalMatches = Array.from(response.matchAll(proposalPattern));
|
|
222
|
-
if (proposalMatches.length === 0) {
|
|
223
|
-
// Formato de un solo commit sin numeración
|
|
224
|
-
const codeBlock = this.extractCodeBlock(response);
|
|
225
|
-
if (codeBlock) {
|
|
226
|
-
const parsed = this.parseCommitContent(codeBlock);
|
|
227
|
-
if (parsed)
|
|
228
|
-
proposals.push(parsed);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
// Múltiples propuestas numeradas
|
|
233
|
-
for (let i = 0; i < proposalMatches.length; i++) {
|
|
234
|
-
const startIndex = proposalMatches[i].index;
|
|
235
|
-
const endIndex = proposalMatches[i + 1]?.index || response.length;
|
|
236
|
-
const proposalSection = response.substring(startIndex, endIndex);
|
|
237
|
-
const codeBlock = this.extractCodeBlock(proposalSection);
|
|
238
|
-
if (codeBlock) {
|
|
239
|
-
const parsed = this.parseCommitContent(codeBlock);
|
|
240
|
-
if (parsed)
|
|
241
|
-
proposals.push(parsed);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return proposals;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Extrae bloque de código markdown
|
|
249
|
-
*/
|
|
250
|
-
static extractCodeBlock(text) {
|
|
251
|
-
const patterns = [
|
|
252
|
-
/```markdown\s*\n([\s\S]*?)\n```/, // ```markdown
|
|
253
|
-
/```\s*\n([\s\S]*?)\n```/, // ``` genérico
|
|
254
|
-
/```([\s\S]*?)```/ // sin saltos
|
|
255
|
-
];
|
|
256
|
-
for (const pattern of patterns) {
|
|
257
|
-
const match = text.match(pattern);
|
|
258
|
-
if (match)
|
|
259
|
-
return match[1].trim();
|
|
260
|
-
}
|
|
261
|
-
return null;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Parsea el contenido de un commit individual
|
|
265
|
-
*/
|
|
266
|
-
static parseCommitContent(content) {
|
|
267
|
-
const lines = content.split('\n');
|
|
268
|
-
// Título (primera línea no vacía)
|
|
269
|
-
let title = '';
|
|
270
|
-
let titleIndex = 0;
|
|
271
|
-
for (let i = 0; i < lines.length; i++) {
|
|
272
|
-
if (lines[i].trim()) {
|
|
273
|
-
title = lines[i].trim();
|
|
274
|
-
titleIndex = i;
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
if (!title)
|
|
279
|
-
return null;
|
|
280
|
-
// Extraer secciones
|
|
281
|
-
let description = '';
|
|
282
|
-
let technical = '';
|
|
283
|
-
let changelog = '';
|
|
284
|
-
let currentSection = 'description';
|
|
285
|
-
for (let i = titleIndex + 1; i < lines.length; i++) {
|
|
286
|
-
const line = lines[i];
|
|
287
|
-
if (line.includes('<technical>')) {
|
|
288
|
-
currentSection = 'technical';
|
|
289
|
-
continue;
|
|
290
|
-
}
|
|
291
|
-
else if (line.includes('</technical>')) {
|
|
292
|
-
currentSection = 'none';
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
else if (line.includes('<changelog>')) {
|
|
296
|
-
currentSection = 'changelog';
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
else if (line.includes('</changelog>')) {
|
|
300
|
-
currentSection = 'none';
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
if (currentSection === 'description' && line.trim()) {
|
|
304
|
-
description += line + '\n';
|
|
305
|
-
}
|
|
306
|
-
else if (currentSection === 'technical') {
|
|
307
|
-
technical += line + '\n';
|
|
308
|
-
}
|
|
309
|
-
else if (currentSection === 'changelog') {
|
|
310
|
-
changelog += line + '\n';
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return {
|
|
314
|
-
title,
|
|
315
|
-
description: description.trim(),
|
|
316
|
-
technical: technical.trim(),
|
|
317
|
-
changelog: changelog.trim()
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Parsea respuesta de workflow en formato estándar
|
|
322
|
-
*/
|
|
323
|
-
static parseWorkflowResponse(response) {
|
|
324
|
-
const analysisMatch = response.match(/🎯\s*\*\*ANÁLISIS\*\*:\s*(.+)/);
|
|
325
|
-
const impactMatch = response.match(/📊\s*\*\*IMPACTO\*\*:\s*(.+)/);
|
|
326
|
-
const recommendationMatch = response.match(/🚀\s*\*\*RECOMENDACIÓN\*\*:\s*(.+)/);
|
|
327
|
-
// Extraer comandos macOS
|
|
328
|
-
const macosSection = response.match(/##\s*🖥️\s*COMANDOS PARA macOS\s*```bash\s*([\s\S]*?)\s*```/);
|
|
329
|
-
const macosCommands = macosSection ? macosSection[1].split('\n').filter(line => line.trim() && !line.startsWith('#')) : [];
|
|
330
|
-
// Extraer comandos Linux ARM
|
|
331
|
-
const linuxSection = response.match(/##\s*🐧\s*COMANDOS PARA LINUX ARM[\s\S]*?```bash\s*([\s\S]*?)\s*```/);
|
|
332
|
-
const linuxCommands = linuxSection ? linuxSection[1].split('\n').filter(line => line.trim() && !line.startsWith('#')) : [];
|
|
333
|
-
// Extraer verificaciones
|
|
334
|
-
const verificationsSection = response.match(/##\s*✅\s*VERIFICACIONES AUTOMÁTICAS\s*([\s\S]*?)```/);
|
|
335
|
-
const verifications = verificationsSection ? verificationsSection[1].split('\n').filter(line => line.trim().startsWith('-')).map(line => line.replace(/^-\s*/, '')) : [];
|
|
336
|
-
return {
|
|
337
|
-
analysis: analysisMatch?.[1] || 'No disponible',
|
|
338
|
-
impact: impactMatch?.[1] || 'No disponible',
|
|
339
|
-
recommendation: recommendationMatch?.[1] || 'No disponible',
|
|
340
|
-
macosCommands,
|
|
341
|
-
linuxCommands,
|
|
342
|
-
verifications
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
}
|