responsive-system 1.7.6 → 1.7.7

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.6",
3
+ "version": "1.7.7",
4
4
  "description": "Sistema de layout responsivo con auto-scaling para Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/responsive-system.cjs",
@@ -21,22 +21,8 @@ const __filename = fileURLToPath(import.meta.url)
21
21
  const __dirname = path.dirname(__filename)
22
22
 
23
23
  // Obtener el directorio del proyecto consumidor
24
- // Cuando npm ejecuta postinstall, process.cwd() debería ser el proyecto consumidor
25
- // Pero si estamos en node_modules, necesitamos subir hasta el proyecto raíz
26
- let projectRoot = process.cwd()
27
- // Si process.cwd() está en node_modules, subir hasta encontrar el proyecto raíz
28
- if (projectRoot.includes('node_modules')) {
29
- // Subir hasta encontrar un directorio que no sea node_modules
30
- let currentDir = projectRoot
31
- while (currentDir !== path.dirname(currentDir)) {
32
- const parentDir = path.dirname(currentDir)
33
- if (!parentDir.includes('node_modules') || parentDir.endsWith('node_modules')) {
34
- projectRoot = parentDir
35
- break
36
- }
37
- currentDir = parentDir
38
- }
39
- }
24
+ // Cuando npm ejecuta postinstall, process.cwd() ya apunta al proyecto consumidor
25
+ const projectRoot = process.cwd()
40
26
  const packageJsonPath = path.join(projectRoot, 'package.json')
41
27
 
42
28
  // Detectar si se ejecuta como postinstall o manualmente
@@ -60,6 +46,11 @@ if (isCI && isPostinstall) {
60
46
  process.exit(0)
61
47
  }
62
48
 
49
+ // Si NO es postinstall y NO es manual, no hacer nada (evitar ejecución accidental)
50
+ if (!isPostinstall && !isManual) {
51
+ process.exit(0)
52
+ }
53
+
63
54
  console.log('')
64
55
  console.log('📦 responsive-system: Iniciando configuración...')
65
56
  console.log(` Directorio: ${projectRoot}`)