From b024a4c7523291d383d3c44b750f0a6bb6510268 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 7 May 2025 11:43:28 +0000 Subject: [PATCH] build: pretty-print adev CDK docs manifests This should make it easier to diff the API changes when PRs are auto-opened in the framework repository. --- tools/adev-api-extraction/index.mts | 44 ++++++++++++++++------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/tools/adev-api-extraction/index.mts b/tools/adev-api-extraction/index.mts index 5e72dc8db003..e8ad78c5c65b 100644 --- a/tools/adev-api-extraction/index.mts +++ b/tools/adev-api-extraction/index.mts @@ -92,26 +92,30 @@ function main() { const normalized = moduleName.replace('@', '').replace(/[\/]/g, '_'); - const output = JSON.stringify({ - repo, - moduleLabel: moduleLabel || moduleName, - moduleName: moduleName, - normalizedModuleName: normalized, - entries: combinedEntries, - symbols: [ - // Symbols referenced, originating from other packages - ...apiDoc.symbols.entries(), - - // Exported symbols from the current package - ...apiDoc.entries.map(entry => [entry.name, moduleName]), - - // Also doing it for every member of classes/interfaces - ...apiDoc.entries.flatMap(entry => [ - [entry.name, moduleName], - ...getEntriesFromMembers(entry).map(member => [member, moduleName]), - ]), - ], - } as EntryCollection); + const output = JSON.stringify( + { + repo, + moduleLabel: moduleLabel || moduleName, + moduleName: moduleName, + normalizedModuleName: normalized, + entries: combinedEntries, + symbols: [ + // Symbols referenced, originating from other packages + ...apiDoc.symbols.entries(), + + // Exported symbols from the current package + ...apiDoc.entries.map(entry => [entry.name, moduleName]), + + // Also doing it for every member of classes/interfaces + ...apiDoc.entries.flatMap(entry => [ + [entry.name, moduleName], + ...getEntriesFromMembers(entry).map(member => [member, moduleName]), + ]), + ], + } as EntryCollection, + null, + 2, + ); writeFileSync(outputFilenameExecRootRelativePath, output, {encoding: 'utf8'}); }