@remotion/cli 4.0.0-alpha6 → 4.0.0-alpha7

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 (117) 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/NewComposition/ComboBox.js +2 -2
  14. package/dist/editor/components/NewComposition/MenuContent.js +1 -1
  15. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  16. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  17. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  18. package/dist/editor/components/RenderModal/RenderModalData.js +21 -7
  19. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +2 -2
  20. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -1
  21. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +3 -2
  22. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
  23. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -1
  24. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  25. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +2 -1
  26. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -8
  27. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +2 -1
  28. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +5 -5
  29. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
  30. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +3 -2
  31. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +3 -2
  32. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +4 -4
  33. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +1 -1
  34. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +2 -1
  35. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +9 -6
  36. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
  37. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +1 -1
  38. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +1 -1
  39. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +40 -7
  40. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +16 -0
  41. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +73 -0
  42. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +2 -1
  43. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +5 -5
  44. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +2 -1
  45. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +4 -0
  46. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
  47. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +3 -0
  48. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.js +126 -0
  49. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +12 -0
  50. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +32 -0
  51. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +3 -2
  52. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +9 -2
  53. package/dist/editor/components/RenderQueue/actions.d.ts +2 -1
  54. package/dist/editor/components/RenderQueue/actions.js +8 -4
  55. package/dist/editor/components/Timeline/TimelineSequence.js +6 -4
  56. package/dist/editor/helpers/calculate-timeline.js +1 -1
  57. package/dist/ffmpeg.js +6 -2
  58. package/dist/handle-common-errors.d.ts +2 -1
  59. package/dist/handle-common-errors.js +2 -2
  60. package/dist/index.d.ts +9 -5
  61. package/dist/index.js +4 -5
  62. package/dist/log.d.ts +5 -5
  63. package/dist/log.js +3 -42
  64. package/dist/parse-command-line.d.ts +1 -0
  65. package/dist/preview-server/dev-middleware/setup-hooks.js +2 -2
  66. package/dist/preview-server/render-queue/job.d.ts +2 -0
  67. package/dist/preview-server/render-queue/queue.js +2 -1
  68. package/dist/preview-server/routes/can-update-default-props.js +1 -0
  69. package/dist/preview-server/routes/update-default-props.js +4 -3
  70. package/dist/print-error.d.ts +2 -1
  71. package/dist/print-error.js +8 -5
  72. package/dist/progress-bar.d.ts +5 -4
  73. package/dist/progress-bar.js +42 -29
  74. package/dist/render-flows/render.js +46 -19
  75. package/dist/render-flows/still.js +17 -12
  76. package/dist/setup-cache.d.ts +2 -1
  77. package/dist/setup-cache.js +8 -4
  78. package/dist/should-use-non-overlaying-logger.d.ts +4 -0
  79. package/dist/should-use-non-overlaying-logger.js +12 -0
  80. package/dist/user-passed-output-location.js +7 -2
  81. package/package.json +7 -7
  82. package/dist/ansi/ansi-regex.d.ts +0 -2
  83. package/dist/ansi/ansi-regex.js +0 -18
  84. package/dist/cloudrun-command.d.ts +0 -1
  85. package/dist/cloudrun-command.js +0 -27
  86. package/dist/config/ffmpeg-executable.d.ts +0 -5
  87. package/dist/config/ffmpeg-executable.js +0 -21
  88. package/dist/config/quality.d.ts +0 -2
  89. package/dist/config/quality.js +0 -17
  90. package/dist/editor/components/ClipboardIcon.d.ts +0 -2
  91. package/dist/editor/components/ClipboardIcon.js +0 -12
  92. package/dist/editor/components/CollapsedCompositionSelector.d.ts +0 -4
  93. package/dist/editor/components/CollapsedCompositionSelector.js +0 -39
  94. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +0 -6
  95. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +0 -24
  96. package/dist/editor/components/RichTimelineToggle.d.ts +0 -2
  97. package/dist/editor/components/RichTimelineToggle.js +0 -29
  98. package/dist/editor/components/Thumbnail.d.ts +0 -8
  99. package/dist/editor/components/Thumbnail.js +0 -76
  100. package/dist/editor/helpers/use-compact-ui.d.ts +0 -1
  101. package/dist/editor/helpers/use-compact-ui.js +0 -18
  102. package/dist/editor/icons/film.d.ts +0 -3
  103. package/dist/editor/icons/film.js +0 -8
  104. package/dist/editor/icons/timeline.d.ts +0 -3
  105. package/dist/editor/icons/timeline.js +0 -9
  106. package/dist/editor/state/rich-timeline.d.ts +0 -9
  107. package/dist/editor/state/rich-timeline.js +0 -17
  108. package/dist/get-render-media-options.d.ts +0 -8
  109. package/dist/get-render-media-options.js +0 -55
  110. package/dist/install.d.ts +0 -2
  111. package/dist/install.js +0 -36
  112. package/dist/is-javascript.d.ts +0 -2
  113. package/dist/is-javascript.js +0 -9
  114. package/dist/preview-server/dev-middleware/is-color-supported.d.ts +0 -1
  115. package/dist/preview-server/dev-middleware/is-color-supported.js +0 -37
  116. package/dist/preview-server/hot-middleware/strip-ansi.d.ts +0 -1
  117. package/dist/preview-server/hot-middleware/strip-ansi.js +0 -21
@@ -6,25 +6,28 @@ const chalk_1 = require("./chalk");
6
6
  const code_frame_1 = require("./code-frame");
7
7
  const log_1 = require("./log");
8
8
  const progress_bar_1 = require("./progress-bar");
9
- const printError = async (err) => {
9
+ const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
10
+ const printError = async (err, logLevel) => {
10
11
  if (err instanceof renderer_1.RenderInternals.SymbolicateableError) {
11
12
  const output = (0, progress_bar_1.createOverwriteableCliOutput)({
12
13
  quiet: false,
13
14
  cancelSignal: null,
15
+ updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
16
+ indent: false,
14
17
  });
15
- output.update(chalk_1.chalk.red('Symbolicating minified error message...\n' + err.message));
18
+ output.update(chalk_1.chalk.red('Symbolicating minified error message...\n' + err.message), false);
16
19
  try {
17
20
  const symbolicated = await renderer_1.RenderInternals.symbolicateError(err);
18
21
  if (symbolicated.frame === null) {
19
- output.update(chalk_1.chalk.red('An error occurred:\n'));
22
+ output.update(chalk_1.chalk.red('An error occurred:'), true);
20
23
  }
21
24
  else {
22
- output.update(chalk_1.chalk.red(`An error occurred while rendering frame ${err.frame}:\n`));
25
+ output.update(chalk_1.chalk.red(`An error occurred while rendering frame ${err.frame}:`), true);
23
26
  }
24
27
  (0, code_frame_1.printCodeFrameAndStack)(symbolicated);
25
28
  }
26
29
  catch (e) {
27
- output.update(chalk_1.chalk.red('(Error occurred symbolicating stack trace - printing minified stack trace)\n'));
30
+ output.update(chalk_1.chalk.red('(Error occurred symbolicating stack trace - printing minified stack trace)'), true);
28
31
  log_1.Log.error();
29
32
  log_1.Log.error(err.stack || err);
30
33
  }
@@ -1,11 +1,13 @@
1
1
  import type { CancelSignal } from '@remotion/renderer';
2
2
  import type { AggregateRenderProgress } from './progress-types';
3
3
  export declare type OverwriteableCliOutput = {
4
- update: (up: string) => boolean;
4
+ update: (up: string, newline: boolean) => boolean;
5
5
  };
6
6
  export declare const createOverwriteableCliOutput: (options: {
7
7
  quiet: boolean;
8
8
  cancelSignal: CancelSignal | null;
9
+ updatesDontOverwrite: boolean;
10
+ indent: boolean;
9
11
  }) => OverwriteableCliOutput;
10
12
  export declare type CopyingState = {
11
13
  bytes: number;
@@ -22,10 +24,9 @@ export declare const makeBundlingAndCopyProgress: ({ bundling, copying, symLinks
22
24
  bundling: BundlingState;
23
25
  copying: CopyingState;
24
26
  symLinks: SymbolicLinksState;
25
- }, indent: boolean, bundlingStep: number, steps: number) => string;
26
- export declare const makeRenderingAndStitchingProgress: ({ prog, indent, steps, stitchingStep, }: {
27
+ }, bundlingStep: number, steps: number) => string;
28
+ export declare const makeRenderingAndStitchingProgress: ({ prog, steps, stitchingStep, }: {
27
29
  prog: AggregateRenderProgress;
28
- indent: boolean;
29
30
  steps: number;
30
31
  stitchingStep: number;
31
32
  }) => {
@@ -5,7 +5,6 @@ const renderer_1 = require("@remotion/renderer");
5
5
  const ansi_diff_1 = require("./ansi/ansi-diff");
6
6
  const chalk_1 = require("./chalk");
7
7
  const download_progress_1 = require("./download-progress");
8
- const log_1 = require("./log");
9
8
  const make_progress_bar_1 = require("./make-progress-bar");
10
9
  const truthy_1 = require("./truthy");
11
10
  const createOverwriteableCliOutput = (options) => {
@@ -15,19 +14,46 @@ const createOverwriteableCliOutput = (options) => {
15
14
  update: () => false,
16
15
  };
17
16
  }
17
+ if (options.updatesDontOverwrite) {
18
+ return {
19
+ update: (up) => {
20
+ if (options.indent) {
21
+ process.stdout.write(up
22
+ .split('\n')
23
+ .filter((a) => a.trim())
24
+ .map((l) => {
25
+ return `${renderer_1.RenderInternals.INDENT_TOKEN} ${l}`;
26
+ })
27
+ .join('\n'));
28
+ }
29
+ else {
30
+ process.stdout.write(up + '\n');
31
+ }
32
+ return true;
33
+ },
34
+ };
35
+ }
18
36
  const diff = new ansi_diff_1.AnsiDiff();
19
37
  (_a = options.cancelSignal) === null || _a === void 0 ? void 0 : _a.call(options, () => {
20
38
  process.stdout.write(diff.finish());
21
39
  });
22
40
  return {
23
- update: (up) => process.stdout.write(diff.update(up)),
41
+ update: (up, newline) => {
42
+ if (options.indent) {
43
+ return process.stdout.write(diff.update(up
44
+ .split('\n')
45
+ .filter((a) => a.trim())
46
+ .map((l) => `${renderer_1.RenderInternals.INDENT_TOKEN} ${l}`)
47
+ .join('\n') + (newline ? '\n' : '')));
48
+ }
49
+ return process.stdout.write(diff.update(up + (newline ? '\n' : '')));
50
+ },
24
51
  };
25
52
  };
26
53
  exports.createOverwriteableCliOutput = createOverwriteableCliOutput;
27
- const makeBundlingProgress = ({ bundlingState, indent, bundlingStep, steps, }) => {
54
+ const makeBundlingProgress = ({ bundlingState, bundlingStep, steps, }) => {
28
55
  const { doneIn, progress } = bundlingState;
29
56
  return [
30
- indent ? log_1.INDENT_TOKEN : null,
31
57
  `(${bundlingStep + 1}/${steps})`,
32
58
  (0, make_progress_bar_1.makeProgressBar)(progress),
33
59
  `${doneIn ? 'Bundled' : 'Bundling'} code`,
@@ -38,13 +64,12 @@ const makeBundlingProgress = ({ bundlingState, indent, bundlingStep, steps, }) =
38
64
  .filter(truthy_1.truthy)
39
65
  .join(' ');
40
66
  };
41
- const makeCopyingProgress = (options, indent) => {
67
+ const makeCopyingProgress = (options) => {
42
68
  // Don't show copy progress lower than 200MB
43
69
  if (options.bytes < 1000 * 1000 * 200) {
44
70
  return null;
45
71
  }
46
72
  return [
47
- indent ? log_1.INDENT_TOKEN : null,
48
73
  ' +',
49
74
  options.doneIn ? (0, make_progress_bar_1.makeProgressBar)(1) : (0, download_progress_1.getFileSizeDownloadBar)(options.bytes),
50
75
  'Copying public dir',
@@ -53,7 +78,7 @@ const makeCopyingProgress = (options, indent) => {
53
78
  .filter(truthy_1.truthy)
54
79
  .join(' ');
55
80
  };
56
- const makeSymlinkProgress = (options, indent) => {
81
+ const makeSymlinkProgress = (options) => {
57
82
  if (options.symlinks.length === 0) {
58
83
  return null;
59
84
  }
@@ -62,40 +87,30 @@ const makeSymlinkProgress = (options, indent) => {
62
87
  chalk_1.chalk.gray(` Found a symbolic link in the public folder:`),
63
88
  chalk_1.chalk.gray(' ' + options.symlinks[0]),
64
89
  chalk_1.chalk.gray(' The symlink will be forwarded in to the bundle.'),
65
- ]
66
- .map((l) => {
67
- return indent ? `${log_1.INDENT_TOKEN} ${l}` : null;
68
- })
69
- .join('\n');
90
+ ].join('\n');
70
91
  }
71
92
  return [
72
93
  chalk_1.chalk.gray(` Found ${options.symlinks.length} symbolic links in the public folder.`),
73
94
  chalk_1.chalk.gray(' The symlinks will be forwarded in to the bundle.'),
74
- ]
75
- .map((l) => {
76
- return indent ? `${log_1.INDENT_TOKEN} ${l}` : null;
77
- })
78
- .join('\n');
95
+ ].join('\n');
79
96
  };
80
- const makeBundlingAndCopyProgress = ({ bundling, copying, symLinks, }, indent, bundlingStep, steps) => {
97
+ const makeBundlingAndCopyProgress = ({ bundling, copying, symLinks, }, bundlingStep, steps) => {
81
98
  return [
82
99
  makeBundlingProgress({
83
100
  bundlingState: bundling,
84
- indent,
85
101
  bundlingStep,
86
102
  steps,
87
103
  }),
88
- makeCopyingProgress(copying, indent),
89
- makeSymlinkProgress(symLinks, indent),
104
+ makeCopyingProgress(copying),
105
+ makeSymlinkProgress(symLinks),
90
106
  ]
91
107
  .filter(truthy_1.truthy)
92
108
  .join('\n');
93
109
  };
94
110
  exports.makeBundlingAndCopyProgress = makeBundlingAndCopyProgress;
95
- const makeRenderingProgress = ({ frames, totalFrames, steps, concurrency, doneIn }, indent) => {
111
+ const makeRenderingProgress = ({ frames, totalFrames, steps, concurrency, doneIn, }) => {
96
112
  const progress = frames / totalFrames;
97
113
  return [
98
- indent ? log_1.INDENT_TOKEN : null,
99
114
  `(${steps.indexOf('rendering') + 1}/${steps.length})`,
100
115
  (0, make_progress_bar_1.makeProgressBar)(progress),
101
116
  [doneIn ? 'Rendered' : 'Rendering', `frames (${concurrency}x)`]
@@ -106,7 +121,7 @@ const makeRenderingProgress = ({ frames, totalFrames, steps, concurrency, doneIn
106
121
  .filter(truthy_1.truthy)
107
122
  .join(' ');
108
123
  };
109
- const makeStitchingProgress = ({ stitchingProgress, indent, steps, stitchingStep, }) => {
124
+ const makeStitchingProgress = ({ stitchingProgress, steps, stitchingStep, }) => {
110
125
  const { frames, totalFrames, doneIn, stage, codec } = stitchingProgress;
111
126
  const progress = frames / totalFrames;
112
127
  const mediaType = codec === 'gif'
@@ -115,7 +130,6 @@ const makeStitchingProgress = ({ stitchingProgress, indent, steps, stitchingStep
115
130
  ? 'audio'
116
131
  : 'video';
117
132
  return [
118
- indent ? log_1.INDENT_TOKEN : null,
119
133
  `(${stitchingStep + 1}/${steps})`,
120
134
  (0, make_progress_bar_1.makeProgressBar)(progress),
121
135
  stage === 'muxing' && renderer_1.RenderInternals.canUseParallelEncoding(codec)
@@ -126,16 +140,15 @@ const makeStitchingProgress = ({ stitchingProgress, indent, steps, stitchingStep
126
140
  .filter(truthy_1.truthy)
127
141
  .join(' ');
128
142
  };
129
- const makeRenderingAndStitchingProgress = ({ prog, indent, steps, stitchingStep, }) => {
143
+ const makeRenderingAndStitchingProgress = ({ prog, steps, stitchingStep, }) => {
130
144
  const { rendering, stitching, downloads, bundling } = prog;
131
145
  const output = [
132
- rendering ? makeRenderingProgress(rendering, indent) : null,
133
- (0, download_progress_1.makeMultiDownloadProgress)(downloads, indent),
146
+ rendering ? makeRenderingProgress(rendering) : null,
147
+ (0, download_progress_1.makeMultiDownloadProgress)(downloads),
134
148
  stitching === null
135
149
  ? null
136
150
  : makeStitchingProgress({
137
151
  stitchingProgress: stitching,
138
- indent,
139
152
  steps,
140
153
  stitchingStep,
141
154
  }),
@@ -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-alpha7",
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-alpha7",
32
+ "@remotion/media-utils": "4.0.0-alpha7",
33
+ "@remotion/player": "4.0.0-alpha7",
34
+ "@remotion/renderer": "4.0.0-alpha7",
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-alpha7",
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-alpha7",
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;