Generate the browser contract from ProductApi
This commit is contained in:
parent
67cc0cb802
commit
c9642f4067
2 changed files with 2572 additions and 130 deletions
|
|
@ -18,7 +18,7 @@ for heading in \
|
|||
done
|
||||
|
||||
for ownership in \
|
||||
'| HTTP | `src/Nuthatch/Api.hs`, `src/Nuthatch/App.hs`, `src/Nuthatch/Http/Server.hs`, `src/Nuthatch/Http/Auth.hs`, `src/Nuthatch/Http/Error.hs`, `src/Nuthatch/Browse.hs`, `src/Nuthatch/Transfer.hs` | `make check-product` |' \
|
||||
'| HTTP | `src/Nuthatch/Api.hs`, `src/Nuthatch/App.hs`, `src/Nuthatch/Http/Server.hs`, `src/Nuthatch/Http/Auth.hs`, `src/Nuthatch/Http/Error.hs`, `src/Nuthatch/Http/Contract.hs`, `src/Nuthatch/Browse.hs`, `src/Nuthatch/Transfer.hs`, `web/src/generated/contract.ts`, `web/src/transport.ts` | `make check-product` |' \
|
||||
'| SQL | `sql/`, `src/Nuthatch/Db.hs`, `src/Nuthatch/Protocol.hs` | `make check-storage-foundation` |' \
|
||||
'| Identity encoding | `src/Nuthatch/Paths.hs` | `make test` |' \
|
||||
'| Content identity | `src/Nuthatch/Streaming.hs`, `src/Nuthatch/S3.hs` | `make check-streaming` |' \
|
||||
|
|
@ -35,6 +35,7 @@ for path in \
|
|||
src/Nuthatch/Config.hs \
|
||||
src/Nuthatch/Db.hs \
|
||||
src/Nuthatch/Http/Auth.hs \
|
||||
src/Nuthatch/Http/Contract.hs \
|
||||
src/Nuthatch/Http/Error.hs \
|
||||
src/Nuthatch/Http/Server.hs \
|
||||
src/Nuthatch/Paths.hs \
|
||||
|
|
@ -42,6 +43,8 @@ for path in \
|
|||
src/Nuthatch/S3.hs \
|
||||
src/Nuthatch/Streaming.hs \
|
||||
src/Nuthatch/Transfer.hs \
|
||||
web/src/generated/contract.ts \
|
||||
web/src/transport.ts \
|
||||
sql/001_initial_schema.sql \
|
||||
deploy/kubernetes/nuthatch.yaml.in \
|
||||
tests/kind/fixture/target.sh \
|
||||
|
|
|
|||
14
tests/web-contract.sh
Executable file
14
tests/web-contract.sh
Executable 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
|
||||
Loading…
Reference in a new issue