@hyperfrontend/project-scope/project

Project Module

The project module provides utilities for analyzing project structure, finding configuration files, reading package.json, discovering project roots, and traversing file trees.

Capabilities

Configuration Detection

Find and analyze configuration files in a project.

import { detectConfigs, findConfigFile } from '@hyperfrontend/project-scope'

// Detect all configuration files
const configs = detectConfigs('./my-project')
for (const config of configs) {
  console.log(`${config.type}: ${config.path}`)
}
// Output:
// typescript: tsconfig.json
// eslint: eslint.config.js
// jest: jest.config.ts
// prettier: .prettierrc

// Detect specific config types
const tsConfigs = detectConfigs('./my-project', ['typescript', 'eslint'])

// Find specific config file
const eslintConfig = findConfigFile('./my-project', 'eslint')
// Returns: './my-project/eslint.config.js'

Supported Config Types

Type Example Files
typescript tsconfig.json, tsconfig.*.json
eslint .eslintrc, eslint.config.js, .eslintrc.json
prettier .prettierrc, prettier.config.js
jest jest.config.ts, jest.config.js
vitest vitest.config.ts
babel babel.config.js, .babelrc
webpack webpack.config.js
vite vite.config.ts
rollup rollup.config.js
nx nx.json, project.json
docker Dockerfile, docker-compose.yml
env .env, .env.*

Package.json Utilities

Read and analyze package.json files.

import {
  readPackageJson,
  readPackageJsonIfExists,
  findNearestPackageJson,
  getDependencyVersion,
  hasDependency,
} from '@hyperfrontend/project-scope'

// Read package.json
const pkg = readPackageJson('./my-project')
console.log(pkg.name, pkg.version)
console.log(pkg.dependencies)
console.log(pkg.scripts)

// Safe reading (returns null if not found)
const pkg2 = readPackageJsonIfExists('./maybe-project')

// Find nearest package.json from any path
const pkgPath = findNearestPackageJson('./src/utils/deep/file.ts')
// Returns: './src/package.json' or '../package.json'

// Check dependencies
if (hasDependency(pkg, 'react')) {
  const version = getDependencyVersion(pkg, 'react')
  console.log('React version:', version) // '^18.2.0'
}

Root Detection

Find project and workspace roots from any path.

import { findProjectRoot, findWorkspaceRoot } from '@hyperfrontend/project-scope'

// Find project root (nearest package.json with source files)
const projectRoot = findProjectRoot('./libs/my-lib/src/utils/helper.ts')
// Returns: './libs/my-lib'

// Find workspace/monorepo root
const workspaceRoot = findWorkspaceRoot('./libs/my-lib')
// Returns: './' (root with nx.json, turbo.json, etc.)

Root Markers

Project root markers:

  • package.json (with src/ directory or entry files)
  • project.json (NX project)

Workspace root markers:

  • nx.json
  • turbo.json
  • lerna.json
  • pnpm-workspace.yaml
  • rush.json
  • package.json with workspaces field

File Traversal

Search and walk through project files.

import { findFiles, walkDirectory, walkTree } from '@hyperfrontend/project-scope'

// Find files by glob pattern
const tsFiles = findFiles('./src', '**/*.ts')
const configFiles = findFiles('./', ['*.json', '*.yaml'])

// With options
const limited = findFiles('./src', '**/*.ts', {
  maxResults: 10,
  absolutePaths: true,
  maxDepth: 5,
})

// Walk directory with callback
walkDirectory('./src', (entry) => {
  if (entry.isFile && entry.name.endsWith('.ts')) {
    console.log('Found:', entry.relativePath)
  }
  // Return 'skip' to skip directory, 'stop' to stop walking
})

// Walk virtual file system tree
walkTree(tree, tree.root, (entry) => {
  console.log(entry.path, entry.isFile ? 'file' : 'directory')
})

Interfaces

PackageJson

interface PackageJson {
  name?: string
  version?: string
  description?: string
  main?: string
  module?: string
  browser?: string
  types?: string
  bin?: string | Record<string, string>
  scripts?: Record<string, string>
  dependencies?: Record<string, string>
  devDependencies?: Record<string, string>
  peerDependencies?: Record<string, string>
  optionalDependencies?: Record<string, string>
  workspaces?: string[] | { packages: string[] }
  exports?: Record<string, unknown>
  engines?: Record<string, string>
  [key: string]: unknown
}

DetectedConfig

interface DetectedConfig {
  /** Config type (e.g., 'typescript', 'eslint') */
  type: ConfigType
  /** File path relative to root */
  path: string
  /** Pattern that matched */
  matchedPattern: string
  /** Pattern info */
  info: ConfigPatternInfo
}

DirectoryEntry

interface DirectoryEntry {
  /** File/directory name */
  name: string
  /** Full path */
  path: string
  /** Relative path from start */
  relativePath: string
  /** Is a file */
  isFile: boolean
  /** Is a directory */
  isDirectory: boolean
  /** Traversal depth */
  depth: number
}

Design Principles

  1. Caching: All detection functions cache results appropriately
  2. Safe operations: *IfExists variants return null instead of throwing
  3. Flexible patterns: Support for multiple glob patterns
  4. Depth control: Configurable traversal depth limits
  5. Cross-platform: Works on Windows, macOS, and Linux

API Reference

ƒ Functions

§function

clearConfigDetectionCache(): void

Clear the config detection cache.
Useful for testing or when the project files have changed.

Example

Clearing the config detection cache

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

// Reset cache after modifying config files
clearConfigDetectionCache()
§function

detectConfigs(rootPath: string, types?: ConfigType[], options?: DetectConfigOptions): DetectedConfig[]

Detect all configuration files in a directory.
Results are cached for 30 seconds per project path and options to avoid redundant file system operations on repeated calls.

Parameters

NameTypeDescription
§rootPath
string
Project root directory
§types?
ConfigType[]
Optional array of config types to check (defaults to all)
§options?
DetectConfigOptions
Detection options

Returns

DetectedConfig[]
Array of detected configuration files

Example

Detecting configuration files

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

// Detect all config files
const configs = detectConfigs('./my-project')
for (const config of configs) {
  console.log(`${config.type}: ${config.path}`)
}
// Output:
// typescript: tsconfig.json
// eslint: eslint.config.js
// jest: jest.config.ts

// Detect specific config types only
const tsConfigs = detectConfigs('./my-project', ['typescript', 'eslint'])
§function

findConfigFile(rootPath: string, type: ConfigType): string

Find a specific configuration file.

Parameters

NameTypeDescription
§rootPath
string
Project root directory
§type
ConfigType
Config type to find

Returns

string
Full path to config file or null if not found

Example

Finding a specific config file

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

const tsConfig = findConfigFile('/project', 'typescript')
// => '/project/tsconfig.json'

const eslint = findConfigFile('/project', 'eslint')
// => '/project/.eslintrc.js' or null if not found
§function

findDirectories(startPath: string, patterns: string | string[], options?: FindOptions): string[]

Searches a directory tree for directories matching one or more glob patterns, returning relative or absolute paths based on options.

Parameters

NameTypeDescription
§startPath
string
Root directory to begin the search
§patterns
string | string[]
Glob patterns to filter directories (supports wildcards)
§options?
FindOptions
Configuration for search behavior

Returns

string[]
List of relative directory paths that match the patterns

Example

Finding directories by pattern

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

const componentDirs = findDirectories('./src', 'components')
// => ['features/auth/components', 'features/dashboard/components']
§function

findFiles(startPath: string, patterns: string | string[], options?: FindOptions): string[]

Searches a directory tree for files matching one or more glob patterns, returning relative or absolute paths based on options.

Parameters

NameTypeDescription
§startPath
string
Root directory to begin the search
§patterns
string | string[]
Glob patterns (e.g., '.ts', '/.json') to filter files
§options?
FindOptions
Configuration for search behavior

Returns

string[]
List of relative file paths that match the patterns

Example

Finding files by pattern

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

// Find all TypeScript files
const tsFiles = findFiles('./src', '\*\*/*.ts')

// Find multiple file types
const configFiles = findFiles('./', ['\*.json', '\*.yaml', '\*.yml'])

// Limit results and get absolute paths
const first10 = findFiles('./src', '\*\*/*.ts', {
  maxResults: 10,
  absolutePaths: true
})
§function

findFilesInTree(tree: Tree, patterns: string | string[], options?: FindOptions): string[]

Searches a virtual file system tree for files matching glob patterns, useful for analyzing project structure without disk I/O.

Parameters

NameTypeDescription
§tree
Tree
In-memory virtual file system representation
§patterns
string | string[]
Glob patterns (e.g., '.ts', '/.json') to filter files
§options?
FindOptions
Configuration for search behavior

Returns

string[]
List of virtual file paths that match the patterns

Example

Finding files in a virtual tree

import { createTree, findFilesInTree } from '@hyperfrontend/project-scope'

const tree = createTree('/workspace')
const tsFiles = findFilesInTree(tree, '**/*.ts', { maxDepth: 3 })
// => ['src/index.ts', 'src/utils/helpers.ts']
§function

findGitRoot(startPath: string): string

Find nearest .git directory (repo root).

Parameters

NameTypeDescription
§startPath
string
Starting path

Returns

string
Git root path or null

Example

Finding Git repository root

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

const gitRoot = findGitRoot('./src/deep/nested/file.ts')
// => '/path/to/repository'
§function

findNearestPackageJson(startPath: string): string

Find nearest package.json by walking up the directory tree.

Parameters

NameTypeDescription
§startPath
string
Starting path

Returns

string
Path to directory containing package.json, or null if not found

Example

Finding nearest package.json

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

const pkgDir = findNearestPackageJson('./src/deep/nested/file.ts')
// => '/path/to/project'
§function

findProjectRoot(startPath: string): string

Find the project root from a starting path. Project root is the nearest directory containing package.json with source files.

Parameters

NameTypeDescription
§startPath
string
Starting path

Returns

string
Project root path or null

Example

Finding project root

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

// Find project root from current directory
const root = findProjectRoot(process.cwd())
if (root) {
  console.log('Project root:', root)
}

// Find root from a deeply nested file
const root2 = findProjectRoot('./libs/my-lib/src/utils/helper.ts')
§function

findRootDirectory(startPath: string, markers: string[] | unknown): string

Generic root finder - walk up looking for any marker file.

Parameters

NameTypeDescription
§startPath
string
Starting path
§markers
string[] | unknown
Files to search for

Returns

string
Root directory path or null

Example

Finding root by marker files

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

// Find monorepo root by looking for nx.json or lerna.json
const root = findRootDirectory('./libs/my-lib', ['nx.json', 'lerna.json'])
// => '/path/to/monorepo'
§function

findWorkspaceRoot(startPath: string): string

Find workspace root (monorepo root). Searches up for workspace markers like nx.json, turbo.json, etc.

Parameters

NameTypeDescription
§startPath
string
Starting path

Returns

string
Workspace root path or null

Example

Finding workspace root

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

const root = findWorkspaceRoot('./libs/my-lib')
if (root) {
  console.log('Monorepo root:', root) // e.g., '/home/user/my-monorepo'
}
§function

getAllDependencies(packageJson: PackageJson): DependencyMap

Get all dependencies merged into a single map.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

DependencyMap
All dependencies merged

Example

Getting all merged dependencies

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

const allDeps = getAllDependencies(packageJson)
if ('typescript' in allDeps) {
  console.log('TypeScript version:', allDeps['typescript'])
}
§function

getConfigPatternsByType(types: ConfigType[]): string[]

Get patterns for specific config types.

Parameters

NameTypeDescription
§types
ConfigType[]
Array of config types to get patterns for

Returns

string[]
Array of file patterns

Example

Retrieving config patterns by type

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

const patterns = getConfigPatternsByType(['typescript', 'eslint'])
// => ['tsconfig.json', 'tsconfig.*.json', '.eslintrc', '.eslintrc.js', ...]
§function

getDependencies(packageJson: PackageJson): AllDependencies

Extract all dependencies from package.json.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

AllDependencies
All dependencies categorized

Example

Extracting all dependencies

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

const deps = getDependencies(packageJson)
console.log('Runtime:', Object.keys(deps.dependencies))
console.log('Dev:', Object.keys(deps.devDependencies))
§function

getDependencyVersion(packageJson: PackageJson, name: string): string

Get version string of a specific dependency.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json content
§name
string
Name of the dependency to look up

Returns

string
Version string or null if not found

Example

Getting dependency version

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

const version = getDependencyVersion(packageJson, 'react')
// => '^18.2.0' or null
§function

getDevDependencies(packageJson: PackageJson): DependencyMap

Get development dependencies only.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

DependencyMap
Map of dependency name to version for dev-time dependencies

Example

Getting development dependencies

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

const devDeps = getDevDependencies(packageJson)
// => { 'jest': '^29.0.0', 'typescript': '^5.0.0' }
§function

getPeerDependencies(packageJson: PackageJson): DependencyMap

Get peer dependencies only.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

DependencyMap
Map of dependency name to version for peer requirements

Example

Getting peer dependencies

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

const peerDeps = getPeerDependencies(packageJson)
// => { 'react': '^18.0.0', 'react-dom': '^18.0.0' }
§function

getProductionDependencies(packageJson: PackageJson): DependencyMap

Get production dependencies only.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

DependencyMap
Map of dependency name to version for runtime dependencies

Example

Getting production dependencies

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

const prodDeps = getProductionDependencies(packageJson)
// => { 'express': '^4.18.0', 'lodash': '^4.17.21' }
§function

getWorkspaces(packageJson: PackageJson): string[]

Get workspace patterns from package.json.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

string[]
Array of workspace patterns or empty array

Example

Getting workspace patterns

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

const patterns = getWorkspaces(packageJson)
// => ['packages/*', 'apps/*']
§function

hasDependency(packageJson: PackageJson, name: string, depTypes?: ("dependencies" | "devDependencies" | "peerDependencies" | "optionalDependencies")[]): boolean

Check if package has a dependency of any type.

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json content
§name
string
Name of the dependency to check
§depTypes?
("dependencies" | "devDependencies" | "peerDependencies" | "optionalDependencies")[]
Optional array of dependency types to check (defaults to all)

Returns

boolean
True if dependency exists in specified categories

Example

Checking for a dependency

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

// Check any dependency type
hasDependency(packageJson, 'lodash')

// Check only production dependencies
hasDependency(packageJson, 'lodash', ['dependencies'])
§function

hasInstalledPackage(projectPath: string, packageName: string): boolean

Check if a package is installed in node_modules.

Parameters

NameTypeDescription
§projectPath
string
Project root directory
§packageName
string
Package name to check

Returns

boolean
Boolean indicating whether the package exists in node_modules

Example

Checking installed packages

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

if (hasInstalledPackage('/project', 'typescript')) {
  console.log('TypeScript is installed')
}
§function

hasWorkspaces(packageJson: PackageJson): boolean

Check if package has workspaces configured (monorepo).

Parameters

NameTypeDescription
§packageJson
PackageJson
Parsed package.json

Returns

boolean
True if workspaces are defined

Example

Checking for workspaces

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

if (hasWorkspaces(packageJson)) {
  console.log('This is a monorepo')
}
§function

parseConfig(filePath: string, type?: ConfigType): ParsedConfig

Parse configuration file.

Parameters

NameTypeDescription
§filePath
string
Path to config file
§type?
ConfigType
Optional config type (auto-detected if not provided)

Returns

ParsedConfig
Parsed configuration

Example

Parsing a configuration file

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

const tsConfig = parseConfig('/project/tsconfig.json')
const eslintConfig = parseConfig('/project/.eslintrc.yml', 'eslint')
§function

parseJsonConfig(filePath: string, content: string, type?: ConfigType, format: "json" | "jsonc"): ParsedConfig

Parse JSON configuration file.

Parameters

NameTypeDescription
§filePath
string
Path to the JSON configuration file
§content
string
Raw file content to parse
§type?
ConfigType
Category of configuration (e.g., typescript, eslint)
§format
"json" | "jsonc"
Whether to strip comments (jsonc) or parse strictly (json)
(default: 'json')

Returns

ParsedConfig
Configuration object with parsed data and extends references

Example

Parsing JSON configuration

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

const config = parseJsonConfig(
  'tsconfig.json',
  '{ "extends": "./base.json", "compilerOptions": {} }',
  'typescript'
)
// => { type: 'typescript', path: 'tsconfig.json', data: {...}, extends: ['./base.json'] }
§function

parseYamlConfig(filePath: string, content: string, type?: ConfigType): ParsedConfig

Parse YAML configuration file.

Parameters

NameTypeDescription
§filePath
string
Path to the YAML configuration file
§content
string
Raw file content to parse
§type?
ConfigType
Category of configuration (e.g., github-actions, docker-compose)

Returns

ParsedConfig
Configuration object with parsed YAML data

Example

Parsing YAML configuration

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

const config = parseYamlConfig('.github/workflows/ci.yml', yamlContent, 'github-actions')
// => { type: 'github-actions', path: '...', format: 'yaml', data: {...} }
§function

readPackageJson(projectPath: string): PackageJson

Reads and parses package.json from a directory, validating the structure and normalizing fields to the PackageJson interface.

Parameters

NameTypeDescription
§projectPath
string
Project directory path or path to package.json

Returns

PackageJson
Parsed package.json

Example

Reading package.json

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

const pkg = readPackageJson('/path/to/project')
console.log(pkg.name, pkg.version)
§function

readPackageJsonIfExists(projectPath: string): PackageJson

Attempts to read and parse package.json if it exists, returning null on missing file or parse failure.

Parameters

NameTypeDescription
§projectPath
string
Project directory path or path to package.json

Returns

PackageJson
Parsed package.json or null if not found

Example

Reading package.json if it exists

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

const pkg = readPackageJsonIfExists('/path/to/project')
if (pkg) {
  console.log('Found:', pkg.name)
}
§function

walkDirectory(startPath: string, visitor: WalkVisitor, options?: WalkOptions): void

Traverses a directory tree synchronously, calling a visitor function for each file and directory encountered. Supports depth limiting, hidden file filtering, and gitignore pattern matching.

Parameters

NameTypeDescription
§startPath
string
Root directory to begin traversal
§visitor
WalkVisitor
Callback function invoked for each file system entry
§options?
WalkOptions
Configuration for traversal behavior

Example

Walking a directory tree

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

const tsFiles: string[] = []
walkDirectory('./src', (entry) => {
  if (entry.isFile && entry.name.endsWith('.ts')) {
    tsFiles.push(entry.relativePath)
  }
}, { maxDepth: 5, respectGitignore: true })
§function

walkTree(tree: Tree, startPath: string, visitor: WalkVisitor, options?: WalkOptions): void

Traverses a virtual file system tree, calling a visitor function for each file and directory. Operates on in-memory tree structure without disk I/O.

Parameters

NameTypeDescription
§tree
Tree
In-memory virtual file system representation
§startPath
string
Root path within the tree to begin traversal
§visitor
WalkVisitor
Callback function invoked for each tree entry
§options?
WalkOptions
Configuration for traversal behavior

Example

Walking a virtual tree

import { createTree, walkTree } from '@hyperfrontend/project-scope'

const tree = createTree('/workspace')
walkTree(tree, 'src', (entry) => {
  if (entry.isDirectory) {
    console.log('Dir:', entry.relativePath)
    return 'skip' // Don't recurse into this directory
  }
})

Interfaces

§interface

AllDependencies

All dependencies categorized.

Properties

§dependencies:DependencyMap
Production dependencies
§devDependencies:DependencyMap
Development dependencies
§optionalDependencies:DependencyMap
Optional dependencies
§peerDependencies:DependencyMap
Peer dependencies
§interface

ConfigPatternInfo

Configuration pattern information.

Properties

§canExtend?:boolean
Whether config can extend others
§description:string
Human-readable description
§format?:"json" | "yaml" | "js" | "ts" | "jsonc" | "ini" | "dotenv" | "text"
Primary format (optional - auto-detected from file extension if not provided)
§patterns:string[]
File patterns to match
§sensitive?:boolean
Whether file may contain secrets
§interface

DetectConfigOptions

Options for config detection.

Properties

§includeHidden?:boolean
Include hidden directories
§maxDepth?:number
Maximum depth for recursive search
§skipCache?:boolean
Skip cache lookup (force fresh detection)
§interface

DetectedConfig

Detected configuration file.

Properties

§info:ConfigPatternInfo
Pattern info
§matchedPattern:string
Pattern that matched
§path:string
File path (relative to root)
§type:ConfigType
Config type
§interface

FindOptions

Options for file and directory search operations.

Properties

§absolutePaths?:boolean
Return absolute paths
§ignorePatterns?:string[]
Glob patterns to ignore
§includeHidden?:boolean
Include hidden files (dotfiles)
§maxDepth?:number
Maximum depth (-1 for unlimited)
§maxResults?:number
Maximum results to return
§respectGitignore?:boolean
Respect .gitignore
§interface

PackageJson

Package.json structure.

Properties

§bin?:string | Record<string, string>
Binary commands
§browser?:string
Browser entry point
§dependencies?:Record<string, string>
Production dependencies
§description?:string
Package description
§devDependencies?:Record<string, string>
Development dependencies
§engines?:Record<string, string>
Engines
§exports?:Record<string, unknown>
Exports map
§main?:string
Main entry point
§module?:string
Module entry point
§name?:string
Package name
§optionalDependencies?:Record<string, string>
Optional dependencies
§peerDependencies?:Record<string, string>
Peer dependencies
§scripts?:Record<string, string>
Scripts
§types?:string
Types entry point
§version?:string
Package version
§workspaces?:string[] | WorkspacesObject
Workspaces configuration
§interface

ParsedConfig

Result of parsing a configuration file.

Properties

§data?:Record<string, unknown>
Parsed data (for JSON/YAML formats)
§extends?:string[]
Extended config paths (if any)
§format:string
File format
§path:string
Source file path
§raw?:string
Raw content (for text formats or JS/TS configs)
§type:"unknown" | ConfigType
Config type
§interface

WalkEntry

Walk entry representing a file or directory.

Properties

§depth:number
Depth from start directory
§isDirectory:boolean
Is a directory
§isFile:boolean
Is a file
§name:string
Entry basename
§path:string
Full path
§relativePath:string
Relative path from start
§interface

WalkOptions

Configuration for directory traversal behavior.

Properties

§ignorePatterns?:string[]
Glob patterns to ignore
§includeHidden?:boolean
Include hidden files (dotfiles)
§maxDepth?:number
Maximum depth (-1 for unlimited)
§respectGitignore?:boolean
Respect .gitignore

Types

§type

ConfigType

Configuration type identifier.
type ConfigType = "package.json" | "package-lock.json" | "pnpm-lock.yaml" | "yarn.lock" | ".npmrc" | "tsconfig" | "nx" | "project.json" | "workspace.json" | "turbo" | "lerna" | "webpack" | "rollup" | "vite" | "esbuild" | "babel" | "swc" | "jest" | "vitest" | "cypress" | "playwright" | "next" | "angular" | "nuxt" | "svelte" | "astro" | "eslint" | "prettier" | "env" | ".gitignore" | ".gitattributes"
§type

DependencyMap

Map of dependency name to version.
type DependencyMap = Record<string, string>
§type

WalkVisitor

Walk visitor function.
type WalkVisitor = (entry: WalkEntry) => WalkVisitorResult
§type

WalkVisitorResult

Visitor function signature.
type WalkVisitorResult = void | "skip" | "stop"

Variables

§type

CONFIG_PATTERNS

Known configuration file patterns organized by type.
§type

ROOT_MARKERS

Files indicating project root.
§type

WORKSPACE_MARKERS

Files indicating workspace/monorepo root.