@remotion/cli 4.0.0-alpha.217 → 4.0.0-alpha10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/dist/benchmark.js +11 -6
  2. package/dist/better-opn/index.js +3 -3
  3. package/dist/chalk/index.d.ts +45 -54
  4. package/dist/chalk/index.js +2 -135
  5. package/dist/codemods/stringify-with-path.d.ts +5 -0
  6. package/dist/codemods/stringify-with-path.js +44 -0
  7. package/dist/codemods/update-default-props.d.ts +4 -2
  8. package/dist/codemods/update-default-props.js +3 -18
  9. package/dist/color-math.d.ts +2 -2
  10. package/dist/color-math.js +5 -3
  11. package/dist/compositions.js +1 -0
  12. package/dist/config/image-format.d.ts +1 -1
  13. package/dist/config/index.d.ts +2 -2
  14. package/dist/config/log.d.ts +1 -3
  15. package/dist/config/log.js +2 -9
  16. package/dist/convert-entry-point-to-serve-url.js +2 -2
  17. package/dist/download-progress.d.ts +1 -1
  18. package/dist/download-progress.js +1 -4
  19. package/dist/editor/components/CanvasOrLoading.d.ts +5 -0
  20. package/dist/editor/components/CanvasOrLoading.js +66 -0
  21. package/dist/editor/components/CheckboardToggle.js +2 -1
  22. package/dist/editor/components/CompositionSelectorItem.js +2 -2
  23. package/dist/editor/components/CurrentCompositionSideEffects.js +3 -3
  24. package/dist/editor/components/InitialCompositionLoader.js +1 -1
  25. package/dist/editor/components/InlineAction.d.ts +6 -4
  26. package/dist/editor/components/InlineAction.js +7 -8
  27. package/dist/editor/components/LoopToggle.js +2 -1
  28. package/dist/editor/components/Menu/MenuItem.js +1 -1
  29. package/dist/editor/components/Menu/SubMenu.js +1 -1
  30. package/dist/editor/components/Menu/styles.d.ts +1 -0
  31. package/dist/editor/components/Menu/styles.js +6 -1
  32. package/dist/editor/components/MenuBuildIndicator.js +20 -1
  33. package/dist/editor/components/MenuToolbar.js +15 -3
  34. package/dist/editor/components/Modals.js +2 -2
  35. package/dist/editor/components/NewComposition/ComboBox.js +20 -5
  36. package/dist/editor/components/NewComposition/InputDragger.js +3 -2
  37. package/dist/editor/components/NewComposition/MenuContent.d.ts +1 -0
  38. package/dist/editor/components/NewComposition/MenuContent.js +12 -4
  39. package/dist/editor/components/Notifications/ServerDisconnected.js +2 -2
  40. package/dist/editor/components/OpenEditorButton.d.ts +2 -0
  41. package/dist/editor/components/OpenEditorButton.js +52 -0
  42. package/dist/editor/components/PlayPause.js +4 -2
  43. package/dist/editor/components/PreviewToolbar.js +2 -2
  44. package/dist/editor/components/QuickSwitcher/algolia-search.js +1 -1
  45. package/dist/editor/components/RenderButton.d.ts +1 -5
  46. package/dist/editor/components/RenderButton.js +48 -21
  47. package/dist/editor/components/RenderModal/CliCopyButton.js +51 -14
  48. package/dist/editor/components/RenderModal/CrfSetting.d.ts +0 -1
  49. package/dist/editor/components/RenderModal/CrfSetting.js +0 -1
  50. package/dist/editor/components/RenderModal/DataEditor.d.ts +21 -0
  51. package/dist/editor/components/RenderModal/DataEditor.js +287 -0
  52. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +3 -2
  53. package/dist/editor/components/RenderModal/InfoBubble.js +2 -1
  54. package/dist/editor/components/RenderModal/InfoTooltip.d.ts +1 -0
  55. package/dist/editor/components/RenderModal/InfoTooltip.js +6 -5
  56. package/dist/editor/components/RenderModal/InlineEyeIcon.js +6 -3
  57. package/dist/editor/components/RenderModal/InlineRemoveButton.js +6 -1
  58. package/dist/editor/components/RenderModal/MutedSetting.js +3 -2
  59. package/dist/editor/components/RenderModal/OptionExplainer.js +14 -3
  60. package/dist/editor/components/RenderModal/RenderModal.d.ts +7 -3
  61. package/dist/editor/components/RenderModal/RenderModal.js +108 -49
  62. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +0 -2
  63. package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
  64. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +3 -2
  65. package/dist/editor/components/RenderModal/RenderModalBasic.js +4 -3
  66. package/dist/editor/components/RenderModal/RenderModalData.d.ts +16 -4
  67. package/dist/editor/components/RenderModal/RenderModalData.js +109 -42
  68. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +14 -0
  69. package/dist/editor/components/RenderModal/{RenderModalJSONInputPropsEditor.js → RenderModalJSONPropsEditor.js} +51 -30
  70. package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +2 -2
  71. package/dist/editor/components/RenderModal/RenderModalPicture.js +2 -4
  72. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +6 -4
  73. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +4 -4
  74. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +4 -0
  75. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +15 -6
  76. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
  77. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +5 -4
  78. package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.js +6 -1
  79. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.d.ts +1 -0
  80. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +7 -2
  81. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +5 -2
  82. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +19 -29
  83. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +5 -2
  84. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +4 -4
  85. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +5 -2
  86. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +7 -7
  87. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +5 -2
  88. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +23 -66
  89. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +5 -2
  90. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +13 -21
  91. package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.d.ts +17 -0
  92. package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.js +10 -0
  93. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +4 -2
  94. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +20 -19
  95. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +4 -2
  96. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +12 -26
  97. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +1 -0
  98. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -2
  99. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +5 -2
  100. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +2 -2
  101. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +5 -2
  102. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +16 -32
  103. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +7 -4
  104. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +18 -11
  105. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +5 -2
  106. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +2 -2
  107. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +5 -2
  108. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +44 -11
  109. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +17 -0
  110. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +59 -0
  111. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +5 -2
  112. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +12 -23
  113. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +5 -2
  114. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +32 -21
  115. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +5 -2
  116. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +6 -6
  117. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -2
  118. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +22 -22
  119. package/dist/editor/components/RenderModal/SchemaEditor/deep-equal.d.ts +1 -0
  120. package/dist/editor/components/RenderModal/SchemaEditor/deep-equal.js +27 -0
  121. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +3 -0
  122. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.js +126 -0
  123. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +14 -0
  124. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +42 -0
  125. package/dist/editor/components/RenderModal/SchemaEditor/local-state.d.ts +16 -0
  126. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +38 -0
  127. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +9 -1
  128. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +42 -8
  129. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  130. package/dist/editor/components/RenderModal/layout.js +3 -0
  131. package/dist/editor/components/RenderModal/out-name-checker.js +1 -11
  132. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +5 -1
  133. package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +5 -1
  134. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +5 -1
  135. package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +5 -1
  136. package/dist/editor/components/RenderQueue/actions.d.ts +4 -3
  137. package/dist/editor/components/RenderQueue/actions.js +8 -3
  138. package/dist/editor/components/RenderQueue/index.js +9 -2
  139. package/dist/editor/components/RightPanel.js +8 -5
  140. package/dist/editor/components/SidebarCollapserControls.js +22 -9
  141. package/dist/editor/components/SidebarRenderButton.d.ts +6 -0
  142. package/dist/editor/components/{RenderToolbarIcon.js → SidebarRenderButton.js} +27 -41
  143. package/dist/editor/components/Spinner.d.ts +5 -0
  144. package/dist/editor/components/Spinner.js +41 -0
  145. package/dist/editor/components/Tabs/index.js +12 -14
  146. package/dist/editor/components/Timeline/Timeline.js +3 -1
  147. package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.js +4 -3
  148. package/dist/editor/components/Timeline/TimelineSequence.js +8 -6
  149. package/dist/editor/components/TimelineInOutToggle.js +2 -4
  150. package/dist/editor/components/TopPanel.js +2 -2
  151. package/dist/editor/components/UpdateCheck.js +2 -1
  152. package/dist/editor/components/get-zod-if-possible.d.ts +3 -3
  153. package/dist/editor/components/get-zod-if-possible.js +11 -11
  154. package/dist/editor/helpers/calculate-timeline.js +1 -1
  155. package/dist/editor/helpers/client-id.d.ts +2 -2
  156. package/dist/editor/helpers/client-id.js +5 -5
  157. package/dist/editor/helpers/colors.d.ts +4 -2
  158. package/dist/editor/helpers/colors.js +4 -2
  159. package/dist/editor/helpers/get-timeline-sequence-layout.d.ts +2 -2
  160. package/dist/editor/helpers/is-composition-still.d.ts +3 -2
  161. package/dist/editor/helpers/is-current-selected-still.js +3 -4
  162. package/dist/editor/helpers/use-file-existence.js +1 -1
  163. package/dist/editor/helpers/use-menu-structure.js +1 -1
  164. package/dist/editor/icons/media-volume.js +2 -1
  165. package/dist/editor/icons/render.d.ts +1 -0
  166. package/dist/editor/icons/render.js +1 -1
  167. package/dist/editor/state/modals.d.ts +3 -1
  168. package/dist/entry-point.js +17 -17
  169. package/dist/event-source-events.d.ts +2 -0
  170. package/dist/event-source.js +2 -2
  171. package/dist/ffmpeg.js +14 -5
  172. package/dist/file-watcher.js +5 -5
  173. package/dist/get-cli-options.d.ts +3 -3
  174. package/dist/get-cli-options.js +4 -4
  175. package/dist/get-composition-id.d.ts +14 -2
  176. package/dist/get-composition-id.js +32 -8
  177. package/dist/get-composition-with-dimension-override.d.ts +13 -2
  178. package/dist/get-composition-with-dimension-override.js +12 -2
  179. package/dist/get-config-file-name.js +6 -6
  180. package/dist/get-env.js +10 -10
  181. package/dist/get-filename.js +1 -0
  182. package/dist/get-input-props.d.ts +1 -1
  183. package/dist/get-input-props.js +9 -9
  184. package/dist/get-network-address.js +2 -2
  185. package/dist/handle-common-errors.d.ts +2 -1
  186. package/dist/handle-common-errors.js +2 -2
  187. package/dist/index.d.ts +41 -19
  188. package/dist/index.js +9 -6
  189. package/dist/list-of-remotion-packages.js +2 -1
  190. package/dist/load-config.js +8 -8
  191. package/dist/log.d.ts +5 -5
  192. package/dist/log.js +3 -42
  193. package/dist/parse-command-line.d.ts +1 -0
  194. package/dist/preview-server/api-types.d.ts +3 -3
  195. package/dist/preview-server/dev-middleware/compatible-api.d.ts +2 -2
  196. package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
  197. package/dist/preview-server/dev-middleware/middleware.js +7 -7
  198. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  199. package/dist/preview-server/dev-middleware/setup-hooks.js +2 -2
  200. package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.js +5 -5
  201. package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.js +17 -17
  202. package/dist/preview-server/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.d.ts +2 -0
  203. package/dist/preview-server/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +18 -0
  204. package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +30 -12
  205. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.d.ts +4 -0
  206. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.js +5 -2
  207. package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.d.ts +4 -0
  208. package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.js +5 -5
  209. package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.d.ts +1 -0
  210. package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +4 -3
  211. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +2 -1
  212. package/dist/preview-server/error-overlay/remotion-overlay/Overlay.js +1 -1
  213. package/dist/preview-server/error-overlay/remotion-overlay/Retry.d.ts +4 -0
  214. package/dist/preview-server/error-overlay/remotion-overlay/Retry.js +9 -0
  215. package/dist/preview-server/file-existence-watchers.js +3 -3
  216. package/dist/preview-server/get-absolute-public-dir.js +3 -3
  217. package/dist/preview-server/get-package-manager.js +3 -3
  218. package/dist/preview-server/handler.d.ts +1 -1
  219. package/dist/preview-server/hot-middleware/index.d.ts +1 -1
  220. package/dist/preview-server/hot-middleware/index.js +2 -2
  221. package/dist/preview-server/live-events.d.ts +1 -1
  222. package/dist/preview-server/parse-body.d.ts +1 -1
  223. package/dist/preview-server/project-info.js +5 -5
  224. package/dist/preview-server/public-folder.js +8 -8
  225. package/dist/preview-server/render-queue/job.d.ts +11 -2
  226. package/dist/preview-server/render-queue/make-retry-payload.js +5 -1
  227. package/dist/preview-server/render-queue/open-directory-in-finder.js +8 -8
  228. package/dist/preview-server/render-queue/process-still.js +1 -0
  229. package/dist/preview-server/render-queue/queue.js +4 -4
  230. package/dist/preview-server/routes/can-update-default-props.js +3 -2
  231. package/dist/preview-server/routes/update-default-props.d.ts +2 -2
  232. package/dist/preview-server/routes/update-default-props.js +26 -15
  233. package/dist/preview-server/routes.d.ts +3 -2
  234. package/dist/preview-server/routes.js +10 -10
  235. package/dist/preview-server/serve-static.d.ts +1 -1
  236. package/dist/preview-server/serve-static.js +7 -7
  237. package/dist/preview-server/start-server.js +3 -3
  238. package/dist/preview.js +6 -4
  239. package/dist/print-error.d.ts +2 -1
  240. package/dist/print-error.js +8 -5
  241. package/dist/print-help.js +1 -1
  242. package/dist/progress-bar.d.ts +5 -4
  243. package/dist/progress-bar.js +42 -29
  244. package/dist/render-flows/render.d.ts +1 -1
  245. package/dist/render-flows/render.js +62 -35
  246. package/dist/render-flows/still.d.ts +3 -2
  247. package/dist/render-flows/still.js +34 -28
  248. package/dist/resolve-from.js +5 -5
  249. package/dist/setup-cache.d.ts +2 -1
  250. package/dist/setup-cache.js +10 -6
  251. package/dist/should-use-non-overlaying-logger.d.ts +4 -0
  252. package/dist/should-use-non-overlaying-logger.js +12 -0
  253. package/dist/show-compositions-picker.d.ts +8 -0
  254. package/dist/show-compositions-picker.js +51 -0
  255. package/dist/still.js +1 -0
  256. package/dist/studio.d.ts +1 -0
  257. package/dist/studio.js +140 -0
  258. package/dist/upgrade.js +2 -2
  259. package/dist/user-passed-output-location.d.ts +3 -2
  260. package/dist/user-passed-output-location.js +10 -5
  261. package/dist/versions.js +2 -2
  262. package/dist/watch-root-file.d.ts +1 -0
  263. package/dist/watch-root-file.js +22 -0
  264. package/package.json +89 -88
  265. package/styles/styles.css +4 -5
  266. package/dist/editor/components/CollapsableOptions.d.ts +0 -6
  267. package/dist/editor/components/CollapsableOptions.js +0 -35
  268. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +0 -10
  269. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +0 -2
  270. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +0 -21
  271. package/dist/editor/components/RenderToolbarIcon.d.ts +0 -2
  272. package/dist/editor/icons/RenderStillIcon.d.ts +0 -3
  273. package/dist/editor/icons/RenderStillIcon.js +0 -8
@@ -6,8 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.renderStillFlow = void 0;
8
8
  const renderer_1 = require("@remotion/renderer");
9
- const fs_1 = require("fs");
10
- const path_1 = __importDefault(require("path"));
9
+ const node_fs_1 = require("node:fs");
10
+ const node_path_1 = __importDefault(require("node:path"));
11
11
  const chalk_1 = require("../chalk");
12
12
  const cleanup_before_quit_1 = require("../cleanup-before-quit");
13
13
  const config_1 = require("../config");
@@ -19,26 +19,27 @@ const parse_command_line_1 = require("../parse-command-line");
19
19
  const progress_bar_1 = require("../progress-bar");
20
20
  const progress_types_1 = require("../progress-types");
21
21
  const setup_cache_1 = require("../setup-cache");
22
+ const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
22
23
  const truthy_1 = require("../truthy");
23
24
  const user_passed_output_location_1 = require("../user-passed-output-location");
24
- const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, inputProps, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indentOutput, addCleanupCallback, cancelSignal, }) => {
25
+ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, inputProps, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indentOutput, addCleanupCallback, cancelSignal, outputLocationFromUi, }) => {
25
26
  var _a, _b;
26
27
  const downloads = [];
27
28
  const aggregate = (0, progress_types_1.initialAggregateRenderProgress)();
29
+ const updatesDontOverwrite = (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel });
28
30
  let renderProgress = null;
29
31
  const steps = [
30
32
  renderer_1.RenderInternals.isServeUrl(fullEntryPoint) ? null : 'bundling',
31
33
  'rendering',
32
34
  ].filter(truthy_1.truthy);
33
- const updateProgress = () => {
35
+ const updateProgress = (newline) => {
34
36
  const { output, progress, message } = (0, progress_bar_1.makeRenderingAndStitchingProgress)({
35
37
  prog: aggregate,
36
- indent: indentOutput,
37
38
  steps: steps.length,
38
39
  stitchingStep: steps.indexOf('stitching'),
39
40
  });
40
41
  if (renderProgress) {
41
- renderProgress.update(output);
42
+ renderProgress.update(updatesDontOverwrite ? message : output, newline);
42
43
  }
43
44
  onProgress({ message, value: progress, ...aggregate });
44
45
  };
@@ -49,7 +50,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
49
50
  chromiumOptions,
50
51
  shouldDumpIo,
51
52
  forceDeviceScaleFactor: scale,
52
- indentationString: indentOutput ? log_1.INDENT_TOKEN + ' ' : '',
53
+ indent: indentOutput,
53
54
  });
54
55
  const { cleanup: cleanupBundle, urlOrBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
55
56
  fullPath: fullEntryPoint,
@@ -59,7 +60,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
59
60
  onProgress: ({ copying, bundling }) => {
60
61
  aggregate.bundling = bundling;
61
62
  aggregate.copyingState = copying;
62
- updateProgress();
63
+ updateProgress(false);
63
64
  },
64
65
  indentOutput,
65
66
  logLevel,
@@ -69,34 +70,35 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
69
70
  renderer_1.RenderInternals.deleteDirectory(dir);
70
71
  });
71
72
  },
73
+ quietProgress: updatesDontOverwrite,
72
74
  });
73
75
  addCleanupCallback(() => cleanupBundle());
74
76
  const puppeteerInstance = await browserInstance;
75
77
  addCleanupCallback(() => puppeteerInstance.close(false));
76
78
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
77
79
  addCleanupCallback(() => renderer_1.RenderInternals.cleanDownloadMap(downloadMap));
78
- const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
79
- inputProps,
80
- puppeteerInstance,
81
- envVariables,
82
- timeoutInMilliseconds: puppeteerTimeout,
83
- chromiumOptions,
84
- port,
85
- browserExecutable,
86
- downloadMap,
87
- });
88
80
  const { compositionId, config, reason, argsAfterComposition } = await (0, get_composition_with_dimension_override_1.getCompositionWithDimensionOverride)({
89
- validCompositions: comps,
90
81
  height,
91
82
  width,
92
83
  args: remainingArgs,
93
84
  compositionIdFromUi,
85
+ browserExecutable,
86
+ chromiumOptions,
87
+ downloadMap,
88
+ envVariables,
89
+ indent: indentOutput,
90
+ inputProps,
91
+ port,
92
+ puppeteerInstance,
93
+ serveUrlOrWebpackUrl: urlOrBundle,
94
+ timeoutInMilliseconds: puppeteerTimeout,
95
+ verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
94
96
  });
95
97
  const { format: imageFormat, source } = (0, determine_image_format_1.determineFinalStillImageFormat)({
96
98
  cliFlag: (_a = parse_command_line_1.parsedCli['image-format']) !== null && _a !== void 0 ? _a : null,
97
99
  configImageFormat: (_b = config_1.ConfigInternals.getUserPreferredStillImageFormat()) !== null && _b !== void 0 ? _b : null,
98
100
  downloadName: null,
99
- outName: (0, user_passed_output_location_1.getUserPassedOutputLocation)(argsAfterComposition),
101
+ outName: (0, user_passed_output_location_1.getUserPassedOutputLocation)(argsAfterComposition, outputLocationFromUi),
100
102
  isLambda: false,
101
103
  fromUi: imageFormatFromUi,
102
104
  });
@@ -105,15 +107,20 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
105
107
  defaultExtension: imageFormat,
106
108
  args: argsAfterComposition,
107
109
  type: 'asset',
110
+ outputLocationFromUi,
108
111
  });
109
112
  const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
110
- (0, fs_1.mkdirSync)(path_1.default.join(absoluteOutputLocation, '..'), {
113
+ const exists = (0, node_fs_1.existsSync)(absoluteOutputLocation);
114
+ (0, node_fs_1.mkdirSync)(node_path_1.default.join(absoluteOutputLocation, '..'), {
111
115
  recursive: true,
112
116
  });
113
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason}), Output = ${relativeOutputLocation}, Format = ${imageFormat} (${source}), Composition = ${compositionId} (${reason})`));
117
+ log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel, tag: 'config' }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
118
+ log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`));
114
119
  renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
115
120
  quiet: (0, parse_command_line_1.quietFlagProvided)(),
116
121
  cancelSignal,
122
+ updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
123
+ indent: indentOutput,
117
124
  });
118
125
  const renderStart = Date.now();
119
126
  aggregate.rendering = {
@@ -123,7 +130,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
123
130
  steps,
124
131
  totalFrames: 1,
125
132
  };
126
- updateProgress();
133
+ updateProgress(false);
127
134
  const onDownload = (src) => {
128
135
  const id = Math.random();
129
136
  const download = {
@@ -134,10 +141,10 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
134
141
  totalBytes: null,
135
142
  };
136
143
  downloads.push(download);
137
- updateProgress();
144
+ updateProgress(false);
138
145
  return ({ percent }) => {
139
146
  download.progress = percent;
140
- updateProgress();
147
+ updateProgress(false);
141
148
  };
142
149
  };
143
150
  await (0, renderer_1.renderStill)({
@@ -167,8 +174,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
167
174
  steps,
168
175
  totalFrames: 1,
169
176
  };
170
- updateProgress();
171
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel });
172
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.cyan(`▶️ ${absoluteOutputLocation}`));
177
+ updateProgress(true);
178
+ log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputLocation}`));
173
179
  };
174
180
  exports.renderStillFlow = renderStillFlow;
@@ -4,22 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.resolveFrom = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
9
  const Module = require("module");
10
10
  const resolveFrom = (fromDirectory, moduleId) => {
11
11
  try {
12
- fromDirectory = fs_1.default.realpathSync(fromDirectory);
12
+ fromDirectory = node_fs_1.default.realpathSync(fromDirectory);
13
13
  }
14
14
  catch (error) {
15
15
  if (error.code === 'ENOENT') {
16
- fromDirectory = path_1.default.resolve(fromDirectory);
16
+ fromDirectory = node_path_1.default.resolve(fromDirectory);
17
17
  }
18
18
  else {
19
19
  throw error;
20
20
  }
21
21
  }
22
- const fromFile = path_1.default.join(fromDirectory, 'noop.js');
22
+ const fromFile = node_path_1.default.join(fromDirectory, 'noop.js');
23
23
  const resolveFileName = () =>
24
24
  // @ts-expect-error
25
25
  Module._resolveFilename(moduleId, {
@@ -1,6 +1,6 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
2
  import type { BundlingState, CopyingState } from './progress-bar';
3
- export declare const bundleOnCliOrTakeServeUrl: ({ fullPath, remotionRoot, publicDir, onProgress, indentOutput, logLevel, bundlingStep, steps, onDirectoryCreated, }: {
3
+ export declare const bundleOnCliOrTakeServeUrl: ({ fullPath, remotionRoot, publicDir, onProgress, indentOutput, logLevel, bundlingStep, steps, onDirectoryCreated, quietProgress, }: {
4
4
  fullPath: string;
5
5
  remotionRoot: string;
6
6
  publicDir: string | null;
@@ -13,6 +13,7 @@ export declare const bundleOnCliOrTakeServeUrl: ({ fullPath, remotionRoot, publi
13
13
  bundlingStep: number;
14
14
  steps: number;
15
15
  onDirectoryCreated: (path: string) => void;
16
+ quietProgress: boolean;
16
17
  }) => Promise<{
17
18
  urlOrBundle: string;
18
19
  cleanup: () => void;
@@ -7,7 +7,8 @@ const config_1 = require("./config");
7
7
  const log_1 = require("./log");
8
8
  const parse_command_line_1 = require("./parse-command-line");
9
9
  const progress_bar_1 = require("./progress-bar");
10
- const bundleOnCliOrTakeServeUrl = async ({ fullPath, remotionRoot, publicDir, onProgress, indentOutput, logLevel, bundlingStep, steps, onDirectoryCreated, }) => {
10
+ const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
11
+ const bundleOnCliOrTakeServeUrl = async ({ fullPath, remotionRoot, publicDir, onProgress, indentOutput, logLevel, bundlingStep, steps, onDirectoryCreated, quietProgress, }) => {
11
12
  if (renderer_1.RenderInternals.isServeUrl(fullPath)) {
12
13
  return {
13
14
  urlOrBundle: fullPath,
@@ -24,6 +25,7 @@ const bundleOnCliOrTakeServeUrl = async ({ fullPath, remotionRoot, publicDir, on
24
25
  bundlingStep,
25
26
  steps,
26
27
  onDirectoryCreated,
28
+ quietProgress,
27
29
  });
28
30
  return {
29
31
  urlOrBundle: bundled,
@@ -31,7 +33,7 @@ const bundleOnCliOrTakeServeUrl = async ({ fullPath, remotionRoot, publicDir, on
31
33
  };
32
34
  };
33
35
  exports.bundleOnCliOrTakeServeUrl = bundleOnCliOrTakeServeUrl;
34
- const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallback, indent, logLevel, bundlingStep, steps, onDirectoryCreated, }) => {
36
+ const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallback, indent, logLevel, bundlingStep, steps, onDirectoryCreated, quietProgress, }) => {
35
37
  var _a;
36
38
  const shouldCache = config_1.ConfigInternals.getWebpackCaching();
37
39
  const symlinkState = {
@@ -54,7 +56,7 @@ const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallba
54
56
  bundling: bundlingState,
55
57
  copying: copyingState,
56
58
  symLinks: symlinkState,
57
- }, indent, bundlingStep, steps) + (newline ? '\n' : ''));
59
+ }, bundlingStep, steps), newline);
58
60
  onProgressCallback({
59
61
  bundling: bundlingState,
60
62
  copying: copyingState,
@@ -92,16 +94,18 @@ const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallba
92
94
  const cacheExistedBefore = bundler_1.BundlerInternals.cacheExists(remotionRoot, 'production', hash);
93
95
  if (cacheExistedBefore !== 'does-not-exist' && !shouldCache) {
94
96
  log_1.Log.infoAdvanced({ indent, logLevel }, '🧹 Cache disabled but found. Deleting... ');
95
- await bundler_1.BundlerInternals.clearCache(remotionRoot);
97
+ await bundler_1.BundlerInternals.clearCache(remotionRoot, 'production');
96
98
  }
97
99
  if (cacheExistedBefore === 'other-exists' && shouldCache) {
98
100
  log_1.Log.infoAdvanced({ indent, logLevel }, '🧹 Webpack config change detected. Clearing cache... ');
99
- await bundler_1.BundlerInternals.clearCache(remotionRoot);
101
+ await bundler_1.BundlerInternals.clearCache(remotionRoot, 'production');
100
102
  }
101
103
  const bundleStartTime = Date.now();
102
104
  const bundlingProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
103
- quiet: (0, parse_command_line_1.quietFlagProvided)(),
105
+ quiet: quietProgress || (0, parse_command_line_1.quietFlagProvided)(),
104
106
  cancelSignal: null,
107
+ updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
108
+ indent,
105
109
  });
106
110
  let bundlingState = {
107
111
  progress: 0,
@@ -0,0 +1,4 @@
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const shouldUseNonOverlayingLogger: ({ logLevel, }: {
3
+ logLevel: LogLevel;
4
+ }) => boolean;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Should not use a logger that uses ANSI Diffing if
3
+ // - using verbose logging (intersection of Chrome + Remotion + compositor logs)
4
+ // - using a non-interactive terminal such as CI
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.shouldUseNonOverlayingLogger = void 0;
7
+ const renderer_1 = require("@remotion/renderer");
8
+ const shouldUseNonOverlayingLogger = ({ logLevel, }) => {
9
+ return (renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose') ||
10
+ !process.stdout.isTTY);
11
+ };
12
+ exports.shouldUseNonOverlayingLogger = shouldUseNonOverlayingLogger;
@@ -0,0 +1,8 @@
1
+ import type { getCompositions } from '@remotion/renderer';
2
+ declare type Await<T> = T extends PromiseLike<infer U> ? U : T;
3
+ export declare const showSingleCompositionsPicker: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<{
4
+ compositionId: string;
5
+ reason: string;
6
+ }>;
7
+ export declare const showMultiCompositionsPicker: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<string[]>;
8
+ export {};
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.showMultiCompositionsPicker = exports.showSingleCompositionsPicker = void 0;
4
+ const composition_prompts_1 = require("./composition-prompts");
5
+ const chalk_1 = require("./chalk");
6
+ const showSingleCompositionsPicker = async (validCompositions) => {
7
+ if (validCompositions.length === 1) {
8
+ const onlyComposition = validCompositions[0];
9
+ if (onlyComposition) {
10
+ return {
11
+ compositionId: onlyComposition.id,
12
+ reason: 'Only composition',
13
+ };
14
+ }
15
+ }
16
+ const selectedComposition = (await (0, composition_prompts_1.selectAsync)({
17
+ message: 'Select composition:',
18
+ optionsPerPage: 5,
19
+ type: 'select',
20
+ choices: validCompositions.map((comp) => {
21
+ return {
22
+ value: comp.id,
23
+ title: chalk_1.chalk.bold(comp.id),
24
+ };
25
+ }),
26
+ }));
27
+ return { compositionId: selectedComposition, reason: 'Selected' };
28
+ };
29
+ exports.showSingleCompositionsPicker = showSingleCompositionsPicker;
30
+ const showMultiCompositionsPicker = async (validCompositions) => {
31
+ if (validCompositions.length === 1) {
32
+ const onlyComposition = validCompositions[0];
33
+ if (onlyComposition) {
34
+ return [onlyComposition.id];
35
+ }
36
+ }
37
+ const selectedComposition = await (0, composition_prompts_1.selectAsync)({
38
+ message: 'Select compositions:',
39
+ optionsPerPage: 5,
40
+ type: 'multiselect',
41
+ min: 1,
42
+ choices: validCompositions.map((comp) => {
43
+ return {
44
+ value: comp.id,
45
+ title: chalk_1.chalk.bold(comp.id),
46
+ };
47
+ }),
48
+ });
49
+ return selectedComposition;
50
+ };
51
+ exports.showMultiCompositionsPicker = showMultiCompositionsPicker;
package/dist/still.js CHANGED
@@ -54,6 +54,7 @@ const still = async (remotionRoot, args) => {
54
54
  (0, cleanup_before_quit_1.registerCleanupJob)(c);
55
55
  },
56
56
  cancelSignal: null,
57
+ outputLocationFromUi: null,
57
58
  });
58
59
  };
59
60
  exports.still = still;
@@ -0,0 +1 @@
1
+ export declare const studioCommand: (remotionRoot: string, args: string[]) => Promise<void>;
package/dist/studio.js ADDED
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.studioCommand = void 0;
7
+ const node_crypto_1 = __importDefault(require("node:crypto"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const better_opn_1 = require("./better-opn");
10
+ const chalk_1 = require("./chalk");
11
+ const config_1 = require("./config");
12
+ const convert_entry_point_to_serve_url_1 = require("./convert-entry-point-to-serve-url");
13
+ const entry_point_1 = require("./entry-point");
14
+ const get_env_1 = require("./get-env");
15
+ const get_input_props_1 = require("./get-input-props");
16
+ const get_network_address_1 = require("./get-network-address");
17
+ const log_1 = require("./log");
18
+ const parse_command_line_1 = require("./parse-command-line");
19
+ const get_absolute_public_dir_1 = require("./preview-server/get-absolute-public-dir");
20
+ const live_events_1 = require("./preview-server/live-events");
21
+ const public_folder_1 = require("./preview-server/public-folder");
22
+ const start_server_1 = require("./preview-server/start-server");
23
+ const watch_root_file_1 = require("./watch-root-file");
24
+ const noop = () => undefined;
25
+ const getShouldOpenBrowser = () => {
26
+ var _a;
27
+ if (parse_command_line_1.parsedCli['no-open']) {
28
+ return {
29
+ shouldOpenBrowser: false,
30
+ reasonForBrowserDecision: '--no-open specified',
31
+ };
32
+ }
33
+ if (((_a = process.env.BROWSER) !== null && _a !== void 0 ? _a : '').toLowerCase() === 'none') {
34
+ return {
35
+ shouldOpenBrowser: false,
36
+ reasonForBrowserDecision: 'env BROWSER=none was set',
37
+ };
38
+ }
39
+ if (config_1.ConfigInternals.getShouldOpenBrowser() === false) {
40
+ return { shouldOpenBrowser: false, reasonForBrowserDecision: 'Config file' };
41
+ }
42
+ return { shouldOpenBrowser: true, reasonForBrowserDecision: 'default' };
43
+ };
44
+ const getPort = () => {
45
+ if (parse_command_line_1.parsedCli.port) {
46
+ return parse_command_line_1.parsedCli.port;
47
+ }
48
+ const serverPort = config_1.ConfigInternals.getServerPort();
49
+ if (serverPort) {
50
+ return serverPort;
51
+ }
52
+ return null;
53
+ };
54
+ const studioCommand = async (remotionRoot, args) => {
55
+ const { file, reason } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
56
+ log_1.Log.verbose('Entry point:', file, 'reason:', reason);
57
+ if (!file) {
58
+ log_1.Log.error('No Remotion entrypoint was found. Specify an additional argument manually:');
59
+ log_1.Log.error(' npx remotion studio src/index.ts');
60
+ log_1.Log.error('See https://www.remotion.dev/docs/register-root for more information.');
61
+ process.exit(1);
62
+ }
63
+ const desiredPort = getPort();
64
+ const fullEntryPath = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(file);
65
+ let inputProps = (0, get_input_props_1.getInputProps)((newProps) => {
66
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
67
+ inputProps = newProps;
68
+ listener.sendEventToClient({
69
+ type: 'new-input-props',
70
+ newProps,
71
+ });
72
+ });
73
+ });
74
+ let envVariables = await (0, get_env_1.getEnvironmentVariables)((newEnvVariables) => {
75
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
76
+ envVariables = newEnvVariables;
77
+ listener.sendEventToClient({
78
+ type: 'new-env-variables',
79
+ newEnvVariables,
80
+ });
81
+ });
82
+ });
83
+ const publicDir = (0, get_absolute_public_dir_1.getAbsolutePublicDir)({
84
+ userPassedPublicDir: config_1.ConfigInternals.getPublicDir(),
85
+ remotionRoot,
86
+ });
87
+ const hashPrefix = '/static-';
88
+ const staticHash = `${hashPrefix}${node_crypto_1.default.randomBytes(6).toString('hex')}`;
89
+ (0, public_folder_1.initPublicFolderWatch)({
90
+ publicDir,
91
+ remotionRoot,
92
+ onUpdate: () => {
93
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
94
+ listener.sendEventToClient({
95
+ type: 'new-public-folder',
96
+ files: (0, public_folder_1.getFiles)(),
97
+ });
98
+ });
99
+ },
100
+ staticHash,
101
+ });
102
+ (0, watch_root_file_1.watchRootFile)(remotionRoot);
103
+ const { port, liveEventsServer } = await (0, start_server_1.startServer)({
104
+ entry: node_path_1.default.resolve(__dirname, 'previewEntry.js'),
105
+ userDefinedComponent: fullEntryPath,
106
+ getCurrentInputProps: () => inputProps,
107
+ getEnvVariables: () => envVariables,
108
+ port: desiredPort,
109
+ maxTimelineTracks: config_1.ConfigInternals.getMaxTimelineTracks(),
110
+ remotionRoot,
111
+ keyboardShortcutsEnabled: config_1.ConfigInternals.getKeyboardShortcutsEnabled(),
112
+ publicDir,
113
+ webpackOverride: config_1.ConfigInternals.getWebpackOverrideFn(),
114
+ poll: config_1.ConfigInternals.getWebpackPolling(),
115
+ userPassedPublicDir: config_1.ConfigInternals.getPublicDir(),
116
+ hash: staticHash,
117
+ hashPrefix,
118
+ });
119
+ (0, live_events_1.setLiveEventsListener)(liveEventsServer);
120
+ const networkAddress = (0, get_network_address_1.getNetworkAddress)();
121
+ if (networkAddress) {
122
+ log_1.Log.info(`Server ready - Local: ${chalk_1.chalk.underline(`http://localhost:${port}`)}, Network: ${chalk_1.chalk.underline(`http://${networkAddress}:${port}`)}`);
123
+ }
124
+ else {
125
+ log_1.Log.info(`Running on http://localhost:${port}`);
126
+ }
127
+ const { reasonForBrowserDecision, shouldOpenBrowser } = getShouldOpenBrowser();
128
+ if (shouldOpenBrowser) {
129
+ await (0, better_opn_1.openBrowser)({
130
+ url: `http://localhost:${port}`,
131
+ browserArgs: parse_command_line_1.parsedCli['browser-args'],
132
+ browserFlag: parse_command_line_1.parsedCli.browser,
133
+ });
134
+ }
135
+ else {
136
+ log_1.Log.verbose(`Not opening browser, reason: ${reasonForBrowserDecision}`);
137
+ }
138
+ await new Promise(noop);
139
+ };
140
+ exports.studioCommand = studioCommand;
package/dist/upgrade.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.upgrade = void 0;
7
7
  const renderer_1 = require("@remotion/renderer");
8
- const path_1 = __importDefault(require("path"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
9
  const config_1 = require("./config");
10
10
  const get_latest_remotion_version_1 = require("./get-latest-remotion-version");
11
11
  const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
@@ -22,7 +22,7 @@ const getUpgradeCommand = ({ manager, packages, version, }) => {
22
22
  };
23
23
  const upgrade = async (remotionRoot, packageManager) => {
24
24
  var _a, _b, _c, _d;
25
- const packageJsonFilePath = path_1.default.join(remotionRoot, 'package.json');
25
+ const packageJsonFilePath = node_path_1.default.join(remotionRoot, 'package.json');
26
26
  const packageJson = require(packageJsonFilePath);
27
27
  const dependencies = Object.keys(packageJson.dependencies);
28
28
  const devDependencies = Object.keys((_a = packageJson.devDependencies) !== null && _a !== void 0 ? _a : {});
@@ -1,6 +1,7 @@
1
- export declare const getUserPassedOutputLocation: (args: string[]) => string;
2
- export declare const getOutputLocation: ({ compositionId, defaultExtension, args, type, }: {
1
+ export declare const getUserPassedOutputLocation: (args: string[], uiPassedOutName: string | null) => string;
2
+ export declare const getOutputLocation: ({ compositionId, defaultExtension, args, type, outputLocationFromUi, }: {
3
3
  compositionId: string;
4
+ outputLocationFromUi: string | null;
4
5
  defaultExtension: string;
5
6
  args: string[];
6
7
  type: 'asset' | 'sequence';
@@ -3,15 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOutputLocation = exports.getUserPassedOutputLocation = void 0;
4
4
  const config_1 = require("./config");
5
5
  const get_default_out_name_1 = require("./get-default-out-name");
6
- const getUserPassedOutputLocation = (args) => {
7
- var _a;
8
- const filename = (_a = args[0]) !== null && _a !== void 0 ? _a : config_1.ConfigInternals.getOutputLocation();
6
+ const parse_command_line_1 = require("./parse-command-line");
7
+ const getUserPassedOutputLocation = (args, uiPassedOutName) => {
8
+ var _a, _b;
9
+ const filename = (_b = (_a = uiPassedOutName !== null && uiPassedOutName !== void 0 ? uiPassedOutName : args[0]) !== null && _a !== void 0 ? _a : parse_command_line_1.parsedCli.output) !== null && _b !== void 0 ? _b : config_1.ConfigInternals.getOutputLocation();
9
10
  return filename;
10
11
  };
11
12
  exports.getUserPassedOutputLocation = getUserPassedOutputLocation;
12
- const getOutputLocation = ({ compositionId, defaultExtension, args, type, }) => {
13
+ const getOutputLocation = ({ compositionId, defaultExtension, args, type, outputLocationFromUi, }) => {
13
14
  var _a;
14
- return ((_a = (0, exports.getUserPassedOutputLocation)(args)) !== null && _a !== void 0 ? _a : (0, get_default_out_name_1.getDefaultOutLocation)({
15
+ if (typeof args[0] !== 'undefined' &&
16
+ typeof parse_command_line_1.parsedCli.output !== 'undefined') {
17
+ throw new Error('Both an output flag (--output) and an output location as a positional argument were passed. Please choose only one of the ways.');
18
+ }
19
+ return ((_a = (0, exports.getUserPassedOutputLocation)(args, outputLocationFromUi)) !== null && _a !== void 0 ? _a : (0, get_default_out_name_1.getDefaultOutLocation)({
15
20
  compositionName: compositionId,
16
21
  defaultExtension,
17
22
  type,
package/dist/versions.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.versionsCommand = exports.validateVersionsBeforeCommand = exports.VERSIONS_COMMAND = void 0;
7
7
  const renderer_1 = require("@remotion/renderer");
8
- const fs_1 = __importDefault(require("fs"));
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const config_1 = require("./config");
10
10
  const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
11
11
  const log_1 = require("./log");
@@ -14,7 +14,7 @@ const resolve_from_1 = require("./resolve-from");
14
14
  const getVersion = async (remotionRoot, p) => {
15
15
  try {
16
16
  const remotionPkgJson = (0, resolve_from_1.resolveFrom)(remotionRoot, `${p}/package.json`);
17
- const file = await fs_1.default.promises.readFile(remotionPkgJson, 'utf-8');
17
+ const file = await node_fs_1.default.promises.readFile(remotionPkgJson, 'utf-8');
18
18
  const packageJson = JSON.parse(file);
19
19
  return packageJson.version;
20
20
  }
@@ -0,0 +1 @@
1
+ export declare const watchRootFile: (remotionRoot: string) => Promise<void>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.watchRootFile = void 0;
4
+ const file_watcher_1 = require("./file-watcher");
5
+ const live_events_1 = require("./preview-server/live-events");
6
+ const project_info_1 = require("./preview-server/project-info");
7
+ const watchRootFile = async (remotionRoot) => {
8
+ const rootFile = await (0, project_info_1.getProjectInfo)(remotionRoot);
9
+ if (!rootFile.videoFile) {
10
+ return;
11
+ }
12
+ (0, file_watcher_1.installFileWatcher)({
13
+ file: rootFile.videoFile,
14
+ onChange: () => {
15
+ // Don't care if changed, added or deleted - should trigger a refetch in the frontend all the time
16
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
17
+ listener.sendEventToClient({ type: 'root-file-changed' });
18
+ });
19
+ },
20
+ });
21
+ };
22
+ exports.watchRootFile = watchRootFile;