Skip to content

Improve framework detection by searching subdirectories for package.json#45

Open
konard wants to merge 3 commits intolak7:mainfrom
konard:issue-43-2f06ca64e20d
Open

Improve framework detection by searching subdirectories for package.json#45
konard wants to merge 3 commits intolak7:mainfrom
konard:issue-43-2f06ca64e20d

Conversation

@konard
Copy link
Contributor

@konard konard commented Feb 2, 2026

Summary

  • When package.json is not found in the repository root directory, the code now searches subdirectories using the GitHub Git tree API (recursive)
  • Picks the shallowest package.json found in subdirectories (closest to root), which handles monorepos and nested project structures
  • Applied to both checkPackageAndFramework() in actions/reverse-architecture.ts and the import API route in src/app/api/github/import/route.ts

Problem

Previously, if package.json was not in the root directory, the framework detection would either report "Error fetching package.json" or return { isValid: false, framework: "" }, making it impossible to analyze repositories where the main application lives in a subdirectory.

Test plan

  • Test with a repository that has package.json in root (should work as before)
  • Test with a monorepo where package.json is in a subdirectory (e.g., frontend/package.json)
  • Test with a repository that has no package.json at all (should still return isValid: false)

Fixes #43

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: lak7#43
@vercel
Copy link

vercel bot commented Feb 2, 2026

@konard is attempting to deploy a commit to the lak7's projects Team on Vercel.

A member of the Team first needs to authorize it.

When package.json is not found in the repository root, use the Git tree
API to recursively search subdirectories and pick the shallowest match.
This handles monorepos and projects where the main app lives in a
subdirectory.

Fixes lak7#43

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Improve Framework Detection Improve framework detection by searching subdirectories for package.json Feb 2, 2026
@konard konard marked this pull request as ready for review February 2, 2026 20:03
@konard
Copy link
Contributor Author

konard commented Feb 2, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.349371 USD
  • Calculated by Anthropic: $0.992583 USD
  • Difference: $-0.356788 (-26.44%)
    📎 Log file uploaded as Gist (478KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Framework Detection

1 participant

Comments