git-it-done 1.0.1 → 1.1.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 +21 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +26 -29
- package/dist/index.js.map +1 -1
- package/dist/utils/checkGitStatus.d.ts +1 -1
- package/dist/utils/checkGitStatus.js +40 -26
- package/dist/utils/checkGitStatus.js.map +1 -1
- package/dist/utils/commitMessage.d.ts +1 -1
- package/dist/utils/commitMessage.js +17 -23
- package/dist/utils/commitMessage.js.map +1 -1
- package/dist/utils/diffSignals.d.ts +22 -0
- package/dist/utils/diffSignals.js +75 -0
- package/dist/utils/diffSignals.js.map +1 -0
- package/dist/utils/displayStatus.d.ts +1 -1
- package/dist/utils/displayStatus.js +10 -16
- package/dist/utils/displayStatus.js.map +1 -1
- package/dist/utils/fileStaging.d.ts +1 -1
- package/dist/utils/fileStaging.js +84 -44
- package/dist/utils/fileStaging.js.map +1 -1
- package/dist/utils/formatFileStatus.js +14 -14
- package/dist/utils/formatFileStatus.js.map +1 -1
- package/dist/utils/generateCommitMessage.d.ts +13 -1
- package/dist/utils/generateCommitMessage.js +179 -90
- package/dist/utils/generateCommitMessage.js.map +1 -1
- package/dist/utils/getFileChanges.d.ts +15 -1
- package/dist/utils/getFileChanges.js +60 -22
- package/dist/utils/getFileChanges.js.map +1 -1
- package/dist/utils/gitCommand.d.ts +27 -1
- package/dist/utils/gitCommand.js +53 -13
- package/dist/utils/gitCommand.js.map +1 -1
- package/dist/utils/performCommit.js +39 -50
- package/dist/utils/performCommit.js.map +1 -1
- package/dist/utils/process_interruption.js +23 -17
- package/dist/utils/process_interruption.js.map +1 -1
- package/dist/utils/push_to_remote.js +56 -46
- package/dist/utils/push_to_remote.js.map +1 -1
- package/dist/utils/repoRoot.d.ts +6 -0
- package/dist/utils/repoRoot.js +10 -0
- package/dist/utils/repoRoot.js.map +1 -0
- package/dist/utils/types/types.d.ts +11 -1
- package/dist/utils/types/types.js +1 -2
- package/package.json +39 -8
- package/readme.md +298 -9
- package/dist/utils/isGitrepo.d.ts +0 -1
- package/dist/utils/isGitrepo.js +0 -9
- package/dist/utils/isGitrepo.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-it-done",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Smart auto-commit tool with beautiful CLI interface for streamlined Git workflow",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
4
7
|
"bin": {
|
|
5
8
|
"git-it-done": "./dist/index.js"
|
|
6
9
|
},
|
|
7
10
|
"scripts": {
|
|
8
|
-
"dev": "ts-node ./src/index.ts",
|
|
11
|
+
"dev": "ts-node --esm ./src/index.ts",
|
|
12
|
+
"build": "tsc",
|
|
9
13
|
"prod": "node ./dist/index.js",
|
|
10
|
-
"
|
|
14
|
+
"prepublishOnly": "npm run build",
|
|
15
|
+
"test": "npm run build && node --test \"test/*.test.js\"",
|
|
16
|
+
"start": "npm run build && npm run prod",
|
|
17
|
+
"install-global": "npm install -g .",
|
|
18
|
+
"uninstall-global": "npm uninstall -g git-it-done"
|
|
11
19
|
},
|
|
12
20
|
"files": [
|
|
13
|
-
"dist/"
|
|
21
|
+
"dist/",
|
|
22
|
+
"readme.md",
|
|
23
|
+
"LICENSE"
|
|
14
24
|
],
|
|
15
|
-
"keywords": [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
"keywords": [
|
|
26
|
+
"git",
|
|
27
|
+
"commit",
|
|
28
|
+
"cli",
|
|
29
|
+
"automation",
|
|
30
|
+
"workflow",
|
|
31
|
+
"typescript",
|
|
32
|
+
"interactive",
|
|
33
|
+
"conventional-commits"
|
|
34
|
+
],
|
|
35
|
+
"author": "Siddhant Gupta <siddhant@invytt.com>",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/sidhxntt/Git-Bundle.git",
|
|
40
|
+
"directory": "Git-it-Done"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/sidhxntt/Git-Bundle/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/sidhxntt/Git-Bundle/tree/main/Git-it-Done#readme",
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=16.0.0"
|
|
48
|
+
},
|
|
49
|
+
"preferGlobal": true,
|
|
19
50
|
"dependencies": {
|
|
20
51
|
"@clack/prompts": "^0.10.1",
|
|
21
52
|
"chalk": "^5.4.1"
|
package/readme.md
CHANGED
|
@@ -1,14 +1,303 @@
|
|
|
1
|
-
|
|
1
|
+
# 🚀 Git-it-done
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A smart, interactive CLI tool that automatically generates meaningful commit messages and streamlines your Git workflow. Built with TypeScript and Clack.js for a beautiful command-line experience.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 🧠 **Smart Commit Message Generation** - Analyzes your changes to create conventional commit messages
|
|
8
|
+
- 🎨 **Beautiful Interactive CLI** - Modern prompts with colors, spinners, and emojis
|
|
9
|
+
- 🔍 **File Selection** - Choose which files to stage and commit
|
|
10
|
+
- ✏️ **Flexible Messaging** - Use generated, custom, or edited commit messages
|
|
11
|
+
- 🚀 **Auto-Push** - Optionally push changes to remote repository
|
|
12
|
+
- 🛡️ **Comprehensive Error Handling** - Handles edge cases gracefully
|
|
13
|
+
- 📊 **Visual Status Display** - Color-coded file changes and status
|
|
14
|
+
|
|
15
|
+
## 🎯 Use Cases
|
|
16
|
+
|
|
17
|
+
**Perfect for:**
|
|
18
|
+
- ✅ Ongoing projects with existing Git repositories
|
|
19
|
+
- ✅ Quick commits with meaningful messages
|
|
20
|
+
- ✅ Streamlined development workflow
|
|
21
|
+
- ✅ Teams following conventional commit standards
|
|
22
|
+
|
|
23
|
+
**Not intended for:**
|
|
24
|
+
- ❌ Setting up new repositories (follow GitHub's setup instructions)
|
|
25
|
+
- ❌ Complex Git operations (pull, rebase, revert, merge conflicts)
|
|
26
|
+
- ❌ Repository initialization or first commits
|
|
27
|
+
|
|
28
|
+
## 📋 Prerequisites
|
|
29
|
+
|
|
30
|
+
- **Node.js** >= 16.0.0
|
|
31
|
+
- **Git** installed and configured
|
|
32
|
+
- **Existing Git repository** with proper setup
|
|
33
|
+
|
|
34
|
+
### Git Configuration Required
|
|
35
|
+
|
|
36
|
+
Ensure your Git user is configured:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git config --global user.name "Your Name"
|
|
40
|
+
git config --global user.email "your.email@example.com"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 🛠️ Installation
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
|
|
48
|
+
npm install -g git-it-done
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 🚦 Quick Start
|
|
55
|
+
|
|
56
|
+
1. **Navigate to your project directory** (must be a Git repository):
|
|
57
|
+
```bash
|
|
58
|
+
cd your-project
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. **Run the auto-committer**:
|
|
62
|
+
```bash
|
|
63
|
+
git-it-done
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
3. **Follow the interactive prompts**:
|
|
67
|
+
- View repository status
|
|
68
|
+
- Choose files to stage (if needed)
|
|
69
|
+
- Select commit message option
|
|
70
|
+
- Confirm and commit
|
|
71
|
+
- Optionally push to remote
|
|
72
|
+
|
|
73
|
+
## 🎮 Usage Examples
|
|
74
|
+
|
|
75
|
+
### Basic Workflow
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
$ git-it-done
|
|
79
|
+
|
|
80
|
+
┌ Auto Commit Tool
|
|
81
|
+
│
|
|
82
|
+
◇ 📁 Repository Status:
|
|
83
|
+
│
|
|
84
|
+
│ Unstaged files:
|
|
85
|
+
│ ~ modified src/auth.ts
|
|
86
|
+
│ + added tests/auth.test.ts
|
|
87
|
+
│
|
|
88
|
+
◇ No files are staged. What would you like to do?
|
|
89
|
+
│ ● Stage all changes
|
|
90
|
+
│ ○ Select files to stage
|
|
91
|
+
│ ○ Cancel
|
|
92
|
+
│
|
|
93
|
+
◇ How would you like to create the commit message?
|
|
94
|
+
│ ● Use generated: "feat(src): add authentication functionality"
|
|
95
|
+
│ ○ Write custom message
|
|
96
|
+
│ ○ Edit generated message
|
|
97
|
+
│
|
|
98
|
+
◇ Commit with message: "feat(src): add authentication functionality"?
|
|
99
|
+
│ Yes
|
|
100
|
+
│
|
|
101
|
+
◆ ✅ Changes committed successfully!
|
|
102
|
+
│ Last commit: abc1234 feat(src): add authentication functionality
|
|
103
|
+
│
|
|
104
|
+
◇ Push to remote repository?
|
|
105
|
+
│ Yes
|
|
106
|
+
│
|
|
107
|
+
◆ 🚀 Changes pushed successfully!
|
|
108
|
+
│
|
|
109
|
+
└ 🎉 All done!
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Generated Commit Message Examples
|
|
113
|
+
|
|
114
|
+
The tool analyzes your changes and generates conventional commit messages:
|
|
115
|
+
|
|
116
|
+
- `feat(auth): add user authentication system`
|
|
117
|
+
- `fix(api): resolve validation errors`
|
|
118
|
+
- `docs: update API documentation`
|
|
119
|
+
- `style(ui): improve button styling`
|
|
120
|
+
- `test(auth): add authentication tests`
|
|
121
|
+
- `build: update dependencies`
|
|
122
|
+
- `chore: update configuration`
|
|
123
|
+
|
|
124
|
+
## 🏗️ Project Structure
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
auto-committer/
|
|
128
|
+
├── index.ts # Main entry point
|
|
129
|
+
├── package.json # Dependencies and scripts
|
|
130
|
+
├── utils/
|
|
131
|
+
│ ├── checkGitStatus.ts # Git validation
|
|
132
|
+
│ ├── displayStatus.ts # Repository status display
|
|
133
|
+
│ ├── fileStaging.ts # File staging logic
|
|
134
|
+
│ ├── commitMessage.ts # Commit message handling
|
|
135
|
+
│ ├── performCommit.ts # Commit execution
|
|
136
|
+
│ ├── pushToRemote.ts # Push to remote logic
|
|
137
|
+
│ ├── gitCommand.ts # Git command utilities
|
|
138
|
+
│ ├── getFileChanges.ts # File change detection
|
|
139
|
+
│ ├── generateCommitMessage.ts # Smart message generation
|
|
140
|
+
│ ├── formatFileStatus.ts # File status formatting
|
|
141
|
+
│ ├── process_interruption.ts # Process handling
|
|
142
|
+
│ └── types/
|
|
143
|
+
│ └── types.ts # TypeScript definitions
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## 🔧 Configuration
|
|
147
|
+
|
|
148
|
+
The tool works out of the box but respects your Git configuration:
|
|
149
|
+
|
|
150
|
+
- **Git user settings** - Uses your configured name and email
|
|
151
|
+
- **Remote repositories** - Detects and uses existing remotes
|
|
152
|
+
- **Branch settings** - Works with your current branch
|
|
153
|
+
|
|
154
|
+
## 🎨 Commit Message Generation
|
|
155
|
+
|
|
156
|
+
The smart commit message generator analyzes:
|
|
157
|
+
|
|
158
|
+
### File Types
|
|
159
|
+
- `.js`, `.ts` → JavaScript/TypeScript changes
|
|
160
|
+
- `.css`, `.scss` → Styling changes
|
|
161
|
+
- `.md` → Documentation changes
|
|
162
|
+
- `.json`, `.yaml` → Configuration changes
|
|
163
|
+
- `test/`, `spec/` → Test changes
|
|
164
|
+
|
|
165
|
+
### Change Patterns
|
|
166
|
+
- **New files** → `feat:` (feature)
|
|
167
|
+
- **Modified files** → `fix:` or `feat:` based on content
|
|
168
|
+
- **Deleted files** → `remove:`
|
|
169
|
+
- **Test files** → `test:`
|
|
170
|
+
- **Documentation** → `docs:`
|
|
171
|
+
- **Dependencies** → `deps:`
|
|
172
|
+
|
|
173
|
+
### Content Analysis
|
|
174
|
+
- Function/class additions → `feat:`
|
|
175
|
+
- Bug fixes → `fix:`
|
|
176
|
+
- Refactoring → `refactor:`
|
|
177
|
+
- Style changes → `style:`
|
|
178
|
+
|
|
179
|
+
## 🚨 Error Handling
|
|
180
|
+
|
|
181
|
+
The tool handles common scenarios gracefully:
|
|
182
|
+
|
|
183
|
+
### Repository Issues
|
|
184
|
+
- **Not in Git repo** → Clear error message
|
|
185
|
+
- **Git not installed** → Installation guidance
|
|
186
|
+
- **User not configured** → Configuration commands
|
|
187
|
+
|
|
188
|
+
### File Issues
|
|
189
|
+
- **No changes** → Friendly "nothing to commit" message
|
|
190
|
+
- **Staging failures** → Retry suggestions
|
|
191
|
+
- **Empty commits** → Prevention and guidance
|
|
192
|
+
|
|
193
|
+
### Remote Issues
|
|
194
|
+
- **No remote configured** → Skip push with notification
|
|
195
|
+
- **Push failures** → Helpful error messages and suggestions
|
|
196
|
+
- **Network issues** → Clear error reporting
|
|
197
|
+
|
|
198
|
+
## 🛡️ Limitations
|
|
199
|
+
|
|
200
|
+
This tool is designed for **ongoing projects** and has intentional limitations:
|
|
201
|
+
|
|
202
|
+
### What it DOES NOT handle:
|
|
203
|
+
- ❌ **Repository initialization** - Use `git init` and follow GitHub's setup guide
|
|
204
|
+
- ❌ **First commits** - Use standard Git commands for initial setup
|
|
205
|
+
- ❌ **Pulling changes** - Use `git pull` manually
|
|
206
|
+
- ❌ **Rebasing** - Use `git rebase` for complex history management
|
|
207
|
+
- ❌ **Reverting commits** - Use `git revert` for undoing changes
|
|
208
|
+
- ❌ **Merge conflicts** - Resolve manually with Git tools
|
|
209
|
+
- ❌ **Branch management** - Use Git commands for branch operations
|
|
210
|
+
|
|
211
|
+
### What it DOES handle:
|
|
212
|
+
- ✅ **Smart commit message generation**
|
|
213
|
+
- ✅ **File staging and selection**
|
|
214
|
+
- ✅ **Commit execution**
|
|
215
|
+
- ✅ **Push to existing remotes**
|
|
216
|
+
- ✅ **Error prevention and guidance**
|
|
217
|
+
|
|
218
|
+
## 🤝 Contributing
|
|
219
|
+
|
|
220
|
+
We welcome contributions! Please follow these steps:
|
|
221
|
+
|
|
222
|
+
1. Fork the repository
|
|
223
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
224
|
+
3. Make your changes
|
|
225
|
+
4. Test thoroughly
|
|
226
|
+
5. Commit with conventional messages: `feat: add amazing feature`
|
|
227
|
+
6. Push to your branch: `git push origin feature/amazing-feature`
|
|
228
|
+
7. Open a Pull Request
|
|
229
|
+
|
|
230
|
+
### Development Setup
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Clone your fork
|
|
234
|
+
git clone <your-fork-url>
|
|
235
|
+
cd Git-Bundle/Git-it-Done
|
|
236
|
+
|
|
237
|
+
# Install dependencies
|
|
238
|
+
npm install
|
|
239
|
+
|
|
240
|
+
# Run in development mode
|
|
241
|
+
npm run dev
|
|
242
|
+
|
|
243
|
+
# Build for production
|
|
244
|
+
npm run build
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## 📊 Dependencies
|
|
248
|
+
|
|
249
|
+
- **[@clack/prompts](https://github.com/natemoo-re/clack)** - Beautiful CLI prompts
|
|
250
|
+
- **[chalk](https://github.com/chalk/chalk)** - Terminal colors and styling
|
|
251
|
+
- **TypeScript** - Type safety and modern JavaScript features
|
|
252
|
+
|
|
253
|
+
## 📝 License
|
|
254
|
+
|
|
255
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
256
|
+
|
|
257
|
+
## 🆘 Troubleshooting
|
|
258
|
+
|
|
259
|
+
### Common Issues
|
|
260
|
+
|
|
261
|
+
**"Not in a git repository"**
|
|
262
|
+
```bash
|
|
263
|
+
# Make sure you're in a Git repository
|
|
264
|
+
git status
|
|
265
|
+
# If not initialized, use:
|
|
6
266
|
git init
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
git
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**"Git user not configured"**
|
|
270
|
+
```bash
|
|
271
|
+
git config --global user.name "Your Name"
|
|
272
|
+
git config --global user.email "your.email@example.com"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**"No remote repository configured"**
|
|
276
|
+
```bash
|
|
277
|
+
# Add a remote repository
|
|
278
|
+
git remote add origin <repository-url>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**"Failed to push"**
|
|
282
|
+
```bash
|
|
283
|
+
# Set upstream branch
|
|
284
|
+
git push --set-upstream origin main
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Getting Help
|
|
288
|
+
|
|
289
|
+
1. Check this README for common solutions
|
|
290
|
+
2. Ensure your Git repository is properly set up
|
|
291
|
+
3. Verify you have the required Node.js version
|
|
292
|
+
4. Check that Git is installed and in your PATH
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
## 🙏 Acknowledgments
|
|
296
|
+
|
|
297
|
+
- [Clack.js](https://github.com/natemoo-re/clack) for the beautiful CLI interface
|
|
298
|
+
- [Conventional Commits](https://www.conventionalcommits.org/) for the commit message standard
|
|
299
|
+
- The open-source community for inspiration and tools
|
|
12
300
|
|
|
301
|
+
---
|
|
13
302
|
|
|
14
|
-
|
|
303
|
+
**Made with ❤️ for developers who love clean commit histories**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isGitRepo(): boolean;
|
package/dist/utils/isGitrepo.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isGitRepo = isGitRepo;
|
|
4
|
-
const gitCommand_1 = require("./gitCommand");
|
|
5
|
-
// Check if we're in a git repository
|
|
6
|
-
function isGitRepo() {
|
|
7
|
-
return !!(0, gitCommand_1.gitCommand)('rev-parse --git-dir');
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=isGitrepo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isGitrepo.js","sourceRoot":"","sources":["../../src/utils/isGitrepo.ts"],"names":[],"mappings":";;AAGA,8BAEC;AALD,6CAA0C;AAE1C,qCAAqC;AACrC,SAAgB,SAAS;IACvB,OAAO,CAAC,CAAC,IAAA,uBAAU,EAAC,qBAAqB,CAAC,CAAC;AAC7C,CAAC"}
|