Switch to JSON Schema rather than protobuf
Some checks failed
Generate and Release Protos / release (push) Failing after 9s

This commit is contained in:
2026-01-07 17:23:56 +00:00
parent a17e7a5290
commit 04ed0ede29
5 changed files with 86 additions and 43 deletions

26
scripts/build.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -e
# Create clean output directories
rm -rf gen && mkdir -p gen/ts gen/go/models
# Find all .json files
FILES=$(find schemas -name "*.json")
# Initialize the TypeScript Barrel File
echo "// Auto-generated barrel file" > gen/ts/index.ts
for file in $FILES; do
# Get a clean name (e.g., data-ingress_pis-mapping)
clean_name=$(echo "${file#schemas/}" | sed 's/\//_/g' | sed 's/\.json//g')
# Output to one folder and add to index
npx --yes json-schema-to-typescript "$file" > "gen/ts/${clean_name}.ts"
echo "export * from './${clean_name}.js';" >> gen/ts/index.ts
# Generate Go
go-jsonschema -p models "$file" > "gen/go/models/${clean_name}.go"
done
echo "✅ Generated single TS package in gen/ts"
echo "✅ Generated single Go package in gen/go/models"