gennady 0.2.0 → 0.2.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/cli/gennady.js CHANGED
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env node
2
+
1
3
  import { readFileSync } from 'fs';
2
4
  import { fileURLToPath } from 'url';
3
5
  import { dirname, join } from 'path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gennady",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "author": "Konstantin Lebedev <ibnrubaxa@gmail.com>",
5
5
  "description": "Gennady — Generate Next-level Automated Description Intelligence",
6
6
  "keywords": [
@@ -85,13 +85,15 @@ export class CommitGen {
85
85
  const maxTokens = codeChanged[codeChanged.length - 1].tokens;
86
86
  const languages = [...new Set(codeChanged.map(f => f.programmingLanguage).filter(Boolean))].join(', ');
87
87
  const mode =
88
- this.init.mode === 'auto'
89
- ? this.init.targetBranch
90
- ? 'detailed'
91
- : commitCount > 1 && codeChanged.length < 5
92
- ? 'oneline'
93
- : 'detailed'
94
- : this.init.mode;
88
+ this.init.oneline
89
+ ? 'oneline'
90
+ : this.init.mode === 'auto'
91
+ ? this.init.targetBranch
92
+ ? 'detailed'
93
+ : commitCount > 1 && codeChanged.length < 5
94
+ ? 'oneline'
95
+ : 'detailed'
96
+ : this.init.mode;
95
97
 
96
98
  this.logger.info(`- Mode: ${style.bold.magentaBright(mode)}`);
97
99
  this.logger.info(`- Languages: ${style.yellow(languages)}`);
@@ -139,7 +141,7 @@ export class CommitGen {
139
141
 
140
142
  const startFormatTime = performance.now();
141
143
  const formatted = await this.toFormat(
142
- mode === 'detailed' && !this.init.oneline ? this.init.formatDetailedPromptTemplate : this.init.formatOnelinePromptTemplate,
144
+ mode === 'detailed' ? this.init.formatDetailedPromptTemplate : this.init.formatOnelinePromptTemplate,
143
145
  results.join('\n\n'),
144
146
  );
145
147
  this.logger.info(`- Formatting time: ${style.blueBright(((performance.now() - startFormatTime) / 1000).toFixed(2))}s`);