From 26dee60729efac52a53500086f5c0c4649d747e7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 7 Apr 2021 18:13:00 +0200 Subject: [PATCH] scripts/api-extractor: better feedback for api-report mismatches Signed-off-by: Patrik Oldsberg --- scripts/api-extractor.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 1cab49750f..e232170e9d 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -171,6 +171,28 @@ async function runApiExtraction({ localBuild: isLocalBuild, showVerboseMessages: false, showDiagnostics: false, + messageCallback(message) { + if ( + message.text.includes( + 'You have changed the public API signature for this project.', + ) + ) { + console.log(''); + console.log( + '*************************************************************************************', + ); + console.log( + '* You have uncommitted changes to the public API of a package. *', + ); + console.log( + '* To solve this, run `yarn build:api-reports` and commit all api-report.md changes. *', + ); + console.log( + '*************************************************************************************', + ); + console.log(''); + } + }, compilerState, });