feat(runner): pass sceneInfoJson to Rust CLI for enhanced template rendering

This commit is contained in:
木炎
2026-04-17 10:39:36 +08:00
parent 7289cc5779
commit bb15d14749
2 changed files with 8 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ const { spawn } = require("child_process");
const path = require("path");
function runGenerator(params, sseWriter, projectRoot) {
const { sourceDir, sceneId, sceneName, sceneKind, targetUrl, outputRoot, lessons } = params;
const { sourceDir, sceneId, sceneName, sceneKind, targetUrl, outputRoot, lessons, sceneInfoJson } = params;
const normalize = (p) => p.replace(/\\/g, "/");
@@ -35,6 +35,11 @@ function runGenerator(params, sseWriter, projectRoot) {
args.push("--lessons", normalize(lessons));
}
// Pass scene info JSON if available
if (sceneInfoJson) {
args.push("--scene-info-json", sceneInfoJson);
}
return new Promise((resolve, reject) => {
sseWriter.write(
`event: status\ndata: ${JSON.stringify({