github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/proto/README.md (about)

     1  # SpiceDB Protocol Buffers
     2  
     3  This directory contains the definitions of [Protocol Buffers] used by SpiceDB.
     4  
     5  [Buf] is used to lint and distribute these definitions and generate source code from them.
     6  
     7  [Protocol Buffers]: https://developers.google.com/protocol-buffers/
     8  [Buf]: https://github.com/bufbuild/buf
     9  
    10  ## ⚠️ Warnings ⚠️
    11  
    12  - The `version` field found in various buf YAML configuration is actually schema of the YAML of the file and is not related to the version of the definitions.
    13  - `buf build` and `buf generate` do entirely different things.
    14     Building compiles definitions and ensures semantic validity.
    15     Generate builds and then produces actual source code according to `buf.gen.yaml`.
    16  
    17  ## Getting Started
    18  
    19  All of the following commands can be done at the root of the project thanks to the `buf.work.yaml` file.
    20  
    21  Edit the various `.proto` definition files and run the following to validate them:
    22  
    23  ```sh
    24  buf build && buf lint
    25  ```
    26  
    27  Once valid and ready to be used in source code, you can generate code by executing `buf.gen.yaml`:
    28  
    29  ```sh
    30  ./buf.gen.yaml
    31  ```