Skip to content

Commit d962d6c

Browse files
clydinmgechev
authored andcommitted
refactor(@angular/pwa): remove unneeded rxjs dependency
1 parent ec731f0 commit d962d6c

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

packages/angular/pwa/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"@angular-devkit/core": "0.0.0",
1414
"@angular-devkit/schematics": "0.0.0",
1515
"@schematics/angular": "0.0.0",
16-
"parse5-html-rewriting-stream": "5.1.0",
17-
"rxjs": "6.4.0"
16+
"parse5-html-rewriting-stream": "5.1.0"
1817
}
1918
}

packages/angular/pwa/pwa/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '@angular-devkit/core';
1616
import {
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';
3028
import { Readable, Writable } from 'stream';
3129
import { 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

117114
export 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

Comments
 (0)