@hyperfrontend/project-scope/tech/legacy

legacy

Legacy-framework detectors for projects still on pre-modern stacks.

Covers AngularJS (1.x), Backbone, Ember, and jQuery. Each <framework>Detector follows the shared LegacyFrameworkDetector contract; detectLegacyFrameworks runs them all and returns the aggregate LegacyFrameworkDetection[]. Useful for migration-planning tools that need to flag projects still depending on these frameworks before recommending modernization paths.

API Reference

ƒ Functions

§function

angularJSDetector(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection

Detect AngularJS (1.x) in project. AngularJS is the original Angular framework, distinct from Angular 2+.

Parameters

NameTypeDescription
§projectPath
string
Project directory path
§packageJson?
PackageJson
Optional pre-loaded package.json

Returns

LegacyFrameworkDetection
Detection result or null if not detected

Example

Detecting AngularJS framework

const result = angularJSDetector('/path/to/project', {
  dependencies: { angular: '^1.8.0', 'angular-route': '^1.8.0' },
})
// => { id: 'angularjs', name: 'AngularJS', confidence: 85, version: '1.8.0', ... }
§function

backboneDetector(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection

Detect Backbone.js in project.

Parameters

NameTypeDescription
§projectPath
string
Project directory path
§packageJson?
PackageJson
Optional pre-loaded package.json

Returns

LegacyFrameworkDetection
Detection result or null if not detected

Example

Detecting Backbone.js framework

const result = backboneDetector('/path/to/project', {
  dependencies: { backbone: '^1.4.0', underscore: '^1.13.0' },
})
// => { id: 'backbone', name: 'Backbone.js', confidence: 85, version: '1.4.0', ... }
§function

detectLegacyFrameworks(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection[]

Detect all legacy frameworks in project.

Parameters

NameTypeDescription
§projectPath
string
Project directory path
§packageJson?
PackageJson
Optional pre-loaded package.json

Returns

LegacyFrameworkDetection[]
Array of detected legacy frameworks, sorted by confidence

Example

Detecting legacy frameworks

const results = detectLegacyFrameworks('/path/to/project', {
  dependencies: { jquery: '^3.6.0', backbone: '^1.4.0' },
})
// => [{ id: 'jquery', confidence: 80 }, { id: 'backbone', confidence: 70 }]
§function

emberDetector(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection

Detect Ember.js in project.

Parameters

NameTypeDescription
§projectPath
string
Project directory path
§packageJson?
PackageJson
Optional pre-loaded package.json

Returns

LegacyFrameworkDetection
Detection result or null if not detected

Example

Detecting Ember.js framework

const result = emberDetector('/path/to/project', {
  dependencies: { 'ember-source': '^4.0.0' },
  devDependencies: { 'ember-cli': '^4.0.0' },
})
// => { id: 'ember', name: 'Ember.js', confidence: 90, version: '4.0.0', ... }
§function

jqueryDetector(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection

Detect jQuery in project.

Parameters

NameTypeDescription
§projectPath
string
Project directory path
§packageJson?
PackageJson
Optional pre-loaded package.json

Returns

LegacyFrameworkDetection
Detection result or null if not detected

Example

Detecting jQuery library

const result = jqueryDetector('/path/to/project', {
  dependencies: { jquery: '^3.6.0', 'jquery-ui': '^1.13.0' },
})
// => { id: 'jquery', name: 'jQuery', confidence: 90, version: '3.6.0', ... }

Interfaces

§interface

LegacyFrameworkDetection

Legacy framework detection result.

Properties

§category:"legacy-frontend"
Framework category
§confidence:number
Detection confidence (0-100)
§detectedFrom:DetectionSource[]
Detection sources
§id:string
Framework identifier
§name:string
Human-readable name
§version?:string
Detected version
§interface

LegacyFrameworkDetector

Legacy framework detector interface.

Properties

§category:"legacy-frontend"
Framework category
§id:string
Framework identifier
§name:string
Human-readable name

Variables

§type

legacyDetectors

All legacy framework detectors