feat: iOS 27 category types (MenopausalState, BleedingAfterMenopause) + generator fix for relocated HKWorkoutActivityType - #360
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 |
|
Hi @robertherber, any chance you would find some time to look at my PR this week? |
commit: |
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. |
Could you have a look at the failing CI stage? Guess CI might need to be upgraded to target a iOS 27 simulator. |
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.