Generate the browser contract from ProductApi

This commit is contained in:
ms2k 2026-07-20 03:20:08 +09:00
commit c9642f4067

14
tests/web-contract.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
temporary="$(mktemp -d)"
trap 'rm -rf "$temporary"' EXIT
cabal run nuthatch-generate-web-contract --offline -- \
"$temporary/contract.ts" \
"$temporary/contract.json"
cmp web/src/generated/contract.ts "$temporary/contract.ts"
cmp web/test/fixtures/contract.json "$temporary/contract.json"
cabal run nuthatch-web-contract-integration --offline