responsive-system 1.0.4 → 1.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/package.json +1 -1
- package/scripts/postinstall.js +54 -36
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -57,49 +57,67 @@ if (!tailwindInRoot || !tailwindInDevDeps) {
|
|
|
57
57
|
needsInstall = true
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
// Verificar si TypeScript está en devDependencies
|
|
61
|
+
const typescriptInDevDeps = packageJson.devDependencies && packageJson.devDependencies.typescript
|
|
62
|
+
if (!typescriptInDevDeps) {
|
|
61
63
|
packagesToInstall.push('typescript@~5.9.3')
|
|
62
64
|
needsInstall = true
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
// SIEMPRE verificar e instalar si falta algo
|
|
68
|
+
console.log('📦 responsive-system: Verificando dependencias...')
|
|
69
|
+
|
|
70
|
+
// Separar paquetes: React (dependencies) vs TypeScript/Tailwind (devDependencies)
|
|
71
|
+
const reactPackages = []
|
|
72
|
+
const devPackages = []
|
|
73
|
+
|
|
74
|
+
// React
|
|
75
|
+
if (!hasReact) {
|
|
76
|
+
reactPackages.push('react@^19.1.1', 'react-dom@^19.1.1')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// TypeScript y Tailwind
|
|
80
|
+
const tailwindInDevDeps = packageJson.devDependencies && packageJson.devDependencies.tailwindcss
|
|
81
|
+
if (!tailwindInDevDeps) {
|
|
82
|
+
devPackages.push('tailwindcss@^4.1.14', 'postcss@^8.5.6', 'autoprefixer@^10.4.21')
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const typescriptInDevDeps = packageJson.devDependencies && packageJson.devDependencies.typescript
|
|
86
|
+
if (!typescriptInDevDeps) {
|
|
87
|
+
devPackages.push('typescript@~5.9.3')
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Instalar React como dependencies (se necesita en runtime)
|
|
91
|
+
if (reactPackages.length > 0) {
|
|
92
|
+
console.log(`📦 responsive-system: Instalando React...`)
|
|
93
|
+
console.log(` Instalando: ${reactPackages.join(', ')}`)
|
|
94
|
+
try {
|
|
95
|
+
execSync(`npm install ${reactPackages.join(' ')}`, {
|
|
96
|
+
stdio: 'inherit',
|
|
97
|
+
cwd: projectRoot
|
|
98
|
+
})
|
|
99
|
+
console.log('✅ responsive-system: React instalado correctamente')
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.warn('⚠️ responsive-system: Error al instalar React')
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Instalar TypeScript y Tailwind como devDependencies (para que npx funcione)
|
|
106
|
+
if (devPackages.length > 0) {
|
|
107
|
+
console.log(`📦 responsive-system: Instalando TypeScript y Tailwind...`)
|
|
108
|
+
console.log(` Instalando: ${devPackages.join(', ')}`)
|
|
69
109
|
try {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
pkg.includes('postcss') ||
|
|
76
|
-
pkg.includes('autoprefixer')
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
// Instalar React como dependencies (se necesita en runtime)
|
|
80
|
-
if (reactPackages.length > 0) {
|
|
81
|
-
execSync(`npm install ${reactPackages.join(' ')}`, {
|
|
82
|
-
stdio: 'inherit',
|
|
83
|
-
cwd: projectRoot
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Instalar TypeScript y Tailwind como devDependencies (para que npx funcione)
|
|
88
|
-
// Usar --force para asegurar que se instalen en el proyecto raíz
|
|
89
|
-
if (devPackages.length > 0) {
|
|
90
|
-
execSync(`npm install ${devPackages.join(' ')} --save-dev --force`, {
|
|
91
|
-
stdio: 'inherit',
|
|
92
|
-
cwd: projectRoot
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
console.log('✅ responsive-system: Dependencias instaladas correctamente')
|
|
110
|
+
execSync(`npm install ${devPackages.join(' ')} --save-dev`, {
|
|
111
|
+
stdio: 'inherit',
|
|
112
|
+
cwd: projectRoot
|
|
113
|
+
})
|
|
114
|
+
console.log('✅ responsive-system: TypeScript y Tailwind instalados correctamente')
|
|
97
115
|
} catch (error) {
|
|
98
|
-
console.warn('⚠️ responsive-system: Error al instalar
|
|
99
|
-
console.warn(' Por favor, instala manualmente:')
|
|
100
|
-
console.warn(` npm install ${packagesToInstall.join(' ')}`)
|
|
116
|
+
console.warn('⚠️ responsive-system: Error al instalar TypeScript/Tailwind')
|
|
101
117
|
}
|
|
102
|
-
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (reactPackages.length === 0 && devPackages.length === 0) {
|
|
103
121
|
console.log('✅ responsive-system: Todas las dependencias están instaladas')
|
|
104
122
|
}
|
|
105
123
|
|