'use strict';
var ConfigurableTaskRunnerFactory = require('./core/configurable_runner_factory'),
	ConfigurableTaskFactory = require('./core/configurable_task_factory'),
	Configuration = require('./core/configuration'),
	Registry = require('./core/registry'),
	stuff = require('./stuff'),
	helpRunner = stuff.recipes.lookup('help');

// TODO: resolve too many dependencies problem. (optionalDependencies?). [THOUGHT]: check out bumpTask's bumpTask.requires comments.
function configure(rawConfigs, options) {
	var registry = new Registry(),
		runnerFactory = new ConfigurableTaskRunnerFactory(stuff),
		taskFactory = new ConfigurableTaskFactory(stuff, runnerFactory, registry),
		configs = Configuration.sort({}, rawConfigs, {}, Configuration.SCHEMA_COMMONS);

	Configuration.setOptions(options);
	taskFactory.multiple('', configs.subTaskConfigs, configs.taskConfig);
	registry.set('help', taskFactory.create('', {}, {}, helpRunner));

	// export recipes registry
	return registry;
}

module.exports = configure;

@@ -252,16 +252,148 @@
 stry'),%0A
+%09DependencyManager = require('./core/dependency_manager'),%0A%09packages = process.cwd() + '/package.json',%0A%09store = require(packages),%0A
 %09stuff =
@@ -413,16 +413,16 @@
 tuff'),%0A
-
 %09helpRun
@@ -665,16 +665,61 @@
 stry(),%0A
+%09%09manager = new DependencyManager(packages),%0A
 %09%09runner
@@ -767,16 +767,25 @@
 ry(stuff
+, manager
 ),%0A%09%09tas
@@ -975,16 +975,16 @@
 tions);%0A
-
 %09taskFac
@@ -1046,16 +1046,207 @@
 onfig);%0A
+%09if (manager.flush()) %7B%0A%09%09manager.save(packages + '.new');%0A%09%09console.log('Notice: new dependencies required by used recipes, please run %22npm update%22 to install them.')%0A%09%09process.exit(1);%0A%09%7D%0A%0A
 %09registr

add "package.json" dependency management