Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@byndyusoft/grpc-tools
Advanced tools
A set of tools to simplify working with protobuf.js, protoc and its plugins.
Why: generating code from proto files is a rather tricky thing because various utilities (protoc itself, pbjs, etc) have a lot of various options and it is also necessary to set proper include and plugins paths. Moreover some well known proto files, such as datetime.proto, openapiv2.proto and others are the part of other repositories and packages, so in order to use them, you have to copy them to your repository every time. As a result, you ought to perform a lot of routine every time.
What: grpc-tools was created to simplify code generation and provide default include paths with well known proto files.
npm i @byndyusoft/grpc-tools
We consider that a code generation is a part of build process, which can be started locally by developer and remotely by CI/CD. So there is no need to store artifacts of the proto files building in a repos since our package is helping easily automate this process. We recommend the following usage scenario:
devDependencies
section of package.json
build
script in the scripts
section of package.json
, which describe code generation process using the commands provided by our packagenpm run build
Short description of the commands provided by our package are listed below.
Generates js files from proto files via pbjs
from protobuf.js providing default include path. Code generation can be started by command
$ js-protoc-gen -r greeter -t static-module -w commonjs --no-verify -o ./tests/generated/server/greeter_pb.js ./tests/protos/greeter.proto
Generates swagger json from proto files via protoc-gen-swagger
from grpc-gateway providing default include path. Code generation can be started by command
$ swagger-protoc-gen --swagger_opt=json_names_for_fields=true --swagger_out=logtostderr=true:./tests/generated/server/ -I ./tests/protos/ greeter.proto
To contribute, you will need to setup your local environment, see prerequisites. For the contribution and workflow guide, see package development lifecycle.
A detailed overview on how to contribute can be found in the contributing guide.
Make sure you have installed all of the following prerequisites on your development machine:
For Node.js code formatting is suggested to use prettier formatter (Visual Studio Code extension for Prettier). Shared prettier settings are saved at .prettierrc file
src/bin
- tools entry points.src/include
- well known proto files, copied from other repositories, which are generated by command npm run build:copy
. Folder is created automatically during the build process and was excluded from repository.*
- implementation of the service.bin
section package.json
src/bin
src
master
branchsrc/protos
- files on which code generation can be tested.tests/generated
— artifacts of the proto files compilation, which are generated by command npm run build
. Folder is created automatically during the build process and was excluded from repository.tests/\*.test.js
— unit test casesTests can be run using the following commands.
$ npm i
$ npm link
$ npm run build
$ npm t
@Byndyusoft/owners: https://github.com/orgs/Byndyusoft/teams/owners, github.maintain@byndyusoft.com
FAQs
A set of tools to simplify working with gRPC
We found that @byndyusoft/grpc-tools demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.