How to Parse React and Angular Legacy codebase and Generate documentation using LLM?

I’m working on a project similar to RepoAgent, which generates documentation for Python code. In their approach, they use Jedi to analyze references, imports, and dependencies, creating a dependency graph between code files.

However, I want to extend this concept to work with React and Angular codebases. I need to identify and document dependencies, components, imports, and their relationships across the codebase.

Currently, I’m trying to use Tree-sitter to parse the code and extract the required information, but I’m finding this approach quite challenging.

Can someone suggest:

  1. Better tools or libraries for analyzing React/Angular codebases?
  2. Effective methods for creating a dependency graph for JavaScript/TypeScript files?
  3. Best practices for handling large projects in this context?