ts-proto
ts-proto copied to clipboard
Feature request: autogenerate index files
With protobuf.js
we used to generate all our type definitions in one big file and then we could easily re-export everything from a single index file. With ts-proto we now have nested files reflecting the structure very nicely, but manually creating index files that reflect this structure is going to be a pain. It would be nice to have an option for ts-proto to automatically generate index files that make each subdirectory a module that just re-exports everything from the files/subdirectories it contains.
I worry about the inevitable namespace collisions from messages with the same name being in different proto files, but otherwise yeah this seems like a good idea.
The solution can be more simpler I think : one file per proto package => one typescript namespace per package
@alexisvisco can you clarify that with a concrete example?
@alexisvisco please don't use Typescript namespaces. They're a completely unnecessarily relic since ES6 Modules, and support for them is very patchy.
An outputIndex
option was added in #821