feat(frameworks): add NestJS support (#220) (#225)

Detect NestJS projects and emit `route` nodes (each linked by a `references`
edge to its handler method) across all four transport layers:

- HTTP controllers: @Controller prefix joined with
  @Get/@Post/@Put/@Patch/@Delete/@Head/@Options/@All
- GraphQL resolvers: @Query/@Mutation/@Subscription
- Microservices: @MessagePattern/@EventPattern
- WebSocket gateways: @SubscribeMessage (prefixed with gateway namespace)

Detected from any @nestjs/* dependency in package.json (falls back to scanning
*.controller.ts/*.resolver.ts/*.gateway.ts). Handles class+method path joining
with empty @Controller()/@Get(), a string-aware balanced-paren arg reader so
GraphQL type thunks (@Query(() => [User])) aren't truncated, stacked decorators
(@UseGuards) when locating the handler, and disambiguates the @Query() GraphQL
method decorator from the REST @Query() param decorator (GraphQL only counts
inside @Resolver classes). Also resolves injected *Service/*Controller refs to
their classes by Nest file-naming convention.

Adds 18 framework tests; updates the README framework table and CHANGELOG.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-05-20 17:09:54 -05:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 5c6e5d5c67
commit 948b287536
5 changed files with 751 additions and 0 deletions
+3
View File
@@ -8,6 +8,7 @@ import { FrameworkResolver, ResolutionContext } from '../types';
import type { Language } from '../../types';
import { laravelResolver } from './laravel';
import { expressResolver } from './express';
import { nestjsResolver } from './nestjs';
import { reactResolver } from './react';
import { svelteResolver } from './svelte';
import { vueResolver } from './vue';
@@ -27,6 +28,7 @@ const FRAMEWORK_RESOLVERS: FrameworkResolver[] = [
laravelResolver,
// JavaScript/TypeScript
expressResolver,
nestjsResolver,
reactResolver,
svelteResolver,
vueResolver,
@@ -105,6 +107,7 @@ export function registerFrameworkResolver(resolver: FrameworkResolver): void {
// Re-export framework resolvers
export { laravelResolver, FACADE_MAPPINGS } from './laravel';
export { expressResolver } from './express';
export { nestjsResolver } from './nestjs';
export { reactResolver } from './react';
export { svelteResolver } from './svelte';
export { vueResolver } from './vue';