10 lines
659 B
TypeScript
Executable file
10 lines
659 B
TypeScript
Executable file
import { Project, SyntaxKind } from 'ts-morph';
|
|
const project = new Project({ tsConfigFilePath: 'C:/ScriptoriumAI/scriptoriumai-ui/tsconfig.json' });
|
|
const sourceFile = project.getSourceFileOrThrow('C:/ScriptoriumAI/scriptoriumai-ui/src/pages/Runboard.tsx');
|
|
|
|
const functions = sourceFile.getFunctions().filter(f => f.getName() && f.getName().startsWith('Runboard') && f.getName() !== 'Runboard');
|
|
|
|
console.log('Sub-components Candidates in Runboard.tsx:');
|
|
functions.sort((a,b) => b.getEnd() - b.getStart() - (a.getEnd() - a.getStart())).slice(0, 15).forEach(f => {
|
|
console.log(f.getName(), 'Lines:', f.getEndLineNumber() - f.getStartLineNumber());
|
|
});
|