(
filter?: { type?: ItemType },
options: ResolveOptions = {},
)
| 28 | * if the registry is unreachable — callers should fall back to bundled items. |
| 29 | */ |
| 30 | export async function listRegistryItems( |
| 31 | filter?: { type?: ItemType }, |
| 32 | options: ResolveOptions = {}, |
| 33 | ): Promise<RegistryManifestEntry[]> { |
| 34 | const baseUrl = options.baseUrl ?? DEFAULT_REGISTRY_URL; |
| 35 | const manifest = await fetchRegistryManifest(baseUrl, { skipCache: options.skipCache }); |
| 36 | if (!manifest) return []; |
| 37 | if (!filter?.type) return manifest.items; |
| 38 | return manifest.items.filter((item) => item.type === filter.type); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Load every item's full manifest in parallel. Used by the interactive init |
no test coverage detected