@@ -8,6 +8,20 @@ const repoEnv = loadRepoEnv();
88Object . assign ( process . env , repoEnv ) ;
99
1010const APP_VARIANT = resolveAppVariant ( repoEnv . APP_VARIANT ) ;
11+ const isIosPersonalTeamBuild = repoEnv . T3CODE_IOS_PERSONAL_TEAM === "1" ;
12+
13+ const personalTeamBundleIdentifier = repoEnv . T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID ?. trim ( ) ;
14+ const IOS_BUNDLE_IDENTIFIER_PATTERN = / ^ [ A - Z a - z 0 - 9 - ] + (?: \. [ A - Z a - z 0 - 9 - ] + ) + $ / ;
15+
16+ if (
17+ isIosPersonalTeamBuild &&
18+ ( ! personalTeamBundleIdentifier ||
19+ ! IOS_BUNDLE_IDENTIFIER_PATTERN . test ( personalTeamBundleIdentifier ) )
20+ ) {
21+ throw new Error (
22+ "T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID must be a reverse-DNS identifier such as com.example.t3code when T3CODE_IOS_PERSONAL_TEAM=1." ,
23+ ) ;
24+ }
1125
1226const VARIANT_CONFIG : Record <
1327 AppVariant ,
@@ -69,6 +83,26 @@ const dmSansFonts = {
6983 bold : "@expo-google-fonts/dm-sans/700Bold/DMSans_700Bold.ttf" ,
7084} as const ;
7185
86+ const widgetsPlugin : NonNullable < ExpoConfig [ "plugins" ] > [ number ] = [
87+ "expo-widgets" ,
88+ {
89+ bundleIdentifier : `${ variant . iosBundleIdentifier } .widgets` ,
90+ groupIdentifier : `group.${ variant . iosBundleIdentifier } ` ,
91+ enablePushNotifications : true ,
92+ // Agent activity can update many times an hour; without the
93+ // frequent-updates entitlement iOS throttles the update budget sooner.
94+ frequentUpdates : true ,
95+ widgets : [
96+ {
97+ name : "AgentActivity" ,
98+ displayName : "Agent Activity" ,
99+ description : "Shows the current state of active T3 Code agents." ,
100+ supportedFamilies : [ "systemSmall" , "systemMedium" , "accessoryRectangular" ] ,
101+ } ,
102+ ] ,
103+ } ,
104+ ] ;
105+
72106// These aliases match the fonts' PostScript names on iOS. Register the same
73107// names on Android so React Native and the native composer use one set of
74108// family names without waiting for runtime font loading.
@@ -125,12 +159,16 @@ const config: ExpoConfig = {
125159 backgroundImage : "./assets/android-icon-background.png" ,
126160 monochromeImage : "./assets/android-icon-monochrome.png" ,
127161 } ,
128- predictiveBackGestureEnabled : false ,
162+ // Opts into OnBackInvokedCallback-based back dispatch (Android 13+).
163+ // JS back handling survives it via react-native's Android 16 shim plus
164+ // withAndroidPredictiveBackCompat on Android 13-15.
165+ predictiveBackGestureEnabled : true ,
129166 } ,
130167 web : {
131168 favicon : "./assets/favicon.png" ,
132169 } ,
133170 plugins : [
171+ "expo-asset" ,
134172 [
135173 "expo-font" ,
136174 {
@@ -157,8 +195,23 @@ const config: ExpoConfig = {
157195 ] ,
158196 "expo-secure-store" ,
159197 "expo-sqlite" ,
160- [ "@clerk/expo" , { theme : "./clerk-theme.json" } ] ,
198+ // appleSignIn must be gated here: withoutIosPersonalTeamCapabilities.cjs runs before
199+ // plugins earlier in this array, so it cannot strip the entitlement Clerk would add.
200+ [ "@clerk/expo" , { theme : "./clerk-theme.json" , appleSignIn : ! isIosPersonalTeamBuild } ] ,
161201 "expo-web-browser" ,
202+ [
203+ "expo-quick-actions" ,
204+ {
205+ // Adaptive launcher-shortcut icon; referenced by resource name from
206+ // the shortcut items set in src/features/shortcuts.
207+ androidIcons : {
208+ shortcut_icon : {
209+ foregroundImage : "./assets/android-icon-foreground.png" ,
210+ backgroundColor : "#E6F4FE" ,
211+ } ,
212+ } ,
213+ } ,
214+ ] ,
162215 [
163216 "expo-camera" ,
164217 {
@@ -198,31 +251,18 @@ const config: ExpoConfig = {
198251 // expo-widgets' — its dangerous mod wipes ios/ExpoWidgetsTarget/ (which
199252 // would delete the asset catalog) and its xcodeproj mod creates the widget
200253 // target (which must exist before the compile phase can be attached).
201- "./plugins/withWidgetLogoAsset.cjs" ,
202- [
203- "expo-widgets" ,
204- {
205- bundleIdentifier : `${ variant . iosBundleIdentifier } .widgets` ,
206- groupIdentifier : `group.${ variant . iosBundleIdentifier } ` ,
207- enablePushNotifications : true ,
208- // Agent activity can update many times an hour; without the
209- // frequent-updates entitlement iOS throttles the update budget sooner.
210- frequentUpdates : true ,
211- widgets : [
212- {
213- name : "AgentActivity" ,
214- displayName : "Agent Activity" ,
215- description : "Shows the current state of active T3 Code agents." ,
216- supportedFamilies : [ "systemSmall" , "systemMedium" , "accessoryRectangular" ] ,
217- } ,
218- ] ,
219- } ,
220- ] ,
254+ ...( ! isIosPersonalTeamBuild ? [ "./plugins/withWidgetLogoAsset.cjs" , widgetsPlugin ] : [ ] ) ,
221255 "./plugins/withIosSceneLifecycle.cjs" ,
222256 "./plugins/withAndroidCleartextTraffic.cjs" ,
257+ "./plugins/withAndroidGradleHeap.cjs" ,
258+ "./plugins/withAndroidModernPopupMenu.cjs" ,
259+ "./plugins/withAndroidModernAlertDialog.cjs" ,
260+ "./plugins/withAndroidPredictiveBackCompat.cjs" ,
261+ ...( isIosPersonalTeamBuild ? [ "./plugins/withoutIosPersonalTeamCapabilities.cjs" ] : [ ] ) ,
223262 ] ,
224263 extra : {
225264 appVariant : APP_VARIANT ,
265+ iosPersonalTeamBuild : isIosPersonalTeamBuild ,
226266 relay : {
227267 url : repoEnv . T3CODE_RELAY_URL ?? null ,
228268 } ,
0 commit comments