git-coco 0.22.11 → 0.23.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/README.md +56 -307
- package/dist/index.esm.mjs +9 -1
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,361 +10,112 @@
|
|
|
10
10
|
[](https://github.com/gfargo/coco/tree/main)
|
|
11
11
|
[](https://discord.gg/KGu9nE9Ejx)
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Currently `coco` generates commit messages with **first-class Conventional Commits support**, creates changelogs, summarizes code changes, performs code reviews, and more - with new features being added regularly!
|
|
13
|
+
An AI-powered git assistant that generates meaningful commit messages, creates changelogs, and streamlines your development workflow.
|
|
16
14
|
|
|
17
15
|
**✨ Key Features:**
|
|
18
16
|
|
|
19
17
|
- 🤖 **AI-Powered Commit Messages** - Generate contextual commits from your staged changes
|
|
20
|
-
- 📋 **Conventional Commits** - Full support with automatic validation and formatting
|
|
18
|
+
- 📋 **Conventional Commits** - Full support with automatic validation and formatting
|
|
21
19
|
- 🔧 **Commitlint Integration** - Seamless integration with your existing commitlint configuration
|
|
22
|
-
- 📦 **Package Manager Friendly** - Works with npm, yarn, and pnpm (with automatic compatibility handling)
|
|
23
|
-
- 🛠️ **Robust Error Recovery** - Advanced JSON parsing with automatic repair capabilities
|
|
24
20
|
- 🏠 **Local AI Support** - Run completely offline with Ollama (no API costs, full privacy)
|
|
21
|
+
- 📦 **Package Manager Friendly** - Works with npm, yarn, and pnpm
|
|
22
|
+
- 👥 **Team Ready** - Shared configurations and enterprise deployment
|
|
25
23
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
- **`commit`**: generates commit messages based on staged changes with intelligent conventional commits support and robust error handling.
|
|
29
|
-
|
|
30
|
-
- **`changelog`**: create changelogs for the current branch or a range of commits.
|
|
31
|
-
|
|
32
|
-
- **`recap`**: summarize changes from working-tree, or yesterday, or in the last month, or since the last tag.
|
|
33
|
-
|
|
34
|
-
- **`review`**: perform a code review on the changes in the working directory.
|
|
35
|
-
|
|
36
|
-
- **`init`**: step by step wizard to set up `coco` globally or for a project.
|
|
37
|
-
|
|
38
|
-
- **`help`**: display help for `coco` commands.
|
|
39
|
-
|
|
40
|
-
## Getting Started
|
|
41
|
-
|
|
42
|
-
**`coco init`** is the first step to getting started with `coco`. It will guide you through the installation process, including setting up your OpenAI API key and configuring `coco` to your preferences.
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# For local project use
|
|
46
|
-
npx git-coco@latest init -l project
|
|
47
|
-
|
|
48
|
-
# For global use
|
|
49
|
-
npx git-coco@latest init -l global
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Usage
|
|
53
|
-
|
|
54
|
-
### **`coco commit`**
|
|
55
|
-
|
|
56
|
-
Generates commit messages based on staged changes with intelligent commitlint integration.
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
coco
|
|
60
|
-
|
|
61
|
-
# or
|
|
62
|
-
|
|
63
|
-
coco commit
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
#### Conventional Commits & Commitlint Integration
|
|
67
|
-
|
|
68
|
-
`coco` provides first-class support for Conventional Commits with intelligent commitlint integration:
|
|
69
|
-
|
|
70
|
-
**Conventional Commits Support:**
|
|
71
|
-
|
|
72
|
-
- **Automatic Detection**: Enables conventional commits mode when commitlint config is detected
|
|
73
|
-
- **Smart Formatting**: Generates properly formatted conventional commits (feat, fix, docs, etc.)
|
|
74
|
-
- **Breaking Changes**: Supports breaking change syntax (`feat!:` and `feat(scope)!:`)
|
|
75
|
-
- **Scoped Commits**: Intelligent scope detection and formatting
|
|
76
|
-
- **Robust Parsing**: Advanced JSON parsing with automatic error recovery
|
|
77
|
-
|
|
78
|
-
**Commitlint Integration:**
|
|
79
|
-
|
|
80
|
-
- **Smart Detection**: Automatically finds commitlint config files (`.commitlintrc.*`, `commitlint.config.*`, or `package.json` with commitlint field)
|
|
81
|
-
- **AI-Aware Rules**: Passes your commitlint rules to the AI for better compliance from the start
|
|
82
|
-
- **Automatic Retry**: When validation fails, `coco` automatically retries generation with error feedback (up to 2 attempts)
|
|
83
|
-
- **Package Manager Compatibility**: Works seamlessly with npm, yarn, and pnpm (with automatic fallback for ES module issues)
|
|
84
|
-
- **User-Friendly Flow**: After auto-retries, offers options to try 2 more times or edit manually
|
|
85
|
-
- **Full Validation**: Both AI-generated and manually edited commit messages are validated against your rules
|
|
86
|
-
|
|
87
|
-
#### Command Options
|
|
88
|
-
|
|
89
|
-
**Basic Options:**
|
|
24
|
+
## Quick Start
|
|
90
25
|
|
|
91
26
|
```bash
|
|
92
|
-
#
|
|
93
|
-
|
|
27
|
+
# Try without installing
|
|
28
|
+
npx git-coco@latest init
|
|
94
29
|
|
|
95
|
-
#
|
|
96
|
-
coco
|
|
97
|
-
|
|
98
|
-
# Help - display command help
|
|
99
|
-
coco --help
|
|
100
|
-
```
|
|
30
|
+
# Install globally
|
|
31
|
+
npm install -g git-coco
|
|
101
32
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
# Add content to the end of the generated commit message
|
|
106
|
-
coco --append "Resolves #128"
|
|
107
|
-
|
|
108
|
-
# Automatically append Jira/Linear ticket ID from branch name
|
|
109
|
-
coco -t, --append-ticket
|
|
110
|
-
|
|
111
|
-
# Add extra context to guide commit generation
|
|
112
|
-
coco -a, --additional "Resolves UX bug with sign up button"
|
|
113
|
-
|
|
114
|
-
# Include previous commits for context (specify number)
|
|
115
|
-
coco -p, --with-previous-commits 3
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Conventional Commits Options:**
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# Force conventional commits mode
|
|
122
|
-
coco -c, --conventional
|
|
123
|
-
|
|
124
|
-
# Include/exclude branch name in context (default: true)
|
|
125
|
-
coco --include-branch-name
|
|
126
|
-
coco --no-include-branch-name
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Processing Options:**
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
# Ignore specific files (can be used multiple times)
|
|
133
|
-
coco --ignored-files "*.lock" --ignored-files "dist/*"
|
|
134
|
-
|
|
135
|
-
# Ignore file extensions (can be used multiple times)
|
|
136
|
-
coco --ignored-extensions ".map" --ignored-extensions ".min.js"
|
|
137
|
-
|
|
138
|
-
# Use basic git status instead of full diff (faster for large changes)
|
|
139
|
-
coco --no-diff
|
|
33
|
+
# Setup and configure
|
|
34
|
+
coco init
|
|
140
35
|
|
|
141
|
-
#
|
|
142
|
-
|
|
36
|
+
# Generate your first commit
|
|
37
|
+
git add .
|
|
38
|
+
coco -i
|
|
143
39
|
```
|
|
144
40
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Creates changelogs from commit history.
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Basic changelog for current branch
|
|
151
|
-
coco changelog
|
|
41
|
+
## Commands
|
|
152
42
|
|
|
153
|
-
|
|
154
|
-
coco changelog -
|
|
155
|
-
|
|
43
|
+
- **`coco commit`** - Generate commit messages from staged changes
|
|
44
|
+
- **`coco changelog`** - Create changelogs from commit history
|
|
45
|
+
- **`coco recap`** - Summarize recent changes and activity
|
|
46
|
+
- **`coco review`** - AI-powered code review of your changes
|
|
47
|
+
- **`coco init`** - Interactive setup wizard
|
|
156
48
|
|
|
157
|
-
|
|
49
|
+
## Usage Examples
|
|
158
50
|
|
|
159
|
-
|
|
51
|
+
### Basic Workflow
|
|
160
52
|
|
|
161
53
|
```bash
|
|
162
|
-
#
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
# Specific commit range (commit hashes)
|
|
166
|
-
coco changelog -r abc1234:def5678
|
|
54
|
+
# Make your changes
|
|
55
|
+
git add .
|
|
167
56
|
|
|
168
|
-
#
|
|
169
|
-
coco
|
|
57
|
+
# Generate commit message (interactive mode recommended)
|
|
58
|
+
coco -i
|
|
170
59
|
|
|
171
|
-
#
|
|
172
|
-
|
|
60
|
+
# Or use stdout mode
|
|
61
|
+
git commit -m "$(coco)"
|
|
173
62
|
```
|
|
174
63
|
|
|
175
|
-
|
|
64
|
+
### Conventional Commits
|
|
176
65
|
|
|
177
66
|
```bash
|
|
178
|
-
#
|
|
179
|
-
coco
|
|
180
|
-
|
|
181
|
-
# Generate changelog based only on branch diff
|
|
182
|
-
coco changelog --only-diff
|
|
67
|
+
# Enable conventional commits format
|
|
68
|
+
coco --conventional
|
|
183
69
|
|
|
184
|
-
#
|
|
185
|
-
coco
|
|
70
|
+
# With additional context
|
|
71
|
+
coco -a "Fixes login timeout" --conventional
|
|
186
72
|
|
|
187
|
-
#
|
|
188
|
-
coco
|
|
73
|
+
# Include ticket from branch name
|
|
74
|
+
coco --append-ticket --conventional
|
|
189
75
|
```
|
|
190
76
|
|
|
191
|
-
###
|
|
192
|
-
|
|
193
|
-
Summarize changes across different time periods.
|
|
77
|
+
### Team Workflows
|
|
194
78
|
|
|
195
79
|
```bash
|
|
196
|
-
#
|
|
197
|
-
coco
|
|
198
|
-
|
|
199
|
-
# Interactive mode
|
|
200
|
-
coco recap -i, --interactive
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
#### Recap Time Periods
|
|
80
|
+
# Generate changelog for releases
|
|
81
|
+
coco changelog --since-last-tag
|
|
204
82
|
|
|
205
|
-
|
|
206
|
-
# Yesterday's changes
|
|
83
|
+
# Summarize recent work
|
|
207
84
|
coco recap --yesterday
|
|
208
85
|
|
|
209
|
-
#
|
|
210
|
-
coco recap --last-week, --week
|
|
211
|
-
|
|
212
|
-
# Last month's changes
|
|
213
|
-
coco recap --last-month, --month
|
|
214
|
-
|
|
215
|
-
# Changes since last git tag
|
|
216
|
-
coco recap --last-tag, --tag
|
|
217
|
-
|
|
218
|
-
# Current branch changes
|
|
219
|
-
coco recap --current-branch
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### **`coco review`**
|
|
223
|
-
|
|
224
|
-
Perform AI-powered code review on your changes.
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Review current working directory changes
|
|
86
|
+
# Code review before committing
|
|
228
87
|
coco review
|
|
229
|
-
|
|
230
|
-
# Interactive mode
|
|
231
|
-
coco review -i, --interactive
|
|
232
|
-
|
|
233
|
-
# Review specific branch
|
|
234
|
-
coco review -b feature-branch, --branch feature-branch
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### **`coco init`**
|
|
238
|
-
|
|
239
|
-
Interactive setup wizard for configuring coco.
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
# Setup wizard (will prompt for scope)
|
|
243
|
-
coco init
|
|
244
|
-
|
|
245
|
-
# Configure for current project only
|
|
246
|
-
coco init --scope project
|
|
247
|
-
|
|
248
|
-
# Configure globally for current user
|
|
249
|
-
coco init --scope global
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Stdout vs. Interactive Mode
|
|
253
|
-
|
|
254
|
-
`coco` offers two modes of operation: **stdout** and **interactive**, defaulting to **stdout**. You can specify your preferred mode in your config file or via command line flags.
|
|
255
|
-
|
|
256
|
-
```bash
|
|
257
|
-
# Stdout mode
|
|
258
|
-
git commit -m $(coco)
|
|
259
|
-
|
|
260
|
-
# Interactive mode
|
|
261
|
-
coco -i
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Generate and commit all in one
|
|
265
|
-
|
|
266
|
-
`coco` can generate and commit your changes in one command.
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
coco -s
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### **Conventional Commits Examples**
|
|
273
|
-
|
|
274
|
-
`coco` excels at generating properly formatted conventional commits:
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
# Basic conventional commit
|
|
278
|
-
coco --conventional
|
|
279
|
-
# Output: feat: add user authentication system
|
|
280
|
-
|
|
281
|
-
# With scope
|
|
282
|
-
coco --conventional -a 'fixes login timeout'
|
|
283
|
-
# Output: fix(auth): resolve login timeout issue
|
|
284
|
-
|
|
285
|
-
# With additional context and ticket
|
|
286
|
-
coco --conventional --additional "Resolves login issues" --append-ticket
|
|
287
|
-
# Output: feat(auth): add OAuth2 integration
|
|
288
|
-
#
|
|
289
|
-
# Implement OAuth2 flow with Google and GitHub providers.
|
|
290
|
-
# Resolves login issues
|
|
291
|
-
#
|
|
292
|
-
# Part of **PROJ-123**
|
|
293
88
|
```
|
|
294
89
|
|
|
295
90
|
## Configuration
|
|
296
91
|
|
|
297
|
-
`coco`
|
|
298
|
-
|
|
299
|
-
**Quick Start:**
|
|
92
|
+
Configure `coco` for your workflow with the interactive setup wizard:
|
|
300
93
|
|
|
301
94
|
```bash
|
|
302
|
-
#
|
|
95
|
+
# Setup wizard
|
|
303
96
|
coco init
|
|
304
97
|
|
|
305
|
-
# Project-specific
|
|
98
|
+
# Project-specific setup
|
|
306
99
|
coco init --scope project
|
|
307
|
-
|
|
308
|
-
# Global user configuration
|
|
309
|
-
coco init --scope global
|
|
310
100
|
```
|
|
311
101
|
|
|
312
|
-
**Configuration Methods (in priority order):**
|
|
313
|
-
|
|
314
|
-
1. Command line flags (highest priority)
|
|
315
|
-
2. Environment variables
|
|
316
|
-
3. Project config (`.coco.config.json`)
|
|
317
|
-
4. Git config (`.gitconfig`)
|
|
318
|
-
5. XDG config directory (lowest priority)
|
|
319
|
-
|
|
320
102
|
**AI Providers:**
|
|
103
|
+
- **OpenAI** - GPT-4o, GPT-4o-mini (API key required)
|
|
104
|
+
- **Anthropic** - Claude 3.5 Sonnet (API key required)
|
|
105
|
+
- **Ollama** - Local models, no API costs, full privacy
|
|
321
106
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
- **Ollama**: Local models, no API costs, full privacy - [Setup Guide](USING_OLLAMA.md)
|
|
325
|
-
|
|
326
|
-
### **Ignoring Files & Extensions**
|
|
327
|
-
|
|
328
|
-
`coco` can ignore specific files and extensions to focus on meaningful changes. See the complete [Ignoring Files & Extensions Guide](IGNORING_FILES_EXTENSIONS.md) for detailed configuration options and examples.
|
|
329
|
-
|
|
330
|
-
**Quick Examples:**
|
|
331
|
-
|
|
332
|
-
```bash
|
|
333
|
-
# Command line flags
|
|
334
|
-
coco --ignored-files "*.lock" --ignored-extensions ".map"
|
|
335
|
-
|
|
336
|
-
# Config file
|
|
107
|
+
**Example Configuration:**
|
|
108
|
+
```json
|
|
337
109
|
{
|
|
338
|
-
"
|
|
339
|
-
"
|
|
110
|
+
"mode": "interactive",
|
|
111
|
+
"conventionalCommits": true,
|
|
112
|
+
"service": {
|
|
113
|
+
"provider": "openai",
|
|
114
|
+
"model": "gpt-4o"
|
|
115
|
+
}
|
|
340
116
|
}
|
|
341
117
|
```
|
|
342
118
|
|
|
343
|
-
**Default Ignores:**
|
|
344
|
-
|
|
345
|
-
- Files: `package-lock.json` + contents of `.gitignore`
|
|
346
|
-
- Extensions: `.map`, `.lock`
|
|
347
|
-
|
|
348
|
-
## Troubleshooting
|
|
349
|
-
|
|
350
|
-
### **pnpm Compatibility**
|
|
351
|
-
|
|
352
|
-
If you encounter ES module errors with pnpm and commitlint:
|
|
353
|
-
|
|
354
|
-
```bash
|
|
355
|
-
# Update commitlint packages to latest versions
|
|
356
|
-
pnpm add -D @commitlint/config-conventional@latest @commitlint/cli@latest
|
|
357
|
-
|
|
358
|
-
# Or continue without commitlint validation
|
|
359
|
-
# coco will automatically fall back to built-in conventional commit rules
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
### **Conventional Commits Issues**
|
|
363
|
-
|
|
364
|
-
- **JSON Parsing Errors**: `coco` automatically repairs common JSON formatting issues from AI responses
|
|
365
|
-
- **Commitlint Validation**: If validation fails, `coco` provides clear error messages and retry options
|
|
366
|
-
- **Missing Dependencies**: `coco` gracefully handles missing commitlint packages with helpful installation guidance
|
|
367
|
-
|
|
368
119
|
## Documentation
|
|
369
120
|
|
|
370
121
|
For comprehensive guides, advanced usage, and detailed configuration options, visit our complete documentation:
|
|
@@ -372,17 +123,15 @@ For comprehensive guides, advanced usage, and detailed configuration options, vi
|
|
|
372
123
|
### 📚 **[Coco Wiki](https://github.com/gfargo/coco/wiki)**
|
|
373
124
|
|
|
374
125
|
**Essential Guides:**
|
|
375
|
-
|
|
376
126
|
- **[Getting Started](https://github.com/gfargo/coco/wiki/Getting-Started)** - Complete beginner's guide from installation to first commit
|
|
127
|
+
- **[Command Reference](https://github.com/gfargo/coco/wiki/Command-Reference)** - Detailed command options and examples
|
|
377
128
|
- **[Configuration Overview](https://github.com/gfargo/coco/wiki/Config-Overview)** - All configuration options and setup methods
|
|
378
129
|
- **[Team Collaboration](https://github.com/gfargo/coco/wiki/Team-Collaboration)** - Enterprise deployment and team adoption strategies
|
|
379
|
-
- **[Using Ollama](https://github.com/gfargo/coco/wiki/Using-Ollama)** - Local AI setup for privacy and cost control
|
|
380
130
|
|
|
381
131
|
**Advanced Resources:**
|
|
382
|
-
|
|
132
|
+
- **[Using Ollama](https://github.com/gfargo/coco/wiki/Using-Ollama)** - Local AI setup for privacy and cost control
|
|
383
133
|
- **[Advanced Usage](https://github.com/gfargo/coco/wiki/Advanced-Usage)** - Custom prompts, automation, and power-user features
|
|
384
134
|
- **[Troubleshooting](https://github.com/gfargo/coco/wiki/Troubleshooting)** - Solutions for common issues and debugging
|
|
385
|
-
- **[Ignoring Files & Extensions](https://github.com/gfargo/coco/wiki/Ignoring-Files-&-Extensions)** - Advanced file filtering and pattern matching
|
|
386
135
|
|
|
387
136
|
### 🆘 **Need Help?**
|
|
388
137
|
|
package/dist/index.esm.mjs
CHANGED
|
@@ -47,7 +47,7 @@ import { pathToFileURL } from 'url';
|
|
|
47
47
|
/**
|
|
48
48
|
* Current build version from package.json
|
|
49
49
|
*/
|
|
50
|
-
const BUILD_VERSION = "0.
|
|
50
|
+
const BUILD_VERSION = "0.23.1";
|
|
51
51
|
|
|
52
52
|
const isInteractive = (config) => {
|
|
53
53
|
return config?.mode === 'interactive' || !!config?.interactive;
|
|
@@ -11557,6 +11557,10 @@ const handler$3 = async (argv, logger) => {
|
|
|
11557
11557
|
},
|
|
11558
11558
|
factory,
|
|
11559
11559
|
parser,
|
|
11560
|
+
reviewParser: (result) => {
|
|
11561
|
+
// Ensure the result is properly formatted as a string for display
|
|
11562
|
+
return typeof result === 'string' ? result : String(result);
|
|
11563
|
+
},
|
|
11560
11564
|
agent: async (context, options) => {
|
|
11561
11565
|
// Select the appropriate schema based on whether conventional commits are enabled
|
|
11562
11566
|
const schema = USE_CONVENTIONAL_COMMITS
|
|
@@ -11684,11 +11688,15 @@ IMPORTANT RULES:
|
|
|
11684
11688
|
});
|
|
11685
11689
|
// Construct the full commit message using the utility function
|
|
11686
11690
|
const ticketId = extractTicketIdFromBranchName(branchName);
|
|
11691
|
+
// Debug: Log what commitMsg looks like before formatting
|
|
11692
|
+
logger.verbose(`commitMsg before formatting: ${JSON.stringify(commitMsg)}`, { color: 'blue' });
|
|
11687
11693
|
const fullMessage = formatCommitMessage(commitMsg, {
|
|
11688
11694
|
append: argv.append,
|
|
11689
11695
|
ticketId: ticketId || undefined,
|
|
11690
11696
|
appendTicket: argv.appendTicket,
|
|
11691
11697
|
});
|
|
11698
|
+
// Debug: Log what fullMessage looks like after formatting
|
|
11699
|
+
logger.verbose(`fullMessage after formatting: ${typeof fullMessage === 'string' ? fullMessage : JSON.stringify(fullMessage)}`, { color: 'blue' });
|
|
11692
11700
|
// If commitlint validation is needed and not skipped, validate the message
|
|
11693
11701
|
if ((USE_CONVENTIONAL_COMMITS || hasCommitLintConfig) && !shouldSkipCommitlintValidation) {
|
|
11694
11702
|
const { validateCommitMessage, CommitlintValidationError } = await Promise.resolve().then(function () { return commitlintValidator; });
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var readline__namespace = /*#__PURE__*/_interopNamespaceDefault(readline);
|
|
|
69
69
|
/**
|
|
70
70
|
* Current build version from package.json
|
|
71
71
|
*/
|
|
72
|
-
const BUILD_VERSION = "0.
|
|
72
|
+
const BUILD_VERSION = "0.23.1";
|
|
73
73
|
|
|
74
74
|
const isInteractive = (config) => {
|
|
75
75
|
return config?.mode === 'interactive' || !!config?.interactive;
|
|
@@ -11579,6 +11579,10 @@ const handler$3 = async (argv, logger) => {
|
|
|
11579
11579
|
},
|
|
11580
11580
|
factory,
|
|
11581
11581
|
parser,
|
|
11582
|
+
reviewParser: (result) => {
|
|
11583
|
+
// Ensure the result is properly formatted as a string for display
|
|
11584
|
+
return typeof result === 'string' ? result : String(result);
|
|
11585
|
+
},
|
|
11582
11586
|
agent: async (context, options) => {
|
|
11583
11587
|
// Select the appropriate schema based on whether conventional commits are enabled
|
|
11584
11588
|
const schema = USE_CONVENTIONAL_COMMITS
|
|
@@ -11706,11 +11710,15 @@ IMPORTANT RULES:
|
|
|
11706
11710
|
});
|
|
11707
11711
|
// Construct the full commit message using the utility function
|
|
11708
11712
|
const ticketId = extractTicketIdFromBranchName(branchName);
|
|
11713
|
+
// Debug: Log what commitMsg looks like before formatting
|
|
11714
|
+
logger.verbose(`commitMsg before formatting: ${JSON.stringify(commitMsg)}`, { color: 'blue' });
|
|
11709
11715
|
const fullMessage = formatCommitMessage(commitMsg, {
|
|
11710
11716
|
append: argv.append,
|
|
11711
11717
|
ticketId: ticketId || undefined,
|
|
11712
11718
|
appendTicket: argv.appendTicket,
|
|
11713
11719
|
});
|
|
11720
|
+
// Debug: Log what fullMessage looks like after formatting
|
|
11721
|
+
logger.verbose(`fullMessage after formatting: ${typeof fullMessage === 'string' ? fullMessage : JSON.stringify(fullMessage)}`, { color: 'blue' });
|
|
11714
11722
|
// If commitlint validation is needed and not skipped, validate the message
|
|
11715
11723
|
if ((USE_CONVENTIONAL_COMMITS || hasCommitLintConfig) && !shouldSkipCommitlintValidation) {
|
|
11716
11724
|
const { validateCommitMessage, CommitlintValidationError } = await Promise.resolve().then(function () { return commitlintValidator; });
|