Summary
src/generator/docs.ts starts the same JSDoc command once for every API directory, but the directory name is not passed to JSDoc.
.jsdoc.js recursively reads build/src and writes to the shared docs/ destination, so each invocation regenerates the full documentation tree.
Impact
On current main, there are 331 API directories. npm run docs therefore starts 331 identical JSDoc jobs, with up to ten writing to the same output directory concurrently. This adds substantial runtime and memory pressure and can produce nondeterministic output.
Proposed fix
Keep building the API index, then invoke JSDoc once for the complete built source tree.
Reproduction
Run npm run docs and observe that the JSDoc command is scheduled once per API directory even though each invocation has identical arguments and configuration.
Summary
src/generator/docs.tsstarts the same JSDoc command once for every API directory, but the directory name is not passed to JSDoc..jsdoc.jsrecursively readsbuild/srcand writes to the shareddocs/destination, so each invocation regenerates the full documentation tree.Impact
On current
main, there are 331 API directories.npm run docstherefore starts 331 identical JSDoc jobs, with up to ten writing to the same output directory concurrently. This adds substantial runtime and memory pressure and can produce nondeterministic output.Proposed fix
Keep building the API index, then invoke JSDoc once for the complete built source tree.
Reproduction
Run
npm run docsand observe that the JSDoc command is scheduled once per API directory even though each invocation has identical arguments and configuration.