alysivji / alysivji/fhir-zod

Ship machine-readable capability metadata

Offen
#68 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
3
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Summary

Ship a generated machine-readable capability artifact so agents and tools can discover supported resource import paths without scraping markdown docs.

This should come from the same release-derived inventory used to build the versions/resource inventory docs.

## Recommended packaging direction

Use a generated JSON subpath export, not a JavaScript helper.

The first version should stay intentionally small and diff-friendly.

## Proposed v1 shape

```json
{
"versions": {
"r4": {
"resources": [
{
"name": "Patient",
"importPath": "fhir-zod/r4/Patient"
}
]
}
}
}
```

Locked v1 fields:

- top-level `versions`
- release ids: `stu3`, `r4`, `r4b`, `r5`
- per-version `resources`
- per-resource `name`
- per-resource `importPath`

Do not include descriptions, HL7 URLs, or extra metadata in v1 unless a concrete consumer requires them.

## Source of truth

- derive the artifact from the same release inventory used by `scripts/generate-supported-resources-doc.ts`
- prefer extracting a shared inventory builder used by both docs generation and metadata generation
- do not maintain separate handwritten inventories for docs and metadata

## Generation and publishing requirements

- generate from handwritten script code, not from generated runtime source files
- support the same fresh-checkout fallback behavior as the versions/resource inventory docs when `.local/spec-cache` is absent
- publish the artifact in `dist/`
- add a package `exports` entry and include it in published files

## Tests to add

- generated metadata contains all supported releases
- includes canonical import paths such as `fhir-zod/r4/Patient`
- works when spec cache is present
- falls back cleanly to committed generated output on a fresh checkout
- package export tests verify the JSON subpath is published and importable
- docs inventory and metadata inventory stay aligned via a shared test or snapshot

## Acceptance criteria

- agents and tools can discover supported resource import paths without scraping prose docs
- docs and metadata are driven by one inventory source
- the artifact is minimal, stable, and diff-friendly
- no runtime package code needs to execute to read the metadata

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.