-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
pbts does not generate code with correct protobufjs version #1228
Comments
Thanks for the report @taylorcode! I'm pretty sure it's hardcoded here: Lines 169 to 179 in f61b4bc
From what I see in Given that it's just a |
Thanks for your response Alexander. An option on pbts would work fine for my use case. In the stack at my company, Dropbox, we do not use NPM/Yarn to install types. Types are vendored into the repo, so I was able to just create a protobufjs/index.d.ts file that re-exports the minimal types. This ensures that when developers import protobufjs/minimal, the types match what the generated code is using. I imagine that most people do not encounter this issue, because they are using NPM/Yarn to install the types, and it is resolving the full-featured version of the types. I imagine this does not lead to any problems, since the generated code does not make use of features that are not in the minimal types. |
protobuf.js version: 6.8.8
Expected:
Using pbts with an input JS file that imports "protobufjs/minimal" should generate a .d.ts file with "protobufjs/minimal" imported.
Actual:
The .d.ts file imports from "protobufjs".
generated .js file
generated .d.ts
The text was updated successfully, but these errors were encountered: