utn-cli 2.1.7 → 2.1.9
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/commands/commit.js +1 -1
- package/commands/pull.js +51 -0
- package/index.js +8 -0
- package/package.json +1 -1
- package/templates/frontend/src/app/app.routes.ts +0 -20
package/commands/commit.js
CHANGED
|
@@ -32,7 +32,7 @@ export async function runCommit() {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const PREGUNTA_MANUAL = '¿Ya hizo la actualización del manual?';
|
|
35
|
-
const PROMPT_MANUAL = `Necesito actualizar el manual Manual.md que se encuentra en la carpeta public, en donde se aborden todas las secciones nuevas que se contemplan en el frontend, el nivel de detalle del manual debe de ser alto, ya que no va a contener imágenes para guiar al usuario en la forma de ejecutar las diferentes acciones, debe ser compatible con las reglas de accesibilidad y para que sea
|
|
35
|
+
const PROMPT_MANUAL = `Necesito actualizar el manual Manual.md que se encuentra en la carpeta public, en donde se aborden todas las secciones nuevas que se contemplan en el frontend, el nivel de detalle del manual debe de ser alto, ya que no va a contener imágenes para guiar al usuario en la forma de ejecutar las diferentes acciones, debe ser compatible con las reglas de accesibilidad y para que sea leído programas lectores de pantalla, en el archivo app.routes.ts están las rutas disponibles que se deben incluir en el manual omitiendo las que estén comentadas.`;
|
|
36
36
|
|
|
37
37
|
for (const pregunta of preguntas) {
|
|
38
38
|
if (!await confirmarPaso(pregunta)) {
|
package/commands/pull.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { closeReadLine } from '../utils/index.js';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
|
|
6
|
+
export async function runGlobalPull() {
|
|
7
|
+
const currentDir = process.cwd();
|
|
8
|
+
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
9
|
+
const directories = entries.filter(entry => entry.isDirectory());
|
|
10
|
+
|
|
11
|
+
if (directories.length === 0) {
|
|
12
|
+
console.log('No se encontraron directorios en la carpeta actual.');
|
|
13
|
+
closeReadLine();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let encontroAlguno = false;
|
|
18
|
+
|
|
19
|
+
for (const dir of directories) {
|
|
20
|
+
const fullPath = path.join(currentDir, dir.name);
|
|
21
|
+
|
|
22
|
+
if (!fs.existsSync(path.join(fullPath, '.git'))) continue;
|
|
23
|
+
|
|
24
|
+
encontroAlguno = true;
|
|
25
|
+
process.chdir(fullPath);
|
|
26
|
+
|
|
27
|
+
console.log(`\n[${dir.name}] Asegurando rama 'desarrollo'...`);
|
|
28
|
+
try {
|
|
29
|
+
execSync('git checkout desarrollo', { stdio: 'inherit' });
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(`[${dir.name}] Error al cambiar a la rama 'desarrollo'. Continuando...`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.log(`[${dir.name}] Ejecutando git pull...`);
|
|
35
|
+
try {
|
|
36
|
+
execSync('git pull', { stdio: 'inherit' });
|
|
37
|
+
} catch {
|
|
38
|
+
console.error(`[${dir.name}] Error al ejecutar git pull. Continuando...`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
process.chdir(currentDir);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!encontroAlguno) {
|
|
45
|
+
console.log('No se encontraron repositorios Git en los directorios actuales.');
|
|
46
|
+
} else {
|
|
47
|
+
console.log('\nPull finalizado en todos los repositorios.');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
closeReadLine();
|
|
51
|
+
}
|
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { initDb, addTableDb, showDbVersion, updateDb } from './commands/db.js';
|
|
|
8
8
|
import { initBackend, updateBackend, addServiceBackend, showBackendVersion } from './commands/backend.js';
|
|
9
9
|
import { initFrontend, updateFrontend, cloneFrontendComponent, showFrontendVersion } from './commands/frontend.js';
|
|
10
10
|
import { runGlobalUpdate } from './commands/update.js';
|
|
11
|
+
import { runGlobalPull } from './commands/pull.js';
|
|
11
12
|
import { createComponent } from './commands/createComponent.js';
|
|
12
13
|
import { runCommit } from './commands/commit.js';
|
|
13
14
|
|
|
@@ -104,6 +105,13 @@ program.command('update')
|
|
|
104
105
|
await runGlobalUpdate();
|
|
105
106
|
});
|
|
106
107
|
|
|
108
|
+
// Define 'pull' command
|
|
109
|
+
program.command('pull')
|
|
110
|
+
.description('Recorre los directorios, cambia a la rama "desarrollo" y ejecuta git pull en cada repositorio Git.')
|
|
111
|
+
.action(async () => {
|
|
112
|
+
await runGlobalPull();
|
|
113
|
+
});
|
|
114
|
+
|
|
107
115
|
// Define 'create-component' command
|
|
108
116
|
program.command('create-component')
|
|
109
117
|
.description('Crea un nuevo servicio en el backend y un componente en el frontend simultáneamente.')
|
package/package.json
CHANGED
|
@@ -13,24 +13,4 @@ export const routes: Routes = [
|
|
|
13
13
|
path: 'manual',
|
|
14
14
|
loadComponent: () => import('./Componentes/Nucleo/manual/manual.component').then(m => m.ManualComponent)
|
|
15
15
|
},
|
|
16
|
-
{
|
|
17
|
-
path: 'tabla',
|
|
18
|
-
loadComponent: () => import('./Paginas/gestion-tabla/gestion-tabla.component').then(m => m.GestionTablaComponent)
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
path: 'aprobaciones',
|
|
22
|
-
loadComponent: () => import('./Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component').then(m => m.GestionTablaJefeComponent)
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
path: 'graficoDeModulos',
|
|
26
|
-
loadComponent: () => import('./Paginas/gestion-graficos/gestion-graficos.component').then(m => m.GestionGraficosComponent)
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
path: 'parametros-reportes',
|
|
30
|
-
loadComponent: () => import('./Paginas/gestion-de-reportes/gestion-de-reportes.component').then(m => m.GestionDeReportesComponent)
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
path: 'gestionIframe1',
|
|
34
|
-
loadComponent: () => import('./Paginas/gestion-iframe1/gestion-iframe1.component').then(m => m.GestionIframe1Component)
|
|
35
|
-
}
|
|
36
16
|
];
|