resolveModuleImplications function

Map<String, bool> resolveModuleImplications(
  1. Map<String, bool> selection
)

Applies the "module A needs module B" rules to a selection.

The brick's hooks/commands/module_vars.dart applies the same rules, so a project generated with plain mason make still compiles. Change both.

Implementation

Map<String, bool> resolveModuleImplications(Map<String, bool> selection) {
  final resolved = Map<String, bool>.from(selection);
  for (final module in templateModules) {
    if (module.impliedBy.any((other) => resolved[other] ?? false)) {
      resolved[module.key] = true;
    }
  }
  return resolved;
}