25b80950c2 | ||
---|---|---|
.. | ||
scripts | ||
README.md | ||
lighthouse-result.proto |
README.md
How to compile protos + use locally
You'll need to have v3.7.1 of the protocol-buffer/protobuf compiler installed. (v3.7.1 is known to be compatible, and 3.11.x is known to be not compatible.).
- Install the proto compiler by either
- Brew installing -
brew install protobuf@3.7
- Manually installing from an official release. There are installation instructions, but these steps have worked well for us:
mkdir protobuf-install && cd protobuf-install curl -L -o protobuf-python-3.7.1.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-python-3.7.1.zip unzip protobuf-python-3.7.1.zip cd protobuf-3.7.1 cd python python setup.py build python setup.py test (cd .. && autogen.sh && configure && make) (cd .. && sudo make install) python setup.py build --cpp_implementation sudo python setup.py install --cpp_implementation
- Brew installing -
- Run
yarn test-proto
Proto Resources
LHR Round Trip Flow
LHR round trip flow:
(Compiling the Proto)
lighthouse_result.proto -> protoc --python_out ... -> lighthouse_result.pb2
⭏
(used by)
(Making a Round Trip JSON) ⭏
lhr.json --> proto_preprocessor.js -> lhr_processed.json -> json_roundtrip_via_proto.py -> lhr.round_trip.json
Hacking Hints
- Clean out compiled proto and json with
yarn clean
- Round trips might jumble the order of your JSON keys and lists!
- Is your
six
installation troubling yourpip install protobuf
? Mine did. Trypip install --ignore-installed six
.