Skip to content

Auto-collect extension dependencies and add ignoreExtensions#103

Merged
ryukzak merged 6 commits intomainfrom
auto-collect-extension-deps
Mar 13, 2026
Merged

Auto-collect extension dependencies and add ignoreExtensions#103
ryukzak merged 6 commits intomainfrom
auto-collect-extension-deps

Conversation

@ryukzak
Copy link
Copy Markdown
Collaborator

@ryukzak ryukzak commented Mar 13, 2026

Renames

  • ProfileExtension.valueTypesvalueFieldTypes
  • ExtensionSubField.valueTypevalueFieldType

Auto-collect extension dependencies

  • Add profile?: ProfileIdentifier field to ProfileExtension, resolved from extension canonical URL
  • Add extractExtensionDeps helper that collects all dependency identifiers from a profile extension (value field types, profile identifier, sub-extension value types)
  • Fix incorrect package metadata on sub-extension identifiers: use buildFieldType instead of manually constructing identifiers with wrong package info
  • Use extractExtensionDeps in transformer and tree shake to auto-collect extension definition schemas as dependencies

ignoreExtensions tree shake rule

  • Add ignoreExtensions?: string[] to TreeShakeRule for excluding specific extensions from a profile by canonical URL
  • Recalculate dependencies after filtering so ignored extension deps are excluded

Generation config changes

Extension definitions used by profiles are now included automatically — no need to list them manually in tree shake config.

Before:

treeShake: {
    "hl7.fhir.us.core": {
        "http://.../us-core-patient": {},
        "http://.../us-core-blood-pressure": {},
        "http://.../us-core-body-weight": {},
        "http://.../us-core-ethnicity": {},
        "http://.../us-core-race": {},
        "http://.../us-core-tribal-affiliation": {},
        "http://.../us-core-individual-sex": {},
        "http://.../us-core-interpreter-needed": {},
    },
}

After:

treeShake: {
    "hl7.fhir.us.core": {
        "http://.../us-core-patient": {},
        "http://.../us-core-blood-pressure": {},
        "http://.../us-core-body-weight": {},
    },
}

@ryukzak ryukzak merged commit 05a759c into main Mar 13, 2026
31 checks passed
@ryukzak ryukzak deleted the auto-collect-extension-deps branch March 13, 2026 13:19
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