Skip to content
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

Merged
merged 11 commits into from Apr 5, 2024
Merged

Conversation

jackey8616
Copy link
Collaborator

@jackey8616 jackey8616 commented Apr 3, 2024

  • 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.

@jackey8616 jackey8616 requested a review from WoH April 3, 2024 16:58
@jackey8616 jackey8616 self-assigned this Apr 3, 2024
/**
* Transformer responsible to transforming native ts node into tsoa type.
*/
export abstract class Transformer {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@jackey8616 jackey8616 changed the title Refactor(resolver)/ clear logics Refactor(resolver): clear logics Apr 4, 2024
@jackey8616 jackey8616 marked this pull request as ready for review April 4, 2024 14:59
@jackey8616
Copy link
Collaborator Author

@WoH
I think we should refactor it in pieces.
This PR would only includes these commits.

@@ -0,0 +1,28 @@
import * as ts from 'typescript';
import { Tsoa } from '@tsoa/runtime';
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Co-authored-by: Wolfgang Hobmaier <wolfgang@hey.com>
@jackey8616 jackey8616 merged commit 4219d33 into master Apr 5, 2024
36 checks passed
@jackey8616 jackey8616 deleted the refactor/resolver-transformer branch April 5, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants