Skip to content

Commit 17a91a0

Browse files
committed
refactor(@angular-devkit/architect-cli): remove rxjs as a dependency
`rxjs` was only a dependency for the `tap` operator which can be replaced by accessing the result object returned from awaiting the builder output `Observable` which is already converted to a Promise.
1 parent b2513e5 commit 17a91a0

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

packages/angular_devkit/architect_cli/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ts_library(
2424
"@npm//@types/progress",
2525
"@npm//@types/yargs-parser",
2626
"@npm//ansi-colors",
27-
"@npm//rxjs",
2827
],
2928
)
3029

packages/angular_devkit/architect_cli/bin/architect.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { NodeJsSyncHost, createConsoleLogger } from '@angular-devkit/core/node';
1414
import * as ansiColors from 'ansi-colors';
1515
import { existsSync } from 'fs';
1616
import * as path from 'path';
17-
import { tap } from 'rxjs/operators';
1817
import yargsParser, { camelCase, decamelize } from 'yargs-parser';
1918
import { MultiProgressBar } from '../src/progress';
2019

@@ -151,27 +150,22 @@ async function _executeTarget(
151150
152151
// Wait for full completion of the builder.
153152
try {
154-
const { success } = await run.output
155-
.pipe(
156-
tap((result) => {
157-
if (result.success) {
158-
parentLogger.info(colors.green('SUCCESS'));
159-
} else {
160-
parentLogger.info(colors.red('FAILURE'));
161-
}
162-
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));
163-
164-
parentLogger.info('\nLogs:');
165-
logs.forEach((l) => parentLogger.next(l));
166-
logs.splice(0);
167-
}),
168-
)
169-
.toPromise();
153+
const result = await run.output.toPromise();
154+
if (result.success) {
155+
parentLogger.info(colors.green('SUCCESS'));
156+
} else {
157+
parentLogger.info(colors.red('FAILURE'));
158+
}
159+
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));
160+
161+
parentLogger.info('\nLogs:');
162+
logs.forEach((l) => parentLogger.next(l));
163+
logs.splice(0);
170164
171165
await run.stop();
172166
bars.terminate();
173167
174-
return success ? 0 : 1;
168+
return result.success ? 0 : 1;
175169
} catch (err) {
176170
parentLogger.info(colors.red('ERROR'));
177171
parentLogger.info('\nLogs:');

packages/angular_devkit/architect_cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
1919
"ansi-colors": "4.1.3",
2020
"progress": "2.0.3",
21-
"rxjs": "6.6.7",
2221
"symbol-observable": "4.0.0",
2322
"yargs-parser": "21.0.1"
2423
},

0 commit comments

Comments
 (0)