It would be great if we could simply add a line to buf.gen.yaml that made the generator add a prefix to the generated types' names. For example, I would just say typesPrefix: "Pb" in the yaml file, and then for this proto enum:
enum Foo {
...
}
the generated TS code would be
export enum PbFoo {
...
}
Same for message types and their TS classes. The motivation for this request is to avoid name collisions between generated TS types and manually-written types that correspond to them. Without this feature I have to manually alias names when I import them, as in
It would be great if we could simply add a line to
buf.gen.yaml
that made the generator add a prefix to the generated types' names. For example, I would just saytypesPrefix: "Pb"
in the yaml file, and then for this proto enum:the generated TS code would be
Same for message types and their TS classes. The motivation for this request is to avoid name collisions between generated TS types and manually-written types that correspond to them. Without this feature I have to manually alias names when I import them, as in