( componentName: string )
| 40 | * Retrieves component information from info.json file |
| 41 | */ |
| 42 | export async function getComponentInfo( |
| 43 | componentName: string |
| 44 | ): Promise<ComponentInfo | null> { |
| 45 | const { componentsPath } = await ensureSourcePaths(); |
| 46 | const infoPath = path.join(componentsPath, componentName, "info.json"); |
| 47 | |
| 48 | if (!(await fs.pathExists(infoPath))) { |
| 49 | return null; |
| 50 | } |
| 51 | |
| 52 | const info = await fs.readJson(infoPath); |
| 53 | return info as ComponentInfo; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Gets list of all available components by scanning for directories with info.json |
no test coverage detected