File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/@angular/cli/utilities Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import {
9
9
Collection ,
10
+ Engine ,
10
11
Schematic ,
11
12
SchematicEngine ,
12
13
} from '@angular-devkit/schematics' ;
13
14
import {
15
+ FileSystemCollectionDesc ,
14
16
FileSystemSchematicDesc ,
15
17
NodeModulesEngineHost
16
18
} from '@angular-devkit/schematics/tools' ;
@@ -20,14 +22,22 @@ import 'rxjs/add/operator/map';
20
22
21
23
const SilentError = require ( 'silent-error' ) ;
22
24
25
+ const engineHost = new NodeModulesEngineHost ( ) ;
26
+ const engine : Engine < FileSystemCollectionDesc , FileSystemSchematicDesc >
27
+ = new SchematicEngine ( engineHost ) ;
28
+
29
+
23
30
export function getEngineHost ( ) {
24
- const engineHost = new NodeModulesEngineHost ( ) ;
25
31
return engineHost ;
26
32
}
33
+ export function getEngine ( ) : Engine < FileSystemCollectionDesc , FileSystemSchematicDesc > {
34
+ return engine ;
35
+ }
36
+
27
37
28
38
export function getCollection ( collectionName : string ) : Collection < any , any > {
29
39
const engineHost = getEngineHost ( ) ;
30
- const engine = new SchematicEngine ( engineHost ) ;
40
+ const engine = getEngine ( ) ;
31
41
32
42
// Add support for schemaJson.
33
43
engineHost . registerOptionsTransform ( ( schematic : FileSystemSchematicDesc , options : any ) => {
You can’t perform that action at this time.
0 commit comments