-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add code generation examples to protoc-gen-es README.md #207
Conversation
|
||
```shell | ||
npm install @bufbuild/protoc-gen-es | ||
npm install --save-dev @bufbuild/protoc-gen-es | ||
npm install @bufbuild/protobuf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With npm, it isn't necessary to install the runtime library explicitly. It is a peer dependency of the plugin, so npm will install it automatically. But yarn and pnpm don't, so it seems a bit clearer to add it in this example anyways.
We use peer dependencies to ensure that code generator and runtime library are | ||
compatible with each other. Note that yarn and pnpm only emit a warning in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hoping this might help a bit with the situation regarding connectrpc/connect-es#239.
"name": "your-package", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"generate": "buf generate" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT, @smaye81?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with pnpm, yarn, npm. They all add npm binaries to the $PATH.
Preview in GitHub: README.md