Closed marcus-sa closed 4 months ago
Error
×Unexpected token ╭─[apps/server/src/hooks/hooks.controller.ts:14:26] 13 │ 14 │ @http.controller('hooks').middleware(HooksMiddleware) · ─ 15 │ export class HooksController { ╰────
Reproduction
import { http, HttpMiddleware } from '@deepkit/http'; export class HooksMiddleware implements HttpMiddleware { execute(): void | Promise<void> { // ... } } @http.controller('hooks').middleware(HooksMiddleware) export class HooksController {}
It seems like I need to rewrite the decorator parsing logic.
If anyone wants to give this a try ...
we need to remove the current code, add a decorator context and mimic what the TypeScript compiler is doing.
https://github.com/microsoft/TypeScript/blob/1d6d962d3132a901f5fb48be4a389c45faf5a74e/src/compiler/parser.ts#L2119-L2121
Error
Reproduction