git-coco 0.21.0 → 0.21.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.
@@ -50,7 +50,7 @@ import { pathToFileURL } from 'url';
50
50
  /**
51
51
  * Current build version from package.json
52
52
  */
53
- const BUILD_VERSION = "0.21.0";
53
+ const BUILD_VERSION = "0.21.1";
54
54
 
55
55
  const isInteractive = (config) => {
56
56
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -7608,7 +7608,7 @@ const conventionalTypeRegex = /^(feat|fix|docs|style|refactor|perf|test|build|ci
7608
7608
  const CommitMessageResponseSchema = objectType({
7609
7609
  title: stringType().describe("Title of the commit message"),
7610
7610
  body: stringType().describe("Body of the commit message"),
7611
- });
7611
+ }).describe("Object with commit message 'title' and 'body'");
7612
7612
  // Conventional commit message schema with strict formatting rules
7613
7613
  const ConventionalCommitMessageResponseSchema = objectType({
7614
7614
  title: stringType()
@@ -7616,7 +7616,7 @@ const ConventionalCommitMessageResponseSchema = objectType({
7616
7616
  .refine((title) => conventionalTypeRegex.test(title), "Title must follow Conventional Commits format (e.g., 'feat: add new feature' or 'fix(scope): fix bug')").describe("Title of the commit message"),
7617
7617
  body: stringType().describe("Body of the commit message")
7618
7618
  // .max(280, "Body must be 280 characters or less"),
7619
- }).describe("Conventional commit message schema with strict formatting rules");
7619
+ }).describe("Object with Conventional Commit message 'title' and 'body' adhering to Conventional Commits specification");
7620
7620
  const command$3 = 'commit';
7621
7621
  /**
7622
7622
  * Command line options via yargs
@@ -11222,13 +11222,19 @@ const handler$3 = async (argv, logger) => {
11222
11222
  }
11223
11223
  }
11224
11224
  async function parser(changes) {
11225
+ if (config.noDiff) {
11226
+ // When noDiff is enabled, just return a simple summary without parsing file contents
11227
+ const filesSummary = changes
11228
+ .map((change) => `${change.status}: ${change.filePath}`)
11229
+ .join('\n');
11230
+ return `Staged files:\n${filesSummary}`;
11231
+ }
11225
11232
  return await fileChangeParser({
11226
11233
  changes,
11227
11234
  commit: '--staged',
11228
11235
  options: { tokenizer, git, llm, logger },
11229
11236
  });
11230
11237
  }
11231
- logger.log(`Generating commit message...${JSON.stringify(config.prompt)}`, { color: 'blue' });
11232
11238
  const commitMsg = await generateAndReviewLoop({
11233
11239
  label: 'commit message',
11234
11240
  options: {
@@ -11261,7 +11267,11 @@ const handler$3 = async (argv, logger) => {
11261
11267
  ? ConventionalCommitMessageResponseSchema
11262
11268
  : CommitMessageResponseSchema;
11263
11269
  const formatInstructions = `You must always return valid JSON fenced by a markdown code block. Do not return any additional text. The JSON object you return should match the following schema:
11264
- ${schema.description}`;
11270
+ ${schema.description}
11271
+ {
11272
+ "title": "The commit title",
11273
+ "body": "The commit body"
11274
+ }`;
11265
11275
  // Use conventional commit prompt if enabled
11266
11276
  const promptTemplate = USE_CONVENTIONAL_COMMITS ? CONVENTIONAL_COMMIT_PROMPT : COMMIT_PROMPT;
11267
11277
  const prompt = getPrompt({
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ var readline__namespace = /*#__PURE__*/_interopNamespaceDefault(readline$1);
72
72
  /**
73
73
  * Current build version from package.json
74
74
  */
75
- const BUILD_VERSION = "0.21.0";
75
+ const BUILD_VERSION = "0.21.1";
76
76
 
77
77
  const isInteractive = (config) => {
78
78
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -7630,7 +7630,7 @@ const conventionalTypeRegex = /^(feat|fix|docs|style|refactor|perf|test|build|ci
7630
7630
  const CommitMessageResponseSchema = objectType({
7631
7631
  title: stringType().describe("Title of the commit message"),
7632
7632
  body: stringType().describe("Body of the commit message"),
7633
- });
7633
+ }).describe("Object with commit message 'title' and 'body'");
7634
7634
  // Conventional commit message schema with strict formatting rules
7635
7635
  const ConventionalCommitMessageResponseSchema = objectType({
7636
7636
  title: stringType()
@@ -7638,7 +7638,7 @@ const ConventionalCommitMessageResponseSchema = objectType({
7638
7638
  .refine((title) => conventionalTypeRegex.test(title), "Title must follow Conventional Commits format (e.g., 'feat: add new feature' or 'fix(scope): fix bug')").describe("Title of the commit message"),
7639
7639
  body: stringType().describe("Body of the commit message")
7640
7640
  // .max(280, "Body must be 280 characters or less"),
7641
- }).describe("Conventional commit message schema with strict formatting rules");
7641
+ }).describe("Object with Conventional Commit message 'title' and 'body' adhering to Conventional Commits specification");
7642
7642
  const command$3 = 'commit';
7643
7643
  /**
7644
7644
  * Command line options via yargs
@@ -11244,13 +11244,19 @@ const handler$3 = async (argv, logger) => {
11244
11244
  }
11245
11245
  }
11246
11246
  async function parser(changes) {
11247
+ if (config.noDiff) {
11248
+ // When noDiff is enabled, just return a simple summary without parsing file contents
11249
+ const filesSummary = changes
11250
+ .map((change) => `${change.status}: ${change.filePath}`)
11251
+ .join('\n');
11252
+ return `Staged files:\n${filesSummary}`;
11253
+ }
11247
11254
  return await fileChangeParser({
11248
11255
  changes,
11249
11256
  commit: '--staged',
11250
11257
  options: { tokenizer, git, llm, logger },
11251
11258
  });
11252
11259
  }
11253
- logger.log(`Generating commit message...${JSON.stringify(config.prompt)}`, { color: 'blue' });
11254
11260
  const commitMsg = await generateAndReviewLoop({
11255
11261
  label: 'commit message',
11256
11262
  options: {
@@ -11283,7 +11289,11 @@ const handler$3 = async (argv, logger) => {
11283
11289
  ? ConventionalCommitMessageResponseSchema
11284
11290
  : CommitMessageResponseSchema;
11285
11291
  const formatInstructions = `You must always return valid JSON fenced by a markdown code block. Do not return any additional text. The JSON object you return should match the following schema:
11286
- ${schema.description}`;
11292
+ ${schema.description}
11293
+ {
11294
+ "title": "The commit title",
11295
+ "body": "The commit body"
11296
+ }`;
11287
11297
  // Use conventional commit prompt if enabled
11288
11298
  const promptTemplate = USE_CONVENTIONAL_COMMITS ? CONVENTIONAL_COMMIT_PROMPT : COMMIT_PROMPT;
11289
11299
  const prompt = getPrompt({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",
@@ -63,7 +63,7 @@
63
63
  "eslint": "^8.54.0",
64
64
  "eslint-formatter-pretty": "^6.0.0",
65
65
  "jest": "^30.0.5",
66
- "jest-mock": "^29.5.0",
66
+ "jest-mock": "^30.0.5",
67
67
  "release-it": "^18.1.2",
68
68
  "rimraf": "^6.0.1",
69
69
  "rollup": "^3.26.1",
@@ -104,7 +104,7 @@
104
104
  "p-queue": "5.0.0",
105
105
  "performance-now": "2.1.0",
106
106
  "pretty-ms": "7.0.1",
107
- "simple-git": "3.27.0",
107
+ "simple-git": "3.28.0",
108
108
  "tiktoken": "^1.0.21",
109
109
  "yargs": "17.7.2"
110
110
  },