# FrameworkDetector

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/framework-detector.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/framework-detector.ts#L31)

Framework Detector - Identifies project tech stack

## Methods

| Method | Signature | Returns |
|---|---|---|
| `detect` | `detect(repoPath: string)` | `Promise<FrameworkDetectionResult>` |

## Where it refuses work

- `FrameworkDetector` stops the work with an early return when `dependencies.has(dep)`, in 4 places.
- `FrameworkDetector` stops the work with an early return when `score >= 40`, in 2 places.
- `FrameworkDetector` stops the work with an early return when `pattern.test(sample)`, in 2 places.
- `FrameworkDetector` stops the work with an early return when `!packageJson`.
- `FrameworkDetector` stops the work with an early return when `depth > 3 || samples.length >= 50`.
- `FrameworkDetector` stops the work with an early return when `dependencies.has(lib)`.

## When something fails

- `FrameworkDetector` handles failure in 7 places: it discards it silently in 6, and turns it into a return value in 1.
