thecore-auth 0.0.5 → 0.0.7
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.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/thecore-auth.cjs.js",
|
|
7
7
|
"module": "dist/thecore-auth.esm.js",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"react": "^18.3.1",
|
|
25
25
|
"react-dom": "^18.3.1",
|
|
26
26
|
"react-icons": "^5.4.0",
|
|
27
|
-
"react-router-dom": "^7.1.3"
|
|
27
|
+
"react-router-dom": "^7.1.3",
|
|
28
|
+
"tailwindcss": "^3.4.17"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@eslint/js": "^9.17.0",
|
|
@@ -43,12 +44,7 @@
|
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
46
|
"react": "^18.0.0",
|
|
46
|
-
"react-dom": "^18.0.0"
|
|
47
|
-
"react-router-dom": "^7.0.0",
|
|
48
|
-
"axios": "^1.0.0",
|
|
49
|
-
"tailwindcss": "^3.0.0",
|
|
50
|
-
"react-icons": "^5.4.0",
|
|
51
|
-
"jwt-decode": "^3.1.2"
|
|
47
|
+
"react-dom": "^18.0.0"
|
|
52
48
|
},
|
|
53
49
|
"files": [
|
|
54
50
|
"dist",
|
|
@@ -2,6 +2,8 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
4
|
|
|
5
|
+
console.log('Sono entrato nello script');
|
|
6
|
+
|
|
5
7
|
const installPeerDependencies = () => {
|
|
6
8
|
const peerDependencies = {
|
|
7
9
|
"react-router-dom": "^7.0.0",
|
|
@@ -68,27 +70,22 @@ const installTailwind = () => {
|
|
|
68
70
|
const modifyTailwindConfig = () => {
|
|
69
71
|
const tailwindConfigPath = path.resolve("tailwind.config.js");
|
|
70
72
|
|
|
71
|
-
// Verifica se il file tailwind.config.js esiste
|
|
72
73
|
if (fs.existsSync(tailwindConfigPath)) {
|
|
73
74
|
console.log("Modifying tailwind.config.js...");
|
|
74
75
|
|
|
75
|
-
// Leggi il contenuto del file
|
|
76
76
|
const configContent = fs.readFileSync(tailwindConfigPath, "utf8");
|
|
77
77
|
|
|
78
|
-
// Aggiungi la configurazione content (assicurati che non esista già)
|
|
79
78
|
if (!configContent.includes("content:")) {
|
|
79
|
+
// Trova il punto giusto per inserire la configurazione content
|
|
80
80
|
const updatedConfigContent = configContent.replace(
|
|
81
|
+
"module.exports = {",
|
|
81
82
|
`module.exports = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
theme: {
|
|
87
|
-
extend: {},
|
|
88
|
-
},
|
|
89
|
-
plugins: [],
|
|
90
|
-
};`
|
|
83
|
+
content: [
|
|
84
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
|
85
|
+
"./public/index.html",
|
|
86
|
+
],`
|
|
91
87
|
);
|
|
88
|
+
|
|
92
89
|
fs.writeFileSync(tailwindConfigPath, updatedConfigContent);
|
|
93
90
|
console.log("Added content path to tailwind.config.js.");
|
|
94
91
|
} else {
|
|
@@ -102,18 +99,14 @@ const modifyTailwindConfig = () => {
|
|
|
102
99
|
const modifyIndexCss = () => {
|
|
103
100
|
const cssPath = path.resolve("src/index.css");
|
|
104
101
|
|
|
105
|
-
// Verifica se il file index.css esiste
|
|
106
102
|
if (fs.existsSync(cssPath)) {
|
|
107
103
|
console.log("Adding Tailwind directives to the beginning of index.css...");
|
|
108
104
|
|
|
109
|
-
// Leggi il contenuto del file CSS
|
|
110
105
|
const cssContent = fs.readFileSync(cssPath, "utf8");
|
|
111
|
-
|
|
112
|
-
// Direttive di Tailwind da aggiungere
|
|
113
106
|
const tailwindDirectives = `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n`;
|
|
114
107
|
|
|
115
|
-
//
|
|
116
|
-
if (!cssContent.
|
|
108
|
+
// Verifica che le direttive non siano già presenti
|
|
109
|
+
if (!cssContent.startsWith(tailwindDirectives)) {
|
|
117
110
|
const updatedCssContent = tailwindDirectives + cssContent;
|
|
118
111
|
fs.writeFileSync(cssPath, updatedCssContent);
|
|
119
112
|
console.log("Tailwind directives added to index.css.");
|