codesummary 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +370 -0
- package/RELEASE.md +412 -0
- package/bin/codesummary.js +13 -0
- package/features.md +502 -0
- package/package.json +84 -0
- package/src/cli.js +392 -0
- package/src/configManager.js +427 -0
- package/src/errorHandler.js +343 -0
- package/src/index.js +26 -0
- package/src/pdfGenerator.js +427 -0
- package/src/scanner.js +330 -0
package/RELEASE.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
# 🎉 CodeSummary v1.0.0 - Initial Release
|
|
2
|
+
|
|
3
|
+
**Release Date:** January 29, 2025
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Type:** Initial Release
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🚀 **Overview**
|
|
10
|
+
|
|
11
|
+
We're thrilled to announce the **initial release** of **CodeSummary**, a powerful cross-platform CLI tool that revolutionizes code documentation by automatically generating comprehensive, professional PDF documents from your project's source code.
|
|
12
|
+
|
|
13
|
+
## 📦 **Installation**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g codesummary
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Requirements:** Node.js ≥ 18.0.0
|
|
20
|
+
|
|
21
|
+
## ✨ **Key Features**
|
|
22
|
+
|
|
23
|
+
### 📝 **Complete Content Processing**
|
|
24
|
+
- **🔥 Zero truncation** - processes files of any size completely, no limits
|
|
25
|
+
- **🚀 Unlimited scalability** - handles projects with thousands of files efficiently
|
|
26
|
+
- **⚡ Smart memory management** - streaming architecture for optimal performance
|
|
27
|
+
- **📊 Progress indicators** - real-time feedback for large file processing
|
|
28
|
+
|
|
29
|
+
### 🛡️ **Smart & Safe Operation**
|
|
30
|
+
- **🎯 Intelligent file conflict handling** - automatic timestamped filenames when PDFs are in use
|
|
31
|
+
- **🌐 Universal terminal compatibility** - works flawlessly across all terminal types and operating systems
|
|
32
|
+
- **🔒 Whitelist-driven filtering** - only processes text files you explicitly choose
|
|
33
|
+
- **🛠️ Comprehensive error handling** - graceful recovery from any edge case
|
|
34
|
+
|
|
35
|
+
### 🌍 **Cross-Platform Excellence**
|
|
36
|
+
- **✅ Windows, macOS, and Linux** - identical behavior everywhere
|
|
37
|
+
- **🎨 Terminal-agnostic output** - clean display in cmd, PowerShell, bash, zsh, fish
|
|
38
|
+
- **📁 Cross-platform path handling** - seamless file system navigation
|
|
39
|
+
- **🔧 No platform-specific dependencies** - works out of the box
|
|
40
|
+
|
|
41
|
+
### 🎯 **Professional User Experience**
|
|
42
|
+
- **🧙♂️ Interactive setup wizard** - one-time configuration with persistent settings
|
|
43
|
+
- **☑️ Checkbox-based file selection** - visual interface with real-time file counts
|
|
44
|
+
- **📈 Comprehensive scan summaries** - detailed statistics before generation
|
|
45
|
+
- **💬 Clear, actionable messaging** - helpful error messages and guidance
|
|
46
|
+
|
|
47
|
+
## 🎨 **Extensive Language Support**
|
|
48
|
+
|
|
49
|
+
**Programming Languages:**
|
|
50
|
+
- JavaScript (.js, .jsx, .mjs)
|
|
51
|
+
- TypeScript (.ts, .tsx, .d.ts)
|
|
52
|
+
- Python (.py, .pyw, .pyx)
|
|
53
|
+
- Java (.java)
|
|
54
|
+
- C/C++ (.c, .cpp, .cc, .cxx, .h, .hpp)
|
|
55
|
+
- C# (.cs)
|
|
56
|
+
- Go (.go)
|
|
57
|
+
- Rust (.rs)
|
|
58
|
+
- Swift (.swift)
|
|
59
|
+
- Kotlin (.kt, .kts)
|
|
60
|
+
- Scala (.scala)
|
|
61
|
+
- PHP (.php, .phtml)
|
|
62
|
+
- Ruby (.rb, .rbw)
|
|
63
|
+
|
|
64
|
+
**Web Technologies:**
|
|
65
|
+
- HTML (.html, .htm)
|
|
66
|
+
- CSS (.css, .scss, .sass, .less)
|
|
67
|
+
- Vue.js (.vue)
|
|
68
|
+
- Svelte (.svelte)
|
|
69
|
+
|
|
70
|
+
**Data & Configuration:**
|
|
71
|
+
- JSON (.json, .jsonc)
|
|
72
|
+
- XML (.xml, .xsd, .xsl)
|
|
73
|
+
- YAML (.yaml, .yml)
|
|
74
|
+
- TOML (.toml)
|
|
75
|
+
- SQL (.sql)
|
|
76
|
+
- GraphQL (.graphql, .gql)
|
|
77
|
+
|
|
78
|
+
**Scripts & Shell:**
|
|
79
|
+
- Shell (.sh, .bash, .zsh)
|
|
80
|
+
- Batch (.bat, .cmd)
|
|
81
|
+
- PowerShell (.ps1, .psm1)
|
|
82
|
+
|
|
83
|
+
**Documentation:**
|
|
84
|
+
- Markdown (.md, .markdown)
|
|
85
|
+
- Plain Text (.txt)
|
|
86
|
+
- Dockerfile (.dockerfile)
|
|
87
|
+
|
|
88
|
+
## 📋 **PDF Output Structure**
|
|
89
|
+
|
|
90
|
+
### **1. Project Overview**
|
|
91
|
+
- Configurable document title
|
|
92
|
+
- Project name (derived from directory)
|
|
93
|
+
- Generation timestamp
|
|
94
|
+
- Complete list of included file types with descriptions
|
|
95
|
+
|
|
96
|
+
### **2. File Structure**
|
|
97
|
+
- Hierarchical listing of all included files
|
|
98
|
+
- Organized by relative paths from project root
|
|
99
|
+
- Alphabetically sorted for easy navigation
|
|
100
|
+
- Monospace formatting for proper alignment
|
|
101
|
+
|
|
102
|
+
### **3. File Content**
|
|
103
|
+
- **Complete source code** for every selected file
|
|
104
|
+
- **No truncation or size limits** - includes everything
|
|
105
|
+
- Professional monospace formatting for code readability
|
|
106
|
+
- Clear file headers with identification
|
|
107
|
+
- Natural page breaks handled automatically
|
|
108
|
+
- Intelligent error handling for unreadable files
|
|
109
|
+
|
|
110
|
+
## 🔧 **Technical Specifications**
|
|
111
|
+
|
|
112
|
+
### **PDF Generation:**
|
|
113
|
+
- **Format:** A4 (595 × 842 points) for international compatibility
|
|
114
|
+
- **Margins:** 40pt on all sides for optimal content utilization
|
|
115
|
+
- **Fonts:** Helvetica for headers, Courier for code (maximum readability)
|
|
116
|
+
- **Architecture:** Streaming generation prevents memory overflow
|
|
117
|
+
|
|
118
|
+
### **File Conflict Resolution:**
|
|
119
|
+
- **Standard naming:** `PROJECTNAME_code.pdf`
|
|
120
|
+
- **Conflict fallback:** `PROJECTNAME_code_YYYYMMDD_HHMMSS.pdf`
|
|
121
|
+
- **Automatic detection** of files in use
|
|
122
|
+
- **User notification** when timestamped files are created
|
|
123
|
+
|
|
124
|
+
### **Performance Metrics:**
|
|
125
|
+
- **Scan Speed:** >1,000 files/second on modern hardware
|
|
126
|
+
- **Memory Usage:** <200MB for projects with 10,000+ files
|
|
127
|
+
- **PDF Generation:** <30 seconds for typical projects (100 files)
|
|
128
|
+
- **File Size Support:** Unlimited - any file size processed completely
|
|
129
|
+
|
|
130
|
+
## 🛠️ **Command Reference**
|
|
131
|
+
|
|
132
|
+
| Command | Description | Example |
|
|
133
|
+
|---------|-------------|---------|
|
|
134
|
+
| `codesummary` | Generate PDF for current project | `codesummary` |
|
|
135
|
+
| `codesummary config` | Launch interactive configuration editor | `codesummary config` |
|
|
136
|
+
| `codesummary --show-config` | Display current configuration settings | `codesummary --show-config` |
|
|
137
|
+
| `codesummary --reset-config` | Reset to defaults and run setup wizard | `codesummary --reset-config` |
|
|
138
|
+
| `codesummary --help` | Show comprehensive help information | `codesummary --help` |
|
|
139
|
+
|
|
140
|
+
### **Command-Line Options:**
|
|
141
|
+
|
|
142
|
+
| Option | Short | Description | Example |
|
|
143
|
+
|--------|-------|-------------|---------|
|
|
144
|
+
| `--output` | `-o` | Override output directory | `codesummary -o ./docs` |
|
|
145
|
+
| `--show-config` | - | Display current configuration | `codesummary --show-config` |
|
|
146
|
+
| `--reset-config` | - | Reset configuration to defaults | `codesummary --reset-config` |
|
|
147
|
+
| `--help` | `-h` | Show help message | `codesummary -h` |
|
|
148
|
+
|
|
149
|
+
## 🎯 **Usage Examples**
|
|
150
|
+
|
|
151
|
+
### **Basic Usage:**
|
|
152
|
+
```bash
|
|
153
|
+
# Navigate to your project
|
|
154
|
+
cd /path/to/your/project
|
|
155
|
+
|
|
156
|
+
# Generate PDF (first run will show setup wizard)
|
|
157
|
+
codesummary
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### **Custom Output Location:**
|
|
161
|
+
```bash
|
|
162
|
+
# Save PDF to specific directory
|
|
163
|
+
codesummary --output ./documentation
|
|
164
|
+
|
|
165
|
+
# Save to parent directory
|
|
166
|
+
codesummary -o ../project-docs
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### **Configuration Management:**
|
|
170
|
+
```bash
|
|
171
|
+
# Edit settings interactively
|
|
172
|
+
codesummary config
|
|
173
|
+
|
|
174
|
+
# View current configuration
|
|
175
|
+
codesummary --show-config
|
|
176
|
+
|
|
177
|
+
# Reset to defaults and reconfigure
|
|
178
|
+
codesummary --reset-config
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## 🔍 **Interactive Workflow**
|
|
182
|
+
|
|
183
|
+
### **1. First-Run Setup**
|
|
184
|
+
```
|
|
185
|
+
Welcome to CodeSummary!
|
|
186
|
+
No configuration found. Starting setup...
|
|
187
|
+
|
|
188
|
+
Where should the PDF be generated by default?
|
|
189
|
+
> [ ] Current working directory (relative mode)
|
|
190
|
+
> [x] Fixed folder (absolute mode)
|
|
191
|
+
|
|
192
|
+
Enter absolute path for fixed folder:
|
|
193
|
+
> ~/Desktop/CodeSummaries
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### **2. Directory Scanning & File Selection**
|
|
197
|
+
```
|
|
198
|
+
Scanning directory: /path/to/project
|
|
199
|
+
|
|
200
|
+
Scan Summary:
|
|
201
|
+
Extensions found: .js, .ts, .md, .json
|
|
202
|
+
Total files: 127
|
|
203
|
+
Total size: 2.4 MB
|
|
204
|
+
|
|
205
|
+
Select file extensions to include:
|
|
206
|
+
[x] .js → JavaScript (42 files)
|
|
207
|
+
[x] .ts → TypeScript (28 files)
|
|
208
|
+
[x] .md → Markdown (5 files)
|
|
209
|
+
[ ] .json → JSON (52 files)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### **3. Generation Complete**
|
|
213
|
+
```
|
|
214
|
+
SUCCESS: PDF generation completed successfully!
|
|
215
|
+
|
|
216
|
+
Summary:
|
|
217
|
+
Output: ~/Desktop/CodeSummaries/MYPROJECT_code.pdf
|
|
218
|
+
Extensions: .js, .ts, .md
|
|
219
|
+
Total files: 75
|
|
220
|
+
PDF size: 2.3 MB
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 🐛 **Bug Fixes & Optimizations**
|
|
224
|
+
|
|
225
|
+
This initial release includes extensive testing and optimization across multiple iterations:
|
|
226
|
+
|
|
227
|
+
### **PDF Generation Improvements:**
|
|
228
|
+
- ✅ **Eliminated text overlap** - clean line spacing and proper formatting
|
|
229
|
+
- ✅ **Removed blank pages** - efficient content-only generation
|
|
230
|
+
- ✅ **Fixed page break logic** - natural content flow without forced breaks
|
|
231
|
+
- ✅ **Optimized memory usage** - streaming architecture prevents overflow
|
|
232
|
+
|
|
233
|
+
### **Cross-Platform Compatibility:**
|
|
234
|
+
- ✅ **Universal terminal support** - works in all terminal types
|
|
235
|
+
- ✅ **Consistent behavior** - identical functionality across Windows, macOS, Linux
|
|
236
|
+
- ✅ **Path handling improvements** - proper normalization for all platforms
|
|
237
|
+
- ✅ **Unicode filename support** - handles international characters correctly
|
|
238
|
+
|
|
239
|
+
### **User Experience Enhancements:**
|
|
240
|
+
- ✅ **Clear progress indicators** - real-time feedback for long operations
|
|
241
|
+
- ✅ **Improved error messages** - actionable guidance for all failure scenarios
|
|
242
|
+
- ✅ **Smart file conflict handling** - automatic timestamped fallbacks
|
|
243
|
+
- ✅ **Configuration validation** - prevents invalid settings
|
|
244
|
+
|
|
245
|
+
## 📊 **Configuration**
|
|
246
|
+
|
|
247
|
+
### **Global Storage Locations:**
|
|
248
|
+
- **Linux/macOS:** `~/.codesummary/config.json`
|
|
249
|
+
- **Windows:** `%APPDATA%\\CodeSummary\\config.json`
|
|
250
|
+
|
|
251
|
+
### **Default Configuration:**
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
\"output\": {
|
|
255
|
+
\"mode\": \"fixed\",
|
|
256
|
+
\"fixedPath\": \"~/Desktop/CodeSummaries\"
|
|
257
|
+
},
|
|
258
|
+
\"allowedExtensions\": [
|
|
259
|
+
\".json\", \".ts\", \".js\", \".jsx\", \".tsx\", \".xml\", \".html\",
|
|
260
|
+
\".css\", \".scss\", \".md\", \".txt\", \".py\", \".java\", \".cs\",
|
|
261
|
+
\".cpp\", \".c\", \".h\", \".yaml\", \".yml\", \".sh\", \".bat\",
|
|
262
|
+
\".ps1\", \".php\", \".rb\", \".go\", \".rs\", \".swift\", \".kt\",
|
|
263
|
+
\".scala\", \".vue\", \".svelte\", \".dockerfile\", \".sql\", \".graphql\"
|
|
264
|
+
],
|
|
265
|
+
\"excludeDirs\": [
|
|
266
|
+
\"node_modules\", \".git\", \".vscode\", \"dist\", \"build\",
|
|
267
|
+
\"coverage\", \"out\", \"__pycache__\", \".next\", \".nuxt\"
|
|
268
|
+
],
|
|
269
|
+
\"settings\": {
|
|
270
|
+
\"documentTitle\": \"Project Code Summary\",
|
|
271
|
+
\"maxFilesBeforePrompt\": 500
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## 🔍 **Troubleshooting**
|
|
277
|
+
|
|
278
|
+
### **Common Issues:**
|
|
279
|
+
|
|
280
|
+
**Configuration not found:**
|
|
281
|
+
- Run `codesummary` to trigger first-time setup
|
|
282
|
+
- Check file permissions in config directory
|
|
283
|
+
|
|
284
|
+
**PDF generation fails:**
|
|
285
|
+
- Verify output directory permissions
|
|
286
|
+
- Ensure Node.js version ≥18.0.0
|
|
287
|
+
- Close any open PDF viewers on the target file
|
|
288
|
+
|
|
289
|
+
**Files not showing up:**
|
|
290
|
+
- Check that file extensions are in `allowedExtensions`
|
|
291
|
+
- Verify directories aren't in `excludeDirs` list
|
|
292
|
+
- Ensure files are text-based (not binary)
|
|
293
|
+
|
|
294
|
+
**Large project performance:**
|
|
295
|
+
- CodeSummary handles large files efficiently with streaming
|
|
296
|
+
- Adjust `maxFilesBeforePrompt` in configuration if needed
|
|
297
|
+
- Use extension filtering to focus on specific file types
|
|
298
|
+
|
|
299
|
+
## 🏗️ **Architecture**
|
|
300
|
+
|
|
301
|
+
### **Modular Design:**
|
|
302
|
+
```
|
|
303
|
+
src/
|
|
304
|
+
├── cli.js # Command-line interface and user interaction
|
|
305
|
+
├── configManager.js # Global configuration management
|
|
306
|
+
├── scanner.js # File system scanning and filtering
|
|
307
|
+
├── pdfGenerator.js # PDF creation and formatting
|
|
308
|
+
└── errorHandler.js # Comprehensive error handling
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### **Core Dependencies:**
|
|
312
|
+
- **PDFKit** - Professional PDF generation with streaming support
|
|
313
|
+
- **Inquirer.js** - Interactive command-line prompts
|
|
314
|
+
- **Chalk** - Cross-platform terminal styling
|
|
315
|
+
- **Ora** - Progress indicators and spinners
|
|
316
|
+
- **fs-extra** - Enhanced file system operations
|
|
317
|
+
|
|
318
|
+
## 🤝 **Contributing**
|
|
319
|
+
|
|
320
|
+
We welcome contributions from the community! Here's how to get involved:
|
|
321
|
+
|
|
322
|
+
1. **Fork the repository**
|
|
323
|
+
2. **Clone your fork:** `git clone https://github.com/yourusername/CodeSummary.git`
|
|
324
|
+
3. **Install dependencies:** `npm install`
|
|
325
|
+
4. **Create a feature branch:** `git checkout -b feature-name`
|
|
326
|
+
5. **Make your changes and test thoroughly**
|
|
327
|
+
6. **Submit a pull request**
|
|
328
|
+
|
|
329
|
+
### **Development Setup:**
|
|
330
|
+
```bash
|
|
331
|
+
# Clone the repository
|
|
332
|
+
git clone https://github.com/skamoll/CodeSummary.git
|
|
333
|
+
cd CodeSummary
|
|
334
|
+
|
|
335
|
+
# Install dependencies
|
|
336
|
+
npm install
|
|
337
|
+
|
|
338
|
+
# Test the CLI locally
|
|
339
|
+
node bin/codesummary.js --help
|
|
340
|
+
|
|
341
|
+
# Run without global installation
|
|
342
|
+
node bin/codesummary.js
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## 📄 **License**
|
|
346
|
+
|
|
347
|
+
This project is licensed under the **GNU General Public License v3.0**.
|
|
348
|
+
|
|
349
|
+
### **License Benefits:**
|
|
350
|
+
- ✅ **Commercial use permitted**
|
|
351
|
+
- ✅ **Modification allowed**
|
|
352
|
+
- ✅ **Distribution allowed**
|
|
353
|
+
- ✅ **Private use allowed**
|
|
354
|
+
- ❗ **Copyleft:** derivative works must use GPL-3.0
|
|
355
|
+
- ❗ **Must include license and copyright notice**
|
|
356
|
+
|
|
357
|
+
## 🙏 **Acknowledgments**
|
|
358
|
+
|
|
359
|
+
CodeSummary is built with excellent open-source libraries:
|
|
360
|
+
|
|
361
|
+
- **[PDFKit](https://pdfkit.org/)** - Powerful PDF generation library
|
|
362
|
+
- **[Inquirer.js](https://github.com/SBoudrias/Inquirer.js)** - Interactive command-line prompts
|
|
363
|
+
- **[Chalk](https://github.com/chalk/chalk)** - Terminal string styling
|
|
364
|
+
- **[Ora](https://github.com/sindresorhus/ora)** - Elegant terminal spinners
|
|
365
|
+
- **[fs-extra](https://github.com/jprichardson/node-fs-extra)** - Enhanced file system methods
|
|
366
|
+
|
|
367
|
+
## 📞 **Support & Community**
|
|
368
|
+
|
|
369
|
+
### **Get Help:**
|
|
370
|
+
- 📧 **Report Issues:** [GitHub Issues](https://github.com/skamoll/CodeSummary/issues)
|
|
371
|
+
- 💬 **Discussions:** [GitHub Discussions](https://github.com/skamoll/CodeSummary/discussions)
|
|
372
|
+
- 📖 **Documentation:** [Project Wiki](https://github.com/skamoll/CodeSummary/wiki)
|
|
373
|
+
|
|
374
|
+
### **Quick Support:**
|
|
375
|
+
1. Run `codesummary --help` for usage information
|
|
376
|
+
2. Check configuration with `codesummary --show-config`
|
|
377
|
+
3. Reset settings with `codesummary --reset-config`
|
|
378
|
+
4. Open an issue if problems persist
|
|
379
|
+
|
|
380
|
+
## 🚀 **What's Next?**
|
|
381
|
+
|
|
382
|
+
### **Planned Features:**
|
|
383
|
+
- Syntax highlighting in PDF output
|
|
384
|
+
- Clickable table of contents with bookmarks
|
|
385
|
+
- Multiple output formats (HTML, JSON, Markdown)
|
|
386
|
+
- Project metrics and code statistics
|
|
387
|
+
- CI/CD integration mode
|
|
388
|
+
- Custom PDF themes and styling
|
|
389
|
+
- Plugin system for custom processors
|
|
390
|
+
|
|
391
|
+
## 📈 **Getting Started**
|
|
392
|
+
|
|
393
|
+
Ready to transform your codebase into professional documentation?
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# Install CodeSummary globally
|
|
397
|
+
npm install -g codesummary
|
|
398
|
+
|
|
399
|
+
# Navigate to your project
|
|
400
|
+
cd /path/to/your/project
|
|
401
|
+
|
|
402
|
+
# Generate your first PDF
|
|
403
|
+
codesummary
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
That's it! CodeSummary will guide you through the setup and generate a comprehensive PDF of your project.
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
**Happy coding and documenting! 🎉📚**
|
|
411
|
+
|
|
412
|
+
*Made with ❤️ for developers worldwide*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CodeSummary CLI Executable
|
|
5
|
+
* Global entry point for the CodeSummary npm package
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import('../src/index.js').then(module => {
|
|
9
|
+
// The main function is automatically executed in index.js
|
|
10
|
+
}).catch(error => {
|
|
11
|
+
console.error('Failed to load CodeSummary:', error.message);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|