Skip to content

feat: iOS 27 category types (MenopausalState, BleedingAfterMenopause) + generator fix for relocated HKWorkoutActivityType#360

Open
pkuczynski wants to merge 4 commits into
kingstinct:masterfrom
pkuczynski:feat/ios27-menopause-types
Open

feat: iOS 27 category types (MenopausalState, BleedingAfterMenopause) + generator fix for relocated HKWorkoutActivityType#360
pkuczynski wants to merge 4 commits into
kingstinct:masterfrom
pkuczynski:feat/ios27-menopause-types

Conversation

@pkuczynski

Copy link
Copy Markdown

What

iOS 27 adds two reproductive-health category types — HKCategoryTypeIdentifierMenopausalState and HKCategoryTypeIdentifierBleedingAfterMenopause. This regenerates the schema against the iOS 27 SDK to include them.

Regenerating against iOS 27 also surfaced a generator gap: iOS 27 relocated HKWorkoutActivityType out of HKWorkout.h into its own HKWorkoutActivityType.h, and the generator only read HKWorkout.h — so a regen on the iOS 27 SDK silently dropped the entire WorkoutActivityType enum. Fixed the generator to read the relocated header, with a fallback to HKWorkout.h on older SDKs.

Changes

  • Generator (scripts/healthkit-sdk.ts, scripts/generate-healthkit.ts): also read Headers/HKWorkoutActivityType.h when present (optional read; older SDKs keep the enum in HKWorkout.h). Keeps WorkoutActivityType from being dropped when regenerating on iOS 27.
  • Regression guard (scripts/verify-healthkit-sdk.ts): assert WorkoutActivityType is present with its full member set — mirrors the BloodKetones guard 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.
  • Generated (src/generated/healthkit.generated.ts, healthkit-schema.json): regenerated against the iOS 27 SDK — adds the two category identifiers (availability 27.0), the CategoryValueMenopausalState enum (menopause=1, perimenopause=2, none=3), and value-enum associations (MenopausalState → CategoryValueMenopausalState; BleedingAfterMenopause → CategoryValueVaginalBleeding, the shared iOS 18 enum).

Verification

  • Regenerated against the Xcode 27 / iOS 27 SDK with the matching toolchain.
  • bun typecheck && bun lint && bun test pass.
  • Enum ints checked against the SDK header HKCategoryValues.h (HKCategoryValueMenopausalState: Menopause = 1 / Perimenopause = 2 / None = 3).

Related

  • Restore BloodKetones quantity identifier and harden generator against symbol-graph omissions #354 hardens the generator against a different drop (HKQuantityTypeIdentifierBloodKetones, via symbol-graph omission). This is the same class of issue — a header-defined type missing from generated output — for WorkoutActivityType (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.

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b2a2e6a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kingstinct/react-native-healthkit Minor

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

@pkuczynski

Copy link
Copy Markdown
Author

Hi @robertherber, any chance you would find some time to look at my PR this week?

@robertherber
robertherber requested a review from Copilot July 17, 2026 06:31
@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/kingstinct/react-native-healthkit/@kingstinct/react-native-healthkit@360

commit: b2a2e6a

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HKWorkoutActivityType from HKWorkoutActivityType.h (while remaining compatible with older SDKs).
  • Add a verification guard to ensure WorkoutActivityType remains present after regeneration.
  • Regenerate the TypeScript + JSON schema artifacts to include the new iOS 27 category identifiers and CategoryValueMenopausalState (and update some quantity aggregationStyle strings 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',
)
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.

3 participants