getprismo 0.1.8 → 0.1.9
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.
|
@@ -59,6 +59,15 @@ function detectFrameworks(root, result) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
if (pyprojectFiles.length && !frameworks.has("Python")) frameworks.add("Python");
|
|
62
|
+
const pythonFiles = [...textFiles.values()].filter((file) => file.path.endsWith(".py") && !isNonSourcePath(file.path)).slice(0, 80);
|
|
63
|
+
for (const file of pythonFiles) {
|
|
64
|
+
const text = readIfText(path.join(root, file.path), 128 * 1024) || "";
|
|
65
|
+
if (/FastAPI\s*\(|from\s+fastapi\s+import|APIRouter\s*\(/.test(text)) frameworks.add("FastAPI");
|
|
66
|
+
if (/from\s+django|import\s+django|DJANGO_SETTINGS_MODULE/.test(text)) frameworks.add("Django");
|
|
67
|
+
if (/Flask\s*\(|from\s+flask\s+import/.test(text)) frameworks.add("Flask");
|
|
68
|
+
if (/sqlalchemy|create_engine|SessionLocal/i.test(text)) frameworks.add("SQLAlchemy");
|
|
69
|
+
}
|
|
70
|
+
if (pythonFiles.length) frameworks.add("Python");
|
|
62
71
|
if ([...textFiles.keys()].some((rel) => rel.endsWith("Cargo.toml"))) frameworks.add("Rust");
|
|
63
72
|
if ([...textFiles.keys()].some((rel) => rel.endsWith("go.mod"))) frameworks.add("Go");
|
|
64
73
|
if ([...textFiles.keys()].some((rel) => rel.endsWith("docker-compose.yml") || rel.endsWith("docker-compose.yaml"))) frameworks.add("Docker");
|
|
@@ -178,10 +187,14 @@ function createOptimizeContext(rootDir = process.cwd(), scope = null) {
|
|
|
178
187
|
const frameworks = detectFrameworks(root, scan);
|
|
179
188
|
const folders = topLevelDirectories(root);
|
|
180
189
|
const entrypoints = detectEntrypoints(scan);
|
|
181
|
-
const backendDetected = folders.includes("backend") || frameworks.some((name) => ["FastAPI", "Django", "Flask"].includes(name));
|
|
182
|
-
const frontendDetected = folders.includes("frontend") || frameworks.some((name) => ["Next.js", "React", "Vite"].includes(name));
|
|
183
190
|
const backend = detectBackendPaths(scan);
|
|
184
191
|
const frontend = detectFrontendPaths(scan);
|
|
192
|
+
const backendDetected = folders.includes("backend") ||
|
|
193
|
+
frameworks.some((name) => ["FastAPI", "Django", "Flask"].includes(name)) ||
|
|
194
|
+
Boolean(backend.api.length || backend.services.length || backend.db.length || backend.auth.length);
|
|
195
|
+
const frontendDetected = folders.includes("frontend") ||
|
|
196
|
+
frameworks.some((name) => ["Next.js", "React", "Vite"].includes(name)) ||
|
|
197
|
+
Boolean(frontend.app.length || frontend.components.length || frontend.apiClient.length || frontend.state.length);
|
|
185
198
|
const warnings = [];
|
|
186
199
|
if (scan.exposedLargeFiles.length) warnings.push(`${scan.exposedLargeFiles.length} exposed large file(s) may bloat AI context.`);
|
|
187
200
|
if (!scan.hasClaudeIgnore) warnings.push(".claudeignore is missing.");
|
package/package.json
CHANGED