All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Shell Expansion Auto-Fix: Automatically detects and fixes shell expansion issues
- Detects when patterns like
examples/**/*expand to 100+ individual files - Automatically reconstructs the original pattern and re-runs the command
- Shows clear feedback: "Auto-fixing shell expansion: using pattern 'examples/**/*' instead of 386 individual files"
- Eliminates frustrating errors and provides seamless user experience
- Detects when patterns like
- Pattern Normalization: Automatic directory pattern conversion
- Converts bare directory names like "examples" to "examples/**"
- Handles directory paths like "src/core" to "src/core/**"
- Makes patterns work intuitively without requiring glob knowledge
- Error Messages: Improved user experience with friendly, actionable messages
- "Pattern needs quotes to work properly" instead of technical stack traces
- Focus on solutions rather than technical explanations
- Code Quality: Enhanced maintainability and consistency
- Extracted
validateFilterOptions()method to eliminate code duplication - Added named constants for validation limits (MAX_PATTERNS: 100, MAX_PATTERN_LENGTH: 1000)
- Improved test reliability by fixing flaky performance thresholds
- Extracted
- CLI Infrastructure: Better executable handling
- Created proper Node.js wrapper following claudekit pattern
- Improved package.json bin configuration for reliable npm linking
- Enhanced CLI integration and error handling
- Test Reliability: Resolved intermittent test failures
- Fixed flaky performance test thresholds
- Improved array equality checks in FileDiscovery tests
- More robust timeout handling in integration tests
- Format Command Filtering: Added include/exclude pattern support to format command
--include <patterns...>- Include file patterns when formatting--exclude <patterns...>- Exclude file patterns when formatting- Works with all format types (json, dsl, graph, markdown, tree)
- Enables "scan once, format many times" workflow for efficient analysis
- Shows clear filtering statistics to stderr (e.g., "Files: 456 of 1,234")
- Instant filtering without file system re-scanning
- Enhanced Workflow: Powerful new analysis patterns
- Focus on specific directories:
--include "src/**" - Exclude test files:
--exclude "**/*.test.ts" - Monorepo package analysis:
--include "packages/core/**" - Component-focused views:
--include "**/*.{tsx,jsx}"
- Focus on specific directories:
- Format Command Documentation: Enhanced README with comprehensive filtering examples
- Added "Filtering on Format" section with practical workflows
- Added filtering statistics explanation
- Added monorepo and component analysis examples
- CLI Help: Updated format command help to include new filtering options
- Tree Format: New ASCII art visualization format for project structure
- Visual directory tree using ASCII characters (├── └── │)
- Available via
--format treefor any project size - 97% token reduction - most efficient format for structure visualization
- Complements content-focused formats (dsl, graph, markdown)
- Sorts directories before files, alphabetically within each type
- Enhanced Format Selection: Improved auto-format selection logic
- Tree format excluded from auto-selection (manual choice only)
- Better documentation of when to use each format
- Comprehensive Testing: Added 18 test cases for tree format functionality
- Edge cases: empty projects, single files, deep nesting
- Performance tests for wide structures
- Integration tests with existing formatter infrastructure
- Format Documentation: Enhanced README with comprehensive format selection guide
- Clear use cases for each format (tree, dsl, graph, markdown)
- Token budget planning guidelines
- Project size examples with specific CLI commands
- CLI Help: Updated format options to include
tree - Format Auto-Selection: DSL format now default for projects ≤5000 files
- Added format comparison table with token reduction metrics
- Added practical CLI examples by project size
- Added tree format example output
- Updated performance metrics to include tree format
- BREAKING: Changed default output filename from
PROJECT_INDEX.jsonto.codebasemap- This affects scripts and tools that depend on the specific filename
- See Migration Guide for upgrade instructions
- Pattern Support: Added comprehensive include/exclude pattern support via CLI options
--include <patterns...>- Include files matching glob patterns--exclude <patterns...>- Exclude files matching glob patterns- Support for complex glob syntax:
**/*.ts,src/{utils,core}/**,packages/*/src/** - Pattern validation with helpful error messages
- Pattern analysis and optimization suggestions in verbose mode
- Enhanced File Discovery: Extended
FileDiscoveryclass with pattern filtering capabilities - Performance Optimizations: Added pattern caching and performance benchmarking
- Comprehensive Testing: Added extensive test suite for pattern functionality
- Unit tests for pattern matching logic
- Integration tests for complex monorepo scenarios
- Performance tests for large codebases
- Documentation: Added comprehensive pattern usage guide and troubleshooting documentation
- Output Filename: Default output file changed from
PROJECT_INDEX.jsonto.codebasemap - CLI Help: Enhanced help text with pattern examples and usage guidance
- Error Handling: Improved error messages for pattern validation and file discovery
- Performance: Optimized file discovery for large codebases with pattern filtering
- TypeScript Format: Removed experimental TypeScript format output (was causing issues)
- Pattern Validation: Added security measures to prevent directory traversal and malicious patterns
- Path Sanitization: Enhanced path validation and relative path enforcement
- Enhanced project indexing capabilities
- Improved dependency resolution
- Better error handling and validation
- Comprehensive test suite
- Refined output format and structure
- Improved performance for large codebases
- Output filename changed from
PROJECT_INDEX.jsonto.codebasemap - New CLI options for pattern support (backward compatible)
-
Update output filename references:
# Before (0.2.x) codebase-map scan # Creates: PROJECT_INDEX.json # After (0.3.0) codebase-map scan # Creates: .codebasemap
-
Update scripts and tools:
# Old script if [ -f "PROJECT_INDEX.json" ]; then cat PROJECT_INDEX.json | jq '.files | length' fi # New script if [ -f ".codebasemap" ]; then cat .codebasemap | jq '.files | length' fi
-
Update CI/CD pipelines:
# Old GitHub Actions - name: Generate codebase map run: codebase-map scan - name: Upload artifact uses: actions/upload-artifact@v3 with: path: PROJECT_INDEX.json # New GitHub Actions - name: Generate codebase map run: codebase-map scan - name: Upload artifact uses: actions/upload-artifact@v3 with: path: .codebasemap
- CLI commands: All existing commands work without changes
- Output format: JSON structure remains identical
- API compatibility: Programmatic usage unchanged
- Configuration: No configuration file changes needed
After upgrading, you can optionally use the new pattern support:
# Focus on source code only
codebase-map scan --include "src/**" --exclude "**/*.test.ts"
# Monorepo package analysis
codebase-map scan --include "packages/*/src/**" --exclude "**/node_modules/**"
# Documentation-focused scan
codebase-map scan --include "docs/**" --include "*.md" --exclude "**/node_modules/**"If you need to revert to 0.2.x:
-
Downgrade package:
npm install codebase-map@0.2.0
-
Update filename references back:
# Rename existing file if needed mv .codebasemap PROJECT_INDEX.json -
Remove pattern options from scripts:
# Remove --include and --exclude options codebase-map scan # Basic command only
| Feature | 0.2.x | 0.3.0 | Notes |
|---|---|---|---|
| Basic scanning | ✅ | ✅ | Fully compatible |
| Output format | ✅ | ✅ | JSON structure unchanged |
| Filename | PROJECT_INDEX.json |
.codebasemap |
Breaking change |
| CLI options | Basic | Enhanced | New options available |
| Pattern support | ❌ | ✅ | New feature |
| Performance | Good | Better | Optimized |
After upgrading, verify the migration:
-
Test basic functionality:
codebase-map scan --verbose ls -la .codebasemap # Should exist -
Validate output format:
cat .codebasemap | jq '.version, .files | length'
-
Test pattern support:
codebase-map scan --include "src/**" --verbose
If you encounter issues after upgrading:
-
Immediate rollback:
npm install codebase-map@0.2.0 mv .codebasemap PROJECT_INDEX.json # If file exists -
Verify rollback:
codebase-map scan ls -la PROJECT_INDEX.json # Should exist
- Issues: Report problems at GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Documentation: See README.md for detailed usage