@marver-design/marver 0.25.0 → 0.25.1
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/CHANGELOG.md +13 -0
- package/dist/{anchor-check-BE5VVN6Q.mjs → anchor-check-DGZnYviN.mjs} +1 -1
- package/dist/{bake-D8byeRzB.mjs → bake-BpxMZfij.mjs} +45 -6
- package/dist/{build-BHoWLvSj.mjs → build-DKaGhoVN.mjs} +3 -3
- package/dist/cli.mjs +2 -2
- package/dist/{dev-DJdgow47.mjs → dev-Diqx1Rt8.mjs} +4 -4
- package/dist/{plugin-CTyhjwoJ.mjs → plugin-dTF5reck.mjs} +10 -9
- package/dist/{poster-D0cbV7hi.mjs → poster-D-zjYpgk.mjs} +1 -1
- package/dist/{publish-bakes--l8ot2eQ.mjs → publish-bakes-C_9VZ-Mq.mjs} +2 -2
- package/dist/{shot-CckrGW-J.mjs → shot-CUlmkqFX.mjs} +2 -2
- package/package.json +1 -1
- package/src/client/shell/canvas/sleep.ts +19 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@marver-design/marver`. Format follows [Keep a Changelog](https://keepachangelog.com); versions follow semver.
|
|
4
4
|
|
|
5
|
+
## 0.25.1 - 2026-10-17
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Comments send at once again on canvases full of glass and animation** ([#23](https://github.com/TNEP4/marver/issues/23)).
|
|
10
|
+
While you work, `marver dev` prepares a still copy of each frame with blur effects so resting
|
|
11
|
+
frames cost nothing. A frame with a looping animation (a spinner, a pulsing dot) never held
|
|
12
|
+
still, so its copy failed every time, was asked for again on every rest, and each ask kept a
|
|
13
|
+
connection open. The browser only opens six per site, so comment sends and board saves waited
|
|
14
|
+
behind them, sometimes for minutes. Now a frame with a looping animation simply rests paused
|
|
15
|
+
with no copy, a copy that cannot be made is not tried again until the frame changes, and the
|
|
16
|
+
canvas never waits more than 2.5 s for one.
|
|
17
|
+
|
|
5
18
|
## 0.25.0 - 2026-10-15
|
|
6
19
|
|
|
7
20
|
### Added
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MOUNTED, frameUrl, manifestFrame, planShot, withBrowser } from "./shot-
|
|
1
|
+
import { MOUNTED, frameUrl, manifestFrame, planShot, withBrowser } from "./shot-CUlmkqFX.mjs";
|
|
2
2
|
//#region src/server/anchor-check.ts
|
|
3
3
|
/**
|
|
4
4
|
* The anchor check (spec 26, Part 6): `comments new --on|--at`, `comments move` and a Live Jam re-pin
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-
|
|
1
|
+
import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-CUlmkqFX.mjs";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { join, sep } from "node:path";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
@@ -58,6 +58,8 @@ const DSF = 2;
|
|
|
58
58
|
* (29 px > 8 of 5.18 M, none > 32) at a quarter of the memory; 0.5x fails on 30 px pills. */
|
|
59
59
|
const TEXTURE_DSF = 1;
|
|
60
60
|
const DEADLINE_MS = 45e3;
|
|
61
|
+
/** The refusal for a frame with a looping animation: it rests paused, never compiled. */
|
|
62
|
+
const LOOPING = "a looping animation - the frame rests paused, uncompiled";
|
|
61
63
|
/** The largest frame an ask may name, in CSS px: the shot pipeline's bitmap budget at DPR 2. */
|
|
62
64
|
const ASK_MAX = {
|
|
63
65
|
side: Math.floor(SURFACE / DSF),
|
|
@@ -330,6 +332,10 @@ async function bakeIn(b, opts) {
|
|
|
330
332
|
error: `the frame did not settle (${unsettled} image(s) or chart(s) still loading)`
|
|
331
333
|
};
|
|
332
334
|
await ev(`Promise.all(Array.from(document.querySelectorAll('image')).map((el) => { const href = el.getAttribute('href') || el.getAttribute('xlink:href'); if (!href) return 1; const im = new Image(); im.src = new URL(href, location.href).href; return im.decode().catch(() => 1) })).then(() => true)`, true);
|
|
335
|
+
if (await ev(`document.getAnimations().some((a) => { const t = a.effect && a.effect.getComputedTiming(); return !!t && t.iterations === Infinity && a.playState === 'running' })`)) return {
|
|
336
|
+
ok: false,
|
|
337
|
+
error: LOOPING
|
|
338
|
+
};
|
|
333
339
|
await ev(`Promise.race([Promise.all(document.getAnimations().map((a) => a.finished.catch(() => 1))), new Promise((r) => setTimeout(r, 5000))]).then(() => true)`, true);
|
|
334
340
|
await ev(`new Promise((resolve) => { let timer = 0; const done = () => { mo.disconnect(); resolve(true) }; const mo = new MutationObserver(() => { clearTimeout(timer); timer = setTimeout(done, 250) }); mo.observe(document.documentElement, { subtree: true, childList: true, attributes: true, characterData: true }); timer = setTimeout(done, 250); setTimeout(done, 3000) })`, true);
|
|
335
341
|
await ev(PAINTED, true);
|
|
@@ -652,17 +658,33 @@ function pruneBakes(root, keep) {
|
|
|
652
658
|
/** Compiles in flight, by generation and key: identical asks - inside one request or across
|
|
653
659
|
* concurrent ones - share one compile. */
|
|
654
660
|
const inflight = /* @__PURE__ */ new Map();
|
|
661
|
+
/** Compiles that FAILED for the frame's own reasons (it loops, never stops changing, never settles,
|
|
662
|
+
* timed out, has too many effects), by generation and key, so it is answered at once from memory
|
|
663
|
+
* instead of being compiled again on every rest. The generation is in the key: an edit retries it.
|
|
664
|
+
* Only these are kept - anything else (the source moved mid-compile, the browser or its pipe died,
|
|
665
|
+
* a cache write failed) says nothing about the frame and is tried again. */
|
|
666
|
+
const failed = /* @__PURE__ */ new Map();
|
|
667
|
+
const FAILED_MAX = 2e3;
|
|
668
|
+
const ofTheFrame = (error) => error === "a looping animation - the frame rests paused, uncompiled" || /^the frame (never stopped changing|did not settle|never rendered|rendered an error)|^the bake timed out$|^too many effects|^an effect larger than/.test(error);
|
|
655
669
|
/** Compile many frames as ONE operation (one browser, `shotConcurrency()` at a time), the cache
|
|
656
670
|
* first. `urlFor(ask)` gives the frame's own URL; `urlBase` is where textures are served from;
|
|
657
671
|
* `live()` is the source generation NOW - a compile the source outran is not published. */
|
|
658
672
|
async function bakeBatch(opts) {
|
|
659
|
-
const { root, gen, asks, urlFor, urlBase, live, log } = opts;
|
|
673
|
+
const { root, gen, asks, urlFor, urlBase, live, log, waitMs } = opts;
|
|
660
674
|
if (!cacheInside(root)) return asks.map((ask) => ({
|
|
661
675
|
...ask,
|
|
662
676
|
ok: false,
|
|
663
677
|
error: "design/.local/bakes resolves outside the project"
|
|
664
678
|
}));
|
|
665
|
-
const
|
|
679
|
+
const failedKey = (ask) => `${root}|${gen}|${bakeKey(ask)}`;
|
|
680
|
+
const answers = asks.map((ask) => {
|
|
681
|
+
const error = failed.get(failedKey(ask));
|
|
682
|
+
return error !== void 0 ? {
|
|
683
|
+
...ask,
|
|
684
|
+
ok: false,
|
|
685
|
+
error
|
|
686
|
+
} : readCached(root, gen, ask, urlBase);
|
|
687
|
+
});
|
|
666
688
|
const protect = new Set(asks.map(bakeKey));
|
|
667
689
|
const misses = /* @__PURE__ */ new Map();
|
|
668
690
|
asks.forEach((ask, i) => {
|
|
@@ -694,7 +716,7 @@ async function bakeBatch(opts) {
|
|
|
694
716
|
};
|
|
695
717
|
});
|
|
696
718
|
});
|
|
697
|
-
|
|
719
|
+
async function compile() {
|
|
698
720
|
const settle = (job, a) => {
|
|
699
721
|
job.done = true;
|
|
700
722
|
job.resolve(a);
|
|
@@ -729,6 +751,10 @@ async function bakeBatch(opts) {
|
|
|
729
751
|
error: e.message
|
|
730
752
|
};
|
|
731
753
|
}
|
|
754
|
+
if (!a.ok && ofTheFrame(a.error)) {
|
|
755
|
+
if (failed.size >= FAILED_MAX) failed.clear();
|
|
756
|
+
failed.set(failedKey(job.ask), a.error);
|
|
757
|
+
}
|
|
732
758
|
log?.(a);
|
|
733
759
|
settle(job, a);
|
|
734
760
|
}));
|
|
@@ -740,8 +766,21 @@ async function bakeBatch(opts) {
|
|
|
740
766
|
});
|
|
741
767
|
}
|
|
742
768
|
}
|
|
743
|
-
|
|
744
|
-
|
|
769
|
+
const all = (mine.length ? compile() : Promise.resolve()).then(() => Promise.all(waits));
|
|
770
|
+
if (waitMs === void 0) {
|
|
771
|
+
await all;
|
|
772
|
+
return answers;
|
|
773
|
+
}
|
|
774
|
+
let timer;
|
|
775
|
+
await Promise.race([all, new Promise((r) => {
|
|
776
|
+
timer = setTimeout(r, waitMs);
|
|
777
|
+
})]);
|
|
778
|
+
clearTimeout(timer);
|
|
779
|
+
return answers.map((a, i) => a ?? {
|
|
780
|
+
...asks[i],
|
|
781
|
+
ok: false,
|
|
782
|
+
error: "compiling - ask again"
|
|
783
|
+
});
|
|
745
784
|
}
|
|
746
785
|
//#endregion
|
|
747
786
|
export { ASK_MAX, bakeBatch, pruneBakes };
|
|
@@ -4,7 +4,7 @@ import { C as PROPOSED_PUBLISH, a as buildTree, f as isBoardName, l as framesOn,
|
|
|
4
4
|
import { g as PUBLISHABLE, s as scanFrames, v as publishableStatus } from "./manifest-DnAte_fB.mjs";
|
|
5
5
|
import { a as readLog, r as legacyExposure, t as appendEvents } from "./comments-Zoch254k.mjs";
|
|
6
6
|
import { n as loadConfig, r as detectHost } from "./config-cKgZBRj0.mjs";
|
|
7
|
-
import { a as autoWidthOf, c as readSizes, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-
|
|
7
|
+
import { a as autoWidthOf, c as readSizes, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-dTF5reck.mjs";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { basename, dirname, join, sep } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
@@ -780,7 +780,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
|
|
|
780
780
|
const realAssets = existsSync(assetsDir) ? realpathSync(assetsDir) : null;
|
|
781
781
|
for (const r of refs) {
|
|
782
782
|
if (!isLocalAssetRef(r) || !r.endsWith(".poster.png") || existsSync(join(assetsDir, r))) continue;
|
|
783
|
-
const { ensurePoster } = await import("./poster-
|
|
783
|
+
const { ensurePoster } = await import("./poster-D-zjYpgk.mjs");
|
|
784
784
|
const g = await ensurePoster(assetsDir, r.slice(0, -11));
|
|
785
785
|
if (!g.ok) throw new Error(`design/assets/${r}: ${g.error}`);
|
|
786
786
|
console.log(` poster: rendered design/assets/${r} (${g.width}×${g.height})`);
|
|
@@ -855,7 +855,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
|
|
|
855
855
|
}));
|
|
856
856
|
let textureLine = " textures: skipped (--no-textures)";
|
|
857
857
|
if (textures && bakeGen) {
|
|
858
|
-
const { bakePublished } = await import("./publish-bakes
|
|
858
|
+
const { bakePublished } = await import("./publish-bakes-C_9VZ-Mq.mjs");
|
|
859
859
|
const pubFrameFile = new Map(pubFrames.map((f) => [f.id, f]));
|
|
860
860
|
const r = await bakePublished({
|
|
861
861
|
root,
|
package/dist/cli.mjs
CHANGED
|
@@ -90,7 +90,7 @@ cli.command("init", "Scaffold design/ in this repo").option("--mode <mode>", "st
|
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot reload, comments, Live Jam)"], ["canvas", "Start the local canvas - same as dev"]]) cli.command(name, desc).option("--root <dir>", "Host repo root", { default: "." }).option("--port <port>", "Port (default 5199)").action(async (opts) => {
|
|
93
|
-
const { dev } = await import("./dev-
|
|
93
|
+
const { dev } = await import("./dev-Diqx1Rt8.mjs");
|
|
94
94
|
let port;
|
|
95
95
|
if (opts.port !== void 0) {
|
|
96
96
|
const n = Number(opts.port);
|
|
@@ -100,7 +100,7 @@ for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot
|
|
|
100
100
|
await dev(resolve$1(opts.root), port);
|
|
101
101
|
});
|
|
102
102
|
cli.command("build", "Static export → design/.dist (what ships comes from design/publish.json - publishing is default-closed)").option("--boards <names>", "Publish only these boards (comma-separated); overrides the publish policy").option("--all-boards", "Publish every board - the loud override for the default-closed policy").option("--embed-seeds", "Copy comment history INTO the web root (identifying - every event carries its author's email)").option("--no-textures", "Skip compiling the glass textures the published frames rest under (needs Chrome; a CI without one skips on its own)").option("--root <dir>", "Host repo root", { default: "." }).action(async (opts) => {
|
|
103
|
-
const { buildSite } = await import("./build-
|
|
103
|
+
const { buildSite } = await import("./build-DKaGhoVN.mjs");
|
|
104
104
|
try {
|
|
105
105
|
const boards = opts.boards === void 0 ? void 0 : typeof opts.boards === "string" ? opts.boards : "";
|
|
106
106
|
await buildSite(resolve$1(opts.root), boards, opts.allBoards === true, opts.embedSeeds === true, opts.textures !== false && !process.env.MARVER_NO_TEXTURES);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as PKG, r as NAME } from "./cli.mjs";
|
|
2
2
|
import { n as loadConfig, r as detectHost } from "./config-cKgZBRj0.mjs";
|
|
3
|
-
import { n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-
|
|
3
|
+
import { n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-dTF5reck.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, watch } from "node:fs";
|
|
5
5
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -457,12 +457,12 @@ async function dev(root, portFlag) {
|
|
|
457
457
|
console.log(`\n ${NAME} · ${projectName} → http://localhost:${port}/\n`);
|
|
458
458
|
setTimeout(async () => {
|
|
459
459
|
try {
|
|
460
|
-
await (await import("./shot-
|
|
460
|
+
await (await import("./shot-CUlmkqFX.mjs")).sweepGhosts((m) => console.log(` ${m}`));
|
|
461
461
|
} catch {}
|
|
462
462
|
}, 0);
|
|
463
463
|
try {
|
|
464
464
|
const { staleManagedInstructions } = await import("./managed-HwHVNI3h.mjs");
|
|
465
|
-
const { installedVersion } = await import("./plugin-
|
|
465
|
+
const { installedVersion } = await import("./plugin-dTF5reck.mjs").then((n) => n.i);
|
|
466
466
|
const stale = staleManagedInstructions(root);
|
|
467
467
|
if (stale.length) {
|
|
468
468
|
const shown = stale.slice(0, 4).join(", ") + (stale.length > 4 ? `, +${stale.length - 4} more` : "");
|
|
@@ -547,7 +547,7 @@ async function dev(root, portFlag) {
|
|
|
547
547
|
}
|
|
548
548
|
if (config.jam) {
|
|
549
549
|
const { startJam } = await import("./daemon-Cl8KXGW4.mjs");
|
|
550
|
-
const { checkAnchor } = await import("./anchor-check-
|
|
550
|
+
const { checkAnchor } = await import("./anchor-check-DGZnYviN.mjs");
|
|
551
551
|
const jam = startJam(root, config.jam, (m) => console.log(m), (board) => server.ws.send("sh:jam-comment", { board }), (frameId, target, others, look) => checkAnchor({
|
|
552
552
|
root,
|
|
553
553
|
viewports: config.viewports,
|
|
@@ -1025,7 +1025,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1025
1025
|
};
|
|
1026
1026
|
const asPng = url.searchParams.get("format") === "png";
|
|
1027
1027
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
1028
|
-
const { shootFrame } = await import("./shot-
|
|
1028
|
+
const { shootFrame } = await import("./shot-CUlmkqFX.mjs");
|
|
1029
1029
|
const r = await shootFrame({
|
|
1030
1030
|
root,
|
|
1031
1031
|
viewports: opts.viewports ?? {},
|
|
@@ -1075,7 +1075,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1075
1075
|
if (typeof theme !== "string" || !/^[a-z0-9-]+$/i.test(theme)) return json(res, 400, { error: "invalid theme" });
|
|
1076
1076
|
const scale = body.scale === void 0 ? void 0 : body.scale;
|
|
1077
1077
|
if (scale !== void 0 && !(Number.isInteger(scale) && scale >= 1 && scale <= 4)) return json(res, 400, { error: "invalid scale" });
|
|
1078
|
-
const { resolveFrames, shootBatch } = await import("./shot-
|
|
1078
|
+
const { resolveFrames, shootBatch } = await import("./shot-CUlmkqFX.mjs");
|
|
1079
1079
|
const sel = resolveFrames(root, body);
|
|
1080
1080
|
if (!sel.ok) return json(res, sel.status, { error: sel.error });
|
|
1081
1081
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
@@ -1109,7 +1109,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1109
1109
|
if (typeof target === "string") return json(res, 400, { error: target });
|
|
1110
1110
|
const others = Array.isArray(b.others) ? b.others.filter((o) => typeof o?.key === "string").slice(0, 200) : [];
|
|
1111
1111
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
1112
|
-
const { checkAnchor, CheckInputError } = await import("./anchor-check-
|
|
1112
|
+
const { checkAnchor, CheckInputError } = await import("./anchor-check-DGZnYviN.mjs");
|
|
1113
1113
|
try {
|
|
1114
1114
|
return json(res, 200, await checkAnchor({
|
|
1115
1115
|
root,
|
|
@@ -1137,7 +1137,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1137
1137
|
return json(res, 400, { error: "malformed JSON" });
|
|
1138
1138
|
}
|
|
1139
1139
|
if (!body || typeof body !== "object" || !Array.isArray(body.asks) || !body.asks.length || body.asks.length > 200) return json(res, 400, { error: "asks must list 1-200 frames" });
|
|
1140
|
-
const { bakeBatch, ASK_MAX } = await import("./bake-
|
|
1140
|
+
const { bakeBatch, ASK_MAX } = await import("./bake-BpxMZfij.mjs");
|
|
1141
1141
|
let manifest = {};
|
|
1142
1142
|
try {
|
|
1143
1143
|
manifest = JSON.parse(readFileSync(join(root, "design", "manifest.json"), "utf8"));
|
|
@@ -1178,7 +1178,8 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1178
1178
|
const f = frames.get(ask.frame);
|
|
1179
1179
|
return f.kind === "html" ? `${origin}/${f.file}?theme=${encodeURIComponent(ask.theme)}` : `${origin}${ROUTE}/frame/?id=${encodeURIComponent(ask.frame)}&theme=${encodeURIComponent(ask.theme)}`;
|
|
1180
1180
|
},
|
|
1181
|
-
urlBase: `${ROUTE}/bakes
|
|
1181
|
+
urlBase: `${ROUTE}/bakes`,
|
|
1182
|
+
waitMs: 2500
|
|
1182
1183
|
});
|
|
1183
1184
|
const after = docs.map((d, i) => d !== void 0 && (!!opts.settled && !opts.settled() || d !== docRev(root, devManifest().frames, asks[i].frame)));
|
|
1184
1185
|
let k = 0;
|
|
@@ -1200,8 +1201,8 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1200
1201
|
if (path === "poster" && req.method === "GET") {
|
|
1201
1202
|
if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
|
|
1202
1203
|
const src = url.searchParams.get("src") ?? "";
|
|
1203
|
-
const { ensurePoster, isLocalClip } = await import("./poster-
|
|
1204
|
-
const { isLocalAssetRef } = await import("./build-
|
|
1204
|
+
const { ensurePoster, isLocalClip } = await import("./poster-D-zjYpgk.mjs");
|
|
1205
|
+
const { isLocalAssetRef } = await import("./build-DKaGhoVN.mjs");
|
|
1205
1206
|
if (!isLocalAssetRef(src) || !isLocalClip(src)) return json(res, 400, { error: "src must be a clip under design/assets/" });
|
|
1206
1207
|
const r = await ensurePoster(join(root, "design", "assets"), src);
|
|
1207
1208
|
if (!r.ok) return json(res, r.error.includes("does not exist") ? 404 : 503, { error: r.error });
|
|
@@ -1858,7 +1859,7 @@ function marverPlugin(ctx) {
|
|
|
1858
1859
|
};
|
|
1859
1860
|
const prune = () => setTimeout(async () => {
|
|
1860
1861
|
try {
|
|
1861
|
-
(await import("./bake-
|
|
1862
|
+
(await import("./bake-BpxMZfij.mjs")).pruneBakes(root, bakeGen);
|
|
1862
1863
|
} catch {}
|
|
1863
1864
|
}, 500);
|
|
1864
1865
|
prune();
|
|
@@ -2038,7 +2039,7 @@ function marverPlugin(ctx) {
|
|
|
2038
2039
|
});
|
|
2039
2040
|
return;
|
|
2040
2041
|
}
|
|
2041
|
-
const { shootFrame, shootBatch, resolveFrames } = await import("./shot-
|
|
2042
|
+
const { shootFrame, shootBatch, resolveFrames } = await import("./shot-CUlmkqFX.mjs");
|
|
2042
2043
|
if (ways[0] === "frame") {
|
|
2043
2044
|
if (typeof spec.frame !== "string") {
|
|
2044
2045
|
write({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { capture, t as findChrome } from "./shot-
|
|
1
|
+
import { capture, t as findChrome } from "./shot-CUlmkqFX.mjs";
|
|
2
2
|
import { constants, copyFileSync, existsSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { basename, dirname, join, sep } from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as slideSize } from "./cli.mjs";
|
|
2
|
-
import { planShot, t as findChrome } from "./shot-
|
|
3
|
-
import { ASK_MAX, bakeBatch } from "./bake-
|
|
2
|
+
import { planShot, t as findChrome } from "./shot-CUlmkqFX.mjs";
|
|
3
|
+
import { ASK_MAX, bakeBatch } from "./bake-BpxMZfij.mjs";
|
|
4
4
|
import { MIME } from "./serve-wv2QWdxB.mjs";
|
|
5
5
|
import { copyFileSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -333,8 +333,8 @@ async function shootFrame(opts) {
|
|
|
333
333
|
};
|
|
334
334
|
const plan = planShot(frame, viewports, size);
|
|
335
335
|
if (frame.kind !== "html") try {
|
|
336
|
-
const { scanAssetRefs } = await import("./build-
|
|
337
|
-
const { ensurePoster } = await import("./poster-
|
|
336
|
+
const { scanAssetRefs } = await import("./build-DKaGhoVN.mjs");
|
|
337
|
+
const { ensurePoster } = await import("./poster-D-zjYpgk.mjs");
|
|
338
338
|
const refs = scanAssetRefs(readFileSync(join(root, frame.file), "utf8"), frame.file);
|
|
339
339
|
for (const r of refs) if (r.endsWith(".poster.png")) await ensurePoster(join(root, "design", "assets"), r.slice(0, -11));
|
|
340
340
|
} catch {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marver-design/marver",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "The agent-native design canvas. A design/ folder, one command, a canvas of live frames built from your repo's real components - comment @marver and your own coding agent does the work. The tool ships no AI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -54,6 +54,13 @@ let seq = 0
|
|
|
54
54
|
/** Nodes with one retry of a failed compile in flight. */
|
|
55
55
|
const retried = new Set<string>()
|
|
56
56
|
const RETRY_MS = 4000
|
|
57
|
+
/** The server's answer for a compile still running (src/server/bake.ts COMPILING), and how many times a
|
|
58
|
+
* node looks again for it before settling for the pause alone. */
|
|
59
|
+
const COMPILING = 'compiling - ask again'
|
|
60
|
+
const COMPILING_TRIES = 15
|
|
61
|
+
/** Looks so far, per node, for the sleep key they were for: a new key (an edit, a theme, a size)
|
|
62
|
+
* or a wake starts the count again. */
|
|
63
|
+
const compiling = new Map<string, { key: string; n: number }>()
|
|
57
64
|
|
|
58
65
|
/** Does this document have anything to compile? Cheap: one computed style per element. */
|
|
59
66
|
export function hasEffects(doc: Document): boolean {
|
|
@@ -125,6 +132,15 @@ export async function sleep(nodeKey: string, iframe: HTMLIFrameElement, key: Sle
|
|
|
125
132
|
}
|
|
126
133
|
const answer = await ask(key)
|
|
127
134
|
if (!current()) return 'live'
|
|
135
|
+
// still compiling (issue #23): the server answered in seconds and carries on by itself. The frame
|
|
136
|
+
// stays LIVE meanwhile - pausing now would freeze a finite animation midway, under a texture of its
|
|
137
|
+
// end - and looks again, a bounded number of times; past that, the pause alone below
|
|
138
|
+
if (!PUBLISHED && !answer.ok && answer.error === COMPILING) {
|
|
139
|
+
const was = compiling.get(nodeKey)
|
|
140
|
+
const n = (was && was.key === k ? was.n : 0) + 1
|
|
141
|
+
compiling.set(nodeKey, { key: k, n })
|
|
142
|
+
if (n <= COMPILING_TRIES) { setTimeout(() => { if (current()) void sleep(nodeKey, iframe, key) }, RETRY_MS); return 'live' }
|
|
143
|
+
}
|
|
128
144
|
// no compiler (a published canvas, a compile that failed): the pause alone, the glass live -
|
|
129
145
|
// never an effect layer without its texture
|
|
130
146
|
let targets = answer.ok ? answer.targets.filter((t) => t.verified && t.texture) : []
|
|
@@ -138,7 +154,8 @@ export async function sleep(nodeKey: string, iframe: HTMLIFrameElement, key: Sle
|
|
|
138
154
|
if (!install(doc, targets)) return 'live'
|
|
139
155
|
// a certified sleep is remembered; the pause-only fallback is not, so the next lifecycle event
|
|
140
156
|
// asks again (a compile the source outran, a server hiccup), and one retry is scheduled now
|
|
141
|
-
if (targets.length) asleep.set(nodeKey, { key: k, doc })
|
|
157
|
+
if (targets.length) { asleep.set(nodeKey, { key: k, doc }); compiling.delete(nodeKey) }
|
|
158
|
+
else if (answer.ok === false && answer.error === COMPILING) { /* out of looks: the pause alone, final */ }
|
|
142
159
|
else if (!PUBLISHED && !retried.has(nodeKey)) { retried.add(nodeKey); setTimeout(() => { retried.delete(nodeKey); if (current()) void sleep(nodeKey, iframe, key) }, RETRY_MS) } // a static miss is final
|
|
143
160
|
return 'asleep'
|
|
144
161
|
}
|
|
@@ -147,6 +164,7 @@ export async function sleep(nodeKey: string, iframe: HTMLIFrameElement, key: Sle
|
|
|
147
164
|
export function wake(nodeKey: string, iframe: HTMLIFrameElement | null): void {
|
|
148
165
|
pending.delete(nodeKey)
|
|
149
166
|
asleep.delete(nodeKey)
|
|
167
|
+
compiling.delete(nodeKey)
|
|
150
168
|
const doc = iframe?.contentDocument
|
|
151
169
|
const st = doc?.getElementById(STYLE_ID)
|
|
152
170
|
if (!doc || !st) return
|