also looking at this
chore(deps): update all non-major dependencies
#2997
29 files
+1047
-444
| @@ -11,11 +11,21 @@ if (cmd === '--project') { | ||
| 11 | 11 | const outdir = args[3] |
| 12 | 12 | const files = readdirSync(dir).filter(f => f.endsWith('.ts') && !f.endsWith('.d.ts')) |
| 13 | 13 | |
| 14 | for (const file of files) { | |
| 15 | const source = readFileSync(join(dir, file), 'utf-8') | |
| 16 | const dts = processSource(source, file) | |
| 17 | writeFileSync(join(outdir, file.replace(/\.ts$/, '.d.ts')), dts) | |
| 14 | // Read all files in parallel using Bun.file() | |
| 15 | const sources = await Promise.all( | |
| 16 | files.map(f => Bun.file(join(dir, f)).text()), | |
| 17 | ) | |
| 18 | ||
| 19 | // Process all files (CPU-bound, sequential) | |
| 20 | const results: string[] = new Array(files.length) | |
| 21 | for (let i = 0; i < files.length; i++) { | |
| 22 | results[i] = processSource(sources[i], files[i]) | |
| 18 | 23 | } |
| 24 | ||
| 25 | // Write all files in parallel using Bun.write() | |
| 26 | await Promise.all( | |
| 27 | files.map((f, i) => Bun.write(join(outdir, f.replace(/\.ts$/, '.d.ts')), results[i])), | |
| 28 | ) | |
| 19 | 29 | } |
| 20 | 30 | else if (cmd === 'emit' && args[1]) { |
| 21 | 31 | const filePath = args[1] |