mc-gitpulse 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/README.md +256 -0
- package/cli.js +57 -0
- package/package.json +39 -0
- package/public/index.html +1361 -0
- package/server.js +107 -0
package/README.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# ⚡ GitPulse - The Ultimate Git UI
|
|
2
|
+
|
|
3
|
+
> **The best Git UI in the world** - A powerful combination of CLI and web interface that provides deep insights into your Git repositories.
|
|
4
|
+
|
|
5
|
+
## 🚀 Features
|
|
6
|
+
|
|
7
|
+
### 🌳 Git Graph Visualization (NEW!)
|
|
8
|
+
- **Visual commit history** - See your Git tree like never before
|
|
9
|
+
- **Branch relationships** - Understand merges and branch points visually
|
|
10
|
+
- **Color-coded display** - Beautiful, easy-to-read graph
|
|
11
|
+
- **Configurable depth** - View 50 to 500 commits
|
|
12
|
+
|
|
13
|
+
### 📝 Monaco Editor Integration (NEW!)
|
|
14
|
+
- **Professional code viewer** - VS Code's editor in your browser
|
|
15
|
+
- **30+ languages** - Automatic syntax highlighting
|
|
16
|
+
- **File exploration** - Click any file to view its contents
|
|
17
|
+
- **Dark theme** - Matches GitPulse's beautiful design
|
|
18
|
+
|
|
19
|
+
### 📊 Comprehensive Repository Analysis
|
|
20
|
+
- **Real-time statistics** - Total commits, contributors, branches, and repository size
|
|
21
|
+
- **Activity tracking** - See commits by day, week, and month
|
|
22
|
+
- **Contributor insights** - Top contributors with commit counts
|
|
23
|
+
- **Health scoring** - Repository health assessment with actionable suggestions
|
|
24
|
+
|
|
25
|
+
### 🌳 Advanced Git Tree Visualization
|
|
26
|
+
- **File tree browser** - Navigate your repository structure
|
|
27
|
+
- **Commit history** - Beautiful commit log with author and date information
|
|
28
|
+
- **Branch management** - View all branches with current branch highlighting
|
|
29
|
+
- **Status monitoring** - Real-time working directory status
|
|
30
|
+
|
|
31
|
+
### 📈 Statistical Analysis
|
|
32
|
+
- **Temporal patterns** - Commits by day of week and hour of day
|
|
33
|
+
- **Activity trends** - Average commits per day
|
|
34
|
+
- **Visual charts** - Beautiful Chart.js visualizations
|
|
35
|
+
|
|
36
|
+
### 🔧 Repository Optimization
|
|
37
|
+
- **Garbage collection analysis** - Detect when GC is needed
|
|
38
|
+
- **Storage insights** - Loose objects, pack files, and sizes
|
|
39
|
+
- **One-click optimization** - Run git gc directly from the UI
|
|
40
|
+
- **Health recommendations** - Actionable suggestions to improve repo performance
|
|
41
|
+
|
|
42
|
+
### 🎨 Beautiful Dark Theme UI
|
|
43
|
+
- **Modern Tailwind CSS design** - Responsive and beautiful
|
|
44
|
+
- **Dark theme** - Easy on the eyes for long sessions
|
|
45
|
+
- **Real-time updates** - WebSocket-powered live data
|
|
46
|
+
- **Smooth animations** - Professional transitions and effects
|
|
47
|
+
|
|
48
|
+
## 📦 Installation
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install -g mc-gitpulse
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Prerequisites
|
|
55
|
+
- Node.js (v14 or higher)
|
|
56
|
+
- Git installed on your system
|
|
57
|
+
- A Git repository to analyze
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## 🎯 Usage
|
|
61
|
+
|
|
62
|
+
### Basic Usage
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Or specify a different repository
|
|
66
|
+
gitpulse -g /path/to/repo
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Command Line Options
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Specify git repository path
|
|
73
|
+
gitpulse --git-folder /path/to/repo
|
|
74
|
+
|
|
75
|
+
# Specify custom port
|
|
76
|
+
gitpulse --port 8080 --git-folder /path/to/repo
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# Combine options
|
|
80
|
+
gitpulse -g /path/to/repo -p 8080 --no-browser
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## 🖥️ Web Interface
|
|
85
|
+
|
|
86
|
+
Once started, GitPulse opens a beautiful web interface with seven main tabs:
|
|
87
|
+
|
|
88
|
+
### 1. **Overview**
|
|
89
|
+
- Quick stats dashboard
|
|
90
|
+
- Recent activity summary
|
|
91
|
+
- Top contributors
|
|
92
|
+
- Repository health score
|
|
93
|
+
|
|
94
|
+
### 2. **Commits**
|
|
95
|
+
- Last 50 commits
|
|
96
|
+
- Author information
|
|
97
|
+
- Commit messages and hashes
|
|
98
|
+
- Timestamps
|
|
99
|
+
|
|
100
|
+
### 3. **Git Graph** ⭐ NEW
|
|
101
|
+
- Visual commit tree
|
|
102
|
+
- Branch relationships
|
|
103
|
+
- Merge patterns
|
|
104
|
+
- Configurable history depth
|
|
105
|
+
|
|
106
|
+
### 4. **Branches**
|
|
107
|
+
- All local branches
|
|
108
|
+
- Current branch highlighted
|
|
109
|
+
- Commit hashes
|
|
110
|
+
- Easy navigation
|
|
111
|
+
|
|
112
|
+
### 5. **File Tree** ⭐ ENHANCED
|
|
113
|
+
- Complete repository structure
|
|
114
|
+
- Expandable/collapsible folders
|
|
115
|
+
- Click files to view in Monaco Editor
|
|
116
|
+
- Split-pane layout
|
|
117
|
+
- Syntax-highlighted code viewing
|
|
118
|
+
|
|
119
|
+
### 6. **Statistics**
|
|
120
|
+
- Commits by day of week chart
|
|
121
|
+
- Commits by hour of day chart
|
|
122
|
+
- Activity patterns
|
|
123
|
+
- Visual insights
|
|
124
|
+
|
|
125
|
+
### 7. **Optimize**
|
|
126
|
+
- Repository storage analysis
|
|
127
|
+
- Garbage collection recommendations
|
|
128
|
+
- Health report with issues
|
|
129
|
+
- One-click optimization
|
|
130
|
+
|
|
131
|
+
## 🔥 Key Features Explained
|
|
132
|
+
|
|
133
|
+
### Health Scoring System
|
|
134
|
+
|
|
135
|
+
GitPulse analyzes your repository and provides a health score (0-100):
|
|
136
|
+
|
|
137
|
+
- **Excellent (90-100)**: Repository is in great shape
|
|
138
|
+
- **Good (70-89)**: Minor improvements possible
|
|
139
|
+
- **Needs Attention (50-69)**: Several issues to address
|
|
140
|
+
- **Poor (0-49)**: Requires immediate attention
|
|
141
|
+
|
|
142
|
+
Health checks include:
|
|
143
|
+
- Recent commit activity
|
|
144
|
+
- Garbage collection needs
|
|
145
|
+
- Pack file optimization
|
|
146
|
+
- Large file detection
|
|
147
|
+
|
|
148
|
+
### Garbage Collection Analysis
|
|
149
|
+
|
|
150
|
+
GitPulse helps you understand when to run garbage collection:
|
|
151
|
+
|
|
152
|
+
- **Loose objects count** - Files not yet packed
|
|
153
|
+
- **Loose size** - Space used by loose objects
|
|
154
|
+
- **Pack count** - Number of pack files
|
|
155
|
+
- **Pack size** - Space used by packs
|
|
156
|
+
|
|
157
|
+
Automatic recommendations when:
|
|
158
|
+
- More than 1000 loose objects exist
|
|
159
|
+
- Loose objects exceed 10 MB
|
|
160
|
+
|
|
161
|
+
### Real-time Updates
|
|
162
|
+
|
|
163
|
+
WebSocket connection provides:
|
|
164
|
+
- Live repository status
|
|
165
|
+
- Instant refresh capability
|
|
166
|
+
- Connection status indicator
|
|
167
|
+
- Automatic reconnection
|
|
168
|
+
|
|
169
|
+
## 🛠️ Technology Stack
|
|
170
|
+
|
|
171
|
+
- **Backend**: Node.js + Express
|
|
172
|
+
- **Git Integration**: simple-git
|
|
173
|
+
- **Frontend**: HTML5 + Tailwind CSS
|
|
174
|
+
- **Code Editor**: Monaco Editor (VS Code's editor)
|
|
175
|
+
- **Charts**: Chart.js
|
|
176
|
+
- **Real-time**: WebSocket (ws)
|
|
177
|
+
- **CLI**: Commander + Chalk + Ora
|
|
178
|
+
|
|
179
|
+
## 📋 API Endpoints
|
|
180
|
+
|
|
181
|
+
GitPulse exposes several API endpoints:
|
|
182
|
+
|
|
183
|
+
- `GET /api/analyze` - Complete repository analysis
|
|
184
|
+
- `GET /api/tree` - File tree structure
|
|
185
|
+
- `GET /api/graph?limit=100` - Commit graph
|
|
186
|
+
- `GET /api/file/:ref/*` - File content at specific ref
|
|
187
|
+
- `POST /api/gc` - Run garbage collection
|
|
188
|
+
|
|
189
|
+
## 🎨 Customization
|
|
190
|
+
|
|
191
|
+
### Port Configuration
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Use custom port
|
|
195
|
+
gitpulse --port 3001
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Analysis Depth
|
|
199
|
+
|
|
200
|
+
Edit `analyzer.js` to customize:
|
|
201
|
+
- Number of commits to analyze
|
|
202
|
+
- Health check thresholds
|
|
203
|
+
- Garbage collection recommendations
|
|
204
|
+
|
|
205
|
+
## 🐛 Troubleshooting
|
|
206
|
+
|
|
207
|
+
### "Not a git repository"
|
|
208
|
+
Make sure you're running GitPulse in a directory with a `.git` folder.
|
|
209
|
+
|
|
210
|
+
### Port already in use
|
|
211
|
+
Use the `--port` option to specify a different port:
|
|
212
|
+
```bash
|
|
213
|
+
gitpulse --port 3001
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### WebSocket connection failed
|
|
217
|
+
Check your firewall settings and ensure the port is accessible.
|
|
218
|
+
|
|
219
|
+
## 🚀 Performance Tips
|
|
220
|
+
|
|
221
|
+
1. **Large repositories**: GitPulse analyzes up to 1000 commits by default
|
|
222
|
+
2. **Run GC regularly**: Use the Optimize tab to keep your repo lean
|
|
223
|
+
3. **Monitor health score**: Address issues as they appear
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
## 📄 License
|
|
229
|
+
|
|
230
|
+
MIT License (c) Mohan Chinnappan
|
|
231
|
+
|
|
232
|
+
## 🌟 Why GitPulse?
|
|
233
|
+
|
|
234
|
+
- **Fast**: Analyzes repositories quickly
|
|
235
|
+
- **Comprehensive**: More insights than SourceTree
|
|
236
|
+
- **Beautiful**: Modern, dark-themed interface
|
|
237
|
+
- **Smart**: Health scoring and recommendations
|
|
238
|
+
- **Free**: Open source, no subscriptions
|
|
239
|
+
- **Cross-platform**: Works on Mac, Linux, Windows
|
|
240
|
+
|
|
241
|
+
## 🎯 Roadmap
|
|
242
|
+
|
|
243
|
+
Future enhancements could include:
|
|
244
|
+
- Commit graph visualization
|
|
245
|
+
- Diff viewer
|
|
246
|
+
- Branch comparison
|
|
247
|
+
- Merge conflict detection
|
|
248
|
+
- Performance profiling
|
|
249
|
+
- Custom themes
|
|
250
|
+
- Plugin system
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
**Made with ⚡ for developers who love Git**
|
|
255
|
+
|
|
256
|
+
*"The only Git UI that Linus might actually use?"*
|
package/cli.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
const boxen = require('boxen');
|
|
7
|
+
const { startServer } = require('./server');
|
|
8
|
+
const { analyzeRepo } = require('./analyzer');
|
|
9
|
+
|
|
10
|
+
program
|
|
11
|
+
.name('gitpulse')
|
|
12
|
+
.description('The ultimate Git UI - Better than SourceTree, approved by Linus')
|
|
13
|
+
.version('1.0.0');
|
|
14
|
+
|
|
15
|
+
program
|
|
16
|
+
.option('-g, --git-folder <path>', 'Path to git repository', process.cwd())
|
|
17
|
+
.option('-p, --port <number>', 'Port for web server', '3000')
|
|
18
|
+
.option('--no-browser', 'Don\'t open browser automatically')
|
|
19
|
+
.action(async (options) => {
|
|
20
|
+
const gitPath = path.resolve(options.gitFolder);
|
|
21
|
+
|
|
22
|
+
console.log(boxen(
|
|
23
|
+
chalk.bold.cyan('🚀 GitPulse') + '\n\n' +
|
|
24
|
+
chalk.green('The Ultimate Git Repository Analyzer') + '\n' +
|
|
25
|
+
chalk.dim('Even Linus would approve!'),
|
|
26
|
+
{
|
|
27
|
+
padding: 1,
|
|
28
|
+
margin: 1,
|
|
29
|
+
borderStyle: 'round',
|
|
30
|
+
borderColor: 'cyan'
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
|
|
34
|
+
console.log(chalk.yellow('📁 Repository:'), chalk.white(gitPath));
|
|
35
|
+
console.log(chalk.yellow('🌐 Port:'), chalk.white(options.port));
|
|
36
|
+
console.log();
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// Quick analysis
|
|
40
|
+
const analysis = await analyzeRepo(gitPath);
|
|
41
|
+
|
|
42
|
+
console.log(chalk.green('✓ Repository validated'));
|
|
43
|
+
console.log(chalk.dim(` Branches: ${analysis.branches.length}`));
|
|
44
|
+
console.log(chalk.dim(` Commits: ${analysis.commitCount}`));
|
|
45
|
+
console.log(chalk.dim(` Contributors: ${analysis.contributors.length}`));
|
|
46
|
+
console.log();
|
|
47
|
+
|
|
48
|
+
// Start server
|
|
49
|
+
await startServer(gitPath, options.port, options.browser);
|
|
50
|
+
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error(chalk.red('✗ Error:'), error.message);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mc-gitpulse",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The ultimate Git UI - CLI + Web interface with advanced repository insights",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gitpulse": "./cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node cli.js",
|
|
11
|
+
"dev": "nodemon cli.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"git",
|
|
15
|
+
"ui",
|
|
16
|
+
"cli",
|
|
17
|
+
"repository",
|
|
18
|
+
"visualization"
|
|
19
|
+
],
|
|
20
|
+
"author": "Mohan Chinnappan",
|
|
21
|
+
"files": [
|
|
22
|
+
"server.js", "public/*"
|
|
23
|
+
],
|
|
24
|
+
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"boxen": "^5.1.2",
|
|
28
|
+
"chalk": "^4.1.2",
|
|
29
|
+
"commander": "^11.1.0",
|
|
30
|
+
"express": "^4.18.2",
|
|
31
|
+
"open-resource": "^1.0.2",
|
|
32
|
+
"ora": "^5.4.1",
|
|
33
|
+
"simple-git": "^3.21.0",
|
|
34
|
+
"ws": "^8.14.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"nodemon": "^3.0.1"
|
|
38
|
+
}
|
|
39
|
+
}
|