()
| 31 | // fake platform package, when present, is written as a resolvable sibling so the |
| 32 | // SDK's `require.resolve('@colbymchenry/codegraph-<target>/...')` walks to it. |
| 33 | function makeConsumer(): { root: string; mainPkg: string } { |
| 34 | const root = mkTmp('consumer'); |
| 35 | const mainPkg = path.join(root, 'node_modules', '@colbymchenry', 'codegraph'); |
| 36 | fs.mkdirSync(mainPkg, { recursive: true }); |
| 37 | fs.copyFileSync(SDK_SRC, path.join(mainPkg, 'npm-sdk.js')); |
| 38 | fs.writeFileSync( |
| 39 | path.join(mainPkg, 'package.json'), |
| 40 | JSON.stringify({ name: '@colbymchenry/codegraph', version: VERSION, main: 'npm-sdk.js' }) + '\n' |
| 41 | ); |
| 42 | return { root, mainPkg }; |
| 43 | } |
| 44 | |
| 45 | // Write a fake compiled library that exports a sentinel, at the given lib/dist |
| 46 | // root (used both for the platform package and the self-heal cache bundle). |
no test coverage detected