git-coco 0.14.6 → 0.14.8
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 +15 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.mjs +25 -8
- package/dist/index.js +25 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
+
# `coco`
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/git-coco)
|
|
6
|
+
[](https://www.npmjs.com/package/git-coco)
|
|
7
|
+
[](https://www.npmjs.com/package/git-coco)
|
|
3
8
|
[](https://github.com/gfargo/coco/issues)
|
|
4
9
|
[](https://github.com/gfargo/coco/pulls)
|
|
5
10
|
[](https://github.com/gfargo/coco/tree/main)
|
|
6
|
-
[](https://discord.gg/KGu9nE9Ejx)
|
|
12
|
+
|
|
13
|
+
Spawned by the dream to automate away the tedium of writing commit messages, `coco` has grown into a multi-facetted git assistant to expedite any developer git workflow.
|
|
8
14
|
|
|
9
|
-
`coco
|
|
15
|
+
Currently `coco` generates commit messages, creates changelogs, summarizes code changes, perform code review, and more - with new features being added regularly!
|
|
10
16
|
|
|
11
17
|
## Commands
|
|
12
18
|
|
|
@@ -130,3 +136,8 @@ We welcome contributions! Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for m
|
|
|
130
136
|
## License
|
|
131
137
|
|
|
132
138
|
MIT © [gfargo](https://github.com/gfargo/)
|
|
139
|
+
|
|
140
|
+
<div style="text-align:center; padding-top: 2rem;">
|
|
141
|
+
<img src="https://git-co.co/mascott/mascott_d.png" width="200px">
|
|
142
|
+
<p>Thanks for using <code>coco</code> ✨💜</p>
|
|
143
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -239,12 +239,14 @@ interface SpinnerOptions {
|
|
|
239
239
|
}
|
|
240
240
|
interface Config {
|
|
241
241
|
verbose?: boolean;
|
|
242
|
+
silent?: boolean;
|
|
242
243
|
}
|
|
243
244
|
declare class Logger {
|
|
244
245
|
private config;
|
|
245
246
|
private timerStart;
|
|
246
247
|
private spinner;
|
|
247
248
|
constructor(config: Config);
|
|
249
|
+
setConfig(config: Config): Logger;
|
|
248
250
|
log(message: string, options?: LoggerOptions): Logger;
|
|
249
251
|
verbose(message: string, options?: LoggerOptions): Logger;
|
|
250
252
|
startTimer(): Logger;
|
package/dist/index.esm.mjs
CHANGED
|
@@ -55,7 +55,7 @@ import * as readline from 'readline';
|
|
|
55
55
|
/**
|
|
56
56
|
* Current build version from package.json
|
|
57
57
|
*/
|
|
58
|
-
const BUILD_VERSION = "0.14.
|
|
58
|
+
const BUILD_VERSION = "0.14.8";
|
|
59
59
|
|
|
60
60
|
const isInteractive = (config) => {
|
|
61
61
|
return config?.mode === 'interactive' || !!config?.interactive;
|
|
@@ -1769,7 +1769,17 @@ class Logger {
|
|
|
1769
1769
|
this.config = config;
|
|
1770
1770
|
this.spinner = null;
|
|
1771
1771
|
}
|
|
1772
|
+
setConfig(config) {
|
|
1773
|
+
this.config = {
|
|
1774
|
+
...this.config,
|
|
1775
|
+
...config,
|
|
1776
|
+
};
|
|
1777
|
+
return this;
|
|
1778
|
+
}
|
|
1772
1779
|
log(message, options = { color: 'blue' }) {
|
|
1780
|
+
if (this.config?.silent) {
|
|
1781
|
+
return this;
|
|
1782
|
+
}
|
|
1773
1783
|
let outputMessage = message;
|
|
1774
1784
|
if (options.color) {
|
|
1775
1785
|
outputMessage = chalk[options.color](outputMessage);
|
|
@@ -1778,7 +1788,7 @@ class Logger {
|
|
|
1778
1788
|
return this;
|
|
1779
1789
|
}
|
|
1780
1790
|
verbose(message, options = {}) {
|
|
1781
|
-
if (!this.config?.verbose) {
|
|
1791
|
+
if (!this.config?.verbose || this.config?.silent) {
|
|
1782
1792
|
return this;
|
|
1783
1793
|
}
|
|
1784
1794
|
this.log(message, options);
|
|
@@ -1789,13 +1799,11 @@ class Logger {
|
|
|
1789
1799
|
return this;
|
|
1790
1800
|
}
|
|
1791
1801
|
stopTimer(message, options = { color: 'yellow' }) {
|
|
1792
|
-
if (!this.config?.verbose || !this.timerStart) {
|
|
1802
|
+
if (!this.config?.verbose || !this.timerStart || this.config?.silent) {
|
|
1793
1803
|
return this;
|
|
1794
1804
|
}
|
|
1795
1805
|
const elapsedTime = prettyMilliseconds(now() - this.timerStart);
|
|
1796
|
-
let outputMessage = message
|
|
1797
|
-
? `${message} (⏲ ${elapsedTime})`
|
|
1798
|
-
: `⏲ ${elapsedTime}`;
|
|
1806
|
+
let outputMessage = message ? `${message} (⏲ ${elapsedTime})` : `⏲ ${elapsedTime}`;
|
|
1799
1807
|
if (options.color) {
|
|
1800
1808
|
outputMessage = chalk[options.color](outputMessage);
|
|
1801
1809
|
}
|
|
@@ -1803,11 +1811,17 @@ class Logger {
|
|
|
1803
1811
|
return this;
|
|
1804
1812
|
}
|
|
1805
1813
|
startSpinner(message, options = { color: 'green' }) {
|
|
1814
|
+
if (this.config?.silent) {
|
|
1815
|
+
return this;
|
|
1816
|
+
}
|
|
1806
1817
|
const spinnerMessage = options.color ? chalk[options.color](message) : message;
|
|
1807
1818
|
this.spinner = ora(spinnerMessage).start();
|
|
1808
1819
|
return this;
|
|
1809
1820
|
}
|
|
1810
1821
|
stopSpinner(message = '', options = { mode: 'succeed', color: 'green' }) {
|
|
1822
|
+
if (this.config?.silent) {
|
|
1823
|
+
return this;
|
|
1824
|
+
}
|
|
1811
1825
|
const spinnerMessage = options?.color ? chalk[options.color](message) : message;
|
|
1812
1826
|
this.spinner?.[options.mode || 'succeed'](spinnerMessage);
|
|
1813
1827
|
this.spinner = null;
|
|
@@ -2364,7 +2378,7 @@ const handler$4 = async (argv, logger) => {
|
|
|
2364
2378
|
variables: CHANGELOG_PROMPT.inputVariables,
|
|
2365
2379
|
fallback: CHANGELOG_PROMPT,
|
|
2366
2380
|
});
|
|
2367
|
-
const formatInstructions = "
|
|
2381
|
+
const formatInstructions = "Only respond with a valid JSON object, containing two fields: 'title' an escaped string, no more than 65 characters, and 'content' also an escaped string.";
|
|
2368
2382
|
const changelog = await executeChain({
|
|
2369
2383
|
llm,
|
|
2370
2384
|
prompt,
|
|
@@ -6237,10 +6251,13 @@ const handler$3 = async (argv, logger) => {
|
|
|
6237
6251
|
}
|
|
6238
6252
|
const tokenizer = await getTokenCounter(provider === 'openai' ? model : 'gpt-4o');
|
|
6239
6253
|
const llm = getLlm(provider, model, config);
|
|
6240
|
-
const INTERACTIVE = isInteractive(config);
|
|
6254
|
+
const INTERACTIVE = argv.interactive || isInteractive(config);
|
|
6241
6255
|
if (INTERACTIVE) {
|
|
6242
6256
|
logger.log(LOGO);
|
|
6243
6257
|
}
|
|
6258
|
+
else {
|
|
6259
|
+
logger.setConfig({ silent: true });
|
|
6260
|
+
}
|
|
6244
6261
|
async function factory() {
|
|
6245
6262
|
const changes = await getChanges({
|
|
6246
6263
|
git,
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,7 @@ var readline__namespace = /*#__PURE__*/_interopNamespaceDefault(readline$1);
|
|
|
77
77
|
/**
|
|
78
78
|
* Current build version from package.json
|
|
79
79
|
*/
|
|
80
|
-
const BUILD_VERSION = "0.14.
|
|
80
|
+
const BUILD_VERSION = "0.14.8";
|
|
81
81
|
|
|
82
82
|
const isInteractive = (config) => {
|
|
83
83
|
return config?.mode === 'interactive' || !!config?.interactive;
|
|
@@ -1791,7 +1791,17 @@ class Logger {
|
|
|
1791
1791
|
this.config = config;
|
|
1792
1792
|
this.spinner = null;
|
|
1793
1793
|
}
|
|
1794
|
+
setConfig(config) {
|
|
1795
|
+
this.config = {
|
|
1796
|
+
...this.config,
|
|
1797
|
+
...config,
|
|
1798
|
+
};
|
|
1799
|
+
return this;
|
|
1800
|
+
}
|
|
1794
1801
|
log(message, options = { color: 'blue' }) {
|
|
1802
|
+
if (this.config?.silent) {
|
|
1803
|
+
return this;
|
|
1804
|
+
}
|
|
1795
1805
|
let outputMessage = message;
|
|
1796
1806
|
if (options.color) {
|
|
1797
1807
|
outputMessage = chalk[options.color](outputMessage);
|
|
@@ -1800,7 +1810,7 @@ class Logger {
|
|
|
1800
1810
|
return this;
|
|
1801
1811
|
}
|
|
1802
1812
|
verbose(message, options = {}) {
|
|
1803
|
-
if (!this.config?.verbose) {
|
|
1813
|
+
if (!this.config?.verbose || this.config?.silent) {
|
|
1804
1814
|
return this;
|
|
1805
1815
|
}
|
|
1806
1816
|
this.log(message, options);
|
|
@@ -1811,13 +1821,11 @@ class Logger {
|
|
|
1811
1821
|
return this;
|
|
1812
1822
|
}
|
|
1813
1823
|
stopTimer(message, options = { color: 'yellow' }) {
|
|
1814
|
-
if (!this.config?.verbose || !this.timerStart) {
|
|
1824
|
+
if (!this.config?.verbose || !this.timerStart || this.config?.silent) {
|
|
1815
1825
|
return this;
|
|
1816
1826
|
}
|
|
1817
1827
|
const elapsedTime = prettyMilliseconds(now() - this.timerStart);
|
|
1818
|
-
let outputMessage = message
|
|
1819
|
-
? `${message} (⏲ ${elapsedTime})`
|
|
1820
|
-
: `⏲ ${elapsedTime}`;
|
|
1828
|
+
let outputMessage = message ? `${message} (⏲ ${elapsedTime})` : `⏲ ${elapsedTime}`;
|
|
1821
1829
|
if (options.color) {
|
|
1822
1830
|
outputMessage = chalk[options.color](outputMessage);
|
|
1823
1831
|
}
|
|
@@ -1825,11 +1833,17 @@ class Logger {
|
|
|
1825
1833
|
return this;
|
|
1826
1834
|
}
|
|
1827
1835
|
startSpinner(message, options = { color: 'green' }) {
|
|
1836
|
+
if (this.config?.silent) {
|
|
1837
|
+
return this;
|
|
1838
|
+
}
|
|
1828
1839
|
const spinnerMessage = options.color ? chalk[options.color](message) : message;
|
|
1829
1840
|
this.spinner = ora(spinnerMessage).start();
|
|
1830
1841
|
return this;
|
|
1831
1842
|
}
|
|
1832
1843
|
stopSpinner(message = '', options = { mode: 'succeed', color: 'green' }) {
|
|
1844
|
+
if (this.config?.silent) {
|
|
1845
|
+
return this;
|
|
1846
|
+
}
|
|
1833
1847
|
const spinnerMessage = options?.color ? chalk[options.color](message) : message;
|
|
1834
1848
|
this.spinner?.[options.mode || 'succeed'](spinnerMessage);
|
|
1835
1849
|
this.spinner = null;
|
|
@@ -2386,7 +2400,7 @@ const handler$4 = async (argv, logger) => {
|
|
|
2386
2400
|
variables: CHANGELOG_PROMPT.inputVariables,
|
|
2387
2401
|
fallback: CHANGELOG_PROMPT,
|
|
2388
2402
|
});
|
|
2389
|
-
const formatInstructions = "
|
|
2403
|
+
const formatInstructions = "Only respond with a valid JSON object, containing two fields: 'title' an escaped string, no more than 65 characters, and 'content' also an escaped string.";
|
|
2390
2404
|
const changelog = await executeChain({
|
|
2391
2405
|
llm,
|
|
2392
2406
|
prompt,
|
|
@@ -6259,10 +6273,13 @@ const handler$3 = async (argv, logger) => {
|
|
|
6259
6273
|
}
|
|
6260
6274
|
const tokenizer = await getTokenCounter(provider === 'openai' ? model : 'gpt-4o');
|
|
6261
6275
|
const llm = getLlm(provider, model, config);
|
|
6262
|
-
const INTERACTIVE = isInteractive(config);
|
|
6276
|
+
const INTERACTIVE = argv.interactive || isInteractive(config);
|
|
6263
6277
|
if (INTERACTIVE) {
|
|
6264
6278
|
logger.log(LOGO);
|
|
6265
6279
|
}
|
|
6280
|
+
else {
|
|
6281
|
+
logger.setConfig({ silent: true });
|
|
6282
|
+
}
|
|
6266
6283
|
async function factory() {
|
|
6267
6284
|
const changes = await getChanges({
|
|
6268
6285
|
git,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-coco",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.8",
|
|
4
4
|
"description": "zero-effort git commits with coco.",
|
|
5
5
|
"author": "gfargo <ghfargo@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"p-queue": "5.0.0",
|
|
101
101
|
"performance-now": "2.1.0",
|
|
102
102
|
"pretty-ms": "7.0.1",
|
|
103
|
-
"simple-git": "3.
|
|
103
|
+
"simple-git": "3.27.0",
|
|
104
104
|
"tiktoken": "^1.0.17",
|
|
105
105
|
"yargs": "17.7.2"
|
|
106
106
|
}
|