mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
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.
This commit is contained in:
parent
b2513e5af2
commit
17a91a058f
@ -24,7 +24,6 @@ ts_library(
|
||||
"@npm//@types/progress",
|
||||
"@npm//@types/yargs-parser",
|
||||
"@npm//ansi-colors",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -14,7 +14,6 @@ import { NodeJsSyncHost, createConsoleLogger } from '@angular-devkit/core/node';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import { existsSync } from 'fs';
|
||||
import * as path from 'path';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import yargsParser, { camelCase, decamelize } from 'yargs-parser';
|
||||
import { MultiProgressBar } from '../src/progress';
|
||||
|
||||
@ -151,27 +150,22 @@ async function _executeTarget(
|
||||
|
||||
// Wait for full completion of the builder.
|
||||
try {
|
||||
const { success } = await run.output
|
||||
.pipe(
|
||||
tap((result) => {
|
||||
if (result.success) {
|
||||
parentLogger.info(colors.green('SUCCESS'));
|
||||
} else {
|
||||
parentLogger.info(colors.red('FAILURE'));
|
||||
}
|
||||
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));
|
||||
const result = await run.output.toPromise();
|
||||
if (result.success) {
|
||||
parentLogger.info(colors.green('SUCCESS'));
|
||||
} else {
|
||||
parentLogger.info(colors.red('FAILURE'));
|
||||
}
|
||||
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));
|
||||
|
||||
parentLogger.info('\nLogs:');
|
||||
logs.forEach((l) => parentLogger.next(l));
|
||||
logs.splice(0);
|
||||
}),
|
||||
)
|
||||
.toPromise();
|
||||
parentLogger.info('\nLogs:');
|
||||
logs.forEach((l) => parentLogger.next(l));
|
||||
logs.splice(0);
|
||||
|
||||
await run.stop();
|
||||
bars.terminate();
|
||||
|
||||
return success ? 0 : 1;
|
||||
return result.success ? 0 : 1;
|
||||
} catch (err) {
|
||||
parentLogger.info(colors.red('ERROR'));
|
||||
parentLogger.info('\nLogs:');
|
||||
|
@ -18,7 +18,6 @@
|
||||
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
|
||||
"ansi-colors": "4.1.3",
|
||||
"progress": "2.0.3",
|
||||
"rxjs": "6.6.7",
|
||||
"symbol-observable": "4.0.0",
|
||||
"yargs-parser": "21.0.1"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user