mongor-cli 1.0.4 → 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/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ User Prompt: "${prompt}"
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
try {
|
|
39
|
-
console.log(
|
|
39
|
+
console.log(`Working on it`);
|
|
40
40
|
|
|
41
41
|
const response = await fetch(url, {
|
|
42
42
|
method: 'POST',
|
|
@@ -54,7 +54,7 @@ User Prompt: "${prompt}"
|
|
|
54
54
|
let responseText = data.candidates[0].content.parts[0].text;
|
|
55
55
|
|
|
56
56
|
// --- NEW JSON PARSING & FILE CREATION LOGIC ---
|
|
57
|
-
|
|
57
|
+
// console.log("🤖 AI response received. Building project...");
|
|
58
58
|
|
|
59
59
|
// Clean up potential markdown fences from the AI's response
|
|
60
60
|
if (responseText.startsWith("```json")) {
|
|
@@ -73,7 +73,7 @@ User Prompt: "${prompt}"
|
|
|
73
73
|
|
|
74
74
|
// Create the main project directory
|
|
75
75
|
fs.mkdirSync(directoryName, { recursive: true });
|
|
76
|
-
|
|
76
|
+
// console.log(`Created base directory: ${directoryName}`);
|
|
77
77
|
|
|
78
78
|
// Loop through the files array and create each file
|
|
79
79
|
for (const file of files) {
|
|
@@ -87,10 +87,10 @@ User Prompt: "${prompt}"
|
|
|
87
87
|
|
|
88
88
|
// Write the code to the file
|
|
89
89
|
fs.writeFileSync(filePath, file.code);
|
|
90
|
-
|
|
90
|
+
// console.log(`✅ Created file: ${filePath}`);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
console.log(`\n
|
|
93
|
+
console.log(`\n Project "${directoryName}" created successfully!`);
|
|
94
94
|
|
|
95
95
|
} catch (error) {
|
|
96
96
|
console.error('❌ An error occurred:', error.message);
|