diff --git a/packages/core/src/api/apis/helpers.ts b/packages/core/src/api/apis/helpers.ts index 1a46781c58..d8f8e8ac11 100644 --- a/packages/core/src/api/apis/helpers.ts +++ b/packages/core/src/api/apis/helpers.ts @@ -16,9 +16,11 @@ import { ApiFactory } from './types'; -// Used to infer types for a standalone ApiFactory that isn't immediately passed -// to another function. -// This function doesn't actually do anything, it's only used to infer types. +/** + * Used to infer types for a standalone ApiFactory that isn't immediately passed + * to another function. + * This function doesn't actually do anything, it's only used to infer types. + */ export function createApiFactory( factory: ApiFactory, ): ApiFactory { diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md index d082b7d06b..04f8404f64 100644 --- a/packages/dev-utils/README.md +++ b/packages/dev-utils/README.md @@ -2,7 +2,7 @@ Utilities for developing Backstage plugins. -This package provides utilities that help in developing plugins for backstage, like App wrappers and API implementations for standalone serving of apps. +This package provides utilities that help in developing plugins for Backstage, like App wrappers and API implementations for standalone serving of apps. ## Installation diff --git a/packages/dev-utils/src/devApp/render.tsx b/packages/dev-utils/src/devApp/render.tsx index 768e0973e6..9c9a72094c 100644 --- a/packages/dev-utils/src/devApp/render.tsx +++ b/packages/dev-utils/src/devApp/render.tsx @@ -36,19 +36,25 @@ import * as defaultApiFactories from './apiFactories'; // TODO(rugvip): export proper plugin type from core that isn't the plugin class type BackstagePlugin = ReturnType; -// DevApp builder that is similar to the App builder API, but creates an App -// with the purpose of developing one or more plugins inside it. +/** + * DevApp builder that is similar to the App builder API, but creates an App + * with the purpose of developing one or more plugins inside it. + */ class DevAppBuilder { private readonly plugins = new Array(); private readonly factories = new Array>(); - // Register one or more plugins to render in the dev app + /** + * Register one or more plugins to render in the dev app + */ registerPlugin(...plugins: BackstagePlugin[]): DevAppBuilder { this.plugins.push(...plugins); return this; } - // Register an API factory to add to the app + /** + * Register an API factory to add to the app + */ registerApiFactory( factory: ApiFactory, ): DevAppBuilder { @@ -56,7 +62,9 @@ class DevAppBuilder { return this; } - // Build a DevApp component using the resources registered so far + /** + * Build a DevApp component using the resources registered so far + */ build(): ComponentType<{}> { const app = createApp(); app.registerApis(this.setupApiRegistry(this.factories)); @@ -83,7 +91,9 @@ class DevAppBuilder { return DevApp; } - // Build and render directory to #root element + /** + * Build and render directory to #root element + */ render(): void { const DevApp = this.build(); @@ -173,7 +183,9 @@ class DevAppBuilder { // TODO(rugvip): Figure out patterns for how to allow in-house apps to build upon // this to provide their own plugin dev wrappers. -// Creates a dev app for rendering one or more plugins and exposing the touchpoints of the plugin. +/** + * Creates a dev app for rendering one or more plugins and exposing the touchpoints of the plugin. + */ export function createDevApp() { return new DevAppBuilder(); }