@blinkk/root 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X2C2MEJ2.js → chunk-HPRRG4EA.js} +2 -1
- package/dist/chunk-HPRRG4EA.js.map +7 -0
- package/dist/{chunk-GK3TDYUY.js → chunk-WGQNQPWG.js} +85 -5
- package/dist/chunk-WGQNQPWG.js.map +7 -0
- package/dist/cli/build-progress.d.ts +35 -0
- package/dist/cli.js +1 -1
- package/dist/functions.js +1 -1
- package/dist/jsx.js +1 -1
- package/dist/render.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GK3TDYUY.js.map +0 -7
- package/dist/chunk-X2C2MEJ2.js.map +0 -7
|
@@ -39,6 +39,14 @@ export interface BuildProgressOptions {
|
|
|
39
39
|
intervalMs?: number;
|
|
40
40
|
/** Number of largest files to list in the summary. Defaults to 5. */
|
|
41
41
|
summaryTopN?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Streams to intercept while the TTY progress bar is active. Anything
|
|
44
|
+
* written to these streams (e.g. `console.log` calls from user code during
|
|
45
|
+
* page renders) clears the bar first so the log prints on its own line,
|
|
46
|
+
* then the bar is redrawn below. Defaults to
|
|
47
|
+
* `[process.stdout, process.stderr]` when `stream` is not overridden.
|
|
48
|
+
*/
|
|
49
|
+
interceptStreams?: WritableStreamLike[];
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* Reports progress for build output files.
|
|
@@ -46,6 +54,12 @@ export interface BuildProgressOptions {
|
|
|
46
54
|
* Tracks completed files and bytes written, and renders progress according
|
|
47
55
|
* to the configured `BuildLogMode`. Designed to keep CI logs readable: a
|
|
48
56
|
* 10,000-page build emits ~10 progress lines instead of 10,000.
|
|
57
|
+
*
|
|
58
|
+
* While the interactive (TTY) progress bar is active, writes to
|
|
59
|
+
* `interceptStreams` from other sources (e.g. `console.log` from user code
|
|
60
|
+
* rendering pages, including output forwarded from worker threads) are
|
|
61
|
+
* wrapped so log lines appear above the bar instead of interleaving with it.
|
|
62
|
+
* Call `finish()` or `abort()` to restore the streams.
|
|
49
63
|
*/
|
|
50
64
|
export declare class BuildProgress {
|
|
51
65
|
private readonly total;
|
|
@@ -65,6 +79,13 @@ export declare class BuildProgress {
|
|
|
65
79
|
private lastMilestone;
|
|
66
80
|
private ttyLineActive;
|
|
67
81
|
private done;
|
|
82
|
+
/** Writes to `this.stream`, bypassing the log interceptor. */
|
|
83
|
+
private streamWrite;
|
|
84
|
+
/** Restores the original `write` of each intercepted stream. */
|
|
85
|
+
private restoreWrites;
|
|
86
|
+
/** True when intercepted output ended without a trailing newline. */
|
|
87
|
+
private foreignLineOpen;
|
|
88
|
+
private redrawTimer;
|
|
68
89
|
constructor(options: BuildProgressOptions);
|
|
69
90
|
/** Records a completed output file. */
|
|
70
91
|
add(outputFile: string, sizeBytes: number): void;
|
|
@@ -78,5 +99,19 @@ export declare class BuildProgress {
|
|
|
78
99
|
private eta;
|
|
79
100
|
private clearTtyLine;
|
|
80
101
|
private println;
|
|
102
|
+
/**
|
|
103
|
+
* Patches `write` on each stream so foreign output (user logs) clears the
|
|
104
|
+
* progress bar line before printing and schedules a redraw after. The
|
|
105
|
+
* progress bar's own writes go through `streamWrite` and bypass the patch.
|
|
106
|
+
*/
|
|
107
|
+
private interceptLogs;
|
|
108
|
+
/** Redraws the progress bar shortly after foreign output interrupts it. */
|
|
109
|
+
private scheduleRedraw;
|
|
110
|
+
/**
|
|
111
|
+
* If intercepted output left a partial (unterminated) line, terminate it
|
|
112
|
+
* so the next progress bar render doesn't overwrite it with `\r`.
|
|
113
|
+
*/
|
|
114
|
+
private closeForeignLine;
|
|
115
|
+
private restoreLogs;
|
|
81
116
|
}
|
|
82
117
|
export {};
|
package/dist/cli.js
CHANGED
package/dist/functions.js
CHANGED
package/dist/jsx.js
CHANGED
package/dist/render.js
CHANGED