From 777622304441be39553be4323fbaebaa2c9f0e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 27 Jan 2026 12:06:44 -0300 Subject: [PATCH 1/4] fix: core json tests --- src/generators/legacy-json/index.mjs | 2 +- src/generators/legacy-json/utils/buildSection.mjs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/generators/legacy-json/index.mjs b/src/generators/legacy-json/index.mjs index b0ae17ea..7b6448d7 100644 --- a/src/generators/legacy-json/index.mjs +++ b/src/generators/legacy-json/index.mjs @@ -78,7 +78,7 @@ export default { for (const section of chunkResult) { const out = join(output, `${section.api}.json`); - await writeFile(out, JSON.stringify(section)); + await writeFile(out, JSON.stringify(section, null, 2)); } } diff --git a/src/generators/legacy-json/utils/buildSection.mjs b/src/generators/legacy-json/utils/buildSection.mjs index d3f710ba..44fb7624 100644 --- a/src/generators/legacy-json/utils/buildSection.mjs +++ b/src/generators/legacy-json/utils/buildSection.mjs @@ -199,7 +199,6 @@ export const createSectionBuilder = () => { return (head, entries) => { const rootModule = { type: 'module', - api: head.api, source: head.api_doc_source, }; From b85afdad637b4432a5e5618d8cdf1447ea940dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 27 Jan 2026 12:19:40 -0300 Subject: [PATCH 2/4] fix: exclude api from output --- src/generators/legacy-json/index.mjs | 5 ++++- src/generators/legacy-json/utils/buildSection.mjs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generators/legacy-json/index.mjs b/src/generators/legacy-json/index.mjs index 7b6448d7..9be9c342 100644 --- a/src/generators/legacy-json/index.mjs +++ b/src/generators/legacy-json/index.mjs @@ -78,7 +78,10 @@ export default { for (const section of chunkResult) { const out = join(output, `${section.api}.json`); - await writeFile(out, JSON.stringify(section, null, 2)); + // eslint-disable-next-line no-unused-vars + const { api, ...content } = section; + + await writeFile(out, JSON.stringify(content, null, 2)); } } diff --git a/src/generators/legacy-json/utils/buildSection.mjs b/src/generators/legacy-json/utils/buildSection.mjs index 44fb7624..d3f710ba 100644 --- a/src/generators/legacy-json/utils/buildSection.mjs +++ b/src/generators/legacy-json/utils/buildSection.mjs @@ -199,6 +199,7 @@ export const createSectionBuilder = () => { return (head, entries) => { const rootModule = { type: 'module', + api: head.api, source: head.api_doc_source, }; From 2dfdbe4bc2735907b1363549c2ecce0f978837fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 27 Jan 2026 12:27:43 -0300 Subject: [PATCH 3/4] fix: format all.json --- src/generators/legacy-json-all/index.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generators/legacy-json-all/index.mjs b/src/generators/legacy-json-all/index.mjs index 1a2c5bd4..a98eb980 100644 --- a/src/generators/legacy-json-all/index.mjs +++ b/src/generators/legacy-json-all/index.mjs @@ -83,7 +83,10 @@ export default { } if (output) { - await writeFile(join(output, 'all.json'), JSON.stringify(generatedValue)); + await writeFile( + join(output, 'all.json'), + JSON.stringify(generatedValue, null, 2) + ); } return generatedValue; From c360a629ec0d52ee19f7e1b5809053f85bbe7828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 27 Jan 2026 13:13:01 -0300 Subject: [PATCH 4/4] refactor: remove api omit --- src/generators/legacy-json/index.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/generators/legacy-json/index.mjs b/src/generators/legacy-json/index.mjs index 9be9c342..7b6448d7 100644 --- a/src/generators/legacy-json/index.mjs +++ b/src/generators/legacy-json/index.mjs @@ -78,10 +78,7 @@ export default { for (const section of chunkResult) { const out = join(output, `${section.api}.json`); - // eslint-disable-next-line no-unused-vars - const { api, ...content } = section; - - await writeFile(out, JSON.stringify(content, null, 2)); + await writeFile(out, JSON.stringify(section, null, 2)); } }