utn-cli 2.0.76 → 2.0.78
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/db.js
CHANGED
|
@@ -92,16 +92,40 @@ export async function updateDb(opciones = { cerrarAlFinalizar: true }) {
|
|
|
92
92
|
process.exit(1);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// Intentar recuperar el nombre del repositorio/base de datos antes de sobrescribir docker-compose.yml
|
|
96
|
+
const rutaCompose = path.join(directorioDestino, 'docker-compose.yml');
|
|
97
|
+
const rutaEstructuraDestino = path.join(directorioDestino, 'docker-scripts/1-crear estructura.sql');
|
|
98
|
+
let nombreRepositorio = '';
|
|
99
|
+
|
|
100
|
+
if (fs.existsSync(rutaCompose)) {
|
|
101
|
+
const contenidoCompose = fs.readFileSync(rutaCompose, 'utf-8');
|
|
102
|
+
const matchCompose = contenidoCompose.match(/^\s*(\S+):\s*\n\s*image:\s*mariadb:lts/m);
|
|
103
|
+
if (matchCompose && matchCompose[1]) {
|
|
104
|
+
nombreRepositorio = matchCompose[1];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!nombreRepositorio && fs.existsSync(rutaEstructuraDestino)) {
|
|
109
|
+
const contenidoEstructura = fs.readFileSync(rutaEstructuraDestino, 'utf-8');
|
|
110
|
+
const matchDb = contenidoEstructura.match(/CREATE DATABASE `(.+?)`/);
|
|
111
|
+
if (matchDb && matchDb[1]) {
|
|
112
|
+
nombreRepositorio = matchDb[1];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
95
116
|
// Copiar todos los archivos excepto la estructura base
|
|
96
117
|
copiarDirectorios(directoriodePlantillas, directorioDestino, archivosAExcluir);
|
|
97
118
|
|
|
119
|
+
if (nombreRepositorio) {
|
|
120
|
+
reemplazarContenidoEnArchivo(rutaCompose, 'NOMBRE_DEL_REPOSITORIO_DE_BASE_DE_DATOS', nombreRepositorio);
|
|
121
|
+
}
|
|
122
|
+
|
|
98
123
|
const gitignorePath = path.join(directorioDestino, 'cumulodb-scripts/gitignore');
|
|
99
124
|
if (fs.existsSync(gitignorePath)) {
|
|
100
125
|
fs.renameSync(gitignorePath, path.join(directorioDestino, 'cumulodb-scripts/.gitignore'));
|
|
101
126
|
}
|
|
102
127
|
|
|
103
128
|
// Lógica de merge para 1-crear estructura.sql
|
|
104
|
-
const rutaEstructuraDestino = path.join(directorioDestino, 'docker-scripts/1-crear estructura.sql');
|
|
105
129
|
const rutaEstructuraFuente = path.join(directoriodePlantillas, 'docker-scripts/1-crear estructura.sql');
|
|
106
130
|
|
|
107
131
|
if (fs.existsSync(rutaEstructuraDestino) && fs.existsSync(rutaEstructuraFuente)) {
|
package/commands/frontend.js
CHANGED
|
@@ -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.
|
|
45
|
+
const archivosAExcluir = ['app.routes.ts', 'contenedor-principal.component.ts', '.vscode', 'dist'];
|
|
46
46
|
const directoriodePlantillas = path.join(__dirname, '../templates/frontend');
|
|
47
47
|
const directorioDestino = process.cwd();
|
|
48
48
|
|
package/package.json
CHANGED
package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.css
CHANGED
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/* Forzamos 4 columnas calculando el espacio disponible */
|
|
11
|
-
.contenido
|
|
12
|
-
width: calc(25% - 12px);
|
|
11
|
+
.contenido>div[cdkDrag] {
|
|
12
|
+
width: calc(25% - 12px);
|
|
13
|
+
/* 25% menos una parte del gap (16px * 3 / 4) */
|
|
13
14
|
box-sizing: border-box;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.cdk-drag-preview {
|
|
17
18
|
box-sizing: border-box;
|
|
18
19
|
border-radius: 8px;
|
|
19
|
-
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
|
|
20
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
|
20
21
|
pointer-events: none;
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
border-radius: 8px;
|
|
28
29
|
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
29
30
|
/* El placeholder debe mantener el tamaño de la tarjeta */
|
|
30
|
-
min-height: 150px;
|
|
31
|
+
min-height: 150px;
|
|
32
|
+
/* Ajustar según la altura promedio de tus tarjetas */
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
.cdk-drag-animating {
|
|
@@ -40,13 +42,13 @@
|
|
|
40
42
|
|
|
41
43
|
/* Responsividad: 2 columnas en tablets, 1 en móviles */
|
|
42
44
|
@media (max-width: 1200px) {
|
|
43
|
-
.contenido
|
|
45
|
+
.contenido>div[cdkDrag] {
|
|
44
46
|
width: calc(50% - 8px);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
@media (max-width: 600px) {
|
|
49
|
-
.contenido
|
|
51
|
+
.contenido>div[cdkDrag] {
|
|
50
52
|
width: 100%;
|
|
51
53
|
}
|
|
52
|
-
}
|
|
54
|
+
}
|