diff --git a/packages/cli/src/helpers/registry.ts b/packages/cli/src/helpers/registry.ts index dcecebd..7c795f5 100644 --- a/packages/cli/src/helpers/registry.ts +++ b/packages/cli/src/helpers/registry.ts @@ -30,3 +30,18 @@ export async function getComponentRealname( ): Promise { return registry.components[componentName].name } + +export async function getComponentLibVersion( + registry: Registry, + componentName: keyof (typeof registry)['components'], +): Promise { + const libVersion = registry.components[componentName].libVersion + if (!registry.lib.includes(libVersion)) { + return null + } + return libVersion +} + +export async function getLibURL(registry: Registry, version: string): Promise { + return registry.base + registry.paths.lib.replace('{version}', version) +}