| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | # eval "$(pkgx --shellcode)" |
| 6 | root=$(git rev-parse --show-toplevel) |
| 7 | |
| 8 | function main() { |
| 9 | pushd ${root} |
| 10 | # env +go |
| 11 | # env +buf |
| 12 | # env +npm |
| 13 | # env +npx |
| 14 | # env +node@20 |
| 15 | |
| 16 | generate_peg |
| 17 | generate_protobuf |
| 18 | } |
| 19 | |
| 20 | function generate_protobuf() { |
| 21 | # npm install \ |
| 22 | # --save-dev \ |
| 23 | # @connectrpc/connect \ |
| 24 | # @connectrpc/connect-web \ |
| 25 | # @connectrpc/connect-query \ |
| 26 | # @connectrpc/protoc-gen-connect-es \ |
| 27 | # @bufbuild/protoc-gen-es \ |
| 28 | # @bufbuild/buf |
| 29 | |
| 30 | # pkgx go install google.golang.org/protobuf/cmd/protoc-gen-go@latest |
| 31 | # pkgx go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest |
| 32 | |
| 33 | export PATH=${PATH}:${root}/node_modules/.bin |
| 34 | pkgx buf format -w |
| 35 | pkgx buf generate |
| 36 | } |
| 37 | |
| 38 | function generate_peg() { |
| 39 | go install github.com/pointlander/peg@latest |
| 40 | peg ${root}/go/pkg/logql/grammar.peg |
| 41 | } |
| 42 | |
| 43 | main |