Skip to content

🎥 Make videos programmatically with React

Better grouping

Vlad Me02c4f033c66
diff --git a/packages/template-ai-video/cli/cli.ts b/packages/template-ai-video/cli/cli.ts
index 5ee7511680..1f666ecdb8 100644
--- a/packages/template-ai-video/cli/cli.ts
+++ b/packages/template-ai-video/cli/cli.ts
@@ -20,7 +20,7 @@ import {
StoryScript,
StoryWithImages,
Timeline,
-} from "../src/types";
+} from "../src/lib/types";
import { v4 as uuidv4 } from "uuid";
import * as fs from "fs";
import * as path from "path";
diff --git a/packages/template-ai-video/cli/timeline.ts b/packages/template-ai-video/cli/timeline.ts
index 3df93ce0b1..b6fe21f465 100644
--- a/packages/template-ai-video/cli/timeline.ts
+++ b/packages/template-ai-video/cli/timeline.ts
@@ -4,7 +4,7 @@ import type {
StoryMetadataWithDetails,
TextElement,
Timeline,
-} from "../src/types";
+} from "../src/lib/types";
export const createTimeLineFromStoryWithDetails = (
storyWithDetails: StoryMetadataWithDetails,
diff --git a/packages/template-ai-video/src/Root.tsx b/packages/template-ai-video/src/Root.tsx
index 503bace809..4225d409dc 100644
--- a/packages/template-ai-video/src/Root.tsx
+++ b/packages/template-ai-video/src/Root.tsx
@@ -4,10 +4,10 @@ import {
delayRender,
getInputProps,
} from "remotion";
-import { AIVideo, aiVideoSchema } from "./AIVideo";
+import { AIVideo, aiVideoSchema } from "./components/AIVideo";
import { useEffect, useState } from "react";
-import { FPS, WindowHeight, WindowWidth } from "./constants";
-import { getTimelinePath, loadTimelineFromFile } from "./utils";
+import { FPS, WindowHeight, WindowWidth } from "./lib/constants";
+import { getTimelinePath, loadTimelineFromFile } from "./lib/utils";
interface InputProps extends Record<string, unknown> {
projectDir?: string;
diff --git a/packages/template-ai-video/src/AIVideo.tsx b/packages/template-ai-video/src/components/AIVideo.tsx
similarity index 93%
rename from packages/template-ai-video/src/AIVideo.tsx
rename to packages/template-ai-video/src/components/AIVideo.tsx
index cdd7d39cd5..b7649de9e9 100644
--- a/packages/template-ai-video/src/AIVideo.tsx
+++ b/packages/template-ai-video/src/components/AIVideo.tsx
@@ -6,13 +6,17 @@ import {
useDelayRender,
} from "remotion";
import { z } from "zod";
-import { Timeline } from "./types";
-import { IntoFrameDuration, FPS } from "./constants";
+import { Timeline } from "../lib/types";
+import { IntoFrameDuration, FPS } from "../lib/constants";
import { loadFont } from "@remotion/google-fonts/Signika";
-import { Background } from "./components/Background";
-import Subtitle from "./components/Subtitle";
+import { Background } from "./Background";
+import Subtitle from "./Subtitle";
import { useEffect, useState } from "react";
-import { getAudioPath, getTimelinePath, loadTimelineFromFile } from "./utils";
+import {
+ getAudioPath,
+ getTimelinePath,
+ loadTimelineFromFile,
+} from "../lib/utils";
export const aiVideoSchema = z.object({
projectName: z.string().min(1),
diff --git a/packages/template-ai-video/src/components/Background.tsx b/packages/template-ai-video/src/components/Background.tsx
index 895ad702f7..b8da99bd8c 100644
--- a/packages/template-ai-video/src/components/Background.tsx
+++ b/packages/template-ai-video/src/components/Background.tsx
@@ -1,7 +1,7 @@
import { AbsoluteFill, Img, staticFile, useCurrentFrame } from "remotion";
-import { FPS, WindowHeight, WindowWidth } from "../constants";
-import { BackgroundElement } from "../types";
-import { getImagePath } from "../utils";
+import { FPS, WindowHeight, WindowWidth } from "../lib/constants";
+import { BackgroundElement } from "../lib/types";
+import { getImagePath } from "../lib/utils";
const EXTRA_SCALE = 0.2;
diff --git a/packages/template-ai-video/src/constants.ts b/packages/template-ai-video/src/lib/constants.ts
similarity index 100%
rename from packages/template-ai-video/src/constants.ts
rename to packages/template-ai-video/src/lib/constants.ts
diff --git a/packages/template-ai-video/src/types.ts b/packages/template-ai-video/src/lib/types.ts
similarity index 100%
rename from packages/template-ai-video/src/types.ts
rename to packages/template-ai-video/src/lib/types.ts
diff --git a/packages/template-ai-video/src/utils.ts b/packages/template-ai-video/src/lib/utils.ts
similarity index 100%
rename from packages/template-ai-video/src/utils.ts
rename to packages/template-ai-video/src/lib/utils.ts