cloving 0.1.15 → 0.1.17
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 +40 -32
- package/dist/cloving_gpt/adapters/claude.js +0 -2
- package/dist/cloving_gpt/adapters/openai.js +1 -0
- package/dist/cloving_gpt/index.js +12 -18
- package/dist/commands/config.js +54 -82
- package/dist/commands/generate/code.js +47 -91
- package/dist/commands/generate/context.js +8 -16
- package/dist/commands/generate/review.js +12 -16
- package/dist/commands/generate/shell.js +22 -35
- package/dist/commands/generate/unit_tests.js +156 -68
- package/dist/commands/init.js +9 -17
- package/dist/commands/project/build.js +11 -19
- package/dist/commands/project/init.js +4 -8
- package/dist/index.js +6 -0
- package/dist/package.json +16 -17
- package/dist/utils/config_utils.js +2 -1
- package/dist/utils/git_utils.js +3 -1
- package/dist/utils/string_utils.js +3 -1
- package/package.json +16 -17
package/dist/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloving",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"packageManager": "yarn@1.22.22",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"types": "dist/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
@@ -11,9 +12,7 @@
|
|
|
11
12
|
"test": "bash -c jest",
|
|
12
13
|
"prepare": "husky"
|
|
13
14
|
},
|
|
14
|
-
"bin":
|
|
15
|
-
"cloving": "./dist/index.js"
|
|
16
|
-
},
|
|
15
|
+
"bin": "./dist/index.js",
|
|
17
16
|
"files": [
|
|
18
17
|
"dist",
|
|
19
18
|
"!**/test/**"
|
|
@@ -37,37 +36,37 @@
|
|
|
37
36
|
}
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"
|
|
39
|
+
"@inquirer/prompts": "^5.3.6",
|
|
40
|
+
"axios": "^1.7.3",
|
|
41
41
|
"cli-highlight": "^2.1.11",
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
43
|
"copy-paste": "^1.5.3",
|
|
44
|
-
"eslint": "^9.
|
|
44
|
+
"eslint": "^9.8.0",
|
|
45
45
|
"eslint-config-prettier": "^9.1.0",
|
|
46
46
|
"eslint-config-raine": "^0.5.0",
|
|
47
47
|
"eslint-config-standard": "^17.1.0",
|
|
48
48
|
"eslint-plugin-import": "^2.29.1",
|
|
49
|
-
"eslint-plugin-jsdoc": "^48.
|
|
50
|
-
"eslint-plugin-n": "^17.
|
|
51
|
-
"eslint-plugin-promise": "^
|
|
49
|
+
"eslint-plugin-jsdoc": "^48.11.0",
|
|
50
|
+
"eslint-plugin-n": "^17.10.1",
|
|
51
|
+
"eslint-plugin-promise": "^7.0.0",
|
|
52
52
|
"ignore": "^5.3.1",
|
|
53
53
|
"ini": "^4.1.3",
|
|
54
|
-
"inquirer": "^10.0.1",
|
|
55
54
|
"nock": "^13.5.4",
|
|
56
|
-
"vite": "^5.3.
|
|
57
|
-
"vite-node": "^2.0.
|
|
55
|
+
"vite": "^5.3.5",
|
|
56
|
+
"vite-node": "^2.0.5"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
59
|
"@types/copy-paste": "^1.1.33",
|
|
61
60
|
"@types/ini": "^4.1.1",
|
|
62
61
|
"@types/inquirer": "^9.0.7",
|
|
63
62
|
"@types/jest": "^29.5.12",
|
|
64
|
-
"@types/node": "^
|
|
65
|
-
"husky": "^9.
|
|
63
|
+
"@types/node": "^22.1.0",
|
|
64
|
+
"husky": "^9.1.4",
|
|
66
65
|
"jest": "^29.7.0",
|
|
67
66
|
"lint-prepush": "^2.2.2",
|
|
68
|
-
"lint-staged": "^15.2.
|
|
69
|
-
"ts-jest": "^29.2.
|
|
70
|
-
"typescript": "^5.5.
|
|
67
|
+
"lint-staged": "^15.2.8",
|
|
68
|
+
"ts-jest": "^29.2.4",
|
|
69
|
+
"typescript": "^5.5.4"
|
|
71
70
|
},
|
|
72
71
|
"resolutions": {
|
|
73
72
|
"eslint": "8.57.0",
|
package/dist/utils/git_utils.js
CHANGED
|
@@ -20,7 +20,9 @@ const getGitDiff = async () => {
|
|
|
20
20
|
try {
|
|
21
21
|
const defaultBranchName = await (0, exports.getDefaultBranchName)();
|
|
22
22
|
const gitDiff = (0, child_process_1.execSync)(`git diff ${defaultBranchName} --`).toString().trim();
|
|
23
|
-
|
|
23
|
+
// Indent each line by four spaces
|
|
24
|
+
const indentedDiff = gitDiff.split('\n').map(line => ` ${line}`).join('\n');
|
|
25
|
+
return indentedDiff;
|
|
24
26
|
}
|
|
25
27
|
catch (error) {
|
|
26
28
|
console.error('Error getting git diff:', error.message);
|
|
@@ -92,6 +92,8 @@ const parseMarkdownInstructions = (input) => {
|
|
|
92
92
|
};
|
|
93
93
|
exports.parseMarkdownInstructions = parseMarkdownInstructions;
|
|
94
94
|
const extractFilesAndContent = (rawCodeCommand) => {
|
|
95
|
+
if (!rawCodeCommand)
|
|
96
|
+
return [[], {}];
|
|
95
97
|
const files = [];
|
|
96
98
|
const fileContents = {};
|
|
97
99
|
const matches = rawCodeCommand.match(/(\*{2})([^\*]+)(\*{2})/g);
|
|
@@ -107,7 +109,7 @@ const extractFilesAndContent = (rawCodeCommand) => {
|
|
|
107
109
|
let content = contentMatch[1];
|
|
108
110
|
// Remove the first word after the opening triple backticks
|
|
109
111
|
content = content.split('\n').map((line, idx) => idx === 0 ? line.replace(/^\w+\s*/, '') : line).join('\n');
|
|
110
|
-
fileContents[fileName] = content;
|
|
112
|
+
fileContents[fileName] = content.trim();
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
return [files, fileContents];
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloving",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"packageManager": "yarn@1.22.22",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"types": "dist/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
@@ -11,9 +12,7 @@
|
|
|
11
12
|
"test": "bash -c jest",
|
|
12
13
|
"prepare": "husky"
|
|
13
14
|
},
|
|
14
|
-
"bin":
|
|
15
|
-
"cloving": "./dist/index.js"
|
|
16
|
-
},
|
|
15
|
+
"bin": "./dist/index.js",
|
|
17
16
|
"files": [
|
|
18
17
|
"dist",
|
|
19
18
|
"!**/test/**"
|
|
@@ -37,37 +36,37 @@
|
|
|
37
36
|
}
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"
|
|
39
|
+
"@inquirer/prompts": "^5.3.6",
|
|
40
|
+
"axios": "^1.7.3",
|
|
41
41
|
"cli-highlight": "^2.1.11",
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
43
|
"copy-paste": "^1.5.3",
|
|
44
|
-
"eslint": "^9.
|
|
44
|
+
"eslint": "^9.8.0",
|
|
45
45
|
"eslint-config-prettier": "^9.1.0",
|
|
46
46
|
"eslint-config-raine": "^0.5.0",
|
|
47
47
|
"eslint-config-standard": "^17.1.0",
|
|
48
48
|
"eslint-plugin-import": "^2.29.1",
|
|
49
|
-
"eslint-plugin-jsdoc": "^48.
|
|
50
|
-
"eslint-plugin-n": "^17.
|
|
51
|
-
"eslint-plugin-promise": "^
|
|
49
|
+
"eslint-plugin-jsdoc": "^48.11.0",
|
|
50
|
+
"eslint-plugin-n": "^17.10.1",
|
|
51
|
+
"eslint-plugin-promise": "^7.0.0",
|
|
52
52
|
"ignore": "^5.3.1",
|
|
53
53
|
"ini": "^4.1.3",
|
|
54
|
-
"inquirer": "^10.0.1",
|
|
55
54
|
"nock": "^13.5.4",
|
|
56
|
-
"vite": "^5.3.
|
|
57
|
-
"vite-node": "^2.0.
|
|
55
|
+
"vite": "^5.3.5",
|
|
56
|
+
"vite-node": "^2.0.5"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
59
|
"@types/copy-paste": "^1.1.33",
|
|
61
60
|
"@types/ini": "^4.1.1",
|
|
62
61
|
"@types/inquirer": "^9.0.7",
|
|
63
62
|
"@types/jest": "^29.5.12",
|
|
64
|
-
"@types/node": "^
|
|
65
|
-
"husky": "^9.
|
|
63
|
+
"@types/node": "^22.1.0",
|
|
64
|
+
"husky": "^9.1.4",
|
|
66
65
|
"jest": "^29.7.0",
|
|
67
66
|
"lint-prepush": "^2.2.2",
|
|
68
|
-
"lint-staged": "^15.2.
|
|
69
|
-
"ts-jest": "^29.2.
|
|
70
|
-
"typescript": "^5.5.
|
|
67
|
+
"lint-staged": "^15.2.8",
|
|
68
|
+
"ts-jest": "^29.2.4",
|
|
69
|
+
"typescript": "^5.5.4"
|
|
71
70
|
},
|
|
72
71
|
"resolutions": {
|
|
73
72
|
"eslint": "8.57.0",
|