Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: App Config Updates #1191

Open
wants to merge 1 commit into
base: release/3.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 12 additions & 42 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,33 @@
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;

Check warning on line 6 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const isDev = env.EXPO_ENV === "dev";

const expoConfig = appJson.expo;

Check warning on line 8 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

'expoConfig' is assigned a value but only used as a type
warnOnce(
isDev && !(process.env as any).EXPO_PUBLIC_DEV_API_URI,

Check warning on line 10 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
"\n\n🚧 Running the app without EXPO_PUBLIC_DEV_API_URI setup\n\n"
);

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 => ({

Check warning on line 23 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Prefer named exports
...(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,
});
40 changes: 36 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading