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

Function issueLayout

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

The issue's layout: an app importing `left-pad2`, a sibling folder (outside the app) named that.

(app: Record<string, unknown>, extra: Files = {})

Source from the content-addressed store, hash-verified

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 {
45 return layout({
46 'app/package.json': JSON.stringify({ name: 'app', ...app, dependencies: { 'left-pad2': '^1.0.0' } }),
47 'app/src/util.ts': 'export function pad(s: string) { return s; }\n',
48 'app/src/main.ts': "import { pad } from 'left-pad2';\nexport function run() { return pad('x'); }\n",
49 'sibling/package.json': JSON.stringify({ name: 'left-pad2', main: 'index.ts' }),
50 'sibling/index.ts': 'export function pad(s: string) { return s; }\n',
51 ...extra,
52 });
53}
54
55async function calleesOfRun(project: string): Promise<string[]> {
56 const cg = CodeGraph.initSync(project);

Calls 1

layoutFunction · 0.70

Tested by

no test coverage detected