fix: prevent Python/Java backend projects from being detected as web …#56
fix: prevent Python/Java backend projects from being detected as web …#56oscaruiz wants to merge 4 commits into
Conversation
|
@oscaruiz is attempting to deploy a commit to the midudev pro Team on Vercel. A member of the Team first needs to authorize it. |
|
¡Hola! Muchas gracias por la PR, se nota el trabajo de análisis del problema y la solución está bien pensada. El bug es real y molesto — un proyecto Flask/Django no debería sugerir skills de frontend-design o SEO solo por tener templates El approach de Dejo algunos comentarios para considerar: 1. Falta un test para el caso base: proyecto solo HTML/CSS sin backendLa refactorización mueve el file scan fuera de it("detects frontend from .html files when no backend stack is present", () => {
writeFile(tmp.path, "index.html", "<!DOCTYPE html><html></html>");
writeFile(tmp.path, "style.css", "body { margin: 0 }");
const { isFrontend } = detectTechnologies(tmp.path);
strictEqual(isFrontend, true);
});2. Edge case: Python + frontend vanilla (sin npm)Si alguien tiene un proyecto Flask como API junto con un directorio No creo que sea un blocker porque es un caso poco común, y el trade-off es correcto (el falso positivo actual es mucho más frecuente que este falso negativo). Pero estaría bien documentarlo con un comentario junto a 3.
|
Address review feedback on midudev#56: - Add regression test verifying that pure HTML/CSS projects without any backend stack are still detected as frontend, ensuring the refactor of hasWebFrontendFiles() out of detectTechnologiesInDir() did not break the happy path. - Document BACKEND_ONLY_IDS with a JSDoc block covering the known false-negative trade-off (backend + vanilla frontend) and noting that the set is extensible to other backend template engines.
d6a0e8c to
3e0536b
Compare
|
Gracias por la review, aplicados los tres puntos en 3e0536b:
Aprovecho que la rama también se rebaseó sobre el último Sobre el edge case del punto 2: si te parece útil, puedo abrir un issue Cualquier cosa que necesite ajuste, dime :) |
…nd-false-frontend # Conflicts: # packages/autoskills/lib.ts # packages/autoskills/skills-map.ts
|
Buenas, He mergeado con lo último de main para adaptar el fix a la migración a TypeScript. La lógica es idéntica, los cambios son:
Ficheros tocados (solo 4, mismos que antes):
342 tests pasando, 0 fallos. He testeado también manualmente con algún proyecto de Python. Lo dicho, cualquier cosa que necesite ajuste, dime :) |
What Changed
SKILLS_MAPvia config files (requirements.txt,pyproject.toml,setup.py,manage.py, etc.) withskills: []BACKEND_ONLY_IDSset inskills-map.mjsto classify backend-only stacks (python, java, springboot)detectTechnologies(): frontend file scan now runs once at the end, only when no frontend packages and no backend-only stack are detectedisFrontendByFilesandskipFrontendFilesfromdetectTechnologiesInDir()Why This Change
Fixes #48. Python backend projects (Flask, Django) containing
.htmltemplates and.cssstatic files were incorrectly classified as web frontend, causing autoskills to suggest frontend-only skills (frontend-design, accessibility, seo).Complementary to #17 which adds Python ecosystem skills. This PR focuses on the bug fix. If #17 merges first, this branch can rebase and drop the
pythonentry.Testing Done
Type of Change
fix:Bug fixfeat:New featurerefactor:Code refactoringdocs:Documentationtest:Testschore:Maintenance/toolingSecurity & Quality Checklist
Documentation