utn-cli 2.0.5 → 2.0.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.
- package/commands/backend.js +5 -5
- package/commands/db.js +1 -1
- package/commands/frontend.js +3 -8
- package/package.json +1 -1
package/commands/backend.js
CHANGED
|
@@ -7,7 +7,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
7
7
|
const __dirname = path.dirname(__filename);
|
|
8
8
|
|
|
9
9
|
async function inicializarProyectoBackend() {
|
|
10
|
-
const rutaDelModuloJson = path.join(__dirname, '
|
|
10
|
+
const rutaDelModuloJson = path.join(__dirname, '../package.json'); // Main CLI's package.json
|
|
11
11
|
const informacionDeRutaDelModuloJson = JSON.parse(fs.readFileSync(rutaDelModuloJson, 'utf-8'));
|
|
12
12
|
console.log(`Versión de utn-backend (a través de utn-cli): ${informacionDeRutaDelModuloJson.version}.`);
|
|
13
13
|
|
|
@@ -123,7 +123,7 @@ export async function initBackend() {
|
|
|
123
123
|
limpiarDirectorioActual(['commit-message.txt']);
|
|
124
124
|
console.log('Inicializando el proyecto de backend...');
|
|
125
125
|
|
|
126
|
-
const directoriodePlantillas = path.join(__dirname, '
|
|
126
|
+
const directoriodePlantillas = path.join(__dirname, '../templates/backend');
|
|
127
127
|
const directorioDestino = process.cwd();
|
|
128
128
|
|
|
129
129
|
if (!fs.existsSync(directoriodePlantillas)) {
|
|
@@ -148,7 +148,7 @@ export async function initBackend() {
|
|
|
148
148
|
export async function updateBackend() {
|
|
149
149
|
console.log('Actualizando el proyecto de backend...');
|
|
150
150
|
const archivosAExcluir = ['InformacionDelModulo.json', 'rutas.js', 'Monitoreo.js', 'API.js'];
|
|
151
|
-
const directoriodePlantillas = path.join(__dirname, '
|
|
151
|
+
const directoriodePlantillas = path.join(__dirname, '../templates/backend');
|
|
152
152
|
const directorioDestino = process.cwd();
|
|
153
153
|
|
|
154
154
|
if (!fs.existsSync(directoriodePlantillas)) {
|
|
@@ -158,7 +158,7 @@ export async function updateBackend() {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
copiarDirectorios(directoriodePlantillas, directorioDestino, archivosAExcluir);
|
|
161
|
-
mostrarVersion(path.join(__dirname, '
|
|
161
|
+
mostrarVersion(path.join(__dirname, '../package.json')); // Show main CLI version
|
|
162
162
|
console.log('Proyecto de backend actualizado exitosamente.');
|
|
163
163
|
closeReadLine();
|
|
164
164
|
}
|
|
@@ -278,6 +278,6 @@ export const routes: Routes = [`
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
export function showBackendVersion() {
|
|
281
|
-
mostrarVersion(path.join(__dirname, '
|
|
281
|
+
mostrarVersion(path.join(__dirname, '../package.json'));
|
|
282
282
|
closeReadLine();
|
|
283
283
|
}
|
package/commands/db.js
CHANGED
|
@@ -11,7 +11,7 @@ export async function initDb() {
|
|
|
11
11
|
limpiarDirectorioActual(['commit-message.txt']); // Assuming this is still relevant for DB
|
|
12
12
|
console.log('Inicializando el proyecto de base de datos...');
|
|
13
13
|
|
|
14
|
-
const directoriodePlantillas = path.join(__dirname, '
|
|
14
|
+
const directoriodePlantillas = path.join(__dirname, '../templates/bd');
|
|
15
15
|
const directorioDestino = process.cwd();
|
|
16
16
|
|
|
17
17
|
if (!fs.existsSync(directoriodePlantillas)) {
|
package/commands/frontend.js
CHANGED
|
@@ -7,12 +7,7 @@ import { execSync } from 'child_process';
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = path.dirname(__filename);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
console.log('Limpiando directorio actual...');
|
|
12
|
-
limpiarDirectorioActual(['commit-message.txt']);
|
|
13
|
-
console.log('Inicializando el proyecto de frontend...');
|
|
14
|
-
|
|
15
|
-
const directoriodePlantillas = path.join(__dirname, '../../templates/frontend');
|
|
10
|
+
const directoriodePlantillas = path.join(__dirname, '../templates/frontend');
|
|
16
11
|
const directorioDestino = process.cwd();
|
|
17
12
|
|
|
18
13
|
if (!fs.existsSync(directoriodePlantillas)) {
|
|
@@ -44,7 +39,7 @@ export async function initFrontend() {
|
|
|
44
39
|
export async function updateFrontend() {
|
|
45
40
|
console.log('Actualizando el proyecto de frontend...');
|
|
46
41
|
const archivosAExcluir = ['app.routes.ts', 'contenedor-principal.component.css', 'contenedor-principal.component.html', 'contenedor-principal.component.ts', '.vscode', 'dist'];
|
|
47
|
-
const directoriodePlantillas = path.join(__dirname, '
|
|
42
|
+
const directoriodePlantillas = path.join(__dirname, '../templates/frontend');
|
|
48
43
|
const directorioDestino = process.cwd();
|
|
49
44
|
|
|
50
45
|
if (!fs.existsSync(directoriodePlantillas)) {
|
|
@@ -113,7 +108,7 @@ export async function cloneFrontendComponent() {
|
|
|
113
108
|
const nombreClase = `GestionTabla${nombreCapitalizado}Component`;
|
|
114
109
|
const nombreRuta = `gestion-tabla-${nombreLower}`;
|
|
115
110
|
|
|
116
|
-
const rutaFuente = path.join(__dirname, '
|
|
111
|
+
const rutaFuente = path.join(__dirname, '../templates/frontend', 'src', 'app', 'Paginas', 'gestion-tabla-XYZ');
|
|
117
112
|
const rutaDestino = path.join(process.cwd(), 'src', 'app', 'Paginas', nombreRuta);
|
|
118
113
|
|
|
119
114
|
if (!fs.existsSync(rutaFuente)) {
|