MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / renders

Function renders

__tests__/jsx-render-outside-function.test.ts:35–47  ·  view source on GitHub ↗

Every jsx-render edge, as `source kind:name@file -> target name@file`.

()

Source from the content-addressed store, hash-verified

33
34 /** Every jsx-render edge, as `source kind:name@file -> target name@file`. */
35 async function renders(): Promise<string[]> {
36 cg = await CodeGraph.init(dir, { silent: true });
37 await cg.indexAll();
38 const db = (cg as any).db.db;
39 return db
40 .prepare(
41 `SELECT s.kind || ':' || s.name || '@' || s.file_path || ' -> ' || t.name || '@' || t.file_path AS e
42 FROM edges e JOIN nodes s ON s.id = e.source JOIN nodes t ON t.id = e.target
43 WHERE json_extract(e.metadata, '$.synthesizedBy') = 'jsx-render' ORDER BY e`
44 )
45 .all()
46 .map((r: any) => r.e);
47 }
48
49 const CARD = [
50 'export function Card() { return <div>card</div>; }',

Calls 5

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
initMethod · 0.45
indexAllMethod · 0.45

Tested by

no test coverage detected