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

A way to bundle TS client stubs as an npm package #16

Open
atreya2011 opened this issue Mar 3, 2021 · 4 comments
Open

A way to bundle TS client stubs as an npm package #16

atreya2011 opened this issue Mar 3, 2021 · 4 comments

Comments

@atreya2011
Copy link

Hello and thanks for all the examples here on how to use gRPC with TypeScript. This is not an issue and actually a question.
I was wondering if there is a way to package the generated TS client stubs as an npm package (without using Rollup or Webpack or the like) that can later used via an npm install.

@badsyntax
Copy link
Owner

Hello! I can certainly see the usefulness of packaging the client stubs into a distributable npm package, and it should be pretty easy to do.
What have you tried and have you experienced any problems?

I guess it would be useful to add an example of that to this repo, but I can't promise when I will be able to do that.

@atreya2011
Copy link
Author

Thank you for the quick response. To be honest, I haven’t really tried anything yet and the only possible solution I could find was this:

improbable-eng/ts-protoc-gen#173

However the method mentioned in the link pasted above only talks about bundling generated stubs using the ts-protoc-gen plugin, so I am not sure if it is applicable for other plugins.

@atreya2011
Copy link
Author

atreya2011 commented Mar 8, 2021

An update, I can confirm that the method posted in the above link works 👍🏼 Is it ok to submit a PR to this repo?

@badsyntax
Copy link
Owner

That would be very useful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants