new ModuleSystem(logger)
Object storing Heta modules and methods to combine them.
Parameters:
Name | Type | Description |
---|---|---|
logger |
Logger | Object to analyze log events. |
Properties:
Name | Type | Description |
---|---|---|
moduleCollection |
object.<string, _Module> | Map-like storage for modules.
Key is a file id (filename), value is a |
graph |
TopoSort | An instance of |
logger |
Logger | Object to analyze log events. |
_top |
_Module | Top-level module. Usually created from |
Methods
_addModuleDeep(modulePath, type, options) → {_Module}
It scan module dependence recursively.
Parameters:
Name | Type | Description |
---|---|---|
modulePath |
string | Absolute module path. |
type |
string | A module type. |
options |
object | additional options. |
Returns:
Created module.
- Type
- _Module
addModule(filename, type, options) → {_Module}
Parse single file without dependencies.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
filename |
string | File path of module file. |
|
type |
string | heta | A module type. |
options |
object | additional options. |
Returns:
Created module.
- Type
- _Module
addModuleDeep(rawAbsFilePath, type, options) → {_Module}
Load top-level module to ModuleSystem
.
Parameters:
Name | Type | Description |
---|---|---|
rawAbsFilePath |
string | Relative or absolute module path. |
type |
string | A module type. |
options |
object | additional options. |
Returns:
Created module.
- Type
- _Module
integrate() → {Array.<object>}
Composes parsed modules into single platform.
Returns:
integrated Q-array.
- Type
- Array.<object>
sortedPaths() → {Array.<string>}
Sort modules before integration. If there is circular references then throw an error.
Returns:
Array of modules ids.
- Type
- Array.<string>