Skip to content

Commit

Permalink
Update invalid.yml description (#82)
Browse files Browse the repository at this point in the history
- Added a script to update all spec-based files after a change to
`typeid/typeid/spec/invalid.yml` is made.
- Updated spec files
  • Loading branch information
broothie committed Jul 7, 2023
1 parent 45e6e6e commit 62eefc0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions scripts/update_specs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! env bash

echo "Convert to JSON"
yq eval typeid/typeid/spec/valid.yml --tojson > typeid/typeid/spec/valid.json
yq eval typeid/typeid/spec/invalid.yml --tojson > typeid/typeid/spec/invalid.json

echo "Update typeid-go"
cp typeid/typeid/spec/valid.yml typeid/typeid-go/testdata/valid.yml
cp typeid/typeid/spec/invalid.yml typeid/typeid-go/testdata/invalid.yml

echo "Update typeid-js"
cat <<-TS > typeid/typeid-js/test/valid.ts
// Data copied from the valid.yml spec file
export default $(cat typeid/typeid/spec/valid.json)
TS
cat <<-TS > typeid/typeid-js/test/invalid.ts
// Data copied from the invalid.yml spec file
export default $(cat typeid/typeid/spec/invalid.json)
TS
2 changes: 1 addition & 1 deletion spec/invalid.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@
{
"name": "suffix-overflow",
"typeid": "prefix_8zzzzzzzzzzzzzzzzzzzzzzzzz",
"description": "The should encode at most 128-bits"
"description": "The suffix should encode at most 128-bits"
}
]
2 changes: 1 addition & 1 deletion spec/invalid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@
- name: suffix-overflow
# This is the first suffix that overflows into 129 bits
typeid: "prefix_8zzzzzzzzzzzzzzzzzzzzzzzzz"
description: "The should encode at most 128-bits"
description: "The suffix should encode at most 128-bits"

0 comments on commit 62eefc0

Please sign in to comment.