How jonathanleahy/folder-bundler works
Project type and purpose
• folder-bundler is a standalone Go-based CLI tool.
• Purpose: collect a directory’s full structure and file contents into a single document, then reconstruct the original tree elsewhere.
• Not a web service or microservice: it’s a developer tool for file-system documentation and recreation.
File structure
• Top-level:
• main.go, main_test.go – CLI entrypoint and test harness
• internal/ – core packages, hidden from external imports
• output/ – sample outputs (generated documentation, reconstructed files)
• test/ – additional test driver
• internal/collect – collector.go: scans directories, reads files, serializes into documentation
• internal/config – params.go: parses CLI flags (max-file, exclude-dirs, etc.)
• internal/fileutils – utils.go: low-level file reads/writes, splitting large files, metadata extraction
• internal/reconstruct – reconstructor.go: parses the document created by collector and rebuilds directory tree and files
• config files (go.mod, go.sum) and .gitignore confirm pure Go build, no external services.
README for additional insights
• Describes two main commands: “collect” and “reconstruct.”
• Highlights features: syntax highlighting, large-file splitting, metadata/timestamp preservation, exclusion rules.
• Use cases focus on documentation, archiving, code review—no network or real-time component.
Detail and essential elements
• Be explicit about metadata flow (timestamps, permissions) through FileUtils.
• How exclusion patterns (from Config) feed into Collector’s directory walker.
• Both CLI parsing logic and the two distinct pipelines (collect vs reconstruct).