Detect monorepo signals.
()
| 372 | |
| 373 | |
| 374 | def detect_monorepo() -> List[str]: |
| 375 | """Detect monorepo signals.""" |
| 376 | signals = [] |
| 377 | |
| 378 | for filename in MONOREPO_FILES: |
| 379 | if Path(filename).exists(): |
| 380 | signals.append(f"Monorepo tool detected: {filename}") |
| 381 | |
| 382 | for dirname in MONOREPO_DIRS: |
| 383 | if Path(dirname).is_dir(): |
| 384 | signals.append(f"Sub-package directory found: {dirname}/") |
| 385 | |
| 386 | # Check package.json workspaces |
| 387 | if Path("package.json").exists(): |
| 388 | try: |
| 389 | with open("package.json", 'r') as f: |
| 390 | content = f.read() |
| 391 | if '"workspaces"' in content: |
| 392 | signals.append("package.json has 'workspaces' field (npm/yarn workspaces monorepo)") |
| 393 | except Exception: |
| 394 | pass |
| 395 | |
| 396 | return signals |
| 397 | |
| 398 | |
| 399 | def detect_ci_cd_pipelines() -> List[str]: |