chore: tidy local debug scripts

This commit is contained in:
npc0-hue
2026-07-23 16:09:12 +08:00
parent c07994c417
commit 8cc741ba19
15 changed files with 86 additions and 42 deletions
+13
View File
@@ -0,0 +1,13 @@
# Scripts
Use these root-level commands for day-to-day work:
- `scripts/dev-start.sh`: start the local platform API, run worker, and platform_web console.
- `scripts/dev-smoke.sh`: seed and verify the API-backed local plugin/server fixtures.
- `scripts/dev-stop.sh`: stop the managed local debug stack.
- `scripts/dev-reset.sh`: stop the stack and delete only the safe local debug data root.
- `scripts/browser-acceptance.sh`: run the full self-starting browser acceptance suite.
- `scripts/check-structure.sh`: verify required repository structure.
- `scripts/check-all.sh`: run structure, backend, frontend, and plugin checks.
Implementation details for the managed local stack live under `scripts/local-debug/`. Prefer the root commands above instead of calling those internals directly.
+6 -6
View File
@@ -2,8 +2,8 @@
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=scripts/local-debug-env.sh
source "$ROOT_DIR/scripts/local-debug-env.sh"
# shellcheck source=scripts/local-debug/env.sh
source "$ROOT_DIR/scripts/local-debug/env.sh"
export BROWSER_ACCEPTANCE_EVIDENCE_DIR="${BROWSER_ACCEPTANCE_EVIDENCE_DIR:-$LOCAL_DEBUG_ROOT/browser-acceptance}"
export LOCAL_DEBUG_PLATFORM_URL="${LOCAL_DEBUG_PLATFORM_URL:-$(local_debug_platform_url)}"
@@ -16,20 +16,20 @@ cleanup() {
LOCAL_DEBUG_ROOT="$LOCAL_DEBUG_ROOT" \
LOCAL_DEBUG_PLATFORM_PORT="$LOCAL_DEBUG_PLATFORM_PORT" \
LOCAL_DEBUG_WEB_PORT="$LOCAL_DEBUG_WEB_PORT" \
"$ROOT_DIR/scripts/local-debug-stop.sh" >/dev/null 2>&1 || true
"$ROOT_DIR/scripts/dev-stop.sh" >/dev/null 2>&1 || true
fi
}
if [[ "$SELF_STARTED" == "true" ]]; then
trap cleanup EXIT
"$ROOT_DIR/scripts/local-debug-reset.sh"
"$ROOT_DIR/scripts/local-debug-start.sh"
"$ROOT_DIR/scripts/dev-reset.sh"
"$ROOT_DIR/scripts/dev-start.sh"
else
curl -fsS "$LOCAL_DEBUG_PLATFORM_URL/healthz" >/dev/null
curl -fsS "$LOCAL_DEBUG_WEB_URL" >/dev/null
fi
"$ROOT_DIR/scripts/local-debug-smoke.sh"
"$ROOT_DIR/scripts/dev-smoke.sh"
mkdir -p "$BROWSER_ACCEPTANCE_EVIDENCE_DIR"
node "$ROOT_DIR/platform_web/acceptance/browser-acceptance.mjs"
+11
View File
@@ -4,6 +4,8 @@ set -euo pipefail
required_paths=(
"AGENTS.md"
"README.md"
"scripts/README.md"
"scripts/browser-acceptance.sh"
"scripts/check-all.sh"
"platform/AGENTS.md"
"platform/README.md"
@@ -96,6 +98,15 @@ required_paths=(
"plugins/examples/scum-server-plugin/actions/status.json"
"plugins/scripts/validate-manifest.ts"
"plugins/tests/manifest-validation.test.ts"
"scripts/dev-start.sh"
"scripts/dev-smoke.sh"
"scripts/dev-stop.sh"
"scripts/dev-reset.sh"
"scripts/local-debug/env.sh"
"scripts/local-debug/start.sh"
"scripts/local-debug/smoke.sh"
"scripts/local-debug/stop.sh"
"scripts/local-debug/reset.sh"
"openspec/changes/bootstrap-game-server-platform-architecture/proposal.md"
"openspec/changes/bootstrap-game-server-platform-architecture/design.md"
"openspec/changes/bootstrap-game-server-platform-architecture/tasks.md"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
exec "$ROOT_DIR/scripts/local-debug/reset.sh" "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
exec "$ROOT_DIR/scripts/local-debug/smoke.sh" "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
exec "$ROOT_DIR/scripts/local-debug/start.sh" "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
exec "$ROOT_DIR/scripts/local-debug/stop.sh" "$@"
@@ -4,7 +4,7 @@
set -euo pipefail
LOCAL_DEBUG_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LOCAL_DEBUG_ROOT_DIR="$(cd "$LOCAL_DEBUG_SCRIPT_DIR/.." && pwd)"
LOCAL_DEBUG_ROOT_DIR="$(cd "$LOCAL_DEBUG_SCRIPT_DIR/../.." && pwd)"
export LOCAL_DEBUG_ROOT="${LOCAL_DEBUG_ROOT:-$LOCAL_DEBUG_ROOT_DIR/.local-debug}"
export LOCAL_DEBUG_LOG_DIR="${LOCAL_DEBUG_LOG_DIR:-$LOCAL_DEBUG_ROOT/logs}"
@@ -157,7 +157,7 @@ local_debug_prepare_run_build_source() {
{
"sourceDir": "$RUN_SOURCE_DIR",
"buildSourceRoot": "$RUN_BUILD_SOURCE_ROOT",
"createdBy": "scripts/local-debug-env.sh"
"createdBy": "scripts/local-debug/env.sh"
}
EOF
}
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=scripts/local-debug-env.sh
source "$ROOT_DIR/scripts/local-debug-env.sh"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# shellcheck source=scripts/local-debug/env.sh
source "$ROOT_DIR/scripts/local-debug/env.sh"
case "$LOCAL_DEBUG_ROOT" in
"$ROOT_DIR/.local-debug" | /private/tmp/browser-local-debug-* | /tmp/browser-local-debug-*)
@@ -15,7 +15,7 @@ case "$LOCAL_DEBUG_ROOT" in
;;
esac
"$ROOT_DIR/scripts/local-debug-stop.sh"
"$ROOT_DIR/scripts/dev-stop.sh"
printf 'deleting local debug root only: %s\n' "$LOCAL_DEBUG_ROOT"
rm -rf "$LOCAL_DEBUG_ROOT"
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=scripts/local-debug-env.sh
source "$ROOT_DIR/scripts/local-debug-env.sh"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# shellcheck source=scripts/local-debug/env.sh
source "$ROOT_DIR/scripts/local-debug/env.sh"
PLATFORM_URL="$(local_debug_platform_url)"
API_URL="$PLATFORM_URL/api/v1"
@@ -244,7 +244,7 @@ if (!plugin.gameClientBridge?.commands?.length) {
}
if (missing.length > 0) {
console.error(`SCUM plugin registration is stale or incomplete: missing ${missing.join(", ")}`);
console.error("Run scripts/local-debug-reset.sh, restart the local debug stack, then rerun scripts/local-debug-smoke.sh.");
console.error("Run scripts/dev-reset.sh, restart the local debug stack, then rerun scripts/dev-smoke.sh.");
process.exit(1);
}
NODE
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=scripts/local-debug-env.sh
source "$ROOT_DIR/scripts/local-debug-env.sh"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# shellcheck source=scripts/local-debug/env.sh
source "$ROOT_DIR/scripts/local-debug/env.sh"
mkdir -p "$LOCAL_DEBUG_LOG_DIR" "$LOCAL_DEBUG_PID_DIR" "$PLATFORM_DATA_DIR" "$PLATFORM_LOG_DIR" "$RUN_WORKSPACE_ROOT" "$RUN_SPOOL_ROOT" "$RUN_BUILD_BUCKET_ROOT"
mkdir -p "$GOCACHE"
@@ -197,7 +197,7 @@ Login with:
password: operator-local
Run smoke verification:
scripts/local-debug-smoke.sh
scripts/dev-smoke.sh
Open local console:
$(local_debug_web_url)
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=scripts/local-debug-env.sh
source "$ROOT_DIR/scripts/local-debug-env.sh"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# shellcheck source=scripts/local-debug/env.sh
source "$ROOT_DIR/scripts/local-debug/env.sh"
if [[ ! -d "$LOCAL_DEBUG_PID_DIR" ]]; then
printf 'no local debug pid directory at %s\n' "$LOCAL_DEBUG_PID_DIR"