cloving 0.1.20 → 0.1.21
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.
|
@@ -16,7 +16,11 @@ const generateCodePrompt = (prompt, files, contextFiles, previousCode) => {
|
|
|
16
16
|
const specialFileContents = (0, command_utils_1.collectSpecialFileContents)();
|
|
17
17
|
const specialFiles = Object.keys(specialFileContents).map((file) => `### Contents of ${file}\n\n${JSON.stringify(specialFileContents[file], null, 2)}\n\n`).join('\n');
|
|
18
18
|
const contextFileContents = Object.keys(contextFiles).map((file) => `### Contents of ${file}\n\n${contextFiles[file]}\n\n`).join('\n');
|
|
19
|
-
let promptText = `###
|
|
19
|
+
let promptText = `### Request
|
|
20
|
+
|
|
21
|
+
Generate code that does the following: ${prompt}
|
|
22
|
+
|
|
23
|
+
### Description of App
|
|
20
24
|
|
|
21
25
|
${JSON.stringify((0, config_utils_1.getClovingConfig)(), null, 2)}
|
|
22
26
|
|
|
@@ -110,7 +110,17 @@ ${contextFileContents}
|
|
|
110
110
|
${gitDiff}
|
|
111
111
|
==== end diff =====`;
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
if (files) {
|
|
114
|
+
promptText += `
|
|
115
|
+
|
|
116
|
+
### Request
|
|
117
|
+
|
|
118
|
+
I would like you to explain the code and document a description of it.
|
|
119
|
+
List any bugs in the new code as well as recommended fixes for those bugs with code examples.
|
|
120
|
+
Format the output of this code review in Markdown format.`;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
promptText += `
|
|
114
124
|
|
|
115
125
|
### Request
|
|
116
126
|
|
|
@@ -118,6 +128,7 @@ Do not use any data from the example response structure, only use the structure.
|
|
|
118
128
|
I would like you to explain why these change are being made and document a description of these changes.
|
|
119
129
|
Also list any bugs in the new code as well as recommended fixes for those bugs with code examples.
|
|
120
130
|
Format the output of this code review in Markdown format.`;
|
|
131
|
+
}
|
|
121
132
|
if (prompt) {
|
|
122
133
|
promptText += `
|
|
123
134
|
|
package/dist/package.json
CHANGED
|
@@ -8,6 +8,7 @@ const child_process_1 = require("child_process");
|
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const config_utils_1 = require("./config_utils");
|
|
11
|
+
const isbinaryfile_1 = require("isbinaryfile");
|
|
11
12
|
exports.SPECIAL_FILES = [
|
|
12
13
|
'package.json', 'Gemfile', 'requirements.txt', 'Pipfile', 'pyproject.toml', 'pom.xml', 'build.gradle',
|
|
13
14
|
'.csproj', 'packages.config', 'composer.json', 'CMakeLists.txt', 'conanfile.txt', 'conanfile.py',
|
|
@@ -37,10 +38,17 @@ const getAllFilesInDirectory = async (dir) => {
|
|
|
37
38
|
const subdirs = await fs_1.default.promises.readdir(dir);
|
|
38
39
|
const files = await Promise.all(subdirs.map(async (subdir) => {
|
|
39
40
|
const res = path_1.default.resolve(dir, subdir);
|
|
40
|
-
if (subdir === 'node_modules' || subdir === '.git') {
|
|
41
|
+
if (subdir === 'node_modules' || subdir === '.git' || subdir === '.DS_Store') {
|
|
41
42
|
return [];
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
const stat = await fs_1.default.promises.stat(res);
|
|
45
|
+
if (stat.isDirectory()) {
|
|
46
|
+
return (0, exports.getAllFilesInDirectory)(res);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const isBinary = await (0, isbinaryfile_1.isBinaryFile)(res);
|
|
50
|
+
return isBinary ? [] : res;
|
|
51
|
+
}
|
|
44
52
|
}));
|
|
45
53
|
return files.flat();
|
|
46
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloving",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"packageManager": "yarn@1.22.22",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"eslint-plugin-promise": "^7.0.0",
|
|
52
52
|
"ignore": "^5.3.1",
|
|
53
53
|
"ini": "^4.1.3",
|
|
54
|
+
"isbinaryfile": "^5.0.2",
|
|
54
55
|
"nock": "^13.5.4",
|
|
55
56
|
"vite": "^5.3.5",
|
|
56
57
|
"vite-node": "^2.0.5"
|