sigstore-js
sigstore-js copied to clipboard
set-up codegen from sigstore bundle protobufs
Signed-off-by: Brian DeHamer [email protected]
Summary
Adds some plumbing to automatically codegen types for the sigstore bundle format from the published protobufs.
Types can be re-generated by executing the following:
npm run codegen:bundle
The generated types are written to src/bundle/__generated__
.
Release Note
- New script in
package.json
for re-generating bundle types from their protobufs
cc @kommendorkapten @patflynn generating TypeScript types from the protobufs in https://github.com/sigstore/cosign/pull/2204
@bdehamer just force pushed as I forgot to add sig-off info on the commits.
@eddiezane 👋 gentle bump, did you have any ideas for improvements here?
@feelepxyz thanks for working on this. I took what you did and refactored a bit:
- Moved the script and Dockerfile into a new
hack
directory (I think this was one of the things @eddiezane had suggested) - That bit where the same script was being used to initiate the
docker build
and also served as the entrypoint of the container was a bit too 🤯 for my simple brain. I split these two responsibilities into separate scripts that I think are a bit easier to grok. - I moved the retrieval of the cosign proto files out of the Dockerfile and back into the
generate-bundle-types
script. This way, the image we're building becomes a general-purpose protoc wrapper that we can re-use if we find that we need to do more protobuf codegen in the future.