Open mpx2m opened 2 years ago
@mpx2m hm, yeah, that makes sense. I think that nestJs=true
is already kind of a meta-option that sets some other parameters; see around here:
https://github.com/stephenh/ts-proto/blob/main/src/options.ts#L113
If you'd like to submit a PR that adds nestJs=client
& nestJs=server
support, that'd be great.
If so, I'd suggest doing it like this PR:
https://github.com/stephenh/ts-proto/pull/512
I.e. turn the internal Options.nestJs
into an array of options.nestJs: Array<'client' | 'server'>
and then update optionsFromParameter
to watch for nestJs=true
and turn that into nestJs: ['client', 'server']
.
Thanks!
+1 for that
If there is proto like this:
after
produce
In some NestJs project, only gRPC client is implemented and generated code with
*Controller
,*ControllerMethods
related (TestServiceController
,TestServiceControllerMethods
above) are unwanted in this situation.So a flag that can be set to only generate gPRC client related code would be nice.
After set the flag, the proto file above will produce code like: