From 2ffd777d72a4013b64ee379ab291d9c9840b1c9f Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Wed, 10 Dec 2025 21:11:27 -0500 Subject: [PATCH 1/2] fix(async): revert Promise.all refactor --- src/generators/ast-js/index.mjs | 12 +++++++++--- src/generators/ast/index.mjs | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/generators/ast-js/index.mjs b/src/generators/ast-js/index.mjs index 44f7f270..b1b4d108 100644 --- a/src/generators/ast-js/index.mjs +++ b/src/generators/ast-js/index.mjs @@ -36,9 +36,15 @@ export default { async processChunk(inputSlice, itemIndices) { const filePaths = itemIndices.map(idx => inputSlice[idx]); - return Promise.all( - filePaths.map(async path => parseJsSource(await read(path, 'utf-8'))) - ); + const results = []; + + for (const path of filePaths) { + const vfile = await read(path, 'utf-8'); + + results.push(parseJsSource(vfile)); + } + + return results; }, /** diff --git a/src/generators/ast/index.mjs b/src/generators/ast/index.mjs index eaec9ff1..03ce0c16 100644 --- a/src/generators/ast/index.mjs +++ b/src/generators/ast/index.mjs @@ -38,18 +38,20 @@ export default { async processChunk(inputSlice, itemIndices) { const filePaths = itemIndices.map(idx => inputSlice[idx]); - return Promise.all( - filePaths.map(async path => { - const vfile = await read(path, 'utf-8'); + const results = []; - updateStabilityPrefixToLink(vfile); + for (const path of filePaths) { + const vfile = await read(path, 'utf-8'); - return { - tree: remarkProcessor.parse(vfile), - file: { stem: vfile.stem, basename: vfile.basename }, - }; - }) - ); + updateStabilityPrefixToLink(vfile); + + results.push({ + tree: remarkProcessor.parse(vfile), + file: { stem: vfile.stem, basename: vfile.basename }, + }); + } + + return results; }, /** From 02009662690905a5790b91e3790175a21e269584 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Wed, 10 Dec 2025 21:16:24 -0500 Subject: [PATCH 2/2] fixup! --- src/generators/ast-js/index.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generators/ast-js/index.mjs b/src/generators/ast-js/index.mjs index b1b4d108..cdc72799 100644 --- a/src/generators/ast-js/index.mjs +++ b/src/generators/ast-js/index.mjs @@ -41,7 +41,9 @@ export default { for (const path of filePaths) { const vfile = await read(path, 'utf-8'); - results.push(parseJsSource(vfile)); + const parsedJS = await parseJsSource(vfile); + + results.push(parsedJS); } return results;