CLAUDE.md — mobile#
The Expo app under /mobile. Read with the root CLAUDE.md and the shared rules it points to
(ask-don't-guess, TDD, DDD) and doc/mobile/, which says how it is built, run and tested.
Expo changes faster than anyone's memory of it#
Expo ships breaking changes with every SDK. Before writing code against an Expo, EAS or React
Native API, read the docs for the SDK in package.json (https://docs.expo.dev/versions/v<major>.0.0/,
or any page with .md appended), not what you remember. Add Expo packages with
npx expo install <package>, which picks the version matching the SDK; never npm install one.
Rules#
ios/andandroid/are generated bynpx expo prebuildand never committed. Native configuration goes inapp.config.tsor a config plugin.- Builds run on GitHub Actions, not EAS (
doc/decisions/mobile-app.md). - A dependency is patched only through
patches/, withpatch-package, applied on everynpm cibypostinstall-- never by editingnode_modulesand hoping. Each patch says why in its code, andsrc/patches.test.tschecks it is in place (doc/decisions/mobile-app.md). An Expo module patched for Android must also be listed inexpo.autolinking.android.buildFromSource: Expo ships them precompiled, and the APK would otherwise never see the patch. - The website's code comes in through
src/web.tsonly. Generated types and validators, texts, date and importance rules: used, never copied. Every text is in the website's catalogue,frontend/src/i18n/messages.ts, in both languages — one only the app shows too, with a comment saying so. Its test counts the app's code as a use, so an entry neither side shows any more fails it. There is deliberately noshared/package yet (doc/decisions/mobile-app.md). - Installed apps are older than their backend (#268,
doc/releasing.md). Every request names the app's release inX-TaskFest-App; the app checks/api/version'sminimumAppVersionat start and asks for an update when it is too old; and it reads an enum value it does not know as unknown instead of refusing the response. - No router yet. One screen;
src/Main.tsxis the root. Expo Router took the sign-in's return link for a page and remounted the app mid-sign-in, so it comes back only with screens to route. - A 64-bit integer in an Expo module's event is a BigInt on iOS since SDK 58, whatever its
types say: expo-file-system's upload progress was, and a BigInt mixed with a number in arithmetic
throws, which ended the app (#682). Turn such a value into a number where it enters the app, as
fractionSentdoes. A property such asFile.sizestill arrives as a number. - Coverage has a floor (
jest.coverageThresholdinpackage.json): raise it when coverage rises, never lower it to land a change. - The backend is sent the app session's token (#281): every sign-in trades the provider's ID
token for one, once (
src/staySignedIn.ts,doc/mobile/sign-in.md). Never the access token, and every response is checked with the generated validators before it is read. - Tokens live in the keychain (
expo-secure-store), never in AsyncStorage or a file. - Colours come from the website (
src/theme.ts, checked againstfrontend/src/App.css). - TSDoc on every module and exported type, saying what it is for, as in
frontend/CLAUDE.md. - Test first: Jest with
jest-expoand React Native Testing Library for logic and components, Maestro (maestro/) for the built app. The fixtures the tests share -- the clock, a session, a board, stores in memory anddependencies()-- live insrc/testing.ts; a test file overrides what differs for it.