You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to bundle the files outputted from a generator that I have no control over since it's an npm package (proto-loader-gen-types). It basically generates typescript definitions for a protobuf file. They only compose typescript types and interfaces.
The file that I use as my entrypoint imports other files using the syntax:
The problem is that dts-bundle-generator is copying the PricingReply interface but using it later on as _provider_a_PricingReply. So it generates invalid TypeScript.
I'm adding two possible examples of expected outputs:
Ignore the alias set in the import as so that the original interface name can always be used.
Copy the interface to the bundle file with the alias name, so it will be found by TypeScript.
Hm, looks like renaming issue which was the known limitation for a while but I don't remember why it was gone from readme.
The tool doesn't follow renamings so the code of all nodes except some keywords is the same as it was originally declared.
Probably it could be done via tricks like type NewLocalName = Type for types and declare const newLocalName: typeof originalName; for classes/functions/enums/variables, but I'm not sure how tricky it would be to implement it.
Bug report
I'm trying to bundle the files outputted from a generator that I have no control over since it's an npm package (proto-loader-gen-types). It basically generates typescript definitions for a protobuf file. They only compose typescript types and interfaces.
The file that I use as my entrypoint imports other files using the syntax:
The problem is that dts-bundle-generator is copying the
PricingReply
interface but using it later on as_provider_a_PricingReply
. So it generates invalid TypeScript.I'm adding two possible examples of expected outputs:
import as
so that the original interface name can always be used.Input code
provider_a/ProviderA.ts
provider_a/PricingRequest.ts
provider_a/PricingReply.ts
Expected output (1)
Expected output (2)
Actual output
The text was updated successfully, but these errors were encountered: