feat(frameworks): add NestJS support#225
Merged
Merged
Conversation
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>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #220.
Adds a
nestjsResolverto the framework-resolution registry, following the established pattern (regex-over-comment-stripped-source, emittingroutenodes +referencesedges to handler methods). NestJS is auto-detected from any@nestjs/*dependency inpackage.json(falling back to a scan of*.controller.ts/*.resolver.ts/*.gateway.ts).Coverage — all four NestJS transport layers
@Controller('cats')+@Get(':id')GET /cats/:idfindOne@Controller('cats')+@Post()POST /catscreate@Resolver()+@Query(() => [Cat])QUERY catscats@Resolver()+@Mutation()MUTATION addCataddCat@WebSocketGateway({namespace:'chat'})+@SubscribeMessage('message')WS chat:messagehandleMessage@Controllerprefix joined with@Get/@Post/@Put/@Patch/@Delete/@Head/@Options/@All, including the common empty@Controller()/@Get()cases.@Query/@Mutation/@Subscriptionin@Resolverclasses.@MessagePattern/@EventPattern.@SubscribeMessage, prefixed with the gateway namespace.Correctness details
@Query(() => [User])) aren't truncated at the inner().@UseGuards,@HttpCode) when locating the handler method.@Query()— it's both a GraphQL method decorator and a REST parameter decorator; it only counts as GraphQL inside an@Resolverclass.resolve()links injected*Service/*Controller/etc. references to their classes by Nest file-naming convention.Tests / verification
tscbuild clean.🤖 Generated with Claude Code