Kind: Class
Source: atloria-monorepo/libs/parser-core/src/detector/project-detector.ts
ProjectDetector class
Detects project type, frameworks, package manager, and build tools by analyzing project structure and configuration files.
Methods
| Method | Signature | Returns |
|---|---|---|
detect | detect(rootDir: string) | Promise<DetectedProject> |
addFrameworkRule | addFrameworkRule(rule: FrameworkRule) | void |
getFrameworkRules | getFrameworkRules() | FrameworkRule[] |
hasFramework | hasFramework(rootDir: string, frameworkName: string) | Promise<boolean> |
supportsParser | supportsParser(rootDir: string, parserName: string) | Promise<boolean> |
Where it refuses work
ProjectDetectorstops the work withErrorwhen!fs.existsSync(absoluteRootDir).ProjectDetectorstops the work with an early return whendepth >= maxDepth, in 3 places.ProjectDetectorstops the work with an early return when!fs.existsSync(packageJsonPath).ProjectDetectorstops the work with an early return whenfs.existsSync(path.join(rootDir, 'bun.lockb')).ProjectDetectorstops the work with an early return whenfs.existsSync(path.join(rootDir, 'pnpm-lock.yaml')).ProjectDetectorstops the work with an early return whenfs.existsSync(path.join(rootDir, 'yarn.lock')).
When something fails
ProjectDetectorhandles failure in 5 places: it discards it silently in 4, and turns it into a return value in 1.
Was this page helpful?