@@ -15,7 +15,6 @@ import {
1515} from '@angular-devkit/core' ;
1616import {
1717 Rule ,
18- SchematicContext ,
1918 SchematicsException ,
2019 Tree ,
2120 apply ,
@@ -26,7 +25,6 @@ import {
2625 template ,
2726 url ,
2827} from '@angular-devkit/schematics' ;
29- import { Observable } from 'rxjs' ;
3028import { Readable , Writable } from 'stream' ;
3129import { Schema as PwaOptions } from './schema' ;
3230
@@ -85,7 +83,7 @@ function updateIndexFile(path: string): Rule {
8583 rewriter . emitEndTag ( endTag ) ;
8684 } ) ;
8785
88- return new Observable < Tree > ( obs => {
86+ return new Promise < void > ( resolve => {
8987 const input = new Readable ( {
9088 encoding : 'utf8' ,
9189 read ( ) : void {
@@ -104,8 +102,7 @@ function updateIndexFile(path: string): Rule {
104102 const full = Buffer . concat ( chunks ) ;
105103 host . overwrite ( path , full . toString ( ) ) ;
106104 callback ( ) ;
107- obs . next ( host ) ;
108- obs . complete ( ) ;
105+ resolve ( ) ;
109106 } ,
110107 } ) ;
111108
@@ -115,7 +112,7 @@ function updateIndexFile(path: string): Rule {
115112}
116113
117114export default function ( options : PwaOptions ) : Rule {
118- return ( host : Tree , context : SchematicContext ) => {
115+ return ( host : Tree ) => {
119116 if ( ! options . title ) {
120117 options . title = options . project ;
121118 }
@@ -210,6 +207,6 @@ export default function (options: PwaOptions): Rule {
210207 mergeWith ( rootTemplateSource ) ,
211208 mergeWith ( assetsTemplateSource ) ,
212209 ...[ ...indexFiles ] . map ( path => updateIndexFile ( path ) ) ,
213- ] ) ( host , context ) ;
210+ ] ) ;
214211 } ;
215212}
0 commit comments