#!/usr/bin/env bash

set -euo pipefail

if ! command -v pnpm >/dev/null 2>&1; then
  echo "pnpm is required to run this check." >&2
  exit 1
fi

echo "🔍 Checking Payload + Next.js versions (peer compatibility)…"
pnpm outdated next \
  payload \
  @payloadcms/next \
  @payloadcms/db-postgres \
  @payloadcms/plugin-form-builder \
  @payloadcms/plugin-multi-tenant \
  @payloadcms/plugin-nested-docs \
  @payloadcms/plugin-redirects \
  @payloadcms/plugin-seo \
  @payloadcms/richtext-lexical \
  @payloadcms/ui

echo
echo "ℹ️  Review Payload release notes: https://github.com/payloadcms/payload/releases"
echo "ℹ️  Review Next.js release notes: https://nextjs.org/blog"
