()
| 85 | } |
| 86 | |
| 87 | async function updateTsconfig() { |
| 88 | const tsconfig = { |
| 89 | files: [], |
| 90 | exclude: ['node_modules'], |
| 91 | references: appsWithPkgJson.map((a) => ({ |
| 92 | path: relativeToWorkshopRoot(a).replace(/\\/g, '/'), |
| 93 | })), |
| 94 | } |
| 95 | const written = await writeIfNeeded( |
| 96 | path.join(workshopRoot, 'tsconfig.json'), |
| 97 | `${JSON.stringify(tsconfig, null, 2)}\n`, |
| 98 | { parser: 'json' }, |
| 99 | ) |
| 100 | |
| 101 | if (written) { |
| 102 | // delete node_modules/.cache |
| 103 | const cacheDir = path.join(workshopRoot, 'node_modules', '.cache') |
| 104 | if (exists(cacheDir)) { |
| 105 | await fs.promises.rm(cacheDir, { recursive: true }) |
| 106 | } |
| 107 | console.log('all fixed up') |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | async function writeIfNeeded(filepath, content) { |
| 112 | const oldContent = await fs.promises.readFile(filepath, 'utf8') |
no test coverage detected