Converts this module to a normal module with the given dependences

@throws IllegalArgumentException if this module is not an automatic module
183576
public Module toNormalModule(Map<String, Boolean> requires) {
        if (!isAutomatic()) {
            throw new IllegalArgumentException(name() + " not an automatic module");
        }
        return new NormalModule(this, requires);
    }
116612
public function readNeedMeDependencies()
    {
        foreach ($this->modules as $readModuleName => $module) {
            $loadInfos = $module->getLoadInfos();
            
            if (!property_exists($loadInfos, 'needMe')) {
                continue;
            }
            
            $needMe = (array) $loadInfos->needMe;
            foreach ($needMe as $needModuleName) {
                if (!isset($this->modules[$needModuleName])) {
                    throw new Exception(
                        'Module error: '.$readModuleName
                        .' need '.$needModuleName
                        .' but the module has not been found.',
                        $this::ERR_NEEDED_NOT_FOUND
                    );
                }
                
                $this->modules[$needModuleName]->addDependency(
                    $readModuleName
                );
            }
        }
    }
830102
public function module($module)
    {
        if (isset($this->modules[$module])) {
            return;
        }

        $this->log->write(Log::DEBUG, 'ModuleHandler', 'Loading module: %s', $module);

        $class        = "\\Modules\\{$module}\\Module";
        $moduleObject = new $class($module, $this->application, $this->fileManager);

        if (!$moduleObject instanceof Module) {
            throw new BadModuleException("Class {$class} does not extend Module class.");
        }

        $this->modules[$module] = $moduleObject;
        foreach ($moduleObject->getDependencies() as $name) {
            $this->module($name);
        }
    }
58563
function setDependencies(\assegai\Server $server, ModuleContainer $modules)
	{
        $this->server = $server;
        $this->modules = $modules;
	}
878081
protected void addModuleArg(String jsFile, String moduleName, List<String> args, StringBuilder moduleArg) {
		int argIdx = 0;
		for (Iterator<String> iterArg = args.iterator(); iterArg.hasNext(); argIdx++) {
			String arg = iterArg.next();
			if (arg.equals(JS_ARG)) {
				iterArg.next();
				arg = iterArg.next();
				argIdx += 2;
			}
			if (arg.equals(MODULE_ARG)) {
				arg = iterArg.next();
				argIdx++;
				Matcher matcher = MODULE_ARG_PATTERN.matcher(arg);
				if (matcher.find()) {
					String dep = matcher.group(1);
					if (dep != null) {
						List<String> moduleDependencies = Arrays.asList(dep.split(MODULE_DEPENDENCIES_SEPARATOR));
						if (moduleDependencies.contains(moduleName)) {
							break;
						}
					}
				} else {
					throw new BundlingProcessException(
							"There were an error in the generation of the module dependencies.");
				}
			}
		}

		args.add(argIdx++, JS_ARG);
		args.add(argIdx++, jsFile);
		args.add(argIdx++, MODULE_ARG);
		args.add(argIdx++, moduleArg.toString());
	}
165017
function ()
  {
    /** @type {Object.<string, ModuleDef>} */
    var modules = {};
    ((typeof this.options.externalModules === 'string' ?
      [this.options.externalModules] : this.options.externalModules
      ) || []).
      concat (this.options.builtinModules).
      forEach (function (moduleName)
    {
      // Ignore redundant names.
      if (!modules[moduleName]) {
        /** @type {ModuleDef} */
        var module = modules[moduleName] = new ModuleDef (moduleName);
        module.external = true;
      }
    });
    return modules;
  }
951108
private function processModules(DependencyInjectionContainer $dic, array $modules, array &$config) {
		/** @noinspection PhpInternalEntityUsedInspection */
		$dependencyGraph = new ModuleDependencyGraph();
		$dependencyGraph->addModules($modules);
		$modules = $dependencyGraph->getSortedModuleList();

		foreach ($modules as $module) {
			$this->loadModuleConfiguration($module, $config);
		}

		foreach ($modules as $module) {
			$module->configureDependencyInjection($dic, $config[$module->getModuleKey()], $config);
		}
	}
134714
function normalize(id, dependencies) {
        id = id || "";
        var parent = id.split('/');
        parent.pop();
        return dependencies.map(function (dep) {
            if (dep[0] === '.') {
                var parts = dep.split('/');
                var current = parent.slice(0);
                parts.forEach(function (part) {
                    if (part === '..') {
                        current.pop();
                    } else if (part !== '.') {
                        current.push(part);
                    }
                });
                return current.join('/');
            } else {
                return dep;
            }
        });
    }
1278041
public function module($module)
    {
        if (is_object($module)) {
            if (!($module instanceof ModuleInterface)) {
                $moduleType = get_class($module);

                throw new InvalidArgumentException("Given module object '$moduleType' does not implement 'Depend\\Abstraction\\ModuleInterface'");
            }

            $module->register($this);

            return $this;
        }

        if (!class_exists((string) $module)) {
            throw new InvalidArgumentException("Given class name '$module' could not be found");
        }

        return $this->module(new $module);
    }
690306
function fetchUnmetDependencies() {
        var runAgain = false;
        for (var id in dependencyMap) {
            _.forEach(dependencyMap[id], function (depId) {
                if (!dependencyMap[depId] && !injectedMap[depId]) {
                    try {
                        loadExternalModule(id, depId);
                    } catch (err) {
                        throw new Error('Error loading dependency ' + depId + ' for ' + id + ': ' + err.message);
                    }

                    runAgain = true;
                }
            });
        }

        if (runAgain) { //continue until all we don't have any more unmet dependencies
            fetchUnmetDependencies();
        }
    }
1054176
public void addDependency(T from, T to) {
      if (from == null || to == null || from.equals(to)) {
         throw new IllegalArgumentException("Invalid parameters");
      }
      lock.writeLock().lock();
      try {
         if (addOutgoingEdge(from, to)) {
            addIncomingEdge(to, from);
         }
      } finally {
         lock.writeLock().unlock();
      }
   }
171602
function(moduleName, deps, callback) {
  //if (moduleName === "jquery/selector") { debugger; }
  if (!deps && !callback) {
    return;
  }

  // Allow deps to be optional.
  if (!callback && typeof deps === "function") {
    callback = deps;
    deps = undefined;
  }

  // Ensure dependencies is never falsey.
  deps = deps || [];

  // Normalize the dependencies.
  deps = deps.map(function(dep) {
    if (dep.indexOf("./") === -1) {
      return dep;
    }

    // Take off the last path.
    var normalize = moduleName.split("/").slice(0, -1).join("/");

    //console.log(normalize, dep, define.join(normalize, dep));
    return define.join(normalize, dep);
  });

  // Attach to the module map.
  define.map[moduleName] = {
    moduleName: moduleName,
    deps: deps,
    callback: callback
  };
}
7420
function buildDependencyGraph(module, dependencies, graph) {
	if (module && !graph[module]) {
		graph[module] = [];
	}

	var dependencyNames = Object.keys(dependencies);
	dependencyNames.forEach(function(dependencyName) {
		var dependency = dependencies[dependencyName];

		if (module && graph[module].indexOf(dependencyName) === -1) {
			graph[module].push(dependencyName);
		}

		// Traverse down to this dependency dependencies:
		// Dependency-ception.
		if (dependency.dependencies) {
			buildDependencyGraph(dependencyName, dependency.dependencies, graph);
		}
	});
}
1194764
public static Iterable<Module> prepareModules(final ConfigurationContext context) {
        final List<Module> normalModules = context.getNormalModules();
        final List<Module> overridingModules = context.getOverridingModules();
        // use different lists to avoid possible side effects from listeners (not allowed to exclude or modify order)
        context.lifecycle().injectorCreation(
                new ArrayList<>(normalModules),
                new ArrayList<>(overridingModules),
                context.getDisabledModules());
        return overridingModules.isEmpty() ? normalModules
                : Collections.singletonList(Modules.override(normalModules).with(overridingModules));
    }
894563
function () {
                        //noinspection JSReferencingMutableVariableFromClosure
                        res.push({
                            combine: 1,
                            path: prefix + currentComboUrls.join(comboSep) + suffix,
                            mods: currentComboMods
                        });
                    }
216107
function(parser, expr) {
    var mod = parser.evaluateExpression(expr.arguments[0]);
    var deps = parser.evaluateExpression(expr.arguments[1]);
    this._addModuleDefinition(parser, expr, mod);
    if( deps.items ){
      return deps.items.every(
        this._addDependency.bind(this, parser, expr));
    }
    return this._addDependency(parser, expr, mod);
  }
178097
public function addDependency($moduleName, $dependency)
    {
        if (!isset($this->moduleNames[$dependency])) {
            throw new RuntimeException(sprintf(
                'The module "%s" does not exist in the graph.',
                $dependency
            ));
        }

        if (!isset($this->moduleNames[$moduleName])) {
            throw new RuntimeException(sprintf(
                'The module "%s" does not exist in the graph.',
                $moduleName
            ));
        }

        if (null !== ($path = $this->getPath($dependency, $moduleName))) {
            $last = array_pop($path);

            throw new CyclicDependencyException(sprintf(
                'A cyclic dependency was discovered between the modules "%s" '.
                'and "%s". Please check the "override" keys defined in these '.
                'modules.',
                implode('", "', $path),
                $last
            ));
        }

        $this->dependencies[$moduleName][$dependency] = true;
    }