scripts/api-extractor: show instructions both before and after file contents

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-10-20 18:46:55 +02:00
parent 8238c8998f
commit 74e1fc1e7d
+20 -15
View File
@@ -134,6 +134,23 @@ async function findPackageDirs() {
return packageDirs;
}
function logApiReportInstructions() {
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('');
}
interface ApiExtractionOptions {
packageDirs: string[];
outputDir: string;
@@ -267,20 +284,7 @@ async function runApiExtraction({
if (!extractorResult.succeeded) {
if (shouldLogInstructions) {
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('');
logApiReportInstructions();
if (conflictingFile) {
console.log('');
@@ -294,7 +298,8 @@ async function runApiExtraction({
const content = await fs.readFile(conflictingFile, 'utf8');
console.log(content);
console.log('');
logApiReportInstructions();
}
}