mongossee 1.0.29 โ†’ 1.0.30

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 +21 -20
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,24 +27,25 @@ async function generateProject(prompt, directoryName) {
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
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).
30
+ 3. ๐ŸŽฏ CONTEXTUAL ONLY: Scrutinize the prompt. If it's a simple app, do NOT add router or state management. Only add 'react-router-dom', 'axios', etc., if the specific feature is requested.
31
+ 4. ๐Ÿšซ NO BLOAT: In package.json, include ONLY the absolute minimum dependencies to run the app (e.g., react, react-dom, react-scripts).
32
+ 5. โŒ REMOVE FALTU LIBRARIES: Strictly do NOT include @testing-library/*, web-vitals, eslintConfig, or reportWebVitals.
33
+ 6. REACT RULES: If using React, always use functional components with hooks (useState, useEffect).
31
34
 
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
+ 7. ๐Ÿง  SMART LOGIC: If the prompt says "Logic", "Algorithm", or "DSA", generate only the core logic without UI or framework code
36
+ 8. ๐Ÿงฑ COMPONENT STRUCTURE: If the prompt mentions "component", "ui", or "frontend", build a complete component with proper imports, exports, and structure.
35
37
 
36
- 7. โ›” ZERO COMMENTS: Return strictly functional code. No // or /* */ comments, and no explanations.
38
+ 9. โ›” ZERO COMMENTS: Return strictly functional code. No // or /* */ comments, and no explanations.
37
39
 
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).
40
+ 10. ๐Ÿ“ 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
41
 
40
- 9. ๐Ÿ“„ FORMAT: Return ONLY a valid JSON array of objects: [{"filename": "string", "code": "string"}].
42
+ 11. ๐Ÿ“„ FORMAT: Return ONLY a valid JSON array of objects: [{"filename": "string", "code": "string"}].
41
43
 
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.
44
+ 12. ๐Ÿšซ NO MARKDOWN: Do not wrap the response in \`\`\`json blocks.
45
+ 13. ๐Ÿงน 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.
46
+ 14. IMPORTANT: I need 'Pretty-Printed' code. Use multi-line formatting. Single-line code is strictly forbidden.
47
+ 15. ๐Ÿ› ๏ธ 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.
48
+ 16. ๐Ÿง‘โ€๐Ÿ’ป 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.
48
49
  `
49
50
  };
50
51
 
@@ -106,13 +107,13 @@ async function generateProject(prompt, directoryName) {
106
107
 
107
108
  if (typeof formattedCode === 'string') {
108
109
  formattedCode = formattedCode
109
- .replace(/\\\\/g, '\\') // Double backslash ko single banaya
110
- .replace(/\\r/g, '') // Carriage returns hatao
111
- .replace(/\\n/g, '\n') // Double backslash ko newline banao
112
- .replace(/\\t/g, ' ') // Tabs ko spaces banao
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
-
110
+ .replace(/\\\\"/g, '"') // 1. Triple escaped quotes (\\") pehle
111
+ .replace(/\\"/g, '"') // 2. Normal escaped quotes (\")
112
+ .replace(/\\r/g, '') // 3. Carriage returns hatao
113
+ .replace(/\\n/g, '\n') // 4. Newlines (Actual line breaks) ko restore karo ๐Ÿš€
114
+ .replace(/\\t/g, ' ') // 5. Tabs ko 2 spaces banao
115
+ .replace(/\\{2,}/g, '\\') // 6. Multiple backslashes ko handle karo
116
+ .replace(/\\\\/g, '\\'); // 7. Generic backslashes last mein
116
117
  }
117
118
 
118
119
  // 2. โœจ JSON Pretty-Print Fix:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mongossee",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {