diff --git a/plugins/techdocs-backend/config.d.ts b/plugins/techdocs-backend/config.d.ts index 01da1e7926..9d1cd9e170 100644 --- a/plugins/techdocs-backend/config.d.ts +++ b/plugins/techdocs-backend/config.d.ts @@ -24,7 +24,7 @@ export interface Config { * Documentation building process depends on the builder attr * @visibility frontend */ - builder: 'local' | 'external'; + builder?: 'local' | 'external'; /** * Techdocs generator information diff --git a/plugins/techdocs-backend/src/service/DefaultDocsBuildStrategy.ts b/plugins/techdocs-backend/src/service/DefaultDocsBuildStrategy.ts index bc2c586c82..a0bd623b64 100644 --- a/plugins/techdocs-backend/src/service/DefaultDocsBuildStrategy.ts +++ b/plugins/techdocs-backend/src/service/DefaultDocsBuildStrategy.ts @@ -29,6 +29,8 @@ export class DefaultDocsBuildStrategy implements DocsBuildStrategy { } async shouldBuild(_: { entity: Entity }): Promise { - return this.config.getString('techdocs.builder') === 'local'; + return [undefined, 'local'].includes( + this.config.getOptionalString('techdocs.builder'), + ); } } diff --git a/plugins/techdocs/config.d.ts b/plugins/techdocs/config.d.ts index 82ae8dd87a..0df852e490 100644 --- a/plugins/techdocs/config.d.ts +++ b/plugins/techdocs/config.d.ts @@ -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. diff --git a/plugins/techdocs/src/client.ts b/plugins/techdocs/src/client.ts index ae81ecdaaa..0f11eb4068 100644 --- a/plugins/techdocs/src/client.ts +++ b/plugins/techdocs/src/client.ts @@ -151,7 +151,7 @@ export class TechDocsStorageClient implements TechDocsStorageApi { } async getBuilder(): Promise { - return this.configApi.getString('techdocs.builder'); + return this.configApi.getOptionalString('techdocs.builder') || 'local'; } /** diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx index bd2ef26b1e..858f9c5afc 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx @@ -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 " +