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

Feature request: autogenerate index files #212

Closed
willclarktech opened this issue Feb 11, 2021 · 5 comments
Closed

Feature request: autogenerate index files #212

willclarktech opened this issue Feb 11, 2021 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@willclarktech
Copy link
Contributor

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.

@stephenh
Copy link
Owner

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.

@stephenh stephenh added enhancement New feature or request help wanted Extra attention is needed labels Feb 26, 2022
@alexisvisco
Copy link

The solution can be more simpler I think : one file per proto package => one typescript namespace per package

@stephenh
Copy link
Owner

@alexisvisco can you clarify that with a concrete example?

@kallangerard
Copy link

@alexisvisco please don't use Typescript namespaces. They're a completely unnecessarily relic since ES6 Modules, and support for them is very patchy.

@stephenh
Copy link
Owner

An outputIndex option was added in #821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants