()
| 70 | } |
| 71 | |
| 72 | async function updateTsconfig() { |
| 73 | const tsconfig = { |
| 74 | files: [], |
| 75 | exclude: ['node_modules'], |
| 76 | references: appsWithPkgJson.map(a => ({ |
| 77 | path: relativeToWorkshopRoot(a).replace(/\\/g, '/'), |
| 78 | })), |
| 79 | } |
| 80 | const written = await writeIfNeeded( |
| 81 | path.join(workshopRoot, 'tsconfig.json'), |
| 82 | `${JSON.stringify(tsconfig, null, 2)}\n`, |
| 83 | { parser: 'json' }, |
| 84 | ) |
| 85 | |
| 86 | if (written) { |
| 87 | // delete node_modules/.cache |
| 88 | const cacheDir = path.join(workshopRoot, 'node_modules', '.cache') |
| 89 | if (exists(cacheDir)) { |
| 90 | await fs.promises.rm(cacheDir, { recursive: true }) |
| 91 | } |
| 92 | console.log('all fixed up') |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | async function writeIfNeeded(filepath, content) { |
| 97 | const oldContent = await fs.promises.readFile(filepath, 'utf8') |
no test coverage detected