-
Notifications
You must be signed in to change notification settings - Fork 596
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
50cac02
commit e2ce6e9
Showing
37 changed files
with
795 additions
and
689 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
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
53 changes: 53 additions & 0 deletions
53
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,53 @@ | ||
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 | ||
m['baseURL'] && typeof m['baseURL'] === 'string'; |
5 changes: 3 additions & 2 deletions
5
frontend/packages/console-dynamic-plugin-sdk/src/lib-webpack.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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/** | ||
* @file Entrypoint for the `@openshift-console/dynamic-plugin-sdk-webpack` package published to npmjs. | ||
* | ||
* Provides webpack plugin `ConsoleRemotePlugin` used to build all dynamic plugin assets. | ||
* Provides webpack plugin `ConsoleRemotePlugin` used to build all Console dynamic plugin assets. | ||
*/ | ||
|
||
export { ConsoleRemotePlugin } from './webpack/ConsoleRemotePlugin'; | ||
export { ConsoleRemotePlugin, ConsoleRemotePluginOptions } from './webpack/ConsoleRemotePlugin'; | ||
export { ConsolePluginBuildMetadata } from './build-types'; |
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
Oops, something went wrong.