proto-loader-gen-types Typename templates
- Allow for customizing the naming pattern for both restricted and permissive types
Enums and filenames are left untouched
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: install / name: austin (49b7c5c656cbf9c6f6e5d2ce3bdf4631d1a02acf)
Can you expand some more on what your use case is for this, and also why you excluded enums?
@murgatroid99
I've found that for the majority of my use cases I'm consuming the __Output types, so it'd be nice if the consumer can determine the naming format for inputs vs outputs.
The enum is a special case because it's both a type and a value. Parent messages seem to reference the enum directly.
export interface TestMessage {
'enum'?: (test_v1_Enum | keyof typeof test_v1_Enum);
}
export interface TestMessage__Output {
'enum': (keyof typeof test_v1_Enum);
}
It might be worth treating enums like messages in that we create both an input and an output version, and the input/output parent message would point to the corresponding one. I wanted to leave that for a different PR for now.
Hey @murgatroid99 have you had a chance to look at this? I'm open to any feedback and suggestions :) thanks
@murgatroid99 Thanks for the feedback! I've addressed your comments and updated the golden tests to use the new flags. Here's the corresponding proposal PR: https://github.com/grpc/proposal/pull/326
FYI - prefixing interfaces with "I" conflicts with Hungarian notation commonly misused in other parts of the TS ecosystem. Suggest prefixing with "In"/"Out" rather than "I/O"
FYI - prefixing interfaces with "I" conflicts with Hungarian notation commonly misused in other parts of the TS ecosystem. Suggest prefixing with "In"/"Out" rather than "I/O"
It's just an example. This won't actually change any of the generated type names by default. Nevertheless if @murgatroid99 prefers different values for the golden test I can change it.
It doesn't matter to me. That test is mainly there to verify the consistency of the generator output.
@murgatroid99 How can I help push this forward?
Sorry about the delay here.
This is out in version 0.7.3