Breaking for imports of @template-cloudflare/api. The four aliases the native app still used, ./routers/{todo,integrations,billing,notifications}.schema, are no longer exported. Import @template-cloudflare/api/<feature>/contract instead; the api package reference lists the pairs. The web app already used the canonical subpaths, and the app's screens and behaviour do not change.
- Feature folders in the native app.
apps/mobile/src/components,hooksandlibare gone. Each feature lives in one flatsrc/features/<feature>/folder with the backend's names (todo,notifications,billing,integrations,app-config, andorganizations,settings,auth,app-shell,dashboard,app-lock,onboarding), and cross-cutting code insrc/platform/(rpc, auth session, i18n, feedback, review, theme, runtime). Files are named<feature>.<role>:screen,hooks, components and models. Mobile app, ADR-0013. - Routes only return screens. The 27 expo-router routes stay at the same paths, with the same scheme and deep links. Each route now renders a feature screen, and the root providers moved to
src/platform/app/root-providers.tsx. No route or screen reads data directly any more: queries and mutations live in hooks. The root layout keeps its module-scope splash and theme calls. - Checked in
pnpm test.scripts/mobile-feature-boundaries.test.mjsholds the layers, cross-feature edges, platform variants, the route list, the API subpaths and Vitest's coverage of every test file; the import cycle test coversapps/mobile/src; the mobile lint warns on long files. The client boundary from ADR-0002 is unchanged. - Removal recipes follow.
optional-features.jsonand the task, MCP and billing removal scripts target the new files; removing the task demo deletesfeatures/todoandfeatures/notificationswhole. - The
domain-featureskill covers mobile.references/mobile.mdand three templates describe a native screen over a contract and its device-free gates.
Measurements (report): after the moves, the iOS and Android sourcemaps of expo export listed the same modules under the new names; the screen extraction adds 35 files and removes none. The JavaScript bundle grows by 11.5 KB raw and 2 KB gzip, the module wrappers of those files. The Hermes bytecode is 55 KB smaller on iOS and 13.8 KB larger on Android, both within 1 %. expo config is unchanged. Nothing was run on a simulator or device; a device check before the next release is recommended.