Open History to see the last commit
1import type { ExpoConfig } from "expo/config";
2
3import { loadRepoEnv } from "../../scripts/lib/public-config.ts";
4
5type AppVariant = "development" | "preview" | "production";
6
7const repoEnv = loadRepoEnv();
8Object.assign(process.env, repoEnv);
9
10const APP_VARIANT = resolveAppVariant(repoEnv.APP_VARIANT);
11
12const VARIANT_CONFIG: Record<
13 AppVariant,
14 {
15 readonly appName: string;
16 readonly scheme: string;
17 readonly iosIcon: string;
18 readonly iosBundleIdentifier: string;
19 readonly androidPackage: string;
20 readonly relyingParty?: string;
21 }
22> = {
23 development: {
24 appName: "T3 Code Dev",
25 scheme: "t3code-dev",
26 iosIcon: "./assets/icon-composer-dev.icon",
27 iosBundleIdentifier: "com.t3tools.t3code.dev",
28 androidPackage: "com.t3tools.t3code.dev",
29 relyingParty: "clerk.t3.codes",
30 },
31 preview: {
32 appName: "T3 Code Preview",
33 scheme: "t3code-preview",
34 iosIcon: "./assets/icon-composer-prod.icon",
35 iosBundleIdentifier: "com.t3tools.t3code.preview",
36 androidPackage: "com.t3tools.t3code.preview",
37 relyingParty: "clerk.t3.codes",
38 },
39 production: {
40 appName: "T3 Code",
41 scheme: "t3code",
42 iosIcon: "./assets/icon-composer-prod.icon",
43 iosBundleIdentifier: "com.t3tools.t3code",
44 androidPackage: "com.t3tools.t3code",
45 relyingParty: "clerk.t3.codes",
46 },
47};
48
49function resolveAppVariant(value: string | undefined): AppVariant {
50 switch (value) {
51 case "development":
52 case "preview":
53 case "production":
54 return value;
55 default:
56 return "production";
57 }
58}
59
60const variant = VARIANT_CONFIG[APP_VARIANT];
61
62const config: ExpoConfig = {
63 name: variant.appName,
64 slug: "t3-code",
65 platforms: ["ios", "android"],
66 scheme: variant.scheme,
67 version: "0.1.0",
68 runtimeVersion: {
69 policy: process.env.MOBILE_VERSION_POLICY ?? "appVersion",
70 },
71 orientation: "portrait",
72 icon: "./assets/icon.png",
73 userInterfaceStyle: "automatic",
74 updates: {
75 enabled: true,
76 url: "https://u.expo.dev/d763fcb8-d37c-41ea-a773-b54a0ab4a454",
77 checkAutomatically: "ON_LOAD",
78 fallbackToCacheTimeout: 0,
79 },
80 ios: {
81 icon: variant.iosIcon,
82 supportsTablet: true,
83 bundleIdentifier: variant.iosBundleIdentifier,
84 // Pin code signing to the T3 Tools team so non-interactive `expo run:ios`
85 // does not fall back to a personal team (which cannot sign app groups,
86 // Sign in with Apple, or push notification entitlements).
87 appleTeamId: "ARK85ZXQ4Z",
88 associatedDomains: [
89 `applinks:${variant.relyingParty}`,
90 `webcredentials:${variant.relyingParty}`,
91 ],
92 infoPlist: {
93 NSAppTransportSecurity: {
94 NSAllowsArbitraryLoads: true,
95 },
96 NSLocalNetworkUsageDescription:
97 "Allow T3 Code to connect to T3 Code servers on your local network or tailnet.",
98 ITSAppUsesNonExemptEncryption: false,
99 },
100 },
101 android: {
102 icon: "./assets/icon.png",
103 package: variant.androidPackage,
104 adaptiveIcon: {
105 backgroundColor: "#E6F4FE",
106 foregroundImage: "./assets/android-icon-foreground.png",
107 backgroundImage: "./assets/android-icon-background.png",
108 monochromeImage: "./assets/android-icon-monochrome.png",
109 },
110 predictiveBackGestureEnabled: false,
111 },
112 web: {
113 favicon: "./assets/favicon.png",
114 },
115 plugins: [
116 "expo-font",
117 "expo-secure-store",
118 ["@clerk/expo", { theme: "./clerk-theme.json" }],
119 "expo-web-browser",
120 [
121 "expo-camera",
122 {
123 cameraPermission: "Allow T3 Code to access your camera so you can scan pairing QR codes.",
124 barcodeScannerEnabled: true,
125 },
126 ],
127 [
128 "expo-splash-screen",
129 {
130 image: "./assets/splash-icon.png",
131 resizeMode: "contain",
132 backgroundColor: "#ffffff",
133 imageWidth: 220,
134 dark: {
135 image: "./assets/splash-icon.png",
136 backgroundColor: "#0a0a0a",
137 },
138 },
139 ],
140 [
141 "expo-build-properties",
142 {
143 ios: {
144 deploymentTarget: "18.0",
145 // AppCheckCore 11.3+ includes Swift and needs module maps for these Objective-C dependencies.
146 extraPods: [
147 { name: "GoogleUtilities", modular_headers: true },
148 { name: "RecaptchaInterop", modular_headers: true },
149 ],
150 },
151 },
152 ],
153 "./plugins/withIosCocoaPodsUuidCache.cjs",
154 [
155 "expo-widgets",
156 {
157 bundleIdentifier: `${variant.iosBundleIdentifier}.widgets`,
158 groupIdentifier: `group.${variant.iosBundleIdentifier}`,
159 enablePushNotifications: true,
160 widgets: [
161 {
162 name: "AgentActivity",
163 displayName: "Agent Activity",
164 description: "Shows the current state of active T3 Code agents.",
165 supportedFamilies: ["systemSmall", "systemMedium", "accessoryRectangular"],
166 },
167 ],
168 },
169 ],
170 "./plugins/withIosSceneLifecycle.cjs",
171 "./plugins/withAndroidCleartextTraffic.cjs",
172 ],
173 extra: {
174 appVariant: APP_VARIANT,
175 relay: {
176 url: repoEnv.T3CODE_RELAY_URL ?? null,
177 },
178 clerk: {
179 publishableKey: repoEnv.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY ?? null,
180 jwtTemplate: repoEnv.EXPO_PUBLIC_CLERK_JWT_TEMPLATE ?? null,
181 },
182 observability: {
183 tracesUrl: repoEnv.EXPO_PUBLIC_OTLP_TRACES_URL ?? "https://api.axiom.co/v1/traces",
184 tracesDataset: repoEnv.EXPO_PUBLIC_OTLP_TRACES_DATASET ?? null,
185 tracesToken: repoEnv.EXPO_PUBLIC_OTLP_TRACES_TOKEN ?? null,
186 },
187 eas: {
188 projectId: "d763fcb8-d37c-41ea-a773-b54a0ab4a454",
189 },
190 },
191 owner: "pingdotgg",
192};
193
194export default config;