responsive-system 1.7.2 → 1.7.4
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 +8 -8
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - Configura App.tsx con el layout seleccionado
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import fs from 'fs'
|
|
14
|
+
import * as fs from 'fs'
|
|
15
15
|
import path from 'path'
|
|
16
16
|
import { execSync } from 'child_process'
|
|
17
17
|
import { fileURLToPath } from 'url'
|
|
@@ -50,14 +50,14 @@ console.log(` Directorio: ${projectRoot}`)
|
|
|
50
50
|
console.log('')
|
|
51
51
|
|
|
52
52
|
// Verificar si package.json existe
|
|
53
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
53
|
+
if (!fs.fs.existsSync(packageJsonPath)) {
|
|
54
54
|
console.log('⚠️ No se encontró package.json, saltando configuración')
|
|
55
55
|
process.exit(0)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
let packageJson
|
|
59
59
|
try {
|
|
60
|
-
packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
60
|
+
packageJson = JSON.parse(fs.fs.readFileSync(packageJsonPath, 'utf8'))
|
|
61
61
|
} catch (error) {
|
|
62
62
|
console.error('❌ Error al leer package.json:', error.message)
|
|
63
63
|
process.exit(1)
|
|
@@ -126,18 +126,18 @@ function copyFileFromPackage(relativePath, targetPath, isComponent = false) {
|
|
|
126
126
|
const sourcePath = path.join(__dirname, '..', relativePath)
|
|
127
127
|
const destPath = path.join(projectRoot, targetPath)
|
|
128
128
|
|
|
129
|
-
if (!fs.existsSync(sourcePath)) {
|
|
129
|
+
if (!fs.fs.existsSync(sourcePath)) {
|
|
130
130
|
console.error(` ❌ No se encontró: ${relativePath}`)
|
|
131
131
|
return false
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// Crear directorio destino si no existe
|
|
135
135
|
const destDir = path.dirname(destPath)
|
|
136
|
-
if (!fs.existsSync(destDir)) {
|
|
137
|
-
fs.mkdirSync(destDir, { recursive: true })
|
|
136
|
+
if (!fs.fs.existsSync(destDir)) {
|
|
137
|
+
fs.fs.mkdirSync(destDir, { recursive: true })
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
let content = fs.readFileSync(sourcePath, 'utf8')
|
|
140
|
+
let content = fs.fs.readFileSync(sourcePath, 'utf8')
|
|
141
141
|
|
|
142
142
|
// Si es un componente, reemplazar importaciones relativas por importaciones del paquete
|
|
143
143
|
if (isComponent) {
|
|
@@ -158,7 +158,7 @@ function copyFileFromPackage(relativePath, targetPath, isComponent = false) {
|
|
|
158
158
|
)
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
fs.writeFileSync(destPath, content)
|
|
161
|
+
fs.fs.writeFileSync(destPath, content)
|
|
162
162
|
return true
|
|
163
163
|
}
|
|
164
164
|
|