Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

fix: add default registry resolve

vholikdc7c0714282b
diff --git a/packages/cli/src/registry/resolver.ts b/packages/cli/src/registry/resolver.ts
index 8ac9e8b30..75eb56bce 100644
--- a/packages/cli/src/registry/resolver.ts
+++ b/packages/cli/src/registry/resolver.ts
@@ -14,6 +14,7 @@ import {
registryResolvedItemsTreeSchema,
} from "./schema";
import { isLocalFile, isUrl } from "./utils";
+import { REGISTRY_URL } from "./constants";
const registryBlockWithSourceSchema = registryItemSchema.extend({
_source: z.string().optional(),
@@ -77,7 +78,14 @@ export async function fetchRegistryBlocks(blocks: string[], config: Config) {
}
}
- throw new RegistryParseError(block, new Error("Invalid registry item"));
+
+ const path = `${REGISTRY_URL}/${block}.json`
+ const [result] = await fetchRegistry([path])
+ try {
+ return registryItemSchema.parse(result)
+ } catch (error) {
+ throw new RegistryParseError(block, error)
+ }
})
);
@@ -190,9 +198,9 @@ async function resolveDependenciesRecursively(
if (block.registryDependencies) {
const resolvedDeps = config?.registries
? resolveRegistryBlocksFromRegistries(
- block.registryDependencies,
- config
- )
+ block.registryDependencies,
+ config
+ )
: block.registryDependencies;
const nested = await resolveDependenciesRecursively(