@@ -15,18 +15,18 @@ export default (options: Schema): Rule => {
15
15
addHttpClientModule ( options ) ,
16
16
addPolyfill ( options ) ,
17
17
injectIdleService ( options ) ,
18
- runScullySchmeatic ( options ) ,
18
+ runScullySchematic ( options ) ,
19
19
] ) ;
20
20
} ;
21
21
22
22
const addDependencies = ( options : Schema ) => ( tree : Tree , context : SchematicContext ) => {
23
23
addPackageToPackageJson ( tree , '@scullyio/scully' , `${ scullyVersion } ` ) ;
24
24
const ngCoreVersionTag = getPackageVersionFromPackageJson ( tree , '@angular/core' ) ;
25
- if ( + ngCoreVersionTag . search ( ( / ( \^ 8 | ~ 8 ) / g) ) === 0 ) {
26
- console . log ( '⚠ install ng-lib for Angular v8' ) ;
25
+ if ( + ngCoreVersionTag . search ( / ( \^ 8 | ~ 8 ) / g) === 0 ) {
26
+ console . log ( 'Install ng-lib for Angular v8' ) ;
27
27
addPackageToPackageJson ( tree , '@scullyio/ng-lib-8' , `${ scullyComponentVersion } ` ) ;
28
28
} else {
29
- console . log ( '⚠ install ng-lib for Angular v9' ) ;
29
+ console . log ( 'Install ng-lib for Angular v9' ) ;
30
30
addPackageToPackageJson ( tree , '@scullyio/ng-lib' , `${ scullyComponentVersion } ` ) ;
31
31
}
32
32
context . logger . info ( '✅️ Added dependency' ) ;
@@ -38,13 +38,17 @@ const importHttpClientModule = (options: Schema) => (tree: Tree, context: Schema
38
38
const recorder = tree . beginUpdate ( mainFilePath ) ;
39
39
40
40
const mainFileSource = getSourceFile ( tree , mainFilePath ) ;
41
- const importChange = insertImport ( mainFileSource , mainFilePath , 'HttpClientModule' , '@angular/common/http' ) as InsertChange ;
41
+ const importChange = insertImport (
42
+ mainFileSource ,
43
+ mainFilePath ,
44
+ 'HttpClientModule' ,
45
+ '@angular/common/http'
46
+ ) as InsertChange ;
42
47
if ( importChange . toAdd ) {
43
48
recorder . insertLeft ( importChange . pos , importChange . toAdd ) ;
44
49
}
45
50
tree . commitUpdate ( recorder ) ;
46
51
return tree ;
47
-
48
52
} catch ( e ) {
49
53
console . log ( 'error into import httpclient' , e ) ;
50
54
}
@@ -77,9 +81,10 @@ const addPolyfill = (options: Schema) => (tree: Tree, context: SchematicContext)
77
81
polyfills =
78
82
polyfills +
79
83
`\n/***************************************************************************************************
80
- \n* SCULLY IMPORTS
81
- \n*/
82
- \n// tslint:disable-next-line: align \nimport 'zone.js/dist/task-tracking';` ;
84
+ * SCULLY IMPORTS
85
+ */
86
+ // tslint:disable-next-line: align
87
+ import 'zone.js/dist/task-tracking';` ;
83
88
tree . overwrite ( `${ getSrc ( tree ) } /polyfills.ts` , polyfills ) ;
84
89
}
85
90
} ;
@@ -129,7 +134,7 @@ const injectIdleService = (options: Schema) => (tree: Tree, context: SchematicCo
129
134
}
130
135
} ;
131
136
132
- const runScullySchmeatic = ( options : Schema ) => ( tree : Tree , context : SchematicContext ) => {
137
+ const runScullySchematic = ( options : Schema ) => ( tree : Tree , context : SchematicContext ) => {
133
138
const nextRules : Rule [ ] = [ ] ;
134
139
if ( options . blog === true ) {
135
140
// @ts -ignore
@@ -138,8 +143,8 @@ const runScullySchmeatic = (options: Schema) => (tree: Tree, context: SchematicC
138
143
// tslint:disable-next-line:no-shadowed-variable
139
144
nextRules . push ( ( tree : Tree , context : SchematicContext ) => {
140
145
const installTaskId = context . addTask ( new NodePackageInstallTask ( ) ) ;
141
- context . addTask ( new RunSchematicTask ( 'scully ' , options ) , [ installTaskId ] ) ;
146
+ context . addTask ( new RunSchematicTask ( 'run ' , options ) , [ installTaskId ] ) ;
142
147
} ) ;
143
148
144
- chain ( nextRules ) ;
149
+ return chain ( nextRules ) ;
145
150
} ;
0 commit comments