responsive-system 1.7.8 → 1.7.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/package.json +1 -1
- package/scripts/postinstall.js +18 -4
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -484,17 +484,31 @@ if (needsUpdate) {
|
|
|
484
484
|
console.log('✅ Todas las dependencias ya están en package.json')
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
// Verificar si el proyecto ya está configurado
|
|
487
|
+
// Verificar si el proyecto ya está configurado (antes de la función async)
|
|
488
488
|
const mainTsxPath = path.join(projectRoot, 'src', 'main.tsx')
|
|
489
489
|
const layoutsDir = path.join(projectRoot, 'src', 'layouts')
|
|
490
|
-
const
|
|
490
|
+
const viteConfigPath = path.join(projectRoot, 'vite.config.ts')
|
|
491
|
+
|
|
492
|
+
// Función helper para verificar si existe un archivo/directorio
|
|
493
|
+
const fileExists = (filePath) => {
|
|
494
|
+
try {
|
|
495
|
+
return typeof fs.existsSync === 'function' && fs.existsSync(filePath)
|
|
496
|
+
} catch (e) {
|
|
497
|
+
return false
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const isAlreadyConfigured = fileExists(mainTsxPath) &&
|
|
502
|
+
fileExists(layoutsDir) &&
|
|
503
|
+
fileExists(viteConfigPath)
|
|
491
504
|
|
|
492
505
|
// Función async para manejar la configuración del proyecto
|
|
493
506
|
(async () => {
|
|
507
|
+
|
|
494
508
|
// Si el proyecto está vacío, crear estructura base
|
|
495
509
|
if (isProjectEmpty) {
|
|
496
|
-
|
|
497
|
-
|
|
510
|
+
// Si ya está configurado, preguntar si quiere sobrescribir
|
|
511
|
+
if (isAlreadyConfigured) {
|
|
498
512
|
console.log('')
|
|
499
513
|
console.log('⚠️ El proyecto ya está configurado')
|
|
500
514
|
|