Skip to content

Commit

Permalink
docs(plugins): add a one-line description to each extension point
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and mergify[bot] committed Apr 21, 2020
1 parent 3673932 commit d8483df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/scripts/modules/core/src/plugins/deck.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import { Registry } from 'core/registry';
import { SearchResultType, searchResultTypeRegistry } from 'core/search';

export interface IDeckPlugin {
/** Custom Stage UI (configuration and execution details) */
stages?: IStageTypeConfig[];
/** Custom Preconfigured Job Stage UI (configuration and execution details) */
preconfiguredJobStages?: IStageTypeConfig[];
/** Help Text for use in <HelpField /> */
help?: { [helpKey: string]: string };
/** Custom global search types */
search?: SearchResultType[];

initialize?(plugin: IDeckPlugin): void;
}

/** Given a plugin, registers the plugin's extensions */
/** Given a plugin, registers the plugin's extensions with Deck registries */
export function registerPluginExtensions(plugin: IDeckPlugin): PromiseLike<any> {
// Register the plugin's extensions with deck.
plugin.stages?.forEach(stage => Registry.pipeline.registerStage(stage));
plugin.preconfiguredJobStages?.forEach(stage => Registry.pipeline.registerPreconfiguredJobStage(stage));
toPairs(plugin.help ?? {}).forEach(([key, value]) => HelpContentsRegistry.register(key, value));
Expand Down

0 comments on commit d8483df

Please sign in to comment.