77 * found in the LICENSE file at https://angular.dev/license
88 */
99
10- import { Architect , BuilderInfo , BuilderProgressState , Target } from '@angular-devkit/architect' ;
10+ import { Architect } from '@angular-devkit/architect' ;
1111import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node' ;
1212import { JsonValue , json , logging , schema , tags , workspaces } from '@angular-devkit/core' ;
1313import { NodeJsSyncHost , createConsoleLogger } from '@angular-devkit/core/node' ;
1414import * as ansiColors from 'ansi-colors' ;
1515import { existsSync } from 'node:fs' ;
1616import * as path from 'node:path' ;
1717import yargsParser , { camelCase , decamelize } from 'yargs-parser' ;
18- import { MultiProgressBar } from '../src/progress' ;
1918
2019function findUp ( names : string | string [ ] , from : string ) {
2120 if ( ! Array . isArray ( names ) ) {
@@ -59,16 +58,6 @@ function usage(logger: logging.Logger, exitCode = 0): never {
5958 return process . exit ( exitCode ) ;
6059}
6160
62- function _targetStringFromTarget ( { project, target, configuration } : Target ) {
63- return `${project } :${target } ${configuration !== undefined ? ':' + configuration : ''} `;
64- }
65-
66- interface BarInfo {
67- status?: string;
68- builder: BuilderInfo;
69- target?: Target;
70- }
71-
7261// Create a separate instance to prevent unintended global changes to the color configuration
7362const colors = ansiColors . create ( ) ;
7463
@@ -106,47 +95,6 @@ async function _executeTarget(
10695 }
10796
10897 const run = await architect . scheduleTarget ( targetSpec , camelCasedOptions , { logger } ) ;
109- const bars = new MultiProgressBar<number, BarInfo>(':name :bar (:current/:total) :status');
110-
111- run.progress.subscribe((update) => {
112- const data = bars.get(update.id) || {
113- id: update.id,
114- builder: update.builder,
115- target: update.target,
116- status: update.status || '',
117- name: (
118- (update.target ? _targetStringFromTarget(update.target) : update.builder.name) +
119- ' '.repeat(80)
120- ).substring(0, 40),
121- };
122-
123- if (update.status !== undefined) {
124- data.status = update.status;
125- }
126-
127- switch (update.state) {
128- case BuilderProgressState.Error:
129- data.status = 'Error: ' + update.error;
130- bars.update(update.id, data);
131- break;
132-
133- case BuilderProgressState.Stopped:
134- data.status = 'Done.';
135- bars.complete(update.id);
136- bars.update(update.id, data, update.total, update.total);
137- break;
138-
139- case BuilderProgressState.Waiting:
140- bars.update(update.id, data);
141- break;
142-
143- case BuilderProgressState.Running:
144- bars.update(update.id, data, update.current, update.total);
145- break;
146- }
147-
148- bars.render();
149- });
15098
15199 // Wait for full completion of the builder.
152100 try {
@@ -163,7 +111,6 @@ async function _executeTarget(
163111 logs . splice ( 0 ) ;
164112
165113 await run . stop ( ) ;
166- bars.terminate();
167114
168115 return result . success ? 0 : 1 ;
169116 } catch ( err ) {
0 commit comments