Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EVOL]: Automatic JavaScript Project Architecture Detection #6

Open
helabenkhalfallah opened this issue May 26, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@helabenkhalfallah
Copy link
Owner

Automatic JavaScript Project Architecture Detection CLI

Introduction

This CLI tool automatically identifies the architecture type of a JavaScript project. While there's no foolproof method, we can use heuristics and patterns to make an educated guess. The goal is to help developers understand their codebase better.

How It Works

  1. CLI Setup:

    • Create a Node.js project for your CLI tool.
    • Use a package like commander or yargs to handle command-line arguments.
  2. Project Analysis:

    • Recursively traverse the project directory.
    • Read the content of each JavaScript file.
    • Extract relevant information (e.g., function names, class names, imports).
  3. Architecture Detection:

    • Apply heuristics based on collected data:
      • Folder Structure: Check for specific folder names associated with an architecture (e.g., controllers, models, views for MVC).
      • Naming Conventions: Analyze suffixes (e.g., Controller, ViewModel).
      • Dependency Flow: Examine how components interact.
      • Patterns: Look for event-driven communication or data binding.
  4. Heuristics and Confidence Levels:

    • Assign confidence levels to detections (e.g., "high confidence," "medium confidence," "low confidence").
    • Provide clear output indicating the detected architecture.
  5. CLI Output:

    • Display the detected architecture and any relevant details.
    • Optionally, offer suggestions for improving the architecture.
  6. Testing and Refinement:

    • Test the CLI tool on various JavaScript projects.
    • Refine heuristics based on real-world feedback.
@helabenkhalfallah helabenkhalfallah self-assigned this May 26, 2024
@helabenkhalfallah helabenkhalfallah added the enhancement New feature or request label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant