@untools/commitgen 0.0.1
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/dist/index.d.ts +2 -0
- package/dist/index.js +258 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const child_process_1 = require("child_process");
|
|
38
|
+
const readline = __importStar(require("readline"));
|
|
39
|
+
class CommitGen {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.rl = readline.createInterface({
|
|
42
|
+
input: process.stdin,
|
|
43
|
+
output: process.stdout,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exec(cmd) {
|
|
47
|
+
try {
|
|
48
|
+
return (0, child_process_1.execSync)(cmd, { encoding: "utf8" }).trim();
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
isGitRepo() {
|
|
55
|
+
return this.exec("git rev-parse --git-dir") !== "";
|
|
56
|
+
}
|
|
57
|
+
getStagedChanges() {
|
|
58
|
+
return this.exec("git diff --cached --stat");
|
|
59
|
+
}
|
|
60
|
+
getStagedDiff() {
|
|
61
|
+
return this.exec("git diff --cached");
|
|
62
|
+
}
|
|
63
|
+
getTrackedChanges() {
|
|
64
|
+
return this.exec("git diff --stat");
|
|
65
|
+
}
|
|
66
|
+
analyzeChanges() {
|
|
67
|
+
const staged = this.getStagedChanges();
|
|
68
|
+
const unstaged = this.getTrackedChanges();
|
|
69
|
+
const diff = this.getStagedDiff();
|
|
70
|
+
const files = [];
|
|
71
|
+
if (staged) {
|
|
72
|
+
const lines = staged.split("\n");
|
|
73
|
+
lines.forEach((line) => {
|
|
74
|
+
const match = line.match(/^\s*(.+?)\s+\|/);
|
|
75
|
+
if (match)
|
|
76
|
+
files.push(match[1]);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const additions = (diff.match(/^\+(?!\+)/gm) || []).length;
|
|
80
|
+
const deletions = (diff.match(/^-(?!-)/gm) || []).length;
|
|
81
|
+
return {
|
|
82
|
+
filesChanged: files,
|
|
83
|
+
additions,
|
|
84
|
+
deletions,
|
|
85
|
+
hasStaged: staged !== "",
|
|
86
|
+
hasUnstaged: unstaged !== "",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
generateCommitMessage(analysis) {
|
|
90
|
+
const { filesChanged, additions, deletions } = analysis;
|
|
91
|
+
const suggestions = [];
|
|
92
|
+
// Analyze file patterns
|
|
93
|
+
const hasTests = filesChanged.some((f) => f.includes("test") || f.includes("spec"));
|
|
94
|
+
const hasDocs = filesChanged.some((f) => f.includes("README") || f.includes(".md"));
|
|
95
|
+
const hasConfig = filesChanged.some((f) => f.includes("config") ||
|
|
96
|
+
f.includes(".json") ||
|
|
97
|
+
f.includes(".yml") ||
|
|
98
|
+
f.includes(".yaml"));
|
|
99
|
+
const hasStyles = filesChanged.some((f) => f.includes(".css") || f.includes(".scss"));
|
|
100
|
+
const hasComponents = filesChanged.some((f) => f.includes("component") || f.includes(".tsx") || f.includes(".jsx"));
|
|
101
|
+
// Generate contextual suggestions
|
|
102
|
+
if (additions > deletions * 2 && additions > 20) {
|
|
103
|
+
suggestions.push({
|
|
104
|
+
type: "feat",
|
|
105
|
+
subject: `add new ${this.inferFeatureType(filesChanged)}`,
|
|
106
|
+
body: `Added ${filesChanged.length} file(s) with ${additions} lines`,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (deletions > additions * 2 && deletions > 20) {
|
|
110
|
+
suggestions.push({
|
|
111
|
+
type: "refactor",
|
|
112
|
+
subject: `remove unused ${this.inferFeatureType(filesChanged)}`,
|
|
113
|
+
body: `Removed ${deletions} lines from ${filesChanged.length} file(s)`,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (hasTests) {
|
|
117
|
+
suggestions.push({
|
|
118
|
+
type: "test",
|
|
119
|
+
subject: `add tests for ${this.inferScope(filesChanged)}`,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (hasDocs) {
|
|
123
|
+
suggestions.push({
|
|
124
|
+
type: "docs",
|
|
125
|
+
subject: "update documentation",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (hasConfig) {
|
|
129
|
+
suggestions.push({
|
|
130
|
+
type: "chore",
|
|
131
|
+
subject: "update configuration",
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
if (hasStyles) {
|
|
135
|
+
suggestions.push({
|
|
136
|
+
type: "style",
|
|
137
|
+
subject: "update styling",
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (hasComponents) {
|
|
141
|
+
suggestions.push({
|
|
142
|
+
type: "feat",
|
|
143
|
+
subject: `update ${this.inferScope(filesChanged)} component`,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
// Default suggestions
|
|
147
|
+
if (suggestions.length === 0) {
|
|
148
|
+
suggestions.push({
|
|
149
|
+
type: "feat",
|
|
150
|
+
subject: `add ${this.inferFeatureType(filesChanged)}`,
|
|
151
|
+
}, {
|
|
152
|
+
type: "fix",
|
|
153
|
+
subject: `resolve issue in ${this.inferScope(filesChanged)}`,
|
|
154
|
+
}, {
|
|
155
|
+
type: "refactor",
|
|
156
|
+
subject: `improve ${this.inferScope(filesChanged)}`,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return suggestions.slice(0, 5);
|
|
160
|
+
}
|
|
161
|
+
inferFeatureType(files) {
|
|
162
|
+
if (files.some((f) => f.includes("component")))
|
|
163
|
+
return "component";
|
|
164
|
+
if (files.some((f) => f.includes("util")))
|
|
165
|
+
return "utility";
|
|
166
|
+
if (files.some((f) => f.includes("api")))
|
|
167
|
+
return "API endpoint";
|
|
168
|
+
if (files.some((f) => f.includes("model")))
|
|
169
|
+
return "model";
|
|
170
|
+
if (files.some((f) => f.includes("service")))
|
|
171
|
+
return "service";
|
|
172
|
+
return "feature";
|
|
173
|
+
}
|
|
174
|
+
inferScope(files) {
|
|
175
|
+
if (files.length === 0)
|
|
176
|
+
return "project";
|
|
177
|
+
const commonPath = files[0].split("/")[0];
|
|
178
|
+
if (files.every((f) => f.startsWith(commonPath))) {
|
|
179
|
+
return commonPath;
|
|
180
|
+
}
|
|
181
|
+
return "multiple modules";
|
|
182
|
+
}
|
|
183
|
+
formatCommitMessage(msg) {
|
|
184
|
+
let result = `${msg.type}`;
|
|
185
|
+
if (msg.scope)
|
|
186
|
+
result += `(${msg.scope})`;
|
|
187
|
+
result += `: ${msg.subject}`;
|
|
188
|
+
if (msg.body)
|
|
189
|
+
result += `\n\n${msg.body}`;
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
question(query) {
|
|
193
|
+
return new Promise((resolve) => {
|
|
194
|
+
this.rl.question(query, resolve);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
async selectFromOptions(options) {
|
|
198
|
+
options.forEach((opt, i) => {
|
|
199
|
+
console.log(`${i + 1}. ${opt}`);
|
|
200
|
+
});
|
|
201
|
+
const answer = await this.question("\nSelect option (number) or press Enter for #1: ");
|
|
202
|
+
const num = parseInt(answer) || 1;
|
|
203
|
+
return Math.min(Math.max(1, num), options.length) - 1;
|
|
204
|
+
}
|
|
205
|
+
async run() {
|
|
206
|
+
console.log("š CommitGen - AI-Powered Commit Message Generator\n");
|
|
207
|
+
if (!this.isGitRepo()) {
|
|
208
|
+
console.error("ā Error: Not a git repository");
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
const analysis = this.analyzeChanges();
|
|
212
|
+
if (!analysis.hasStaged) {
|
|
213
|
+
console.log("ā ļø No staged changes found.");
|
|
214
|
+
if (analysis.hasUnstaged) {
|
|
215
|
+
console.log("š” You have unstaged changes. Stage them with: git add <files>");
|
|
216
|
+
}
|
|
217
|
+
process.exit(0);
|
|
218
|
+
}
|
|
219
|
+
console.log(`š Analysis:`);
|
|
220
|
+
console.log(` Files changed: ${analysis.filesChanged.length}`);
|
|
221
|
+
console.log(` Additions: +${analysis.additions}`);
|
|
222
|
+
console.log(` Deletions: -${analysis.deletions}`);
|
|
223
|
+
console.log(`\nš Changed files:`);
|
|
224
|
+
analysis.filesChanged.forEach((f) => console.log(` - ${f}`));
|
|
225
|
+
const suggestions = this.generateCommitMessage(analysis);
|
|
226
|
+
console.log("\nš” Suggested commit messages:\n");
|
|
227
|
+
const options = suggestions.map((s) => this.formatCommitMessage(s));
|
|
228
|
+
options.push("āļø Write custom message");
|
|
229
|
+
const selected = await this.selectFromOptions(options);
|
|
230
|
+
let commitMessage;
|
|
231
|
+
if (selected === options.length - 1) {
|
|
232
|
+
commitMessage = await this.question("\nEnter your commit message: ");
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
commitMessage = options[selected];
|
|
236
|
+
const confirm = await this.question(`\nUse this message? (Y/n): `);
|
|
237
|
+
if (confirm.toLowerCase() === "n") {
|
|
238
|
+
commitMessage = await this.question("Enter your commit message: ");
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (!commitMessage.trim()) {
|
|
242
|
+
console.log("ā Commit cancelled - empty message");
|
|
243
|
+
this.rl.close();
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
try {
|
|
247
|
+
this.exec(`git commit -m "${commitMessage.replace(/"/g, '\\"')}"`);
|
|
248
|
+
console.log("\nā
Commit successful!");
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
console.error("ā Commit failed:", error);
|
|
252
|
+
}
|
|
253
|
+
this.rl.close();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const commitGen = new CommitGen();
|
|
257
|
+
commitGen.run().catch(console.error);
|
|
258
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAyC;AACzC,mDAAqC;AASrC,MAAM,SAAS;IAGb;QACE,IAAI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BAClC,aAAa,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;YAClD,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,kBAAkB,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACxC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;CACF;AAED,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAClC,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@untools/commitgen",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "CLI to create generate commit messages",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"@untools/commitgen": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepublishOnly": "npm run build",
|
|
12
|
+
"dev": "ts-node src/index.ts",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"release": "standard-version",
|
|
15
|
+
"release:minor": "standard-version --release-as minor",
|
|
16
|
+
"release:major": "standard-version --release-as major",
|
|
17
|
+
"release:patch": "standard-version --release-as patch"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"typescript",
|
|
21
|
+
"express",
|
|
22
|
+
"mongodb",
|
|
23
|
+
"graphql",
|
|
24
|
+
"starter",
|
|
25
|
+
"api",
|
|
26
|
+
"nextjs",
|
|
27
|
+
"fullstack"
|
|
28
|
+
],
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=14.0.0"
|
|
34
|
+
},
|
|
35
|
+
"author": "Miracle Onyenma",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/aevrHQ/untools-commitgen.git"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/aevrHQ/untools-commitgen/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/aevrHQ/untools-commitgen#readme",
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@untools/port-gen": "^0.0.2",
|
|
50
|
+
"chalk": "^4.1.2",
|
|
51
|
+
"commander": "^13.1.0",
|
|
52
|
+
"degit": "^2.8.4",
|
|
53
|
+
"inquirer": "^12.5.2"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/chalk": "^0.4.31",
|
|
57
|
+
"@types/degit": "^2.8.6",
|
|
58
|
+
"@types/inquirer": "^9.0.7",
|
|
59
|
+
"@types/jest": "^29.5.14",
|
|
60
|
+
"@types/node": "^22.14.0",
|
|
61
|
+
"jest": "^29.7.0",
|
|
62
|
+
"standard-version": "^9.5.0",
|
|
63
|
+
"ts-jest": "^29.3.1",
|
|
64
|
+
"ts-node": "^10.9.2",
|
|
65
|
+
"typescript": "^5.8.3"
|
|
66
|
+
}
|
|
67
|
+
}
|