repo-tools: Improve error message when API report is missing
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/repo-tools': patch
|
||||
---
|
||||
|
||||
Log API report instructions when api-report is missing.
|
||||
@@ -487,6 +487,9 @@ export async function runApiExtraction({
|
||||
showVerboseMessages: false,
|
||||
showDiagnostics: false,
|
||||
messageCallback(message) {
|
||||
if (message.text.includes('The API report file is missing')) {
|
||||
shouldLogInstructions = true;
|
||||
}
|
||||
if (
|
||||
message.text.includes(
|
||||
'You have changed the public API signature for this project.',
|
||||
@@ -506,7 +509,11 @@ export async function runApiExtraction({
|
||||
|
||||
// This release tag validation makes sure that the release tag of known entry points match expectations.
|
||||
// The root index entrypoint is only allowed @public exports, while /alpha and /beta only allow @alpha and @beta.
|
||||
if (validateReleaseTags && !usesExperimentalTypeBuild) {
|
||||
if (
|
||||
validateReleaseTags &&
|
||||
!usesExperimentalTypeBuild &&
|
||||
fs.pathExistsSync(extractorConfig.reportFilePath)
|
||||
) {
|
||||
if (['index', 'alpha', 'beta'].includes(name)) {
|
||||
const report = await fs.readFile(
|
||||
extractorConfig.reportFilePath,
|
||||
|
||||
Reference in New Issue
Block a user