File tree Expand file tree Collapse file tree 5 files changed +60
-13
lines changed
Expand file tree Collapse file tree 5 files changed +60
-13
lines changed Original file line number Diff line number Diff line change 4141 "loader-utils" : " 3.3.1" ,
4242 "mini-css-extract-plugin" : " 2.9.2" ,
4343 "open" : " 10.1.2" ,
44- "ora" : " 5.4.1 " ,
44+ "ora" : " 8.2.0 " ,
4545 "picomatch" : " 4.0.2" ,
4646 "piscina" : " 5.0.0" ,
4747 "postcss" : " 8.5.3" ,
Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9- import ora from 'ora' ;
9+ import ora , { type Ora } from 'ora' ;
1010import { colors } from './color' ;
1111import { isTTY } from './tty' ;
1212
1313export class Spinner {
14- private readonly spinner : ora . Ora ;
14+ private readonly spinner : Ora ;
1515
1616 /** When false, only fail messages will be displayed. */
1717 enabled = true ;
Original file line number Diff line number Diff line change 1616 "@angular-devkit/core" : " workspace:0.0.0-PLACEHOLDER" ,
1717 "jsonc-parser" : " 3.3.1" ,
1818 "magic-string" : " 0.30.17" ,
19- "ora" : " 5.4.1 " ,
19+ "ora" : " 8.2.0 " ,
2020 "rxjs" : " 7.8.2"
2121 }
2222}
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import { BaseException } from '@angular-devkit/core';
1010import { SpawnOptions , spawn } from 'node:child_process' ;
1111import * as path from 'node:path' ;
1212import ora from 'ora' ;
13- import { Observable } from 'rxjs' ;
1413import { TaskExecutor , UnsuccessfulWorkflowExecution } from '../../src' ;
1514import { NodePackageTaskFactoryOptions , NodePackageTaskOptions } from './options' ;
1615
@@ -127,7 +126,7 @@ export default function (
127126 args . push ( '--force' ) ;
128127 }
129128
130- return new Observable ( ( obs ) => {
129+ return new Promise < void > ( ( resolve , reject ) => {
131130 const spinner = ora ( {
132131 text : `Installing packages (${ taskPackageManagerName } )...` ,
133132 // Workaround for https://github.com/sindresorhus/ora/issues/136.
@@ -139,14 +138,13 @@ export default function (
139138 if ( code === 0 ) {
140139 spinner . succeed ( 'Packages installed successfully.' ) ;
141140 spinner . stop ( ) ;
142- obs . next ( ) ;
143- obs . complete ( ) ;
141+ resolve ( ) ;
144142 } else {
145143 if ( options . hideOutput ) {
146144 bufferedOutput . forEach ( ( { stream, data } ) => stream . write ( data ) ) ;
147145 }
148146 spinner . fail ( 'Package install failed, see above.' ) ;
149- obs . error ( new UnsuccessfulWorkflowExecution ( ) ) ;
147+ reject ( new UnsuccessfulWorkflowExecution ( ) ) ;
150148 }
151149 } ,
152150 ) ;
You can’t perform that action at this time.
0 commit comments