omzmarlon / ManagementApp

0 stars 0 forks source link

Write a script for typescript protobuf generation #25

Open omzmarlon opened 7 years ago

omzmarlon commented 7 years ago

currently we have to manually generate by running: $> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto $> pbts -o compiled.d.ts compiled.js

Write a script to automate this process

omzmarlon commented 7 years ago

A couple further issues with protobufjs typescript.

  1. *.proto files cannot have package keyword. Otherwise using two DTOs in one file causes runtime error. (could be incorrect importing of namespaces in ts)
  2. certain functions in generated DTO class has to be deleted, otherwise typescript compilation won't pass. (fixed. do not use @types/protobufjs. protobufjs version6.x.x has its own index.d.ts)