fix(cli): bypass stale cache on tag-based registry lookup (#648)

The add command's tag fallback (e.g. `hyperframes add html-in-canvas`)
uses the same 24h cached manifest as single-item lookups. When new items
are added to the registry, the stale cache returns an incomplete item
list, causing tag resolution to find zero matches.

Pass skipCache: true in the tag fallback path so it always fetches the
latest manifest from the registry.
This commit is contained in:
Miguel Ángel
2026-05-06 19:26:20 +02:00
committed by GitHub
parent 64f3a4ed5f
commit 35e71cb3f0
3 changed files with 9 additions and 4 deletions
+5 -2
View File
@@ -84,10 +84,13 @@ async function fetchJson<T>(url: string): Promise<T> {
*/
export async function fetchRegistryManifest(
baseUrl: string = DEFAULT_REGISTRY_URL,
options?: { skipCache?: boolean },
): Promise<RegistryManifest | undefined> {
const cacheFile = cachePath(baseUrl, "registry");
const cached = readCache<RegistryManifest>(cacheFile);
if (cached) return cached;
if (!options?.skipCache) {
const cached = readCache<RegistryManifest>(cacheFile);
if (cached) return cached;
}
try {
const manifest = await fetchJson<RegistryManifest>(`${baseUrl}/registry.json`);