awc-zns-mtd 2.0.0
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/.editorconfig +21 -0
- package/CHANGELOG.md +210 -0
- package/LICENSE +21 -0
- package/README.md +439 -0
- package/docs/examples/example-feature.md +94 -0
- package/docs/getting-started/quick-start.md +85 -0
- package/docs/guides/agent-guide.md +56 -0
- package/docs/guides/workflow-guide.md +49 -0
- package/docs/reference/commands-reference.md +93 -0
- package/docs/reference/methodology-design.md +193 -0
- package/package.json +66 -0
- package/src/modules/awc-zns-mtd/agents/architect-senior.agent.yaml +159 -0
- package/src/modules/awc-zns-mtd/agents/developer-pro.agent.yaml +197 -0
- package/src/modules/awc-zns-mtd/agents/qa-specialist.agent.yaml +225 -0
- package/src/modules/awc-zns-mtd/agents/zen-master.agent.yaml +142 -0
- package/src/modules/awc-zns-mtd/config.yaml +412 -0
- package/src/modules/awc-zns-mtd/templates/PRD-template.md +490 -0
- package/src/modules/awc-zns-mtd/templates/arquitectura-conceptual.md +431 -0
- package/src/modules/awc-zns-mtd/templates/cotizacion.md +333 -0
- package/src/modules/awc-zns-mtd/templates/discovery-notes.md +205 -0
- package/src/modules/awc-zns-mtd/templates/kickoff-agenda.md +297 -0
- package/src/modules/awc-zns-mtd/templates/oferta-comercial.md +279 -0
- package/src/modules/awc-zns-mtd/templates/viabilidad.md +281 -0
- package/src/modules/awc-zns-mtd/workflows/analisis-flow/workflow.yaml +500 -0
- package/src/modules/awc-zns-mtd/workflows/comercial-flow/workflow.yaml +444 -0
- package/src/modules/awc-zns-mtd/workflows/deployment-flow/workflow.yaml +395 -0
- package/src/modules/awc-zns-mtd/workflows/development-flow/workflow.yaml +321 -0
- package/src/modules/awc-zns-mtd/workflows/enterprise-flow/workflow.yaml +276 -0
- package/src/modules/awc-zns-mtd/workflows/inception-flow/workflow.yaml +588 -0
- package/src/modules/awc-zns-mtd/workflows/planificacion-flow/workflow.yaml +526 -0
- package/src/modules/awc-zns-mtd/workflows/qa-flow/workflow.yaml +291 -0
- package/src/modules/awc-zns-mtd/workflows/quick-flow/workflow.yaml +121 -0
- package/src/modules/awc-zns-mtd/workflows/standard-flow/workflow.yaml +181 -0
- package/src/modules/awc-zns-mtd/workflows/support-flow/workflow.yaml +438 -0
- package/src/modules/custom-agents/ARCHITECTURE.md +566 -0
- package/src/modules/custom-agents/CONVERSION_SUMMARY.md +315 -0
- package/src/modules/custom-agents/FINAL_SUMMARY.md +296 -0
- package/src/modules/custom-agents/README.md +628 -0
- package/src/modules/custom-agents/USAGE_GUIDE.md +306 -0
- package/src/modules/custom-agents/agents/aspnet-core-architect-senior.agent.yaml +368 -0
- package/src/modules/custom-agents/agents/backend-audit-master.agent.yaml +376 -0
- package/src/modules/custom-agents/agents/backend-java-senior.agent.yaml +606 -0
- package/src/modules/custom-agents/agents/c4-diagram-specialist.agent.yaml +345 -0
- package/src/modules/custom-agents/agents/consolidation-context-master.agent.yaml +318 -0
- package/src/modules/custom-agents/agents/cost-estimator-senior.agent.yaml +369 -0
- package/src/modules/custom-agents/agents/database-engineer-senior.agent.yaml +331 -0
- package/src/modules/custom-agents/agents/devsecops-onpremise-senior.agent.yaml +370 -0
- package/src/modules/custom-agents/agents/document-export-specialist.agent.yaml +355 -0
- package/src/modules/custom-agents/agents/dotnet-core-senior.agent.yaml +258 -0
- package/src/modules/custom-agents/agents/frontend-audit-master.agent.yaml +356 -0
- package/src/modules/custom-agents/agents/frontend-react-senior.agent.yaml +470 -0
- package/src/modules/custom-agents/agents/obsolescence-analyst-senior.agent.yaml +339 -0
- package/src/modules/custom-agents/agents/php-senior.agent.yaml +277 -0
- package/src/modules/custom-agents/agents/product-owner-business-analyst.agent.yaml +315 -0
- package/src/modules/custom-agents/agents/prompt-architect-senior.agent.yaml +398 -0
- package/src/modules/custom-agents/agents/prompt-engineer-senior.agent.yaml +431 -0
- package/src/modules/custom-agents/agents/python-senior.agent.yaml +347 -0
- package/src/modules/custom-agents/agents/react-native-senior.agent.yaml +292 -0
- package/src/modules/custom-agents/agents/solution-architect-senior.agent.yaml +496 -0
- package/src/modules/custom-agents/agents/technical-stories-architect.agent.yaml +402 -0
- package/src/modules/custom-agents/agents/validation-quality-master.agent.yaml +377 -0
- package/src/modules/custom-agents/cli/.awc-agents/aspnet-core-architect-senior.agent.yaml +368 -0
- package/src/modules/custom-agents/cli/.awc-agents/backend-audit-master.agent.yaml +376 -0
- package/src/modules/custom-agents/cli/.awc-agents/backend-java-senior.agent.yaml +606 -0
- package/src/modules/custom-agents/cli/.awc-agents/c4-diagram-specialist.agent.yaml +345 -0
- package/src/modules/custom-agents/cli/.awc-agents/consolidation-context-master.agent.yaml +318 -0
- package/src/modules/custom-agents/cli/.awc-agents/cost-estimator-senior.agent.yaml +369 -0
- package/src/modules/custom-agents/cli/.awc-agents/database-engineer-senior.agent.yaml +331 -0
- package/src/modules/custom-agents/cli/.awc-agents/devsecops-onpremise-senior.agent.yaml +370 -0
- package/src/modules/custom-agents/cli/.awc-agents/document-export-specialist.agent.yaml +355 -0
- package/src/modules/custom-agents/cli/.awc-agents/dotnet-core-senior.agent.yaml +258 -0
- package/src/modules/custom-agents/cli/.awc-agents/frontend-audit-master.agent.yaml +356 -0
- package/src/modules/custom-agents/cli/.awc-agents/frontend-react-senior.agent.yaml +470 -0
- package/src/modules/custom-agents/cli/.awc-agents/obsolescence-analyst-senior.agent.yaml +339 -0
- package/src/modules/custom-agents/cli/.awc-agents/php-senior.agent.yaml +277 -0
- package/src/modules/custom-agents/cli/.awc-agents/product-owner-business-analyst.agent.yaml +315 -0
- package/src/modules/custom-agents/cli/.awc-agents/prompt-architect-senior.agent.yaml +398 -0
- package/src/modules/custom-agents/cli/.awc-agents/prompt-engineer-senior.agent.yaml +431 -0
- package/src/modules/custom-agents/cli/.awc-agents/python-senior.agent.yaml +347 -0
- package/src/modules/custom-agents/cli/.awc-agents/react-native-senior.agent.yaml +292 -0
- package/src/modules/custom-agents/cli/.awc-agents/solution-architect-senior.agent.yaml +496 -0
- package/src/modules/custom-agents/cli/.awc-agents/technical-stories-architect.agent.yaml +402 -0
- package/src/modules/custom-agents/cli/.awc-agents/validation-quality-master.agent.yaml +377 -0
- package/src/modules/custom-agents/cli/CHANGELOG.md +77 -0
- package/src/modules/custom-agents/cli/LICENSE +21 -0
- package/src/modules/custom-agents/cli/PUBLISH.md +292 -0
- package/src/modules/custom-agents/cli/README.md +333 -0
- package/src/modules/custom-agents/cli/agents-data/aspnet-core-architect-senior.agent.yaml +368 -0
- package/src/modules/custom-agents/cli/agents-data/backend-audit-master.agent.yaml +376 -0
- package/src/modules/custom-agents/cli/agents-data/backend-java-senior.agent.yaml +606 -0
- package/src/modules/custom-agents/cli/agents-data/c4-diagram-specialist.agent.yaml +345 -0
- package/src/modules/custom-agents/cli/agents-data/consolidation-context-master.agent.yaml +318 -0
- package/src/modules/custom-agents/cli/agents-data/cost-estimator-senior.agent.yaml +369 -0
- package/src/modules/custom-agents/cli/agents-data/database-engineer-senior.agent.yaml +331 -0
- package/src/modules/custom-agents/cli/agents-data/devsecops-onpremise-senior.agent.yaml +370 -0
- package/src/modules/custom-agents/cli/agents-data/document-export-specialist.agent.yaml +355 -0
- package/src/modules/custom-agents/cli/agents-data/dotnet-core-senior.agent.yaml +258 -0
- package/src/modules/custom-agents/cli/agents-data/frontend-audit-master.agent.yaml +356 -0
- package/src/modules/custom-agents/cli/agents-data/frontend-react-senior.agent.yaml +470 -0
- package/src/modules/custom-agents/cli/agents-data/obsolescence-analyst-senior.agent.yaml +339 -0
- package/src/modules/custom-agents/cli/agents-data/php-senior.agent.yaml +277 -0
- package/src/modules/custom-agents/cli/agents-data/product-owner-business-analyst.agent.yaml +315 -0
- package/src/modules/custom-agents/cli/agents-data/prompt-architect-senior.agent.yaml +398 -0
- package/src/modules/custom-agents/cli/agents-data/prompt-engineer-senior.agent.yaml +431 -0
- package/src/modules/custom-agents/cli/agents-data/python-senior.agent.yaml +347 -0
- package/src/modules/custom-agents/cli/agents-data/react-native-senior.agent.yaml +292 -0
- package/src/modules/custom-agents/cli/agents-data/solution-architect-senior.agent.yaml +496 -0
- package/src/modules/custom-agents/cli/agents-data/technical-stories-architect.agent.yaml +402 -0
- package/src/modules/custom-agents/cli/agents-data/validation-quality-master.agent.yaml +377 -0
- package/src/modules/custom-agents/cli/awc-agent.js +372 -0
- package/src/modules/custom-agents/cli/config.yaml +478 -0
- package/src/modules/custom-agents/cli/package.json +63 -0
- package/src/modules/custom-agents/config.yaml +478 -0
- package/templates/.github/copilot-instructions.md +120 -0
- package/tools/cli/awc-cli.js +137 -0
- package/tools/cli/commands/config.js +148 -0
- package/tools/cli/commands/init.js +147 -0
- package/tools/cli/commands/install.js +188 -0
- package/tools/cli/commands/status.js +128 -0
- package/tools/cli/commands/validate.js +147 -0
- package/tools/cli/commands/version.js +49 -0
- package/tools/cli/utils/console-logger.js +153 -0
- package/tools/cli/utils/file-utils.js +178 -0
- package/tools/cli/utils/project-analyzer.js +280 -0
- package/tools/cli/utils/version.js +126 -0
- package/tools/version/README.md +272 -0
- package/tools/version/changelog-manager.js +288 -0
- package/tools/version/update-checker.js +234 -0
- package/tools/version/version-bump.js +90 -0
- package/tools/version/version-manager.js +224 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Analyzer
|
|
3
|
+
* Analiza proyectos para determinar workflow recomendado
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs-extra');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { countFiles, findFiles } = require('./file-utils');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Analiza un proyecto y retorna información relevante
|
|
12
|
+
*/
|
|
13
|
+
async function analyzeProject(projectPath) {
|
|
14
|
+
const analysis = {
|
|
15
|
+
technologies: [],
|
|
16
|
+
languages: [],
|
|
17
|
+
fileCount: 0,
|
|
18
|
+
directoryCount: 0,
|
|
19
|
+
complexity: 'medium',
|
|
20
|
+
size: 'medium',
|
|
21
|
+
hasTests: false,
|
|
22
|
+
hasDocs: false,
|
|
23
|
+
buildTools: []
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
// Detectar tecnologías por archivos de configuración
|
|
28
|
+
analysis.technologies = await detectTechnologies(projectPath);
|
|
29
|
+
|
|
30
|
+
// Detectar lenguajes
|
|
31
|
+
analysis.languages = await detectLanguages(projectPath);
|
|
32
|
+
|
|
33
|
+
// Contar archivos
|
|
34
|
+
analysis.fileCount = await countFiles(projectPath);
|
|
35
|
+
|
|
36
|
+
// Contar directorios
|
|
37
|
+
analysis.directoryCount = await countDirectories(projectPath);
|
|
38
|
+
|
|
39
|
+
// Detectar tests
|
|
40
|
+
analysis.hasTests = await hasTestDirectory(projectPath);
|
|
41
|
+
|
|
42
|
+
// Detectar documentación
|
|
43
|
+
analysis.hasDocs = await hasDocsDirectory(projectPath);
|
|
44
|
+
|
|
45
|
+
// Detectar build tools
|
|
46
|
+
analysis.buildTools = await detectBuildTools(projectPath);
|
|
47
|
+
|
|
48
|
+
// Calcular complejidad
|
|
49
|
+
analysis.complexity = calculateComplexity(analysis);
|
|
50
|
+
|
|
51
|
+
// Calcular tamaño
|
|
52
|
+
analysis.size = calculateSize(analysis);
|
|
53
|
+
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error('Error en análisis:', error.message);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return analysis;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Detecta tecnologías basándose en archivos de configuración
|
|
63
|
+
*/
|
|
64
|
+
async function detectTechnologies(projectPath) {
|
|
65
|
+
const technologies = [];
|
|
66
|
+
|
|
67
|
+
const techMarkers = {
|
|
68
|
+
'package.json': ['Node.js', 'npm'],
|
|
69
|
+
'yarn.lock': ['Yarn'],
|
|
70
|
+
'pnpm-lock.yaml': ['pnpm'],
|
|
71
|
+
'requirements.txt': ['Python', 'pip'],
|
|
72
|
+
'Pipfile': ['Python', 'Pipenv'],
|
|
73
|
+
'pyproject.toml': ['Python', 'Poetry'],
|
|
74
|
+
'Gemfile': ['Ruby', 'Bundler'],
|
|
75
|
+
'Cargo.toml': ['Rust', 'Cargo'],
|
|
76
|
+
'go.mod': ['Go'],
|
|
77
|
+
'pom.xml': ['Java', 'Maven'],
|
|
78
|
+
'build.gradle': ['Java/Kotlin', 'Gradle'],
|
|
79
|
+
'composer.json': ['PHP', 'Composer'],
|
|
80
|
+
'.csproj': ['C#', '.NET'],
|
|
81
|
+
'Dockerfile': ['Docker'],
|
|
82
|
+
'docker-compose.yml': ['Docker Compose'],
|
|
83
|
+
'.gitignore': ['Git'],
|
|
84
|
+
'tsconfig.json': ['TypeScript'],
|
|
85
|
+
'angular.json': ['Angular'],
|
|
86
|
+
'next.config.js': ['Next.js'],
|
|
87
|
+
'nuxt.config.js': ['Nuxt.js'],
|
|
88
|
+
'vue.config.js': ['Vue.js'],
|
|
89
|
+
'svelte.config.js': ['Svelte'],
|
|
90
|
+
'gatsby-config.js': ['Gatsby'],
|
|
91
|
+
'vite.config.js': ['Vite']
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
for (const [file, techs] of Object.entries(techMarkers)) {
|
|
95
|
+
if (await fs.pathExists(path.join(projectPath, file))) {
|
|
96
|
+
technologies.push(...techs);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return [...new Set(technologies)]; // Eliminar duplicados
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Detecta lenguajes de programación
|
|
105
|
+
*/
|
|
106
|
+
async function detectLanguages(projectPath) {
|
|
107
|
+
const languages = new Set();
|
|
108
|
+
|
|
109
|
+
const languageExtensions = {
|
|
110
|
+
'.js': 'JavaScript',
|
|
111
|
+
'.jsx': 'JavaScript',
|
|
112
|
+
'.ts': 'TypeScript',
|
|
113
|
+
'.tsx': 'TypeScript',
|
|
114
|
+
'.py': 'Python',
|
|
115
|
+
'.java': 'Java',
|
|
116
|
+
'.rb': 'Ruby',
|
|
117
|
+
'.php': 'PHP',
|
|
118
|
+
'.go': 'Go',
|
|
119
|
+
'.rs': 'Rust',
|
|
120
|
+
'.cs': 'C#',
|
|
121
|
+
'.cpp': 'C++',
|
|
122
|
+
'.c': 'C',
|
|
123
|
+
'.swift': 'Swift',
|
|
124
|
+
'.kt': 'Kotlin'
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
for (const [ext, lang] of Object.entries(languageExtensions)) {
|
|
128
|
+
const files = await findFiles(projectPath, new RegExp(`\\${ext}$`));
|
|
129
|
+
if (files.length > 0) {
|
|
130
|
+
languages.add(lang);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return Array.from(languages);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Cuenta directorios recursivamente
|
|
139
|
+
*/
|
|
140
|
+
async function countDirectories(dir, depth = 0, maxDepth = 10) {
|
|
141
|
+
let count = 0;
|
|
142
|
+
|
|
143
|
+
if (depth > maxDepth || !(await fs.pathExists(dir))) {
|
|
144
|
+
return count;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const items = await fs.readdir(dir, { withFileTypes: true });
|
|
148
|
+
|
|
149
|
+
for (const item of items) {
|
|
150
|
+
if (item.isDirectory() && !shouldIgnoreDirectory(item.name)) {
|
|
151
|
+
count++;
|
|
152
|
+
const subPath = path.join(dir, item.name);
|
|
153
|
+
count += await countDirectories(subPath, depth + 1, maxDepth);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return count;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Verifica si existe directorio de tests
|
|
162
|
+
*/
|
|
163
|
+
async function hasTestDirectory(projectPath) {
|
|
164
|
+
const testDirs = ['test', 'tests', '__tests__', 'spec', 'specs'];
|
|
165
|
+
|
|
166
|
+
for (const dir of testDirs) {
|
|
167
|
+
if (await fs.pathExists(path.join(projectPath, dir))) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Verifica si existe directorio de documentación
|
|
177
|
+
*/
|
|
178
|
+
async function hasDocsDirectory(projectPath) {
|
|
179
|
+
const docsDirs = ['docs', 'documentation', 'doc'];
|
|
180
|
+
|
|
181
|
+
for (const dir of docsDirs) {
|
|
182
|
+
if (await fs.pathExists(path.join(projectPath, dir))) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Detecta herramientas de build
|
|
192
|
+
*/
|
|
193
|
+
async function detectBuildTools(projectPath) {
|
|
194
|
+
const buildTools = [];
|
|
195
|
+
|
|
196
|
+
const buildMarkers = {
|
|
197
|
+
'webpack.config.js': 'Webpack',
|
|
198
|
+
'rollup.config.js': 'Rollup',
|
|
199
|
+
'gulpfile.js': 'Gulp',
|
|
200
|
+
'Gruntfile.js': 'Grunt',
|
|
201
|
+
'Makefile': 'Make',
|
|
202
|
+
'CMakeLists.txt': 'CMake'
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
for (const [file, tool] of Object.entries(buildMarkers)) {
|
|
206
|
+
if (await fs.pathExists(path.join(projectPath, file))) {
|
|
207
|
+
buildTools.push(tool);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return buildTools;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Calcula la complejidad del proyecto
|
|
216
|
+
*/
|
|
217
|
+
function calculateComplexity(analysis) {
|
|
218
|
+
const { fileCount, directoryCount, technologies } = analysis;
|
|
219
|
+
|
|
220
|
+
let score = 0;
|
|
221
|
+
|
|
222
|
+
// Basado en cantidad de archivos
|
|
223
|
+
if (fileCount > 1000) score += 3;
|
|
224
|
+
else if (fileCount > 500) score += 2;
|
|
225
|
+
else if (fileCount > 100) score += 1;
|
|
226
|
+
|
|
227
|
+
// Basado en cantidad de directorios
|
|
228
|
+
if (directoryCount > 100) score += 2;
|
|
229
|
+
else if (directoryCount > 50) score += 1;
|
|
230
|
+
|
|
231
|
+
// Basado en cantidad de tecnologías
|
|
232
|
+
if (technologies.length > 10) score += 2;
|
|
233
|
+
else if (technologies.length > 5) score += 1;
|
|
234
|
+
|
|
235
|
+
// Determinar nivel de complejidad
|
|
236
|
+
if (score >= 5) return 'high';
|
|
237
|
+
if (score >= 3) return 'medium';
|
|
238
|
+
return 'low';
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Calcula el tamaño del proyecto
|
|
243
|
+
*/
|
|
244
|
+
function calculateSize(analysis) {
|
|
245
|
+
const { fileCount } = analysis;
|
|
246
|
+
|
|
247
|
+
if (fileCount > 1000) return 'large';
|
|
248
|
+
if (fileCount > 100) return 'medium';
|
|
249
|
+
return 'small';
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Determina si un directorio debe ignorarse
|
|
254
|
+
*/
|
|
255
|
+
function shouldIgnoreDirectory(dirName) {
|
|
256
|
+
const ignoreDirs = [
|
|
257
|
+
'node_modules',
|
|
258
|
+
'.git',
|
|
259
|
+
'.awc',
|
|
260
|
+
'dist',
|
|
261
|
+
'build',
|
|
262
|
+
'out',
|
|
263
|
+
'target',
|
|
264
|
+
'vendor',
|
|
265
|
+
'__pycache__',
|
|
266
|
+
'.venv',
|
|
267
|
+
'venv',
|
|
268
|
+
'env'
|
|
269
|
+
];
|
|
270
|
+
|
|
271
|
+
return ignoreDirs.includes(dirName);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
module.exports = {
|
|
275
|
+
analyzeProject,
|
|
276
|
+
detectTechnologies,
|
|
277
|
+
detectLanguages,
|
|
278
|
+
calculateComplexity,
|
|
279
|
+
calculateSize
|
|
280
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Utilities
|
|
3
|
+
* Utilidades para manejo de versiones y actualizaciones
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const semver = require('semver');
|
|
7
|
+
const packageJson = require('../../../package.json');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Obtiene la versión actual del paquete
|
|
11
|
+
*/
|
|
12
|
+
function getVersion() {
|
|
13
|
+
return packageJson.version;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Verifica si hay actualizaciones disponibles
|
|
18
|
+
* @param {string} currentVersion - Versión actual
|
|
19
|
+
* @returns {Promise<{hasUpdate: boolean, latestVersion: string}>}
|
|
20
|
+
*/
|
|
21
|
+
async function checkForUpdates(currentVersion) {
|
|
22
|
+
try {
|
|
23
|
+
// En producción, esto consultaría el registro de npm
|
|
24
|
+
// Por ahora, simulamos que no hay actualización
|
|
25
|
+
const latestVersion = currentVersion;
|
|
26
|
+
|
|
27
|
+
const hasUpdate = semver.gt(latestVersion, currentVersion);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
hasUpdate,
|
|
31
|
+
latestVersion,
|
|
32
|
+
currentVersion
|
|
33
|
+
};
|
|
34
|
+
} catch (error) {
|
|
35
|
+
// Si falla la verificación (ej: sin internet), retornamos sin actualización
|
|
36
|
+
return {
|
|
37
|
+
hasUpdate: false,
|
|
38
|
+
latestVersion: currentVersion,
|
|
39
|
+
currentVersion,
|
|
40
|
+
error: error.message
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Compara dos versiones
|
|
47
|
+
* @returns {number} -1 si v1 < v2, 0 si v1 === v2, 1 si v1 > v2
|
|
48
|
+
*/
|
|
49
|
+
function compareVersions(v1, v2) {
|
|
50
|
+
if (semver.lt(v1, v2)) return -1;
|
|
51
|
+
if (semver.gt(v1, v2)) return 1;
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Valida si una versión es válida según semver
|
|
57
|
+
*/
|
|
58
|
+
function isValidVersion(version) {
|
|
59
|
+
return semver.valid(version) !== null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Obtiene la versión mayor (major)
|
|
64
|
+
*/
|
|
65
|
+
function getMajorVersion(version) {
|
|
66
|
+
return semver.major(version);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Obtiene la versión menor (minor)
|
|
71
|
+
*/
|
|
72
|
+
function getMinorVersion(version) {
|
|
73
|
+
return semver.minor(version);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Obtiene la versión de parche (patch)
|
|
78
|
+
*/
|
|
79
|
+
function getPatchVersion(version) {
|
|
80
|
+
return semver.patch(version);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Verifica si la versión satisface un rango
|
|
85
|
+
*/
|
|
86
|
+
function satisfiesRange(version, range) {
|
|
87
|
+
return semver.satisfies(version, range);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Incrementa la versión
|
|
92
|
+
* @param {string} version - Versión actual
|
|
93
|
+
* @param {string} type - Tipo de incremento: 'major', 'minor', 'patch'
|
|
94
|
+
*/
|
|
95
|
+
function incrementVersion(version, type = 'patch') {
|
|
96
|
+
return semver.inc(version, type);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Obtiene información detallada de la versión
|
|
101
|
+
*/
|
|
102
|
+
function getVersionInfo() {
|
|
103
|
+
const version = getVersion();
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
version,
|
|
107
|
+
major: getMajorVersion(version),
|
|
108
|
+
minor: getMinorVersion(version),
|
|
109
|
+
patch: getPatchVersion(version),
|
|
110
|
+
name: packageJson.name,
|
|
111
|
+
description: packageJson.description
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
module.exports = {
|
|
116
|
+
getVersion,
|
|
117
|
+
checkForUpdates,
|
|
118
|
+
compareVersions,
|
|
119
|
+
isValidVersion,
|
|
120
|
+
getMajorVersion,
|
|
121
|
+
getMinorVersion,
|
|
122
|
+
getPatchVersion,
|
|
123
|
+
satisfiesRange,
|
|
124
|
+
incrementVersion,
|
|
125
|
+
getVersionInfo
|
|
126
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Sistema de Versiones AWC ZNS-MTD
|
|
2
|
+
|
|
3
|
+
## Descripción
|
|
4
|
+
|
|
5
|
+
Sistema integral de gestión de versiones para el método AWC ZNS-MTD, basado en [Semantic Versioning 2.0.0](https://semver.org/lang/es/).
|
|
6
|
+
|
|
7
|
+
## Componentes
|
|
8
|
+
|
|
9
|
+
### 1. Version Manager (`version-manager.js`)
|
|
10
|
+
|
|
11
|
+
Gestor central de versiones del sistema.
|
|
12
|
+
|
|
13
|
+
**Funcionalidades:**
|
|
14
|
+
- Obtener versión actual
|
|
15
|
+
- Comparar versiones
|
|
16
|
+
- Verificar compatibilidad
|
|
17
|
+
- Incrementar versiones
|
|
18
|
+
- Validar formatos de versión
|
|
19
|
+
|
|
20
|
+
**Uso:**
|
|
21
|
+
```javascript
|
|
22
|
+
const versionManager = require('./version-manager');
|
|
23
|
+
|
|
24
|
+
// Obtener versión actual
|
|
25
|
+
const version = versionManager.getCurrentVersion();
|
|
26
|
+
|
|
27
|
+
// Comparar versiones
|
|
28
|
+
const comparison = versionManager.compareVersions('1.0.0', '1.1.0');
|
|
29
|
+
|
|
30
|
+
// Verificar compatibilidad
|
|
31
|
+
const compatible = versionManager.isCompatible('^1.0.0');
|
|
32
|
+
|
|
33
|
+
// Incrementar versión
|
|
34
|
+
const newVersion = versionManager.incrementVersion('minor');
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Update Checker (`update-checker.js`)
|
|
38
|
+
|
|
39
|
+
Verificador de actualizaciones disponibles.
|
|
40
|
+
|
|
41
|
+
**Funcionalidades:**
|
|
42
|
+
- Verificar actualizaciones en registro npm
|
|
43
|
+
- Determinar severidad de actualizaciones
|
|
44
|
+
- Generar mensajes de actualización
|
|
45
|
+
- Verificar compatibilidad de actualizaciones
|
|
46
|
+
- Detectar versiones deprecadas
|
|
47
|
+
|
|
48
|
+
**Uso:**
|
|
49
|
+
```javascript
|
|
50
|
+
const updateChecker = require('./update-checker');
|
|
51
|
+
|
|
52
|
+
// Verificar actualizaciones
|
|
53
|
+
const update = await updateChecker.checkForUpdates();
|
|
54
|
+
|
|
55
|
+
if (update.hasUpdate) {
|
|
56
|
+
console.log(`Nueva versión: ${update.latestVersion}`);
|
|
57
|
+
console.log(`Severidad: ${update.severity}`);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 3. Changelog Manager (`changelog-manager.js`)
|
|
62
|
+
|
|
63
|
+
Gestor de changelog automático.
|
|
64
|
+
|
|
65
|
+
**Funcionalidades:**
|
|
66
|
+
- Leer y parsear CHANGELOG.md
|
|
67
|
+
- Obtener notas de versiones específicas
|
|
68
|
+
- Agregar nuevas versiones
|
|
69
|
+
- Detectar breaking changes
|
|
70
|
+
- Generar resúmenes de cambios
|
|
71
|
+
|
|
72
|
+
**Uso:**
|
|
73
|
+
```javascript
|
|
74
|
+
const changelogManager = require('./changelog-manager');
|
|
75
|
+
|
|
76
|
+
// Obtener última versión
|
|
77
|
+
const latest = await changelogManager.getLatestRelease();
|
|
78
|
+
|
|
79
|
+
// Agregar nueva versión
|
|
80
|
+
await changelogManager.addVersion('1.1.0', '2026-01-07', {
|
|
81
|
+
added: ['Nueva funcionalidad X'],
|
|
82
|
+
fixed: ['Bug en componente Y']
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 4. Version Bump Script (`version-bump.js`)
|
|
87
|
+
|
|
88
|
+
Script CLI para incrementar versiones.
|
|
89
|
+
|
|
90
|
+
**Uso:**
|
|
91
|
+
```bash
|
|
92
|
+
# Incrementar versión patch (1.0.0 → 1.0.1)
|
|
93
|
+
node tools/version/version-bump.js patch
|
|
94
|
+
|
|
95
|
+
# Incrementar versión minor (1.0.1 → 1.1.0)
|
|
96
|
+
node tools/version/version-bump.js minor
|
|
97
|
+
|
|
98
|
+
# Incrementar versión major (1.1.0 → 2.0.0)
|
|
99
|
+
node tools/version/version-bump.js major
|
|
100
|
+
|
|
101
|
+
# Con mensaje personalizado
|
|
102
|
+
node tools/version/version-bump.js minor --message "Nueva funcionalidad de análisis"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Semantic Versioning
|
|
106
|
+
|
|
107
|
+
Formato: `MAJOR.MINOR.PATCH`
|
|
108
|
+
|
|
109
|
+
- **MAJOR**: Cambios incompatibles en la API (breaking changes)
|
|
110
|
+
- **MINOR**: Nuevas funcionalidades compatibles con versiones anteriores
|
|
111
|
+
- **PATCH**: Correcciones de bugs compatibles
|
|
112
|
+
|
|
113
|
+
### Cuándo incrementar cada versión:
|
|
114
|
+
|
|
115
|
+
**MAJOR (1.0.0 → 2.0.0)**
|
|
116
|
+
- Cambios en la estructura de agentes que requieren migración
|
|
117
|
+
- Modificaciones en formato de workflows
|
|
118
|
+
- Cambios en CLI que rompen scripts existentes
|
|
119
|
+
- Eliminación de funcionalidades
|
|
120
|
+
|
|
121
|
+
**MINOR (1.0.0 → 1.1.0)**
|
|
122
|
+
- Nuevos agentes
|
|
123
|
+
- Nuevos workflows
|
|
124
|
+
- Nuevos comandos CLI
|
|
125
|
+
- Nuevas funcionalidades sin breaking changes
|
|
126
|
+
|
|
127
|
+
**PATCH (1.0.0 → 1.0.1)**
|
|
128
|
+
- Corrección de bugs
|
|
129
|
+
- Mejoras de rendimiento
|
|
130
|
+
- Correcciones de documentación
|
|
131
|
+
- Refactorizaciones internas
|
|
132
|
+
|
|
133
|
+
## Flujo de Trabajo de Versionado
|
|
134
|
+
|
|
135
|
+
### 1. Durante el Desarrollo
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Trabajar en rama feature/nueva-funcionalidad
|
|
139
|
+
git checkout -b feature/nueva-funcionalidad
|
|
140
|
+
|
|
141
|
+
# Hacer commits descriptivos
|
|
142
|
+
git commit -m "feat: agregar nuevo agente DevOps"
|
|
143
|
+
git commit -m "fix: corregir validación en workflow"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 2. Preparar Release
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Ejecutar script de bump
|
|
150
|
+
node tools/version/version-bump.js minor --message "Nuevo agente DevOps"
|
|
151
|
+
|
|
152
|
+
# Revisar cambios generados
|
|
153
|
+
git diff package.json CHANGELOG.md
|
|
154
|
+
|
|
155
|
+
# Commit de versión
|
|
156
|
+
git add .
|
|
157
|
+
git commit -m "chore: bump version to 1.1.0"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 3. Publicar Release
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Crear tag
|
|
164
|
+
git tag -a v1.1.0 -m "Release v1.1.0"
|
|
165
|
+
|
|
166
|
+
# Push con tags
|
|
167
|
+
git push origin main
|
|
168
|
+
git push origin v1.1.0
|
|
169
|
+
|
|
170
|
+
# Publicar en npm (si aplica)
|
|
171
|
+
npm publish
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Integración con CLI
|
|
175
|
+
|
|
176
|
+
El sistema de versiones está integrado en los comandos CLI:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Ver versión actual y verificar actualizaciones
|
|
180
|
+
awc version
|
|
181
|
+
|
|
182
|
+
# Durante instalación, verifica versión compatible
|
|
183
|
+
awc install
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Formato de CHANGELOG.md
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
# Changelog
|
|
190
|
+
|
|
191
|
+
## [Unreleased]
|
|
192
|
+
### Añadido
|
|
193
|
+
- Funcionalidad en desarrollo
|
|
194
|
+
|
|
195
|
+
## [1.1.0] - 2026-01-07
|
|
196
|
+
### Añadido
|
|
197
|
+
- Nuevo agente DevOps
|
|
198
|
+
- Comandos de infraestructura
|
|
199
|
+
|
|
200
|
+
### Corregido
|
|
201
|
+
- Bug en validación de workflow
|
|
202
|
+
|
|
203
|
+
## [1.0.0] - 2026-01-07
|
|
204
|
+
### Añadido
|
|
205
|
+
- Lanzamiento inicial
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Tipos de Cambios
|
|
209
|
+
|
|
210
|
+
- **Añadido**: Nuevas funcionalidades
|
|
211
|
+
- **Cambiado**: Cambios en funcionalidades existentes
|
|
212
|
+
- **Obsoleto**: Funcionalidades deprecadas
|
|
213
|
+
- **Eliminado**: Funcionalidades removidas
|
|
214
|
+
- **Corregido**: Corrección de bugs
|
|
215
|
+
- **Seguridad**: Parches de seguridad
|
|
216
|
+
|
|
217
|
+
## Verificación de Actualizaciones
|
|
218
|
+
|
|
219
|
+
El sistema verifica automáticamente actualizaciones cada 24 horas y muestra mensajes según severidad:
|
|
220
|
+
|
|
221
|
+
- 🚨 **CRÍTICA**: Breaking changes (major)
|
|
222
|
+
- ⚡ **IMPORTANTE**: Nuevas funcionalidades (minor)
|
|
223
|
+
- 💡 **BAJA**: Correcciones de bugs (patch)
|
|
224
|
+
|
|
225
|
+
## Compatibilidad
|
|
226
|
+
|
|
227
|
+
El sistema garantiza compatibilidad dentro del mismo MAJOR version:
|
|
228
|
+
|
|
229
|
+
- Versión `1.x.x` es compatible con `1.y.z`
|
|
230
|
+
- Versión `2.x.x` puede tener breaking changes respecto a `1.x.x`
|
|
231
|
+
|
|
232
|
+
## Requerimientos de Sistema
|
|
233
|
+
|
|
234
|
+
Especificados en `package.json`:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"engines": {
|
|
239
|
+
"node": ">=18.0.0",
|
|
240
|
+
"npm": ">=9.0.0"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Scripts de Mantenimiento
|
|
246
|
+
|
|
247
|
+
Agregados a `package.json`:
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"scripts": {
|
|
252
|
+
"version:bump:major": "node tools/version/version-bump.js major",
|
|
253
|
+
"version:bump:minor": "node tools/version/version-bump.js minor",
|
|
254
|
+
"version:bump:patch": "node tools/version/version-bump.js patch",
|
|
255
|
+
"version:check": "awc version"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Mejores Prácticas
|
|
261
|
+
|
|
262
|
+
1. **Siempre actualizar CHANGELOG.md** con cada cambio significativo
|
|
263
|
+
2. **Usar commits convencionales** (feat:, fix:, chore:, etc.)
|
|
264
|
+
3. **Verificar compatibilidad** antes de incrementar major version
|
|
265
|
+
4. **Documentar breaking changes** claramente en CHANGELOG
|
|
266
|
+
5. **Mantener versiones en sync** entre package.json y sistema
|
|
267
|
+
6. **Probar actualizaciones** en entorno de desarrollo primero
|
|
268
|
+
7. **Comunicar cambios** al equipo antes de releases major
|
|
269
|
+
|
|
270
|
+
## Soporte
|
|
271
|
+
|
|
272
|
+
Para más información sobre versionado semántico: https://semver.org/lang/es/
|