File tree 5 files changed +60
-13
lines changed
5 files changed +60
-13
lines changed Original file line number Diff line number Diff line change 41
41
"loader-utils" : " 3.3.1" ,
42
42
"mini-css-extract-plugin" : " 2.9.2" ,
43
43
"open" : " 10.1.2" ,
44
- "ora" : " 5.4.1 " ,
44
+ "ora" : " 8.2.0 " ,
45
45
"picomatch" : " 4.0.2" ,
46
46
"piscina" : " 5.0.0" ,
47
47
"postcss" : " 8.5.3" ,
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.dev/license
7
7
*/
8
8
9
- import ora from 'ora' ;
9
+ import ora , { type Ora } from 'ora' ;
10
10
import { colors } from './color' ;
11
11
import { isTTY } from './tty' ;
12
12
13
13
export class Spinner {
14
- private readonly spinner : ora . Ora ;
14
+ private readonly spinner : Ora ;
15
15
16
16
/** When false, only fail messages will be displayed. */
17
17
enabled = true ;
Original file line number Diff line number Diff line change 16
16
"@angular-devkit/core" : " workspace:0.0.0-PLACEHOLDER" ,
17
17
"jsonc-parser" : " 3.3.1" ,
18
18
"magic-string" : " 0.30.17" ,
19
- "ora" : " 5.4.1 " ,
19
+ "ora" : " 8.2.0 " ,
20
20
"rxjs" : " 7.8.2"
21
21
}
22
22
}
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import { BaseException } from '@angular-devkit/core';
10
10
import { SpawnOptions , spawn } from 'node:child_process' ;
11
11
import * as path from 'node:path' ;
12
12
import ora from 'ora' ;
13
- import { Observable } from 'rxjs' ;
14
13
import { TaskExecutor , UnsuccessfulWorkflowExecution } from '../../src' ;
15
14
import { NodePackageTaskFactoryOptions , NodePackageTaskOptions } from './options' ;
16
15
@@ -127,7 +126,7 @@ export default function (
127
126
args . push ( '--force' ) ;
128
127
}
129
128
130
- return new Observable ( ( obs ) => {
129
+ return new Promise < void > ( ( resolve , reject ) => {
131
130
const spinner = ora ( {
132
131
text : `Installing packages (${ taskPackageManagerName } )...` ,
133
132
// Workaround for https://github.com/sindresorhus/ora/issues/136.
@@ -139,14 +138,13 @@ export default function (
139
138
if ( code === 0 ) {
140
139
spinner . succeed ( 'Packages installed successfully.' ) ;
141
140
spinner . stop ( ) ;
142
- obs . next ( ) ;
143
- obs . complete ( ) ;
141
+ resolve ( ) ;
144
142
} else {
145
143
if ( options . hideOutput ) {
146
144
bufferedOutput . forEach ( ( { stream, data } ) => stream . write ( data ) ) ;
147
145
}
148
146
spinner . fail ( 'Package install failed, see above.' ) ;
149
- obs . error ( new UnsuccessfulWorkflowExecution ( ) ) ;
147
+ reject ( new UnsuccessfulWorkflowExecution ( ) ) ;
150
148
}
151
149
} ,
152
150
) ;
You can’t perform that action at this time.
0 commit comments