-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch-flex.js
More file actions
27 lines (23 loc) · 905 Bytes
/
Copy pathpatch-flex.js
File metadata and controls
27 lines (23 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const fs = require('fs');
const path = require('path');
const componentsDir = path.join(__dirname, 'app', 'system-design', 'components');
const files = fs.readdirSync(componentsDir).filter(f => f.startsWith('Module') && f.endsWith('.tsx'));
for (const file of files) {
const filePath = path.join(componentsDir, file);
let content = fs.readFileSync(filePath, 'utf8');
// Add flex-wrap and shrink-0 to card headers
content = content.replace(
/className="flex items-center gap-3 mb-4"/g,
'className="flex flex-wrap items-center gap-2 sm:gap-3 mb-4"'
);
content = content.replace(
/className="flex items-center gap-2 mb-2"/g,
'className="flex flex-wrap items-center gap-2 mb-2"'
);
content = content.replace(
/className="w-8 h-8 text-([^"]+)"/g,
'className="w-8 h-8 text-$1 shrink-0"'
);
fs.writeFileSync(filePath, content);
console.log(`Patched ${file}`);
}