/ concept-collection / stan-web-ide
Sign in
concept-collection / stan-web-ide
stan-web-ide / scripts / typecheck.sh
21 lines · 844 BCodeBlameHistory
21efcb6stan web IDE: run Stan sampling in the browserJeremy Magland 1#!/usr/bin/env bash
2# Typecheck the app. Diagnostics inside the minwebide vendor tree (VS Code
3# source) are reported as a count only — they stem from TS-version and
4# ambient-type differences with VS Code's own build and never affect the
5# bundle. Errors in the app's own code fail the check.
6set -uo pipefail
8ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9OUTPUT="$(cd "$ROOT" && npx tsc --noEmit --pretty false 2>&1)"
11VENDOR_COUNT="$(printf '%s\n' "$OUTPUT" | grep -cE '/vendor/vscode/' || true)"
12OURS="$(printf '%s\n' "$OUTPUT" | grep -vE '/vendor/vscode/|^ ' | grep -v '^$' || true)"
14if [ -n "$VENDOR_COUNT" ] && [ "$VENDOR_COUNT" != "0" ]; then
15 echo "note: $VENDOR_COUNT vendor diagnostics suppressed (run 'npx tsc --noEmit' to see them)"
16fi
17if [ -n "$OURS" ]; then
18 printf '%s\n' "$OURS"
19 exit 1
20fi
21echo "typecheck OK"
moveopenescclose