protobuf.js icon indicating copy to clipboard operation
protobuf.js copied to clipboard

pbjs/pbts-generated namespaces

Open jsw opened this issue 8 years ago • 3 comments

protobuf.js version: 6.8.0

Is there any way to not generate nested namespaces based on the proto package name, and have the types at the top-level?

If not, can a cli and/or file-level proto option be added?

jsw avatar Oct 18 '17 01:10 jsw

I also need this :)

paralin avatar Sep 21 '18 08:09 paralin

plusch011 avatar Jun 23 '22 07:06 plusch011

Any progress on this ? I also would like this feature.

gabdusch avatar Sep 03 '22 09:09 gabdusch

+1

typescript offical document

To reiterate why you shouldn’t try to namespace your module contents, the general idea of namespacing is to provide logical grouping of constructs and to prevent name collisions. Because the module file itself is already a logical grouping, and its top-level name is defined by the code that imports it, it’s unnecessary to use an additional module layer for exported objects.

Maybe we need file to file 1:1 transform?

hxsf avatar Mar 16 '23 06:03 hxsf