feat: Merge plugin modules (#10895)

Fixes: FRMW-2858

This PR merge the modules exported by the plugins with the modules defined within the user config. As a result, all modules get loaded without changing the internals of the loader.

However, you cannot disable the module of a plugin by re-adding it to the `modules` array. That is something we should handle separately. 

We've added the breaking change label because of the following fix:
We did broke the ability to completely disable modules in the past pr's, in this pr we re add the ability to disable a module and that this modules does not get loaded at all. ([here](6dd164f783))

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
Harminder Virk
2025-01-10 15:32:09 +05:30
committed by GitHub
parent a607b8e800
commit c1930bd656
15 changed files with 244 additions and 87 deletions

View File

@@ -106,7 +106,8 @@ export async function loadModules(args: {
let declaration: any = {}
let definition: Partial<ModuleDefinition> | undefined = undefined
if (mod === false) {
// TODO: We are keeping mod === false for backward compatibility for now
if (mod === false || (isObject(mod) && "disable" in mod && mod.disable)) {
continue
}