🎥 Make videos programmatically with React
support config file
Hunain Ahmed2e7a421e0952
diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.tsindex 44dc6f4f7e..15dbcfb461 100644--- a/packages/cli/src/config/index.ts+++ b/packages/cli/src/config/index.ts@@ -90,6 +90,7 @@ import {setWebpackPollingInMilliseconds,} from './webpack-poll';import {getWidth, overrideWidth} from './width';+import { AskAIOption } from '@remotion/renderer/src/options/disable-ask-ai';export type {Concurrency, WebpackConfiguration, WebpackOverrideFn};@@ -492,6 +493,13 @@ declare global {disallowParallelEncoding: boolean,) => void;+ /**+ * disables the Ask AI Modal in Studio+ */+ readonly setAskAIEnabled: (+ AskAIEnabled: boolean,+ ) => void;+/*** Removes the --single-process flag that gets passed toChromium on Linux by default. This will make the render faster because@@ -722,6 +730,7 @@ export const Config: FlatConfig = {setImageSequencePattern: imageSequencePatternOption.setConfig,setHardwareAcceleration: hardwareAccelerationOption.setConfig,setEnableCrossSiteIsolation: enableCrossSiteIsolationOption.setConfig,+ setAskAIEnabled: AskAIOption.setConfig,setPublicLicenseKey: publicLicenseKeyOption.setConfig,};diff --git a/packages/cli/src/studio.ts b/packages/cli/src/studio.tsindex b372af5e24..0a6a1a9946 100644--- a/packages/cli/src/studio.ts+++ b/packages/cli/src/studio.ts@@ -36,7 +36,7 @@ const {publicDirOption,disableGitSourceOption,enableCrossSiteIsolationOption,- disableAskAIOption+ AskAIOption} = BrowserSafeApis.options;export const studioCommand = async (@@ -128,7 +128,7 @@ export const studioCommand = async (commandLine: parsedCli,}).value;- const disableAskAIModal = disableAskAIOption.getValue({+ const AskAIEnabled = AskAIOption.getValue({commandLine: parsedCli}).value@@ -170,7 +170,7 @@ export const studioCommand = async (forceIPv4: parsedCli.ipv4,audioLatencyHint: parsedCli['audio-latency-hint'],enableCrossSiteIsolation,- AskAIEnabled: !disableAskAIModal+ AskAIEnabled});// If the server is restarted through the UI, let's do the whole thing again.diff --git a/packages/renderer/src/options/disable-ask-ai.tsx b/packages/renderer/src/options/ask-ai.tsxsimilarity index 67%rename from packages/renderer/src/options/disable-ask-ai.tsxrename to packages/renderer/src/options/ask-ai.tsxindex c760da6adc..23512e37fc 100644--- a/packages/renderer/src/options/disable-ask-ai.tsx+++ b/packages/renderer/src/options/ask-ai.tsx@@ -1,19 +1,19 @@import type {AnyRemotionOption} from './option';-let disableAskAI = false;+let AskAIEnabled = true;const cliFlag = 'disable-ask-ai' as const;-export const disableAskAIOption = {- name: 'Disable the Ask AI option',+export const AskAIOption = {+ name: 'Disable or Enable the Ask AI option',cliFlag,description: () => (<>- If the Cmd + I shortcut of the Ask AI modal conflicts with your studio, you can disable it.+ If the Cmd + I shortcut of the Ask AI modal conflicts with your studio, you can disable it using this.</>),ssrName: null,- docLink: 'https://www.remotion.dev/docs/config#setdisabledaskai',+ docLink: 'https://www.remotion.dev/docs/config#setaskaienabled',type: false as boolean,getValue: ({commandLine}) => {if (commandLine[cliFlag] !== undefined) {@@ -24,11 +24,11 @@ export const disableAskAIOption = {}return {- value: disableAskAI,+ value: AskAIEnabled,source: 'config',};},setConfig(value) {- disableAskAI = value;+ AskAIEnabled = value;},} satisfies AnyRemotionOption<boolean>;diff --git a/packages/renderer/src/options/index.tsx b/packages/renderer/src/options/index.tsxindex 0bf55c76bb..9040658016 100644--- a/packages/renderer/src/options/index.tsx+++ b/packages/renderer/src/options/index.tsx@@ -9,7 +9,7 @@ import {crfOption} from './crf';import {enableCrossSiteIsolationOption} from './cross-site-isolation';import {darkModeOption} from './dark-mode';import {deleteAfterOption} from './delete-after';-import { disableAskAIOption } from './disable-ask-ai';+import {AskAIOption} from './ask-ai';import {disableGitSourceOption} from './disable-git-source';import {disallowParallelEncodingOption} from './disallow-parallel-encoding';import {enableLambdaInsights} from './enable-lambda-insights';@@ -100,7 +100,7 @@ export const allOptions = {mediaCacheSizeInBytesOption,darkModeOption,publicLicenseKeyOption,- disableAskAIOption+ AskAIOption};export type AvailableOptions = keyof typeof allOptions;