1
0
forked from baron/baron-sso

make dev/dev-debug 구분.

This commit is contained in:
2026-05-20 13:34:19 +09:00
parent 0155ee4ee7
commit 5496735e2f
15 changed files with 192 additions and 45 deletions

View File

@@ -40,7 +40,14 @@ grep -Fq -- "AS dev" "$USERFRONT_DOCKERFILE" || fail "userfront Dockerfile must
grep -Fq -- "AS production" "$USERFRONT_DOCKERFILE" || fail "userfront Dockerfile must keep an explicit production target"
grep -Fq -- "flutter run" "$USERFRONT_DEV_SERVER" || fail "userfront dev server must use flutter run"
grep -Fq -- "--wasm" "$USERFRONT_DEV_SERVER" || fail "userfront dev server must keep WebAssembly enabled"
grep -Fq -- "--debug" "$USERFRONT_DEV_SERVER" || fail "userfront dev server must run in debug mode"
grep -Fq -- "--dart-define=CLIENT_LOG_DEBUG=" "$USERFRONT_DEV_SERVER" || fail "userfront dev server must pass client log debug mode through dart-define"
grep -Fq -- "--dart-define=APP_ENV=" "$USERFRONT_DEV_SERVER" || fail "userfront dev server must pass app env through dart-define"
grep -Fq -- 'USERFRONT_FLUTTER_RUN_FLAGS' "$USERFRONT_DEV_SERVER" || fail "userfront dev server must accept optional Flutter run flags"
assert_contains 'CLIENT_LOG_DEBUG=${CLIENT_LOG_DEBUG:-false}'
assert_contains 'USERFRONT_FLUTTER_RUN_FLAGS=${USERFRONT_FLUTTER_RUN_FLAGS:-}'
if grep -Fq -- "--debug" "$USERFRONT_DEV_SERVER"; then
fail "make dev must not hard-code Flutter debug mode in the userfront dev server"
fi
if grep -Fq -- "--release" "$USERFRONT_DEV_SERVER"; then
fail "userfront dev server must not run Flutter in release mode"
fi

View File

@@ -54,6 +54,54 @@ if ! grep -q -- " --build" <<<"$app_up_line"; then
exit 1
fi
if ! grep -q -- "BACKEND_LOG_LEVEL=info" <<<"$app_up_line"; then
echo "make dev must run backend at info log level." >&2
exit 1
fi
if ! grep -q -- "CLIENT_LOG_DEBUG=false" <<<"$app_up_line"; then
echo "make dev must disable verbose client debug log ingestion." >&2
exit 1
fi
if ! grep -q -- "VITE_CLIENT_LOG_DEBUG=false" <<<"$app_up_line"; then
echo "make dev must disable React client debug console logs." >&2
exit 1
fi
if grep -q -- "BACKEND_LOG_LEVEL=debug" <<<"$app_up_line"; then
echo "make dev must not run backend at debug log level." >&2
exit 1
fi
if grep -q -- "USERFRONT_FLUTTER_RUN_FLAGS=--debug" <<<"$app_up_line"; then
echo "make dev must not run userfront with explicit Flutter debug flags." >&2
exit 1
fi
dry_run_dev_debug="$(
make --dry-run --always-make -C "$repo_root" dev-debug DEV_SERVICES="backend userfront" 2>&1
)"
if ! grep -q "Ensuring Infra stack" <<<"$dry_run_dev_debug"; then
echo "make dev-debug must ensure the infra stack first." >&2
exit 1
fi
if ! grep -q "Ensuring Ory stack" <<<"$dry_run_dev_debug"; then
echo "make dev-debug must ensure the Ory stack first." >&2
exit 1
fi
dev_debug_app_up_line="$(
grep -E "BACKEND_LOG_LEVEL=debug CLIENT_LOG_DEBUG=true VITE_CLIENT_LOG_DEBUG=true USERFRONT_FLUTTER_RUN_FLAGS=--debug docker compose .* -f docker-compose.yaml up .*backend.*userfront" <<<"$dry_run_dev_debug" | tail -1
)"
if [[ -z "$dev_debug_app_up_line" ]]; then
echo "make dev-debug must run app services with explicit backend, client log, and userfront debug flags." >&2
exit 1
fi
dry_run_up_dev="$(
make --dry-run --always-make -C "$repo_root" up-dev 2>&1
)"