feat(analyzers): recognize NestJS projects#127
Conversation
React 19 and Next 16 added framework signals that the analyzers were not classifying yet. Keep the analyzer surface current without touching core search or indexing behavior.
We work in NestJS code often enough that treating it as generic TypeScript loses useful context. Add a dedicated analyzer for controllers, modules, providers, routes, DI, and common Nest packages so backend code gets the same first-class treatment as React and Next.js.
Large repositories were silently limited to the first 5,000 searchable chunks. Let each configured project raise that safety limit while keeping 5,000 as the default for smaller codebases. Use the same setting in MCP server and CLI reindex paths so both keyword and semantic indexes cover the same files.
Keep the auto-extracted Git history in project memory so future searches can surface the fixes and test constraints already handled in this repository.
Greptile SummaryAdds NestJS framework analysis and extends project indexing configuration.
Confidence Score: 3/5The PR should not merge until analyzer selection stops routing common NestJS providers through Angular and React pattern detection distinguishes React's The current priority ordering makes standard NestJS Files Needing Attention: src/analyzers/nestjs/index.ts, src/analyzers/react/index.ts
|
| Filename | Overview |
|---|---|
| src/analyzers/nestjs/index.ts | Adds comprehensive NestJS extraction, but its priority allows Angular's overlapping decorator detection to capture common NestJS provider files first. |
| src/analyzers/react/index.ts | Adds current React hooks and patterns, but textual detection of calls named use creates false Suspense signals. |
| src/analyzers/nextjs/index.ts | Expands App Router special-file recognition, proxy detection, and async metadata detection without an identified defect. |
| src/core/indexer.ts | Makes the existing semantic and keyword chunk cap configurable while retaining the 5,000-chunk default. |
| src/server/config.ts | Parses and validates positive integer per-project chunk limits and resolves configuration by project root. |
| src/index.ts | Registers NestJS and propagates configured chunk limits through server indexing runtime overrides. |
| src/cli.ts | Registers NestJS and loads the selected project's parsing override for direct CLI indexing. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
F[Source file] --> R[Analyzer registry]
R --> A{Highest-priority analyzer<br/>whose canAnalyze matches}
A -->|Angular priority 100| NG[Angular analysis]
A -->|Next.js priority 90| NX[Next.js analysis]
A -->|NestJS priority 85| NS[NestJS analysis]
A -->|React priority 80| RE[React analysis]
A -->|Fallback| GE[Generic analysis]
NS --> C[NestJS components and route metadata]
C --> I[Semantic and keyword indexes]
Reviews (1): Last reviewed commit: "style(indexing): Format project index ov..." | Re-trigger Greptile
| readonly version = '1.0.0'; | ||
| readonly supportedExtensions = ['.ts', '.js', '.mjs', '.cjs', '.mts', '.cts']; | ||
| readonly priority = 85; | ||
|
|
There was a problem hiding this comment.
Angular captures NestJS providers
When a NestJS file contains @Injectable(), the higher-priority Angular analyzer accepts it before this analyzer is considered, causing the file to be indexed as Angular and lose its NestJS-specific component classification and metadata.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| if (calleeName === 'use') { | ||
| usesSuspense = true; | ||
| } |
There was a problem hiding this comment.
Unbound use calls imply Suspense
When an analyzable React file calls any local or imported function named use, this name-only check marks the file as using Suspense, causing unrelated calls to pollute framework pattern statistics and search metadata.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
NestJS imports are a stronger framework signal than Angular's shared decorator names. Give the NestJS analyzer precedence so providers keep their Nest-specific classification and metadata.
A function named use is not necessarily React's API. Track the actual React import binding so local and unrelated use calls do not add hook or Suspense metadata.
|
Greptile identified two issues in this PR, and both have been fixed:
Both fixes include regression coverage. The build, formatting, typecheck, and full test suite pass with 627 tests across 87 files. |
Summary
Large repository indexing
While indexing a large Nx monorepo project, Codebase Context created more than 22,000 chunks but only kept the first 5,000 in both the semantic and keyword indexes. The limit was hardcoded in
CodebaseIndexer, so increasing chunk size would not fix the missing search coverage.This adds
projects[].parsing.maxChunksto~/.codebase-context/config.json:{ "projects": [ { "root": "/path/to/large-project", "parsing": { "maxChunks": 25000 } } ] }The default stays at 5,000 for smaller projects. A project can raise the limit when it has enough files to exceed that safety cap. The value is validated as a positive integer and is used by both indexing paths:
codebase-context reindexresolves the current root against the same server config.Verification
pnpm buildpnpm format:checkpnpm test— 624 tests passed across 87 filesmaxChunks: 25000Notes
maxChunksincreases embedding time, memory use, and local index size. The override is intentionally per project rather than a larger global default.