MCPcopy Index your code
hub / github.com/craftreactnative/ui / getComponentInfo

Function getComponentInfo

cli/src/utils/component-manager.ts:42–54  ·  view source on GitHub ↗
(
  componentName: string
)

Source from the content-addressed store, hash-verified

40 * Retrieves component information from info.json file
41 */
42export 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

Callers 2

addCommandFunction · 0.90
resolveDependenciesFunction · 0.85

Calls 1

ensureSourcePathsFunction · 0.85

Tested by

no test coverage detected