Fix scripts for Next.js + Payload CMS workflow

- new-project.sh: Use nextjs-payload-starter template, Next.js AI rules
- convert-astro.sh: Complete rewrite to migrate Astro MDX to Payload CMS Lexical JSON
- deploy.sh: Check for next.config instead of astro.config.mjs, use MONGODB_URL
- preview.sh: Check for Next.js, default port 3002
- audit-seo.sh: Check .tsx pages in src/app, Next.js config

All scripts now properly support Next.js + Payload CMS workflow.
This commit is contained in:
2026-04-17 10:34:41 +07:00
parent 2d57380c79
commit 47e0258694
5 changed files with 282 additions and 250 deletions

View File

@@ -19,7 +19,7 @@ NC='\033[0m'
# Default values
PROJECT_PATH="${1:-.}"
PORT="${2:-4321}"
PORT="${2:-3002}"
HOST="0.0.0.0"
#-------------------------------------------------------------------------------
@@ -64,13 +64,13 @@ check_project() {
exit 1
fi
# Check for Astro or Emdash
if ! grep -q "astro" "$PROJECT_PATH/package.json"; then
log_error "ไม่ใช่ Astro project"
# Check for Next.js
if ! grep -q '"next"' "$PROJECT_PATH/package.json"; then
log_error "ไม่ใช่ Next.js project"
exit 1
fi
log_success "พบ Astro project"
log_success "พบ Next.js project"
}
#-------------------------------------------------------------------------------
@@ -159,7 +159,7 @@ check_port() {
main() {
echo "=============================================="
echo " Astro Preview Server"
echo " Next.js Preview Server"
echo "=============================================="
echo ""