| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.listCompositionsCommand = void 0; | |
| const renderer_1 = require("@remotion/renderer"); | |
| const client_1 = require("@remotion/renderer/client"); | |
| const no_react_1 = require("remotion/no-react"); | |
| const browser_download_bar_1 = require("./browser-download-bar"); | |
| const cleanup_before_quit_1 = require("./cleanup-before-quit"); | |
| const preview_server_1 = require("./config/preview-server"); | |
| const entry_point_1 = require("./entry-point"); | |
| const get_cli_options_1 = require("./get-cli-options"); | |
| const log_1 = require("./log"); | |
| const parsed_cli_1 = require("./parsed-cli"); | |
| const print_compositions_1 = require("./print-compositions"); | |
| const setup_cache_1 = require("./setup-cache"); | |
| const { enableMultiprocessOnLinuxOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, glOption, headlessOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, publicPathOption, publicDirOption, chromeModeOption, audioLatencyHintOption, mediaCacheSizeInBytesOption, preferredEffectBackendOption, darkModeOption, askAIOption, keyboardShortcutsOption, rspackOption, browserExecutableOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, bundleCacheOption, } = client_1.BrowserSafeApis.options; | |
| const listCompositionsCommand = async (remotionRoot, args, logLevel) => { | |
| const { file, reason } = (0, entry_point_1.findEntryPoint)({ | |
| args, | |
| remotionRoot, | |
| logLevel, | |
| allowDirectory: true, | |
| }); | |
| if (!file) { | |
| log_1.Log.error({ indent: false, logLevel }, 'The `compositions` command requires you to specify a entry point. For example'); | |
| log_1.Log.error({ indent: false, logLevel }, ' npx remotion compositions src/index.ts'); | |
| log_1.Log.error({ indent: false, logLevel }, 'See https://www.remotion.dev/docs/register-root for more information.'); | |
| process.exit(1); | |
| } | |
| log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', file, 'reason:', reason); | |
| const { envVariables, inputProps } = (0, get_cli_options_1.getCliOptions)({ | |
| isStill: false, | |
| logLevel, | |
| indent: false, | |
| }); | |
| const browserExecutable = browserExecutableOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const userAgent = userAgentOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; | |
| const disableWebSecurity = disableWebSecurityOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const publicPath = publicPathOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; | |
| const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const binariesDirectory = binariesDirectoryOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const darkMode = darkModeOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; | |
| const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const publicDir = publicDirOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; | |
| const chromeMode = chromeModeOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const audioLatencyHint = audioLatencyHintOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const mediaCacheSizeInBytes = mediaCacheSizeInBytesOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const preferredEffectBackend = preferredEffectBackendOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const askAIEnabled = askAIOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; | |
| const chromiumOptions = { | |
| disableWebSecurity, | |
| enableMultiProcessOnLinux: enableMultiprocessOnLinuxOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value, | |
| gl: glOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value, | |
| headless: headlessOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value, | |
| ignoreCertificateErrors, | |
| userAgent, | |
| darkMode, | |
| }; | |
| const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const rspack = rspackOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; | |
| const shouldCache = bundleCacheOption.getValue({ | |
| commandLine: parsed_cli_1.parsedCli, | |
| }).value; | |
| const { urlOrBundle: bundled, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({ | |
| remotionRoot, | |
| fullPath: file, | |
| publicDir, | |
| onProgress: () => undefined, | |
| indentOutput: false, | |
| logLevel, | |
| onDirectoryCreated: (dir) => { | |
| (0, cleanup_before_quit_1.registerCleanupJob)(`Delete ${dir}`, () => renderer_1.RenderInternals.deleteDirectory(dir)); | |
| }, | |
| quietProgress: false, | |
| quietFlag: (0, parsed_cli_1.quietFlagProvided)(), | |
| outDir: null, | |
| // Not needed for compositions | |
| gitSource: null, | |
| bufferStateDelayInMilliseconds: null, | |
| maxTimelineTracks: null, | |
| publicPath, | |
| audioLatencyHint, | |
| askAIEnabled, | |
| keyboardShortcutsEnabled, | |
| rspack, | |
| shouldCache, | |
| bundlerOverride: null, | |
| rspackOverride: null, | |
| webpackOverride: null, | |
| }); | |
| (0, cleanup_before_quit_1.registerCleanupJob)(`Cleanup bundle`, () => cleanupBundle()); | |
| const compositions = await renderer_1.RenderInternals.internalGetCompositions({ | |
| serveUrlOrWebpackUrl: bundled, | |
| browserExecutable, | |
| chromiumOptions, | |
| envVariables, | |
| serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({ | |
| data: inputProps, | |
| staticBase: null, | |
| indent: undefined, | |
| }).serializedString, | |
| timeoutInMilliseconds, | |
| port: (0, preview_server_1.getRendererPortFromConfigFileAndCliFlag)(), | |
| indent: false, | |
| onBrowserLog: null, | |
| puppeteerInstance: undefined, | |
| logLevel, | |
| server: undefined, | |
| offthreadVideoCacheSizeInBytes, | |
| offthreadVideoThreads, | |
| binariesDirectory, | |
| onBrowserDownload: (0, browser_download_bar_1.defaultBrowserDownloadProgress)({ | |
| indent: false, | |
| logLevel, | |
| quiet: (0, parsed_cli_1.quietFlagProvided)(), | |
| onProgress: () => undefined, | |
| }), | |
| chromeMode, | |
| mediaCacheSizeInBytes, | |
| preferredEffectBackend, | |
| onLog: renderer_1.RenderInternals.defaultOnLog, | |
| }); | |
| (0, print_compositions_1.printCompositions)(compositions, logLevel); | |
| }; | |
| exports.listCompositionsCommand = listCompositionsCommand; | |
Xet Storage Details
- Size:
- 7.21 kB
- Xet hash:
- d53b8298d21039b50e48b373c54d7e7399f833a14d278421b99304f499e248a1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.