@hyperfrontend/project-scope/heuristics/framework

framework

Cross-cutting framework identification that aggregates the tech/* detectors into a single, confidence-scored picture of a project's tech stack.

identifyFrameworks runs frontend, backend, meta-framework, build, testing, linting, and monorepo detectors against the target project, then surfaces a summary string (e.g. "React + Next.js with Jest"), the highest-confidence primary framework, and per-category arrays of every detected framework with confidence and evidence. usesFramework(path, id) is a convenience predicate for asking "does this project use Vite?" without unpacking the full identification result. Cached per project path with a short TTL; pass { skipCache: true } to force fresh detection.

API Reference§

ƒ Functions

§function

clearFrameworkIdentificationCache(): void

Clear the framework identification cache.
Useful for testing or when the project files have changed.
Example

Clearing the framework cache

import { clearFrameworkIdentificationCache } from '@hyperfrontend/project-scope'

// Reset cache before re-identifying frameworks
clearFrameworkIdentificationCache()
§function

identifyFrameworks(projectPath: string, options?: IdentifyFrameworksOptions): FrameworkIdentification

Identify all frameworks in project.
Runs all technology detectors and aggregates results into a comprehensive framework identification with confidence scoring.
Parameters
NameTypeDescription
§projectPath
stringProject directory path
§options?
IdentifyFrameworksOptionsIdentification options
Returns
FrameworkIdentification
Framework identification result
Example

Identifying all frameworks in project

import { identifyFrameworks } from '@hyperfrontend/project-scope'

const result = identifyFrameworks('./my-react-app')
console.log(result.summary)      // 'React + Next.js with Jest'
console.log(result.primary?.name) // 'React'
console.log(result.stack.frontend) // ['react', 'nextjs']
console.log(result.stack.testing)  // ['jest']
§function

usesFramework(projectPath: string, frameworkId: string, minConfidence: number): boolean

Check if a project uses a specific framework.
Parameters
NameTypeDescription
§projectPath
stringProject directory path
§frameworkId
stringFramework identifier to check
§minConfidence
numberMinimum confidence threshold (default: 50)(default: 50)
Returns
boolean
True if the framework is detected with sufficient confidence
Example

Checking for a specific framework

import { usesFramework } from '@hyperfrontend/project-scope'

if (usesFramework('/path/to/project', 'react', 70)) {
  console.log('Project uses React with high confidence')
}

◈ Interfaces

§interface

FrameworkIdentification

Framework identification result.
Properties
§primary?:FrameworkInfoPrimary framework (highest confidence)
§frontend:FrameworkInfo[]Frontend frameworks
§backend:FrameworkInfo[]Backend frameworks
§testing:TestingInfo[]Testing frameworks
§metaFrameworks:FrameworkInfo[]Meta-frameworks (Next.js, Nuxt, etc.)
§summary:stringSummary string (e.g., "React + Next.js with Jest")
§stack:StackSummaryStack summary
§interface

IdentifyFrameworksOptions

Options for framework identification.
Properties
§minConfidence?:numberMinimum confidence threshold (0-100)
§skipCache?:booleanSkip cache lookup (force fresh detection)
§interface

StackSummary

Stack summary for a project.
Properties
§frontend:string[]Frontend framework IDs
§backend:string[]Backend framework IDs
§testing:string[]Testing framework IDs
§build:string[]Build tool IDs
§typeSystem:string[]Type system IDs
§linting:string[]Linting tool IDs