(files: Record<string, string>)
| 30 | }); |
| 31 | |
| 32 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 33 | tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-jsx-work-')); |
| 34 | fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"dependencies":{"react":"^18.0.0"}}'); |
| 35 | for (const [file, content] of Object.entries(files)) fs.writeFileSync(path.join(tmpDir, file), content); |
| 36 | cg = CodeGraph.initSync(tmpDir); |
| 37 | await cg.indexAll(); |
| 38 | return cg; |
| 39 | } |
| 40 | |
| 41 | /** What each named function renders, by jsx-render edge. */ |
| 42 | const renders = (graph: CodeGraph, name: string): string[] => { |
no test coverage detected