thecore-auth 0.0.6 → 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.6",
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",
@@ -70,27 +70,22 @@ const installTailwind = () => {
70
70
  const modifyTailwindConfig = () => {
71
71
  const tailwindConfigPath = path.resolve("tailwind.config.js");
72
72
 
73
- // Verifica se il file tailwind.config.js esiste
74
73
  if (fs.existsSync(tailwindConfigPath)) {
75
74
  console.log("Modifying tailwind.config.js...");
76
75
 
77
- // Leggi il contenuto del file
78
76
  const configContent = fs.readFileSync(tailwindConfigPath, "utf8");
79
77
 
80
- // Aggiungi la configurazione content (assicurati che non esista già)
81
78
  if (!configContent.includes("content:")) {
79
+ // Trova il punto giusto per inserire la configurazione content
82
80
  const updatedConfigContent = configContent.replace(
81
+ "module.exports = {",
83
82
  `module.exports = {
84
- content: [
85
- "./src/**/*.{js,jsx,ts,tsx}",
86
- "./public/index.html",
87
- ],
88
- theme: {
89
- extend: {},
90
- },
91
- plugins: [],
92
- };`
83
+ content: [
84
+ "./src/**/*.{js,jsx,ts,tsx}",
85
+ "./public/index.html",
86
+ ],`
93
87
  );
88
+
94
89
  fs.writeFileSync(tailwindConfigPath, updatedConfigContent);
95
90
  console.log("Added content path to tailwind.config.js.");
96
91
  } else {
@@ -104,18 +99,14 @@ const modifyTailwindConfig = () => {
104
99
  const modifyIndexCss = () => {
105
100
  const cssPath = path.resolve("src/index.css");
106
101
 
107
- // Verifica se il file index.css esiste
108
102
  if (fs.existsSync(cssPath)) {
109
103
  console.log("Adding Tailwind directives to the beginning of index.css...");
110
104
 
111
- // Leggi il contenuto del file CSS
112
105
  const cssContent = fs.readFileSync(cssPath, "utf8");
113
-
114
- // Direttive di Tailwind da aggiungere
115
106
  const tailwindDirectives = `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n`;
116
107
 
117
- // Aggiungi le direttive all'inizio del file se non sono già presenti
118
- if (!cssContent.includes("@tailwind base;")) {
108
+ // Verifica che le direttive non siano già presenti
109
+ if (!cssContent.startsWith(tailwindDirectives)) {
119
110
  const updatedCssContent = tailwindDirectives + cssContent;
120
111
  fs.writeFileSync(cssPath, updatedCssContent);
121
112
  console.log("Tailwind directives added to index.css.");