UNPKG

@openshift-console/dynamic-plugin-sdk-webpack

Version:

Provides webpack ConsoleRemotePlugin used to build all dynamic plugin assets.

51 lines (50 loc) 2.08 kB
import { PluginBuildMetadata, PluginManifest } from '@openshift/dynamic-plugin-sdk-webpack'; import { PackageJson } from 'read-pkg'; /** * Note: this metadata should be supported in upstream plugin SDK. */ export type ExtraPluginBuildMetadata = Partial<{ /** Plugin dependencies listed here will be treated as optional. */ optionalDependencies: Record<string, string>; }>; export type ExtraPluginManifestProperties = ExtraPluginBuildMetadata; /** * Additional plugin metadata supported by the Console application. */ export type ConsoleSupportedCustomProperties = Partial<{ /** User-friendly plugin name. */ displayName: string; /** User-friendly plugin description. */ description: string; /** Disable the given static plugins when this plugin gets loaded. */ disableStaticPlugins: string[]; }>; /** * Build-time Console dynamic plugin metadata. */ export type ConsolePluginBuildMetadata = PluginBuildMetadata & ExtraPluginBuildMetadata & ConsoleSupportedCustomProperties; /** The package.json for a Console plugin. */ export type ConsolePluginPackageJSON = PackageJson & { consolePlugin?: ConsolePluginBuildMetadata; }; /** * Standard Console dynamic plugin manifest format. */ export type StandardConsolePluginManifest = { customProperties?: { console?: ConsoleSupportedCustomProperties; [customNamespace: string]: unknown; }; } & ExtraPluginManifestProperties & PluginManifest; /** * Legacy Console dynamic plugin manifest format. */ export type LegacyConsolePluginManifest = Pick<PluginManifest, 'name' | 'version' | 'dependencies' | 'extensions'> & ConsoleSupportedCustomProperties; /** * This type supports both standard and legacy Console dynamic plugin manifest formats. * * Console application automatically adapts the manifest to standard format when loading * the given plugin. */ export type AnyConsolePluginManifest = StandardConsolePluginManifest | LegacyConsolePluginManifest; export declare const isStandardPluginManifest: (m: AnyConsolePluginManifest) => m is StandardConsolePluginManifest;