File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262 attempt=$((attempt + 1))
6363 done
6464
65+ # Some workshops generate React Router route types and Prisma clients for
66+ # their exercise apps here. Generate them before the root project-reference
67+ # typecheck, while allowing older workshops without this script to proceed.
68+ - name : ⚙️ Generate app artifacts
69+ run : npm run generate --if-present
70+ working-directory : ./workshop
71+
72+ # Not every workshop has TypeScript. `--if-present` skips only a missing
73+ # script; npm still returns a failure when an existing typecheck fails.
6574 - name : ʦ TypeScript
66- run : npm run typecheck
75+ run : npm run typecheck --if-present
6776 working-directory : ./workshop
6877
6978 - name : ⬣ Lint
@@ -97,7 +106,14 @@ jobs:
97106 run : |
98107 set -euo pipefail
99108 shopt -s globstar nullglob
100- schemas=(./exercises/**/*.solution.*/prisma/schema.prisma)
109+ schemas=()
110+ for schema in ./exercises/**/prisma/schema.prisma; do
111+ app_dir="${schema%/prisma/schema.prisma}"
112+ app_name="${app_dir##*/}"
113+ if [[ "$app_name" =~ ^[0-9]+\.solution(\..+)?$ ]]; then
114+ schemas+=("$schema")
115+ fi
116+ done
101117 if [ "${#schemas[@]}" -eq 0 ]; then
102118 echo "No solution-app Prisma schemas found; skipping Prisma client generation."
103119 exit 0
You can’t perform that action at this time.
0 commit comments