Repository navigation
feat: @kingstinct/exact-healthkit, HealthKit for Exact apps - #402
Draft
robertherber wants to merge 4 commits into
Draft
robertherber wants to merge 4 commits into
robertherber wants to merge 4 commits into
Conversation
New package @kingstinct/exact-healthkit: react-native-healthkit's functionality as an Exact (github.com/expo/exact) package, an interface (exact.json) with a Swift implementation for iOS. Reads are live through HealthKit observer queries; under Exact's agent it answers from an in-memory fixture store. Background delivery is not supported yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5373331 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
HealthKit fills in a sample's source revision when it stores it, so the object the package made answered an empty source. A save now reads the stored copy back by uuid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Exact app using @kingstinct/exact-healthkit, the Exact counterpart of apps/example: Today (activity and the week's steps), Workouts (list and detail) and Log (save a weight). app.test.contract covers the screen before access; test/drive.mjs drives the flows after it under the agent. The example installs the package with file: outside the Bun workspace, since Exact builds packages only from the app's own node_modules. The package's fixture gains a week of steps, energy, distance and weights. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new package,
packages/exact-healthkit(@kingstinct/exact-healthkit). It exposes react-native-healthkit's functionality as an Exact package: an interface (exact.json, 53 names, 56 shapes) and a Swift implementation for iOS (apple/).HKObserverQueryper sample type re-asks the type's readers when it changes. This replacessubscribeToChangesand the hooks.healthkit.read.<id>,healthkit.share.<id>).requestAuthorizationasks for all of them in one sheet. A read of a type never asked for fails withNotAllowedError. A denied read answers only the app's own samples, as HealthKit does.fixture/health.json(compiled in) and keeps what the app saves and deletes.scripts/manifest.mjsgeneratesexact.json.scripts/tables.mjsgeneratesapple/Tables.swiftfrom react-native-healthkit's HealthKit schema.bun run checkfails when either is stale.The README has the full mapping from the RN API: dates in ms, metadata as entries,
anyOf/allOf/noneOffilters, workout proxy methods takingworkoutUuid.Example app
apps/exact-exampleis an Exact app using the package, the counterpart ofapps/example. It has three tabs:iPhone 18 Pro simulator, under Exact's agent over the package's fixture. Log is shown after saving 71.9 kg, which tops the recent list.
It sits outside the Bun workspace (root
workspacesis nowapps/exampleandpackages/*) and installs the package withfile:, because Exact builds a package only from the app's ownnode_modules. It expects anexactcheckout next to the repo, orEXACTset.Not included
Repo changes outside the package
biome.jsonignores the generatedexact.json.tsconfig.jsonexcludestest/fixture, whose types only exist inside an Exact app.bun.lockgains the new workspace.Test plan
dcf4dd8b).EXACT_DIR=… bun test/drive.mjson an iPhone 18 Pro simulator under the agent: 9/9. Covers the read before asking, permission, fixture reads (samples, statistics, a filtered read, a daily max collection), a save read back, and deny.bun exact.mjs test ios(1/1, before access) andbun test/drive.mjs(7/7: Today, Workouts and its detail, a weight saved and read back) on the simulator under the agentbun lint,bun typecheck,bun run checkagent ios --bind exact-healthkit, with Health access pre-granted byapplesimutils). Reads,requestAuthorizationandsaveQuantitySampleall go through real HealthKit. The observer query refreshed the reads after the save, and a filter became the expectedNSPredicate. This run found and fixed one bug: saves answered the unsaved object, whose source revision was empty.🤖 Generated with Claude Code