@remotion/cli 4.0.0-alpha6 → 4.0.0-alpha8

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 (131) hide show
  1. package/dist/benchmark.js +9 -4
  2. package/dist/chalk/index.d.ts +45 -54
  3. package/dist/chalk/index.js +2 -135
  4. package/dist/codemods/stringify-with-path.d.ts +5 -0
  5. package/dist/codemods/stringify-with-path.js +44 -0
  6. package/dist/codemods/update-default-props.d.ts +3 -1
  7. package/dist/codemods/update-default-props.js +3 -17
  8. package/dist/compositions.js +1 -0
  9. package/dist/config/log.d.ts +1 -3
  10. package/dist/config/log.js +2 -9
  11. package/dist/download-progress.d.ts +1 -1
  12. package/dist/download-progress.js +1 -5
  13. package/dist/editor/components/MenuBuildIndicator.js +20 -1
  14. package/dist/editor/components/Modals.js +1 -1
  15. package/dist/editor/components/NewComposition/ComboBox.js +2 -2
  16. package/dist/editor/components/NewComposition/MenuContent.js +1 -1
  17. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  18. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  19. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  20. package/dist/editor/components/OpenEditorButton.d.ts +2 -0
  21. package/dist/editor/components/OpenEditorButton.js +52 -0
  22. package/dist/editor/components/RenderButton.js +5 -1
  23. package/dist/editor/components/RenderModal/CliCopyButton.js +7 -6
  24. package/dist/editor/components/RenderModal/OptionExplainer.js +1 -0
  25. package/dist/editor/components/RenderModal/RenderModal.d.ts +2 -0
  26. package/dist/editor/components/RenderModal/RenderModal.js +3 -3
  27. package/dist/editor/components/RenderModal/RenderModalData.js +55 -27
  28. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +2 -2
  29. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -1
  30. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +3 -2
  31. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
  32. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -1
  33. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  34. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +2 -1
  35. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -8
  36. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +2 -1
  37. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +5 -5
  38. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
  39. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +3 -2
  40. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +3 -2
  41. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +4 -4
  42. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +1 -1
  43. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +2 -1
  44. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +9 -6
  45. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
  46. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +1 -1
  47. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +1 -1
  48. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +40 -7
  49. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +16 -0
  50. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +73 -0
  51. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +2 -1
  52. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +5 -5
  53. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +2 -1
  54. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +4 -0
  55. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
  56. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +3 -0
  57. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.js +126 -0
  58. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +14 -0
  59. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +42 -0
  60. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +6 -2
  61. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +29 -3
  62. package/dist/editor/components/RenderQueue/actions.d.ts +2 -1
  63. package/dist/editor/components/RenderQueue/actions.js +8 -4
  64. package/dist/editor/components/SidebarRenderButton.js +2 -0
  65. package/dist/editor/components/Spinner.d.ts +4 -0
  66. package/dist/editor/components/Spinner.js +42 -0
  67. package/dist/editor/components/Timeline/TimelineSequence.js +6 -4
  68. package/dist/editor/helpers/calculate-timeline.js +1 -1
  69. package/dist/editor/state/modals.d.ts +2 -0
  70. package/dist/ffmpeg.js +6 -2
  71. package/dist/handle-common-errors.d.ts +2 -1
  72. package/dist/handle-common-errors.js +2 -2
  73. package/dist/index.d.ts +9 -5
  74. package/dist/index.js +4 -5
  75. package/dist/log.d.ts +5 -5
  76. package/dist/log.js +3 -42
  77. package/dist/parse-command-line.d.ts +1 -0
  78. package/dist/preview-server/dev-middleware/setup-hooks.js +2 -2
  79. package/dist/preview-server/render-queue/job.d.ts +2 -0
  80. package/dist/preview-server/render-queue/make-retry-payload.js +4 -0
  81. package/dist/preview-server/render-queue/queue.js +2 -1
  82. package/dist/preview-server/routes/can-update-default-props.js +1 -0
  83. package/dist/preview-server/routes/update-default-props.js +4 -3
  84. package/dist/print-error.d.ts +2 -1
  85. package/dist/print-error.js +8 -5
  86. package/dist/progress-bar.d.ts +5 -4
  87. package/dist/progress-bar.js +42 -29
  88. package/dist/render-flows/render.js +46 -19
  89. package/dist/render-flows/still.js +17 -12
  90. package/dist/setup-cache.d.ts +2 -1
  91. package/dist/setup-cache.js +8 -4
  92. package/dist/should-use-non-overlaying-logger.d.ts +4 -0
  93. package/dist/should-use-non-overlaying-logger.js +12 -0
  94. package/dist/user-passed-output-location.js +7 -2
  95. package/package.json +7 -7
  96. package/dist/ansi/ansi-regex.d.ts +0 -2
  97. package/dist/ansi/ansi-regex.js +0 -18
  98. package/dist/cloudrun-command.d.ts +0 -1
  99. package/dist/cloudrun-command.js +0 -27
  100. package/dist/config/ffmpeg-executable.d.ts +0 -5
  101. package/dist/config/ffmpeg-executable.js +0 -21
  102. package/dist/config/quality.d.ts +0 -2
  103. package/dist/config/quality.js +0 -17
  104. package/dist/editor/components/ClipboardIcon.d.ts +0 -2
  105. package/dist/editor/components/ClipboardIcon.js +0 -12
  106. package/dist/editor/components/CollapsedCompositionSelector.d.ts +0 -4
  107. package/dist/editor/components/CollapsedCompositionSelector.js +0 -39
  108. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +0 -6
  109. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +0 -24
  110. package/dist/editor/components/RichTimelineToggle.d.ts +0 -2
  111. package/dist/editor/components/RichTimelineToggle.js +0 -29
  112. package/dist/editor/components/Thumbnail.d.ts +0 -8
  113. package/dist/editor/components/Thumbnail.js +0 -76
  114. package/dist/editor/helpers/use-compact-ui.d.ts +0 -1
  115. package/dist/editor/helpers/use-compact-ui.js +0 -18
  116. package/dist/editor/icons/film.d.ts +0 -3
  117. package/dist/editor/icons/film.js +0 -8
  118. package/dist/editor/icons/timeline.d.ts +0 -3
  119. package/dist/editor/icons/timeline.js +0 -9
  120. package/dist/editor/state/rich-timeline.d.ts +0 -9
  121. package/dist/editor/state/rich-timeline.js +0 -17
  122. package/dist/get-render-media-options.d.ts +0 -8
  123. package/dist/get-render-media-options.js +0 -55
  124. package/dist/install.d.ts +0 -2
  125. package/dist/install.js +0 -36
  126. package/dist/is-javascript.d.ts +0 -2
  127. package/dist/is-javascript.js +0 -9
  128. package/dist/preview-server/dev-middleware/is-color-supported.d.ts +0 -1
  129. package/dist/preview-server/dev-middleware/is-color-supported.js +0 -37
  130. package/dist/preview-server/hot-middleware/strip-ansi.d.ts +0 -1
  131. package/dist/preview-server/hot-middleware/strip-ansi.js +0 -21
@@ -1,11 +1,34 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.renderVideoFlow = void 0;
7
30
  const renderer_1 = require("@remotion/renderer");
8
- const node_fs_1 = __importDefault(require("node:fs"));
31
+ const node_fs_1 = __importStar(require("node:fs"));
9
32
  const node_os_1 = __importDefault(require("node:os"));
10
33
  const node_path_1 = __importDefault(require("node:path"));
11
34
  const chalk_1 = require("../chalk");
@@ -19,6 +42,7 @@ const log_1 = require("../log");
19
42
  const parse_command_line_1 = require("../parse-command-line");
20
43
  const progress_bar_1 = require("../progress-bar");
21
44
  const setup_cache_1 = require("../setup-cache");
45
+ const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
22
46
  const truthy_1 = require("../truthy");
23
47
  const user_passed_output_location_1 = require("../user-passed-output-location");
24
48
  const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel, browserExecutable, browser, chromiumOptions, scale, shouldOutputImageSequence, publicDir, inputProps, envVariables, puppeteerTimeout, port, height, width, remainingArgs, compositionIdFromUi, entryPointReason, overwrite, quiet, concurrency, frameRange, everyNthFrame, outputLocationFromUI, jpegQuality, onProgress, addCleanupCallback, cancelSignal, crf, uiCodec, uiImageFormat, ffmpegOverride, audioBitrate, muted, enforceAudioTrack, proResProfile, pixelFormat, videoBitrate, numberOfGifLoops, audioCodec, disallowParallelEncoding, }) => {
@@ -33,11 +57,14 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
33
57
  shouldDumpIo: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
34
58
  chromiumOptions,
35
59
  forceDeviceScaleFactor: scale,
36
- indentationString: indent ? log_1.INDENT_TOKEN + ' ' : '',
60
+ indent,
37
61
  });
62
+ const updatesDontOverwrite = (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel });
38
63
  const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
39
64
  quiet,
40
65
  cancelSignal,
66
+ updatesDontOverwrite,
67
+ indent,
41
68
  });
42
69
  const steps = [
43
70
  renderer_1.RenderInternals.isServeUrl(fullEntryPoint) ? null : 'bundling',
@@ -54,7 +81,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
54
81
  bytes: 0,
55
82
  doneIn: null,
56
83
  };
57
- const updateRenderProgress = () => {
84
+ const updateRenderProgress = (newline) => {
58
85
  const aggregateRenderProgress = {
59
86
  rendering: renderingProgress,
60
87
  stitching: shouldOutputImageSequence ? null : stitchingProgress,
@@ -64,12 +91,11 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
64
91
  };
65
92
  const { output, message, progress } = (0, progress_bar_1.makeRenderingAndStitchingProgress)({
66
93
  prog: aggregateRenderProgress,
67
- indent,
68
94
  steps: steps.length,
69
- stitchingStep: steps.indexOf('bundling'),
95
+ stitchingStep: steps.indexOf('stitching'),
70
96
  });
71
97
  onProgress({ message, value: progress, ...aggregateRenderProgress });
72
- return renderProgress.update(output);
98
+ return renderProgress.update(updatesDontOverwrite ? message : output, newline);
73
99
  };
74
100
  const { urlOrBundle, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
75
101
  fullPath: fullEntryPoint,
@@ -78,7 +104,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
78
104
  onProgress: ({ bundling, copying }) => {
79
105
  bundlingProgress = bundling;
80
106
  copyingState = copying;
81
- updateRenderProgress();
107
+ updateRenderProgress(false);
82
108
  },
83
109
  indentOutput: indent,
84
110
  logLevel,
@@ -87,6 +113,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
87
113
  onDirectoryCreated: (dir) => {
88
114
  addCleanupCallback(() => renderer_1.RenderInternals.deleteDirectory(dir));
89
115
  },
116
+ quietProgress: updatesDontOverwrite,
90
117
  });
91
118
  addCleanupCallback(() => cleanupBundle());
92
119
  const onDownload = (src) => {
@@ -99,12 +126,12 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
99
126
  totalBytes: null,
100
127
  };
101
128
  downloads.push(download);
102
- updateRenderProgress();
129
+ updateRenderProgress(false);
103
130
  return ({ percent, downloaded, totalSize }) => {
104
131
  download.progress = percent;
105
132
  download.totalBytes = totalSize;
106
133
  download.downloaded = downloaded;
107
- updateRenderProgress();
134
+ updateRenderProgress(false);
108
135
  };
109
136
  };
110
137
  const puppeteerInstance = await browserInstance;
@@ -148,8 +175,10 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
148
175
  fromUi: outputLocationFromUI,
149
176
  logLevel,
150
177
  });
151
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason}), Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
178
+ log_1.Log.verboseAdvanced({ indent, logLevel, tag: 'config' }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
179
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
152
180
  const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
181
+ const exists = (0, node_fs_1.existsSync)(absoluteOutputFile);
153
182
  const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(config.durationInFrames, frameRange);
154
183
  const totalFrames = renderer_1.RenderInternals.getFramesToRender(realFrameRange, everyNthFrame);
155
184
  const actualConcurrency = renderer_1.RenderInternals.getActualConcurrency(concurrency);
@@ -180,7 +209,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
180
209
  inputProps,
181
210
  onFrameUpdate: (rendered) => {
182
211
  renderingProgress.frames = rendered;
183
- updateRenderProgress();
212
+ updateRenderProgress(false);
184
213
  },
185
214
  onStart: () => undefined,
186
215
  onDownload: (src) => {
@@ -209,9 +238,8 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
209
238
  downloadMap,
210
239
  composition: config,
211
240
  });
212
- updateRenderProgress();
213
- process.stdout.write('\n');
214
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
241
+ updateRenderProgress(true);
242
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`▶ ${absoluteOutputFile}`));
215
243
  return;
216
244
  }
217
245
  stitchingProgress = {
@@ -263,16 +291,16 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
263
291
  update.renderedDoneIn;
264
292
  renderingProgress.frames =
265
293
  update.renderedFrames;
266
- updateRenderProgress();
294
+ updateRenderProgress(false);
267
295
  },
268
296
  puppeteerInstance,
269
297
  onDownload,
270
298
  internal: {
271
299
  onCtrlCExit: addCleanupCallback,
272
300
  downloadMap,
301
+ indent,
273
302
  },
274
303
  cancelSignal: cancelSignal !== null && cancelSignal !== void 0 ? cancelSignal : undefined,
275
- printLog: (...str) => log_1.Log.verboseAdvanced({ indent, logLevel }, ...str),
276
304
  audioCodec,
277
305
  preferLossless: false,
278
306
  imageFormat,
@@ -283,9 +311,8 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
283
311
  slowestFrames.forEach(({ frame, time }) => {
284
312
  log_1.Log.verboseAdvanced({ indent, logLevel }, `Frame ${frame} (${time.toFixed(3)}ms)`);
285
313
  });
286
- updateRenderProgress();
287
- process.stdout.write('\n');
288
- log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
314
+ updateRenderProgress(true);
315
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '' : '+'} ${absoluteOutputFile}`));
289
316
  for (const line of renderer_1.RenderInternals.perf.getPerf()) {
290
317
  log_1.Log.verboseAdvanced({ indent, logLevel }, line);
291
318
  }
@@ -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
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, }) => {
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,6 +70,7 @@ 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;
@@ -107,13 +109,17 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
107
109
  type: 'asset',
108
110
  });
109
111
  const absoluteOutputLocation = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
112
+ const exists = (0, node_fs_1.existsSync)(absoluteOutputLocation);
110
113
  (0, node_fs_1.mkdirSync)(node_path_1.default.join(absoluteOutputLocation, '..'), {
111
114
  recursive: true,
112
115
  });
113
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason}), Output = ${relativeOutputLocation}, Format = ${imageFormat} (${source}), Composition = ${compositionId} (${reason})`));
116
+ log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel, tag: 'config' }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
117
+ log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`));
114
118
  renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
115
119
  quiet: (0, parse_command_line_1.quietFlagProvided)(),
116
120
  cancelSignal,
121
+ updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
122
+ indent: indentOutput,
117
123
  });
118
124
  const renderStart = Date.now();
119
125
  aggregate.rendering = {
@@ -123,7 +129,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
123
129
  steps,
124
130
  totalFrames: 1,
125
131
  };
126
- updateProgress();
132
+ updateProgress(false);
127
133
  const onDownload = (src) => {
128
134
  const id = Math.random();
129
135
  const download = {
@@ -134,10 +140,10 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
134
140
  totalBytes: null,
135
141
  };
136
142
  downloads.push(download);
137
- updateProgress();
143
+ updateProgress(false);
138
144
  return ({ percent }) => {
139
145
  download.progress = percent;
140
- updateProgress();
146
+ updateProgress(false);
141
147
  };
142
148
  };
143
149
  await (0, renderer_1.renderStill)({
@@ -167,8 +173,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
167
173
  steps,
168
174
  totalFrames: 1,
169
175
  };
170
- updateProgress();
171
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel });
172
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.cyan(`▶️ ${absoluteOutputLocation}`));
176
+ updateProgress(true);
177
+ log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputLocation}`));
173
178
  };
174
179
  exports.renderStillFlow = renderStillFlow;
@@ -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,
@@ -100,8 +102,10 @@ const bundleOnCli = async ({ fullPath, remotionRoot, publicDir, onProgressCallba
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;
@@ -3,14 +3,19 @@ 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 parse_command_line_1 = require("./parse-command-line");
6
7
  const getUserPassedOutputLocation = (args) => {
7
- var _a;
8
- const filename = (_a = args[0]) !== null && _a !== void 0 ? _a : config_1.ConfigInternals.getOutputLocation();
8
+ var _a, _b;
9
+ const filename = (_b = (_a = 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
13
  const getOutputLocation = ({ compositionId, defaultExtension, args, type, }) => {
13
14
  var _a;
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
+ }
14
19
  return ((_a = (0, exports.getUserPassedOutputLocation)(args)) !== null && _a !== void 0 ? _a : (0, get_default_out_name_1.getDefaultOutLocation)({
15
20
  compositionName: compositionId,
16
21
  defaultExtension,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.0-alpha6",
3
+ "version": "4.0.0-alpha8",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -28,16 +28,16 @@
28
28
  "author": "Jonny Burger <jonny@remotion.dev>",
29
29
  "license": "SEE LICENSE IN LICENSE.md",
30
30
  "dependencies": {
31
- "@remotion/bundler": "4.0.0-alpha6",
32
- "@remotion/media-utils": "4.0.0-alpha6",
33
- "@remotion/player": "4.0.0-alpha6",
34
- "@remotion/renderer": "4.0.0-alpha6",
31
+ "@remotion/bundler": "4.0.0-alpha8",
32
+ "@remotion/media-utils": "4.0.0-alpha8",
33
+ "@remotion/player": "4.0.0-alpha8",
34
+ "@remotion/renderer": "4.0.0-alpha8",
35
35
  "dotenv": "9.0.2",
36
36
  "memfs": "3.4.3",
37
37
  "minimist": "1.2.6",
38
38
  "open": "^8.4.2",
39
39
  "prompts": "2.4.1",
40
- "remotion": "4.0.0-alpha6",
40
+ "remotion": "4.0.0-alpha8",
41
41
  "semver": "7.3.5",
42
42
  "source-map": "0.6.1"
43
43
  },
@@ -56,7 +56,7 @@
56
56
  "@types/semver": "^7.3.4",
57
57
  "@typescript-eslint/eslint-plugin": "5.18.0",
58
58
  "@typescript-eslint/parser": "5.18.0",
59
- "@remotion/zod-types": "4.0.0-alpha6",
59
+ "@remotion/zod-types": "4.0.0-alpha8",
60
60
  "eslint": "8.25.0",
61
61
  "eslint-plugin-10x": "1.5.2",
62
62
  "eslint-plugin-react": "7.29.4",
@@ -1,2 +0,0 @@
1
- export declare const ansiRegex: () => RegExp;
2
- export declare const stripAnsi: (str: string) => string;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripAnsi = exports.ansiRegex = void 0;
4
- const ansiRegex = () => {
5
- const pattern = [
6
- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
7
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
8
- ].join('|');
9
- return new RegExp(pattern, 'g');
10
- };
11
- exports.ansiRegex = ansiRegex;
12
- const stripAnsi = (str) => {
13
- if (typeof str !== 'string') {
14
- throw new TypeError(`Expected a \`string\`, got \`${typeof str}\``);
15
- }
16
- return str.replace((0, exports.ansiRegex)(), '');
17
- };
18
- exports.stripAnsi = stripAnsi;
@@ -1 +0,0 @@
1
- export declare const cloudrunCommand: (remotionRoot: string, args: string[]) => Promise<never>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cloudrunCommand = void 0;
4
- const log_1 = require("./log");
5
- const get_package_manager_1 = require("./preview-server/get-package-manager");
6
- const update_available_1 = require("./preview-server/update-available");
7
- const cloudrunCommand = async (remotionRoot, args) => {
8
- try {
9
- const path = require.resolve('@remotion/cloudrun', {
10
- paths: [remotionRoot],
11
- });
12
- const { CloudrunInternals } = require(path);
13
- await CloudrunInternals.executeCommand(args, remotionRoot);
14
- process.exit(0);
15
- }
16
- catch (err) {
17
- const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
18
- const installCommand = manager === 'unknown' ? 'npm i' : manager.installCommand;
19
- log_1.Log.error(err);
20
- log_1.Log.error('Remotion CloudRun is not installed.');
21
- log_1.Log.info('');
22
- log_1.Log.info('You can install it using:');
23
- log_1.Log.info(`${installCommand} @remotion/cloudrun@${(0, update_available_1.getRemotionVersion)()}`);
24
- process.exit(1);
25
- }
26
- };
27
- exports.cloudrunCommand = cloudrunCommand;
@@ -1,5 +0,0 @@
1
- import type { FfmpegExecutable } from '@remotion/renderer';
2
- export declare const setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
3
- export declare const getCustomFfmpegExecutable: () => FfmpegExecutable;
4
- export declare const setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
5
- export declare const getCustomFfprobeExecutable: () => FfmpegExecutable;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCustomFfprobeExecutable = exports.setFfprobeExecutable = exports.getCustomFfmpegExecutable = exports.setFfmpegExecutable = void 0;
4
- let currentFfmpegExecutablePath = null;
5
- let currentFfprobeExecutablePath = null;
6
- const setFfmpegExecutable = (ffmpegPath) => {
7
- currentFfmpegExecutablePath = ffmpegPath;
8
- };
9
- exports.setFfmpegExecutable = setFfmpegExecutable;
10
- const getCustomFfmpegExecutable = () => {
11
- return currentFfmpegExecutablePath;
12
- };
13
- exports.getCustomFfmpegExecutable = getCustomFfmpegExecutable;
14
- const setFfprobeExecutable = (ffprobePath) => {
15
- currentFfprobeExecutablePath = ffprobePath;
16
- };
17
- exports.setFfprobeExecutable = setFfprobeExecutable;
18
- const getCustomFfprobeExecutable = () => {
19
- return currentFfprobeExecutablePath;
20
- };
21
- exports.getCustomFfprobeExecutable = getCustomFfprobeExecutable;
@@ -1,2 +0,0 @@
1
- export declare const setQuality: (q: number | undefined) => void;
2
- export declare const getQuality: () => number | undefined;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getQuality = exports.setQuality = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const defaultValue = undefined;
6
- let quality = defaultValue;
7
- const setQuality = (q) => {
8
- renderer_1.RenderInternals.validateQuality(q);
9
- if (q === 0 || q === undefined) {
10
- quality = defaultValue;
11
- return;
12
- }
13
- quality = q;
14
- };
15
- exports.setQuality = setQuality;
16
- const getQuality = () => quality;
17
- exports.getQuality = getQuality;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const ClipboardIcon: React.FC;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClipboardIcon = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const ClipboardIcon = () => {
6
- return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: {
7
- height: 16,
8
- verticalAlign: 'middle',
9
- marginTop: -3,
10
- }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
11
- };
12
- exports.ClipboardIcon = ClipboardIcon;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const CollapsedCompositionSelector: React.FC<{
3
- onExpand: () => void;
4
- }>;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CollapsedCompositionSelector = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const colors_1 = require("../helpers/colors");
7
- const caret_1 = require("../icons/caret");
8
- const z_index_1 = require("../state/z-index");
9
- const CollapsedCompositionSelector = ({ onExpand }) => {
10
- const [hovered, setHovered] = (0, react_1.useState)(false);
11
- const { tabIndex } = (0, z_index_1.useZIndex)();
12
- const onPointerEnter = (0, react_1.useCallback)(() => {
13
- setHovered(true);
14
- }, []);
15
- const onPointerLeave = (0, react_1.useCallback)(() => {
16
- setHovered(false);
17
- }, []);
18
- const style = (0, react_1.useMemo)(() => {
19
- return {
20
- border: 'none',
21
- borderRight: '2px solid black',
22
- cursor: 'pointer',
23
- color: 'white',
24
- display: 'flex',
25
- justifyContent: 'center',
26
- alignItems: 'center',
27
- paddingLeft: 7,
28
- paddingRight: 4,
29
- backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
30
- hovered,
31
- selected: false,
32
- }),
33
- appearance: 'none',
34
- WebkitAppearance: 'none',
35
- };
36
- }, [hovered]);
37
- return ((0, jsx_runtime_1.jsx)("button", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, type: "button", role: "button", tabIndex: tabIndex, onClick: onExpand, children: (0, jsx_runtime_1.jsx)(caret_1.CaretRight, {}) }));
38
- };
39
- exports.CollapsedCompositionSelector = CollapsedCompositionSelector;
@@ -1,6 +0,0 @@
1
- export declare type SerializedJSONWithDate = {
2
- serializedString: string;
3
- customDateUsed: boolean;
4
- };
5
- export declare const serializeJSONWithDate: (data: unknown, indent: number | undefined) => SerializedJSONWithDate;
6
- export declare const deserializeJSONWithDate: (data: string) => any;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeJSONWithDate = exports.serializeJSONWithDate = void 0;
4
- const serializeJSONWithDate = (data, indent) => {
5
- let customDateUsed = false;
6
- const serializedString = JSON.stringify(data, function (key, value) {
7
- if (this[key] instanceof Date) {
8
- customDateUsed = true;
9
- return `remotion-date:${this[key].toISOString()}`;
10
- }
11
- return value;
12
- }, indent);
13
- return { serializedString, customDateUsed };
14
- };
15
- exports.serializeJSONWithDate = serializeJSONWithDate;
16
- const deserializeJSONWithDate = (data) => {
17
- return JSON.parse(data, (_, value) => {
18
- if (typeof value === 'string' && value.startsWith('remotion-date:')) {
19
- return new Date(value.replace('remotion-date:', ''));
20
- }
21
- return value;
22
- });
23
- };
24
- exports.deserializeJSONWithDate = deserializeJSONWithDate;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const RichTimelineToggle: React.FC;