thecore-auth 0.0.25 → 0.0.26

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,7 +1,7 @@
1
1
  {
2
2
  "name": "thecore-auth",
3
3
  "private": false,
4
- "version": "0.0.25",
4
+ "version": "0.0.26",
5
5
  "type": "module",
6
6
  "main": "dist/thecore-auth.cjs.js",
7
7
  "module": "dist/thecore-auth.esm.js",
@@ -6,6 +6,15 @@ import { fileURLToPath } from "url";
6
6
  const __filename = fileURLToPath(import.meta.url);
7
7
  const __dirname = path.dirname(__filename);
8
8
 
9
+ // Dipendenze rischieste
10
+ const requiredDependencies = [
11
+ "axios",
12
+ "react-router-dom",
13
+ "react-icons",
14
+ "jwt-decode",
15
+ "tailwindcss",
16
+ ]
17
+
9
18
  // Funzione per trovare il package.json dell'applicazione principale
10
19
  const findAppRoot = () => {
11
20
  let dir = path.resolve(__dirname, "../.."); // Risali dalla directory del pacchetto (node_modules/thecore-auth)
@@ -46,6 +55,42 @@ const printDependencies = (packageJsonPath) => {
46
55
  }
47
56
  };
48
57
 
58
+ // Funzione per controllare se le dipendenze richieste sono installate
59
+ const checkDependencies = (packageJsonPath) => {
60
+ try {
61
+ const packageJsonContent = fs.readFileSync(packageJsonPath, "utf-8");
62
+ const packageJson = JSON.parse(packageJsonContent);
63
+
64
+ const dependencies = {
65
+ ...packageJson.dependencies,
66
+ ...packageJson.devDependencies,
67
+ };
68
+
69
+ console.log("šŸ“¦ Verifica delle dipendenze richieste:");
70
+
71
+ let allDependenciesFound = true;
72
+ REQUIRED_DEPENDENCIES.forEach((dep) => {
73
+ if (dependencies[dep]) {
74
+ console.log(`āœ… ${dep} ĆØ installato (versione: ${dependencies[dep]})`);
75
+ } else {
76
+ console.log(`āŒ ${dep} NON ĆØ installato`);
77
+ allDependenciesFound = false;
78
+ }
79
+ });
80
+
81
+ if (!allDependenciesFound) {
82
+ console.warn(
83
+ "\nāš ļø Alcune dipendenze richieste non sono installate. Assicurati di aggiungerle manualmente o tramite npm/yarn."
84
+ );
85
+ }
86
+
87
+ } catch (error) {
88
+ console.error("āŒ Errore nella lettura del package.json:", error);
89
+ process.exit(1);
90
+ }
91
+ };
92
+
93
+
49
94
  // Trova la root dell'app e stampa le dipendenze
50
95
  try {
51
96
  const appRoot = findAppRoot();
@@ -54,6 +99,9 @@ try {
54
99
 
55
100
  // Stampa le dipendenze
56
101
  printDependencies(packageJsonPath);
102
+
103
+ // Controlla le dipendenze
104
+ checkDependencies(packageJsonPath);
57
105
 
58
106
  } catch (error) {
59
107
  console.error("āŒ Errore generale:", error);