setup-nativewind 1.1.1 → 1.1.2
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
package/src/fileWriter.js
CHANGED
|
@@ -21,4 +21,27 @@ export async function writeConfigFiles(projectType) {
|
|
|
21
21
|
await fs.copy(src, dest);
|
|
22
22
|
console.log(`✅ Created ${file}`);
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
// For TS projects update tsconfig.json automatically
|
|
26
|
+
if (projectType.includes('ts')) {
|
|
27
|
+
await updateTsConfig(targetDir);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function updateTsConfig(targetDir) {
|
|
32
|
+
const tsconfigPath = path.join(targetDir, 'tsconfig.json');
|
|
33
|
+
|
|
34
|
+
if (!fs.existsSync(tsconfigPath)) return;
|
|
35
|
+
|
|
36
|
+
const tsconfig = fs.readJsonSync(tsconfigPath);
|
|
37
|
+
|
|
38
|
+
if (!tsconfig.include) {
|
|
39
|
+
tsconfig.include = [];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!tsconfig.include.includes('nativewind-env.d.ts')) {
|
|
43
|
+
tsconfig.include.push('nativewind-env.d.ts');
|
|
44
|
+
fs.writeJsonSync(tsconfigPath, tsconfig, { spaces: 2 });
|
|
45
|
+
console.log('✅ Updated tsconfig.json');
|
|
46
|
+
}
|
|
24
47
|
}
|