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 77
88import {
99 Collection ,
10+ Engine ,
1011 Schematic ,
1112 SchematicEngine ,
1213} from '@angular-devkit/schematics' ;
1314import {
15+ FileSystemCollectionDesc ,
1416 FileSystemSchematicDesc ,
1517 NodeModulesEngineHost
1618} from '@angular-devkit/schematics/tools' ;
@@ -20,14 +22,22 @@ import 'rxjs/add/operator/map';
2022
2123const SilentError = require ( 'silent-error' ) ;
2224
25+ const engineHost = new NodeModulesEngineHost ( ) ;
26+ const engine : Engine < FileSystemCollectionDesc , FileSystemSchematicDesc >
27+ = new SchematicEngine ( engineHost ) ;
28+
29+
2330export function getEngineHost ( ) {
24- const engineHost = new NodeModulesEngineHost ( ) ;
2531 return engineHost ;
2632}
33+ export function getEngine ( ) : Engine < FileSystemCollectionDesc , FileSystemSchematicDesc > {
34+ return engine ;
35+ }
36+
2737
2838export function getCollection ( collectionName : string ) : Collection < any , any > {
2939 const engineHost = getEngineHost ( ) ;
30- const engine = new SchematicEngine ( engineHost ) ;
40+ const engine = getEngine ( ) ;
3141
3242 // Add support for schemaJson.
3343 engineHost . registerOptionsTransform ( ( schematic : FileSystemSchematicDesc , options : any ) => {
You can’t perform that action at this time.
0 commit comments