First upload version 0.0.1
This commit is contained in:
39
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/base-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
39
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/base-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import { FormattedStatus } from "../../format-transfer-status.js";
|
||||
import { BaseMultiProgressBar } from "../multiProgressBars/BaseMultiProgressBar.js";
|
||||
import { DataLine, DataPart } from "../../utils/data-line.js";
|
||||
import cliSpinners, { Spinner } from "cli-spinners";
|
||||
export type CliFormattedStatus = FormattedStatus & {
|
||||
transferAction: string;
|
||||
};
|
||||
export type BaseCliOptions = {
|
||||
truncateName?: boolean | number;
|
||||
loadingSpinner?: cliSpinners.SpinnerName;
|
||||
};
|
||||
export interface TransferCliProgressBar {
|
||||
multiProgressBar: typeof BaseMultiProgressBar;
|
||||
createStatusLine(status: CliFormattedStatus): string;
|
||||
}
|
||||
/**
|
||||
* A class to display transfer progress in the terminal, with a progress bar and other information.
|
||||
*/
|
||||
export default class BaseTransferCliProgressBar implements TransferCliProgressBar {
|
||||
multiProgressBar: typeof BaseMultiProgressBar;
|
||||
downloadLoadingSpinner: Spinner;
|
||||
private _spinnerState;
|
||||
protected status: CliFormattedStatus;
|
||||
protected options: BaseCliOptions;
|
||||
protected minNameLength: number;
|
||||
constructor(options: BaseCliOptions);
|
||||
switchTransferToShortText(): string;
|
||||
protected get showETA(): boolean;
|
||||
protected getNameSize(fileName?: string): number;
|
||||
protected getSpinnerText(): string;
|
||||
protected getNameAndCommentDataParts(): DataPart[];
|
||||
protected getETA(spacer?: string, formatter?: (text: string, size: number, type: "spacer" | "time") => string): DataLine;
|
||||
protected createProgressBarLine(length: number): string;
|
||||
protected renderProgressLine(): string;
|
||||
protected renderFinishedLine(): string;
|
||||
protected renderPendingLine(): string;
|
||||
protected renderLoadingLine(): string;
|
||||
createStatusLine(status: CliFormattedStatus): string;
|
||||
}
|
||||
284
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/base-transfer-cli-progress-bar.js
generated
vendored
Normal file
284
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/base-transfer-cli-progress-bar.js
generated
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
import chalk from "chalk";
|
||||
import { truncateText } from "../../utils/cli-text.js";
|
||||
import { clamp } from "../../utils/numbers.js";
|
||||
import { DownloadStatus } from "../../../download-engine/download-file/progress-status-file.js";
|
||||
import { BaseMultiProgressBar } from "../multiProgressBars/BaseMultiProgressBar.js";
|
||||
import { STATUS_ICONS } from "../../utils/progressBarIcons.js";
|
||||
import { renderDataLine } from "../../utils/data-line.js";
|
||||
import cliSpinners from "cli-spinners";
|
||||
const SKIP_ETA_START_TIME = 1000 * 2;
|
||||
const MIN_NAME_LENGTH = 20;
|
||||
const MIN_COMMENT_LENGTH = 15;
|
||||
const DEFAULT_SPINNER_UPDATE_INTERVAL_MS = 10;
|
||||
/**
|
||||
* A class to display transfer progress in the terminal, with a progress bar and other information.
|
||||
*/
|
||||
export default class BaseTransferCliProgressBar {
|
||||
multiProgressBar = BaseMultiProgressBar;
|
||||
downloadLoadingSpinner;
|
||||
_spinnerState = {
|
||||
step: 0,
|
||||
lastChanged: 0
|
||||
};
|
||||
status = null;
|
||||
options;
|
||||
minNameLength = MIN_NAME_LENGTH;
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
this.downloadLoadingSpinner = cliSpinners[options.loadingSpinner ?? "dots"];
|
||||
}
|
||||
switchTransferToShortText() {
|
||||
switch (this.status.transferAction) {
|
||||
case "Downloading":
|
||||
return "Pull";
|
||||
case "Copying":
|
||||
return "Copy";
|
||||
}
|
||||
return this.status.transferAction;
|
||||
}
|
||||
get showETA() {
|
||||
return this.status.startTime < Date.now() - SKIP_ETA_START_TIME;
|
||||
}
|
||||
getNameSize(fileName = this.status.fileName) {
|
||||
return this.options.truncateName === false
|
||||
? fileName.length
|
||||
: typeof this.options.truncateName === "number"
|
||||
? this.options.truncateName
|
||||
: Math.min(fileName.length, this.minNameLength);
|
||||
}
|
||||
getSpinnerText() {
|
||||
const spinner = this.downloadLoadingSpinner.frames[this._spinnerState.step];
|
||||
if (this._spinnerState.lastChanged + DEFAULT_SPINNER_UPDATE_INTERVAL_MS < Date.now()) {
|
||||
this._spinnerState.step++;
|
||||
if (this._spinnerState.step >= this.downloadLoadingSpinner.frames.length) {
|
||||
this._spinnerState.step = 0;
|
||||
}
|
||||
this._spinnerState.lastChanged = Date.now();
|
||||
}
|
||||
return spinner;
|
||||
}
|
||||
getNameAndCommentDataParts() {
|
||||
const { fileName, comment, downloadStatus } = this.status;
|
||||
let fullComment = comment;
|
||||
if (downloadStatus === DownloadStatus.Cancelled || downloadStatus === DownloadStatus.Paused) {
|
||||
if (fullComment) {
|
||||
fullComment += " | " + downloadStatus;
|
||||
}
|
||||
else {
|
||||
fullComment = downloadStatus;
|
||||
}
|
||||
}
|
||||
return [{
|
||||
type: "name",
|
||||
fullText: fileName,
|
||||
size: this.getNameSize(),
|
||||
flex: typeof this.options.truncateName === "number"
|
||||
? undefined
|
||||
: 1,
|
||||
maxSize: fileName.length,
|
||||
cropper: truncateText,
|
||||
formatter: (text) => chalk.bold(text)
|
||||
}, ...((fullComment == null || fullComment.length === 0)
|
||||
? []
|
||||
: [{
|
||||
type: "spacer",
|
||||
fullText: " (",
|
||||
size: " (".length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}, {
|
||||
type: "nameComment",
|
||||
fullText: fullComment,
|
||||
size: Math.min(fullComment.length, MIN_COMMENT_LENGTH),
|
||||
maxSize: fullComment.length,
|
||||
flex: 1,
|
||||
cropper: truncateText,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}, {
|
||||
type: "spacer",
|
||||
fullText: ")",
|
||||
size: ")".length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}])];
|
||||
}
|
||||
getETA(spacer = " | ", formatter = text => text) {
|
||||
const formatedTimeLeft = this.status.timeLeft < 1_000 ? "0s" : this.status.formatTimeLeft;
|
||||
const timeLeft = `${formatedTimeLeft.padStart("10s".length)} left`;
|
||||
if (this.showETA) {
|
||||
return [{
|
||||
type: "spacer",
|
||||
fullText: spacer,
|
||||
size: spacer.length,
|
||||
formatter(text, size) {
|
||||
return formatter(text, size, "spacer");
|
||||
}
|
||||
}, {
|
||||
type: "timeLeft",
|
||||
fullText: timeLeft,
|
||||
size: timeLeft.length,
|
||||
formatter(text, size) {
|
||||
return formatter(text, size, "time");
|
||||
}
|
||||
}];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
createProgressBarLine(length) {
|
||||
const fileName = truncateText(this.status.fileName, length);
|
||||
const percentage = clamp(this.status.transferredBytes / this.status.totalBytes, 0, 1);
|
||||
const fullLength = Math.floor(percentage * length);
|
||||
const emptyLength = length - fullLength;
|
||||
return chalk.cyan(fileName.slice(0, fullLength)) + chalk.dim(fileName.slice(fullLength, fullLength + emptyLength));
|
||||
}
|
||||
renderProgressLine() {
|
||||
const { formattedPercentage, formattedSpeed, formatTransferredOfTotal, formatTotal } = this.status;
|
||||
const status = this.switchTransferToShortText();
|
||||
return renderDataLine([
|
||||
{
|
||||
type: "status",
|
||||
fullText: status,
|
||||
size: status.length,
|
||||
formatter: (text) => chalk.cyan(text)
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "percentage",
|
||||
fullText: formattedPercentage,
|
||||
size: "100.00%".length,
|
||||
formatter: () => chalk.green(formattedPercentage)
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "progressBar",
|
||||
size: this.getNameSize(),
|
||||
fullText: "",
|
||||
flex: 4,
|
||||
addEndPadding: 4,
|
||||
maxSize: 40,
|
||||
formatter: (_, size) => {
|
||||
return `[${this.createProgressBarLine(size)}]`;
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "transferred",
|
||||
fullText: formatTransferredOfTotal,
|
||||
size: `999.99MB/${formatTotal}`.length
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " (",
|
||||
size: " (".length
|
||||
},
|
||||
{
|
||||
type: "speed",
|
||||
fullText: formattedSpeed,
|
||||
size: Math.max("00.00kB/s".length, formattedSpeed.length),
|
||||
formatter: text => chalk.ansi256(31)(text)
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: ")",
|
||||
size: ")".length
|
||||
},
|
||||
...this.getETA(" ~ ", text => chalk.dim(text))
|
||||
]);
|
||||
}
|
||||
renderFinishedLine() {
|
||||
const status = this.status.downloadStatus === DownloadStatus.Finished ? chalk.green(STATUS_ICONS.done) : chalk.red(STATUS_ICONS.failed);
|
||||
return renderDataLine([
|
||||
{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => status
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
...this.getNameAndCommentDataParts()
|
||||
]);
|
||||
}
|
||||
renderPendingLine() {
|
||||
return renderDataLine([
|
||||
{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => STATUS_ICONS.pending
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
...this.getNameAndCommentDataParts(),
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "description",
|
||||
fullText: this.status.formatTotal,
|
||||
size: this.status.formatTotal.length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}
|
||||
]);
|
||||
}
|
||||
renderLoadingLine() {
|
||||
const spinner = this.getSpinnerText();
|
||||
const showText = "Gathering information";
|
||||
return renderDataLine([
|
||||
{
|
||||
type: "status",
|
||||
fullText: spinner,
|
||||
size: spinner.length,
|
||||
formatter: (text) => chalk.cyan(text)
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "name",
|
||||
fullText: showText,
|
||||
size: this.getNameSize(showText),
|
||||
flex: typeof this.options.truncateName === "number"
|
||||
? undefined
|
||||
: 1,
|
||||
maxSize: showText.length,
|
||||
cropper: truncateText,
|
||||
formatter: (text) => chalk.bold(text)
|
||||
}
|
||||
]);
|
||||
}
|
||||
createStatusLine(status) {
|
||||
this.status = status;
|
||||
if ([DownloadStatus.Finished, DownloadStatus.Error, DownloadStatus.Cancelled].includes(this.status.downloadStatus)) {
|
||||
return this.renderFinishedLine();
|
||||
}
|
||||
if (this.status.downloadStatus === DownloadStatus.NotStarted) {
|
||||
return this.renderPendingLine();
|
||||
}
|
||||
if (this.status.downloadStatus === DownloadStatus.Loading) {
|
||||
return this.renderLoadingLine();
|
||||
}
|
||||
return this.renderProgressLine();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=base-transfer-cli-progress-bar.js.map
|
||||
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/base-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/base-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
6
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import SummaryTransferCliProgressBar from "./summary-transfer-cli-progress-bar.js";
|
||||
import { CIMultiProgressBar } from "../multiProgressBars/CIMultiProgressBar.js";
|
||||
export default class CiTransferCliProgressBar extends SummaryTransferCliProgressBar {
|
||||
multiProgressBar: typeof CIMultiProgressBar;
|
||||
minNameLength: number;
|
||||
}
|
||||
8
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.js
generated
vendored
Normal file
8
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import SummaryTransferCliProgressBar from "./summary-transfer-cli-progress-bar.js";
|
||||
import { CIMultiProgressBar } from "../multiProgressBars/CIMultiProgressBar.js";
|
||||
const MIN_NAME_LENGTH = 80;
|
||||
export default class CiTransferCliProgressBar extends SummaryTransferCliProgressBar {
|
||||
multiProgressBar = CIMultiProgressBar;
|
||||
minNameLength = MIN_NAME_LENGTH;
|
||||
}
|
||||
//# sourceMappingURL=ci-transfer-cli-progress-bar.js.map
|
||||
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ci-transfer-cli-progress-bar.js","sourceRoot":"","sources":["../../../../../src/download/transfer-visualize/transfer-cli/progress-bars/ci-transfer-cli-progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAC,kBAAkB,EAAC,MAAM,4CAA4C,CAAC;AAE9E,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,6BAA6B;IACtE,gBAAgB,GAAG,kBAAkB,CAAC;IACtC,aAAa,GAAG,eAAe,CAAC;CAC5C"}
|
||||
9
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
9
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import BaseTransferCliProgressBar from "./base-transfer-cli-progress-bar.js";
|
||||
/**
|
||||
* A class to display transfer progress in the terminal, with a progress bar and other information.
|
||||
*/
|
||||
export default class FancyTransferCliProgressBar extends BaseTransferCliProgressBar {
|
||||
protected renderProgressLine(): string;
|
||||
protected renderFinishedLine(): string;
|
||||
protected renderPendingLine(): string;
|
||||
}
|
||||
125
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.js
generated
vendored
Normal file
125
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
import chalk from "chalk";
|
||||
import { PRETTY_MS_OPTIONS } from "../../format-transfer-status.js";
|
||||
import { renderDataLine } from "../../utils/data-line.js";
|
||||
import prettyMilliseconds from "pretty-ms";
|
||||
import sliceAnsi from "slice-ansi";
|
||||
import stripAnsi from "strip-ansi";
|
||||
import { DownloadStatus } from "../../../download-engine/download-file/progress-status-file.js";
|
||||
import BaseTransferCliProgressBar from "./base-transfer-cli-progress-bar.js";
|
||||
import { STATUS_ICONS } from "../../utils/progressBarIcons.js";
|
||||
/**
|
||||
* A class to display transfer progress in the terminal, with a progress bar and other information.
|
||||
*/
|
||||
export default class FancyTransferCliProgressBar extends BaseTransferCliProgressBar {
|
||||
renderProgressLine() {
|
||||
const { formattedSpeed, formatTransferred, formatTotal, formattedPercentage, percentage } = this.status;
|
||||
const formattedPercentageWithPadding = formattedPercentage.padEnd(6, " ");
|
||||
const progressBarText = ` ${formattedPercentageWithPadding} (${formatTransferred}/${formatTotal}) `;
|
||||
const dimEta = this.getETA(" | ", text => chalk.dim(text));
|
||||
return renderDataLine([{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => STATUS_ICONS.activeDownload
|
||||
}, {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
}, ...this.getNameAndCommentDataParts(), {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
}, {
|
||||
type: "progressBar",
|
||||
fullText: progressBarText,
|
||||
size: Math.max(progressBarText.length, `100.0% (1024.00MB/${formatTotal})`.length),
|
||||
flex: 4,
|
||||
addEndPadding: 4,
|
||||
maxSize: 40,
|
||||
formatter(_, size) {
|
||||
const leftPad = " ".repeat(Math.floor((size - progressBarText.length) / 2));
|
||||
return renderProgressBar({
|
||||
barText: leftPad + ` ${chalk.black.bgWhiteBright(formattedPercentageWithPadding)} ${chalk.gray(`(${formatTransferred}/${formatTotal})`)} `,
|
||||
backgroundText: leftPad + ` ${chalk.yellow.bgGray(formattedPercentageWithPadding)} ${chalk.white(`(${formatTransferred}/${formatTotal})`)} `,
|
||||
length: size,
|
||||
loadedPercentage: percentage / 100,
|
||||
barStyle: chalk.black.bgWhiteBright,
|
||||
backgroundStyle: chalk.bgGray
|
||||
});
|
||||
}
|
||||
}, {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
}, {
|
||||
type: "speed",
|
||||
fullText: formattedSpeed,
|
||||
size: Math.max("00.00kB/s".length, formattedSpeed.length)
|
||||
}, ...dimEta]);
|
||||
}
|
||||
renderFinishedLine() {
|
||||
const wasSuccessful = this.status.downloadStatus === DownloadStatus.Finished;
|
||||
const { endTime, startTime } = this.status;
|
||||
const downloadTime = (endTime || Date.now()) - startTime;
|
||||
const finishedText = wasSuccessful
|
||||
? `downloaded ${this.status.formatTransferred} in ${prettyMilliseconds(downloadTime, PRETTY_MS_OPTIONS)}`
|
||||
: `failed downloading after ${prettyMilliseconds(endTime - startTime, PRETTY_MS_OPTIONS)}`;
|
||||
return renderDataLine([{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => (wasSuccessful
|
||||
? STATUS_ICONS.done
|
||||
: STATUS_ICONS.failed)
|
||||
}, {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length,
|
||||
formatter: (text) => text
|
||||
}, ...this.getNameAndCommentDataParts(), {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length,
|
||||
formatter: (text) => text
|
||||
}, {
|
||||
type: "description",
|
||||
fullText: finishedText,
|
||||
size: finishedText.length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}]);
|
||||
}
|
||||
renderPendingLine() {
|
||||
const pendingText = `will download ${this.status.formatTotal}`;
|
||||
return renderDataLine([{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => STATUS_ICONS.pending
|
||||
}, {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length,
|
||||
formatter: (text) => text
|
||||
}, ...this.getNameAndCommentDataParts(), {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length,
|
||||
formatter: (text) => text
|
||||
}, {
|
||||
type: "description",
|
||||
fullText: pendingText,
|
||||
size: pendingText.length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}]);
|
||||
}
|
||||
}
|
||||
function renderProgressBar({ barText, backgroundText, length, loadedPercentage, barStyle, backgroundStyle }) {
|
||||
const barChars = Math.floor(length * loadedPercentage);
|
||||
const backgroundChars = length - barChars;
|
||||
const slicedBarText = sliceAnsi(barText, 0, barChars);
|
||||
const paddedBarText = slicedBarText + " ".repeat(barChars - stripAnsi(slicedBarText).length);
|
||||
const slicedBackgroundText = sliceAnsi(backgroundText, barChars, barChars + backgroundChars);
|
||||
const paddedBackgroundText = slicedBackgroundText + " ".repeat(backgroundChars - stripAnsi(slicedBackgroundText).length);
|
||||
return barStyle(paddedBarText) + backgroundStyle(paddedBackgroundText);
|
||||
}
|
||||
//# sourceMappingURL=fancy-transfer-cli-progress-bar.js.map
|
||||
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fancy-transfer-cli-progress-bar.js","sourceRoot":"","sources":["../../../../../src/download/transfer-visualize/transfer-cli/progress-bars/fancy-transfer-cli-progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAW,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAClE,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,cAAc,EAAC,MAAM,gEAAgE,CAAC;AAC9F,OAAO,0BAA0B,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,0BAA0B;IAC5D,kBAAkB;QACjC,MAAM,EAAC,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAEtG,MAAM,8BAA8B,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1E,MAAM,eAAe,GAAG,IAAI,8BAA8B,KAAK,iBAAiB,IAAI,WAAW,IAAI,CAAC;QAEpG,MAAM,MAAM,GAAa,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAErE,OAAO,cAAc,CAAC,CAAC;gBACnB,IAAI,EAAE,QAAQ;gBACd,Q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C;aACvC,CAAC,CAAC,CAAC;IACR,CAAC;CACJ;AAED,SAAS,iBAAiB,CAAC,EAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,EAOvG;IACG,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;IACvD,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,CAAC;IAE1C,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7F,MAAM,oBAAoB,GAAG,SAAS,CAAC,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC;IAC7F,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;IAEzH,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC;AAC3E,CAAC"}
|
||||
9
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
9
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { SummaryMultiProgressBar } from "../multiProgressBars/SummaryMultiProgressBar.js";
|
||||
import FancyTransferCliProgressBar from "./fancy-transfer-cli-progress-bar.js";
|
||||
export default class SummaryTransferCliProgressBar extends FancyTransferCliProgressBar {
|
||||
multiProgressBar: typeof SummaryMultiProgressBar;
|
||||
switchTransferToIcon(): string;
|
||||
getSpinnerText(): string;
|
||||
renderProgressLine(): string;
|
||||
protected renderDownloadSequence(): string;
|
||||
}
|
||||
103
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.js
generated
vendored
Normal file
103
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
import chalk from "chalk";
|
||||
import { SummaryMultiProgressBar } from "../multiProgressBars/SummaryMultiProgressBar.js";
|
||||
import { renderDataLine } from "../../utils/data-line.js";
|
||||
import FancyTransferCliProgressBar from "./fancy-transfer-cli-progress-bar.js";
|
||||
import { STATUS_ICONS } from "../../utils/progressBarIcons.js";
|
||||
import { DownloadFlags } from "../../../download-engine/download-file/progress-status-file.js";
|
||||
export default class SummaryTransferCliProgressBar extends FancyTransferCliProgressBar {
|
||||
multiProgressBar = SummaryMultiProgressBar;
|
||||
switchTransferToIcon() {
|
||||
switch (this.status.transferAction) {
|
||||
case "Downloading":
|
||||
return "↓";
|
||||
case "Copying":
|
||||
return "→";
|
||||
}
|
||||
return this.status.transferAction;
|
||||
}
|
||||
getSpinnerText() {
|
||||
return STATUS_ICONS.pending;
|
||||
}
|
||||
renderProgressLine() {
|
||||
if (this.status.downloadFlags.includes(DownloadFlags.DownloadSequence)) {
|
||||
return this.renderDownloadSequence();
|
||||
}
|
||||
const pendingText = `downloading ${this.status.formatTotal}`;
|
||||
return renderDataLine([{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => STATUS_ICONS.activeDownload
|
||||
}, {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
}, ...this.getNameAndCommentDataParts(), {
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
}, {
|
||||
type: "description",
|
||||
fullText: pendingText,
|
||||
size: pendingText.length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
}]);
|
||||
}
|
||||
renderDownloadSequence() {
|
||||
const { formatTransferredOfTotal, formattedSpeed, comment, formattedPercentage } = this.status;
|
||||
const progressBar = `(${formatTransferredOfTotal})`;
|
||||
return renderDataLine([
|
||||
{
|
||||
type: "status",
|
||||
fullText: "",
|
||||
size: 1,
|
||||
formatter: () => chalk.cyan(this.switchTransferToIcon())
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "percentage",
|
||||
fullText: formattedPercentage,
|
||||
size: 6,
|
||||
formatter: (text) => text
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " ",
|
||||
size: " ".length
|
||||
},
|
||||
{
|
||||
type: "progressBar",
|
||||
fullText: progressBar,
|
||||
size: progressBar.length
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " | ",
|
||||
size: " | ".length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
},
|
||||
{
|
||||
type: "nameComment",
|
||||
fullText: comment || "",
|
||||
size: (comment || "").length
|
||||
},
|
||||
{
|
||||
type: "spacer",
|
||||
fullText: " | ",
|
||||
size: " | ".length,
|
||||
formatter: (text) => chalk.dim(text)
|
||||
},
|
||||
{
|
||||
type: "speed",
|
||||
fullText: formattedSpeed,
|
||||
size: formattedSpeed.length
|
||||
},
|
||||
...this.getETA(" | ")
|
||||
]);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=summary-transfer-cli-progress-bar.js.map
|
||||
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"summary-transfer-cli-progress-bar.js","sourceRoot":"","sources":["../../../../../src/download/transfer-visualize/transfer-cli/progress-bars/summary-transfer-cli-progress-bar.ts"],"names":[],"mappings":"AAAA,O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E,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACvC;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,QAAQ,EAAE,OAAO,IAAI,EAAE;gBACvB,IAAI,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM;aAC/B;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,KAAK,CAAC,MAAM;gBAClB,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACvC;YACD;gBACI,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,cAAc;gBACxB,IAAI,EAAE,cAAc,CAAC,MAAM;aAC9B;YACD,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;SACxB,CAAC,CAAC;IACP,CAAC;CACJ"}
|
||||
3
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.d.ts
generated
vendored
Normal file
3
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import BaseTransferCliProgressBar, { BaseCliOptions } from "./base-transfer-cli-progress-bar.js";
|
||||
export type AvailableCLIProgressStyle = "basic" | "fancy" | "ci" | "summary" | "auto";
|
||||
export default function switchCliProgressStyle(cliStyle: AvailableCLIProgressStyle, options: BaseCliOptions): BaseTransferCliProgressBar;
|
||||
27
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.js
generated
vendored
Normal file
27
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import BaseTransferCliProgressBar from "./base-transfer-cli-progress-bar.js";
|
||||
import FancyTransferCliProgressBar from "./fancy-transfer-cli-progress-bar.js";
|
||||
import SummaryTransferCliProgressBar from "./summary-transfer-cli-progress-bar.js";
|
||||
import ci from "ci-info";
|
||||
import CiTransferCliProgressBar from "./ci-transfer-cli-progress-bar.js";
|
||||
export default function switchCliProgressStyle(cliStyle, options) {
|
||||
switch (cliStyle) {
|
||||
case "basic":
|
||||
return new BaseTransferCliProgressBar(options);
|
||||
case "fancy":
|
||||
return new FancyTransferCliProgressBar(options);
|
||||
case "summary":
|
||||
return new SummaryTransferCliProgressBar(options);
|
||||
case "ci":
|
||||
return new CiTransferCliProgressBar(options);
|
||||
case "auto":
|
||||
if (ci.isCI || process.env.IPULL_USE_CI_STYLE) {
|
||||
return switchCliProgressStyle("ci", options);
|
||||
}
|
||||
else {
|
||||
return switchCliProgressStyle("fancy", options);
|
||||
}
|
||||
}
|
||||
void cliStyle;
|
||||
throw new Error(`Unknown CLI progress style: ${cliStyle}`);
|
||||
}
|
||||
//# sourceMappingURL=switch-cli-progress-style.js.map
|
||||
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.js.map
generated
vendored
Normal file
1
node_modules/ipull/dist/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"switch-cli-progress-style.js","sourceRoot":"","sources":["../../../../../src/download/transfer-visualize/transfer-cli/progress-bars/switch-cli-progress-style.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA4C,MAAM,qCAAqC,CAAC;AAC/F,OAAO,2BAA2B,MAAM,sCAAsC,CAAC;AAC/E,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,wBAAwB,MAAM,mCAAmC,CAAC;AAIzE,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAmC,EAAE,OAAuB;IACvG,QAAQ,QAAQ,EAAE,CAAC;QACf,KAAK,OAAO;YACR,OAAO,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;QAEnD,KAAK,OAAO;YACR,OAAO,IAAI,2BAA2B,CAAC,OAAO,CAAC,CAAC;QAEpD,KAAK,SAAS;YACV,OAAO,IAAI,6BAA6B,CAAC,OAAO,CAAC,CAAC;QAEtD,KAAK,IAAI;YACL,OAAO,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAEjD,KAAK,MAAM;YACP,IAAI,EAAE,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;gBAC5C,OAAO,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACJ,OAAO,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACpD,CAAC;IACT,CAAC;IAED,KAAM,QAAyB,CAAC;IAChC,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
||||
Reference in New Issue
Block a user