refactor(cli): make getComponentURL handle only file component
This commit is contained in:
parent
9b0b37ec01
commit
6d3f29a614
@ -1,4 +1,4 @@
|
|||||||
import {REGISTRY_URL, Registry} from '../const.js'
|
import {Registry, REGISTRY_URL, RegistryComponent} from '../const.js'
|
||||||
import {safeFetch} from './safeFetcher.js'
|
import {safeFetch} from './safeFetcher.js'
|
||||||
|
|
||||||
export async function getRegistry(
|
export async function getRegistry(
|
||||||
@ -19,15 +19,6 @@ export async function getRegistry(
|
|||||||
return registryResponse
|
return registryResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getComponentURL(
|
export async function getComponentURL(registry: Registry, component: RegistryComponent): Promise<string> {
|
||||||
registry: Registry,
|
return registry.base + registry.paths.components.replace('{componentName}', component.name)
|
||||||
componentName: string,
|
|
||||||
dirComponentFile?: string,
|
|
||||||
): Promise<string> {
|
|
||||||
let base =
|
|
||||||
registry.base + registry.paths.components.replace('{componentName}', registry.components[componentName].name)
|
|
||||||
if (dirComponentFile) {
|
|
||||||
base += '/' + dirComponentFile
|
|
||||||
}
|
|
||||||
return base
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user