From ea152a91692f664d2e8487a7554cde4a71ecaceb Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Wed, 20 May 2026 05:42:00 +0200 Subject: [PATCH] feat(debug): debug-page in TestFlight via EXPO_PUBLIC_ENABLE_DEBUG flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit debug.tsx war hart __DEV__-gated → der Protection-Log-Viewer (v0.3.3) wäre im TestFlight-Build unerreichbar gewesen. eas.json production-Profil setzt jetzt EXPO_PUBLIC_ENABLE_DEBUG=1. debug.tsx + HeaderDropdownMenu prüfen `__DEV__ || EXPO_PUBLIC_ENABLE_DEBUG`. Für den echten App-Store-Release einfach das Flag aus eas.json nehmen. --- apps/rebreak-native/app/debug.tsx | 13 ++++++++++--- .../components/header/HeaderDropdownMenu.tsx | 4 +++- apps/rebreak-native/eas.json | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/rebreak-native/app/debug.tsx b/apps/rebreak-native/app/debug.tsx index 26cec7f..596ca06 100644 --- a/apps/rebreak-native/app/debug.tsx +++ b/apps/rebreak-native/app/debug.tsx @@ -25,13 +25,20 @@ export default function DebugScreen() { const colors = useColors(); const { me } = useMe(); + // Debug-Page ist in __DEV__ immer da, plus in TestFlight/production-Builds + // wenn EXPO_PUBLIC_ENABLE_DEBUG gesetzt ist (eas.json production-Profil) — + // damit Tester den Protection-Log-Viewer ohne Mac/Console.app nutzen können. + // Für den echten App-Store-Release das Flag aus eas.json nehmen → wieder dicht. + const debugAccessible = + __DEV__ || process.env.EXPO_PUBLIC_ENABLE_DEBUG === '1'; + useEffect(() => { - if (!__DEV__) { + if (!debugAccessible) { router.replace('/'); } - }, [router]); + }, [router, debugAccessible]); - if (!__DEV__) { + if (!debugAccessible) { return ; } diff --git a/apps/rebreak-native/components/header/HeaderDropdownMenu.tsx b/apps/rebreak-native/components/header/HeaderDropdownMenu.tsx index 6bfb8e6..18a1418 100644 --- a/apps/rebreak-native/components/header/HeaderDropdownMenu.tsx +++ b/apps/rebreak-native/components/header/HeaderDropdownMenu.tsx @@ -68,7 +68,9 @@ export function HeaderDropdownMenu({ visible, onClose, topOffset = 80 }: Props) }, ]; - if (__DEV__) { + // Debug-Eintrag: __DEV__ immer, plus TestFlight/production-Builds wenn + // EXPO_PUBLIC_ENABLE_DEBUG gesetzt ist (eas.json production-Profil). + if (__DEV__ || process.env.EXPO_PUBLIC_ENABLE_DEBUG === '1') { items.push({ key: 'debug', label: t('headerMenu.debug'), diff --git a/apps/rebreak-native/eas.json b/apps/rebreak-native/eas.json index 6e6bca9..55b8139 100644 --- a/apps/rebreak-native/eas.json +++ b/apps/rebreak-native/eas.json @@ -34,7 +34,8 @@ }, "production": { "env": { - "EXPO_PUBLIC_API_URL": "https://staging.rebreak.org" + "EXPO_PUBLIC_API_URL": "https://staging.rebreak.org", + "EXPO_PUBLIC_ENABLE_DEBUG": "1" }, "ios": { "resourceClass": "m-medium",