@hyperfrontend/project-scope/techTech Module
The tech module provides comprehensive technology stack detection for JavaScript/TypeScript projects. It identifies frontend frameworks, backend frameworks, build tools, testing frameworks, type systems, linting tools, and legacy frameworks.
Capabilities
Detect All Technologies
Run all detectors at once for a complete technology stack analysis.
import { detectAll } from '@hyperfrontend/project-scope'
const detections = detectAll('./my-project')
// Frontend frameworks (React, Vue, Angular, Svelte, etc.)
for (const fw of detections.frontendFrameworks) {
console.log(`${fw.name} v${fw.version} (${fw.confidence}% confidence)`)
if (fw.metaFrameworks) {
console.log(
' Meta-frameworks:',
fw.metaFrameworks.map((m) => m.name)
)
}
}
// Backend frameworks (Express, NestJS, Fastify, etc.)
console.log(
'Backend:',
detections.backendFrameworks.map((f) => f.name)
)
// Build tools (Webpack, Vite, esbuild, etc.)
console.log(
'Build tools:',
detections.buildTools.map((t) => t.name)
)
// Testing frameworks (Jest, Vitest, Cypress, etc.)
console.log(
'Testing:',
detections.testingFrameworks.map((t) => `${t.name} (${t.type})`)
)
// Type system (TypeScript, Flow)
console.log(
'Types:',
detections.typeSystem.map((t) => t.name)
)
// Linting (ESLint, Prettier, Biome)
console.log(
'Linting:',
detections.linting.map((t) => t.name)
)
// Legacy frameworks (jQuery, AngularJS, Backbone)
console.log(
'Legacy:',
detections.legacyFrameworks.map((t) => t.name)
)
Frontend Framework Detection
import { frameworkDetectors, reactDetector, vueDetector } from '@hyperfrontend/project-scope'
// Use individual detectors
const react = reactDetector('./my-app')
if (react) {
console.log('React detected:', react.version)
console.log('Meta-frameworks:', react.metaFrameworks) // Next.js, Gatsby, Remix
}
// All frontend detectors
for (const detector of frameworkDetectors) {
const result = detector.detect('./my-app')
if (result) {
console.log(`${detector.name}: ${result.confidence}%`)
}
}
Supported Frontend Frameworks
| Framework | Meta-frameworks | Detection Sources |
|---|---|---|
| React | Next.js, Gatsby, Remix | react, react-dom packages |
| Vue | Nuxt | vue package, .vue files |
| Angular | @angular/core package |
|
| Svelte | SvelteKit | svelte package, .svelte files |
| Solid | solid-js package |
|
| Qwik | @builder.io/qwik package |
|
| Astro | astro package |
Backend Framework Detection
import { backendDetectors } from '@hyperfrontend/project-scope'
const detections = backendDetectors.map((d) => d.detect('./my-api')).filter(Boolean)
for (const detection of detections) {
console.log(`${detection.name} (${detection.type})`) // 'Express (http-server)'
}
Supported Backend Frameworks
| Framework | Type | Detection Sources |
|---|---|---|
| Express | http-server | express package |
| NestJS | framework | @nestjs/core package |
| Fastify | http-server | fastify package |
| Koa | http-server | koa package |
| Hono | http-server | hono package |
Build Tool Detection
import { buildToolDetectors } from '@hyperfrontend/project-scope'
for (const detector of buildToolDetectors) {
const result = detector.detect('./my-project')
if (result) {
console.log(`${result.name}: ${result.configPath}`)
}
}
Supported Build Tools
| Tool | Detection Sources |
|---|---|
| Webpack | webpack package, webpack.config.* files |
| Vite | vite package, vite.config.* files |
| esbuild | esbuild package |
| Rollup | rollup package, rollup.config.* files |
| Parcel | parcel package |
| SWC | @swc/core package |
| Babel | @babel/core package, babel.config.* files |
Testing Framework Detection
import { testingDetectors } from '@hyperfrontend/project-scope'
const tests = testingDetectors.map((d) => d.detect('./my-project')).filter(Boolean)
for (const test of tests) {
console.log(`${test.name} (${test.type})`) // 'Jest (unit)', 'Cypress (e2e)'
}
Supported Testing Frameworks
| Framework | Type | Detection Sources |
|---|---|---|
| Jest | unit | jest package, jest.config.* files |
| Vitest | unit | vitest package, vitest.config.* files |
| Mocha | unit | mocha package |
| Cypress | e2e | cypress package, cypress/ directory |
| Playwright | e2e | @playwright/test package |
Monorepo Tool Detection
import { monorepoDetectors } from '@hyperfrontend/project-scope'
for (const detector of monorepoDetectors) {
const result = detector.detect('./')
if (result) {
console.log(`Monorepo: ${result.name}`)
}
}
Supported Monorepo Tools
| Tool | Detection Sources |
|---|---|
| NX | nx.json, @nx/workspace package |
| Turborepo | turbo.json, turbo package |
| Lerna | lerna.json, lerna package |
| Rush | rush.json |
| PNPM Workspaces | pnpm-workspace.yaml |
Detection Result Structure
All detections follow a common structure:
interface BaseDetection {
/** Unique identifier (lowercase) */
id: string
/** Human-readable name */
name: string
/** Detected version (from package.json) */
version?: string
/** Confidence score 0-100 */
confidence: number
/** How the detection was made */
detectedFrom: DetectionSource[]
}
interface DetectionSource {
type: 'package.json' | 'config-file' | 'directory' | 'file-pattern'
field?: string // For package.json
path?: string // For files
}
Caching
Detection results are cached for 60 seconds:
// Use cached results (default)
const result1 = detectAll('./my-project')
// Force fresh detection
const result2 = detectAll('./my-project', { skipCache: true })
Confidence Scoring
Confidence scores reflect detection reliability:
| Range | Meaning |
|---|---|
| 90-100 | Very high confidence (explicit package + config) |
| 70-89 | High confidence (package dependency present) |
| 50-69 | Medium confidence (config file or patterns) |
| 30-49 | Low confidence (indirect signals) |
| 0-29 | Very low confidence (heuristics only) |
API Reference
ƒ Functions
Useful for testing or when the project files have changed.
Example
Clearing the tech detection cache
import { detectAll, clearTechDetectionCache } from '@hyperfrontend/project-scope'
// Initial detection (cached)
const first = detectAll('./my-project')
// After modifying package.json, clear cache to re-detect
clearTechDetectionCache()
const fresh = detectAll('./my-project')detectAll(projectPath: string, packageJsonOrOptions?: PackageJson | DetectAllOptions): AllDetections
Results are cached for 60 seconds per project path to avoid redundant file system operations on repeated calls.
Parameters
Returns
AllDetectionsExample
Running all tech detectors
import { detectAll } from '@hyperfrontend/project-scope'
const detections = detectAll('./my-project')
// Check frontend frameworks
for (const fw of detections.frontendFrameworks) {
console.log(`${fw.name} v${fw.version} (${fw.confidence}% confidence)`)
}
// Check build tools
console.log('Build tools:', detections.buildTools.map(t => t.name))
// Check testing frameworks
console.log('Testing:', detections.testingFrameworks.map(t => t.name))Parameters
Returns
FrameworkDetectionExample
Detecting Angular framework
const result = angularDetector('/path/to/angular-app', {
dependencies: { '@angular/core': '^17.0.0', '@angular/cli': '^17.0.0' }
})
// => {
// id: 'angular',
// name: 'Angular',
// category: 'frontend',
// version: '17.0.0',
// confidence: 85,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.@angular/core' },
// { type: 'package.json', field: 'dependencies.@angular/cli' }
// ]
// }angularJSDetector(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection
Parameters
Returns
LegacyFrameworkDetectionExample
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', ... }Parameters
Returns
FrameworkDetectionExample
Detecting Astro framework
const result = astroDetector('/path/to/astro-project', {
dependencies: { 'astro': '^4.0.0' }
})
// => {
// id: 'astro',
// name: 'Astro',
// category: 'meta-framework',
// version: '4.0.0',
// confidence: 70,
// detectedFrom: [{ type: 'package.json', field: 'dependencies.astro' }]
// }Parameters
Returns
BuildToolDetectionExample
Detecting Babel compiler
const result = babelDetector('/path/to/project', {
name: 'my-app',
devDependencies: { '@babel/core': '^7.23.0', '@babel/preset-env': '^7.23.0' }
})
// => {
// id: 'babel',
// name: 'Babel',
// version: '7.23.0',
// confidence: 60,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.@babel/core' },
// { type: 'package.json', field: 'dependencies (@babel packages)' }
// ]
// }Parameters
Returns
LegacyFrameworkDetectionExample
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', ... }Parameters
Returns
LintingToolDetectionExample
Detecting Biome linter
const result = biomeDetector('/path/to/project', {
devDependencies: { '@biomejs/biome': '^1.5.0' },
})
// => { id: 'biome', name: 'Biome', confidence: 70, version: '1.5.0', ... }Parameters
Returns
TestingFrameworkDetectionExample
Detecting Cypress testing framework
import { cypressDetector } from '@hyperfrontend/project-scope'
const result = cypressDetector('./my-project')
if (result) {
console.log(`Cypress ${result.version} detected (${result.confidence}% confidence)`)
// => "Cypress 13.6.0 detected (95% confidence)"
}detectBackendFrameworks(projectPath: string, packageJson?: PackageJson): BackendDetection[]
Parameters
Returns
BackendDetection[]Example
Detecting multiple backend frameworks
const pkg = {
dependencies: { '@nestjs/core': '^10.0.0', '@nestjs/common': '^10.0.0' },
devDependencies: { express: '^4.18.0' },
}
const results = detectBackendFrameworks('/path/to/project', pkg)
// => [
// { id: 'nestjs', name: 'NestJS', confidence: 85, ... },
// { id: 'express', name: 'Express', confidence: 80, ... },
// ]Parameters
Returns
BuildToolDetection[]Example
Detecting multiple build tools
const tools = detectBuildTools('/path/to/project', {
name: 'my-app',
devDependencies: {
'vite': '^5.0.0',
'@vitejs/plugin-react': '^4.0.0',
'@babel/core': '^7.23.0'
}
})
// => [
// { id: 'vite', name: 'Vite', version: '5.0.0', confidence: 70, ... },
// { id: 'babel', name: 'Babel', version: '7.23.0', confidence: 50, ... }
// ]detectFrontendFrameworks(projectPath: string, packageJson?: PackageJson): FrameworkDetection[]
Parameters
Returns
FrameworkDetection[]Example
Detecting multiple frontend frameworks
const frameworks = detectFrontendFrameworks('/path/to/nextjs-app', {
dependencies: { 'react': '^18.0.0', 'next': '^14.0.0' }
})
// => [
// { id: 'nextjs', name: 'Next.js', category: 'meta-framework', confidence: 70, ... },
// { id: 'react', name: 'React', category: 'frontend', confidence: 60, ... }
// ]detectLegacyFrameworks(projectPath: string, packageJson?: PackageJson): LegacyFrameworkDetection[]
Parameters
Returns
LegacyFrameworkDetection[]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 }]Parameters
Returns
LintingToolDetection[]Example
Detecting multiple linting tools
const results = detectLintingTools('/path/to/project', {
devDependencies: { eslint: '^8.0.0', prettier: '^3.0.0' },
})
// => [{ id: 'eslint', confidence: 50 }, { id: 'prettier', confidence: 50 }]Parameters
Returns
MonorepoDetection[]Example
Detecting monorepo tools
const detections = detectMonorepoTools('/path/to/project')
// => [
// { id: 'nx', name: 'NX', confidence: 90, configPath: 'nx.json', detectedFrom: [...] },
// { id: 'npm-workspaces', name: 'npm Workspaces', confidence: 80, ... }
// ]detectTestingFrameworks(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection[]
Parameters
Returns
TestingFrameworkDetection[]Example
Detecting multiple testing frameworks
import { detectTestingFrameworks } from '@hyperfrontend/project-scope'
const frameworks = detectTestingFrameworks('./my-project')
// => [
// { id: 'jest', name: 'Jest', type: 'unit', confidence: 95, ... },
// { id: 'cypress', name: 'Cypress', type: 'e2e', confidence: 85, ... }
// ]
// Results are sorted by confidence (highest first)
const primary = frameworks[0]?.name ?? 'None'
console.log(`Primary testing framework: ${primary}`)Parameters
Returns
TypeSystemDetection[]Example
Detecting all type systems
import { detectTypeSystems } from '@hyperfrontend/project-scope'
const typeSystems = detectTypeSystems('./my-project')
// => [
// { id: 'typescript', name: 'TypeScript', version: '5.3.0', strictMode: true, confidence: 95, ... },
// { id: 'jsdoc', name: 'JSDoc', confidence: 40, ... }
// ]
const primary = typeSystems[0]?.name ?? 'None'
console.log(`Primary type system: ${primary}`)Parameters
Returns
LegacyFrameworkDetectionExample
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', ... }Parameters
Returns
BuildToolDetectionExample
Detecting esbuild bundler
const result = esbuildDetector('/path/to/project', {
name: 'my-lib',
devDependencies: { 'esbuild': '^0.19.0' },
scripts: { 'build': 'esbuild src/index.ts --bundle --outfile=dist/index.js' }
})
// => {
// id: 'esbuild',
// name: 'esbuild',
// version: '0.19.0',
// confidence: 80,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.esbuild' },
// { type: 'package.json', field: 'scripts.build' }
// ]
// }Parameters
Returns
LintingToolDetectionExample
Detecting ESLint linter
const result = eslintDetector('/path/to/project', {
devDependencies: { eslint: '^8.50.0', '@typescript-eslint/parser': '^6.0.0' },
scripts: { lint: 'eslint src/' },
})
// => { id: 'eslint', name: 'ESLint', confidence: 65, version: '8.50.0', ... }Parameters
Returns
BackendDetectionExample
Detecting Express framework
const pkg = {
dependencies: { express: '^4.18.2', cors: '^2.8.5' },
devDependencies: { '@types/express': '^4.17.17' },
}
const result = expressDetector('/path/to/project', pkg)
// => {
// id: 'express',
// name: 'Express',
// version: '4.18.2',
// confidence: 100,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.express' },
// { type: 'package.json', field: 'dependencies.@types/express' },
// { type: 'package.json', field: 'dependencies (express middleware)' },
// ],
// }Parameters
Returns
BackendDetectionExample
Detecting Fastify framework
const pkg = {
dependencies: { fastify: '^4.24.0', '@fastify/cors': '^8.4.0' },
}
const result = fastifyDetector('/path/to/project', pkg)
// => {
// id: 'fastify',
// name: 'Fastify',
// version: '4.24.0',
// confidence: 95,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.fastify' },
// { type: 'package.json', field: 'dependencies (fastify plugins)' },
// ],
// }Parameters
Returns
TypeSystemDetectionExample
Detecting Flow type system
import { flowDetector } from '@hyperfrontend/project-scope'
const result = flowDetector('./my-project')
if (result) {
console.log(`Flow ${result.version} with config: ${result.configPath}`)
// => "Flow 0.232.0 with config: .flowconfig"
}Parameters
Returns
FrameworkDetectionExample
Detecting Gatsby framework
const result = gatsbyDetector('/path/to/gatsby-blog', {
dependencies: {
'gatsby': '^5.0.0',
'gatsby-plugin-image': '^3.0.0',
'gatsby-source-filesystem': '^5.0.0'
}
})
// => {
// id: 'gatsby',
// name: 'Gatsby',
// category: 'meta-framework',
// version: '5.0.0',
// confidence: 75,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.gatsby' },
// { type: 'package.json', field: 'dependencies (gatsby plugins)' }
// ]
// }Parameters
Returns
BackendDetectionExample
Detecting Hono framework
const pkg = {
dependencies: { hono: '^3.11.0', '@hono/node-server': '^1.3.0' },
}
const result = honoDetector('/path/to/project', pkg)
// => {
// id: 'hono',
// name: 'Hono',
// version: '3.11.0',
// confidence: 100,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.hono' },
// { type: 'package.json', field: 'dependencies (@hono adapters)' },
// ],
// }Parameters
Returns
TestingFrameworkDetectionExample
Detecting Jest testing framework
import { jestDetector } from '@hyperfrontend/project-scope'
const result = jestDetector('./my-project')
if (result) {
console.log(`Jest ${result.version} detected`)
console.log('Sources:', result.detectedFrom.map(s => s.type))
// => "Sources: ['package.json', 'config-file']"
}Parameters
Returns
LegacyFrameworkDetectionExample
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', ... }Parameters
Returns
TypeSystemDetectionExample
Detecting JSDoc type annotations
import { jsdocDetector } from '@hyperfrontend/project-scope'
const result = jsdocDetector('./my-project')
if (result) {
console.log('JSDoc types detected')
console.log('Sources:', result.detectedFrom.map(s => s.path ?? s.field))
// => "Sources: ['jsconfig.json', 'src/utils.js (JSDoc annotations)']"
}Parameters
Returns
BackendDetectionExample
Detecting Koa framework
const pkg = {
dependencies: { koa: '^2.14.2', 'koa-router': '^12.0.0' },
devDependencies: { '@types/koa': '^2.13.9' },
}
const result = koaDetector('/path/to/project', pkg)
// => {
// id: 'koa',
// name: 'Koa',
// version: '2.14.2',
// confidence: 100,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.koa' },
// { type: 'package.json', field: 'dependencies.@types/koa' },
// { type: 'package.json', field: 'dependencies (koa middleware)' },
// ],
// }Parameters
Returns
MonorepoDetectionExample
Detecting Lerna monorepo
// Project with lerna.json config file
const result = lernaDetector('/path/to/lerna-project')
// => {
// id: 'lerna',
// name: 'Lerna',
// confidence: 80,
// configPath: 'lerna.json',
// detectedFrom: [{ type: 'config-file', path: 'lerna.json' }]
// }Parameters
Returns
TestingFrameworkDetectionExample
Detecting Mocha testing framework
import { mochaDetector } from '@hyperfrontend/project-scope'
const result = mochaDetector('./my-project')
if (result) {
console.log(`Mocha ${result.version} detected (${result.confidence}%)`)
// => "Mocha 10.2.0 detected (95%)"
}Parameters
Returns
BackendDetectionExample
Detecting NestJS framework
// Project with nest-cli.json and NestJS packages
const pkg = {
dependencies: {
'@nestjs/core': '^10.2.0',
'@nestjs/common': '^10.2.0',
'@nestjs/platform-express': '^10.2.0',
},
}
const result = nestDetector('/path/to/nest-project', pkg)
// => {
// id: 'nestjs',
// name: 'NestJS',
// version: '10.2.0',
// configPath: 'nest-cli.json', // if present
// confidence: 100,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.@nestjs/core' },
// { type: 'package.json', field: 'dependencies.@nestjs/common' },
// { type: 'config-file', path: 'nest-cli.json' },
// { type: 'package.json', field: 'dependencies (@nestjs packages)' },
// ],
// }Parameters
Returns
FrameworkDetectionExample
Detecting Next.js framework
const result = nextjsDetector('/path/to/nextjs-app', {
dependencies: { 'next': '^14.0.0', 'react': '^18.0.0' }
})
// => {
// id: 'nextjs',
// name: 'Next.js',
// category: 'meta-framework',
// version: '14.0.0',
// confidence: 70,
// detectedFrom: [{ type: 'package.json', field: 'dependencies.next' }]
// }Parameters
Returns
MonorepoDetectionExample
Detecting npm workspaces
// Project with workspaces in package.json and package-lock.json
const result = npmWorkspacesDetector('/path/to/npm-project')
// => {
// id: 'npm-workspaces',
// name: 'npm Workspaces',
// confidence: 90,
// configPath: 'package.json',
// detectedFrom: [
// { type: 'package.json', field: 'workspaces' },
// { type: 'lockfile', path: 'package-lock.json' }
// ]
// }Parameters
Returns
FrameworkDetectionExample
Detecting Nuxt framework
const result = nuxtDetector('/path/to/nuxt-app', {
dependencies: { 'nuxt': '^3.0.0', 'vue': '^3.0.0' }
})
// => {
// id: 'nuxt',
// name: 'Nuxt',
// category: 'meta-framework',
// version: '3.0.0',
// confidence: 70,
// detectedFrom: [{ type: 'package.json', field: 'dependencies.nuxt' }]
// }Parameters
Returns
MonorepoDetectionExample
Detecting NX workspace
// Project with nx.json and apps/libs directories
const result = nxDetector('/path/to/nx-workspace')
// => {
// id: 'nx',
// name: 'NX',
// confidence: 100,
// configPath: 'nx.json',
// version: '17.0.0',
// workspaceLayout: { appsDir: 'apps', libsDir: 'libs' },
// detectedFrom: [
// { type: 'config-file', path: 'nx.json' },
// { type: 'package.json', field: 'dependencies.nx' },
// { type: 'directory', path: 'apps/ or libs/' }
// ]
// }Parameters
Returns
BuildToolDetectionExample
Detecting Parcel bundler
const result = parcelDetector('/path/to/project', {
name: 'my-app',
devDependencies: { 'parcel': '^2.10.0' },
scripts: { 'dev': 'parcel src/index.html', 'build': 'parcel build src/index.html' }
})
// => {
// id: 'parcel',
// name: 'Parcel',
// version: '2.10.0',
// confidence: 80,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.parcel' },
// { type: 'package.json', field: 'scripts.dev' },
// { type: 'package.json', field: 'scripts.build' }
// ]
// }playwrightDetector(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection
Parameters
Returns
TestingFrameworkDetectionExample
Detecting Playwright testing framework
import { playwrightDetector } from '@hyperfrontend/project-scope'
const result = playwrightDetector('./my-project')
if (result) {
console.log(`Playwright ${result.version} (${result.type} tests)`)
// => "Playwright 1.42.0 (e2e tests)"
}Parameters
| Name | Type | Description |
|---|---|---|
§workspacePath | string | Workspace directory path |
Returns
MonorepoDetectionExample
Detecting pnpm workspaces
// Project with pnpm-workspace.yaml
const result = pnpmWorkspacesDetector('/path/to/pnpm-project')
// => {
// id: 'pnpm-workspaces',
// name: 'pnpm Workspaces',
// confidence: 100,
// configPath: 'pnpm-workspace.yaml',
// detectedFrom: [
// { type: 'config-file', path: 'pnpm-workspace.yaml' },
// { type: 'lockfile', path: 'pnpm-lock.yaml' }
// ]
// }Parameters
Returns
LintingToolDetectionExample
Detecting Prettier formatter
const result = prettierDetector('/path/to/project', {
devDependencies: { prettier: '^3.0.0' },
scripts: { format: 'prettier --write .' },
})
// => { id: 'prettier', name: 'Prettier', confidence: 55, version: '3.0.0', ... }Parameters
Returns
FrameworkDetectionExample
Detecting Qwik framework
const result = qwikDetector('/path/to/qwik-app', {
dependencies: {
'@builder.io/qwik': '^1.0.0',
'@builder.io/qwik-city': '^1.0.0'
}
})
// => {
// id: 'qwik',
// name: 'Qwik',
// category: 'frontend',
// version: '1.0.0',
// confidence: 90,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.@builder.io/qwik' },
// { type: 'package.json', field: 'dependencies.@builder.io/qwik-city' }
// ]
// }Parameters
Returns
FrameworkDetectionExample
Detecting React library
const result = reactDetector('/path/to/react-app', {
dependencies: { 'react': '^18.0.0', 'react-dom': '^18.0.0' }
})
// => {
// id: 'react',
// name: 'React',
// category: 'frontend',
// version: '18.0.0',
// confidence: 80,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.react' },
// { type: 'package.json', field: 'dependencies.react-dom' }
// ]
// }Parameters
Returns
FrameworkDetectionExample
Detecting Remix framework
const result = remixDetector('/path/to/remix-app', {
dependencies: {
'@remix-run/react': '^2.0.0',
'@remix-run/node': '^2.0.0'
}
})
// => {
// id: 'remix',
// name: 'Remix',
// category: 'meta-framework',
// version: '2.0.0',
// confidence: 90,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.@remix-run/react' },
// { type: 'package.json', field: 'dependencies.@remix-run/*' }
// ]
// }Parameters
Returns
BuildToolDetectionExample
Detecting Rollup bundler
const result = rollupDetector('/path/to/project', {
name: 'my-lib',
devDependencies: {
'rollup': '^4.0.0',
'@rollup/plugin-node-resolve': '^15.0.0',
'@rollup/plugin-commonjs': '^25.0.0'
}
})
// => {
// id: 'rollup',
// name: 'Rollup',
// version: '4.0.0',
// confidence: 65,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.rollup' },
// { type: 'package.json', field: 'dependencies (rollup plugins)' }
// ]
// }Parameters
Returns
MonorepoDetectionExample
Detecting Rush monorepo
// Project with rush.json config file
const result = rushDetector('/path/to/rush-project')
// => {
// id: 'rush',
// name: 'Rush',
// confidence: 90,
// configPath: 'rush.json',
// detectedFrom: [{ type: 'config-file', path: 'rush.json' }]
// }Parameters
Returns
FrameworkDetectionExample
Detecting Solid.js framework
const result = solidDetector('/path/to/solid-app', {
dependencies: { 'solid-js': '^1.8.0', 'vite-plugin-solid': '^2.0.0' }
})
// => {
// id: 'solid',
// name: 'Solid',
// category: 'frontend',
// version: '1.8.0',
// confidence: 90,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.solid-js' },
// { type: 'package.json', field: 'dependencies.vite-plugin-solid' }
// ]
// }Parameters
Returns
LintingToolDetectionExample
Detecting Stylelint linter
const result = stylelintDetector('/path/to/project', {
devDependencies: { stylelint: '^15.0.0', 'stylelint-config-standard': '^30.0.0' },
})
// => { id: 'stylelint', name: 'Stylelint', confidence: 65, version: '15.0.0', ... }Parameters
Returns
FrameworkDetectionExample
Detecting Svelte framework
const result = svelteDetector('/path/to/svelte-app', {
devDependencies: { 'svelte': '^4.0.0' }
})
// => {
// id: 'svelte',
// name: 'Svelte',
// category: 'frontend',
// version: '4.0.0',
// confidence: 70,
// detectedFrom: [{ type: 'package.json', field: 'dependencies.svelte' }]
// }Parameters
Returns
FrameworkDetectionExample
Detecting SvelteKit framework
const result = sveltekitDetector('/path/to/sveltekit-app', {
devDependencies: { '@sveltejs/kit': '^2.0.0', 'svelte': '^4.0.0' }
})
// => {
// id: 'sveltekit',
// name: 'SvelteKit',
// category: 'meta-framework',
// version: '2.0.0',
// confidence: 70,
// detectedFrom: [{ type: 'package.json', field: 'dependencies.@sveltejs/kit' }]
// }Parameters
Returns
BuildToolDetectionExample
Detecting SWC compiler
const result = swcDetector('/path/to/project', {
name: 'my-app',
devDependencies: { '@swc/core': '^1.3.0', '@swc/cli': '^0.1.0' }
})
// => {
// id: 'swc',
// name: 'SWC',
// version: '1.3.0',
// confidence: 70,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.@swc/core' },
// { type: 'package.json', field: 'dependencies.@swc/cli' }
// ]
// }Parameters
Returns
MonorepoDetectionExample
Detecting Turborepo monorepo
// Project with turbo.json and turbo dependency
const result = turborepoDetector('/path/to/turbo-project')
// => {
// id: 'turborepo',
// name: 'Turborepo',
// confidence: 95,
// configPath: 'turbo.json',
// version: '2.0.0',
// detectedFrom: [
// { type: 'config-file', path: 'turbo.json' },
// { type: 'package.json', field: 'dependencies.turbo' }
// ]
// }Parameters
Returns
TypeSystemDetectionExample
Detecting TypeScript
import { typescriptDetector } from '@hyperfrontend/project-scope'
const result = typescriptDetector('./my-project')
if (result) {
console.log(`TypeScript ${result.version}`)
console.log(`Strict mode: ${result.strictMode ?? 'unknown'}`)
// => "TypeScript 5.3.0"
// => "Strict mode: true"
}Parameters
Returns
BuildToolDetectionExample
Detecting Vite build tool
const result = viteDetector('/path/to/project', {
name: 'my-app',
devDependencies: {
'vite': '^5.0.0',
'@vitejs/plugin-react': '^4.0.0',
'vitest': '^1.0.0'
}
})
// => {
// id: 'vite',
// name: 'Vite',
// version: '5.0.0',
// confidence: 80,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.vite' },
// { type: 'package.json', field: 'dependencies.vitest' },
// { type: 'package.json', field: 'dependencies (vite plugins)' }
// ]
// }Parameters
Returns
TestingFrameworkDetectionExample
Detecting Vitest testing framework
import { vitestDetector } from '@hyperfrontend/project-scope'
const result = vitestDetector('./my-project')
if (result) {
console.log(`Vitest ${result.version} detected`)
console.log('Config:', result.configPath)
// => "Config: vitest.config.ts"
}Parameters
Returns
FrameworkDetectionExample
Detecting Vue.js framework
const result = vueDetector('/path/to/vue-app', {
dependencies: { 'vue': '^3.0.0', '@vue/cli-service': '^5.0.0' }
})
// => {
// id: 'vue',
// name: 'Vue',
// category: 'frontend',
// version: '3.0.0',
// confidence: 85,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.vue' },
// { type: 'package.json', field: 'dependencies.@vue/cli-service' }
// ]
// }Parameters
Returns
BuildToolDetectionExample
Detecting Webpack bundler
const result = webpackDetector('/path/to/project', {
name: 'my-app',
devDependencies: { 'webpack': '^5.89.0', 'webpack-cli': '^5.1.0' },
scripts: { 'build': 'webpack --mode production' }
})
// => {
// id: 'webpack',
// name: 'Webpack',
// version: '5.89.0',
// confidence: 65,
// detectedFrom: [
// { type: 'package.json', field: 'dependencies.webpack' },
// { type: 'package.json', field: 'dependencies.webpack-cli' },
// { type: 'package.json', field: 'scripts.build' }
// ]
// }yarnWorkspacesDetector(workspacePath: string, packageJson?: PackageJson): MonorepoDetection
Parameters
Returns
MonorepoDetectionExample
Detecting yarn workspaces
// Project with workspaces in package.json and yarn.lock
const result = yarnWorkspacesDetector('/path/to/yarn-project')
// => {
// id: 'yarn-workspaces',
// name: 'Yarn Workspaces',
// confidence: 100,
// configPath: 'package.json',
// detectedFrom: [
// { type: 'package.json', field: 'workspaces' },
// { type: 'lockfile', path: 'yarn.lock' },
// { type: 'config-file', path: '.yarnrc.yml' }
// ]
// }◈ Interfaces
Properties
legacyFrameworks:LegacyFrameworkDetection[]—