UNPKG

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
## ๐Ÿ“ 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