utn-cli 2.1.5 → 2.1.6

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.
@@ -42,7 +42,7 @@ export async function initFrontend() {
42
42
 
43
43
  export async function updateFrontend(opciones = { cerrarAlFinalizar: true }) {
44
44
  console.log('Actualizando el proyecto de frontend...');
45
- const archivosAExcluir = ['app.routes.ts', 'contenedor-principal.component.ts', '.vscode', 'dist', 'Manual.md'];
45
+ const archivosAExcluir = ['app.routes.ts', '.vscode', 'dist', 'Manual.md'];
46
46
  const directoriodePlantillas = path.join(__dirname, '../templates/frontend');
47
47
  const directorioDestino = process.cwd();
48
48
 
@@ -387,47 +387,47 @@ function actualizarArchivosConfiguracion(nombreClase, nombreRuta, titulo, descri
387
387
  }
388
388
  }
389
389
 
390
- // --- Modificar contenedor-principal.component.ts ---
391
- console.log('Actualizando contenedor-principal.component.ts...');
392
- const rutaTs = path.join(process.cwd(), 'src', 'app', 'Paginas', 'contenedor-principal', 'contenedor-principal.component.ts');
393
- if (fs.existsSync(rutaTs)) {
394
- let contenidoTs = fs.readFileSync(rutaTs, 'utf-8');
395
- if (!contenidoTs.includes(`rutaASeguir: '${nombreRuta}'`)) {
396
- // Encontrar el array baseTarjetas y su contenido
397
- const regexBaseTarjetas = /let baseTarjetas: AnyTarjetaConfig\[\] = \[([\s\S]*?)\];/;
398
- const match = contenidoTs.match(regexBaseTarjetas);
390
+ // // --- Modificar contenedor-principal.component.ts ---
391
+ // console.log('Actualizando contenedor-principal.component.ts...');
392
+ // const rutaTs = path.join(process.cwd(), 'src', 'app', 'Paginas', 'contenedor-principal', 'contenedor-principal.component.ts');
393
+ // if (fs.existsSync(rutaTs)) {
394
+ // let contenidoTs = fs.readFileSync(rutaTs, 'utf-8');
395
+ // if (!contenidoTs.includes(`rutaASeguir: '${nombreRuta}'`)) {
396
+ // // Encontrar el array baseTarjetas y su contenido
397
+ // const regexBaseTarjetas = /let baseTarjetas: AnyTarjetaConfig\[\] = \[([\s\S]*?)\];/;
398
+ // const match = contenidoTs.match(regexBaseTarjetas);
399
399
 
400
- if (match) {
401
- const contenidoArray = match[1];
402
- // Buscar la última posición para incrementar
403
- const regexPosiciones = /position: (\d+)/g;
404
- let ultimaPosicion = 0;
405
- let m;
406
- while ((m = regexPosiciones.exec(contenidoArray)) !== null) {
407
- const pos = parseInt(m[1]);
408
- if (pos > ultimaPosicion) ultimaPosicion = pos;
409
- }
410
- const nuevaPosicion = ultimaPosicion + 10;
411
-
412
- const nuevaTarjeta = `,
413
- {
414
- type: 'single',
415
- position: ${nuevaPosicion},
416
- rutaASeguir: '${nombreRuta}',
417
- titulo: '${titulo}',
418
- descripcion: '${descripcion}',
419
- icono: 'table_chart'
420
- }`;
421
-
422
- // Insertar antes del cierre del array (el ]; que sigue al contenidoArray)
423
- const indiceCierre = contenidoTs.indexOf('];', match.index);
424
- if (indiceCierre !== -1) {
425
- contenidoTs = contenidoTs.slice(0, indiceCierre).trimEnd() + nuevaTarjeta + '\n ' + contenidoTs.slice(indiceCierre);
426
- fs.writeFileSync(rutaTs, contenidoTs);
427
- }
428
- }
429
- }
430
- }
400
+ // if (match) {
401
+ // const contenidoArray = match[1];
402
+ // // Buscar la última posición para incrementar
403
+ // const regexPosiciones = /position: (\d+)/g;
404
+ // let ultimaPosicion = 0;
405
+ // let m;
406
+ // while ((m = regexPosiciones.exec(contenidoArray)) !== null) {
407
+ // const pos = parseInt(m[1]);
408
+ // if (pos > ultimaPosicion) ultimaPosicion = pos;
409
+ // }
410
+ // const nuevaPosicion = ultimaPosicion + 10;
411
+
412
+ // const nuevaTarjeta = `,
413
+ // {
414
+ // type: 'single',
415
+ // position: ${nuevaPosicion},
416
+ // rutaASeguir: '${nombreRuta}',
417
+ // titulo: '${titulo}',
418
+ // descripcion: '${descripcion}',
419
+ // icono: 'table_chart'
420
+ // }`;
421
+
422
+ // // Insertar antes del cierre del array (el ]; que sigue al contenidoArray)
423
+ // const indiceCierre = contenidoTs.indexOf('];', match.index);
424
+ // if (indiceCierre !== -1) {
425
+ // contenidoTs = contenidoTs.slice(0, indiceCierre).trimEnd() + nuevaTarjeta + '\n ' + contenidoTs.slice(indiceCierre);
426
+ // fs.writeFileSync(rutaTs, contenidoTs);
427
+ // }
428
+ // }
429
+ // }
430
+ // }
431
431
  }
432
432
 
433
433
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",