From f37992797acf73431cbf1e3def2bb4ee84fd20aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 18 Feb 2021 11:14:03 +0100 Subject: [PATCH] got rid of some attr and cleaned up a bit in techdocs schema --- .changeset/dry-ads-matter.md | 6 +++ plugins/techdocs-backend/config.d.ts | 27 ++++------ plugins/techdocs/config.d.ts | 78 +++++++--------------------- 3 files changed, 36 insertions(+), 75 deletions(-) create mode 100644 .changeset/dry-ads-matter.md diff --git a/.changeset/dry-ads-matter.md b/.changeset/dry-ads-matter.md new file mode 100644 index 0000000000..fc0a412d1e --- /dev/null +++ b/.changeset/dry-ads-matter.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-techdocs': patch +'@backstage/plugin-techdocs-backend': patch +--- + +Got rid of some `attr` and cleaned up a bit in the TechDocs config schema. diff --git a/plugins/techdocs-backend/config.d.ts b/plugins/techdocs-backend/config.d.ts index 7ec1162d03..5a323f244a 100644 --- a/plugins/techdocs-backend/config.d.ts +++ b/plugins/techdocs-backend/config.d.ts @@ -13,36 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /** * TechDocs schema below is an abstract of what's used within techdocs-backend and for its visibility * to view the complete TechDocs schema please refer: plugins/techdocs/config.d.ts - * */ + */ export interface Config { - /** Configuration options for the techdocs-backend plugin */ + /** + * Configuration options for the techdocs-backend plugin + * @see http://backstage.io/docs/features/techdocs/configuration + */ techdocs: { /** - * documentation building process depends on the builder attr - * attr: 'builder' - accepts a string value - * e.g. builder: 'local' - * alternative: 'external' etc. - * @see http://backstage.io/docs/features/techdocs/configuration + * Documentation building process depends on the builder attr */ builder: 'local' | 'external'; + /** - * techdocs publisher information + * Techdocs publisher information */ publisher: { - /** - * attr: 'type' - accepts a string value - * e.g. type: 'local' - * aleternatives: 'googleGcs' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ type: 'local' | 'googleGcs' | 'awsS3'; }; + /** - * attr: 'storageUrl' - accepts a string value - * e.g. storageUrl: http://localhost:7000/api/techdocs/static/docs + * @example http://localhost:7000/api/techdocs/static/docs * @deprecated */ storageUrl?: string; diff --git a/plugins/techdocs/config.d.ts b/plugins/techdocs/config.d.ts index 1104d75237..d85269d2ec 100644 --- a/plugins/techdocs/config.d.ts +++ b/plugins/techdocs/config.d.ts @@ -15,105 +15,76 @@ */ export interface Config { - /** Configuration options for the techdocs plugin */ + /** + * Configuration options for the techdocs plugin + * @see http://backstage.io/docs/features/techdocs/configuration + */ techdocs: { /** - * documentation building process depends on the builder attr - * attr: 'builder' - accepts a string value - * e.g. builder: 'local' - * alternative: 'external' etc. - * @see http://backstage.io/docs/features/techdocs/configuration + * Documentation building process depends on the builder attr * @visibility frontend */ builder: 'local' | 'external'; /** - * techdocs publisher information + * Techdocs generator information */ generators?: { - /** - * attr: 'techdocs' - accepts a string value - * e.g. type: 'docker' - * alternatives: 'local' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ techdocs: 'local' | 'docker'; }; /** - * techdocs publisher information + * Techdocs publisher information */ publisher?: | { - /** - * attr: 'type' - accepts a string value - * e.g. type: 'local' - * alternatives: 'googleGcs' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ type: 'local'; } | { - /** - * attr: 'type' - accepts a string value - * e.g. type: 'awsS3' - * alternatives: 'googleGcs' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ type: 'awsS3'; /** - * awsS3 required when 'type' is set to awsS3 + * Required when 'type' is set to awsS3 */ awsS3?: { /** * (Optional) Credentials used to access a storage bucket. * If not set, environment variables or aws config file will be used to authenticate. - * https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html - * https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html + * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html + * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html * @visibility secret */ credentials?: { /** * User access key id - * attr: 'accessKeyId' - accepts a string value * @visibility secret */ accessKeyId: string; /** * User secret access key - * attr: 'secretAccessKey' - accepts a string value * @visibility secret */ secretAccessKey: string; }; /** * (Required) Cloud Storage Bucket Name - * attr: 'bucketName' - accepts a string value * @visibility backend */ bucketName: string; /** * (Optional) AWS Region. * If not set, AWS_REGION environment variable or aws config file will be used. - * https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html - * attr: 'region' - accepts a string value + * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html * @visibility secret */ region?: string; }; } | { - /** - * attr: 'type' - accepts a string value - * e.g. type: 'azureBlobStorage' - * alternatives: 'azureBlobStorage' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ type: 'azureBlobStorage'; /** - * azureBlobStorage required when 'type' is set to azureBlobStorage + * Required when 'type' is set to azureBlobStorage */ azureBlobStorage?: { /** @@ -123,66 +94,55 @@ export interface Config { credentials: { /** * Account access name - * attr: 'account' - accepts a string value * @visibility secret */ accountName: string; /** * (Optional) Account secret primary key * If not set, environment variables will be used to authenticate. - * https://docs.microsoft.com/en-us/azure/storage/common/storage-auth?toc=/azure/storage/blobs/toc.json - * attr: 'accountKey' - accepts a string value + * @see https://docs.microsoft.com/en-us/azure/storage/common/storage-auth?toc=/azure/storage/blobs/toc.json * @visibility secret */ accountKey?: string; }; /** * (Required) Cloud Storage Container Name - * attr: 'containerName' - accepts a string value * @visibility backend */ containerName: string; }; } | { - /** - * attr: 'type' - accepts a string value - * e.g. type: 'googleGcs' - * alternatives: 'googleGcs' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ type: 'googleGcs'; /** - * googleGcs required when 'type' is set to googleGcs + * Required when 'type' is set to googleGcs */ googleGcs?: { /** * (Required) Cloud Storage Bucket Name - * attr: 'bucketName' - accepts a string value * @visibility backend */ bucketName: string; /** * (Optional) API key used to write to a storage bucket. * If not set, environment variables will be used to authenticate. - * Read more: https://cloud.google.com/docs/authentication/production - * attr: 'credentials' - accepts a string value + * @see https://cloud.google.com/docs/authentication/production * @visibility secret */ credentials?: string; }; }; + /** - * attr: 'requestUrl' - accepts a string value - * e.g. requestUrl: http://localhost:7000/api/techdocs + * @example http://localhost:7000/api/techdocs * @visibility frontend * @deprecated */ requestUrl?: string; + /** - * attr: 'storageUrl' - accepts a string value - * e.g. storageUrl: http://localhost:7000/api/techdocs/static/docs + * @example http://localhost:7000/api/techdocs/static/docs * @deprecated */ storageUrl?: string;