awc-zns-mtd 2.6.1 → 2.7.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/package.json +1 -2
- package/src/modules/awc-zns-mtd/config.yaml +1 -1
- package/tools/cli/commands/init.js +2 -2
- package/tools/cli/commands/new-project.js +16 -16
- package/tools/cli/commands/status.js +5 -5
- package/tools/cli/commands/validate.js +2 -2
- package/tools/cli/utils/file-utils.js +23 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "awc-zns-mtd",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
5
5
|
"description": "AWC ZNS-MTD Method - Metodología de Transformación Digital Zen, Neutro y Sistemático",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"awc",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"author": "AWC Team",
|
|
25
25
|
"main": "tools/cli/awc-cli.js",
|
|
26
26
|
"bin": {
|
|
27
|
-
"awc": "tools/cli/awc-cli.js",
|
|
28
27
|
"zns": "tools/cli/awc-cli.js"
|
|
29
28
|
},
|
|
30
29
|
"scripts": {
|
|
@@ -21,8 +21,8 @@ async function initCommand(options = {}) {
|
|
|
21
21
|
|
|
22
22
|
// Verificar que existe .awc
|
|
23
23
|
if (!(await fs.pathExists(awcDir))) {
|
|
24
|
-
console.log(chalk.red('❌ Este directorio no es un proyecto
|
|
25
|
-
console.log(chalk.yellow(`\n💡 Ejecuta primero ${chalk.green('
|
|
24
|
+
console.log(chalk.red('❌ Este directorio no es un proyecto ZNS.'));
|
|
25
|
+
console.log(chalk.yellow(`\n💡 Ejecuta primero ${chalk.green('zns new <proyecto>')}\n`));
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -214,10 +214,10 @@ async function newProjectCommand(projectName, options = {}) {
|
|
|
214
214
|
// Próximos pasos
|
|
215
215
|
console.log(chalk.cyan('📚 Próximos Pasos:\n'));
|
|
216
216
|
console.log(` ${chalk.green('1.')} cd ${projectName}`);
|
|
217
|
-
console.log(` ${chalk.green('2.')}
|
|
217
|
+
console.log(` ${chalk.green('2.')} zns init ${chalk.gray('# Inicializar tipo de proyecto')}`);
|
|
218
218
|
console.log(` ${chalk.green('3.')} Leer ${chalk.yellow('NEXT_STEPS.md')} para más detalles\n`);
|
|
219
219
|
|
|
220
|
-
console.log(chalk.yellow('⚠️ La estructura de fases se creará al ejecutar') + chalk.green('
|
|
220
|
+
console.log(chalk.yellow('⚠️ La estructura de fases se creará al ejecutar') + chalk.green(' zns init\n'));
|
|
221
221
|
|
|
222
222
|
} catch (error) {
|
|
223
223
|
spinner.fail(chalk.red('❌ Error creando proyecto'));
|
|
@@ -247,10 +247,10 @@ Este proyecto ha sido creado con la estructura base de AWC ZNS-MTD.
|
|
|
247
247
|
### 1. Inicializar Tipo de Proyecto
|
|
248
248
|
|
|
249
249
|
\`\`\`bash
|
|
250
|
-
|
|
250
|
+
zns init
|
|
251
251
|
\`\`\`
|
|
252
252
|
|
|
253
|
-
El comando \`
|
|
253
|
+
El comando \`zns init\` te preguntará:
|
|
254
254
|
- Tipo de proyecto (auditoría, desarrollo nuevo, migración, etc.)
|
|
255
255
|
- Tecnologías a utilizar
|
|
256
256
|
- Tipo de workflow (quick, standard, enterprise)
|
|
@@ -278,16 +278,16 @@ El directorio \`.awc/\` contiene:
|
|
|
278
278
|
|
|
279
279
|
\`\`\`bash
|
|
280
280
|
# Inicializar proyecto (siguiente paso)
|
|
281
|
-
|
|
281
|
+
zns init
|
|
282
282
|
|
|
283
283
|
# Ver estado del proyecto
|
|
284
|
-
|
|
284
|
+
zns status
|
|
285
285
|
|
|
286
286
|
# Validar estructura
|
|
287
|
-
|
|
287
|
+
zns validate
|
|
288
288
|
|
|
289
289
|
# Ver configuración
|
|
290
|
-
|
|
290
|
+
zns config
|
|
291
291
|
\`\`\`
|
|
292
292
|
|
|
293
293
|
---
|
|
@@ -370,12 +370,12 @@ Tu proyecto ha sido creado con la **estructura base** de AWC ZNS-MTD.
|
|
|
370
370
|
Ejecuta el comando de inicialización:
|
|
371
371
|
|
|
372
372
|
\`\`\`bash
|
|
373
|
-
|
|
373
|
+
zns init
|
|
374
374
|
\`\`\`
|
|
375
375
|
|
|
376
|
-
### 🔍 ¿Qué hace \`
|
|
376
|
+
### 🔍 ¿Qué hace \`zns init\`?
|
|
377
377
|
|
|
378
|
-
El comando \`
|
|
378
|
+
El comando \`zns init\` te preguntará:
|
|
379
379
|
|
|
380
380
|
#### 1️⃣ Tipo de Proyecto
|
|
381
381
|
- **🔍 Auditoría de Código Existente**: Evaluar sistema legacy
|
|
@@ -396,7 +396,7 @@ El comando \`awc init\` te preguntará:
|
|
|
396
396
|
- Frontend: React, Angular, Vue
|
|
397
397
|
- Base de datos: SQL, NoSQL
|
|
398
398
|
|
|
399
|
-
### ✅ Resultado de \`
|
|
399
|
+
### ✅ Resultado de \`zns init\`
|
|
400
400
|
|
|
401
401
|
Basado en tus respuestas, creará automáticamente:
|
|
402
402
|
|
|
@@ -447,16 +447,16 @@ proyecto/
|
|
|
447
447
|
|
|
448
448
|
\`\`\`bash
|
|
449
449
|
# Inicializar proyecto
|
|
450
|
-
|
|
450
|
+
zns init
|
|
451
451
|
|
|
452
452
|
# Ver estado actual
|
|
453
|
-
|
|
453
|
+
zns status
|
|
454
454
|
|
|
455
455
|
# Validar estructura
|
|
456
|
-
|
|
456
|
+
zns validate
|
|
457
457
|
|
|
458
458
|
# Ver configuración
|
|
459
|
-
|
|
459
|
+
zns config
|
|
460
460
|
\`\`\`
|
|
461
461
|
|
|
462
462
|
### 📚 Más Información
|
|
@@ -21,7 +21,7 @@ async function statusCommand(options = {}) {
|
|
|
21
21
|
// Verificar si está instalado
|
|
22
22
|
if (!(await fs.pathExists(awcDir))) {
|
|
23
23
|
console.log(chalk.red('❌ AWC ZNS-MTD no está instalado en este proyecto.'));
|
|
24
|
-
console.log(chalk.yellow(`\n💡 Ejecuta ${chalk.green('
|
|
24
|
+
console.log(chalk.yellow(`\n💡 Ejecuta ${chalk.green('zns install')} para comenzar.\n`));
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -113,16 +113,16 @@ async function statusCommand(options = {}) {
|
|
|
113
113
|
console.log(chalk.green(' ✅ Sistema AWC ZNS-MTD funcionando correctamente'));
|
|
114
114
|
} else {
|
|
115
115
|
console.log(chalk.yellow(' ⚠️ Algunos componentes están faltando'));
|
|
116
|
-
console.log(chalk.gray(` Ejecuta ${chalk.green('
|
|
116
|
+
console.log(chalk.gray(` Ejecuta ${chalk.green('zns install --force')} para reparar`));
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
console.log(chalk.gray('─'.repeat(60)));
|
|
120
120
|
|
|
121
121
|
// Comandos sugeridos
|
|
122
122
|
console.log(chalk.cyan('\n💡 Comandos útiles:\n'));
|
|
123
|
-
console.log(` ${chalk.green('
|
|
124
|
-
console.log(` ${chalk.green('
|
|
125
|
-
console.log(` ${chalk.green('
|
|
123
|
+
console.log(` ${chalk.green('zns init')} - Analizar proyecto y recomendar workflow`);
|
|
124
|
+
console.log(` ${chalk.green('zns config')} - Configurar preferencias`);
|
|
125
|
+
console.log(` ${chalk.green('zns validate')} - Validar estructura del proyecto\n`);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
module.exports = { statusCommand };
|
|
@@ -137,10 +137,10 @@ async function validateCommand() {
|
|
|
137
137
|
console.log(chalk.green('✅ ¡Proyecto AWC ZNS-MTD totalmente válido!\n'));
|
|
138
138
|
} else if (errors.length === 0) {
|
|
139
139
|
console.log(chalk.yellow('⚠️ Proyecto válido con algunas advertencias\n'));
|
|
140
|
-
console.log(chalk.gray(` Ejecuta ${chalk.green('
|
|
140
|
+
console.log(chalk.gray(` Ejecuta ${chalk.green('zns install --force')} para reparar\n`));
|
|
141
141
|
} else {
|
|
142
142
|
console.log(chalk.red('❌ Proyecto tiene errores que requieren atención\n'));
|
|
143
|
-
console.log(chalk.gray(` Ejecuta ${chalk.green('
|
|
143
|
+
console.log(chalk.gray(` Ejecuta ${chalk.green('zns install --force')} para reparar\n`));
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -44,29 +44,39 @@ async function createConfigFile(awcDir, config) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Carga configuración desde archivo YAML
|
|
47
|
+
* Carga configuración desde archivo JSON o YAML
|
|
48
48
|
*/
|
|
49
49
|
async function loadConfig(awcDir) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
50
|
+
// Intentar primero JSON (usado por zns new)
|
|
51
|
+
const configJsonPath = path.join(awcDir, 'config.json');
|
|
52
|
+
if (await fs.pathExists(configJsonPath)) {
|
|
53
|
+
try {
|
|
54
|
+
return await fs.readJson(configJsonPath);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error('Error al cargar config.json:', error.message);
|
|
57
|
+
}
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
// Fallback a YAML (compatibilidad)
|
|
61
|
+
const configYamlPath = path.join(awcDir, 'config.yaml');
|
|
62
|
+
if (await fs.pathExists(configYamlPath)) {
|
|
63
|
+
try {
|
|
64
|
+
const content = await fs.readFile(configYamlPath, 'utf8');
|
|
65
|
+
return yaml.load(content);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error('Error al cargar config.yaml:', error.message);
|
|
68
|
+
}
|
|
62
69
|
}
|
|
70
|
+
|
|
71
|
+
return null;
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
/**
|
|
66
|
-
* Actualiza configuración existente
|
|
75
|
+
* Actualiza configuración existente (JSON)
|
|
67
76
|
*/
|
|
68
77
|
async function updateConfig(awcDir, newConfig) {
|
|
69
|
-
|
|
78
|
+
const configPath = path.join(awcDir, 'config.json');
|
|
79
|
+
await fs.writeJson(configPath, newConfig, { spaces: 2 });
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
/**
|