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

Add code generation examples to protoc-gen-es README.md #207

Merged
merged 3 commits into from
Aug 25, 2022

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Aug 25, 2022

Preview in GitHub: README.md

@timostamm timostamm marked this pull request as ready for review August 25, 2022 16:43

```shell
npm install @bufbuild/protoc-gen-es
npm install --save-dev @bufbuild/protoc-gen-es
npm install @bufbuild/protobuf
Copy link
Member Author

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.

Comment on lines +44 to +45
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.
Copy link
Member Author

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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT, @smaye81?

Copy link
Member Author

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.

packages/protoc-gen-es/README.md Outdated Show resolved Hide resolved
packages/protoc-gen-es/README.md Outdated Show resolved Hide resolved
@timostamm timostamm merged commit f526ea6 into main Aug 25, 2022
@timostamm timostamm deleted the tstamm/update-plugin-readme branch August 25, 2022 17:36
@smaye81 smaye81 mentioned this pull request Sep 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants