feat: iOS 27 category types (MenopausalState, BleedingAfterMenopause) + generator fix for relocated HKWorkoutActivityType#360
Open
pkuczynski wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: b2a2e6a 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 |
Author
|
Hi @robertherber, any chance you would find some time to look at my PR this week? |
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the react-native-healthkit generation pipeline to support new iOS 27 HealthKit category types and to prevent a schema regression caused by HKWorkoutActivityType being relocated into its own header in the iOS 27 SDK.
Changes:
- Extend the SDK source loader + schema generator to optionally read
HKWorkoutActivityTypefromHKWorkoutActivityType.h(while remaining compatible with older SDKs). - Add a verification guard to ensure
WorkoutActivityTyperemains present after regeneration. - Regenerate the TypeScript + JSON schema artifacts to include the new iOS 27 category identifiers and
CategoryValueMenopausalState(and update some quantityaggregationStylestrings as part of the regen).
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-healthkit/src/generated/healthkit.generated.ts | Regenerated TS artifacts adding iOS 27 category identifiers, new menopausal value enum, and updated workout activity enum members. |
| packages/react-native-healthkit/src/generated/healthkit-schema.json | Regenerated schema JSON adding the new iOS 27 category identifiers and menopausal value enum (plus updated aggregationStyle strings). |
| packages/react-native-healthkit/scripts/verify-healthkit-sdk.ts | Adds a regression guard to ensure WorkoutActivityType exists after generation. |
| packages/react-native-healthkit/scripts/healthkit-sdk.ts | Loads HKWorkoutActivityType.h when present (optional header read) and surfaces it as a schema input. |
| packages/react-native-healthkit/scripts/generate-healthkit.ts | Combines workout headers for enum parsing so WorkoutActivityType is found regardless of header location. |
| .changeset/ios27-menopause-types.md | Adds a minor changeset documenting the new iOS 27 identifiers and generator hardening. |
Comment on lines
+57
to
+60
| assert.ok( | ||
| workoutActivityType.members.length > 50, | ||
| 'WorkoutActivityType should retain its full member set, not a stub', | ||
| ) |
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
iOS 27 adds two reproductive-health category types —
HKCategoryTypeIdentifierMenopausalStateandHKCategoryTypeIdentifierBleedingAfterMenopause. This regenerates the schema against the iOS 27 SDK to include them.Regenerating against iOS 27 also surfaced a generator gap: iOS 27 relocated
HKWorkoutActivityTypeout ofHKWorkout.hinto its ownHKWorkoutActivityType.h, and the generator only readHKWorkout.h— so a regen on the iOS 27 SDK silently dropped the entireWorkoutActivityTypeenum. Fixed the generator to read the relocated header, with a fallback toHKWorkout.hon older SDKs.Changes
scripts/healthkit-sdk.ts,scripts/generate-healthkit.ts): also readHeaders/HKWorkoutActivityType.hwhen present (optional read; older SDKs keep the enum inHKWorkout.h). KeepsWorkoutActivityTypefrom being dropped when regenerating on iOS 27.scripts/verify-healthkit-sdk.ts): assertWorkoutActivityTypeis present with its full member set — mirrors theBloodKetonesguard added in Restore BloodKetones quantity identifier and harden generator against symbol-graph omissions #354, so this drop can't silently regress on a future SDK bump.src/generated/healthkit.generated.ts,healthkit-schema.json): regenerated against the iOS 27 SDK — adds the two category identifiers (availability27.0), theCategoryValueMenopausalStateenum (menopause=1,perimenopause=2,none=3), and value-enum associations (MenopausalState → CategoryValueMenopausalState;BleedingAfterMenopause → CategoryValueVaginalBleeding, the shared iOS 18 enum).Verification
bun typecheck && bun lint && bun testpass.HKCategoryValues.h(HKCategoryValueMenopausalState:Menopause = 1 / Perimenopause = 2 / None = 3).Related
HKQuantityTypeIdentifierBloodKetones, via symbol-graph omission). This is the same class of issue — a header-defined type missing from generated output — forWorkoutActivityType(via header relocation). The two are complementary and touch overlapping files (scripts/generate-healthkit.ts, the generated artifacts), so whichever merges second will need a trivial rebase.