techdocs: make builder optional

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2024-05-07 14:28:02 +02:00
parent 178ffdd402
commit 8a18e9ef38
5 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export interface Config {
* Documentation building process depends on the builder attr
* @visibility frontend
*/
builder: 'local' | 'external';
builder?: 'local' | 'external';
/**
* Allows fallback to case-sensitive triplets in case of migration issues.
+1 -1
View File
@@ -151,7 +151,7 @@ export class TechDocsStorageClient implements TechDocsStorageApi {
}
async getBuilder(): Promise<string> {
return this.configApi.getString('techdocs.builder');
return this.configApi.getOptionalString('techdocs.builder') || 'local';
}
/**
@@ -39,7 +39,7 @@ export const TechDocsNotFound = ({ errorMessage }: Props) => {
}, [analyticsApi, entityRef, location]);
let additionalInfo = '';
if (techdocsBuilder !== 'local') {
if (![undefined, 'local'].includes(techdocsBuilder)) {
additionalInfo =
"Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not " +
"generate docs if they are not found. Make sure the project's docs are generated and published by some external " +