diff --git a/app.config.ts b/app.config.ts index f7fac77c6..8366d5bae 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,11 +1,11 @@ import { ConfigContext, ExpoConfig } from "expo/config"; import warnOnce from "warn-once"; -import appBuildNumbers from "./app.json"; +import appJson from "./app.json"; const env = process.env as any; const isDev = env.EXPO_ENV === "dev"; - +const expoConfig = appJson.expo; warnOnce( isDev && !(process.env as any).EXPO_PUBLIC_DEV_API_URI, "\n\n🚧 Running the app without EXPO_PUBLIC_DEV_API_URI setup\n\n" @@ -14,50 +14,20 @@ warnOnce( const isPreview = env.EXPO_ENV === "preview"; const isProduction = !isDev && !isPreview; -export default ({ config }: ConfigContext): ExpoConfig => ({ - ...config, +type DefaultExpoConfig = typeof expoConfig; + +type ConverseConfigContext = ConfigContext & { + config: DefaultExpoConfig; +}; + +export default ({ config }: ConverseConfigContext): ExpoConfig => ({ + ...(config as ExpoConfig), name: isDev ? "Converse DEV" : isPreview ? "Converse PREVIEW" : "Converse", scheme: isDev ? "converse-dev" : isPreview ? "converse-preview" : "converse", - slug: "converse", - orientation: "portrait", icon: isProduction ? "./assets/icon.png" : "./assets/icon-preview.png", - userInterfaceStyle: "automatic", - splash: { - image: "./assets/splash.png", - resizeMode: "contain", - backgroundColor: "#ffffff", - }, - updates: { - fallbackToCacheTimeout: 0, - url: "https://u.expo.dev/49a65fae-3895-4487-8e8a-5bd8bee3a401", - }, - version: appBuildNumbers.expo.version, - assetBundlePatterns: ["**/*"], - ios: { - supportsTablet: true, - buildNumber: appBuildNumbers.expo.ios.buildNumber, - config: { - usesNonExemptEncryption: false, - }, - }, - android: { - adaptiveIcon: { - foregroundImage: "./assets/adaptive-icon.png", - backgroundColor: "#FFFFFF", - }, - versionCode: appBuildNumbers.expo.android.versionCode, - }, - web: { - favicon: "./assets/favicon.png", - bundler: "metro", - }, extra: { - eas: { - projectId: "49a65fae-3895-4487-8e8a-5bd8bee3a401", - }, + ...config.extra, ENV: isDev ? "dev" : isPreview ? "preview" : "prod", }, - runtimeVersion: appBuildNumbers.expo.version, - owner: "converse", - jsEngine: "hermes", + runtimeVersion: config.version, }); diff --git a/app.json b/app.json index ac4d1c150..3f9146ae2 100644 --- a/app.json +++ b/app.json @@ -1,11 +1,43 @@ { "expo": { - "version": "2.0.8", + "version": "3.0.0", "ios": { - "buildNumber": "29" + "buildNumber": "29", + "supportsTablet": true, + "config": { + "usesNonExemptEncryption": false + } }, "android": { - "versionCode": 226 - } + "versionCode": 226, + "adaptiveIcon": { + "foregroundImage": "./assets/adaptive-icon.png", + "backgroundColor": "#FFFFFF" + } + }, + "web": { + "favicon": "./assets/favicon.png", + "bundler": "metro" + }, + "slug": "converse", + "orientation": "portrait", + "userInterfaceStyle": "automatic", + "assetBundlePatterns": ["**/*"], + "splash": { + "image": "./assets/splash.png", + "resizeMode": "contain", + "backgroundColor": "#ffffff" + }, + "updates": { + "fallbackToCacheTimeout": 0, + "url": "https://u.expo.dev/49a65fae-3895-4487-8e8a-5bd8bee3a401" + }, + "extra": { + "eas": { + "projectId": "49a65fae-3895-4487-8e8a-5bd8bee3a401" + } + }, + "owner": "converse", + "jsEngine": "hermes" } }