77
88import * as os from 'os' ;
99import * as path from 'path' ;
10- import { CliUx } from '@oclif/core' ;
10+ import { ux } from '@oclif/core' ;
1111import { blue , bold , dim , underline } from 'chalk' ;
1212import {
1313 DeployResult ,
@@ -183,7 +183,7 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
183183 replaced,
184184 } ) )
185185 ) ;
186- CliUx . ux . table (
186+ ux . table (
187187 replacements ,
188188 {
189189 filePath : { header : 'PROJECT PATH' } ,
@@ -209,9 +209,9 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
209209 } ;
210210 const title = 'Deployed Source' ;
211211 const options = { title : tableHeader ( title ) } ;
212- CliUx . ux . log ( ) ;
212+ ux . log ( ) ;
213213
214- CliUx . ux . table (
214+ ux . table (
215215 successes . map ( ( s ) => ( { filePath : s . filePath , fullName : s . fullName , type : s . type , state : s . state } ) ) ,
216216 columns ,
217217 options
@@ -230,8 +230,8 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
230230 error : { header : 'Problem' } ,
231231 } ;
232232 const options = { title : error ( `Component Failures [${ failures . length } ]` ) } ;
233- CliUx . ux . log ( ) ;
234- CliUx . ux . table (
233+ ux . log ( ) ;
234+ ux . table (
235235 failures . map ( ( f ) => ( { problemType : f . problemType , fullName : f . fullName , error : f . error } ) ) ,
236236 columns ,
237237 options
@@ -250,14 +250,14 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
250250 } ;
251251
252252 const options = { title : tableHeader ( 'Deleted Source' ) } ;
253- CliUx . ux . log ( ) ;
253+ ux . log ( ) ;
254254
255- CliUx . ux . table ( getFileResponseSuccessProps ( deletions ) , columns , options ) ;
255+ ux . table ( getFileResponseSuccessProps ( deletions ) , columns , options ) ;
256256 }
257257
258258 private displayTestResults ( ) : void {
259259 if ( this . testLevel === TestLevel . NoTestRun ) {
260- CliUx . ux . log ( ) ;
260+ ux . log ( ) ;
261261 return ;
262262 }
263263
@@ -268,27 +268,27 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
268268 this . displayVerboseTestCoverage ( ) ;
269269 }
270270
271- CliUx . ux . log ( ) ;
272- CliUx . ux . log ( tableHeader ( 'Test Results Summary' ) ) ;
271+ ux . log ( ) ;
272+ ux . log ( tableHeader ( 'Test Results Summary' ) ) ;
273273 const passing = this . result . response . numberTestsCompleted ?? 0 ;
274274 const failing = this . result . response . numberTestErrors ?? 0 ;
275275 const total = this . result . response . numberTestsTotal ?? 0 ;
276276 const time = this . result . response . details . runTestResult ?. totalTime ?? 0 ;
277- CliUx . ux . log ( `Passing: ${ passing } ` ) ;
278- CliUx . ux . log ( `Failing: ${ failing } ` ) ;
279- CliUx . ux . log ( `Total: ${ total } ` ) ;
280- if ( time ) CliUx . ux . log ( `Time: ${ time } ` ) ;
277+ ux . log ( `Passing: ${ passing } ` ) ;
278+ ux . log ( `Failing: ${ failing } ` ) ;
279+ ux . log ( `Total: ${ total } ` ) ;
280+ if ( time ) ux . log ( `Time: ${ time } ` ) ;
281281 }
282282
283283 private displayVerboseTestSuccesses ( ) : void {
284284 const successes = ensureArray ( this . result . response . details . runTestResult ?. successes ) ;
285285 if ( successes . length > 0 ) {
286286 const testSuccesses = sortTestResults ( successes ) as Successes [ ] ;
287- CliUx . ux . log ( ) ;
288- CliUx . ux . log ( success ( `Test Success [${ successes . length } ]` ) ) ;
287+ ux . log ( ) ;
288+ ux . log ( success ( `Test Success [${ successes . length } ]` ) ) ;
289289 for ( const test of testSuccesses ) {
290290 const testName = underline ( `${ test . name } .${ test . methodName } ` ) ;
291- CliUx . ux . log ( `${ check } ${ testName } ` ) ;
291+ ux . log ( `${ check } ${ testName } ` ) ;
292292 }
293293 }
294294 }
@@ -298,26 +298,26 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
298298 const failures = ensureArray ( this . result . response . details . runTestResult ?. failures ) ;
299299 const failureCount = this . result . response . details . runTestResult ?. numFailures ;
300300 const testFailures = sortTestResults ( failures ) as Failures [ ] ;
301- CliUx . ux . log ( ) ;
302- CliUx . ux . log ( error ( `Test Failures [${ failureCount } ]` ) ) ;
301+ ux . log ( ) ;
302+ ux . log ( error ( `Test Failures [${ failureCount } ]` ) ) ;
303303 for ( const test of testFailures ) {
304304 const testName = underline ( `${ test . name } .${ test . methodName } ` ) ;
305305 const stackTrace = test . stackTrace . replace ( / \n / g, `${ os . EOL } ` ) ;
306- CliUx . ux . log ( `• ${ testName } ` ) ;
307- CliUx . ux . log ( ` ${ dim ( 'message' ) } : ${ test . message } ` ) ;
308- CliUx . ux . log ( ` ${ dim ( 'stacktrace' ) } : ${ os . EOL } ${ stackTrace } ` ) ;
309- CliUx . ux . log ( ) ;
306+ ux . log ( `• ${ testName } ` ) ;
307+ ux . log ( ` ${ dim ( 'message' ) } : ${ test . message } ` ) ;
308+ ux . log ( ` ${ dim ( 'stacktrace' ) } : ${ os . EOL } ${ stackTrace } ` ) ;
309+ ux . log ( ) ;
310310 }
311311 }
312312
313313 private displayVerboseTestCoverage ( ) : void {
314314 const codeCoverage = ensureArray ( this . result . response . details . runTestResult ?. codeCoverage ) ;
315315 if ( codeCoverage . length ) {
316316 const coverage = codeCoverage . sort ( ( a , b ) => ( a . name . toUpperCase ( ) > b . name . toUpperCase ( ) ? 1 : - 1 ) ) ;
317- CliUx . ux . log ( ) ;
318- CliUx . ux . log ( tableHeader ( 'Apex Code Coverage' ) ) ;
317+ ux . log ( ) ;
318+ ux . log ( tableHeader ( 'Apex Code Coverage' ) ) ;
319319
320- CliUx . ux . table ( coverage . map ( coverageOutput ) , {
320+ ux . table ( coverage . map ( coverageOutput ) , {
321321 name : { header : 'Name' } ,
322322 numLocations : { header : '% Covered' } ,
323323 lineNotCovered : { header : 'Uncovered Lines' } ,
@@ -334,7 +334,7 @@ export class DeployResultFormatter implements Formatter<DeployResultJson> {
334334
335335export class DeployReportResultFormatter extends DeployResultFormatter {
336336 public display ( ) : void {
337- CliUx . ux . log ( `${ this . result . response . id } ... ${ this . result . response . status } ` ) ;
337+ ux . log ( `${ this . result . response . id } ... ${ this . result . response . status } ` ) ;
338338
339339 const response = Object . entries ( this . result . response ) . reduce < Array < { key : string ; value : unknown } > > (
340340 ( result , [ key , value ] ) => {
@@ -350,15 +350,15 @@ export class DeployReportResultFormatter extends DeployResultFormatter {
350350 [ ]
351351 ) ;
352352
353- CliUx . ux . log ( ) ;
354- CliUx . ux . table ( response , { key : { } , value : { } } , { title : tableHeader ( 'Deploy Info' ) } ) ;
353+ ux . log ( ) ;
354+ ux . table ( response , { key : { } , value : { } } , { title : tableHeader ( 'Deploy Info' ) } ) ;
355355
356356 const opts = Object . entries ( this . flags ) . reduce < Array < { key : string ; value : unknown } > > ( ( result , [ key , value ] ) => {
357357 if ( key === 'timestamp' ) return result ;
358358 return result . concat ( { key, value } ) ;
359359 } , [ ] ) ;
360- CliUx . ux . log ( ) ;
361- CliUx . ux . table ( opts , { key : { } , value : { } } , { title : tableHeader ( 'Deploy Options' ) } ) ;
360+ ux . log ( ) ;
361+ ux . table ( opts , { key : { } , value : { } } , { title : tableHeader ( 'Deploy Options' ) } ) ;
362362 super . display ( ) ;
363363 }
364364}
@@ -371,11 +371,11 @@ export class AsyncDeployResultFormatter implements Formatter<AsyncDeployResultJs
371371 }
372372
373373 public display ( ) : void {
374- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployQueued' ) ) ;
375- CliUx . ux . log ( ) ;
376- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployResume' , [ this . id ] ) ) ;
377- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployStatus' , [ this . id ] ) ) ;
378- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployCancel' , [ this . id ] ) ) ;
374+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployQueued' ) ) ;
375+ ux . log ( ) ;
376+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployResume' , [ this . id ] ) ) ;
377+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployStatus' , [ this . id ] ) ) ;
378+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployCancel' , [ this . id ] ) ) ;
379379 }
380380}
381381
@@ -388,9 +388,9 @@ export class DeployCancelResultFormatter implements Formatter<DeployResultJson>
388388
389389 public display ( ) : void {
390390 if ( this . result . response . status === RequestStatus . Canceled ) {
391- CliUx . ux . log ( `Successfully canceled ${ this . result . response . id } ` ) ;
391+ ux . log ( `Successfully canceled ${ this . result . response . id } ` ) ;
392392 } else {
393- CliUx . ux . error ( `Could not cancel ${ this . result . response . id } ` ) ;
393+ ux . error ( `Could not cancel ${ this . result . response . id } ` ) ;
394394 }
395395 }
396396}
@@ -403,9 +403,9 @@ export class AsyncDeployCancelResultFormatter implements Formatter<AsyncDeployRe
403403 }
404404
405405 public display ( ) : void {
406- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployCancelQueued' ) ) ;
407- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployResume' , [ this . id ] ) ) ;
408- CliUx . ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployStatus' , [ this . id ] ) ) ;
406+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployCancelQueued' ) ) ;
407+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployResume' , [ this . id ] ) ) ;
408+ ux . log ( deployAsyncMessages . getMessage ( 'info.AsyncDeployStatus' , [ this . id ] ) ) ;
409409 }
410410}
411411
@@ -441,9 +441,9 @@ export class RetrieveResultFormatter implements Formatter<RetrieveResultJson> {
441441 } ;
442442 const title = 'Retrieved Source' ;
443443 const options = { title : tableHeader ( title ) } ;
444- CliUx . ux . log ( ) ;
444+ ux . log ( ) ;
445445
446- CliUx . ux . table ( getFileResponseSuccessProps ( successes ) , columns , options ) ;
446+ ux . table ( getFileResponseSuccessProps ( successes ) , columns , options ) ;
447447 }
448448
449449 private async displayPackages ( ) : Promise < void > {
@@ -455,8 +455,8 @@ export class RetrieveResultFormatter implements Formatter<RetrieveResultJson> {
455455 } ;
456456 const title = 'Retrieved Packages' ;
457457 const options = { title : tableHeader ( title ) } ;
458- CliUx . ux . log ( ) ;
459- CliUx . ux . table ( packages , columns , options ) ;
458+ ux . log ( ) ;
459+ ux . table ( packages , columns , options ) ;
460460 }
461461 }
462462
@@ -488,10 +488,10 @@ export class MetadataRetrieveResultFormatter implements Formatter<MetadataRetrie
488488
489489 // eslint-disable-next-line @typescript-eslint/require-await
490490 public async display ( ) : Promise < void > {
491- CliUx . ux . log ( retrieveMessages . getMessage ( 'info.WroteZipFile' , [ this . zipFilePath ] ) ) ;
491+ ux . log ( retrieveMessages . getMessage ( 'info.WroteZipFile' , [ this . zipFilePath ] ) ) ;
492492 if ( this . opts . unzip ) {
493493 const extractPath = path . join ( this . opts [ 'target-metadata-dir' ] , path . parse ( this . opts [ 'zip-file-name' ] ) . name ) ;
494- CliUx . ux . log ( retrieveMessages . getMessage ( 'info.ExtractedZipFile' , [ this . zipFilePath , extractPath ] ) ) ;
494+ ux . log ( retrieveMessages . getMessage ( 'info.ExtractedZipFile' , [ this . zipFilePath , extractPath ] ) ) ;
495495 }
496496 }
497497}
0 commit comments