import os
from pathlib import Path
from typing import List

def scan_repo(directory: str = ".") -> List[str]:
    """Scans the directory and subdirectories for common files and folders."""
    common_files = [
        "package.json",
        "requirements.txt",
        "setup.py",
        "pyproject.toml",
        "main.py",
        "boot.py",
        "Makefile",
        "go.mod",
        "pom.xml",
        "Dockerfile",
        "terraform",
        "swagger.json",
        "openapi.json",
        "openapi.yaml",
        "openapi.yml",
        "*.sh"
    ]
    
    found_files = []
    path = Path(directory)
    
    # Recursive search for common files
    for item in common_files:
        if list(path.glob(f"**/{item}")):
            found_files.append(item)
    
    # Recursive search for extensions
    if list(path.glob("**/*.csproj")):
        found_files.append(".csproj")
    if list(path.glob("**/*.sln")):
        found_files.append(".sln")
    if list(path.glob("**/*.tf")):
        found_files.append("terraform")
            
    return list(set(found_files))
