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

Function project

__tests__/nextjs-proxy.test.ts:205–213  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

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' } });

Callers 1

Calls 5

pushMethod · 0.80
initSyncMethod · 0.80
writeFunction · 0.70
joinMethod · 0.45
indexAllMethod · 0.45

Tested by

no test coverage detected