Releases: w3spi5/codepack
Releases · w3spi5/codepack
v4.2 - Shell Compatibility & Documentation - DON'T USE, IT WON'T WORK !!
🛡️ Shell Compatibility Guard
Running codepack with sh instead of bash now shows a helpful error:
Error: This script requires bash. Please run with: bash codepack.sh
Or make it executable: chmod +x codepack.sh && ./codepack.sh
Why? Codepack uses bash-specific features (arrays, associative arrays) that aren't available in POSIX shells like sh, ash, or dash.
📚 Documentation
CLAUDE.md
AI-friendly documentation files to help assistants (Claude, ChatGPT, etc.) understand the project:
- Project overview and key features
- Technical requirements (Bash 4.0+)
- Development guidelines
- Common tasks and code locations
CHANGELOG.md
Complete version history covering 25 releases from v1.0 to v4.2:
- v1.x: Foundation (tree structure, exclusions, filtering)
- v2.x: Stability (refactoring, progress, exclusions)
- v3.x: Optimization (file detection, compression, UX)
- v4.x: Power features (minification, clipboard, external tools)
🔧 Fixes
- CRLF → LF line endings for cross-platform compatibility
Installation
# npm
npm install -g @w3spi5/codepack
# or direct
curl -O https://raw.githubusercontent.com/w3spi5/codepack/main/codepack.sh
chmod +x codepack.sh
Full Changelog
See CHANGELOG.md for complete version history.v4.1
v4.1 (2025-06-22)
- ✨ NEW: Default current directory processing - run
./codepackwithout specifying a path - 🔧 IMPROVED: Simplified usage - directory path is now optional
- 📚 ENHANCED: Updated documentation with current directory examples
- 🎯 OPTIMIZED: Better argument parsing for optional directory
v4 codepack
v4 codepack : new logo, new package name
v3
Changelog
Version 3.2.1 (3.2.0)
🚀 New Features
- Debug Mode: Added optional
--debugflag for detailed processing information and troubleshooting - Enhanced Progress Tracking: Improved progress bar with file count display (current/total)
- Intelligent File Processing: Smart detection and skipping of empty files to reduce output pollution
- External Tool Timeout Protection: Added 10-second timeout for external minifiers to prevent hanging
- Large File Handling: Automatic fallback for HTML files over 30KB to prevent html-minifier-terser crashes
🔧 Improvements
- Robust Error Handling: All sed operations now include fallback mechanisms and error protection
- Memory Management: Better cleanup of temporary files and resources
- Processing Statistics: Detailed reports on processed vs skipped files
- Minification Reliability: Enhanced minification functions with comprehensive error handling for edge cases
- Tool Detection: Improved external minifier detection and configuration
🛠️ Bug Fixes
- Fixed Progress Bar: Progress now correctly displays 0-100% instead of stopping at intermediate percentages
- Fixed Argument Parsing: Resolved issues with corrupted command-line arguments
- Fixed Empty Content Handling: All minification functions now properly handle empty or whitespace-only content
- Fixed External Tool Integration: Improved stability when using terser, pyminify, csso, html-minifier-terser, and jq
- Fixed Resource Cleanup: Proper cleanup of temporary files and moviepy resources
Version 3.1.0
🚀 New Features
- Ultra-Aggressive Minification: Complete rewrite of minification engine with 50-70% size reduction
- External Tool Integration: Support for terser, pyminify, csso-cli, html-minifier-terser, and jq
- Intelligent Fallback System: Automatic fallback to bash minification when external tools unavailable
- Multi-Language Support: Enhanced support for 20+ file types including Python, JavaScript, CSS, HTML, JSON, YAML, XML, and more
- Tool Management Commands: Added
--install-minifiersand--minify-infocommands
🔧 Improvements
- Advanced File Type Detection: Intelligent detection of file types based on content and extensions
- Modular Architecture: Completely refactored codebase with separate functions for each file type
- Enhanced Configuration: Improved handling of special files like Dockerfile, .gitignore, Makefile
- Better Resource Management: Optimized memory usage and file handling
🛠️ Bug Fixes
- Fixed Minification Stability: Resolved crashes with complex file contents
- Fixed Character Encoding: Better handling of non-ASCII characters
- Fixed Large File Processing: Improved performance with files over 10MB
Version 3.0.0
🚀 New Features
- Compression Support: Added
--compressoption for gzip compression of output files - File Filtering System: Added
--includeand--excludeoptions for fine-grained file selection - Progress Indicators: Added visual progress bars with percentage completion
- Processing Statistics: Comprehensive reporting of processed files, sizes, and compression ratios
- Minification Framework: Initial implementation of code minification capabilities
🔧 Improvements
- Enhanced Directory Tree: Improved tree visualization with better formatting and excluded item marking
- File Size Reporting: Added file size calculations and formatting (bytes, KB, MB, GB)
- Error Handling: Comprehensive error handling and validation
- User Experience: Better command-line interface with detailed help and examples
🛠️ Bug Fixes
- Fixed Directory Exclusion: Proper handling of nested excluded directories
- Fixed File Permissions: Better handling of read-only and protected files
- Fixed Output Formatting: Consistent formatting across different file types
Version 2.5.0
🚀 New Features
- Automatic Directory Exclusion: Smart exclusion of common build/cache directories (.git, node_modules, venv, pycache, .next, dist, build)
- Sensitive File Protection: Automatic exclusion of sensitive files (.env, .DS_Store)
- Enhanced Output Format: Improved output structure with clear file headers and separators
- Timestamped Output: Output files include timestamp for version control
🔧 Improvements
- Better File Detection: Improved file type detection and handling
- Enhanced Tree Generation: More accurate directory tree representation
- Cleaner Output: Reduced noise in output files by filtering irrelevant content
🛠️ Bug Fixes
- Fixed Tree Structure: Corrected issues with nested directory visualization
- Fixed File Reading: Better handling of binary and special files
- Fixed Path Resolution: Improved path handling across different operating systems
Version 2.0.0
🚀 New Features
- Directory Structure Visualization: Added comprehensive tree-like directory structure generation
- Dual-Section Output: Separated directory structure and file contents into distinct sections
- File Content Extraction: Complete file content extraction with proper formatting
- Command-Line Interface: Professional CLI with argument parsing and validation
🔧 Improvements
- Modular Code Structure: Refactored codebase into logical functions and sections
- Better Documentation: Comprehensive inline documentation and comments
- Enhanced Error Messages: More descriptive error messages and validation
🛠️ Bug Fixes
- Fixed File Reading: Resolved issues with special characters and encoding
- Fixed Directory Traversal: Improved handling of symlinks and special directories
- Fixed Output Generation: Consistent output formatting across all file types
Version 1.8.0
🚀 New Features
- Recursive Directory Processing: Full recursive traversal of directory structures
- Multiple File Support: Ability to process multiple files in a single operation
- Basic File Filtering: Initial implementation of file type filtering
🔧 Improvements
- Performance Optimization: Faster file processing and reduced memory usage
- Better File Handling: Improved handling of large files and directories
🛠️ Bug Fixes
- Fixed Memory Issues: Resolved memory leaks with large directory structures
- Fixed File Encoding: Better handling of different character encodings
Version 1.5.0
🚀 New Features
- Initial Release: Basic file extraction functionality
- Single File Processing: Extract content from individual files
- Simple Output Format: Basic text output with file names and content
- Cross-Platform Support: Compatible with Unix-like systems (Linux, macOS, BSD)
🔧 Core Features
- File Content Reading: Basic file reading capabilities
- Text Output: Simple text-based output format
- Error Handling: Basic error detection and reporting
- Shell Script Foundation: Robust bash script architecture
Migration Notes
From v3.1.x to v3.2.x
- No breaking changes
- New
--debugflag is optional and does not affect existing workflows
From v3.0.x to v3.1.x
- No breaking changes
- New minification features are optional and activated only with
--minifyflag - External tools are optional; script works with built-in fallbacks
From v2.x to v3.0.x
- Output format enhanced but remains backward compatible
- New filtering options are optional
- Existing scripts will continue to work without modifications
From v1.x to v2.x
- Significant output format changes
- Directory structure section added
- May require updates to scripts that parse output