git-coco 0.22.3 → 0.22.4

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.
@@ -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.22.3";
50
+ const BUILD_VERSION = "0.22.4";
51
51
 
52
52
  const isInteractive = (config) => {
53
53
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -11620,7 +11620,7 @@ ${schema.description}
11620
11620
  };
11621
11621
  // Use retry wrapper for commitlint validation with up to 4 total attempts
11622
11622
  // (2 automatic retries + 2 more if user chooses "Try again")
11623
- return await withRetry(generateCommitMessage, {
11623
+ const result = await withRetry(generateCommitMessage, {
11624
11624
  maxAttempts: 6, // Allow for multiple user retry requests
11625
11625
  shouldRetry: shouldRetryCommitlint,
11626
11626
  backoffMs: 0, // No delay needed for commitlint retries
@@ -11632,6 +11632,15 @@ ${schema.description}
11632
11632
  logger.verbose(`Retrying commit message generation (attempt ${attempt}): ${error.message}`, { color: 'yellow' });
11633
11633
  },
11634
11634
  });
11635
+ // Ensure we always return a formatted string, not a JSON object
11636
+ if (typeof result === 'object' && result !== null && 'title' in result && 'body' in result) {
11637
+ const commitMsgObj = result;
11638
+ const appendedText = argv.append ? `\n\n${argv.append}` : '';
11639
+ const ticketId = extractTicketIdFromBranchName(branchName);
11640
+ const ticketFooter = argv.appendTicket && ticketId ? `\n\nPart of **${ticketId}**` : '';
11641
+ return `${commitMsgObj.title}\n\n${commitMsgObj.body}${appendedText}${ticketFooter}`;
11642
+ }
11643
+ return result;
11635
11644
  },
11636
11645
  noResult: async () => {
11637
11646
  await noResult$2({ git, logger });
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.22.3";
72
+ const BUILD_VERSION = "0.22.4";
73
73
 
74
74
  const isInteractive = (config) => {
75
75
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -11642,7 +11642,7 @@ ${schema.description}
11642
11642
  };
11643
11643
  // Use retry wrapper for commitlint validation with up to 4 total attempts
11644
11644
  // (2 automatic retries + 2 more if user chooses "Try again")
11645
- return await withRetry(generateCommitMessage, {
11645
+ const result = await withRetry(generateCommitMessage, {
11646
11646
  maxAttempts: 6, // Allow for multiple user retry requests
11647
11647
  shouldRetry: shouldRetryCommitlint,
11648
11648
  backoffMs: 0, // No delay needed for commitlint retries
@@ -11654,6 +11654,15 @@ ${schema.description}
11654
11654
  logger.verbose(`Retrying commit message generation (attempt ${attempt}): ${error.message}`, { color: 'yellow' });
11655
11655
  },
11656
11656
  });
11657
+ // Ensure we always return a formatted string, not a JSON object
11658
+ if (typeof result === 'object' && result !== null && 'title' in result && 'body' in result) {
11659
+ const commitMsgObj = result;
11660
+ const appendedText = argv.append ? `\n\n${argv.append}` : '';
11661
+ const ticketId = extractTicketIdFromBranchName(branchName);
11662
+ const ticketFooter = argv.appendTicket && ticketId ? `\n\nPart of **${ticketId}**` : '';
11663
+ return `${commitMsgObj.title}\n\n${commitMsgObj.body}${appendedText}${ticketFooter}`;
11664
+ }
11665
+ return result;
11657
11666
  },
11658
11667
  noResult: async () => {
11659
11668
  await noResult$2({ git, logger });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",