getModelFromSource
API / @publicodes/tools / compilation / getModelFromSource
function getModelFromSource(sourcePaths, opts?): RawRules
Defined in: compilation/getModelFromSource.ts:47
Aggregates all rules from the rules folder into a single json object (the model) with the resolved dependencies.
Parameters
Parameter | Type | Description |
---|---|---|
sourcePaths | string | string [] | Path to the source files, can be a glob pattern or a directory. |
opts ? | GetModelFromSourceOptions | Options. |
Returns
The model with resolved imports in a single JSON object.
Throws
If the package name is missing in the macro.
Throws
If the rule to import does not exist.
Throws
If there is double definition of a rule.
Throws
If there is a conflict between an imported rule and a base rule.