Skip to content

Commit d47cf44

Browse files
committed
feat: Enhance file and folder ignore logic, improve UI animations, and refine styling for better user experience
1 parent 40992bf commit d47cf44

File tree

3 files changed

+241
-49
lines changed

3 files changed

+241
-49
lines changed

MyDocs

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.js

Lines changed: 106 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
'.npm',
1515
'.yarn',
1616
'bower_components',
17+
1718
// Version Control
1819
'.git',
1920
'.svn',
2021
'.hg',
22+
'.gitignore',
23+
2124
// Python
2225
'__pycache__',
2326
'.pytest_cache',
@@ -33,6 +36,8 @@
3336
'build',
3437
'*.egg-info',
3538
'.eggs',
39+
'site-packages',
40+
3641
// Java/Spring Boot/Maven/Gradle
3742
'target',
3843
'build',
@@ -45,19 +50,24 @@
4550
'generated',
4651
'generated-sources',
4752
'generated-test-sources',
48-
// IDE Files
53+
'.apt_generated',
54+
'.apt_generated_tests',
55+
56+
// IDE Files (VS Code, IntelliJ, Eclipse, etc.)
4957
'.vscode',
5058
'.idea',
5159
'.eclipse',
5260
'.settings',
5361
'.classpath',
5462
'.project',
5563
'.factorypath',
56-
'.apt_generated',
57-
'.apt_generated_tests',
5864
'nbproject',
5965
'.nb-gradle',
60-
// JavaScript/TypeScript
66+
'.vs',
67+
'.vscode-test',
68+
'*.iml',
69+
70+
// JavaScript/TypeScript Build
6171
'.next',
6272
'.nuxt',
6373
'.output',
@@ -67,32 +77,73 @@
6777
'dist',
6878
'coverage',
6979
'.nyc_output',
80+
'build',
81+
'public/build',
82+
'.webpack',
83+
7084
// PHP
7185
'vendor',
86+
87+
// Ruby
88+
'.bundle',
89+
7290
// Logs & Temp
7391
'logs',
7492
'temp',
7593
'tmp',
7694
'.log',
95+
'.tmp',
96+
7797
// OS
7898
'.DS_Store',
79-
'Thumbs.db'
99+
'Thumbs.db',
100+
'desktop.ini',
101+
102+
// Other
103+
'coverage',
104+
'.sass-cache',
105+
'.eslintcache'
80106
]),
107+
81108
exts: new Set([
82109
// Executables & Binaries
83-
'exe', 'dll', 'so', 'dylib', 'a', 'o', 'obj',
110+
'exe', 'dll', 'so', 'dylib', 'a', 'o', 'obj', 'bin',
111+
84112
// Java Compiled
85-
'class',
113+
'class', 'jar', 'war', 'ear',
114+
86115
// Python Compiled
87116
'pyc', 'pyo', 'pyd',
88-
// Media
89-
'mp4', 'mp3', 'wav', 'avi', 'mov', 'flv', 'wmv', 'ogg',
117+
118+
// Images (CRITICAL: These appear as binary in output!)
119+
'png', 'jpg', 'jpeg', 'gif', 'bmp', 'ico', 'webp', 'svg', 'tiff', 'psd', 'ai',
120+
121+
// Media (Videos, Audio)
122+
'mp4', 'mp3', 'wav', 'avi', 'mov', 'flv', 'wmv', 'ogg', 'webm', 'mkv', 'flac', 'aac',
123+
90124
// Archives
91-
'zip', 'tar', 'gz', 'rar', '7z', 'bz2', 'xz', 'tgz',
125+
'zip', 'tar', 'gz', 'rar', '7z', 'bz2', 'xz', 'tgz', 'iso',
126+
92127
// Fonts
93128
'ttf', 'woff', 'woff2', 'eot', 'otf',
94-
// Other
95-
'log', 'cache', 'swp', 'swo', 'bak', 'tmp'
129+
130+
// Documents (Binary formats)
131+
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
132+
133+
// Database
134+
'db', 'sqlite', 'sqlite3',
135+
136+
// Minified/Compiled (CRITICAL: Skip compiled code!)
137+
'min.js', 'min.css', 'bundle.js', 'chunk.js',
138+
139+
// Logs & Cache
140+
'log', 'cache', 'swp', 'swo', 'bak', 'tmp',
141+
142+
// Lock files
143+
'lock',
144+
145+
// IDE specific
146+
'iml', 'ipr', 'iws'
96147
])
97148
};
98149
// Download the bundled Python script (combine.py) and notify user to update paths
@@ -444,11 +495,45 @@
444495
}
445496
return r;
446497
};
447-
const ign = p => { const pts = p.split('/'); if (pts.some(x => IGNORED.folders.has(x))) return true; const e = pts[pts.length - 1].split('.').pop().toLowerCase(); return IGNORED.exts.has(e); };
498+
// Enhanced ignore function with better detection
499+
const ign = p => {
500+
const pts = p.split('/');
501+
502+
// Check if path contains ignored folders
503+
if (pts.some(x => IGNORED.folders.has(x))) return true;
504+
505+
const filename = pts[pts.length - 1].toLowerCase();
506+
507+
// Check for minified files (CRITICAL: Skip .min.js, .min.css, etc.)
508+
if (filename.includes('.min.')) return true;
509+
if (filename.includes('.bundle.')) return true;
510+
if (filename.includes('.chunk.')) return true;
511+
512+
// Check for specific IDE files
513+
if (filename.startsWith('.') && filename !== '.gitignore') {
514+
// Allow some dotfiles but skip most
515+
const allowed = ['.env.example', '.editorconfig', '.prettierrc'];
516+
if (!allowed.some(a => filename.includes(a))) return true;
517+
}
518+
519+
// Check extension
520+
const e = filename.split('.').pop().toLowerCase();
521+
return IGNORED.exts.has(e);
522+
};
523+
448524
const isBinary = filename => {
449525
const ext = filename.split('.').pop().toLowerCase();
450526
return BINARY_EXTS.has(ext);
451527
};
528+
529+
// Check if file is likely minified/compiled (additional safety check)
530+
const isMinified = filename => {
531+
const lower = filename.toLowerCase();
532+
return lower.includes('.min.') ||
533+
lower.includes('.bundle.') ||
534+
lower.includes('.chunk.') ||
535+
lower.endsWith('.map'); // source maps
536+
};
452537
// Get icon for file or folder
453538
const ico = (name, isFolder) => {
454539
if (isFolder) {
@@ -669,11 +754,18 @@
669754
// ========================================
670755
const ext = name.split('.').pop().toLowerCase();
671756
const iconData = ICONS[ext] || ICONS['default'];
757+
// Add specific class for better CSS targeting and visual effects
758+
let specificClass = `${ext}-icon`;
759+
// Group similar extensions for consistent styling
760+
if (['jsx', 'tsx'].includes(ext)) specificClass += ' react-icon';
761+
if (['vue', 'svelte'].includes(ext)) specificClass += ' framework-icon';
762+
if (['scss', 'sass', 'less'].includes(ext)) specificClass += ' style-icon';
763+
672764
return {
673765
type: 'svg',
674766
url: ICON_BASE_URL + iconData.icon,
675767
color: iconData.color,
676-
cls: `${ext}-icon`
768+
cls: specificClass
677769
};
678770
};
679771
const esc = s => s.replace(/&/g, '&amp;').replace(/</g, '<').replace(/>/g, '>');

0 commit comments

Comments
 (0)