Pre-launch live mode: PEPPA_WEB_MODE=dev runs next dev (HMR) from the working copy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
52d861bbc7
commit
c4952b2011
@ -14,6 +14,8 @@ const version = (JSON.parse(readFileSync(new URL("../../package.json", import.me
|
|||||||
|
|
||||||
const config: NextConfig = {
|
const config: NextConfig = {
|
||||||
// Workspace packages ship TypeScript sources.
|
// Workspace packages ship TypeScript sources.
|
||||||
|
// `next dev` behind Traefik (pre-launch live mode): let the public host load dev assets and HMR.
|
||||||
|
allowedDevOrigins: ["peppa.telecom.quest"],
|
||||||
transpilePackages: ["@peppa/db", "@peppa/shared", "@peppa/core", "@peppa/runner", "@peppa/mcp"],
|
transpilePackages: ["@peppa/db", "@peppa/shared", "@peppa/core", "@peppa/runner", "@peppa/mcp"],
|
||||||
env: {
|
env: {
|
||||||
NEXT_PUBLIC_PEPPA_VERSION: version,
|
NEXT_PUBLIC_PEPPA_VERSION: version,
|
||||||
|
|||||||
@ -1,17 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Installs Peppa's launchd agents (start at login, restart on crash):
|
# Installs Peppa's launchd agents (start at login, restart on crash):
|
||||||
# quest.telecom.peppa.watchdog — session watchdog under caffeinate -i (no idle sleep)
|
# quest.telecom.peppa.watchdog — session watchdog under caffeinate -i (no idle sleep)
|
||||||
# quest.telecom.peppa.web — Next.js platform on :3100 (needs `pnpm --filter @peppa/web build`)
|
# quest.telecom.peppa.web — Next.js platform on :3100 (needs `pnpm --filter @peppa/web build`);
|
||||||
|
# PEPPA_WEB_MODE=dev runs `next dev` instead (HMR: edits in this
|
||||||
|
# checkout go live without build or release — the pre-launch setup)
|
||||||
# quest.telecom.peppa.bot — Telegram bot (TELEGRAM_BOT_TOKEN in .env)
|
# quest.telecom.peppa.bot — Telegram bot (TELEGRAM_BOT_TOKEN in .env)
|
||||||
# quest.telecom.peppa.release — Peppa's own prod releases (PEP-18): started by launchd while
|
# quest.telecom.peppa.release — Peppa's own prod releases (PEP-18): started by launchd while
|
||||||
# ~/.peppa/release-queue has requests (the PM's button)
|
# ~/.peppa/release-queue has requests (the PM's button)
|
||||||
# Prod runs from the release directory: ~/peppa/current/scripts/install-launchd.sh, so every
|
# Prod runs from the release directory: ~/peppa/current/scripts/install-launchd.sh, so every
|
||||||
# path below (and PEPPA_ROOT for hooks and git config) is ~/peppa/current, not a release.
|
# path below (and PEPPA_ROOT for hooks and git config) is ~/peppa/current, not a release.
|
||||||
|
# Pre-launch (everything is dev): PEPPA_WEB_MODE=dev scripts/install-launchd.sh watchdog web bot
|
||||||
|
# from the working copy — no release agent, so nothing replaces what this checkout serves.
|
||||||
# Usage: scripts/install-launchd.sh [watchdog] [web] [bot] [release] (default: all)
|
# Usage: scripts/install-launchd.sh [watchdog] [web] [bot] [release] (default: all)
|
||||||
# Remove: launchctl bootout gui/$(id -u)/<label> && rm ~/Library/LaunchAgents/<label>.plist
|
# Remove: launchctl bootout gui/$(id -u)/<label> && rm ~/Library/LaunchAgents/<label>.plist
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
PEPPA_HOME="${PEPPA_HOME:-$HOME/.peppa}"
|
PEPPA_HOME="${PEPPA_HOME:-$HOME/.peppa}"
|
||||||
|
WEB_MODE="${PEPPA_WEB_MODE:-start}"
|
||||||
|
case "$WEB_MODE" in start|dev) ;; *) echo "PEPPA_WEB_MODE must be start or dev" >&2; exit 1 ;; esac
|
||||||
mkdir -p "$HOME/Library/LaunchAgents" "$PEPPA_HOME"
|
mkdir -p "$HOME/Library/LaunchAgents" "$PEPPA_HOME"
|
||||||
PATH_ENV="$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
|
PATH_ENV="$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
|
||||||
# Bot and watchdog run TypeScript straight from source with Node's type stripping (PEP-36):
|
# Bot and watchdog run TypeScript straight from source with Node's type stripping (PEP-36):
|
||||||
@ -76,7 +82,7 @@ for s in "${SERVICES[@]}"; do
|
|||||||
/usr/bin/caffeinate -i "$ROOT/packages/cli/bin/peppa" watchdog ;;
|
/usr/bin/caffeinate -i "$ROOT/packages/cli/bin/peppa" watchdog ;;
|
||||||
web)
|
web)
|
||||||
install_agent quest.telecom.peppa.web web.log "$ROOT/apps/web" \
|
install_agent quest.telecom.peppa.web web.log "$ROOT/apps/web" \
|
||||||
/bin/bash -c "set -a; . '$ROOT/.env'; set +a; exec '$ROOT/apps/web/node_modules/.bin/next' start -p 3100" ;;
|
/bin/bash -c "set -a; . '$ROOT/.env'; set +a; exec '$ROOT/apps/web/node_modules/.bin/next' $WEB_MODE -p 3100" ;;
|
||||||
bot)
|
bot)
|
||||||
install_agent quest.telecom.peppa.bot bot.log "$ROOT" "$ROOT/apps/bot/bin/peppa-bot" ;;
|
install_agent quest.telecom.peppa.bot bot.log "$ROOT" "$ROOT/apps/bot/bin/peppa-bot" ;;
|
||||||
release)
|
release)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user