ReviewOS

also looking at this

stacks/dtsx

chore(deps): update all non-major dependencies

#2997
Closed renovate[bot] wants to merge renovate/all-minor-patch into main
29 files +1047 -444
packages/dtsx/bin/emit.tsmodified+14-4
Changes to packages/dtsx/bin/emit.ts
@@ -11,11 +11,21 @@ if (cmd === '--project') {
1111 const outdir = args[3]
1212 const files = readdirSync(dir).filter(f => f.endsWith('.ts') && !f.endsWith('.d.ts'))
1313
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])
1823 }
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 )
1929}
2030else if (cmd === 'emit' && args[1]) {
2131 const filePath = args[1]