Skip to content

API/TypeSchema: respect tree shaking and fix package attribution in introspection output - #197

Merged
ryukzak merged 5 commits into
mainfrom
fix/introspection-output
Jul 22, 2026
Merged

API/TypeSchema: respect tree shaking and fix package attribution in introspection output#197
ryukzak merged 5 commits into
mainfrom
fix/introspection-output

Conversation

@ryukzak

@ryukzak ryukzak commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Introspection fixes

  • `introspection({ fhirSchemas, structureDefinitions })` now dumps only schemas present in the (tree-shaken) TypeSchema index, mirroring the existing `typeSchemas` behavior. Previously both options dumped the entire register.
  • `allSd()` now stamps the fallback `package_name`/`package_version` from the resolution's source package instead of the containing package index, so StructureDefinitions are attributed to the package that actually declares them.

Both problems surfaced when generating a tree-shaken profile from a multi-package canonical-manager input (`kbv.basis@1.9.0`, single profile):

Before:

introspection (5535 files, 2967 kloc):
  fhir-schemas/...                          2579 files across 11 packages
  structure-definitions/kbv.basis/          2579 files  <- every SD, incl. R4 core, attributed to kbv.basis

After:

introspection (499 files, 56 kloc):
  fhir-schemas/hl7.fhir.r4.core/            60 files
  fhir-schemas/kbv.basis/                   1 file
  structure-definitions/hl7.fhir.r4.core/   62 files
  structure-definitions/de.basisprofil.r4/  1 file
  structure-definitions/hl7.fhir.uv.extensions.r4/ 1 file
  structure-definitions/kbv.basis/          2 files

CI fixes

@ryukzak

ryukzak commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

Added two commits to make CI green:

@ryukzak
ryukzak merged commit 931aacf into main Jul 22, 2026
35 checks passed
@ryukzak
ryukzak deleted the fix/introspection-output branch July 22, 2026 12:42
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.

2 participants