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