@koda-sl/baker-cli 0.353.0-dev.5d1d795f9 → 0.353.0-dev.8bdd8f915
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 +5 -3
- package/dist/{chunk-PHHQLFY3.js → chunk-YBLNCFK4.js} +4 -28
- package/dist/chunk-YBLNCFK4.js.map +1 -0
- package/dist/cli.js +12 -7
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.d.ts +0 -7
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-PHHQLFY3.js.map +0 -1
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-YBLNCFK4.js";
|
|
72
73
|
import {
|
|
73
74
|
csvOrJson,
|
|
74
75
|
daysAgoIso,
|
|
@@ -35895,7 +35896,7 @@ function rewriteTarget(value, workspaceRoot) {
|
|
|
35895
35896
|
}
|
|
35896
35897
|
return null;
|
|
35897
35898
|
}
|
|
35898
|
-
function
|
|
35899
|
+
function normalizeCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
35899
35900
|
if (!canvas || typeof canvas !== "object") return { canvas, rewrites: [] };
|
|
35900
35901
|
const c = canvas;
|
|
35901
35902
|
if (!Array.isArray(c.nodes)) return { canvas, rewrites: [] };
|
|
@@ -35908,6 +35909,10 @@ function normalizeAbsoluteCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
|
35908
35909
|
const params = n.params;
|
|
35909
35910
|
if (!params || typeof params !== "object") return node;
|
|
35910
35911
|
const nodeId = typeof n.id === "string" ? n.id : "?";
|
|
35912
|
+
if (n.type === "ingest" && params.source === "path" && looksLikeHttpUrl(params.path)) {
|
|
35913
|
+
rewrites.push({ nodeId, param: "source", from: "path", to: "url" });
|
|
35914
|
+
return { ...node, params: coercePathUrlToUrl(params) };
|
|
35915
|
+
}
|
|
35911
35916
|
const key = n.type === "ingest" && params.source === "path" ? "path" : n.type === "hyperframe_render" ? "composition" : null;
|
|
35912
35917
|
if (!key) return node;
|
|
35913
35918
|
const target = rewriteTarget(params[key], root);
|
|
@@ -35918,11 +35923,11 @@ function normalizeAbsoluteCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
|
35918
35923
|
});
|
|
35919
35924
|
return rewrites.length === 0 ? { canvas, rewrites } : { canvas: { ...canvas, nodes }, rewrites };
|
|
35920
35925
|
}
|
|
35921
|
-
async function
|
|
35926
|
+
async function healCanvasPaths(filePath, canvas) {
|
|
35922
35927
|
const canvasDir = path5.dirname(filePath);
|
|
35923
35928
|
const workspaceRoot = findWorkspaceRoot(canvasDir);
|
|
35924
35929
|
if (!workspaceRoot) return { canvas, rewrites: [], text: null };
|
|
35925
|
-
const normalized =
|
|
35930
|
+
const normalized = normalizeCanvasPaths(canvas, canvasDir, workspaceRoot);
|
|
35926
35931
|
if (normalized.rewrites.length === 0) return { ...normalized, text: null };
|
|
35927
35932
|
const text2 = `${JSON.stringify(normalized.canvas, null, 2)}
|
|
35928
35933
|
`;
|
|
@@ -40864,12 +40869,12 @@ async function executeCanvasRun(opts) {
|
|
|
40864
40869
|
}
|
|
40865
40870
|
const attemptedSlug = creativeSlugFromCanvasPath(filePath);
|
|
40866
40871
|
if (attemptedSlug) await clearCreativeDirty(attemptedSlug);
|
|
40867
|
-
const healed = await
|
|
40872
|
+
const healed = await healCanvasPaths(filePath, parsed);
|
|
40868
40873
|
parsed = healed.canvas;
|
|
40869
40874
|
const canvasText = healed.text ?? raw;
|
|
40870
40875
|
if (healed.rewrites.length > 0) {
|
|
40871
40876
|
process.stderr.write(
|
|
40872
|
-
`[canvas] rewrote ${healed.rewrites.length}
|
|
40877
|
+
`[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"):
|
|
40873
40878
|
${describeRewrites(healed.rewrites)}
|
|
40874
40879
|
`
|
|
40875
40880
|
);
|
|
@@ -44462,7 +44467,7 @@ var validateCommand = defineCommand118({
|
|
|
44462
44467
|
`);
|
|
44463
44468
|
process.exit(2);
|
|
44464
44469
|
}
|
|
44465
|
-
const healed = await
|
|
44470
|
+
const healed = await healCanvasPaths(filePath, parsed);
|
|
44466
44471
|
parsed = healed.canvas;
|
|
44467
44472
|
parsed = resolveRelativeCanvasPaths(parsed, path28.dirname(filePath));
|
|
44468
44473
|
let styleProjection = "not_applicable";
|