- Add vendor/scrum4me as a git submodule (read-only source of truth) - scripts/sync-schema.sh copies schema.prisma into prisma/, stripping the upstream prisma-erd-generator block we don't ship - Track the synced schema in git so a fresh clone works after 'git submodule update --init && npm install' - postinstall runs 'prisma generate' so @prisma/client is ready Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
870 B
Bash
Executable file
28 lines
870 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Sync prisma/schema.prisma from the vendored Scrum4Me submodule.
|
|
#
|
|
# Strips the `generator erd` block — that generator depends on
|
|
# prisma-erd-generator which we don't ship in this MCP package. The
|
|
# schema is otherwise byte-identical with upstream.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
SRC="$ROOT/vendor/scrum4me/prisma/schema.prisma"
|
|
DST="$ROOT/prisma/schema.prisma"
|
|
|
|
if [ ! -f "$SRC" ]; then
|
|
echo "error: $SRC not found — run 'git submodule update --init' first" >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$ROOT/prisma"
|
|
|
|
# Strip the `generator erd { ... }` block (multi-line, balanced braces).
|
|
awk '
|
|
/^generator erd \{/ { skip = 1; next }
|
|
skip && /^\}/ { skip = 0; next }
|
|
skip { next }
|
|
{ print }
|
|
' "$SRC" > "$DST"
|
|
|
|
echo "synced schema from $(cd "$ROOT/vendor/scrum4me" && git rev-parse --short HEAD) to prisma/schema.prisma"
|