responsive-system 1.0.0 → 1.0.1
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 +26 -4
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -39,6 +39,7 @@ if (!hasReact) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (!hasTailwind) {
|
|
42
|
+
// Instalar como devDependencies para que npx funcione
|
|
42
43
|
packagesToInstall.push('tailwindcss@^4.1.14', 'postcss@^8.5.6', 'autoprefixer@^10.4.21')
|
|
43
44
|
needsInstall = true
|
|
44
45
|
}
|
|
@@ -53,10 +54,31 @@ if (needsInstall && packagesToInstall.length > 0) {
|
|
|
53
54
|
console.log(` Instalando: ${packagesToInstall.join(', ')}`)
|
|
54
55
|
|
|
55
56
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
// Separar paquetes: React (dependencies) vs TypeScript/Tailwind (devDependencies)
|
|
58
|
+
const reactPackages = packagesToInstall.filter(pkg => pkg.includes('react'))
|
|
59
|
+
const devPackages = packagesToInstall.filter(pkg =>
|
|
60
|
+
pkg.includes('typescript') ||
|
|
61
|
+
pkg.includes('tailwind') ||
|
|
62
|
+
pkg.includes('postcss') ||
|
|
63
|
+
pkg.includes('autoprefixer')
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
// Instalar React como dependencies (se necesita en runtime)
|
|
67
|
+
if (reactPackages.length > 0) {
|
|
68
|
+
execSync(`npm install ${reactPackages.join(' ')}`, {
|
|
69
|
+
stdio: 'inherit',
|
|
70
|
+
cwd: projectRoot
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Instalar TypeScript y Tailwind como devDependencies (para que npx funcione)
|
|
75
|
+
if (devPackages.length > 0) {
|
|
76
|
+
execSync(`npm install ${devPackages.join(' ')} --save-dev`, {
|
|
77
|
+
stdio: 'inherit',
|
|
78
|
+
cwd: projectRoot
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
60
82
|
console.log('✅ responsive-system: Dependencias instaladas correctamente')
|
|
61
83
|
} catch (error) {
|
|
62
84
|
console.warn('⚠️ responsive-system: Error al instalar dependencias automáticamente')
|