-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
52 lines (25 loc) · 1.59 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module.exports = function(projectRoot) {
var DependencyHelper = require('./src/Service/DependencyHelper');
var FileUtils = require('./src/Service/FileUtils');
var Container = require("./src/Container/Container.js");
var ngDI = require("ng-di");
var dependencies = new DependencyHelper(projectRoot, require).getDependencies();
var container = ngDI.module("Application", []);
var fs = require('fs');
var path = require('path');
var variableRegex = require('./src/VariableNameRegex');
var packageJson = require(projectRoot + "/package.json");
packageJson['node-dependency'] = packageJson['node-dependency'] || {};
packageJson['node-dependency'].source = packageJson['node-dependency'].source || 'src'
var projectSources = packageJson['node-dependency'].source;
var fileUtils = new FileUtils(path.join(projectRoot, projectSources), fs);
var StringUtils = require('./src/Service/StringUtils');
var FunctionRunner = require('./src/Service/FunctionRunner');
var runner = new FunctionRunner(container);
var PluginServiceClass = require('./src/Service/PluginService.js');
var PluginService = new PluginServiceClass(projectRoot);
new Container(container, dependencies, fileUtils, require, projectRoot, variableRegex, StringUtils, runner, PluginService, packageJson);
runner.shouldCache = true;
runner.setInjector(ngDI.injector(['Application']));
return container;
};