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

feat(rpc): make controller decorator name optional #491

Merged
merged 9 commits into from
Nov 9, 2023

Conversation

marcus-sa
Copy link
Contributor

@marcus-sa marcus-sa commented Oct 21, 2023

Summary of changes

Use case: not having to explicitly specify a name for a controller
https://github.com/marcus-sa/ngkit/blob/main/apps/example-cli/src/app.controller.ts

Relinquishment of Rights

Please mark following checkbox to confirm that you relinquish all rights of your changes:

  • I waive and relinquish all rights regarding this changes (including code, text, and images) to Deepkit UG (limited), Germany. This changes (including code, text, and images) are under MIT license without name attribution, copyright notice, and permission notice requirement.

The rpc controller metadata name would then default to the name of the class

Signed-off-by: Marcus S. Abildskov <[email protected]>
Signed-off-by: Marcus S. Abildskov <[email protected]>
Signed-off-by: Marcus S. Abildskov <[email protected]>
@marcus-sa marcus-sa changed the title feat(rpc): make controller decorator name or definition optional feat(rpc): make controller decorator name optional Oct 21, 2023
Signed-off-by: Marcus S. Abildskov <[email protected]>
Signed-off-by: Marcus S. Abildskov <[email protected]>
Signed-off-by: Marcus S. Abildskov <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2023

Codecov Report

Merging #491 (feb9889) into master (dd08c77) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head feb9889 differs from pull request most recent head 589c79e. Consider uploading reports for the commit 589c79e to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master     #491      +/-   ##
==========================================
+ Coverage   78.25%   78.26%   +0.01%     
==========================================
  Files         186      186              
  Lines       19761    19763       +2     
  Branches     5082     5083       +1     
==========================================
+ Hits        15463    15467       +4     
+ Misses       4298     4296       -2     
Files Coverage Δ
packages/rpc/src/decorators.ts 89.09% <100.00%> (+4.18%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Marcus S. Abildskov <[email protected]>
@marcus-sa marcus-sa marked this pull request as ready for review October 21, 2023 15:02
@marcj marcj merged commit 525ed39 into deepkit:master Nov 9, 2023
4 of 5 checks passed
@marcj
Copy link
Member

marcj commented Nov 9, 2023

Thanks!

@marcus-sa
Copy link
Contributor Author

marcus-sa commented Nov 9, 2023

Thanks!

@marcj what do you think about adding a reusable function for getting the name of a class type?

function getClassTypeName(classType: ClassType): string {
	return reflect(classType).typeName || classType.name;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants