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

Function layout

__tests__/workspace-outside-project.test.ts:33–41  ·  view source on GitHub ↗

A temp folder holding `files`; the project is its `app/` folder.

(files: Files)

Source from the content-addressed store, hash-verified

31
32/** A temp folder holding `files`; the project is its `app/` folder. */
33function layout(files: Files): string {
34 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-ws-outside-'));
35 roots.push(root);
36 for (const [file, text] of Object.entries(files)) {
37 fs.mkdirSync(path.dirname(path.join(root, file)), { recursive: true });
38 fs.writeFileSync(path.join(root, file), text);
39 }
40 return path.join(root, 'app');
41}
42
43/** The issue's layout: an app importing `left-pad2`, a sibling folder (outside the app) named that. */
44function issueLayout(app: Record<string, unknown>, extra: Files = {}): string {

Callers 2

issueLayoutFunction · 0.70

Calls 2

pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected