thecore-auth 0.0.28 โ†’ 0.0.30

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.28",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "main": "dist/thecore-auth.cjs.js",
7
7
  "module": "dist/thecore-auth.esm.js",
@@ -15,8 +15,7 @@
15
15
  "dev": "vite --host",
16
16
  "build": "vite build",
17
17
  "lint": "eslint .",
18
- "preview": "vite preview",
19
- "postinstall": "node postinstall.js --verbose"
18
+ "preview": "vite preview"
20
19
  },
21
20
  "dependencies": {
22
21
  "axios": "^1.7.9",
@@ -48,8 +47,6 @@
48
47
  },
49
48
  "files": [
50
49
  "dist",
51
- "postinstall.js",
52
- "scripts",
53
50
  "README.md"
54
51
  ],
55
52
  "repository": {
package/postinstall.js DELETED
@@ -1,28 +0,0 @@
1
- import { execSync } from "child_process";
2
- import { fileURLToPath } from "url";
3
- import path from "path";
4
- import fs from "fs";
5
-
6
- // Trova il percorso assoluto della directory corrente
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
-
10
- // Percorso corretto dello script
11
- const scriptPath = path.join(__dirname, "scripts", "check-peer-dependencies.js");
12
-
13
- console.log("๐Ÿ“‚ Percorso calcolato:", scriptPath);
14
-
15
- if (!fs.existsSync(scriptPath)) {
16
- console.error("โŒ ERRORE: Il file check-peer-dependencies.js non esiste!");
17
- process.exit(1);
18
- }
19
-
20
- try {
21
- console.log("๐Ÿ“Œ Eseguendo check-peer-dependencies.js...");
22
- execSync(`node ${scriptPath}`, { stdio: "inherit" });
23
- console.log("โœ… check-peer-dependencies.js eseguito con successo!");
24
- } catch (error) {
25
- console.error("โŒ Errore nell'esecuzione di check-peer-dependencies.js", error);
26
- process.exit(1);
27
- }
28
-
@@ -1,124 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { fileURLToPath } from "url";
4
-
5
- // Trova il percorso assoluto dello script
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
-
9
- // Dipendenze rischieste
10
- const requiredDependencies = [
11
- "axios",
12
- "react-router-dom",
13
- "react-icons",
14
- "jwt-decode",
15
- ]
16
-
17
- // Funzione per trovare il package.json dell'applicazione principale
18
- const findAppRoot = () => {
19
- let dir = path.resolve(__dirname, "../.."); // Risali dalla directory del pacchetto (node_modules/thecore-auth)
20
-
21
- while (!fs.existsSync(path.join(dir, "package.json"))) {
22
- const parentDir = path.dirname(dir);
23
- if (parentDir === dir) {
24
- console.error("โŒ package.json dell'applicazione non trovato.");
25
- process.exit(1);
26
- }
27
- dir = parentDir;
28
- }
29
- return dir;
30
- };
31
-
32
- // Funzione per leggere e stampare le dipendenze
33
- const printDependencies = (packageJsonPath) => {
34
- try {
35
- const packageJsonContent = fs.readFileSync(packageJsonPath, "utf-8");
36
- const packageJson = JSON.parse(packageJsonContent);
37
-
38
- console.log("๐Ÿ“ฆ Dipendenze installate:");
39
- if (packageJson.dependencies) {
40
- console.log("๐Ÿ”น dependencies:", packageJson.dependencies);
41
- } else {
42
- console.log("โš ๏ธ Nessuna dependencies trovata.");
43
- }
44
-
45
- if (packageJson.devDependencies) {
46
- console.log("๐Ÿ”น devDependencies:", packageJson.devDependencies);
47
- } else {
48
- console.log("โš ๏ธ Nessuna devDependencies trovata.");
49
- }
50
-
51
- } catch (error) {
52
- console.error("โŒ Errore nella lettura del package.json:", error);
53
- process.exit(1);
54
- }
55
- };
56
-
57
- // Funzione per controllare le dipendenze e installare quelle mancanti
58
- const checkAndInstallDependencies = (packageJsonPath, appRoot) => {
59
- try {
60
- const packageJsonContent = fs.readFileSync(packageJsonPath, "utf-8");
61
- const packageJson = JSON.parse(packageJsonContent);
62
-
63
- const dependencies = {
64
- ...packageJson.dependencies,
65
- ...packageJson.devDependencies,
66
- };
67
-
68
- console.log("๐Ÿ“ฆ Verifica delle dipendenze richieste:");
69
-
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`);
80
- });
81
-
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
- }
98
- }
99
-
100
- console.log("โš ๏ธ NOTA: 'tailwindcss' non รจ stato installato automaticamente. Dovrai farlo manualmente.");
101
-
102
- } catch (error) {
103
- console.error("โŒ Errore nella lettura del package.json:", error);
104
- process.exit(1);
105
- }
106
- };
107
-
108
-
109
- // Trova la root dell'app e stampa le dipendenze
110
- try {
111
- const appRoot = findAppRoot();
112
- const packageJsonPath = path.join(appRoot, "package.json");
113
- console.log("โœ… package.json trovato in:", packageJsonPath);
114
-
115
- // Stampa le dipendenze
116
- printDependencies(packageJsonPath);
117
-
118
- // Controlla le dipendenze
119
- checkAndInstallDependencies(packageJsonPath, appRoot);
120
-
121
- } catch (error) {
122
- console.error("โŒ Errore generale:", error);
123
- process.exit(1);
124
- }