feat(app-expo): env variants, local iOS prebuild, and About diagnostics
Align staging/production builds with APP_VARIANT bundle IDs, allow staging HTTP on iOS, add ios-prebuild scripts for TestFlight, and show connected API URL on About for non-production builds. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,26 @@ function trimTrailingSlashes(value: string): string {
|
||||
return value.replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
export type AppVariant = 'development' | 'staging' | 'production';
|
||||
|
||||
function resolveAppVariant(): AppVariant {
|
||||
const raw = process.env.EXPO_PUBLIC_APP_VARIANT;
|
||||
if (raw === 'development' || raw === 'staging' || raw === 'production') {
|
||||
return raw;
|
||||
}
|
||||
if (__DEV__) {
|
||||
return 'development';
|
||||
}
|
||||
return 'production';
|
||||
}
|
||||
|
||||
/** Shown on About screen for dev/staging builds only. */
|
||||
export function shouldShowAboutBackendUrl(variant: AppVariant = appVariant): boolean {
|
||||
return variant === 'development' || variant === 'staging';
|
||||
}
|
||||
|
||||
export const appVariant = resolveAppVariant();
|
||||
|
||||
export const config = {
|
||||
apiBaseUrl: trimTrailingSlashes(
|
||||
process.env.EXPO_PUBLIC_API_URL ?? 'http://192.168.10.151:8000',
|
||||
@@ -10,6 +30,8 @@ export const config = {
|
||||
process.env.EXPO_PUBLIC_WS_URL ?? 'ws://192.168.10.151:8000',
|
||||
),
|
||||
isDebugMode: __DEV__,
|
||||
appVariant,
|
||||
showAboutBackendUrl: shouldShowAboutBackendUrl(),
|
||||
|
||||
api: {
|
||||
timeoutMs: 30_000,
|
||||
|
||||
Reference in New Issue
Block a user