| 203 | } |
| 204 | |
| 205 | async function project(files: Record<string, string>): Promise<{ cg: CodeGraph; dir: string }> { |
| 206 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-next-proxy-')); |
| 207 | dirs.push(dir); |
| 208 | for (const [rel, content] of Object.entries(files)) write(dir, rel, content); |
| 209 | const cg = CodeGraph.initSync(dir); |
| 210 | graphs.push(cg); |
| 211 | await cg.indexAll(); |
| 212 | return { cg, dir }; |
| 213 | } |
| 214 | |
| 215 | const page = (name: string): string => `export default function ${name}() {\n return null\n}\n`; |
| 216 | const manifest = (next: string): string => JSON.stringify({ name: 'web', dependencies: { next, react: '19.0.0' } }); |