fix(cli): flat asset structure + separate audio tracks in templates

Assets: video, images, fonts all go at project root (not assets/ or
fonts/ subdirectories). The studio preview can't resolve relative
paths from subdirectories due to the /preview URL suffix.

Audio: added <audio> elements alongside muted <video> in all 4
templates so the video's audio plays back. The framework requires
muted video + separate audio element.

Removed assets/ and fonts/ directory creation from scaffoldProject.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-03-26 18:03:31 +00:00
committed by Vance Ingalls
co-authored by Claude Opus 4.6
parent ba41b593a8
commit 30821cd35c
5 changed files with 36 additions and 5 deletions
+3 -4
View File
@@ -590,10 +590,9 @@ export default defineCommand({
localVideoName = result.localVideoName;
} else {
// Audio file — copy to assets/
const assetsDir = resolve(destDir, "assets");
mkdirSync(assetsDir, { recursive: true });
copyFileSync(filePath, resolve(assetsDir, basename(filePath)));
clack.log.info(`Audio copied to ${c.accent("assets/" + basename(filePath))}`);
copyFileSync(filePath, resolve(destDir, basename(filePath)));
clack.log.info(`Audio copied to ${c.accent(basename(filePath))}`);
}
}
}
@@ -151,6 +151,14 @@
style="width: 100%; height: auto"
></video>
</div>
<audio
id="a-roll-audio"
src="__VIDEO_SRC__"
data-start="0"
data-duration="16.04"
data-track-index="5"
data-volume="1"
></audio>
<style>
#aroll-container {
position: absolute;
@@ -106,6 +106,14 @@
data-track-index="1"
></video>
</div>
<audio
id="a-roll-audio"
src="__VIDEO_SRC__"
data-start="0"
data-duration="16.04"
data-track-index="5"
data-volume="1"
></audio>
<!-- Intro Sub-composition -->
<div
@@ -119,6 +119,14 @@
data-track-index="0"
></video>
</div>
<audio
id="a-roll-audio"
src="__VIDEO_SRC__"
data-start="0"
data-duration="13.88"
data-track-index="5"
data-volume="1"
></audio>
<!-- Transitions -->
<div id="curtain-black" class="curtain"></div>
@@ -123,7 +123,7 @@
</script>
</div>
<!-- A-Roll Video -->
<!-- A-Roll Video (muted — audio is separate) -->
<video
id="a-roll"
src="__VIDEO_SRC__"
@@ -133,6 +133,14 @@
data-duration="17"
data-track-index="0"
></video>
<audio
id="a-roll-audio"
src="__VIDEO_SRC__"
data-start="0"
data-duration="17"
data-track-index="5"
data-volume="1"
></audio>
<!-- Compositions -->
<div