@koda-sl/baker-cli 0.355.0 → 0.356.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/cli.js
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
clipDurationsFor,
|
|
29
29
|
clipParamRecipe,
|
|
30
30
|
clipProfileFor,
|
|
31
|
+
coercePathUrlToUrl,
|
|
31
32
|
collectAssetRefLikes,
|
|
32
33
|
createEngineFromEnv,
|
|
33
34
|
defaultRegistry,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
validateCanvasDeep,
|
|
69
70
|
withoutCastName,
|
|
70
71
|
ytDlpBlockSignal
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-H3SAAHZA.js";
|
|
72
73
|
import {
|
|
73
74
|
csvOrJson,
|
|
74
75
|
daysAgoIso,
|
|
@@ -36809,7 +36810,7 @@ function rewriteTarget(value, workspaceRoot) {
|
|
|
36809
36810
|
}
|
|
36810
36811
|
return null;
|
|
36811
36812
|
}
|
|
36812
|
-
function
|
|
36813
|
+
function normalizeCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
36813
36814
|
if (!canvas || typeof canvas !== "object") return { canvas, rewrites: [] };
|
|
36814
36815
|
const c = canvas;
|
|
36815
36816
|
if (!Array.isArray(c.nodes)) return { canvas, rewrites: [] };
|
|
@@ -36822,6 +36823,10 @@ function normalizeAbsoluteCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
|
36822
36823
|
const params = n.params;
|
|
36823
36824
|
if (!params || typeof params !== "object") return node;
|
|
36824
36825
|
const nodeId = typeof n.id === "string" ? n.id : "?";
|
|
36826
|
+
if (n.type === "ingest" && params.source === "path" && looksLikeHttpUrl(params.path)) {
|
|
36827
|
+
rewrites.push({ nodeId, param: "source", from: "path", to: "url" });
|
|
36828
|
+
return { ...node, params: coercePathUrlToUrl(params) };
|
|
36829
|
+
}
|
|
36825
36830
|
const key = n.type === "ingest" && params.source === "path" ? "path" : n.type === "hyperframe_render" ? "composition" : null;
|
|
36826
36831
|
if (!key) return node;
|
|
36827
36832
|
const target2 = rewriteTarget(params[key], root);
|
|
@@ -36832,11 +36837,11 @@ function normalizeAbsoluteCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
|
36832
36837
|
});
|
|
36833
36838
|
return rewrites.length === 0 ? { canvas, rewrites } : { canvas: { ...canvas, nodes }, rewrites };
|
|
36834
36839
|
}
|
|
36835
|
-
async function
|
|
36840
|
+
async function healCanvasPaths(filePath, canvas) {
|
|
36836
36841
|
const canvasDir = path5.dirname(filePath);
|
|
36837
36842
|
const workspaceRoot = findWorkspaceRoot(canvasDir);
|
|
36838
36843
|
if (!workspaceRoot) return { canvas, rewrites: [], text: null };
|
|
36839
|
-
const normalized =
|
|
36844
|
+
const normalized = normalizeCanvasPaths(canvas, canvasDir, workspaceRoot);
|
|
36840
36845
|
if (normalized.rewrites.length === 0) return { ...normalized, text: null };
|
|
36841
36846
|
const text2 = `${JSON.stringify(normalized.canvas, null, 2)}
|
|
36842
36847
|
`;
|
|
@@ -41778,12 +41783,12 @@ async function executeCanvasRun(opts) {
|
|
|
41778
41783
|
}
|
|
41779
41784
|
const attemptedSlug = creativeSlugFromCanvasPath(filePath);
|
|
41780
41785
|
if (attemptedSlug) await clearCreativeDirty(attemptedSlug);
|
|
41781
|
-
const healed = await
|
|
41786
|
+
const healed = await healCanvasPaths(filePath, parsed);
|
|
41782
41787
|
parsed = healed.canvas;
|
|
41783
41788
|
const canvasText = healed.text ?? raw;
|
|
41784
41789
|
if (healed.rewrites.length > 0) {
|
|
41785
41790
|
process.stderr.write(
|
|
41786
|
-
`[canvas] rewrote ${healed.rewrites.length}
|
|
41791
|
+
`[canvas] rewrote ${healed.rewrites.length} asset reference(s) in the canvas file so it says what runs (absolute paths \u2192 canvas-relative, a URL in an ingest path \u2192 source "url"):
|
|
41787
41792
|
${describeRewrites(healed.rewrites)}
|
|
41788
41793
|
`
|
|
41789
41794
|
);
|
|
@@ -45376,7 +45381,7 @@ var validateCommand = defineCommand118({
|
|
|
45376
45381
|
`);
|
|
45377
45382
|
process.exit(2);
|
|
45378
45383
|
}
|
|
45379
|
-
const healed = await
|
|
45384
|
+
const healed = await healCanvasPaths(filePath, parsed);
|
|
45380
45385
|
parsed = healed.canvas;
|
|
45381
45386
|
parsed = resolveRelativeCanvasPaths(parsed, path28.dirname(filePath));
|
|
45382
45387
|
let styleProjection = "not_applicable";
|