Skip to content

feat: add Expo example app - #47

Merged
lam0819 merged 1 commit into
mainfrom
agent/sarah-kay-sonnet-5-5/a22fc066cfd6
Nov 26, 2026
Merged

lam0819 merged 1 commit into
mainfrom
agent/sarah-kay-sonnet-5-5/a22fc066cfd6

Conversation

@lam0819

@lam0819 lam0819 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds example-expo/, a minimal Expo app that uses the library through its config plugin. Follow-up to the competitor review: react-native-health-connect ships an Expo example, and we only had a bare RN one.

The app shows four things:

  1. Health Connect availability, with a button to install or open it when missing.
  2. A READ_STEPS permission request.
  3. Step records for the last 7 days.
  4. An aggregate step total (COUNT_TOTAL) for the same 7 days.

Setup

  • Expo SDK 58, which bundles React Native 0.88.1, the same version as the repo.
  • Dev client (expo-dev-client), not Expo Go.
  • app.json registers the config plugin with permissions: [READ_STEPS]. It also sets minSdkVersion 29 with expo-build-properties, because Expo's default is lower than the library's minimum.
  • metro.config.js uses react-native-monorepo-config so Metro resolves the library from this repo's source.
  • android/ is generated by prebuild and git-ignored.

Repo wiring

  • example-expo is added to the yarn workspaces, with a new yarn example:expo script.
  • CI: the lint job gains a yarn example:expo typecheck step. No Expo Android build in CI; it would be a second full Gradle build.
  • Root tsconfig.json: now excludes example-expo, which has its own tsconfig, and lib/. Without the lib/ exclusion, yarn typecheck and the pre-commit hook fail after yarn prepare, because they pick up the generated .d.ts files.
  • ESLint: ignores example-expo/, the same as example/.

Docs

  • README: the "Expo setup" section now covers the dev-client steps (npx expo prebuild, npx expo run:android) and the minSdk 29 note, and links the example.
  • docs/install.html: new step "04 Expo" with the app.json snippet, the commands and a link to the example. The later steps are renumbered.
  • example-expo/README.md: run instructions.

Verification (local)

  • npx expo prebuild --platform android succeeds. The generated manifest has health.READ_STEPS, both Health Connect intent filters (ACTION_SHOW_PERMISSIONS_RATIONALE, and VIEW_PERMISSION_USAGE + HEALTH_PERMISSIONS), and android.minSdkVersion=29. Autolinking resolves the library.
  • npx expo export --platform android: Metro bundles the app (601 modules).
  • Checks:
    • yarn example:expo typecheck passes, and fails as expected when I add a deliberate type error.
    • yarn typecheck, yarn lint and yarn test --coverage pass (231 tests, coverage gates met).
    • yarn install --immutable and .github/scripts/check-versions.sh pass.
  • Not done: I did not run npx expo run:android on a device. There is no Android SDK on this runner.

No library code changes; the supported RN range is unchanged.

Add example-expo/, a minimal Expo SDK 58 (RN 0.88) dev-client app that
uses the config plugin and shows availability, permission request, the
last 7 days of steps and an aggregate.

- Wire it into the yarn workspaces (yarn example:expo).
- Typecheck it in CI (lint job).
- Exclude build output (lib/) from the root tsconfig so typecheck passes
  after yarn prepare.
- Document Expo dev-client setup in README and docs/install.html.
@lam0819
lam0819 merged commit 7bfcebb into main Nov 26, 2026
8 checks passed
@lam0819
lam0819 deleted the agent/sarah-kay-sonnet-5-5/a22fc066cfd6 branch November 26, 2026 15:16
@lam0819 lam0819 mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant