Skip to content

Commit 650e132

Browse files
committed
refactor: use cli-progress directly
1 parent f81f043 commit 650e132

File tree

4 files changed

+9
-32
lines changed

4 files changed

+9
-32
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@salesforce/source-tracking": "^6.3.3",
1515
"@salesforce/ts-types": "^2.0.9",
1616
"chalk": "^5.3.0",
17+
"cli-progress": "^3.12.0",
1718
"got": "^13.0.0",
1819
"proxy-agent": "^6.3.1"
1920
},
@@ -26,6 +27,7 @@
2627
"@salesforce/source-testkit": "^2.2.23",
2728
"@salesforce/ts-sinon": "1.4.19",
2829
"@types/archiver": "^5.3.2",
30+
"@types/cli-progress": "^3.11.5",
2931
"archiver": "^5.3.2",
3032
"chai-each": "^0.0.1",
3133
"cross-env": "^7.0.3",

src/formatters/deployProgressBarFormatter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
import { MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
99
import { once } from '@salesforce/kit';
10-
import { ux as coreUx } from '@oclif/core';
10+
import { SingleBar } from 'cli-progress';
1111
import { Ux } from '@salesforce/sf-plugins-core';
1212
import { ProgressFormatter } from './progressFormatter.js';
1313

1414
export class DeployProgressBarFormatter extends ProgressFormatter {
15-
protected progressBar = coreUx.progress({
15+
protected progressBar = new SingleBar({
1616
format: 'DEPLOY PROGRESS | {bar} | {value}/{total} Components',
1717
barCompleteChar: '\u2588',
1818
barIncompleteChar: '\u2591',

src/sourceCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import fs from 'node:fs';
1111
import { Messages, SfError } from '@salesforce/core';
1212
import { ComponentSet } from '@salesforce/source-deploy-retrieve';
1313
import { getString, Optional } from '@salesforce/ts-types';
14-
import { ux } from '@oclif/core';
14+
import { SingleBar } from 'cli-progress';
1515
import { SfCommand } from '@salesforce/sf-plugins-core';
1616
import { EnsureFsFlagOptions, FsError, ProgressBar } from './types.js';
1717

@@ -26,7 +26,7 @@ export abstract class SourceCommand extends SfCommand<unknown> {
2626

2727
protected initProgressBar(): void {
2828
this.debug('initializing progress bar');
29-
this.progressBar = ux.progress({
29+
this.progressBar = new SingleBar({
3030
format: 'SOURCE PROGRESS | {bar} | {value}/{total} Components',
3131
barCompleteChar: '\u2588',
3232
barIncompleteChar: '\u2591',

yarn.lock

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7291,16 +7291,7 @@ srcset@^5.0.0:
72917291
resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f"
72927292
integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA==
72937293

7294-
"string-width-cjs@npm:string-width@^4.2.0":
7295-
version "4.2.3"
7296-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
7297-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
7298-
dependencies:
7299-
emoji-regex "^8.0.0"
7300-
is-fullwidth-code-point "^3.0.0"
7301-
strip-ansi "^6.0.1"
7302-
7303-
string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
7294+
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
73047295
version "4.2.3"
73057296
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
73067297
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -7368,14 +7359,7 @@ string_decoder@~1.1.1:
73687359
dependencies:
73697360
safe-buffer "~5.1.0"
73707361

7371-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
7372-
version "6.0.1"
7373-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
7374-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
7375-
dependencies:
7376-
ansi-regex "^5.0.1"
7377-
7378-
strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
7362+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
73797363
version "6.0.1"
73807364
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
73817365
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -7937,7 +7921,7 @@ workerpool@6.2.1:
79377921
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
79387922
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==
79397923

7940-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
7924+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
79417925
version "7.0.0"
79427926
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
79437927
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -7955,15 +7939,6 @@ wrap-ansi@^6.2.0:
79557939
string-width "^4.1.0"
79567940
strip-ansi "^6.0.0"
79577941

7958-
wrap-ansi@^7.0.0:
7959-
version "7.0.0"
7960-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
7961-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
7962-
dependencies:
7963-
ansi-styles "^4.0.0"
7964-
string-width "^4.1.0"
7965-
strip-ansi "^6.0.0"
7966-
79677942
wrap-ansi@^8.1.0:
79687943
version "8.1.0"
79697944
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)