diff --git a/specs/Earthfile b/specs/Earthfile index e6c010f0707..537a67e7c5c 100644 --- a/specs/Earthfile +++ b/specs/Earthfile @@ -23,10 +23,21 @@ src: SAVE ARTIFACT signed_doc.json +# Regenerate the json spec file. +regenerate-json: + FROM +src + # Make sure keys are sorted so its both reproducible, AND diffs easily. + RUN cd definitions; \ + cue export -f -s ./signed_docs/docs:signed_docs --out json | jq -S > ../signed_doc.json + + SAVE ARTIFACT --keep-ts signed_doc.json + # Regenerate the full signed document specification json file. regenerate: FROM +src + COPY +regenerate-json/signed_doc.json . + # Make sure keys are sorted so its both reproducible, AND diffs easily. RUN cd definitions; \ cue export -f -s ./signed_docs/docs:signed_docs --out json | jq -S > ../signed_doc.json @@ -37,6 +48,12 @@ regenerate: SAVE ARTIFACT --keep-ts signed_doc.json SAVE ARTIFACT --keep-ts ../gen gen +regenerate-local-json: + FROM +regenerate-json + + SAVE ARTIFACT signed_doc.json AS LOCAL signed_doc.json + + regenerate-local: FROM +regenerate @@ -48,6 +65,8 @@ regenerate-local: check: FROM +src RUN cue fmt --check -s --files ./definitions + # RUN cd definitions; \ + # cue vet ./cddl RUN cd definitions; \ cue vet ./signed_docs/docs:signed_docs ../signed_doc.json diff --git a/specs/Justfile b/specs/Justfile index 632895d4009..b6ea2e8cf0d 100644 --- a/specs/Justfile +++ b/specs/Justfile @@ -3,7 +3,7 @@ # Developer convenience functions # required to get cuelang to enable file embedding -export CUE_EXPERIMENT := "embed" +export CUE_EXPERIMENT := "evalv3=0" default: @just --list --unsorted @@ -19,16 +19,14 @@ format: # Check the signed document cue files are valid. check: format - cd definitions; cue vet ./signed_docs/docs:signed_docs -c - cd definitions; cue vet ./form_template/elements:form_template -c + earthly +check # Regenerate the full signed document specification json file. regenerate-signed-doc-json: - # Make sure keys are sorted so its both reproducible, AND diffs easily. - cd definitions; cue export -f -s ./signed_docs/docs:signed_docs --out json | jq -S > ../signed_doc.json + earthly +regenerate-local-json # Fix and Check Markdown files -regenerate: check regenerate-signed-doc-json validate && validate-docs +regenerate: earthly +regenerate-local rm -rf "../docs/src/architecture/08_concepts/signed_doc" mv temp_gen "../docs/src/architecture/08_concepts/signed_doc"