Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| The phone app's scaffolding, in apps/mobile: Expo SDK 57 with Expo Router, Android first, with Chat, Code and Customize. It signs in with g1t's own OAuth 2.1 (PKCE, a client id that encodes "g1t for Android" and g1t://oauth/callback, so nothing is registered), keeps the server and credentials in the phone's keystore, refreshes the 30-day token a minute early and shares the single-use refresh between requests. A personal access token is the other way in, and a self-hosted g1t the other server. | 1 | import type { ConfigContext, ExpoConfig } from "expo/config"; |
| 2 | ||
| 3 | /** | |
| 4 | * The phone app's configuration. `APP_VARIANT` (set by eas.json's | |
| 5 | * profiles) picks an identity, so a development build, a preview build | |
| 6 | * and the store build install side by side on one phone: | |
| 7 | * | |
| 8 | * | Variant | Android package / iOS bundle | Name | | |
| 9 | * | ------------- | ---------------------------- | ----------- | | |
| 10 | * | `development` | `sh.g1t.app.dev` | g1t (dev) | | |
| 11 | * | `preview` | `sh.g1t.app.preview` | g1t (beta) | | |
| 12 | * | production | `sh.g1t.app` | g1t | | |
| 13 | * | |
| 14 | * The EAS project is set once `eas init` has made one (README.md); until | |
| 15 | * then, builds and updates are not linked to one. | |
| 16 | */ | |
| 17 | ||
| 18 | /** The EAS project's id, from `eas init`. `EAS_PROJECT_ID` overrides it. */ | |
| 19 | const EAS_PROJECT: string | undefined = undefined; | |
| 20 | ||
| 21 | const variant = process.env.APP_VARIANT; | |
| 22 | const suffix = variant === "development" ? ".dev" : variant === "preview" ? ".preview" : ""; | |
| 23 | const name = variant === "development" ? "g1t (dev)" : variant === "preview" ? "g1t (beta)" : "g1t"; | |
| 24 | const id = `sh.g1t.app${suffix}`; | |
| 25 | const projectId = process.env.EAS_PROJECT_ID ?? EAS_PROJECT; | |
| 26 | ||
| 27 | /** g1t's background, dark as the site is by default (packages/theme/tokens.css `--g1t-bg`). */ | |
| 28 | const BACKGROUND = "#0f0f11"; | |
| 29 | ||
| 30 | export default ({ config }: ConfigContext): ExpoConfig => ({ | |
| 31 | ...config, | |
| 32 | name, | |
| 33 | slug: "g1t", | |
| 34 | owner: process.env.EAS_OWNER, | |
| 35 | version: "0.1.0", | |
| 36 | orientation: "portrait", | |
| 37 | icon: "./assets/images/icon.png", | |
| 38 | // g1t:// links, as on the desktop, and where sign-in comes back to. | |
| 39 | scheme: "g1t", | |
| 40 | userInterfaceStyle: "automatic", | |
| 41 | backgroundColor: BACKGROUND, | |
| 42 | ios: { | |
| 43 | bundleIdentifier: id, | |
| 44 | supportsTablet: true, | |
| 45 | config: { usesNonExemptEncryption: false }, | |
| 46 | }, | |
| 47 | android: { | |
| 48 | package: id, | |
| 49 | adaptiveIcon: { | |
| 50 | backgroundColor: BACKGROUND, | |
| 51 | foregroundImage: "./assets/images/android-icon-foreground.png", | |
| 52 | monochromeImage: "./assets/images/android-icon-monochrome.png", | |
| 53 | }, | |
| 54 | predictiveBackGestureEnabled: true, | |
| 55 | softwareKeyboardLayoutMode: "resize", | |
| 56 | }, | |
| 57 | plugins: [ | |
| 58 | "expo-router", | |
| 59 | "expo-secure-store", | |
| 60 | "expo-web-browser", | |
| 61 | [ | |
| 62 | "expo-splash-screen", | |
| 63 | { | |
| 64 | backgroundColor: BACKGROUND, | |
| 65 | image: "./assets/images/splash-icon.png", | |
| 66 | imageWidth: 96, | |
| 67 | }, | |
| 68 | ], | |
| 69 | ], | |
| 70 | experiments: { | |
| 71 | reactCompiler: true, | |
| 72 | }, | |
| 73 | runtimeVersion: { policy: "appVersion" }, | |
| 74 | ...(projectId ? { updates: { url: `https://u.expo.dev/${projectId}` } } : {}), | |
| 75 | extra: { | |
| 76 | ...config.extra, | |
| 77 | ...(projectId ? { eas: { projectId } } : {}), | |
| 78 | }, | |
| 79 | }); |