Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
refactor(cli): move templates to templates/ for remote fetching (#161)
James Russo6b1463fd5bf8
diff --git a/scripts/generate-template-previews.ts b/scripts/generate-template-previews.tsindex 5d88de6d6e..0d65381c33 100644--- a/scripts/generate-template-previews.ts+++ b/scripts/generate-template-previews.ts@@ -39,7 +39,7 @@ import {const scriptDir = dirname(fileURLToPath(import.meta.url));const repoRoot = resolve(scriptDir, "..");const bundledTemplatesDir = resolve(repoRoot, "packages/cli/src/templates");-const examplesDir = resolve(repoRoot, "examples");+const remoteTemplatesDir = resolve(repoRoot, "templates");const outputDir = resolve(repoRoot, "docs/images/templates");if (!process.env.PRODUCER_HYPERFRAME_MANIFEST_PATH) {@@ -86,7 +86,7 @@ function parseArgs(): { only: string | null; skipVideo: boolean } {}function resolveTemplateDir(templateId: string): string | null {- for (const base of [bundledTemplatesDir, examplesDir]) {+ for (const base of [bundledTemplatesDir, remoteTemplatesDir]) {const dir = join(base, templateId);if (existsSync(join(dir, "index.html"))) return dir;}@@ -97,7 +97,7 @@ function discoverTemplates(only: string | null): string[] {const seen = new Set<string>();const all: string[] = [];- for (const dir of [bundledTemplatesDir, examplesDir]) {+ for (const dir of [bundledTemplatesDir, remoteTemplatesDir]) {if (!existsSync(dir)) continue;for (const e of readdirSync(dir, { withFileTypes: true })) {if (diff --git a/packages/cli/src/templates/decision-tree/compositions/decision_tree.html b/templates/decision-tree/compositions/decision_tree.htmlsimilarity index 100%rename from packages/cli/src/templates/decision-tree/compositions/decision_tree.htmlrename to templates/decision-tree/compositions/decision_tree.htmldiff --git a/packages/cli/src/templates/decision-tree/index.html b/templates/decision-tree/index.htmlsimilarity index 100%rename from packages/cli/src/templates/decision-tree/index.htmlrename to templates/decision-tree/index.htmldiff --git a/packages/cli/src/templates/kinetic-type/compositions/main-graphics.html b/templates/kinetic-type/compositions/main-graphics.htmlsimilarity index 100%rename from packages/cli/src/templates/kinetic-type/compositions/main-graphics.htmlrename to templates/kinetic-type/compositions/main-graphics.htmldiff --git a/packages/cli/src/templates/kinetic-type/index.html b/templates/kinetic-type/index.htmlsimilarity index 100%rename from packages/cli/src/templates/kinetic-type/index.htmlrename to templates/kinetic-type/index.htmldiff --git a/packages/cli/src/templates/nyt-graph/compositions/nyt-chart.html b/templates/nyt-graph/compositions/nyt-chart.htmlsimilarity index 100%rename from packages/cli/src/templates/nyt-graph/compositions/nyt-chart.htmlrename to templates/nyt-graph/compositions/nyt-chart.htmldiff --git a/packages/cli/src/templates/nyt-graph/index.html b/templates/nyt-graph/index.htmlsimilarity index 100%rename from packages/cli/src/templates/nyt-graph/index.htmlrename to templates/nyt-graph/index.htmldiff --git a/packages/cli/src/templates/play-mode/compositions/captions.html b/templates/play-mode/compositions/captions.htmlsimilarity index 100%rename from packages/cli/src/templates/play-mode/compositions/captions.htmlrename to templates/play-mode/compositions/captions.htmldiff --git a/packages/cli/src/templates/play-mode/compositions/intro.html b/templates/play-mode/compositions/intro.htmlsimilarity index 100%rename from packages/cli/src/templates/play-mode/compositions/intro.htmlrename to templates/play-mode/compositions/intro.htmldiff --git a/packages/cli/src/templates/play-mode/compositions/stats.html b/templates/play-mode/compositions/stats.htmlsimilarity index 100%rename from packages/cli/src/templates/play-mode/compositions/stats.htmlrename to templates/play-mode/compositions/stats.htmldiff --git a/packages/cli/src/templates/play-mode/index.html b/templates/play-mode/index.htmlsimilarity index 100%rename from packages/cli/src/templates/play-mode/index.htmlrename to templates/play-mode/index.htmldiff --git a/packages/cli/src/templates/product-promo/assets/figma-cursors.svg b/templates/product-promo/assets/figma-cursors.svgsimilarity index 100%rename from packages/cli/src/templates/product-promo/assets/figma-cursors.svgrename to templates/product-promo/assets/figma-cursors.svgdiff --git a/packages/cli/src/templates/product-promo/assets/figma-logo-pieces.svg b/templates/product-promo/assets/figma-logo-pieces.svgsimilarity index 100%rename from packages/cli/src/templates/product-promo/assets/figma-logo-pieces.svgrename to templates/product-promo/assets/figma-logo-pieces.svgdiff --git a/packages/cli/src/templates/product-promo/assets/figma-logo-pills.svg b/templates/product-promo/assets/figma-logo-pills.svgsimilarity index 100%rename from packages/cli/src/templates/product-promo/assets/figma-logo-pills.svgrename to templates/product-promo/assets/figma-logo-pills.svgdiff --git a/packages/cli/src/templates/product-promo/compositions/scene1-logo-intro.html b/templates/product-promo/compositions/scene1-logo-intro.htmlsimilarity index 100%rename from packages/cli/src/templates/product-promo/compositions/scene1-logo-intro.htmlrename to templates/product-promo/compositions/scene1-logo-intro.htmldiff --git a/packages/cli/src/templates/product-promo/compositions/scene2-4-canvas.html b/templates/product-promo/compositions/scene2-4-canvas.htmlsimilarity index 100%rename from packages/cli/src/templates/product-promo/compositions/scene2-4-canvas.htmlrename to templates/product-promo/compositions/scene2-4-canvas.htmldiff --git a/packages/cli/src/templates/product-promo/compositions/scene5-logo-outro.html b/templates/product-promo/compositions/scene5-logo-outro.htmlsimilarity index 100%rename from packages/cli/src/templates/product-promo/compositions/scene5-logo-outro.htmlrename to templates/product-promo/compositions/scene5-logo-outro.htmldiff --git a/packages/cli/src/templates/product-promo/index.html b/templates/product-promo/index.htmlsimilarity index 100%rename from packages/cli/src/templates/product-promo/index.htmlrename to templates/product-promo/index.htmldiff --git a/packages/cli/src/templates/swiss-grid/assets/swiss-grid.svg b/templates/swiss-grid/assets/swiss-grid.svgsimilarity index 100%rename from packages/cli/src/templates/swiss-grid/assets/swiss-grid.svgrename to templates/swiss-grid/assets/swiss-grid.svgdiff --git a/packages/cli/src/templates/swiss-grid/compositions/captions.html b/templates/swiss-grid/compositions/captions.htmlsimilarity index 100%rename from packages/cli/src/templates/swiss-grid/compositions/captions.htmlrename to templates/swiss-grid/compositions/captions.htmldiff --git a/packages/cli/src/templates/swiss-grid/compositions/graphics.html b/templates/swiss-grid/compositions/graphics.htmlsimilarity index 100%rename from packages/cli/src/templates/swiss-grid/compositions/graphics.htmlrename to templates/swiss-grid/compositions/graphics.htmldiff --git a/packages/cli/src/templates/swiss-grid/compositions/intro.html b/templates/swiss-grid/compositions/intro.htmlsimilarity index 100%rename from packages/cli/src/templates/swiss-grid/compositions/intro.htmlrename to templates/swiss-grid/compositions/intro.htmldiff --git a/packages/cli/src/templates/swiss-grid/index.html b/templates/swiss-grid/index.htmlsimilarity index 100%rename from packages/cli/src/templates/swiss-grid/index.htmlrename to templates/swiss-grid/index.htmldiff --git a/templates/templates.json b/templates/templates.jsonnew file mode 100644index 0000000000..9f32fb3900--- /dev/null+++ b/templates/templates.json@@ -0,0 +1,58 @@+{+ "templates": [+ {+ "id": "blank",+ "label": "Blank",+ "hint": "Empty composition — just the scaffolding",+ "bundled": true+ },+ {+ "id": "warm-grain",+ "label": "Warm Grain",+ "hint": "Cream aesthetic with grain texture",+ "bundled": false+ },+ {+ "id": "play-mode",+ "label": "Play Mode",+ "hint": "Playful elastic animations",+ "bundled": false+ },+ {+ "id": "swiss-grid",+ "label": "Swiss Grid",+ "hint": "Structured grid layout",+ "bundled": false+ },+ {+ "id": "vignelli",+ "label": "Vignelli",+ "hint": "Bold typography with red accents",+ "bundled": false+ },+ {+ "id": "decision-tree",+ "label": "Decision Tree",+ "hint": "Animated flowchart with branching paths",+ "bundled": false+ },+ {+ "id": "kinetic-type",+ "label": "Kinetic Type",+ "hint": "Bold kinetic typography promo",+ "bundled": false+ },+ {+ "id": "product-promo",+ "label": "Product Promo",+ "hint": "Multi-scene product showcase with SVG assets",+ "bundled": false+ },+ {+ "id": "nyt-graph",+ "label": "NYT Graph",+ "hint": "Animated data chart in print editorial style",+ "bundled": false+ }+ ]+}diff --git a/packages/cli/src/templates/vignelli/compositions/captions.html b/templates/vignelli/compositions/captions.htmlsimilarity index 100%rename from packages/cli/src/templates/vignelli/compositions/captions.htmlrename to templates/vignelli/compositions/captions.htmldiff --git a/packages/cli/src/templates/vignelli/compositions/overlays.html b/templates/vignelli/compositions/overlays.htmlsimilarity index 100%rename from packages/cli/src/templates/vignelli/compositions/overlays.htmlrename to templates/vignelli/compositions/overlays.htmldiff --git a/packages/cli/src/templates/vignelli/index.html b/templates/vignelli/index.htmlsimilarity index 100%rename from packages/cli/src/templates/vignelli/index.htmlrename to templates/vignelli/index.htmldiff --git a/packages/cli/src/templates/warm-grain/compositions/captions.html b/templates/warm-grain/compositions/captions.htmlsimilarity index 100%rename from packages/cli/src/templates/warm-grain/compositions/captions.htmlrename to templates/warm-grain/compositions/captions.htmldiff --git a/packages/cli/src/templates/warm-grain/compositions/graphics.html b/templates/warm-grain/compositions/graphics.htmlsimilarity index 100%rename from packages/cli/src/templates/warm-grain/compositions/graphics.htmlrename to templates/warm-grain/compositions/graphics.htmldiff --git a/packages/cli/src/templates/warm-grain/compositions/intro.html b/templates/warm-grain/compositions/intro.htmlsimilarity index 100%rename from packages/cli/src/templates/warm-grain/compositions/intro.htmlrename to templates/warm-grain/compositions/intro.htmldiff --git a/packages/cli/src/templates/warm-grain/index.html b/templates/warm-grain/index.htmlsimilarity index 100%rename from packages/cli/src/templates/warm-grain/index.htmlrename to templates/warm-grain/index.html