utn-cli 2.1.22 → 2.1.24
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/backend.js
CHANGED
|
@@ -43,7 +43,7 @@ async function inicializarProyectoBackend() {
|
|
|
43
43
|
await askAndReplace('DESCRIPCION_DEL_PROYECTO', '¿Cuál es la descripción del proyecto?: ');
|
|
44
44
|
await askAndReplace('DETALLE_DEL_PROYECTO', '¿Cuál es el detalle del proyecto?: ');
|
|
45
45
|
|
|
46
|
-
const NOMBRE_DEL_CANONICO_DEL_PROYECTO = await askAndReplace('NOMBRE_DEL_CANONICO_DEL_PROYECTO', '¿Cuál es el nombre canónico del proyecto?: ',
|
|
46
|
+
const NOMBRE_DEL_CANONICO_DEL_PROYECTO = await askAndReplace('NOMBRE_DEL_CANONICO_DEL_PROYECTO', '¿Cuál es el nombre canónico del proyecto?: ', null, null, (val) => {
|
|
47
47
|
const oldFileName = path.join(process.cwd(), 'NOMBRE_DEL_CANONICO_DEL_PROYECTO.rest');
|
|
48
48
|
const newFileName = path.join(process.cwd(), `${val}.rest`);
|
|
49
49
|
if (fs.existsSync(newFileName)) {
|
|
@@ -62,7 +62,7 @@ async function inicializarProyectoBackend() {
|
|
|
62
62
|
await askAndReplace('TIPO_DE_TARJETA', '¿Cuál es el tipo de tarjeta? Posibles valores: Área, Proceso, Servicio: ');
|
|
63
63
|
// await askAndReplace('NOMBRE_DEL_ROL', '¿Cuál es el nombre del rol?: ', rutaDeInformacionDelModulo, 'NOMBRE_DEL_ROL');
|
|
64
64
|
|
|
65
|
-
const NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', '¿Cuál es el nombre del repositorio de base de datos?: ',
|
|
65
|
+
const NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', '¿Cuál es el nombre del repositorio de base de datos?: ', null, null, (val) => {
|
|
66
66
|
const rutaDeVariablesDeCalidad = path.join(process.cwd(), 'variables-calidad.env');
|
|
67
67
|
reemplazarContenidoEnArchivo(rutaDeVariablesDeCalidad, 'NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', val);
|
|
68
68
|
const rutaDeVariablesDeDesarrollo = path.join(process.cwd(), 'variables-desarrollo.env');
|
|
@@ -73,14 +73,14 @@ async function inicializarProyectoBackend() {
|
|
|
73
73
|
reemplazarContenidoEnArchivo(rutaDeDB, 'NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', val.slice(0, -3));
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
const NOMBRE_DEL_REPOSITORIO_DE_BACKEND = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BACKEND', '¿Cuál es el nombre del repositorio de backend?: ',
|
|
76
|
+
const NOMBRE_DEL_REPOSITORIO_DE_BACKEND = await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_BACKEND', '¿Cuál es el nombre del repositorio de backend?: ', null, null, (val) => {
|
|
77
77
|
const rutaPackage = path.join(process.cwd(), 'package.json');
|
|
78
78
|
reemplazarContenidoEnArchivo(rutaPackage, 'nombre_del_repositorio_backend', val);
|
|
79
79
|
const rutaDeserver = path.join(process.cwd(), 'server.js');
|
|
80
80
|
reemplazarContenidoEnArchivo(rutaDeserver, 'NOMBRE_DEL_REPOSITORIO_DE_BACKEND', `${val} corriendo en el puerto 80.`);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_FRONTEND', '¿Cuál es el nombre del repositorio de frontend?: '
|
|
83
|
+
await askAndReplace('NOMBRE_DEL_REPOSITORIO_DE_FRONTEND', '¿Cuál es el nombre del repositorio de frontend?: ');
|
|
84
84
|
await askAndReplace('NOMBRE_DEL_PERMISO', '¿Cuál es el nombre del permiso?: ');
|
|
85
85
|
await askAndReplace('DESCRIPCION_DEL_PERMISO', '¿Cuál es la descripción del permiso?: ');
|
|
86
86
|
// await askAndReplace('MENU_PADRE', '¿Cuál es el nombre canónico del menú padre?: ', rutaDeInformacionDelModulo, 'MENU_PADRE');
|
|
@@ -112,11 +112,11 @@ async function inicializarProyectoBackend() {
|
|
|
112
112
|
BACKENDS_QUE_CONSUME_ESTE_MODULO = BACKENDS_QUE_CONSUME_ESTE_MODULO.split(",").map((x) => "'" + x.trim() + "'").toString();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
if (BACKENDS_QUE_CONSUME_ESTE_MODULO.trim().length > 2) {
|
|
116
|
-
|
|
117
|
-
} else {
|
|
118
|
-
|
|
119
|
-
}
|
|
115
|
+
// if (BACKENDS_QUE_CONSUME_ESTE_MODULO.trim().length > 2) {
|
|
116
|
+
// reemplazarContenidoEnArchivo(rutaDeInformacionDelModulo, 'BACKENDS_QUE_CONSUME_ESTE_MODULO', BACKENDS_QUE_CONSUME_ESTE_MODULO);
|
|
117
|
+
// } else {
|
|
118
|
+
// reemplazarContenidoEnArchivo(rutaDeInformacionDelModulo, 'BACKENDS_QUE_CONSUME_ESTE_MODULO', '');
|
|
119
|
+
// }
|
|
120
120
|
|
|
121
121
|
await askAndReplace('VERSION', '¿Cuál es la versión del módulo?: ');
|
|
122
122
|
|
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@ class InformacionDelModulo {
|
|
|
77
77
|
return this._menuPadre;
|
|
78
78
|
};
|
|
79
79
|
getBackEndsQueConsumeEsteModulo() {
|
|
80
|
-
return info.BACKENDS_QUE_CONSUME_ESTE_MODULO;
|
|
80
|
+
return info.BACKENDS_QUE_CONSUME_ESTE_MODULO.split(',');
|
|
81
81
|
};
|
|
82
82
|
getUsuariosConAccesoInicial() {
|
|
83
83
|
return ['111050570', '204540859', '602990078', '109840817', '206860639', '801680123', '111050570'];
|
package/utils/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function hacerPreguntaTrim(pregunta) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function reemplazarContenidoEnArchivo(rutaDeArchivo, valorABuscar, valorAReemplazar) {
|
|
21
|
-
if (!fs.existsSync(rutaDeArchivo)) {
|
|
21
|
+
if (!rutaDeArchivo || !fs.existsSync(rutaDeArchivo)) {
|
|
22
22
|
// console.error(`El archivo ${rutaDeArchivo} no existe.`); // This might be desired behavior for files that don't always exist
|
|
23
23
|
return false; // Indicate that the file was not found or not replaced
|
|
24
24
|
}
|