@@ -117,3 +117,112 @@ validate-docs-go:
117117validate-docs-cs :
118118 @ echo " === Validating C# documentation ==="
119119 @ cd scripts/ docs-validation && npm run validate:cs
120+
121+ # Build all scenario samples (all languages)
122+ scenario-build :
123+ #!/usr/bin/env bash
124+ set -euo pipefail
125+ echo " === Building all scenario samples ==="
126+ TOTAL=0; PASS=0; FAIL=0
127+
128+ build_lang() {
129+ local lang=" $1" find_expr=" $2" build_cmd=" $3"
130+ echo " "
131+ echo " ── $lang ──"
132+ while IFS= read -r target; do
133+ [ -z " $target" ] && continue
134+ dir=$(dirname " $target" )
135+ scenario=" ${dir#test/scenarios/}"
136+ TOTAL=$((TOTAL + 1 ))
137+ if (cd " $dir" && eval " $build_cmd" >/ dev/ null 2 >&1 ); then
138+ printf " ✅ %s\n " " $scenario"
139+ PASS=$((PASS + 1 ))
140+ else
141+ printf " ❌ %s\n " " $scenario"
142+ FAIL=$((FAIL + 1 ))
143+ fi
144+ done < <(find test/ scenarios $find_expr | sort)
145+ }
146+
147+ # TypeScript: npm install
148+ (cd nodejs && npm ci --ignore-scripts --silent 2 >/ dev/ null) || true
149+ build_lang " TypeScript" " -path '*/typescript/package.json'" " npm install --ignore-scripts"
150+
151+ # Python: syntax check
152+ build_lang " Python" " -path '*/python/main.py'" " python3 -c \" import ast; ast.parse(open('main.py').read())\" "
153+
154+ # Go: go build
155+ build_lang " Go" " -path '*/go/go.mod'" " go build ./..."
156+
157+ # C#: dotnet build
158+ build_lang " C#" " -name '*.csproj' -path '*/csharp/*'" " dotnet build --nologo -v quiet"
159+
160+ echo " "
161+ echo " ══════════════════════════════════════"
162+ echo " Scenario build summary: $PASS passed, $FAIL failed (of $TOTAL)"
163+ echo " ══════════════════════════════════════"
164+ [ " $FAIL" -eq 0 ]
165+
166+ # Run the full scenario verify orchestrator (build + E2E, needs real CLI)
167+ scenario-verify :
168+ @ echo " === Running scenario verification ==="
169+ @ bash test/ scenarios/ verify.sh
170+
171+ # Build scenarios for a single language (typescript, python, go, csharp)
172+ scenario-build-lang LANG :
173+ #!/usr/bin/env bash
174+ set -euo pipefail
175+ echo " === Building {{ LANG}} scenarios ==="
176+ PASS=0; FAIL=0
177+
178+ case " {{ LANG}} " in
179+ typescript)
180+ (cd nodejs && npm ci --ignore-scripts --silent 2 >/ dev/ null) || true
181+ for target in $(find test/ scenarios -path ' */typescript/package.json' | sort); do
182+ dir=$(dirname " $target" ); scenario=" ${dir#test/scenarios/}"
183+ if (cd " $dir" && npm install --ignore-scripts >/ dev/ null 2 >&1 ); then
184+ printf " ✅ %s\n " " $scenario" ; PASS=$((PASS + 1 ))
185+ else
186+ printf " ❌ %s\n " " $scenario" ; FAIL=$((FAIL + 1 ))
187+ fi
188+ done
189+ ;;
190+ python)
191+ for target in $(find test/ scenarios -path ' */python/main.py' | sort); do
192+ dir=$(dirname " $target" ); scenario=" ${dir#test/scenarios/}"
193+ if python3 -c " import ast; ast.parse(open('$target').read())" 2 >/ dev/ null; then
194+ printf " ✅ %s\n " " $scenario" ; PASS=$((PASS + 1 ))
195+ else
196+ printf " ❌ %s\n " " $scenario" ; FAIL=$((FAIL + 1 ))
197+ fi
198+ done
199+ ;;
200+ go)
201+ for target in $(find test/ scenarios -path ' */go/go.mod' | sort); do
202+ dir=$(dirname " $target" ); scenario=" ${dir#test/scenarios/}"
203+ if (cd " $dir" && go build ./ ... >/ dev/ null 2 >&1 ); then
204+ printf " ✅ %s\n " " $scenario" ; PASS=$((PASS + 1 ))
205+ else
206+ printf " ❌ %s\n " " $scenario" ; FAIL=$((FAIL + 1 ))
207+ fi
208+ done
209+ ;;
210+ csharp)
211+ for target in $(find test/ scenarios -name ' *.csproj' -path ' */csharp/*' | sort); do
212+ dir=$(dirname " $target" ); scenario=" ${dir#test/scenarios/}"
213+ if (cd " $dir" && dotnet build --nologo -v quiet >/ dev/ null 2 >&1 ); then
214+ printf " ✅ %s\n " " $scenario" ; PASS=$((PASS + 1 ))
215+ else
216+ printf " ❌ %s\n " " $scenario" ; FAIL=$((FAIL + 1 ))
217+ fi
218+ done
219+ ;;
220+ *)
221+ echo " Unknown language: {{ LANG}} . Use: typescript, python, go, csharp"
222+ exit 1
223+ ;;
224+ esac
225+
226+ echo " "
227+ echo " {{ LANG}} scenarios: $PASS passed, $FAIL failed"
228+ [ " $FAIL" -eq 0 ]
0 commit comments