@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
string
Project directory path
§options?
IdentifyFrameworksOptions
Identification 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
string
Project directory path
§frameworkId
string
Framework identifier to check
§minConfidence
number
Minimum 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

§backend:FrameworkInfo[]
Backend frameworks
§frontend:FrameworkInfo[]
Frontend frameworks
§metaFrameworks:FrameworkInfo[]
Meta-frameworks (Next.js, Nuxt, etc.)
§primary?:FrameworkInfo
Primary framework (highest confidence)
§stack:StackSummary
Stack summary
§summary:string
Summary string (e.g., "React + Next.js with Jest")
§testing:TestingInfo[]
Testing frameworks
§interface

IdentifyFrameworksOptions

Options for framework identification.

Properties

§minConfidence?:number
Minimum confidence threshold (0-100)
§skipCache?:boolean
Skip cache lookup (force fresh detection)
§interface

StackSummary

Stack summary for a project.

Properties

§backend:string[]
Backend framework IDs
§build:string[]
Build tool IDs
§frontend:string[]
Frontend framework IDs
§linting:string[]
Linting tool IDs
§testing:string[]
Testing framework IDs
§typeSystem:string[]
Type system IDs