mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 15:01:49 +00:00
a67a96eab5
* refactor(lint): Switch to Oxlint * Update .oxlintrc.json * Fix CI --------- Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
Hex V2 Protocol Buffers
TypeScript decoders for the Hex V2 registry protocol.
Proto sources
The .proto files are copied from hexpm/specifications:
package.proto— package metadata and releasessigned.proto— signed payload wrapper
Permalink of the revision used is in the first line of each .proto file.
Code generation
The .ts files are generated from this directory:
# install protoc: https://grpc.io/docs/protoc-installation/
cd lib/modules/datasource/hex/v2
protoc \
--plugin=protoc-gen-ts_proto=$(npx -y -p ts-proto@1.178.0 which protoc-gen-ts_proto) \
--ts_proto_opt=esModuleInterop=true \
--ts_proto_opt=enumsAsLiterals=true \
--ts_proto_opt=importSuffix=.js \
--ts_proto_opt=outputEncodeMethods=decode-only \
--ts_proto_opt=outputJsonMethods=from-only \
--ts_proto_opt=outputPartialMethods=true \
--ts_proto_out=. \
package.proto signed.proto
Key options:
enumsAsLiterals— const objects instead of TS enums (required for Node.js strip-only TypeScript mode)outputEncodeMethods=decode-only— only decode, no encode (we only read registry data)outputJsonMethods=from-only— only fromJSON, no toJSON