-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phase 1 of using OpenShift Dynamic Plugin SDK
- Loading branch information
1 parent
224da7e
commit dd6de65
Showing
34 changed files
with
880 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { PluginBuildMetadata, PluginManifest } from '@openshift/dynamic-plugin-sdk-webpack'; | ||
|
||
/** | ||
* 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 & ConsoleSupportedCustomProperties; | ||
|
||
/** | ||
* Standard Console dynamic plugin manifest format. | ||
*/ | ||
export type StandardConsolePluginManifest = { | ||
customProperties?: { | ||
console?: ConsoleSupportedCustomProperties; | ||
[customNamespace: string]: unknown; | ||
}; | ||
} & 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 const isStandardPluginManifest = ( | ||
m: AnyConsolePluginManifest, | ||
): m is StandardConsolePluginManifest => | ||
// Standard plugin manifests must have a string valued baseURL property | ||
// eslint-disable-next-line dot-notation | ||
m['baseURL'] && typeof m['baseURL'] === 'string'; |
Oops, something went wrong.