Skip to content

Commit

Permalink
Merge branch 'v2' of github.com:parcel-bundler/parcel into jlane2/wri…
Browse files Browse the repository at this point in the history
…te-request-graph-to-disk-background
  • Loading branch information
JakeLane committed Dec 8, 2023
2 parents 0cfdedb + ecfeb40 commit d1e726d
Show file tree
Hide file tree
Showing 46 changed files with 2,085 additions and 1,261 deletions.
414 changes: 164 additions & 250 deletions Cargo.lock

Large diffs are not rendered by default.

377 changes: 377 additions & 0 deletions flow-libs/cli-progress.js.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,377 @@
/**
* Flowtype definitions for index
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.21.0
* @flow
*/
declare module 'cli-progress' {
declare export interface Params {
progress: number;
eta: number;
startTime: number;
stopTime: number | null;
total: number;
value: number;
maxWidth: number;
}
declare export interface Options {
/**
* progress bar output format.
* The progressbar can be customized by using the following build-in placeholders. They can be combined in any order.
* {bar} - the progress bar, customizable by the options barsize, barCompleteString and barIncompleteString
* {percentage} - the current progress in percent (0-100)
* {total} - the end value
* {value} - the current value set by last update() call
* {eta} - expected time of accomplishment in seconds
* {duration} - elapsed time in seconds
* {eta_formatted} - expected time of accomplishment formatted into appropriate units
* {duration_formatted} - elapsed time formatted into appropriate units
*
* Example:
* progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}
* is rendered as
* progress [========================================] 100% | ETA: 0s | 200/200
*/
format?: string | GenericFormatter | void;

/**
* a custom bar formatter function which renders the bar-element (default: format-bar.js)
*/
formatBar?: BarFormatter | void;

/**
* a custom timer formatter function which renders the formatted time elements like eta_formatted and duration-formatted (default: format-time.js)
*/
formatTime?: TimeFormatter | void;

/**
* a custom value formatter function which renders all other values (default: format-value.js)
*/
formatValue?: ValueFormatter | void;

/**
* the maximum update rate (default: 10)
*/
fps?: number | void;

/**
* output stream to use (default: process.stderr)
*/
stream?: WritableStream | void;

/**
* automatically call stop() when the value reaches the total (default: false)
*/
stopOnComplete?: boolean | void;

/**
* clear the progress bar on complete / stop() call (default: false)
*/
clearOnComplete?: boolean | void;

/**
* the length of the progress bar in chars (default: 40)
*/
barsize?: number | void;

/**
* position of the progress bar - 'left' (default), 'right' or 'center
*/
align?: 'left' | 'right' | 'center' | void;

/**
* character to use as "complete" indicator in the bar (default: "=")
*/
barCompleteString?: string | void;

/**
* character to use as "incomplete" indicator in the bar (default: "-")
*/
barIncompleteString?: string | void;

/**
* character to use as "complete" indicator in the bar (default: "=")
*/
barCompleteChar?: string | void;

/**
* character to use as "incomplete" indicator in the bar (default: "-")
*/
barIncompleteChar?: string | void;

/**
* hide the cursor during progress operation; restored on complete (default: false)
* - pass `null` to keep terminal settings
*/
hideCursor?: boolean | null | void;

/**
* glue sequence (control chars) between bar elements (default: '')
*/
barGlue?: string | void;

/**
* number of updates with which to calculate the eta; higher numbers give a more stable eta (default: 10)
*/
etaBuffer?: number | void;

/**
* trigger an eta calculation update during asynchronous rendering trigger using the current value
* - should only be used for long running processes in conjunction with lof `fps` values and large `etaBuffer`
* @default false
*/
etaAsynchronousUpdate?: boolean | void;

/**
* progress calculation relative to start value ? default start at 0 (default: false)
*/
progressCalculationRelative?: boolean | void;

/**
* disable line wrapping (default: false) - pass null to keep terminal settings; pass true to trim the output to terminal width
*/
linewrap?: boolean | null | void;

/**
* trigger redraw during update() in case threshold time x2 is exceeded (default: true) - limited to single bar usage
*/
synchronousUpdate?: boolean | void;

/**
* enable scheduled output to notty streams - e.g. redirect to files (default: false)
*/
noTTYOutput?: boolean | void;

/**
* set the output schedule/interval for notty output in ms (default: 2000ms)
*/
notTTYSchedule?: number | void;

/**
* display progress bars with 'total' of zero(0) as empty, not full (default: false)
*/
emptyOnZero?: boolean | void;

/**
* trigger redraw on every frame even if progress remains the same; can be useful if progress bar gets overwritten by other concurrent writes to the terminal (default: false)
*/
forceRedraw?: boolean | void;

/**
* add padding chars to formatted time and percentage to force fixed width (default: false)
*/
autopadding?: boolean | void;

/**
* the character sequence used for autopadding (default: " ")
*/
autopaddingChar?: string | void;

/**
* stop bar on SIGINT/SIGTERM to restore cursor settings (default: true)
*/
gracefulExit?: boolean | void;
}
declare export interface Preset {
barCompleteChar: string;
barIncompleteChar: string;

/**
* Example: 'progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}'
*
* {bar} - the progress bar, customizable by the options barsize, barCompleteString and barIncompleteString
*
* {percentage} - the current progress in percent (0-100)
*
* {total} - the end value
*
* {value} - the current value set by last update() call
*
* {eta} - expected time of accomplishment in seconds (limited to 115days, otherwise INF is displayed)
*
* {duration} - elapsed time in seconds
*
* {eta_formatted} - expected time of accomplishment formatted into appropriate units
*
* {duration_formatted} - elapsed time formatted into appropriate units
*/
format: string;
}
declare export class GenericBar mixins events$EventEmitter {
/**
* Initialize a new Progress bar. An instance can be used multiple times! it's not required to re-create it!
*/
constructor(opt: Options, preset?: Preset): this;

/**
* Internal render function
*/
render(forceRendering?: boolean): void;

/**
* Starts the progress bar and set the total and initial value
*/
start(
total: number,
startValue: number,
payload?: {[key: string]: any},
): void;

/**
* Stops the progress bar and go to next line
*/
stop(): void;

/**
* Sets the current progress value and optionally the payload with values of custom tokens as a second parameter
*/
update(current: number, payload?: {[key: string]: any}): void;
update(payload: {[key: string]: any}): void;

/**
* Calculate the actual progress value
*/
getProgress(): number;

/**
* Increases the current progress value by a specified amount (default +1). Update payload optionally
*/
increment(step?: number, payload?: {[key: string]: any}): void;
increment(payload: {[key: string]: any}): void;

/**
* Get the total (limit) value
*/
getTotal(): number;

/**
* Sets the total progress value while progressbar is active. Especially useful handling dynamic tasks.
*/
setTotal(total: number): void;

/**
* Force eta calculation update (long running processes) without altering the progress values.
*/
updateETA(): void;
}
declare export class SingleBar mixins GenericBar {
/**
* Initialize a new Progress bar. An instance can be used multiple times! it's not required to re-create it!
*/
constructor(opt: Options, preset?: Preset): this;

/**
* Internal render function
*/
render(): void;

/**
* Sets the current progress value and optionally the payload with values of custom tokens as a second parameter
*/
update(current: number, payload?: {[key: string]: any}): void;
update(payload: {[key: string]: any}): void;

/**
* Starts the progress bar and set the total and initial value
*/
start(
total: number,
startValue: number,
payload?: {[key: string]: any},
): void;

/**
* Stops the progress bar and go to next line
*/
stop(): void;
}
declare export class MultiBar mixins events$EventEmitter {
constructor(opt: Options, preset?: Preset): this;

/**
* add a new bar to the stack
*/
create(
total: number,
startValue: number,
payload?: any,
barOptions?: Options,
): SingleBar;

/**
* remove a bar from the stack
*/
remove(bar: SingleBar): boolean;

/**
* internal update routine
*/
update(): void;
stop(): void;

/**
* log output above the progress bars; string must end with newline character!
*/
log(data: string): void;
}
declare export var Presets: {
/**
* Styles as of cli-progress v1.3.0
*/
legacy: Preset,

/**
* Unicode Rectangles
*/
rect: Preset,

/**
* Unicode background shades are used for the bar
*/
shades_classic: Preset,

/**
* Unicode background shades with grey bar
*/
shades_grey: Preset,
...
};
declare export interface GenericFormatter {
(options: Options, params: Params, payload: any): string;
}
declare export interface TimeFormatter {
(t: number, options: Options, roundToMultipleOf: number): string;
}
declare export interface ValueFormatter {
(v: number, options: Options, type: ValueType): string;
}
declare export interface BarFormatter {
(progress: number, options: Options): string;
}
declare export type ValueType =
| 'percentage'
| 'total'
| 'value'
| 'eta'
| 'duration';
declare var defaultFormatter: GenericFormatter;
declare var formatBar: BarFormatter;
declare var formatValue: ValueFormatter;
declare var formatTime: TimeFormatter;
declare export var Format: {
Formatter: typeof defaultFormatter,
BarFormat: typeof formatBar,
ValueFormat: typeof formatValue,
TimeFormat: typeof formatTime,
...
};
declare export class Bar mixins SingleBar {}
declare export interface cliProgress {
Bar: typeof Bar;
SingleBar: typeof SingleBar;
MultiBar: typeof MultiBar;
Presets: typeof Presets;
Format: typeof Format;
}
declare export default cliProgress;
}
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,12 @@
"type": "opencollective",
"url": "https://opencollective.com/parcel"
},
"packageManager": "yarn@1.22.19"
"packageManager": "yarn@1.22.19",
"_": "See issue #9405 for the Vue problem",
"__": "The watcher complains about non-existing dirs in the integration tests on >=2.3.0",
"resolutions": {
"@parcel/watcher": "~2.2.0",
"@vue/compiler-sfc": "~3.2.47",
"vue": "~3.2.47"
}
}

0 comments on commit d1e726d

Please sign in to comment.