@m3hti/commit-genie 3.1.0 → 3.1.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/services/analyzerService.d.ts +0 -157
- package/dist/services/analyzerService.d.ts.map +1 -1
- package/dist/services/analyzerService.js +23 -2001
- package/dist/services/analyzerService.js.map +1 -1
- package/dist/services/breakingChangeDetector.d.ts +9 -0
- package/dist/services/breakingChangeDetector.d.ts.map +1 -0
- package/dist/services/breakingChangeDetector.js +76 -0
- package/dist/services/breakingChangeDetector.js.map +1 -0
- package/dist/services/commitTypeDetector.d.ts +32 -0
- package/dist/services/commitTypeDetector.d.ts.map +1 -0
- package/dist/services/commitTypeDetector.js +490 -0
- package/dist/services/commitTypeDetector.js.map +1 -0
- package/dist/services/descriptionGenerator.d.ts +58 -0
- package/dist/services/descriptionGenerator.d.ts.map +1 -0
- package/dist/services/descriptionGenerator.js +569 -0
- package/dist/services/descriptionGenerator.js.map +1 -0
- package/dist/services/gitService.test.js +242 -24
- package/dist/services/gitService.test.js.map +1 -1
- package/dist/services/hookService.test.d.ts +2 -0
- package/dist/services/hookService.test.d.ts.map +1 -0
- package/dist/services/hookService.test.js +182 -0
- package/dist/services/hookService.test.js.map +1 -0
- package/dist/services/lintService.test.d.ts +2 -0
- package/dist/services/lintService.test.d.ts.map +1 -0
- package/dist/services/lintService.test.js +288 -0
- package/dist/services/lintService.test.js.map +1 -0
- package/dist/services/messageBuilder.d.ts +16 -0
- package/dist/services/messageBuilder.d.ts.map +1 -0
- package/dist/services/messageBuilder.js +135 -0
- package/dist/services/messageBuilder.js.map +1 -0
- package/dist/services/scopeDetector.d.ts +6 -0
- package/dist/services/scopeDetector.d.ts.map +1 -0
- package/dist/services/scopeDetector.js +51 -0
- package/dist/services/scopeDetector.js.map +1 -0
- package/dist/services/semanticAnalyzer.d.ts +25 -0
- package/dist/services/semanticAnalyzer.d.ts.map +1 -0
- package/dist/services/semanticAnalyzer.js +713 -0
- package/dist/services/semanticAnalyzer.js.map +1 -0
- package/dist/services/splitService.test.d.ts +2 -0
- package/dist/services/splitService.test.d.ts.map +1 -0
- package/dist/services/splitService.test.js +190 -0
- package/dist/services/splitService.test.js.map +1 -0
- package/dist/services/statsService.test.d.ts +2 -0
- package/dist/services/statsService.test.d.ts.map +1 -0
- package/dist/services/statsService.test.js +211 -0
- package/dist/services/statsService.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,162 +4,10 @@ export declare class AnalyzerService {
|
|
|
4
4
|
* Analyze staged changes and return structured analysis
|
|
5
5
|
*/
|
|
6
6
|
static analyzeChanges(): ChangeAnalysis;
|
|
7
|
-
/**
|
|
8
|
-
* Detect breaking changes from diff content and file changes
|
|
9
|
-
*/
|
|
10
|
-
private static detectBreakingChanges;
|
|
11
|
-
/**
|
|
12
|
-
* Determine the commit type based on analysis
|
|
13
|
-
*/
|
|
14
|
-
private static determineCommitType;
|
|
15
|
-
/**
|
|
16
|
-
* Check if diff contains actual logic changes (not just formatting)
|
|
17
|
-
*/
|
|
18
|
-
private static hasLogicChanges;
|
|
19
|
-
/**
|
|
20
|
-
* Check if the diff contains ONLY formatting changes (no logic impact).
|
|
21
|
-
* Formatting changes include: semicolons, blank lines, indentation, trailing commas, braces.
|
|
22
|
-
* Per Conventional Commits, these should be classified as "style".
|
|
23
|
-
*/
|
|
24
|
-
private static isFormattingOnlyChange;
|
|
25
|
-
/**
|
|
26
|
-
* Generate a description for formatting-only changes
|
|
27
|
-
*/
|
|
28
|
-
private static generateFormattingDescription;
|
|
29
|
-
/**
|
|
30
|
-
* Check if the changes are ONLY non-style JavaScript changes
|
|
31
|
-
* (console.log, debug statements, test prints, comments, etc.)
|
|
32
|
-
* Returns true if JS files have changes but NO actual styling changes
|
|
33
|
-
*/
|
|
34
|
-
private static hasOnlyNonStyleJsChanges;
|
|
35
|
-
/**
|
|
36
|
-
* Extract non-comment changed lines from a diff for keyword analysis.
|
|
37
|
-
* Filters out comment lines to prevent false positives from descriptive text.
|
|
38
|
-
*/
|
|
39
|
-
private static extractNonCommentChanges;
|
|
40
|
-
/**
|
|
41
|
-
* Check if the diff contains only comment changes (documentation)
|
|
42
|
-
* Returns true if ALL changes are comments (no code changes)
|
|
43
|
-
*/
|
|
44
|
-
private static isCommentOnlyChange;
|
|
45
|
-
/**
|
|
46
|
-
* Perform semantic analysis on the diff to understand the nature of changes
|
|
47
|
-
* This provides intent-based understanding rather than line-count metrics
|
|
48
|
-
*/
|
|
49
|
-
private static analyzeSemanticChanges;
|
|
50
|
-
/**
|
|
51
|
-
* Detect which roles are affected by the changes and calculate semantic significance
|
|
52
|
-
* Significance is NOT based on line count - it's based on the semantic weight of patterns
|
|
53
|
-
*/
|
|
54
|
-
private static detectRoleChanges;
|
|
55
|
-
/**
|
|
56
|
-
* Determine if a pattern represents a high-value semantic change
|
|
57
|
-
*/
|
|
58
|
-
private static isHighValuePattern;
|
|
59
|
-
/**
|
|
60
|
-
* Detect the intent for changes in a specific role
|
|
61
|
-
*/
|
|
62
|
-
private static detectRoleIntent;
|
|
63
|
-
/**
|
|
64
|
-
* Determine the primary role from all detected role changes
|
|
65
|
-
*/
|
|
66
|
-
private static determinePrimaryRole;
|
|
67
|
-
/**
|
|
68
|
-
* Determine the overall intent of the changes
|
|
69
|
-
*/
|
|
70
|
-
private static determineIntent;
|
|
71
|
-
/**
|
|
72
|
-
* Extract affected element names (components, functions, etc.) from the diff
|
|
73
|
-
*/
|
|
74
|
-
private static extractAffectedElements;
|
|
75
|
-
/**
|
|
76
|
-
* Extract function/class/method names from git diff by analyzing both hunk headers
|
|
77
|
-
* and the actual context lines around changes.
|
|
78
|
-
*
|
|
79
|
-
* This method prioritizes function declarations found in context lines near the
|
|
80
|
-
* actual changes, which is more accurate than just using hunk headers (which may
|
|
81
|
-
* show preceding functions instead of the one being modified).
|
|
82
|
-
*/
|
|
83
|
-
private static extractHunkContext;
|
|
84
|
-
/**
|
|
85
|
-
* Extract a function/class/method name from a single line of code
|
|
86
|
-
*/
|
|
87
|
-
private static extractNameFromLine;
|
|
88
|
-
/**
|
|
89
|
-
* Detect function/class/type renames by comparing removed and added names
|
|
90
|
-
* Returns an array of { oldName, newName } objects
|
|
91
|
-
*/
|
|
92
|
-
private static detectRenames;
|
|
93
|
-
/**
|
|
94
|
-
* Extract affected elements for a specific role
|
|
95
|
-
*/
|
|
96
|
-
private static extractElementsForRole;
|
|
97
|
-
/**
|
|
98
|
-
* Generate a human-readable summary for a role change
|
|
99
|
-
*/
|
|
100
|
-
private static generateRoleSummary;
|
|
101
|
-
/**
|
|
102
|
-
* Generate the WHY description for the commit
|
|
103
|
-
*/
|
|
104
|
-
private static generateIntentDescription;
|
|
105
|
-
/**
|
|
106
|
-
* Generate the WHAT changed description
|
|
107
|
-
*/
|
|
108
|
-
private static generateWhatChanged;
|
|
109
|
-
/**
|
|
110
|
-
* Generate a description from AST analysis results.
|
|
111
|
-
* Produces specific, human-readable descriptions based on structural signals.
|
|
112
|
-
* Returns empty string if AST data is insufficient for a good description.
|
|
113
|
-
*/
|
|
114
|
-
private static generateASTDescription;
|
|
115
|
-
/**
|
|
116
|
-
* Detect test+implementation file pairs.
|
|
117
|
-
* Returns the pair info if files match naming conventions, null otherwise.
|
|
118
|
-
*/
|
|
119
|
-
private static detectTestImplPair;
|
|
120
|
-
/**
|
|
121
|
-
* Generate description using lightweight file content analysis (JSON, CSS, YAML, MD).
|
|
122
|
-
* Returns null if no structural info is available.
|
|
123
|
-
*/
|
|
124
|
-
private static generateFileContentDescription;
|
|
125
|
-
/**
|
|
126
|
-
* Generate description using hunk header context (function/class names).
|
|
127
|
-
* Works for any language that git can identify scope for.
|
|
128
|
-
* Returns null if no hunk context is available.
|
|
129
|
-
*/
|
|
130
|
-
private static generateHunkDescription;
|
|
131
|
-
/**
|
|
132
|
-
* Generate a descriptive commit message
|
|
133
|
-
* Uses AST analysis for specific descriptions when available,
|
|
134
|
-
* falls back to semantic analysis and regex-based descriptions.
|
|
135
|
-
*/
|
|
136
|
-
private static generateDescription;
|
|
137
|
-
/**
|
|
138
|
-
* Generate description based on semantic analysis
|
|
139
|
-
* Creates intent-based messages like "update UserProfile validation logic"
|
|
140
|
-
*/
|
|
141
|
-
private static generateSemanticDescription;
|
|
142
|
-
/**
|
|
143
|
-
* Determine scope from file paths
|
|
144
|
-
*/
|
|
145
|
-
private static determineScope;
|
|
146
7
|
/**
|
|
147
8
|
* Extract file name from path
|
|
148
9
|
*/
|
|
149
10
|
private static getFileName;
|
|
150
|
-
/**
|
|
151
|
-
* Generate commit body for larger changes
|
|
152
|
-
* Includes semantic role context when available
|
|
153
|
-
*/
|
|
154
|
-
private static generateBody;
|
|
155
|
-
/**
|
|
156
|
-
* Apply a template to build the commit message subject line
|
|
157
|
-
*/
|
|
158
|
-
private static applyTemplate;
|
|
159
|
-
/**
|
|
160
|
-
* Build full commit message string
|
|
161
|
-
*/
|
|
162
|
-
private static buildFullMessage;
|
|
163
11
|
/**
|
|
164
12
|
* Generate the final commit message
|
|
165
13
|
*/
|
|
@@ -172,10 +20,5 @@ export declare class AnalyzerService {
|
|
|
172
20
|
* Generate suggestions with optional AI enhancement
|
|
173
21
|
*/
|
|
174
22
|
static generateSuggestionsWithAI(useAI?: boolean): Promise<MessageSuggestion[]>;
|
|
175
|
-
/**
|
|
176
|
-
* Generate an alternative description style
|
|
177
|
-
* Uses AST data when available, otherwise falls back to regex extraction.
|
|
178
|
-
*/
|
|
179
|
-
private static generateAlternativeDescription;
|
|
180
23
|
}
|
|
181
24
|
//# sourceMappingURL=analyzerService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzerService.d.ts","sourceRoot":"","sources":["../../src/services/analyzerService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyzerService.d.ts","sourceRoot":"","sources":["../../src/services/analyzerService.ts"],"names":[],"mappings":"AAoBA,OAAO,EAEL,cAAc,EACd,aAAa,EAKb,iBAAiB,EAGlB,MAAM,UAAU,CAAC;AAyBlB,qBAAa,eAAe;IAC1B;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,cAAc;IAuJvC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAK1B;;OAEG;IACH,MAAM,CAAC,qBAAqB,IAAI,aAAa;IAkC7C;;OAEG;IACH,MAAM,CAAC,2BAA2B,IAAI,iBAAiB,EAAE;IAqLzD;;OAEG;WACU,yBAAyB,CAAC,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CA0E7F"}
|