openpetswithchatandmcp/website/analyze-size.ts
OpenPets Dev 65ac83849e Add 'website/' from commit '966aea480ffe1c340553aa878def30131d2af827'
git-subtree-dir: website
git-subtree-mainline: 8d3849caea
git-subtree-split: 966aea480f
2026-06-17 20:48:39 +00:00

7 lines
613 B
TypeScript
Executable file

import { Project } from 'ts-morph';
const project = new Project({ tsConfigFilePath: 'C:/ScriptoriumAI/scriptoriumai-ui/tsconfig.json' });
const sf = project.getSourceFileOrThrow('C:/ScriptoriumAI/scriptoriumai-ui/src/pages/Runboard.tsx');
const items = [...sf.getFunctions(), ...sf.getVariableStatements().flatMap(v => v.getDeclarations())];
items.sort((a,b) => b.getText().split('\n').length - a.getText().split('\n').length);
console.log('Top largest blocks:');
items.slice(0, 10).forEach(i => console.log(i.getName ? i.getName() : i.getText().substring(0, 30), '-', i.getText().split('\n').length, 'lines'));