composablesys/collabs

Needed pbjs version to build?

echarles opened this issue · 2 comments

The build needs to generate code base on proto definition with eg. "build:protobuf:js": "pbjs -t static-module -w es6 -o generated_esm/proto_compiled.js find src -name '.proto'&& pbjs -t static-module -w commonjs -o generated/proto_compiled.jsfind src -name '.proto'".

I have install latest pbjs, and the build fails with

Usage: pbjs [options] <schema_path>

Options:
  -V, --version        output the version number
  --js <js_path>       Generate JavaScript code
  --ts <js_path>       Generate TypeScript code
  --es6                Generate ES6 JavaScript code
  --decode <msg_type>  Decode standard input to JSON
  --encode <msg_type>  Encode standard input to JSON
  -h, --help           output usage information

This is coherent with the documentation of pbjs on https://github.com/evanw/pbjs

Which pbjs should I install to build?

pbjs should come from the protobufjs dependency (in @collabs/collabs). So npm run build:protobuf:js or npx pbjs should work once you npm i in the repo.

It looks like the pbjs repo you linked is an unrelated protobuf project.

Thx. I was running on node14 and for some reasons some deps were not installed (correctly). I had to add a few, included the one for pbjs, which actually was not the correct.

I have rebuilt with node16 and it is now OK.

Closing this. Thx!