@moku-labs/web 1.16.1 → 1.17.0
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/index.cjs +28 -8
- package/dist/index.d.cts +13 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.mjs +28 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8039,17 +8039,22 @@ function createApi$1(ctx) {
|
|
|
8039
8039
|
* @example
|
|
8040
8040
|
* await api.update(["src/islands/board.ts"]);
|
|
8041
8041
|
*/
|
|
8042
|
-
update(changes, options = {}) {
|
|
8042
|
+
async update(changes, options = {}) {
|
|
8043
8043
|
const overrides = devBuildOverrides({
|
|
8044
8044
|
og: options.og ?? false,
|
|
8045
8045
|
sitemap: options.sitemap ?? false,
|
|
8046
8046
|
feeds: options.feeds ?? false
|
|
8047
8047
|
});
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8048
|
+
ctx.state.render.setDriven(true);
|
|
8049
|
+
try {
|
|
8050
|
+
return await ctx.require(buildPlugin).run({
|
|
8051
|
+
skipClean: true,
|
|
8052
|
+
overrides,
|
|
8053
|
+
changed: changes
|
|
8054
|
+
});
|
|
8055
|
+
} finally {
|
|
8056
|
+
ctx.state.render.setDriven(false);
|
|
8057
|
+
}
|
|
8053
8058
|
},
|
|
8054
8059
|
/**
|
|
8055
8060
|
* Dev loop: build once, serve `dist/` in-process (live-reload injected), watch
|
|
@@ -8342,6 +8347,7 @@ function createPanelRenderer(options = {}) {
|
|
|
8342
8347
|
let idle = false;
|
|
8343
8348
|
let idleStartedAt = 0;
|
|
8344
8349
|
let serveMode = false;
|
|
8350
|
+
let driven = false;
|
|
8345
8351
|
let ticker;
|
|
8346
8352
|
/**
|
|
8347
8353
|
* Render one phase-tree row: a spinning cyan glyph + dim name while running, or a green
|
|
@@ -8503,7 +8509,7 @@ function createPanelRenderer(options = {}) {
|
|
|
8503
8509
|
* render.phase({ phase: "pages", status: "done", durationMs: 12 });
|
|
8504
8510
|
*/
|
|
8505
8511
|
phase(phase) {
|
|
8506
|
-
if (rebuilding) return;
|
|
8512
|
+
if (rebuilding || driven) return;
|
|
8507
8513
|
if (!color) {
|
|
8508
8514
|
if (phase.status === "done") write(` ${palette.green("✓")} ${phase.phase}${durationSuffix(palette, phase.durationMs)}`);
|
|
8509
8515
|
return;
|
|
@@ -8537,7 +8543,7 @@ function createPanelRenderer(options = {}) {
|
|
|
8537
8543
|
* render.built({ outDir: "dist", pageCount: 12, durationMs: 840 });
|
|
8538
8544
|
*/
|
|
8539
8545
|
built(summary) {
|
|
8540
|
-
if (rebuilding) return;
|
|
8546
|
+
if (rebuilding || driven) return;
|
|
8541
8547
|
if (color && phaseOpen) {
|
|
8542
8548
|
let frame = (0, _moku_labs_common_cli.cursorUp)(phaseDrawn);
|
|
8543
8549
|
for (const row of phaseRows) frame += `${_moku_labs_common_cli.CLEAR_LINE}${renderPhaseRow(row)}\n`;
|
|
@@ -8711,6 +8717,20 @@ function createPanelRenderer(options = {}) {
|
|
|
8711
8717
|
if (detail !== void 0) for (const line of detail.split("\n")) write(` ${palette.dim(line)}`);
|
|
8712
8718
|
},
|
|
8713
8719
|
/**
|
|
8720
|
+
* Mark the build TUI as externally driven: when `on`, the per-phase build tree and the BUILD
|
|
8721
|
+
* summary are suppressed so an external dev driver (e.g. the worker's `dev({ onChange })` loop,
|
|
8722
|
+
* which calls `update()` and renders its own concise rebuild line) is the sole source of rebuild
|
|
8723
|
+
* output. Off by default; a standalone `build()` / `serve()` renders the full TUI as before.
|
|
8724
|
+
*
|
|
8725
|
+
* @param on - Whether an external driver owns the dev TUI.
|
|
8726
|
+
* @example
|
|
8727
|
+
* render.setDriven(true); // before an externally-driven update()
|
|
8728
|
+
* render.setDriven(false); // after it settles
|
|
8729
|
+
*/
|
|
8730
|
+
setDriven(on) {
|
|
8731
|
+
driven = on;
|
|
8732
|
+
},
|
|
8733
|
+
/**
|
|
8714
8734
|
* Stop every animation and release the interval timer (serve()'s teardown calls this).
|
|
8715
8735
|
*
|
|
8716
8736
|
* @example
|
package/dist/index.d.cts
CHANGED
|
@@ -2219,6 +2219,19 @@ type CliRenderer = {
|
|
|
2219
2219
|
* render.check(false, "CLOUDFLARE_API_TOKEN is set", "Create one at …");
|
|
2220
2220
|
*/
|
|
2221
2221
|
check(ok: boolean, label: string, detail?: string): void;
|
|
2222
|
+
/**
|
|
2223
|
+
* Mark the build TUI as externally driven. When `on`, the per-phase build tree and the BUILD
|
|
2224
|
+
* summary block are suppressed, so an external dev driver (e.g. the worker's `dev({ onChange })`
|
|
2225
|
+
* loop, which calls `update()` and renders its own concise rebuild line) is the sole source of
|
|
2226
|
+
* rebuild output — no duplicate full TUI on each incremental rebuild. Off by default; a standalone
|
|
2227
|
+
* `build()` / `serve()` keeps the full TUI.
|
|
2228
|
+
*
|
|
2229
|
+
* @param on - Whether an external driver owns the dev TUI.
|
|
2230
|
+
* @returns Nothing.
|
|
2231
|
+
* @example
|
|
2232
|
+
* render.setDriven(true);
|
|
2233
|
+
*/
|
|
2234
|
+
setDriven(on: boolean): void;
|
|
2222
2235
|
/**
|
|
2223
2236
|
* Stop any running animation (the live `serve()` idle pulse, a phase/rebuild spinner)
|
|
2224
2237
|
* and release the renderer's interval timer. Called by `serve()`'s SIGINT/SIGTERM
|
package/dist/index.d.mts
CHANGED
|
@@ -2217,6 +2217,19 @@ type CliRenderer = {
|
|
|
2217
2217
|
* render.check(false, "CLOUDFLARE_API_TOKEN is set", "Create one at …");
|
|
2218
2218
|
*/
|
|
2219
2219
|
check(ok: boolean, label: string, detail?: string): void;
|
|
2220
|
+
/**
|
|
2221
|
+
* Mark the build TUI as externally driven. When `on`, the per-phase build tree and the BUILD
|
|
2222
|
+
* summary block are suppressed, so an external dev driver (e.g. the worker's `dev({ onChange })`
|
|
2223
|
+
* loop, which calls `update()` and renders its own concise rebuild line) is the sole source of
|
|
2224
|
+
* rebuild output — no duplicate full TUI on each incremental rebuild. Off by default; a standalone
|
|
2225
|
+
* `build()` / `serve()` keeps the full TUI.
|
|
2226
|
+
*
|
|
2227
|
+
* @param on - Whether an external driver owns the dev TUI.
|
|
2228
|
+
* @returns Nothing.
|
|
2229
|
+
* @example
|
|
2230
|
+
* render.setDriven(true);
|
|
2231
|
+
*/
|
|
2232
|
+
setDriven(on: boolean): void;
|
|
2220
2233
|
/**
|
|
2221
2234
|
* Stop any running animation (the live `serve()` idle pulse, a phase/rebuild spinner)
|
|
2222
2235
|
* and release the renderer's interval timer. Called by `serve()`'s SIGINT/SIGTERM
|
package/dist/index.mjs
CHANGED
|
@@ -8026,17 +8026,22 @@ function createApi$1(ctx) {
|
|
|
8026
8026
|
* @example
|
|
8027
8027
|
* await api.update(["src/islands/board.ts"]);
|
|
8028
8028
|
*/
|
|
8029
|
-
update(changes, options = {}) {
|
|
8029
|
+
async update(changes, options = {}) {
|
|
8030
8030
|
const overrides = devBuildOverrides({
|
|
8031
8031
|
og: options.og ?? false,
|
|
8032
8032
|
sitemap: options.sitemap ?? false,
|
|
8033
8033
|
feeds: options.feeds ?? false
|
|
8034
8034
|
});
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8035
|
+
ctx.state.render.setDriven(true);
|
|
8036
|
+
try {
|
|
8037
|
+
return await ctx.require(buildPlugin).run({
|
|
8038
|
+
skipClean: true,
|
|
8039
|
+
overrides,
|
|
8040
|
+
changed: changes
|
|
8041
|
+
});
|
|
8042
|
+
} finally {
|
|
8043
|
+
ctx.state.render.setDriven(false);
|
|
8044
|
+
}
|
|
8040
8045
|
},
|
|
8041
8046
|
/**
|
|
8042
8047
|
* Dev loop: build once, serve `dist/` in-process (live-reload injected), watch
|
|
@@ -8329,6 +8334,7 @@ function createPanelRenderer(options = {}) {
|
|
|
8329
8334
|
let idle = false;
|
|
8330
8335
|
let idleStartedAt = 0;
|
|
8331
8336
|
let serveMode = false;
|
|
8337
|
+
let driven = false;
|
|
8332
8338
|
let ticker;
|
|
8333
8339
|
/**
|
|
8334
8340
|
* Render one phase-tree row: a spinning cyan glyph + dim name while running, or a green
|
|
@@ -8490,7 +8496,7 @@ function createPanelRenderer(options = {}) {
|
|
|
8490
8496
|
* render.phase({ phase: "pages", status: "done", durationMs: 12 });
|
|
8491
8497
|
*/
|
|
8492
8498
|
phase(phase) {
|
|
8493
|
-
if (rebuilding) return;
|
|
8499
|
+
if (rebuilding || driven) return;
|
|
8494
8500
|
if (!color) {
|
|
8495
8501
|
if (phase.status === "done") write(` ${palette.green("✓")} ${phase.phase}${durationSuffix(palette, phase.durationMs)}`);
|
|
8496
8502
|
return;
|
|
@@ -8524,7 +8530,7 @@ function createPanelRenderer(options = {}) {
|
|
|
8524
8530
|
* render.built({ outDir: "dist", pageCount: 12, durationMs: 840 });
|
|
8525
8531
|
*/
|
|
8526
8532
|
built(summary) {
|
|
8527
|
-
if (rebuilding) return;
|
|
8533
|
+
if (rebuilding || driven) return;
|
|
8528
8534
|
if (color && phaseOpen) {
|
|
8529
8535
|
let frame = cursorUp(phaseDrawn);
|
|
8530
8536
|
for (const row of phaseRows) frame += `${CLEAR_LINE}${renderPhaseRow(row)}\n`;
|
|
@@ -8698,6 +8704,20 @@ function createPanelRenderer(options = {}) {
|
|
|
8698
8704
|
if (detail !== void 0) for (const line of detail.split("\n")) write(` ${palette.dim(line)}`);
|
|
8699
8705
|
},
|
|
8700
8706
|
/**
|
|
8707
|
+
* Mark the build TUI as externally driven: when `on`, the per-phase build tree and the BUILD
|
|
8708
|
+
* summary are suppressed so an external dev driver (e.g. the worker's `dev({ onChange })` loop,
|
|
8709
|
+
* which calls `update()` and renders its own concise rebuild line) is the sole source of rebuild
|
|
8710
|
+
* output. Off by default; a standalone `build()` / `serve()` renders the full TUI as before.
|
|
8711
|
+
*
|
|
8712
|
+
* @param on - Whether an external driver owns the dev TUI.
|
|
8713
|
+
* @example
|
|
8714
|
+
* render.setDriven(true); // before an externally-driven update()
|
|
8715
|
+
* render.setDriven(false); // after it settles
|
|
8716
|
+
*/
|
|
8717
|
+
setDriven(on) {
|
|
8718
|
+
driven = on;
|
|
8719
|
+
},
|
|
8720
|
+
/**
|
|
8701
8721
|
* Stop every animation and release the interval timer (serve()'s teardown calls this).
|
|
8702
8722
|
*
|
|
8703
8723
|
* @example
|
package/package.json
CHANGED