crosscode: Events 3.0 builds auth-client; tests on real Postgres

- scripts/products/events.sh: packages/auth-client is installed and built
  (after contracts) when Events uses it, as 3.0.0 does; without it a 3.0
  deploy would fail at the first sign-in through Accounts. bats test.
- test:accounts runs on real Postgres for both apps with
  EVENTS_TEST_DATABASE_URL and ACCOUNTS_TEST_DATABASE_URL (14/14); the
  Accounts test harness takes a real Prisma client.
- e2e/excel.spec.ts resolves excelts from the backend (hoisted in the
  monorepo), so the e2e suite loads again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 14:45:17 +02:00
co-authored by Claude Opus 5.5
parent be5b56673a
commit cbd7965fcc
5 changed files with 43 additions and 18 deletions
+3 -2
View File
@@ -31,11 +31,12 @@ events_backup() {
.catch(e => { console.error(" Backup failed: " + e.message); process.exit(1); });'
}
# The shared packages this checkout's Events uses (from 2.4.0: contracts and seo), built before it.
# The shared packages this checkout's Events uses (from 2.4.0: contracts and seo; from 3.0.0:
# auth-client, built after contracts, which it uses), built before it.
# Only the ones in the checkout, so going back to an older tag still installs and builds.
events_shared_packages() {
local p
for p in packages/contracts packages/seo; do
for p in packages/contracts packages/auth-client packages/seo; do
if [ -f "$1/$p/package.json" ] && grep -q "\"@crosscode/${p#packages/}\"" "$1/apps/events/backend/package.json" "$1/apps/events/frontend/package.json" 2>/dev/null; then
printf '%s\n' "$p"
fi
+13 -1
View File
@@ -15,8 +15,9 @@ setup() {
checkout() {
local dir="$TMP/$1"; shift
mkdir -p "$dir/apps/events/backend" "$dir/apps/events/frontend" "$dir/packages/contracts" "$dir/packages/seo"
mkdir -p "$dir/apps/events/backend" "$dir/apps/events/frontend" "$dir/packages/contracts" "$dir/packages/seo" "$dir/packages/auth-client"
echo '{"name":"@crosscode/contracts"}' > "$dir/packages/contracts/package.json"
echo '{"name":"@crosscode/auth-client"}' > "$dir/packages/auth-client/package.json"
echo '{"name":"@crosscode/seo"}' > "$dir/packages/seo/package.json"
printf '{"dependencies":{%s}}' "$1" > "$dir/apps/events/backend/package.json"
printf '{"dependencies":{%s}}' "$2" > "$dir/apps/events/frontend/package.json"
@@ -35,6 +36,17 @@ checkout() {
[ "$(cut -d'|' -f2 "$CALLS" | tr '\n' ' ')" = "new/packages/contracts new/packages/seo new/apps/events/backend new/apps/events/frontend " ]
}
@test "3.0.0: auth-client is installed and built after contracts, before Events" {
checkout new '"@crosscode/auth-client":"*","@crosscode/contracts":"*"' '"@crosscode/contracts":"*","@crosscode/seo":"*"'
run events_shared_packages "$TMP/new"
[ "$output" = $'packages/contracts
packages/auth-client
packages/seo' ]
events_build "$TMP/new" hope
[ "$(cut -d'|' -f2 "$CALLS" | tr '
' ' ')" = "new/packages/contracts new/packages/auth-client new/packages/seo new/apps/events/backend new/apps/events/frontend " ]
}
@test "2.3.x (no shared packages used): installed and built as before" {
checkout old '' ''
run events_shared_packages "$TMP/old"