Skip to content

Commit

Permalink
Merge pull request #613 from zowe/example/v3/customizable-entrypoint-url
Browse files Browse the repository at this point in the history
Load plugins by entrypoint urls if defined
  • Loading branch information
DivergentEuropeans authored Aug 29, 2024
2 parents 030ba3d + 6eca934 commit 04f9425
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ class SimpleAngularComponentFactory extends ComponentFactory {
export class Angular2PluginFactory extends PluginFactory {
private readonly logger: ZLUX.ComponentLogger = BaseLogger;
private static getAngularModuleURL(pluginDefinition: MVDHosting.DesktopPluginDefinition): string {
return ZoweZLUX.uriBroker.pluginResourceUri(pluginDefinition.getBasePlugin(), 'main.js');
let pluginDefBase = pluginDefinition.getBasePlugin();
let pluginDefAny:any = (pluginDefBase as any);
let entryPoint = 'main.js';
if (pluginDefAny.getWebEntryPoint) {
entryPoint = pluginDefAny.getWebEntryPoint() || 'main.js';
}
return ZoweZLUX.uriBroker.pluginResourceUri(pluginDefBase, entryPoint);
}

private static getAngularComponentsURL(pluginDefinition: MVDHosting.DesktopPluginDefinition): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ interface MvdNativeReactPluginComponentDefinition {
export class ReactPluginFactory extends PluginFactory {
private readonly logger: ZLUX.ComponentLogger = BaseLogger;
private static getReactModuleURL(pluginDefinition: MVDHosting.DesktopPluginDefinition): string {
// TODO: clean this up with .d.ts file
return ZoweZLUX.uriBroker.pluginResourceUri(pluginDefinition.getBasePlugin(), 'main.js');
let pluginDefBase = pluginDefinition.getBasePlugin();
let pluginDefAny:any = (pluginDefBase as any);
let entryPoint = 'main.js';
if (pluginDefAny.getWebEntryPoint) {
entryPoint = pluginDefAny.getWebEntryPoint() || 'main.js';
}
return ZoweZLUX.uriBroker.pluginResourceUri(pluginDefBase, entryPoint);
}

private static getReactComponentsURL(pluginDefinition: MVDHosting.DesktopPluginDefinition): string {
Expand Down

0 comments on commit 04f9425

Please sign in to comment.