Files
hao-ai-lab-FastVideo/apps/dreamverse/scripts/launch/launch_frontend.sh
T
9c2da7c2b0 [feat] dreamverse-monorepo: Phase 3 — frontend + public assets
Source: Dreamverse repo at will/integrate-public-fastvideo @ ec8ef92.
Cross-repo move; original history retained in archived Dreamverse repo.
Per .agents/memory/dreamverse-integration/integration-plan.md Phase 3.

* Frontend moved to apps/dreamverse/web with Next/Vitest/Playwright config
  rewired for the monorepo location.
* Product docs, scripts, launch helpers, prompt assets, and Dreamverse
  diagrams/assets moved under apps/dreamverse/.
* Public streaming demo config added at examples/serving/streaming_demo.yaml
  with non-private placeholders.
* Launch/smoke scripts now resolve DREAMVERSE_ROOT from apps/dreamverse
  and run frontend commands from apps/dreamverse/web.
* Dreamverse asset allow-list narrowed in .gitignore so copied image/video
  assets can be staged without broadly tracking generated build output.
* Vitest excludes Playwright e2e specs; obsolete page.integration assertions
  remain skipped until updated for the current migrated shell.

Co-authored-by: Junda (David) Su <90978028+Davids048@users.noreply.github.com>
Co-authored-by: Matthew Noto <99706358+RandNMR73@users.noreply.github.com>
Co-authored-by: XOR-op <17672363+XOR-op@users.noreply.github.com>
Co-authored-by: Zhang Peiyuan <42993249+jzhang38@users.noreply.github.com>
2026-05-07 13:37:25 -07:00

55 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Launch the Dreamverse Next.js frontend in dev mode on port 5274
# (the devtools-enabled build the e2e tests target).
#
# Usage:
# bash launch_frontend.sh
# FRONTEND_MODE=dev bash launch_frontend.sh # plain dev (5299, no devtools)
# FRONTEND_MODE=single5s bash launch_frontend.sh # single-5s product mode
#
# The script ``cd``'s into ``web`` and shells out to pnpm. It runs
# ``pnpm install --frozen-lockfile`` only when ``node_modules/`` is missing so repeat
# launches are fast.
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
DREAMVERSE_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
WEB_ROOT="${DREAMVERSE_ROOT}/web"
FRONTEND_MODE="${FRONTEND_MODE:-devtools}"
case "${FRONTEND_MODE}" in
devtools|dev|single5s) ;;
*)
echo "error: FRONTEND_MODE must be one of devtools|dev|single5s (got '${FRONTEND_MODE}')" >&2
exit 1
;;
esac
if [[ ! -d "${WEB_ROOT}" ]]; then
echo "error: web app not found at ${WEB_ROOT}" >&2
exit 1
fi
cd "${WEB_ROOT}"
if [[ ! -d node_modules ]]; then
echo "[launch-demo] node_modules missing — running pnpm install --frozen-lockfile"
pnpm install --frozen-lockfile
fi
case "${FRONTEND_MODE}" in
devtools)
echo "[launch-demo] starting Next.js dev:devtools (port 5274)"
exec pnpm run dev:devtools -- "$@"
;;
dev)
echo "[launch-demo] starting Next.js dev (port 5299)"
exec pnpm run dev -- "$@"
;;
single5s)
echo "[launch-demo] starting Next.js dev:single5s (port 5274)"
exec pnpm run dev:single5s -- "$@"
;;
esac