Fix: Angular detection in plugin loader (#87323)

fix(plugins): make sure angular detection is passed to loader
This commit is contained in:
Jack Westbrook 2024-05-13 09:55:26 +02:00 committed by GitHub
parent a6076d8d05
commit f785a71aae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -90,6 +90,7 @@ export interface PluginMeta<T extends KeyValue = {}> {
signatureOrg?: string;
live?: boolean;
angular?: AngularMeta;
angularDetected?: boolean;
}
interface PluginDependencyInfo {

View File

@ -98,10 +98,11 @@ export async function importPluginModule({
}
export function importDataSourcePlugin(meta: DataSourcePluginMeta): Promise<GenericDataSourcePlugin> {
const isAngular = meta.angular?.detected ?? meta.angularDetected;
return importPluginModule({
path: meta.module,
version: meta.info?.version,
isAngular: meta.angular?.detected,
isAngular,
pluginId: meta.id,
}).then((pluginExports) => {
if (pluginExports.plugin) {
@ -126,10 +127,11 @@ export function importDataSourcePlugin(meta: DataSourcePluginMeta): Promise<Gene
}
export function importAppPlugin(meta: PluginMeta): Promise<AppPlugin> {
const isAngular = meta.angular?.detected ?? meta.angularDetected;
return importPluginModule({
path: meta.module,
version: meta.info?.version,
isAngular: meta.angular?.detected,
isAngular,
pluginId: meta.id,
}).then((pluginExports) => {
const plugin: AppPlugin = pluginExports.plugin ? pluginExports.plugin : new AppPlugin();