Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

fix(templates): resolve bundled fonts before onboarding preview

bone3deep1962-collabc1c5ac588ec4
diff --git a/template-library/nyt-graph/compositions/nyt-chart.html b/template-library/nyt-graph/compositions/nyt-chart.html
index 10f569b5..5e984a8d 100644
--- a/template-library/nyt-graph/compositions/nyt-chart.html
+++ b/template-library/nyt-graph/compositions/nyt-chart.html
@@ -1,12 +1,8 @@
<template id="nyt-chart-template">
<div data-composition-id="nyt-chart" data-width="1920" data-height="1080" data-duration="15">
- <!-- Google Fonts Import -->
-
-
- <link
- href="./../vendor/fonts/libre.css"
- rel="stylesheet"
- />
+ <!-- Link bundled font declarations directly for Studio preview preflight. -->
+ <link href="./../vendor/fonts/libre-baskerville.css" rel="stylesheet" />
+ <link href="./../vendor/fonts/libre-franklin.css" rel="stylesheet" />
<div class="chart-container">
<!-- Header Section -->
diff --git a/tests/npm-package.test.ts b/tests/npm-package.test.ts
index 4ff2001f..0b56495d 100644
--- a/tests/npm-package.test.ts
+++ b/tests/npm-package.test.ts
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
import { mkdtemp, readFile, readdir, rm, symlink, writeFile } from 'node:fs/promises';
import path from 'node:path';
import { tmpdir } from 'node:os';
+import { pathToFileURL } from 'node:url';
import { checkReleaseLocks, packageNpm } from '../scripts/package-npm.mjs';
import { extractArchive, runFile, sha256 } from '../scripts/runtime-assets.mjs';
import { protocolClient } from '../scripts/smoke-test-package.mjs';
@@ -16,6 +17,20 @@ async function verifyTrackingPolicy(application: string, mode: 'test' | 'stable'
assert.equal(result.passed, true); assert.equal(result.external_requests, 0);
}
+async function verifyBundledTemplates(application: string) {
+ const { copyTemplate, templates } = await import(pathToFileURL(path.join(application, 'template-library.ts')).href);
+ const directory = await mkdtemp(path.join(tmpdir(), 'motion-bundled-templates-'));
+ try {
+ for (const template of templates) {
+ const project = path.join(directory, template.id);
+ await copyTemplate(template.id, project, application);
+ // Match MCP preview preflight before Studio can rewrite the copied source.
+ const checked = JSON.parse(await runFile(process.execPath, [path.join(application, 'scripts/lint-project.mjs'), application, project]));
+ assert.equal(checked.errorCount, 0, `${template.id}: ${JSON.stringify(checked.findings)}`);
+ }
+ } finally { await rm(directory, { recursive: true, force: true }); }
+}
+
test('shared Agent instructions keep the release controls synchronized', async () => {
const section = async file => {
const text = await readFile(new URL(`../${file}`, import.meta.url), 'utf8');
@@ -82,6 +97,7 @@ test('test npm artifacts contain their application, locked manifest and no bundl
await assert.rejects(readdir(path.join(application, 'docs/readme/media')), { code: 'ENOENT' });
assert.equal((await json(path.join(application, 'package.json'))).version, version);
await verifyTrackingPolicy(application, 'test');
+ await verifyBundledTemplates(application);
assert.equal((await json(path.join(application, 'shared/template-config.json'))).environment, 'dev');
assert.equal((await json(path.join(application, '.codex-plugin/plugin.json'))).version, version);
assert.equal((await json(path.join(application, '.codex-plugin/plugin.json'))).description,
@@ -166,6 +182,7 @@ test('stable artifacts stage publication instead of replacing latest and retain
await runFile(process.execPath, [path.join(application, 'scripts/diagnostics.mjs'), '--data-dir', path.join(directory, 'missing-data'), '--output', diagnosticFile]);
assert.match(await runFile('unzip', ['-p', diagnosticFile, 'metadata.json']), /"version": "0\.6\.4"/);
await verifyTrackingPolicy(application, 'stable');
+ await verifyBundledTemplates(application);
assert.equal(metadata.version, '0.6.4'); assert.equal(metadata.private, false); assert.equal(metadata.publishConfig.tag, 'stage');
assert.equal((await json('package.json')).private, true);
assert.equal((await json('packages/npm/package.json')).private, true);