import { searchDependencies } from '../../../helpers/profileGeneratorHelper'; export async function includeDependency( componentPath: string, entityName: string, ): Promise<{ filePaths: string[]; associations: { taskId: string; pullerId: string; tableId: string; resultKey: string; } | null; } | null> { const dependencies = (await searchDependencies( entityName, componentPath, )) as any[]; if (!dependencies.length) { console.error( `Could not find dependency named ${entityName} in ${componentPath}`, ); return null; } const filePaths = dependencies .map((d) => d.__file_path) .filter(Boolean) .filter((v, i, a) => a.indexOf(v) === i); return { filePaths, associations: null }; }