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