filetree-pro
Version:
A powerful file tree generator for VS Code and Cursor. Generate beautiful file trees in multiple formats with smart exclusions and custom configurations.
160 lines (118 loc) โข 6.25 kB
Markdown
## ๐ Changelog
### v0.2.0 - Comprehensive Testing & Quality Assurance
**๐ Major Testing Milestone: 234 Tests, 100% Pass Rate**
This release focuses on enterprise-grade test coverage with comprehensive edge case validation, security testing, and quality assurance across all core services and commands.
#### โจ New Test Suites (124 New Tests)
**Core Command Tests:**
- ๐งช **generateTreeCommand.test.ts** (15 tests) - Command execution, all output formats (Markdown, JSON, SVG, ASCII), icon preferences, progress notifications, command registration
- ๐งช **treeBuilderService.test.ts** (20 tests) - Tree building with correct method signatures, file sorting, exclusion patterns, depth limiting, cancellation support
**Service Layer Tests:**
- ๐งช **analyticsService.test.ts** (18 tests) - Project analytics, file type distribution, size analysis, recent files tracking, project structure detection, error handling
- ๐งช **copilotService.test.ts** (19 tests) - AI availability detection, file analysis, caching strategies, rate limiting, API response handling, lifecycle management
- ๐งช **fileSystemService.test.ts** (31 tests) - File system operations, LRU caching (100-entry, 5-min TTL), security validation, statistics tracking, resource cleanup, concurrent requests
- ๐งช **convertTextCommand.test.ts** (21 tests) - Text to tree conversion, folder/file detection, tree connectors, document creation, special character handling
#### ๐ Security Enhancements
- โ
Path traversal prevention testing (validates all file paths)
- โ
File size limit validation (rejects files > 10MB)
- โ
Exclusion pattern security (prevents malicious patterns)
- โ
Input sanitization for user-provided patterns
- โ
Secure cache key generation
#### โก Performance Features Tested
- โ
LRU cache with 100-entry capacity and 5-minute TTL
- โ
Periodic cache cleanup (5-minute intervals)
- โ
Cache hit rate tracking and monitoring
- โ
Statistics collection (file counts, errors, read times)
- โ
Concurrent request handling
- โ
Deep directory structure handling
#### ๐ฏ Edge Cases Covered
**File System Edge Cases:**
- Empty directories
- Very deep nesting (10+ levels)
- Special characters in filenames (spaces, dashes, underscores, dots, @, #)
- Symlinks and circular references
- Mixed line endings (Unix/Windows: `\n` and `\r\n`)
- Windows path separators (backslashes)
- Very long filenames (200+ characters)
- Single line input
- Indentation depth limiting for readability
**Format Detection:**
- Folders by trailing slash (`src/`, `lib/`)
- Files by extension (`.tsx`, `.md`, `.json`)
- Items without extension as folders (`Dockerfile`, `Makefile`)
**Error Handling:**
- Missing active editor
- Empty or whitespace-only selections
- File system permission errors
- Stat errors on invalid paths
- Conversion failures
- Document creation errors
#### ๐ VS Code Mock Enhancements
- โ
Added `EndOfLine` enum (LF: 1, CRLF: 2) for document line ending support
- โ
Added `ViewColumn` enum (Active, Beside, One-Nine) for editor column management
- โ
Added `Selection` class for text selection mocking
- โ
Enhanced command registration with proper disposable returns
- โ
Added `showQuickPick` and `openTextDocument` methods
#### ๐ Test Metrics
```
Total Tests: 234 (100% passing)
Test Suites: 12 (all passing)
New Tests: +124 (+112% increase)
Code Coverage: Enterprise-grade validation
Pass Rate: 100% ๐ฏ
```
**Test Distribution:**
- Command Tests: 36 tests (generateTree, convertText)
- Service Tests: 88 tests (treeBuilder, analytics, copilot, fileSystem)
- Utility Tests: 110 tests (existing suite)
#### ๐ง Technical Improvements
- Relaxed timing-sensitive test expectations for mock environments
- Fixed method name inconsistencies (`getStats` vs `getStatistics`)
- Corrected TypeScript type annotations (explicit types for array callbacks)
- Enhanced test isolation with proper beforeEach/afterEach patterns
- Improved test readability with descriptive test names
- Added comprehensive inline documentation in tests
#### ๐ Testing Best Practices Implemented
- โ
Unit test isolation (no shared state)
- โ
Mock all external dependencies (VS Code API, file system)
- โ
Test both success and error paths
- โ
Validate edge cases and boundary conditions
- โ
Security-focused testing (path traversal, injection)
- โ
Performance monitoring (cache hit rates, timing)
- โ
Resource cleanup validation (dispose patterns)
- โ
Concurrent operation testing
#### ๐ What This Release Delivers
**For Developers:**
- Confidence in code reliability (234 passing tests)
- Comprehensive edge case coverage
- Security validation at multiple layers
- Performance optimization verification
**For Users:**
- More stable extension behavior
- Better error handling and recovery
- Improved performance with LRU caching
- Enhanced security with input validation
**For Contributors:**
- Clear test patterns to follow
- Comprehensive test suite to validate changes
- Well-documented edge cases
- Easy-to-run test commands (`pnpm test`)
---
### v0.1.92+ - Issue #5 Fixes
- ๐ **Fixed**: Auto-hidden flag incorrectly hiding important files
- ๐ **Fixed**: Files with "log" in name (like `requestLogger.ts`) being incorrectly excluded
- ๐ **Fixed**: Config files (`.env`, `.gitignore`, `.prettierignore`) being auto-hidden
- ๐ **Fixed**: Lock files (`pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`) being excluded
- ๐ **Fixed**: Extension crashes with complex exclusion patterns like `**/node_modules/**`
- โจ **Enhanced**: Proper glob pattern matching with `**` support
- โจ **Enhanced**: Better multi-language project support (Python, Go, Rust, Java, C#, etc.)
- โจ **Enhanced**: Cross-platform path handling
- โจ **Enhanced**: 83+ comprehensive tests for reliability
- ๐ง **Improved**: Smarter exclusion logic - shows important files, hides true build artifacts
### v0.1.0 - Initial Release
- โ
Core file tree generation
- โ
4 output formats (Markdown, JSON, SVG, ASCII)
- โ
Universal language support (50+ languages)
- โ
Smart exclusions system
- โ
Custom configuration support
- โ
Performance optimizations
- โ
VS Code and Cursor compatibility