mongossee 1.0.27 → 1.0.28

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.
Files changed (2) hide show
  1. package/index.js +22 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -26,14 +26,25 @@ async function generateProject(prompt, directoryName) {
26
26
  - If the request mentions "Typescript" or ".ts/.tsx", use TypeScript strictly.
27
27
  - If it mentions React/Components, use React (JSX/TSX).
28
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.
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
- 10. IMPORTANT: I need 'Pretty-Printed' code. Use multi-line formatting. Single-line code is strictly forbidden.
29
+ 2. TYPESCRIPT RULES: If using TypeScript, define proper Interfaces/Types for Props and State.
30
+ 3. REACT RULES: If using React, always use functional components with hooks (useState, useEffect).
31
+
32
+ 4. REMOVE FALTU STUFF: Do NOT include @testing-library, web-vitals, or eslintConfig.
33
+ 5. 🧠 SMART LOGIC: If the prompt says "Logic", "Algorithm", or "DSA", generate only the core logic without UI or framework code
34
+ 6. 🧱 COMPONENT STRUCTURE: If the prompt mentions "component", "ui", or "frontend", build a complete component with proper imports, exports, and structure.
35
+
36
+ 7. ⛔ ZERO COMMENTS: Return strictly functional code. No // or /* */ comments, and no explanations.
37
+
38
+ 8. 📁 ARCHITECTURE: If the prompt mentions Parent/Child or Props, strictly follow React best practices (state in parent, props to child, arrow functions for events).
39
+
40
+ 9. 📄 FORMAT: Return ONLY a valid JSON array of objects: [{"filename": "string", "code": "string"}].
41
+
42
+ 10. 🚫 NO MARKDOWN: Do not wrap the response in \`\`\`json blocks.
43
+ 11. 🧹 CLEAN CODE: Ensure the 'code' string has proper indentation (spaces/tabs) and newlines so it is human-readable after being written to a file. Single-line code is not acceptable.
44
+ 12. IMPORTANT: I need 'Pretty-Printed' code. Use multi-line formatting. Single-line code is strictly forbidden.
45
+ 13. 🛠️ BOILERPLATE: Include all necessary boilerplate files (e.g. package.json for Node.js, pom.xml for Java, etc.) based on the detected language and framework.
46
+ 14. 🧩 FILE STRUCTURE: If the prompt implies multiple files (e.g. "Create a React app with components"), generate a structured file hierarchy with appropriate imports/exports.
47
+ 15. 🧑‍💻 FULL SOURCE CODE: The 'code' field must contain the complete source code for the file, including all necessary imports, exports, and boilerplate. Do not return partial code snippets.
37
48
  `
38
49
  };
39
50
 
@@ -99,7 +110,9 @@ async function generateProject(prompt, directoryName) {
99
110
  .replace(/\\r/g, '') // Carriage returns hatao
100
111
  .replace(/\\n/g, '\n') // Double backslash ko newline banao
101
112
  .replace(/\\t/g, ' ') // Tabs ko spaces banao
102
- .replace(/\\"/g, '"'); // Escaped quotes ko sahi karo
113
+ .replace(/\\"/g, '"') // Escaped quotes ko sahi karo
114
+ .replace(/\\\\"/g, '"'); // Agar AI ne code ko ek single line mein diya hai, toh usko pretty-print karne ki koshish karo
115
+
103
116
  }
104
117
 
105
118
  // Write the code to the file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mongossee",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {