@blinkk/root 3.1.2 → 3.1.4

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.
@@ -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
@@ -8,7 +8,7 @@ import {
8
8
  dev,
9
9
  preview,
10
10
  start
11
- } from "./chunk-GK3TDYUY.js";
11
+ } from "./chunk-WGQNQPWG.js";
12
12
  import "./chunk-YU22SAIG.js";
13
13
  import "./chunk-I3RCAIW7.js";
14
14
  import "./chunk-M3E4RKS7.js";
package/dist/functions.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPreviewServer,
3
3
  createProdServer
4
- } from "./chunk-GK3TDYUY.js";
4
+ } from "./chunk-WGQNQPWG.js";
5
5
  import "./chunk-YU22SAIG.js";
6
6
  import "./chunk-I3RCAIW7.js";
7
7
  import "./chunk-M3E4RKS7.js";
package/dist/jsx.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderJsxToString
3
- } from "./chunk-X2C2MEJ2.js";
3
+ } from "./chunk-OQRFLH2X.js";
4
4
  import {
5
5
  Fragment,
6
6
  createContext,
package/dist/render.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-3PWR4F2R.js";
16
16
  import {
17
17
  renderJsxToString
18
- } from "./chunk-X2C2MEJ2.js";
18
+ } from "./chunk-OQRFLH2X.js";
19
19
  import "./chunk-3Z5TNZEP.js";
20
20
  import {
21
21
  getSecurityConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkk/root",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "author": "s@blinkk.com",
5
5
  "license": "MIT",
6
6
  "engines": {