1 | Container = require './container'
|
2 | findModule = require('./find-module').instance
|
3 | findPath = require('./find-module').path
|
4 | populateDi = require('./populate-di')(findModule)
|
5 | addParent = require('./add-parent')(findModule, populateDi)
|
6 | getConfPaths = require('./get-conf-paths')(findPath, findModule)
|
7 | cc = require('./clear-cache')
|
8 |
|
9 | getPath = (o) -> o.path
|
10 |
|
11 | module.exports = (opts) ->
|
12 | { config, baseDir, annotations, clearCache } = opts
|
13 |
|
14 | cc(getConfPaths(baseDir, config).map(getPath)) if clearCache
|
15 |
|
16 | di = new Container(annotations)
|
17 | config.parents?.forEach (p) ->
|
18 | addParent di, baseDir, p, []
|
19 | populateDi di, baseDir, config.modules, []
|