@ksw8954/git-ai-commit 1.0.3 → 1.0.5

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/index.js CHANGED
@@ -1,17 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
7
  const commander_1 = require("commander");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
5
10
  const commit_1 = require("./commands/commit");
6
11
  const configCommand_1 = require("./commands/configCommand");
7
12
  const prCommand_1 = require("./commands/prCommand");
8
13
  const tag_1 = require("./commands/tag");
9
14
  const history_1 = require("./commands/history");
15
+ function getPackageVersion() {
16
+ try {
17
+ // When compiled, __dirname will be dist/; package.json is one level up
18
+ const pkgPath = path_1.default.resolve(__dirname, '../package.json');
19
+ const raw = fs_1.default.readFileSync(pkgPath, 'utf-8');
20
+ const pkg = JSON.parse(raw);
21
+ return typeof pkg.version === 'string' ? pkg.version : '0.0.0';
22
+ }
23
+ catch {
24
+ return '0.0.0';
25
+ }
26
+ }
10
27
  const program = new commander_1.Command();
11
28
  program
12
29
  .name('git-ai-commit')
13
30
  .description('AI-powered git commit message generator')
14
- .version('1.0.0');
31
+ // Expose -v, --version instead of default -V
32
+ .version(getPackageVersion(), '-v, --version', 'output the version number');
15
33
  const commitCommand = new commit_1.CommitCommand();
16
34
  const configCommand = new configCommand_1.ConfigCommand();
17
35
  const pullRequestCommand = new prCommand_1.PullRequestCommand();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,8CAAkD;AAClD,4DAAyD;AACzD,oDAA0D;AAC1D,wCAA4C;AAC5C,gDAAoD;AAEpD,MAAM,OAA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AM,EACf,2BAAuB,EACvB,WAAU,iBAAwB,KACjC,MAyCF,CAAC"}
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/prompts/tag.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,eAAO,MAAM,iBAAiB,GAC5B,SAAS,MAAM,EACf,2BAAuB,EACvB,WAAU,iBAAwB,KACjC,MA2CF,CAAC"}
@@ -3,20 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateTagPrompt = void 0;
4
4
  const generateTagPrompt = (tagName, customInstructions = '', language = 'ko') => {
5
5
  const summaryInstruction = language === 'ko'
6
- ? 'Begin with a short summary sentence (in Korean) that captures the overall impact of the release.'
7
- : 'Begin with a short summary sentence (in English) that captures the overall impact of the release.';
6
+ ? 'Begin with a short summary sentence (in Korean) that captures the overall impact of the release using plain text only.'
7
+ : 'Begin with a short summary sentence (in English) that captures the overall impact of the release using plain text only.';
8
8
  const listInstruction = language === 'ko'
9
- ? 'After the summary, list every change as a markdown bullet (-) grouped by category: 사용자 기능, 버그 수정, 유지 보수.'
10
- : 'After the summary, list every change as a markdown bullet (-) grouped by category: User Features, Bug Fixes, Maintenance.';
9
+ ? 'After the summary, write one line per category 사용자 기능, 버그 수정, 유지 보수 — using the format "사용자 기능: 변경1; 변경2" with plain text only (no bullets, numbers, or markdown symbols).'
10
+ : 'After the summary, write one line per category User Features, Bug Fixes, Maintenance — using the format "User Features: Change 1; Change 2" with plain text only (no bullets, numbers, or markdown symbols).';
11
11
  const emptyCategoryInstruction = language === 'ko'
12
- ? 'If a category has no changes, include a bullet stating - 해당 사항 없음.'
13
- : 'If a category has no changes, include a bullet stating - None.';
12
+ ? 'If a category has no changes, write "사용자 기능: 해당 사항 없음." (or the matching category label) using the same plain text format.'
13
+ : 'If a category has no changes, write "User Features: None." (or the matching category label) using the same plain text format.';
14
14
  const noChangesInstruction = language === 'ko'
15
15
  ? 'If no changes exist at all, state "변경 사항 없음" plainly.'
16
16
  : 'If no changes exist at all, state "No changes to report." plainly.';
17
17
  const outputLanguageLine = language === 'ko'
18
- ? 'Write the release notes in Korean using concise markdown.'
19
- : 'Write the release notes in English using concise markdown.';
18
+ ? 'Write the release notes in Korean using concise plain text without markdown syntax.'
19
+ : 'Write the release notes in English using concise plain text without markdown syntax.';
20
20
  return `You are an experienced release manager. Produce clear, user-facing release notes that describe the differences between the previous tag and ${tagName}.
21
21
 
22
22
  ## Objective
@@ -32,10 +32,12 @@ ${customInstructions}
32
32
  - ${outputLanguageLine}
33
33
  - ${summaryInstruction}
34
34
  - ${listInstruction}
35
- - Use short phrases for each bullet and include scope/component names when helpful, without copying commit messages verbatim.
35
+ - Use short phrases for each change and include scope/component names when helpful, without copying commit messages verbatim.
36
36
  - ${emptyCategoryInstruction}
37
37
  - ${noChangesInstruction}
38
38
  - Do not invent work beyond what appears in the commit log.
39
+ - Do not use markdown syntax such as headings (#), bullets (-), emphasis (**), underscores (_), or backticks (\`).
40
+ - Separate lines using newline characters only; do not use numbering, bullet prefixes, tables, or code blocks.
39
41
  - Return only the release notes content with no surrounding commentary.`;
40
42
  };
41
43
  exports.generateTagPrompt = generateTagPrompt;
@@ -1 +1 @@
1
- {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/prompts/tag.ts"],"names":[],"mappings":";;;AAEO,MAAM,iBAAiB,GAAG,CAC/B,OAAe,EACf,kBAAkB,GAAG,EAAE,EACvB,WAA8B,IAAI,EAC1B,EAAE;IACV,MAAM,kBAAkB,GAAG,QAAQ,KAAK,IAAI;QAC1C,CAAC,CAAC,kGAAkG;QACpG,CAAC,CAAC,mGAAmG,CAAC;IAExG,MAAM,eAAe,GAAG,QAAQ,KAAK,IAAI;QACvC,CAAC,CAAC,0GAA0G;QAC5G,CAAC,CAAC,2HAA2H,CAAC;IAEhI,MAAM,wBAAwB,GAAG,QAAQ,KAAK,IAAI;QAChD,CAAC,CAAC,oEAAoE;QAC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AO;gDACc,OAAO;;EAErD,kBAAkB;;;IAGhB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;;IAEf,wBAAwB;IACxB,oBAAoB;;;;wEAIgD,CAAC;AACzE,CAAC,CAAC;AA/CW,QAAA,iBAAiB,qBA+C5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ksw8954/git-ai-commit",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "AI-powered git commit message generator",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -1,18 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { Command } from 'commander';
4
+ import fs from 'fs';
5
+ import path from 'path';
4
6
  import { CommitCommand } from './commands/commit';
5
7
  import { ConfigCommand } from './commands/configCommand';
6
8
  import { PullRequestCommand } from './commands/prCommand';
7
9
  import { TagCommand } from './commands/tag';
8
10
  import { HistoryCommand } from './commands/history';
9
11
 
12
+ function getPackageVersion(): string {
13
+ try {
14
+ // When compiled, __dirname will be dist/; package.json is one level up
15
+ const pkgPath = path.resolve(__dirname, '../package.json');
16
+ const raw = fs.readFileSync(pkgPath, 'utf-8');
17
+ const pkg = JSON.parse(raw);
18
+ return typeof pkg.version === 'string' ? pkg.version : '0.0.0';
19
+ } catch {
20
+ return '0.0.0';
21
+ }
22
+ }
23
+
10
24
  const program = new Command();
11
25
 
12
26
  program
13
27
  .name('git-ai-commit')
14
28
  .description('AI-powered git commit message generator')
15
- .version('1.0.0');
29
+ // Expose -v, --version instead of default -V
30
+ .version(getPackageVersion(), '-v, --version', 'output the version number');
16
31
 
17
32
  const commitCommand = new CommitCommand();
18
33
  const configCommand = new ConfigCommand();
@@ -6,24 +6,24 @@ export const generateTagPrompt = (
6
6
  language: TagPromptLanguage = 'ko'
7
7
  ): string => {
8
8
  const summaryInstruction = language === 'ko'
9
- ? 'Begin with a short summary sentence (in Korean) that captures the overall impact of the release.'
10
- : 'Begin with a short summary sentence (in English) that captures the overall impact of the release.';
9
+ ? 'Begin with a short summary sentence (in Korean) that captures the overall impact of the release using plain text only.'
10
+ : 'Begin with a short summary sentence (in English) that captures the overall impact of the release using plain text only.';
11
11
 
12
12
  const listInstruction = language === 'ko'
13
- ? 'After the summary, list every change as a markdown bullet (-) grouped by category: 사용자 기능, 버그 수정, 유지 보수.'
14
- : 'After the summary, list every change as a markdown bullet (-) grouped by category: User Features, Bug Fixes, Maintenance.';
13
+ ? 'After the summary, write one line per category 사용자 기능, 버그 수정, 유지 보수 — using the format "사용자 기능: 변경1; 변경2" with plain text only (no bullets, numbers, or markdown symbols).'
14
+ : 'After the summary, write one line per category User Features, Bug Fixes, Maintenance — using the format "User Features: Change 1; Change 2" with plain text only (no bullets, numbers, or markdown symbols).';
15
15
 
16
16
  const emptyCategoryInstruction = language === 'ko'
17
- ? 'If a category has no changes, include a bullet stating - 해당 사항 없음.'
18
- : 'If a category has no changes, include a bullet stating - None.';
17
+ ? 'If a category has no changes, write "사용자 기능: 해당 사항 없음." (or the matching category label) using the same plain text format.'
18
+ : 'If a category has no changes, write "User Features: None." (or the matching category label) using the same plain text format.';
19
19
 
20
20
  const noChangesInstruction = language === 'ko'
21
21
  ? 'If no changes exist at all, state "변경 사항 없음" plainly.'
22
22
  : 'If no changes exist at all, state "No changes to report." plainly.';
23
23
 
24
24
  const outputLanguageLine = language === 'ko'
25
- ? 'Write the release notes in Korean using concise markdown.'
26
- : 'Write the release notes in English using concise markdown.';
25
+ ? 'Write the release notes in Korean using concise plain text without markdown syntax.'
26
+ : 'Write the release notes in English using concise plain text without markdown syntax.';
27
27
 
28
28
  return `You are an experienced release manager. Produce clear, user-facing release notes that describe the differences between the previous tag and ${tagName}.
29
29
 
@@ -40,9 +40,11 @@ ${customInstructions}
40
40
  - ${outputLanguageLine}
41
41
  - ${summaryInstruction}
42
42
  - ${listInstruction}
43
- - Use short phrases for each bullet and include scope/component names when helpful, without copying commit messages verbatim.
43
+ - Use short phrases for each change and include scope/component names when helpful, without copying commit messages verbatim.
44
44
  - ${emptyCategoryInstruction}
45
45
  - ${noChangesInstruction}
46
46
  - Do not invent work beyond what appears in the commit log.
47
+ - Do not use markdown syntax such as headings (#), bullets (-), emphasis (**), underscores (_), or backticks (\`).
48
+ - Separate lines using newline characters only; do not use numbering, bullet prefixes, tables, or code blocks.
47
49
  - Return only the release notes content with no surrounding commentary.`;
48
50
  };