@m3hti/commit-genie 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 +21 -0
- package/README.md +430 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +31 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/generate.d.ts +10 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +313 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/generate.test.d.ts +2 -0
- package/dist/commands/generate.test.d.ts.map +1 -0
- package/dist/commands/generate.test.js +168 -0
- package/dist/commands/generate.test.js.map +1 -0
- package/dist/commands/hook.d.ts +4 -0
- package/dist/commands/hook.d.ts.map +1 -0
- package/dist/commands/hook.js +62 -0
- package/dist/commands/hook.js.map +1 -0
- package/dist/commands/stats.d.ts +6 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +39 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/services/aiService.d.ts +38 -0
- package/dist/services/aiService.d.ts.map +1 -0
- package/dist/services/aiService.js +187 -0
- package/dist/services/aiService.js.map +1 -0
- package/dist/services/analyzerService.d.ts +60 -0
- package/dist/services/analyzerService.d.ts.map +1 -0
- package/dist/services/analyzerService.js +832 -0
- package/dist/services/analyzerService.js.map +1 -0
- package/dist/services/analyzerService.test.d.ts +2 -0
- package/dist/services/analyzerService.test.d.ts.map +1 -0
- package/dist/services/analyzerService.test.js +323 -0
- package/dist/services/analyzerService.test.js.map +1 -0
- package/dist/services/configService.d.ts +25 -0
- package/dist/services/configService.d.ts.map +1 -0
- package/dist/services/configService.js +207 -0
- package/dist/services/configService.js.map +1 -0
- package/dist/services/configService.test.d.ts +2 -0
- package/dist/services/configService.test.d.ts.map +1 -0
- package/dist/services/configService.test.js +165 -0
- package/dist/services/configService.test.js.map +1 -0
- package/dist/services/gitService.d.ts +44 -0
- package/dist/services/gitService.d.ts.map +1 -0
- package/dist/services/gitService.js +217 -0
- package/dist/services/gitService.js.map +1 -0
- package/dist/services/gitService.test.d.ts +2 -0
- package/dist/services/gitService.test.d.ts.map +1 -0
- package/dist/services/gitService.test.js +140 -0
- package/dist/services/gitService.test.js.map +1 -0
- package/dist/services/historyService.d.ts +39 -0
- package/dist/services/historyService.d.ts.map +1 -0
- package/dist/services/historyService.js +195 -0
- package/dist/services/historyService.js.map +1 -0
- package/dist/services/historyService.test.d.ts +2 -0
- package/dist/services/historyService.test.d.ts.map +1 -0
- package/dist/services/historyService.test.js +157 -0
- package/dist/services/historyService.test.js.map +1 -0
- package/dist/services/hookService.d.ts +29 -0
- package/dist/services/hookService.d.ts.map +1 -0
- package/dist/services/hookService.js +164 -0
- package/dist/services/hookService.js.map +1 -0
- package/dist/services/statsService.d.ts +28 -0
- package/dist/services/statsService.d.ts.map +1 -0
- package/dist/services/statsService.js +204 -0
- package/dist/services/statsService.js.map +1 -0
- package/dist/types/index.d.ts +134 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/filePatterns.d.ts +5 -0
- package/dist/utils/filePatterns.d.ts.map +1 -0
- package/dist/utils/filePatterns.js +77 -0
- package/dist/utils/filePatterns.js.map +1 -0
- package/dist/utils/filePatterns.test.d.ts +2 -0
- package/dist/utils/filePatterns.test.d.ts.map +1 -0
- package/dist/utils/filePatterns.test.js +51 -0
- package/dist/utils/filePatterns.test.js.map +1 -0
- package/dist/utils/prompt.d.ts +4 -0
- package/dist/utils/prompt.d.ts.map +1 -0
- package/dist/utils/prompt.js +60 -0
- package/dist/utils/prompt.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statsService.d.ts","sourceRoot":"","sources":["../../src/services/statsService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,MAAM,UAAU,CAAC;AAKnD,qBAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,GAAE,MAAY,GAAG,WAAW;IAsE7D;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAoBzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAe5B;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAmF9C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;CAIzB"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatsService = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const CONVENTIONAL_COMMIT_REGEX = /^(feat|fix|docs|style|refactor|test|chore|perf)(\(.+\))?!?:/;
|
|
6
|
+
const EMOJI_REGEX = /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]/u;
|
|
7
|
+
class StatsService {
|
|
8
|
+
/**
|
|
9
|
+
* Get commit statistics for the repository
|
|
10
|
+
*/
|
|
11
|
+
static getCommitStats(commitCount = 100) {
|
|
12
|
+
const commits = this.getCommits(commitCount);
|
|
13
|
+
if (commits.length === 0) {
|
|
14
|
+
return this.getEmptyStats();
|
|
15
|
+
}
|
|
16
|
+
const commitsByType = {};
|
|
17
|
+
const commitsByScope = {};
|
|
18
|
+
const commitsByAuthor = {};
|
|
19
|
+
const commitsByMonth = {};
|
|
20
|
+
let totalLength = 0;
|
|
21
|
+
let emojiCount = 0;
|
|
22
|
+
let conventionalCount = 0;
|
|
23
|
+
for (const commit of commits) {
|
|
24
|
+
// Parse commit type
|
|
25
|
+
const typeMatch = commit.subject.match(CONVENTIONAL_COMMIT_REGEX);
|
|
26
|
+
if (typeMatch) {
|
|
27
|
+
conventionalCount++;
|
|
28
|
+
const type = typeMatch[1];
|
|
29
|
+
commitsByType[type] = (commitsByType[type] || 0) + 1;
|
|
30
|
+
// Extract scope if present
|
|
31
|
+
if (typeMatch[2]) {
|
|
32
|
+
const scope = typeMatch[2].replace(/[()]/g, '');
|
|
33
|
+
commitsByScope[scope] = (commitsByScope[scope] || 0) + 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Check for emoji
|
|
37
|
+
if (EMOJI_REGEX.test(commit.subject)) {
|
|
38
|
+
emojiCount++;
|
|
39
|
+
}
|
|
40
|
+
// Count by author
|
|
41
|
+
commitsByAuthor[commit.author] = (commitsByAuthor[commit.author] || 0) + 1;
|
|
42
|
+
// Count by month (YYYY-MM format)
|
|
43
|
+
const month = commit.date.substring(0, 7);
|
|
44
|
+
commitsByMonth[month] = (commitsByMonth[month] || 0) + 1;
|
|
45
|
+
// Track message length
|
|
46
|
+
totalLength += commit.subject.length;
|
|
47
|
+
}
|
|
48
|
+
// Calculate top contributors
|
|
49
|
+
const topContributors = Object.entries(commitsByAuthor)
|
|
50
|
+
.map(([name, count]) => ({ name, count }))
|
|
51
|
+
.sort((a, b) => b.count - a.count)
|
|
52
|
+
.slice(0, 5);
|
|
53
|
+
// Calculate recent activity (last 7 days)
|
|
54
|
+
const recentActivity = this.getRecentActivity(commits);
|
|
55
|
+
return {
|
|
56
|
+
totalCommits: commits.length,
|
|
57
|
+
commitsByType,
|
|
58
|
+
commitsByScope,
|
|
59
|
+
commitsByAuthor,
|
|
60
|
+
commitsByMonth,
|
|
61
|
+
averageMessageLength: Math.round(totalLength / commits.length),
|
|
62
|
+
emojiUsagePercent: Math.round((emojiCount / commits.length) * 100),
|
|
63
|
+
conventionalCommitsPercent: Math.round((conventionalCount / commits.length) * 100),
|
|
64
|
+
topContributors,
|
|
65
|
+
recentActivity,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get commits from git history
|
|
70
|
+
*/
|
|
71
|
+
static getCommits(count) {
|
|
72
|
+
try {
|
|
73
|
+
const output = (0, child_process_1.execSync)(`git log --format="%s|||%an|||%aI" -n ${count}`, { encoding: 'utf-8', maxBuffer: 10 * 1024 * 1024 });
|
|
74
|
+
return output
|
|
75
|
+
.trim()
|
|
76
|
+
.split('\n')
|
|
77
|
+
.filter(line => line.length > 0)
|
|
78
|
+
.map(line => {
|
|
79
|
+
const [subject, author, date] = line.split('|||');
|
|
80
|
+
return { subject: subject || '', author: author || 'Unknown', date: date || '' };
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get recent activity for the last 7 days
|
|
89
|
+
*/
|
|
90
|
+
static getRecentActivity(commits) {
|
|
91
|
+
const today = new Date();
|
|
92
|
+
const activity = [];
|
|
93
|
+
for (let i = 6; i >= 0; i--) {
|
|
94
|
+
const date = new Date(today);
|
|
95
|
+
date.setDate(date.getDate() - i);
|
|
96
|
+
const dateStr = date.toISOString().substring(0, 10);
|
|
97
|
+
const count = commits.filter(c => c.date.startsWith(dateStr)).length;
|
|
98
|
+
activity.push({ date: dateStr, count });
|
|
99
|
+
}
|
|
100
|
+
return activity;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get empty stats object
|
|
104
|
+
*/
|
|
105
|
+
static getEmptyStats() {
|
|
106
|
+
return {
|
|
107
|
+
totalCommits: 0,
|
|
108
|
+
commitsByType: {},
|
|
109
|
+
commitsByScope: {},
|
|
110
|
+
commitsByAuthor: {},
|
|
111
|
+
commitsByMonth: {},
|
|
112
|
+
averageMessageLength: 0,
|
|
113
|
+
emojiUsagePercent: 0,
|
|
114
|
+
conventionalCommitsPercent: 0,
|
|
115
|
+
topContributors: [],
|
|
116
|
+
recentActivity: [],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Format stats for display
|
|
121
|
+
*/
|
|
122
|
+
static formatStats(stats) {
|
|
123
|
+
const lines = [];
|
|
124
|
+
lines.push('\n' + '═'.repeat(60));
|
|
125
|
+
lines.push(' COMMIT STATISTICS');
|
|
126
|
+
lines.push('═'.repeat(60));
|
|
127
|
+
// Overview
|
|
128
|
+
lines.push('\n📊 Overview:');
|
|
129
|
+
lines.push('─'.repeat(40));
|
|
130
|
+
lines.push(` Total commits analyzed: ${stats.totalCommits}`);
|
|
131
|
+
lines.push(` Average message length: ${stats.averageMessageLength} chars`);
|
|
132
|
+
lines.push(` Conventional commits: ${stats.conventionalCommitsPercent}%`);
|
|
133
|
+
lines.push(` Emoji usage: ${stats.emojiUsagePercent}%`);
|
|
134
|
+
// Commits by type
|
|
135
|
+
if (Object.keys(stats.commitsByType).length > 0) {
|
|
136
|
+
lines.push('\n📝 Commits by Type:');
|
|
137
|
+
lines.push('─'.repeat(40));
|
|
138
|
+
const sortedTypes = Object.entries(stats.commitsByType)
|
|
139
|
+
.sort((a, b) => b[1] - a[1]);
|
|
140
|
+
const maxCount = Math.max(...sortedTypes.map(([, count]) => count));
|
|
141
|
+
for (const [type, count] of sortedTypes) {
|
|
142
|
+
const bar = this.createBar(count, maxCount, 20);
|
|
143
|
+
const percent = Math.round((count / stats.totalCommits) * 100);
|
|
144
|
+
lines.push(` ${type.padEnd(10)} ${bar} ${count} (${percent}%)`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Top scopes
|
|
148
|
+
if (Object.keys(stats.commitsByScope).length > 0) {
|
|
149
|
+
lines.push('\n🏷️ Top Scopes:');
|
|
150
|
+
lines.push('─'.repeat(40));
|
|
151
|
+
const sortedScopes = Object.entries(stats.commitsByScope)
|
|
152
|
+
.sort((a, b) => b[1] - a[1])
|
|
153
|
+
.slice(0, 5);
|
|
154
|
+
for (const [scope, count] of sortedScopes) {
|
|
155
|
+
lines.push(` ${scope.padEnd(15)} ${count} commits`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Top contributors
|
|
159
|
+
if (stats.topContributors.length > 0) {
|
|
160
|
+
lines.push('\n👥 Top Contributors:');
|
|
161
|
+
lines.push('─'.repeat(40));
|
|
162
|
+
for (let i = 0; i < stats.topContributors.length; i++) {
|
|
163
|
+
const { name, count } = stats.topContributors[i];
|
|
164
|
+
const medal = i === 0 ? '🥇' : i === 1 ? '🥈' : i === 2 ? '🥉' : ' ';
|
|
165
|
+
lines.push(` ${medal} ${name.padEnd(20)} ${count} commits`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Recent activity
|
|
169
|
+
if (stats.recentActivity.length > 0) {
|
|
170
|
+
lines.push('\n📈 Recent Activity (Last 7 Days):');
|
|
171
|
+
lines.push('─'.repeat(40));
|
|
172
|
+
const maxActivity = Math.max(...stats.recentActivity.map(a => a.count), 1);
|
|
173
|
+
for (const { date, count } of stats.recentActivity) {
|
|
174
|
+
const dayName = new Date(date).toLocaleDateString('en-US', { weekday: 'short' });
|
|
175
|
+
const bar = this.createBar(count, maxActivity, 15);
|
|
176
|
+
lines.push(` ${dayName} ${date.substring(5)} ${bar} ${count}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Monthly trend
|
|
180
|
+
if (Object.keys(stats.commitsByMonth).length > 0) {
|
|
181
|
+
lines.push('\n📅 Monthly Commits:');
|
|
182
|
+
lines.push('─'.repeat(40));
|
|
183
|
+
const sortedMonths = Object.entries(stats.commitsByMonth)
|
|
184
|
+
.sort((a, b) => b[0].localeCompare(a[0]))
|
|
185
|
+
.slice(0, 6);
|
|
186
|
+
const maxMonthly = Math.max(...sortedMonths.map(([, count]) => count));
|
|
187
|
+
for (const [month, count] of sortedMonths) {
|
|
188
|
+
const bar = this.createBar(count, maxMonthly, 15);
|
|
189
|
+
lines.push(` ${month} ${bar} ${count}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
lines.push('\n' + '═'.repeat(60) + '\n');
|
|
193
|
+
return lines.join('\n');
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Create a visual bar for charts
|
|
197
|
+
*/
|
|
198
|
+
static createBar(value, max, width) {
|
|
199
|
+
const filled = Math.round((value / max) * width);
|
|
200
|
+
return '█'.repeat(filled) + '░'.repeat(width - filled);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.StatsService = StatsService;
|
|
204
|
+
//# sourceMappingURL=statsService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statsService.js","sourceRoot":"","sources":["../../src/services/statsService.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAGzC,MAAM,yBAAyB,GAAG,6DAA6D,CAAC;AAChG,MAAM,WAAW,GAAG,4CAA4C,CAAC;AAEjE,MAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,cAAsB,GAAG;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9B,CAAC;QAED,MAAM,aAAa,GAA2B,EAAE,CAAC;QACjD,MAAM,cAAc,GAA2B,EAAE,CAAC;QAClD,MAAM,eAAe,GAA2B,EAAE,CAAC;QACnD,MAAM,cAAc,GAA2B,EAAE,CAAC;QAElD,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,iBAAiB,GAAG,CAAC,CAAC;QAE1B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,oBAAoB;YACpB,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAClE,IAAI,SAAS,EAAE,CAAC;gBACd,iBAAiB,EAAE,CAAC;gBACp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,EAAE,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAEzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,SAAS,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QAChE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;QACjD,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;IACzD,CAAC;CACF;AArOD,oCAqOC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export interface FileChange {
|
|
2
|
+
status: string;
|
|
3
|
+
path: string;
|
|
4
|
+
}
|
|
5
|
+
export interface GitStatus {
|
|
6
|
+
staged: FileChange[];
|
|
7
|
+
unstaged: FileChange[];
|
|
8
|
+
hasStagedChanges: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DiffStats {
|
|
11
|
+
filesChanged: number;
|
|
12
|
+
insertions: number;
|
|
13
|
+
deletions: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ChangeAnalysis {
|
|
16
|
+
commitType: CommitType;
|
|
17
|
+
scope?: string;
|
|
18
|
+
description: string;
|
|
19
|
+
filesAffected: {
|
|
20
|
+
test: number;
|
|
21
|
+
docs: number;
|
|
22
|
+
config: number;
|
|
23
|
+
source: number;
|
|
24
|
+
};
|
|
25
|
+
fileChanges: {
|
|
26
|
+
added: string[];
|
|
27
|
+
modified: string[];
|
|
28
|
+
deleted: string[];
|
|
29
|
+
renamed: string[];
|
|
30
|
+
};
|
|
31
|
+
isLargeChange: boolean;
|
|
32
|
+
isBreakingChange: boolean;
|
|
33
|
+
breakingChangeReasons: string[];
|
|
34
|
+
}
|
|
35
|
+
export type CommitType = 'feat' | 'fix' | 'docs' | 'style' | 'refactor' | 'test' | 'chore' | 'perf';
|
|
36
|
+
export interface CommitMessage {
|
|
37
|
+
type: CommitType;
|
|
38
|
+
scope?: string;
|
|
39
|
+
description: string;
|
|
40
|
+
body?: string;
|
|
41
|
+
full: string;
|
|
42
|
+
isBreaking?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface MessageSuggestion {
|
|
45
|
+
id: number;
|
|
46
|
+
message: CommitMessage;
|
|
47
|
+
label: string;
|
|
48
|
+
}
|
|
49
|
+
export interface FilePattern {
|
|
50
|
+
pattern: RegExp;
|
|
51
|
+
type: 'test' | 'docs' | 'config' | 'source';
|
|
52
|
+
commitType: CommitType;
|
|
53
|
+
}
|
|
54
|
+
export interface ScopeMapping {
|
|
55
|
+
pattern: string;
|
|
56
|
+
scope: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CommitGenieConfig {
|
|
59
|
+
scopes?: ScopeMapping[];
|
|
60
|
+
defaultType?: CommitType;
|
|
61
|
+
includeEmoji?: boolean;
|
|
62
|
+
maxMessageLength?: number;
|
|
63
|
+
customPatterns?: {
|
|
64
|
+
pattern: string;
|
|
65
|
+
type: 'test' | 'docs' | 'config' | 'source';
|
|
66
|
+
commitType: CommitType;
|
|
67
|
+
}[];
|
|
68
|
+
ticketLinking?: {
|
|
69
|
+
enabled?: boolean;
|
|
70
|
+
patterns?: string[];
|
|
71
|
+
prefix?: string;
|
|
72
|
+
};
|
|
73
|
+
learnFromHistory?: {
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
commitCount?: number;
|
|
76
|
+
};
|
|
77
|
+
breakingChangeDetection?: {
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
keywords?: string[];
|
|
80
|
+
includeFooter?: boolean;
|
|
81
|
+
};
|
|
82
|
+
templates?: {
|
|
83
|
+
default?: string;
|
|
84
|
+
noScope?: string;
|
|
85
|
+
withBody?: string;
|
|
86
|
+
};
|
|
87
|
+
ai?: {
|
|
88
|
+
enabled?: boolean;
|
|
89
|
+
provider?: 'openai' | 'anthropic' | 'google';
|
|
90
|
+
apiKey?: string;
|
|
91
|
+
model?: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface TicketInfo {
|
|
95
|
+
id: string;
|
|
96
|
+
source: 'branch' | 'custom';
|
|
97
|
+
prefix?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface CommitHistoryAnalysis {
|
|
100
|
+
usesEmojis: boolean;
|
|
101
|
+
usesConventionalCommits: boolean;
|
|
102
|
+
commonScopes: string[];
|
|
103
|
+
commonVerbs: string[];
|
|
104
|
+
averageLength: number;
|
|
105
|
+
emojiFrequency: Record<string, number>;
|
|
106
|
+
typeFrequency: Record<string, number>;
|
|
107
|
+
}
|
|
108
|
+
export interface HistoricalCommit {
|
|
109
|
+
hash: string;
|
|
110
|
+
message: string;
|
|
111
|
+
subject: string;
|
|
112
|
+
body?: string;
|
|
113
|
+
author?: string;
|
|
114
|
+
date?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface CommitStats {
|
|
117
|
+
totalCommits: number;
|
|
118
|
+
commitsByType: Record<string, number>;
|
|
119
|
+
commitsByScope: Record<string, number>;
|
|
120
|
+
commitsByAuthor: Record<string, number>;
|
|
121
|
+
commitsByMonth: Record<string, number>;
|
|
122
|
+
averageMessageLength: number;
|
|
123
|
+
emojiUsagePercent: number;
|
|
124
|
+
conventionalCommitsPercent: number;
|
|
125
|
+
topContributors: {
|
|
126
|
+
name: string;
|
|
127
|
+
count: number;
|
|
128
|
+
}[];
|
|
129
|
+
recentActivity: {
|
|
130
|
+
date: string;
|
|
131
|
+
count: number;
|
|
132
|
+
}[];
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":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CAAC;IACvC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,EAAE,MAAM,CAAC;IACnC,eAAe,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FilePattern } from '../types';
|
|
2
|
+
export declare const filePatterns: FilePattern[];
|
|
3
|
+
export declare function detectFileType(filePath: string): 'test' | 'docs' | 'config' | 'source';
|
|
4
|
+
export declare function getCommitTypeForFile(filePath: string): string;
|
|
5
|
+
//# sourceMappingURL=filePatterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filePatterns.d.ts","sourceRoot":"","sources":["../../src/utils/filePatterns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,YAAY,EAAE,WAAW,EAwDrC,CAAC;AAEF,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAOvC;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAO7D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filePatterns = void 0;
|
|
4
|
+
exports.detectFileType = detectFileType;
|
|
5
|
+
exports.getCommitTypeForFile = getCommitTypeForFile;
|
|
6
|
+
exports.filePatterns = [
|
|
7
|
+
// Test files
|
|
8
|
+
{
|
|
9
|
+
pattern: /\.(test|spec)\.(ts|js|tsx|jsx)$/,
|
|
10
|
+
type: 'test',
|
|
11
|
+
commitType: 'test',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
pattern: /\/__tests__\//,
|
|
15
|
+
type: 'test',
|
|
16
|
+
commitType: 'test',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
pattern: /\/tests?\//,
|
|
20
|
+
type: 'test',
|
|
21
|
+
commitType: 'test',
|
|
22
|
+
},
|
|
23
|
+
// Documentation
|
|
24
|
+
{
|
|
25
|
+
pattern: /\.(md|mdx)$/,
|
|
26
|
+
type: 'docs',
|
|
27
|
+
commitType: 'docs',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
pattern: /\/docs?\//,
|
|
31
|
+
type: 'docs',
|
|
32
|
+
commitType: 'docs',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
pattern: /^README/i,
|
|
36
|
+
type: 'docs',
|
|
37
|
+
commitType: 'docs',
|
|
38
|
+
},
|
|
39
|
+
// Configuration files
|
|
40
|
+
{
|
|
41
|
+
pattern: /\.(json|ya?ml|toml|ini|config\.js)$/,
|
|
42
|
+
type: 'config',
|
|
43
|
+
commitType: 'chore',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
pattern: /\.(eslintrc|prettierrc|babelrc|gitignore|dockerignore)/,
|
|
47
|
+
type: 'config',
|
|
48
|
+
commitType: 'chore',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
pattern: /^(package\.json|tsconfig\.json|webpack\.config|vite\.config)/,
|
|
52
|
+
type: 'config',
|
|
53
|
+
commitType: 'chore',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
pattern: /Dockerfile/,
|
|
57
|
+
type: 'config',
|
|
58
|
+
commitType: 'chore',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
function detectFileType(filePath) {
|
|
62
|
+
for (const pattern of exports.filePatterns) {
|
|
63
|
+
if (pattern.pattern.test(filePath)) {
|
|
64
|
+
return pattern.type;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return 'source';
|
|
68
|
+
}
|
|
69
|
+
function getCommitTypeForFile(filePath) {
|
|
70
|
+
for (const pattern of exports.filePatterns) {
|
|
71
|
+
if (pattern.pattern.test(filePath)) {
|
|
72
|
+
return pattern.commitType;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return 'feat'; // Default for source files
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=filePatterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filePatterns.js","sourceRoot":"","sources":["../../src/utils/filePatterns.ts"],"names":[],"mappings":";;;AA4DA,wCASC;AAED,oDAOC;AA5EY,QAAA,YAAY,GAAkB;IACzC,aAAa;IACb;QACE,OAAO,EAAE,iCAAiC;QAC1C,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;KACnB;IACD;QACE,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;KACnB;IACD;QACE,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;KACnB;IAED,gBAAgB;IAChB;QACE,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;KACnB;IACD;QACE,OAAO,EAAE,WAAW;QACpB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;KACnB;IACD;QACE,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;KACnB;IAED,sBAAsB;IACtB;QACE,OAAO,EAAE,qCAAqC;QAC9C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;KACpB;IACD;QACE,OAAO,EAAE,wDAAwD;QACjE,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;KACpB;IACD;QACE,OAAO,EAAE,8DAA8D;QACvE,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;KACpB;IACD;QACE,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;KACpB;CACF,CAAC;AAEF,SAAgB,cAAc,CAC5B,QAAgB;IAEhB,KAAK,MAAM,OAAO,IAAI,oBAAY,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,oBAAoB,CAAC,QAAgB;IACnD,KAAK,MAAM,OAAO,IAAI,oBAAY,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC,UAAU,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,CAAC,2BAA2B;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filePatterns.test.d.ts","sourceRoot":"","sources":["../../src/utils/filePatterns.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const filePatterns_1 = require("./filePatterns");
|
|
4
|
+
describe('filePatterns', () => {
|
|
5
|
+
describe('detectFileType', () => {
|
|
6
|
+
it('should detect test files by extension', () => {
|
|
7
|
+
expect((0, filePatterns_1.detectFileType)('src/utils/helper.test.ts')).toBe('test');
|
|
8
|
+
expect((0, filePatterns_1.detectFileType)('src/utils/helper.spec.js')).toBe('test');
|
|
9
|
+
expect((0, filePatterns_1.detectFileType)('components/Button.test.tsx')).toBe('test');
|
|
10
|
+
});
|
|
11
|
+
it('should detect test files by directory', () => {
|
|
12
|
+
expect((0, filePatterns_1.detectFileType)('src/__tests__/helper.ts')).toBe('test');
|
|
13
|
+
expect((0, filePatterns_1.detectFileType)('src/__tests__/service.ts')).toBe('test');
|
|
14
|
+
expect((0, filePatterns_1.detectFileType)('src/tests/integration.ts')).toBe('test');
|
|
15
|
+
expect((0, filePatterns_1.detectFileType)('src/test/unit.ts')).toBe('test');
|
|
16
|
+
});
|
|
17
|
+
it('should detect documentation files', () => {
|
|
18
|
+
expect((0, filePatterns_1.detectFileType)('README.md')).toBe('docs');
|
|
19
|
+
expect((0, filePatterns_1.detectFileType)('docs/guide.md')).toBe('docs');
|
|
20
|
+
expect((0, filePatterns_1.detectFileType)('CONTRIBUTING.mdx')).toBe('docs');
|
|
21
|
+
});
|
|
22
|
+
it('should detect config files', () => {
|
|
23
|
+
expect((0, filePatterns_1.detectFileType)('package.json')).toBe('config');
|
|
24
|
+
expect((0, filePatterns_1.detectFileType)('tsconfig.json')).toBe('config');
|
|
25
|
+
expect((0, filePatterns_1.detectFileType)('.eslintrc')).toBe('config');
|
|
26
|
+
expect((0, filePatterns_1.detectFileType)('.prettierrc')).toBe('config');
|
|
27
|
+
expect((0, filePatterns_1.detectFileType)('webpack.config.js')).toBe('config');
|
|
28
|
+
expect((0, filePatterns_1.detectFileType)('Dockerfile')).toBe('config');
|
|
29
|
+
});
|
|
30
|
+
it('should detect source files as default', () => {
|
|
31
|
+
expect((0, filePatterns_1.detectFileType)('src/index.ts')).toBe('source');
|
|
32
|
+
expect((0, filePatterns_1.detectFileType)('src/services/api.ts')).toBe('source');
|
|
33
|
+
expect((0, filePatterns_1.detectFileType)('lib/utils.js')).toBe('source');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('getCommitTypeForFile', () => {
|
|
37
|
+
it('should return test for test files', () => {
|
|
38
|
+
expect((0, filePatterns_1.getCommitTypeForFile)('src/helper.test.ts')).toBe('test');
|
|
39
|
+
});
|
|
40
|
+
it('should return docs for documentation files', () => {
|
|
41
|
+
expect((0, filePatterns_1.getCommitTypeForFile)('README.md')).toBe('docs');
|
|
42
|
+
});
|
|
43
|
+
it('should return chore for config files', () => {
|
|
44
|
+
expect((0, filePatterns_1.getCommitTypeForFile)('package.json')).toBe('chore');
|
|
45
|
+
});
|
|
46
|
+
it('should return feat for source files', () => {
|
|
47
|
+
expect((0, filePatterns_1.getCommitTypeForFile)('src/index.ts')).toBe('feat');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=filePatterns.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filePatterns.test.js","sourceRoot":"","sources":["../../src/utils/filePatterns.test.ts"],"names":[],"mappings":";;AAAA,iDAAsE;AAEtE,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC/C,MAAM,CAAC,IAAA,6BAAc,EAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAChE,MAAM,CAAC,IAAA,6BAAc,EAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAChE,MAAM,CAAC,IAAA,6BAAc,EAAC,4BAA4B,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC/C,MAAM,CAAC,IAAA,6BAAc,EAAC,yBAAyB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/D,MAAM,CAAC,IAAA,6BAAc,EAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAChE,MAAM,CAAC,IAAA,6BAAc,EAAC,0BAA0B,CAA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C,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtD,MAAM,CAAC,IAAA,6BAAc,EAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7D,MAAM,CAAC,IAAA,6BAAc,EAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,CAAC,IAAA,mCAAoB,EAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,MAAM,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,CAAC,IAAA,mCAAoB,EAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7C,MAAM,CAAC,IAAA,mCAAoB,EAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function prompt(question: string): Promise<string>;
|
|
2
|
+
export declare function confirm(question: string): Promise<boolean>;
|
|
3
|
+
export declare function promptWithDefault(question: string, defaultValue: string): Promise<string>;
|
|
4
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/utils/prompt.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYxD;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGhE;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.prompt = prompt;
|
|
37
|
+
exports.confirm = confirm;
|
|
38
|
+
exports.promptWithDefault = promptWithDefault;
|
|
39
|
+
const readline = __importStar(require("readline"));
|
|
40
|
+
function prompt(question) {
|
|
41
|
+
const rl = readline.createInterface({
|
|
42
|
+
input: process.stdin,
|
|
43
|
+
output: process.stdout,
|
|
44
|
+
});
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
rl.question(question, (answer) => {
|
|
47
|
+
rl.close();
|
|
48
|
+
resolve(answer.trim());
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async function confirm(question) {
|
|
53
|
+
const answer = await prompt(`${question} (y/n): `);
|
|
54
|
+
return answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes';
|
|
55
|
+
}
|
|
56
|
+
async function promptWithDefault(question, defaultValue) {
|
|
57
|
+
const answer = await prompt(`${question} [${defaultValue}]: `);
|
|
58
|
+
return answer || defaultValue;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/utils/prompt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAYC;AAED,0BAGC;AAED,8CAMC;AA3BD,mDAAqC;AAErC,SAAgB,MAAM,CAAC,QAAgB;IACrC,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;YAC/B,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,OAAO,CAAC,QAAgB;IAC5C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,QAAQ,UAAU,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AACxE,CAAC;AAEM,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,YAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,QAAQ,KAAK,YAAY,KAAK,CAAC,CAAC;IAC/D,OAAO,MAAM,IAAI,YAAY,CAAC;AAChC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@m3hti/commit-genie",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A CLI tool to generate intelligent Git commit messages based on code changes",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"commit-genie": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"start": "node dist/index.js",
|
|
12
|
+
"dev": "ts-node src/index.ts",
|
|
13
|
+
"watch": "tsc --watch",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test:watch": "jest --watch",
|
|
16
|
+
"test:coverage": "jest --coverage"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"git",
|
|
20
|
+
"commit",
|
|
21
|
+
"cli",
|
|
22
|
+
"conventional-commits"
|
|
23
|
+
],
|
|
24
|
+
"author": "M3hTi",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/M3hTi/CommitGenie.git"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"commander": "^11.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/jest": "^30.0.0",
|
|
38
|
+
"@types/node": "^20.10.5",
|
|
39
|
+
"jest": "^30.2.0",
|
|
40
|
+
"ts-jest": "^29.4.6",
|
|
41
|
+
"ts-node": "^10.9.2",
|
|
42
|
+
"typescript": "^5.3.3"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=16.0.0"
|
|
46
|
+
}
|
|
47
|
+
}
|