responsive-system 1.7.9 → 1.7.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "responsive-system",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "Sistema de layout responsivo con auto-scaling para Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/responsive-system.cjs",
@@ -25,9 +25,12 @@ const __dirname = path.dirname(__filename)
25
25
  const projectRoot = process.cwd()
26
26
  const packageJsonPath = path.join(projectRoot, 'package.json')
27
27
 
28
- // Detectar si se ejecuta como postinstall o manualmente
29
- const isPostinstall = process.env.npm_lifecycle_event === 'postinstall'
30
- const isManual = process.argv[1].includes('postinstall.js') && !isPostinstall
28
+ // Detectar si se ejecuta como postinstall del paquete instalado
29
+ // El script se ejecuta desde node_modules/responsive-system/scripts/postinstall.js
30
+ const scriptPath = fileURLToPath(import.meta.url)
31
+ const isFromNodeModules = scriptPath.includes('node_modules' + path.sep + 'responsive-system')
32
+ const isPostinstall = process.env.npm_lifecycle_event === 'postinstall' || isFromNodeModules
33
+ const isManual = process.argv[1].includes('postinstall.js') && !isFromNodeModules
31
34
 
32
35
  // Detectar CI/CD environments
33
36
  const isCI = !!(
@@ -484,26 +487,28 @@ if (needsUpdate) {
484
487
  console.log('✅ Todas las dependencias ya están en package.json')
485
488
  }
486
489
 
487
- // Verificar si el proyecto ya está configurado (antes de la función async)
488
- const mainTsxPath = path.join(projectRoot, 'src', 'main.tsx')
489
- const layoutsDir = path.join(projectRoot, 'src', 'layouts')
490
- const viteConfigPath = path.join(projectRoot, 'vite.config.ts')
490
+ // Función async para manejar la configuración del proyecto
491
+ (async () => {
492
+ // Verificar que fs.existsSync esté disponible
493
+ if (typeof fs.existsSync !== 'function') {
494
+ console.error('❌ Error: fs.existsSync no está disponible')
495
+ process.exit(1)
496
+ }
491
497
 
492
- // Función helper para verificar si existe un archivo/directorio
493
- const fileExists = (filePath) => {
498
+ // Verificar si el proyecto ya está configurado
499
+ const mainTsxPath = path.join(projectRoot, 'src', 'main.tsx')
500
+ const layoutsDir = path.join(projectRoot, 'src', 'layouts')
501
+ const viteConfigPath = path.join(projectRoot, 'vite.config.ts')
502
+
503
+ let isAlreadyConfigured = false
494
504
  try {
495
- return typeof fs.existsSync === 'function' && fs.existsSync(filePath)
505
+ isAlreadyConfigured = fs.existsSync(mainTsxPath) &&
506
+ fs.existsSync(layoutsDir) &&
507
+ fs.existsSync(viteConfigPath)
496
508
  } catch (e) {
497
- return false
509
+ console.error('❌ Error al verificar archivos existentes:', e.message)
510
+ isAlreadyConfigured = false
498
511
  }
499
- }
500
-
501
- const isAlreadyConfigured = fileExists(mainTsxPath) &&
502
- fileExists(layoutsDir) &&
503
- fileExists(viteConfigPath)
504
-
505
- // Función async para manejar la configuración del proyecto
506
- (async () => {
507
512
 
508
513
  // Si el proyecto está vacío, crear estructura base
509
514
  if (isProjectEmpty) {