Protoc Plugin for TypeScript Declarations
This repository contains a protoc plugin that generates TypeScript declarations
(.d.ts files) that match the JavaScript output of protoc --js_out=import_style=commonjs,binary. This plugin can
also output service definitions as .ts files in the structure required by grpc-web.
This repository also contains a plugin for generating service definitions as .js files in the structure required by
grpc-web.
- Install this repository using
npm install ts-protoc-genor clone this repository and runnpm install && npm run build - Invoke
protocwith:--plugin- define where the plugin needed forts_outcan be found--js_out- the standard argument toprotocthat generates.jsfiles in the specified directory--ts_out- the params and directory to output to (service=trueenables outputting.tsfiles for services).- This directory must match
js_out
protoc \ --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ --js_out=import_style=commonjs,binary:generated \ --ts_out=service=true:generated \ -I ./proto \ proto/*.proto- This directory must match
- Install this repository using
npm install ts-protoc-genor clone this repository and runnpm install && npm run build - Invoke
protocwith:--plugin- define where the plugin needed forjs_service_outcan be found--js_out- the standard argument toprotocthat generates.jsfiles in the specified directory--js_service_out- define the directory to output the service definitions to.- This directory must match
js_out
protoc \ --plugin=protoc-gen-js_service=./node_modules/.bin/protoc-gen-js_service \ --js_out=import_style=commonjs,binary:generated \ --js_service_out=generated \ -I ./proto \ proto/*.proto- This directory must match
- Add tests for extensions