@koda-sl/baker-cli 0.260.0-dev.07acdacde → 0.261.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/README.md +50 -13
- package/canvas/tiktok-captions-composition/index.html +2 -19
- package/dist/{chunk-GXRUZ4LP.js → chunk-2IB3IL4K.js} +2 -2
- package/dist/{chunk-TBEVU7XF.js → chunk-6F52WYB7.js} +3 -3
- package/dist/{chunk-POYXIDOD.js → chunk-DZUVUGEP.js} +1 -5
- package/dist/{chunk-POYXIDOD.js.map → chunk-DZUVUGEP.js.map} +1 -1
- package/dist/{chunk-ECPNYXOA.js → chunk-GU7IWEBC.js} +12 -5
- package/dist/chunk-GU7IWEBC.js.map +1 -0
- package/dist/{chunk-2VM2J6MB.js → chunk-KSOGK7SJ.js} +4 -4
- package/dist/{chunk-R4MBS2OI.js → chunk-SJPRTSGY.js} +36 -149
- package/dist/chunk-SJPRTSGY.js.map +1 -0
- package/dist/cli.js +3142 -2478
- package/dist/cli.js.map +1 -1
- package/dist/client-VDCCDEHE.js +17 -0
- package/dist/engine/index.js +3 -3
- package/dist/{env-HZNFGXAR.js → env-FWMZXMQK.js} +2 -4
- package/dist/{output-MWMAXN4M.js → output-JBYI5IVX.js} +5 -5
- package/dist/{shared-NFLXWGHK.js → shared-GWFXJXKJ.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-ECPNYXOA.js.map +0 -1
- package/dist/chunk-R4MBS2OI.js.map +0 -1
- package/dist/client-7QIDRQXG.js +0 -15
- /package/dist/{chunk-GXRUZ4LP.js.map → chunk-2IB3IL4K.js.map} +0 -0
- /package/dist/{chunk-TBEVU7XF.js.map → chunk-6F52WYB7.js.map} +0 -0
- /package/dist/{chunk-2VM2J6MB.js.map → chunk-KSOGK7SJ.js.map} +0 -0
- /package/dist/{client-7QIDRQXG.js.map → client-VDCCDEHE.js.map} +0 -0
- /package/dist/{env-HZNFGXAR.js.map → env-FWMZXMQK.js.map} +0 -0
- /package/dist/{output-MWMAXN4M.js.map → output-JBYI5IVX.js.map} +0 -0
- /package/dist/{shared-NFLXWGHK.js.map → shared-GWFXJXKJ.js.map} +0 -0
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
debugLogHttp,
|
|
3
3
|
readBodyForLog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2IB3IL4K.js";
|
|
5
5
|
import {
|
|
6
6
|
DIRECT_ROUTE,
|
|
7
7
|
__commonJS,
|
|
8
8
|
__toESM,
|
|
9
9
|
captureProxyCredentials,
|
|
10
10
|
childEnvWith,
|
|
11
|
-
hasFrameVisionKey,
|
|
12
11
|
isChallengeBody,
|
|
13
12
|
isPrivateAddress,
|
|
14
13
|
isProxyFailure,
|
|
15
14
|
plannedRoutes,
|
|
16
15
|
refuseNonPublicUrl,
|
|
17
16
|
shouldEscalate
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DZUVUGEP.js";
|
|
19
18
|
|
|
20
|
-
//
|
|
19
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
|
|
21
20
|
var require_safe_stable_stringify = __commonJS({
|
|
22
|
-
"
|
|
21
|
+
"../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
23
22
|
"use strict";
|
|
24
23
|
var { hasOwnProperty } = Object.prototype;
|
|
25
24
|
var stringify = configure2();
|
|
@@ -1093,7 +1092,7 @@ function resolveAdaptFormats(params) {
|
|
|
1093
1092
|
return params.formats ?? [];
|
|
1094
1093
|
}
|
|
1095
1094
|
|
|
1096
|
-
//
|
|
1095
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
1097
1096
|
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
1098
1097
|
var configure = import__.default.configure;
|
|
1099
1098
|
var wrapper_default = import__.default;
|
|
@@ -7254,24 +7253,6 @@ import { execFile as execFile3 } from "child_process";
|
|
|
7254
7253
|
import { readFile as readFile9 } from "fs/promises";
|
|
7255
7254
|
import path12 from "path";
|
|
7256
7255
|
import { promisify as promisify3 } from "util";
|
|
7257
|
-
|
|
7258
|
-
// src/engine/nodes/local/lib/caption-style.ts
|
|
7259
|
-
var TERMINAL = /[.,;:!?…]$/;
|
|
7260
|
-
function captionTextsFrom(html) {
|
|
7261
|
-
const cards = html.match(/<div[^>]*class="[^"]*\bcaption\b[^"]*"[\s\S]*?<\/div>/g) ?? [];
|
|
7262
|
-
return cards.map(
|
|
7263
|
-
(card) => card.replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim()
|
|
7264
|
-
).filter((text) => text.length > 0);
|
|
7265
|
-
}
|
|
7266
|
-
function fragmentedCaptions(texts) {
|
|
7267
|
-
if (texts.length < 2) return null;
|
|
7268
|
-
const fragments = texts.slice(0, -1).filter((t) => !TERMINAL.test(t));
|
|
7269
|
-
if (fragments.length === 0) return null;
|
|
7270
|
-
const example = fragments[0];
|
|
7271
|
-
return `${fragments.length} of ${texts.length} caption cards end mid-clause, e.g. "${example}". Split captions where the script punctuates, not on a word count \u2014 a card that ends bare is a sentence cut in half by a timing decision, and it reads as one.`;
|
|
7272
|
-
}
|
|
7273
|
-
|
|
7274
|
-
// src/engine/nodes/local/lib/hyperframe-check.ts
|
|
7275
7256
|
var execFileAsync = promisify3(execFile3);
|
|
7276
7257
|
var NEVER_BLOCK = [
|
|
7277
7258
|
/contrast/i,
|
|
@@ -7340,73 +7321,6 @@ function classifyCheckOutput(lintRaw, inspectRaw) {
|
|
|
7340
7321
|
warnings: findings.filter((f) => f.severity === "warning")
|
|
7341
7322
|
};
|
|
7342
7323
|
}
|
|
7343
|
-
var GATE_SECTIONS = ["lint", "runtime", "layout", "motion", "contrast"];
|
|
7344
|
-
function buildCheckArgs(dir, samples) {
|
|
7345
|
-
return ["hyperframes", "check", dir, "--json", "--samples", String(samples), "--at-transitions"];
|
|
7346
|
-
}
|
|
7347
|
-
var PROMOTE_TO_BLOCKING = /GSAP target [^ ]+ not found/i;
|
|
7348
|
-
function toGateFinding(section, entry) {
|
|
7349
|
-
const f = entry;
|
|
7350
|
-
const code = typeof f.code === "string" ? f.code : "unknown";
|
|
7351
|
-
const message2 = typeof f.message === "string" ? f.message : "";
|
|
7352
|
-
const isError = f.severity === "error" || PROMOTE_TO_BLOCKING.test(message2);
|
|
7353
|
-
return {
|
|
7354
|
-
source: section,
|
|
7355
|
-
code,
|
|
7356
|
-
message: message2,
|
|
7357
|
-
severity: isError && !isAdvisory(code, message2) ? "blocking" : "warning"
|
|
7358
|
-
};
|
|
7359
|
-
}
|
|
7360
|
-
function classifyGateOutput(raw) {
|
|
7361
|
-
const parsed = parseCheckJson(raw);
|
|
7362
|
-
const findings = GATE_SECTIONS.flatMap((section) => {
|
|
7363
|
-
const block = parsed?.[section];
|
|
7364
|
-
const entries = Array.isArray(block?.findings) ? block.findings : [];
|
|
7365
|
-
return entries.map((entry) => toGateFinding(section, entry));
|
|
7366
|
-
});
|
|
7367
|
-
return {
|
|
7368
|
-
blocking: findings.filter((f) => f.severity === "blocking"),
|
|
7369
|
-
warnings: findings.filter((f) => f.severity === "warning")
|
|
7370
|
-
};
|
|
7371
|
-
}
|
|
7372
|
-
function summariseWarnings(warnings) {
|
|
7373
|
-
const groups = /* @__PURE__ */ new Map();
|
|
7374
|
-
for (const w of warnings) {
|
|
7375
|
-
const key = `${w.source}/${w.code}`;
|
|
7376
|
-
const seen = groups.get(key);
|
|
7377
|
-
if (seen) seen.count += 1;
|
|
7378
|
-
else groups.set(key, { count: 1, message: w.message });
|
|
7379
|
-
}
|
|
7380
|
-
return [...groups.entries()].sort((a, b) => b[1].count - a[1].count).map(([key, g]) => `${g.count}\xD7 [${key}] ${g.message}`);
|
|
7381
|
-
}
|
|
7382
|
-
var FINDING_ADVICE = {
|
|
7383
|
-
sweep_static: "the timeline never advanced, so this renders as a STILL IMAGE while billing like a video \u2014 and every other green verdict in this run is unreliable. Check the composition registers a paused timeline on `window.__timelines[<composition-id>]` and that the tweens target elements that exist.",
|
|
7384
|
-
console_error: "the composition threw in the browser, so whatever that script was driving did not happen.",
|
|
7385
|
-
page_error: "a script failed to evaluate \u2014 animations and any JS-driven layout in this composition did not run.",
|
|
7386
|
-
http_error: "an asset 404ed at render time; it will be missing from the frame, not substituted.",
|
|
7387
|
-
console_warning: "if this names a GSAP target, the element it animates does not exist, so that tween is a no-op and whatever it was meant to reveal never appears. Fix the selector or add the element before rendering."
|
|
7388
|
-
};
|
|
7389
|
-
function explainGateFinding(finding) {
|
|
7390
|
-
const advice = FINDING_ADVICE[finding.code];
|
|
7391
|
-
return advice ? `${finding.message} \u2014 ${advice}` : finding.message;
|
|
7392
|
-
}
|
|
7393
|
-
function condenseFrameDescriptions(markdown) {
|
|
7394
|
-
const lines = [];
|
|
7395
|
-
let frame = null;
|
|
7396
|
-
for (const line of markdown.split("\n")) {
|
|
7397
|
-
const heading = line.match(/^## (.+)$/);
|
|
7398
|
-
if (heading) {
|
|
7399
|
-
frame = heading[1] ?? null;
|
|
7400
|
-
continue;
|
|
7401
|
-
}
|
|
7402
|
-
const text = line.trim();
|
|
7403
|
-
if (frame && text) {
|
|
7404
|
-
lines.push(`${frame}: ${text}`);
|
|
7405
|
-
frame = null;
|
|
7406
|
-
}
|
|
7407
|
-
}
|
|
7408
|
-
return lines;
|
|
7409
|
-
}
|
|
7410
7324
|
function buildLintArgs(dir) {
|
|
7411
7325
|
return ["hyperframes", "lint", dir, "--json"];
|
|
7412
7326
|
}
|
|
@@ -7438,13 +7352,8 @@ async function lintStructuralIssues(dir, timeoutMs) {
|
|
|
7438
7352
|
function buildInspectArgs(dir, samples) {
|
|
7439
7353
|
return ["hyperframes", "inspect", dir, "--json", "--samples", String(samples)];
|
|
7440
7354
|
}
|
|
7441
|
-
function buildSnapshotArgs(dir, frames
|
|
7442
|
-
|
|
7443
|
-
return vision ? [
|
|
7444
|
-
...base,
|
|
7445
|
-
"--describe",
|
|
7446
|
-
"Answer three things about this frame. (1) Is it empty or near-empty? Name every element actually visible. (2) Could what is shown physically happen \u2014 are object sizes, human scale and actions plausible? Say so plainly if something is the wrong size or impossible. (3) Is any on-screen text legible against what is behind it?"
|
|
7447
|
-
] : [...base, "--describe", "false"];
|
|
7355
|
+
function buildSnapshotArgs(dir, frames) {
|
|
7356
|
+
return ["hyperframes", "snapshot", dir, "--frames", String(frames), "--describe", "false"];
|
|
7448
7357
|
}
|
|
7449
7358
|
function usesNestedCompositions(indexHtml) {
|
|
7450
7359
|
const withoutComments = indexHtml.replace(/<!--[\s\S]*?-->/g, "");
|
|
@@ -7473,66 +7382,44 @@ async function runSnapshotSmoke(args, timeoutMs) {
|
|
|
7473
7382
|
return { ok: false, unavailable: false, message: (err.stderr || err.message || "snapshot failed").slice(0, 800) };
|
|
7474
7383
|
}
|
|
7475
7384
|
}
|
|
7476
|
-
async function
|
|
7477
|
-
const { dir, nodeId, ctx, timeoutMs, samples } = opts;
|
|
7478
|
-
const indexHtml = await readFile9(path12.join(dir, "index.html"), "utf-8").catch(() => "");
|
|
7479
|
-
if (!indexHtml || !usesNestedCompositions(indexHtml)) return;
|
|
7480
|
-
const snap = await runSnapshotSmoke(
|
|
7481
|
-
buildSnapshotArgs(dir, Math.min(samples, 3), hasFrameVisionKey()),
|
|
7482
|
-
Math.max(timeoutMs, 12e4)
|
|
7483
|
-
);
|
|
7484
|
-
if (snap.unavailable) {
|
|
7485
|
-
ctx.log(`${nodeId}: hyperframes snapshot unavailable \u2014 skipping nested-composition smoke test`);
|
|
7486
|
-
return;
|
|
7487
|
-
}
|
|
7488
|
-
if (!snap.ok) {
|
|
7489
|
-
throw new Error(
|
|
7490
|
-
`${nodeId}: nested-composition smoke test failed \u2014 an embedded block did not render. Check the host\u2194block id match, that the block's <style>/<script> live inside its <template>, and that it styles #root (not a class).
|
|
7491
|
-
${snap.message}`
|
|
7492
|
-
);
|
|
7493
|
-
}
|
|
7494
|
-
const described = await readFile9(path12.join(dir, "snapshots", "descriptions.md"), "utf-8").catch(() => "");
|
|
7495
|
-
for (const line of condenseFrameDescriptions(described)) {
|
|
7496
|
-
ctx.log(`${nodeId}: frame check \u2014 ${line}`);
|
|
7497
|
-
}
|
|
7498
|
-
ctx.log(`${nodeId}: nested-composition smoke test passed`);
|
|
7499
|
-
}
|
|
7500
|
-
async function runGate(dir, timeoutMs, samples) {
|
|
7501
|
-
const checkRaw = await runOne(buildCheckArgs(dir, samples), timeoutMs);
|
|
7502
|
-
if (checkRaw !== null) return classifyGateOutput(checkRaw);
|
|
7385
|
+
async function runHyperframesCheck(opts) {
|
|
7386
|
+
const { dir, nodeId, ctx, timeoutMs, samples = 5 } = opts;
|
|
7503
7387
|
const [lintRaw, inspectRaw] = await Promise.all([
|
|
7504
7388
|
runOne(buildLintArgs(dir), timeoutMs),
|
|
7505
7389
|
runOne(buildInspectArgs(dir, samples), timeoutMs)
|
|
7506
7390
|
]);
|
|
7507
|
-
if (lintRaw === null && inspectRaw === null)
|
|
7508
|
-
|
|
7509
|
-
}
|
|
7510
|
-
async function runHyperframesCheck(opts) {
|
|
7511
|
-
const { dir, nodeId, ctx, timeoutMs, samples = 5 } = opts;
|
|
7512
|
-
const gate = await runGate(dir, timeoutMs, samples);
|
|
7513
|
-
if (gate === null) {
|
|
7514
|
-
ctx.log(`${nodeId}: hyperframes check/lint/inspect unavailable \u2014 skipping pre-render check`);
|
|
7391
|
+
if (lintRaw === null && inspectRaw === null) {
|
|
7392
|
+
ctx.log(`${nodeId}: hyperframes lint/inspect unavailable \u2014 skipping pre-render check`);
|
|
7515
7393
|
return;
|
|
7516
7394
|
}
|
|
7517
|
-
const { blocking, warnings } =
|
|
7518
|
-
for (const
|
|
7519
|
-
ctx.log(`${nodeId}: hyperframe check warning ${
|
|
7395
|
+
const { blocking, warnings } = classifyCheckOutput(lintRaw ?? "", inspectRaw ?? "");
|
|
7396
|
+
for (const w of warnings) {
|
|
7397
|
+
ctx.log(`${nodeId}: hyperframe check warning [${w.source}/${w.code}] ${w.message}`);
|
|
7520
7398
|
}
|
|
7521
7399
|
if (blocking.length > 0) {
|
|
7522
|
-
const
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
);
|
|
7400
|
+
const detail = blocking.map((b) => `\u2022 [${b.source}/${b.code}] ${b.message}`).join("\n");
|
|
7401
|
+
throw new Error(`${nodeId}: pre-render check failed (${blocking.length} blocking)
|
|
7402
|
+
${detail}`);
|
|
7403
|
+
}
|
|
7404
|
+
let indexHtml = "";
|
|
7405
|
+
try {
|
|
7406
|
+
indexHtml = await readFile9(path12.join(dir, "index.html"), "utf-8");
|
|
7407
|
+
} catch {
|
|
7408
|
+
indexHtml = "";
|
|
7529
7409
|
}
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7410
|
+
if (indexHtml && usesNestedCompositions(indexHtml)) {
|
|
7411
|
+
const snap = await runSnapshotSmoke(buildSnapshotArgs(dir, Math.min(samples, 3)), Math.max(timeoutMs, 12e4));
|
|
7412
|
+
if (snap.unavailable) {
|
|
7413
|
+
ctx.log(`${nodeId}: hyperframes snapshot unavailable \u2014 skipping nested-composition smoke test`);
|
|
7414
|
+
} else if (!snap.ok) {
|
|
7415
|
+
throw new Error(
|
|
7416
|
+
`${nodeId}: nested-composition smoke test failed \u2014 an embedded block did not render. Check the host\u2194block id match, that the block's <style>/<script> live inside its <template>, and that it styles #root (not a class).
|
|
7417
|
+
${snap.message}`
|
|
7418
|
+
);
|
|
7419
|
+
} else {
|
|
7420
|
+
ctx.log(`${nodeId}: nested-composition smoke test passed`);
|
|
7421
|
+
}
|
|
7534
7422
|
}
|
|
7535
|
-
await runNestedCompositionSmoke({ dir, nodeId, ctx, timeoutMs, samples });
|
|
7536
7423
|
ctx.log(`${nodeId}: pre-render check passed (${warnings.length} warning${warnings.length === 1 ? "" : "s"})`);
|
|
7537
7424
|
}
|
|
7538
7425
|
|
|
@@ -9267,4 +9154,4 @@ export {
|
|
|
9267
9154
|
defaultRegistry,
|
|
9268
9155
|
createEngineFromEnv
|
|
9269
9156
|
};
|
|
9270
|
-
//# sourceMappingURL=chunk-
|
|
9157
|
+
//# sourceMappingURL=chunk-SJPRTSGY.js.map
|