-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor(resolver): clear logics #1606
Conversation
jackey8616
commented
Apr 3, 2024
•
edited
Loading
edited
- Splitting logics of TypeResolver into Transformer class.
- Clean up some nested logics in TypeResolver.
- Rewrite the flow of throwing error with throwUnless instead of if branch.
/** | ||
* Transformer responsible to transforming native ts node into tsoa type. | ||
*/ | ||
export abstract class Transformer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about the Transformers registering themselves via a shouldHandle(node) function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give me more details about it? I have no clue about shouldHandle function. Oops.
@WoH |
@@ -0,0 +1,28 @@ | |||
import * as ts from 'typescript'; | |||
import { Tsoa } from '@tsoa/runtime'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the future, we should probably remove this namespace and use a module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we decouple everything from GIGANTIC type resolver, I think we can do this.
packages/cli/src/metadataGeneration/transformer/dateTransformer.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Wolfgang Hobmaier <[email protected]>