mongossee 1.0.24 → 1.0.25
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 +17 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,7 +4,6 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const yargs = require('yargs/yargs');
|
|
6
6
|
const { hideBin } = require('yargs/helpers');
|
|
7
|
-
const { execSync } = require('child_process');
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
const SERVER_URL = "https://mongossee.vercel.app/api/server";
|
|
@@ -19,8 +18,23 @@ async function generateProject(prompt, directoryName) {
|
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
const body = {
|
|
22
|
-
|
|
23
|
-
}
|
|
21
|
+
prompt: `
|
|
22
|
+
TASK: Generate a coding project based on this user request: "${prompt}"
|
|
23
|
+
|
|
24
|
+
STRICT TECHNICAL CONSTRAINTS (Follow for every project):
|
|
25
|
+
1. AUTO-DETECT LANGUAGE & TECH:
|
|
26
|
+
- If the request mentions "Typescript" or ".ts/.tsx", use TypeScript strictly.
|
|
27
|
+
- If it mentions React/Components, use React (JSX/TSX).
|
|
28
|
+
- For DSA/Logic, choose Java, Python, or C++ based on context.
|
|
29
|
+
3. TYPESCRIPT RULES: If using TypeScript, define proper Interfaces/Types for Props and State. No "any" type.
|
|
30
|
+
4. ⛔ NO EXTRA BLOAT: In package.json, include ONLY strictly necessary dependencies (e.g., react, react-dom, react-scripts).
|
|
31
|
+
5. ❌ REMOVE FALTU STUFF: Do NOT include @testing-library, web-vitals, or eslintConfig. I want a clean, minimal package.json.
|
|
32
|
+
6. ⛔ ZERO COMMENTS: Return strictly functional code. No // or /* */ comments, and no explanations.
|
|
33
|
+
7. 📁 ARCHITECTURE: If the prompt mentions Parent/Child or Props, strictly follow React best practices (state in parent, props to child, arrow functions for events).
|
|
34
|
+
8. 📄 FORMAT: Return ONLY a valid JSON array of objects: [{"filename": "string", "code": "string"}].
|
|
35
|
+
9. 🚫 NO MARKDOWN: Do not wrap the response in \`\`\`json blocks.
|
|
36
|
+
`
|
|
37
|
+
};
|
|
24
38
|
|
|
25
39
|
try {
|
|
26
40
|
console.log(`Code Running in Expresss`);
|
|
@@ -81,23 +95,6 @@ async function generateProject(prompt, directoryName) {
|
|
|
81
95
|
//console.log(`Created file: ${filePath}`);
|
|
82
96
|
}
|
|
83
97
|
|
|
84
|
-
const hasPackageJson = files.some(file => file.filename === 'package.json');
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (hasPackageJson) {
|
|
88
|
-
console.log(`📦 package.json detected. Installing dependencies...`);
|
|
89
|
-
try {
|
|
90
|
-
// Folder ke andar jaakar npm install chalao
|
|
91
|
-
execSync('npm install', {
|
|
92
|
-
cwd: directoryName,
|
|
93
|
-
stdio: 'inherit' // Taaki installation progress dikhe
|
|
94
|
-
});
|
|
95
|
-
console.log(`\n✅ All dependencies installed!`);
|
|
96
|
-
} catch (err) {
|
|
97
|
-
console.error(`\n⚠️ NPM Install failed. Please run 'npm install' manually inside "${directoryName}".`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
98
|
// console.log(`\n Project "${directoryName}" created successfully!`);
|
|
102
99
|
|
|
103
100
|
} catch (error) {
|