Skip to content

feat: add BSR plugin configuration and documentation#49

Open
allenday wants to merge 1 commit intodatachainlab:masterfrom
allenday:feat/bsr-distribution
Open

feat: add BSR plugin configuration and documentation#49
allenday wants to merge 1 commit intodatachainlab:masterfrom
allenday:feat/bsr-distribution

Conversation

@allenday
Copy link

feat: add BSR plugin configuration and documentation

Summary

  • Add buf.plugin.yaml for Buf Schema Registry (BSR) compatibility
  • Include comprehensive BSR integration documentation
  • Provide examples for modern protobuf toolchain integration

Changes

BSR Plugin Configuration

  • Added buf.plugin.yaml with complete plugin metadata
  • Defined runtime requirements (Python + protobuf>=4.25.1 + wrapt)
  • Specified plugin dependencies (protocolbuffers/protobuf, bufbuild/protovalidate)
  • Proper license and source attribution

Documentation Enhancements

  • Added "BSR Plugin Configuration" section to README
  • Provided buf.gen.yaml examples for local development
  • Documented all plugin options and parameters
  • Integration examples for common use cases

Modern Toolchain Support

  • Better integration with buf-based workflows
  • Simplified plugin configuration and usage
  • Standardized metadata format for BSR distribution

Technical Details

Files Added:

  • buf.plugin.yaml - BSR plugin configuration file

Files Modified:

  • README.md - Added BSR configuration documentation

Plugin Metadata:

  • Name: buf.build/datachainlab/protoc-gen-solidity
  • Version: v1.0.0
  • Runtime: Python with protobuf>=4.25.1, wrapt
  • Dependencies: protocolbuffers/protobuf, bufbuild/protovalidate
  • License: Apache-2.0

Configuration Examples

Local Development buf.gen.yaml

version: v2
plugins:
  - local: ["python", "protobuf-solidity/src/protoc/plugin/gen_sol.py"]
    out: contracts/generated
    opt: gen_runtime=true

Plugin Options Documented

  • gen_runtime=true - Generate runtime libraries
  • gen_runtime=CustomRuntime.sol - Custom runtime filename
  • solc_version=0.8.19 - Target Solidity version
  • for_linking - Enable library linking mode
  • pb_libname=Custom - Custom library name prefix

Test Plan

  • Verify buf.plugin.yaml validates against BSR schema
  • Test local buf.gen.yaml configuration works correctly
  • Confirm plugin options are properly documented
  • Validate metadata accuracy and completeness

Attribution

All references properly attribute the original datachainlab/solidity-protobuf project and maintain original licensing and source information.

Impact

Modernizes the plugin for distribution via BSR, making it easier to integrate with buf-based protobuf workflows and improving overall developer experience.

- Add buf.plugin.yaml for Buf Schema Registry distribution
- Include plugin metadata, dependencies, and runtime requirements
- Add comprehensive BSR integration documentation
- Provide buf.gen.yaml examples for local development
- Document plugin options and configuration parameters
- Respect original datachainlab project attribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant