Open History to see the last commit
1import type { ExpoConfig } from "expo/config";
2
3type AppVariant = "development" | "preview" | "production";
4
5const APP_VARIANT = resolveAppVariant(process.env.APP_VARIANT);
6
7const VARIANT_CONFIG: Record<
8 AppVariant,
9 {
10 readonly appName: string;
11 readonly scheme: string;
12 readonly iosIcon: string;
13 readonly iosBundleIdentifier: string;
14 readonly androidPackage: string;
15 }
16> = {
17 development: {
18 appName: "T3 Code Dev",
19 scheme: "t3code-dev",
20 iosIcon: "./assets/icon-composer-dev.icon",
21 iosBundleIdentifier: "com.t3tools.t3code.dev",
22 androidPackage: "com.t3tools.t3code.dev",
23 },
24 preview: {
25 appName: "T3 Code Preview",
26 scheme: "t3code-preview",
27 iosIcon: "./assets/icon-composer-prod.icon",
28 iosBundleIdentifier: "com.t3tools.t3code.preview",
29 androidPackage: "com.t3tools.t3code.preview",
30 },
31 production: {
32 appName: "T3 Code",
33 scheme: "t3code",
34 iosIcon: "./assets/icon-composer-prod.icon",
35 iosBundleIdentifier: "com.t3tools.t3code",
36 androidPackage: "com.t3tools.t3code",
37 },
38};
39
40function resolveAppVariant(value: string | undefined): AppVariant {
41 switch (value) {
42 case "development":
43 case "preview":
44 case "production":
45 return value;
46 default:
47 return "production";
48 }
49}
50
51const variant = VARIANT_CONFIG[APP_VARIANT];
52
53const config: ExpoConfig = {
54 name: variant.appName,
55 slug: "t3-code",
56 scheme: variant.scheme,
57 version: "0.1.0",
58 runtimeVersion: {
59 policy: "appVersion",
60 },
61 orientation: "portrait",
62 icon: "./assets/icon.png",
63 userInterfaceStyle: "automatic",
64 updates: {
65 enabled: true,
66 url: "https://u.expo.dev/d763fcb8-d37c-41ea-a773-b54a0ab4a454",
67 checkAutomatically: "ON_LOAD",
68 fallbackToCacheTimeout: 0,
69 },
70 ios: {
71 icon: variant.iosIcon,
72 supportsTablet: true,
73 bundleIdentifier: variant.iosBundleIdentifier,
74 infoPlist: {
75 NSAppTransportSecurity: {
76 NSAllowsArbitraryLoads: true,
77 },
78 NSLocalNetworkUsageDescription:
79 "Allow T3 Code to connect to T3 Code servers on your local network or tailnet.",
80 ITSAppUsesNonExemptEncryption: false,
81 },
82 },
83 android: {
84 icon: "./assets/icon.png",
85 package: variant.androidPackage,
86 adaptiveIcon: {
87 backgroundColor: "#E6F4FE",
88 foregroundImage: "./assets/android-icon-foreground.png",
89 backgroundImage: "./assets/android-icon-background.png",
90 monochromeImage: "./assets/android-icon-monochrome.png",
91 },
92 predictiveBackGestureEnabled: false,
93 },
94 web: {
95 favicon: "./assets/favicon.png",
96 },
97 plugins: [
98 [
99 "expo-camera",
100 {
101 cameraPermission: "Allow T3 Code to access your camera so you can scan pairing QR codes.",
102 barcodeScannerEnabled: true,
103 },
104 ],
105 [
106 "expo-splash-screen",
107 {
108 image: "./assets/splash-icon.png",
109 resizeMode: "contain",
110 backgroundColor: "#ffffff",
111 imageWidth: 220,
112 dark: {
113 image: "./assets/splash-icon.png",
114 backgroundColor: "#0a0a0a",
115 },
116 },
117 ],
118 [
119 "expo-build-properties",
120 {
121 ios: {
122 deploymentTarget: "16.4",
123 },
124 },
125 ],
126 "expo-secure-store",
127 "expo-router",
128 "expo-font",
129 "./plugins/withAndroidCleartextTraffic.cjs",
130 ],
131 extra: {
132 appVariant: APP_VARIANT,
133 eas: {
134 projectId: "d763fcb8-d37c-41ea-a773-b54a0ab4a454",
135 },
136 },
137 owner: "pingdotgg",
138};
139
140export default config;