Skip to content

🎥 Make videos programmatically with React

rename to rootFile

Jonny Burger16545b213722
diff --git a/packages/studio-server/src/preview-server/routes/can-update-default-props.ts b/packages/studio-server/src/preview-server/routes/can-update-default-props.ts
index bcdee77221..c9b79971aa 100644
--- a/packages/studio-server/src/preview-server/routes/can-update-default-props.ts
+++ b/packages/studio-server/src/preview-server/routes/can-update-default-props.ts
@@ -24,15 +24,15 @@ export const canUpdateDefaultPropsHandler: ApiHandler<
> = async ({input: {compositionId}, remotionRoot}) => {
try {
const projectInfo = await getProjectInfo(remotionRoot);
- if (!projectInfo.videoFile) {
+ if (!projectInfo.rootFile) {
throw new Error('Cannot find root file in project');
}
- checkIfTypeScriptFile(projectInfo.videoFile);
+ checkIfTypeScriptFile(projectInfo.rootFile);
await updateDefaultProps({
compositionId,
- input: readFileSync(projectInfo.videoFile, 'utf-8'),
+ input: readFileSync(projectInfo.rootFile, 'utf-8'),
newDefaultProps: {},
enumPaths: [],
});
diff --git a/packages/studio-server/src/watch-root-file.ts b/packages/studio-server/src/watch-root-file.ts
index e3032de88d..d0a6274b62 100644
--- a/packages/studio-server/src/watch-root-file.ts
+++ b/packages/studio-server/src/watch-root-file.ts
@@ -4,12 +4,12 @@ import {getProjectInfo} from './preview-server/project-info';
export const watchRootFile = async (remotionRoot: string) => {
const rootFile = await getProjectInfo(remotionRoot);
- if (!rootFile.videoFile) {
+ if (!rootFile.rootFile) {
return;
}
installFileWatcher({
- file: rootFile.videoFile,
+ file: rootFile.rootFile,
onChange: () => {
// Don't care if changed, added or deleted - should trigger a refetch in the frontend all the time
waitForLiveEventsListener().then((listener) => {
diff --git a/packages/studio-shared/src/project-info.ts b/packages/studio-shared/src/project-info.ts
index dd3254f9aa..2c5c74cfdc 100644
--- a/packages/studio-shared/src/project-info.ts
+++ b/packages/studio-shared/src/project-info.ts
@@ -1,4 +1,4 @@
export type ProjectInfo = {
- videoFile: string | null;
- relativeVideoFile: string | null;
+ rootFile: string | null;
+ relativeRootFile: string | null;
};
diff --git a/packages/studio/src/components/NewComposition/CopyHint.tsx b/packages/studio/src/components/NewComposition/CopyHint.tsx
index 33be0a3f99..735f75c4d7 100644
--- a/packages/studio/src/components/NewComposition/CopyHint.tsx
+++ b/packages/studio/src/components/NewComposition/CopyHint.tsx
@@ -23,15 +23,15 @@ export const CopyHint: React.FC = () => {
});
}, []);
- if (!projectInfo?.videoFile) {
+ if (!projectInfo?.rootFile) {
return null;
}
return (
<div style={style}>
Copy this into <br /> your{' '}
- <span style={style} title={projectInfo.videoFile as string}>
- {projectInfo.relativeVideoFile}
+ <span style={style} title={projectInfo.rootFile as string}>
+ {projectInfo.relativeRootFile}
</span>{' '}
file.
</div>