thecore-auth 0.0.26 → 0.0.28
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
|
@@ -12,7 +12,6 @@ const requiredDependencies = [
|
|
|
12
12
|
"react-router-dom",
|
|
13
13
|
"react-icons",
|
|
14
14
|
"jwt-decode",
|
|
15
|
-
"tailwindcss",
|
|
16
15
|
]
|
|
17
16
|
|
|
18
17
|
// Funzione per trovare il package.json dell'applicazione principale
|
|
@@ -55,8 +54,8 @@ const printDependencies = (packageJsonPath) => {
|
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
// Funzione per controllare
|
|
59
|
-
const
|
|
57
|
+
// Funzione per controllare le dipendenze e installare quelle mancanti
|
|
58
|
+
const checkAndInstallDependencies = (packageJsonPath, appRoot) => {
|
|
60
59
|
try {
|
|
61
60
|
const packageJsonContent = fs.readFileSync(packageJsonPath, "utf-8");
|
|
62
61
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -68,22 +67,38 @@ const checkDependencies = (packageJsonPath) => {
|
|
|
68
67
|
|
|
69
68
|
console.log("📦 Verifica delle dipendenze richieste:");
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
const missingDependencies = requiredDependencies.filter((dep) => !dependencies[dep]);
|
|
71
|
+
|
|
72
|
+
// Mostra quali dipendenze mancano
|
|
73
|
+
if (missingDependencies.length === 0) {
|
|
74
|
+
console.log("✅ Tutte le dipendenze richieste sono già installate!");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
missingDependencies.forEach((dep) => {
|
|
79
|
+
console.log(`❌ ${dep} NON è installato`);
|
|
79
80
|
});
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
// Installa solo le dipendenze mancanti (escludendo tailwindcss)
|
|
83
|
+
const dependenciesToInstall = missingDependencies.filter((dep) => dep !== "tailwindcss");
|
|
84
|
+
|
|
85
|
+
if (dependenciesToInstall.length > 0) {
|
|
86
|
+
console.log(`📥 Installazione delle dipendenze mancanti: ${dependenciesToInstall.join(", ")}...`);
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
execSync(`npm install ${dependenciesToInstall.join(" ")}`, {
|
|
90
|
+
cwd: appRoot,
|
|
91
|
+
stdio: "inherit",
|
|
92
|
+
});
|
|
93
|
+
console.log("✅ Dipendenze installate con successo!");
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error("❌ Errore durante l'installazione delle dipendenze:", error);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
85
98
|
}
|
|
86
99
|
|
|
100
|
+
console.log("⚠️ NOTA: 'tailwindcss' non è stato installato automaticamente. Dovrai farlo manualmente.");
|
|
101
|
+
|
|
87
102
|
} catch (error) {
|
|
88
103
|
console.error("❌ Errore nella lettura del package.json:", error);
|
|
89
104
|
process.exit(1);
|
|
@@ -99,9 +114,9 @@ try {
|
|
|
99
114
|
|
|
100
115
|
// Stampa le dipendenze
|
|
101
116
|
printDependencies(packageJsonPath);
|
|
102
|
-
|
|
117
|
+
|
|
103
118
|
// Controlla le dipendenze
|
|
104
|
-
|
|
119
|
+
checkAndInstallDependencies(packageJsonPath, appRoot);
|
|
105
120
|
|
|
106
121
|
} catch (error) {
|
|
107
122
|
console.error("❌ Errore generale:", error);
|