diff --git a/packages/cli/src/helpers/registry.ts b/packages/cli/src/helpers/registry.ts index a048b6b..eaeccef 100644 --- a/packages/cli/src/helpers/registry.ts +++ b/packages/cli/src/helpers/registry.ts @@ -19,6 +19,18 @@ export async function getRegistry( return registryResponse } -export async function getComponentURL(registry: Registry, component: RegistryComponent): Promise { +export async function getComponentURL( + registry: Registry, + component: RegistryComponent & {type: 'file'}, +): Promise { return registry.base + registry.paths.components.replace('{componentName}', component.name) } + +export async function getDirComponentURL( + registry: Registry, + component: RegistryComponent & {type: 'dir'}, +): Promise { + const base = registry.base + registry.paths.components.replace('{componentName}', component.name) + + return component.files.map((filename) => base + '/' + filename) +}