@remotion/cli 4.0.14 → 4.0.15

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.
@@ -0,0 +1 @@
1
+ export declare const cloudrunCommand: (remotionRoot: string, args: string[]) => Promise<never>;
@@ -0,0 +1,27 @@
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;
@@ -2,4 +2,4 @@ import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
2
2
  export declare const setStillImageFormat: (format: StillImageFormat) => void;
3
3
  export declare const setVideoImageFormat: (format: VideoImageFormat) => void;
4
4
  export declare const getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
5
- export declare const getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
5
+ export declare const getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
@@ -297,7 +297,7 @@ export declare const ConfigInternals: {
297
297
  getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
298
298
  getDotEnvLocation: () => string | null;
299
299
  getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
300
- getUserPreferredVideoImageFormat: () => "none" | "png" | "jpeg" | undefined;
300
+ getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
301
301
  getWebpackOverrideFn: () => WebpackOverrideFn;
302
302
  getWebpackCaching: () => boolean;
303
303
  getOutputLocation: () => string | null;
@@ -13,5 +13,5 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
15
  }) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
16
- export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status" | "rightAlign"> & React.RefAttributes<HTMLInputElement>>;
16
+ export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
4
4
  status: RemInputStatus;
5
5
  name: string;
6
6
  };
7
- export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status"> & React.RefAttributes<HTMLInputElement>>;
7
+ export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
8
8
  export {};
@@ -3,5 +3,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaEleme
3
3
  status: 'error' | 'warning' | 'ok';
4
4
  };
5
5
  export declare const inputBaseStyle: React.CSSProperties;
6
- export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
6
+ export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
7
7
  export {};
@@ -1,2 +1,2 @@
1
1
  import type { Codec } from '@remotion/renderer';
2
- export declare const humanReadableCodec: (codec: Codec) => "AAC" | "MP3" | "GIF" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
2
+ export declare const humanReadableCodec: (codec: Codec) => "GIF" | "AAC" | "MP3" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
@@ -33,5 +33,5 @@ export declare const getCliOptions: (options: {
33
33
  videoBitrate: string | null;
34
34
  height: number | null;
35
35
  width: number | null;
36
- configFileImageFormat: "none" | "png" | "jpeg" | undefined;
36
+ configFileImageFormat: "png" | "jpeg" | "none" | undefined;
37
37
  }>;
@@ -27,8 +27,8 @@ const handleCommonError = async (err, logLevel) => {
27
27
  }
28
28
  if (err.message.includes('Error creating WebGL context')) {
29
29
  log_1.Log.info();
30
- log_1.Log.info('💡 You might need to set the OpenGL renderer to "angle"');
31
- log_1.Log.info('💡 Get help for this issue at https://www.remotion.dev/docs/three');
30
+ log_1.Log.warn('💡 You might need to set the OpenGL renderer to "angle" (or "swangle" if rendering on lambda). Learn why at https://www.remotion.dev/docs/three');
31
+ log_1.Log.warn("💡 Check how it's done at https://www.remotion.dev/docs/chromium-flags#--gl");
32
32
  }
33
33
  if (err.message.includes('The bucket does not allow ACLs')) {
34
34
  log_1.Log.info();
package/dist/index.d.ts CHANGED
@@ -118,7 +118,7 @@ export declare const CliInternals: {
118
118
  videoBitrate: string | null;
119
119
  height: number | null;
120
120
  width: number | null;
121
- configFileImageFormat: "none" | "png" | "jpeg" | undefined;
121
+ configFileImageFormat: "png" | "jpeg" | "none" | undefined;
122
122
  }>;
123
123
  loadConfig: (remotionRoot: string) => Promise<string | null>;
124
124
  initializeCli: (remotionRoot: string) => Promise<void>;
@@ -127,7 +127,7 @@ export declare const CliInternals: {
127
127
  parsedCli: {
128
128
  "browser-executable": import("@remotion/renderer").BrowserExecutable;
129
129
  "pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
130
- "image-format": "none" | "png" | "jpeg" | "pdf" | "webp";
130
+ "image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
131
131
  "prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
132
132
  "bundle-cache": string;
133
133
  "env-file": string;
@@ -136,6 +136,7 @@ export declare const CliInternals: {
136
136
  "every-nth-frame": number;
137
137
  "number-of-gif-loops": number;
138
138
  "number-of-shared-audio-tags": number;
139
+ version: string;
139
140
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
140
141
  concurrency: number;
141
142
  timeout: number;
@@ -191,7 +192,7 @@ export declare const CliInternals: {
191
192
  downloadName: string | null;
192
193
  outName: string | null;
193
194
  configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
194
- cliFlag: "none" | "png" | "jpeg" | "pdf" | "webp" | null;
195
+ cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
195
196
  isLambda: boolean;
196
197
  fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
197
198
  }) => {
@@ -206,8 +207,8 @@ export declare const CliInternals: {
206
207
  };
207
208
  getVideoImageFormat: ({ codec, uiImageFormat, }: {
208
209
  codec: import("@remotion/renderer").CodecOrUndefined;
209
- uiImageFormat: "none" | "png" | "jpeg" | null;
210
- }) => "none" | "png" | "jpeg";
210
+ uiImageFormat: "png" | "jpeg" | "none" | null;
211
+ }) => "png" | "jpeg" | "none";
211
212
  printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
212
213
  getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, }: {
213
214
  cliFlag: import("@remotion/renderer").CodecOrUndefined;
package/dist/index.js CHANGED
@@ -90,7 +90,7 @@ const cli = async () => {
90
90
  (0, ffmpeg_1.ffprobeCommand)(remotionRoot, process.argv.slice(3));
91
91
  }
92
92
  else if (command === 'upgrade') {
93
- await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager']);
93
+ await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager'], parse_command_line_1.parsedCli.version);
94
94
  }
95
95
  else if (command === versions_1.VERSIONS_COMMAND) {
96
96
  await (0, versions_1.versionsCommand)(remotionRoot);
@@ -0,0 +1,12 @@
1
+ import type { LogLevel, RenderMediaOnDownload } from '@remotion/renderer';
2
+ import type { DownloadProgress } from './progress-types';
3
+ export declare const makeOnDownload: ({ indent, logLevel, updatesDontOverwrite, downloads, updateRenderProgress, }: {
4
+ indent: boolean;
5
+ logLevel: LogLevel;
6
+ updatesDontOverwrite: boolean;
7
+ downloads: DownloadProgress[];
8
+ updateRenderProgress: (progress: {
9
+ newline: boolean;
10
+ printToConsole: boolean;
11
+ }) => void;
12
+ }) => RenderMediaOnDownload;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeOnDownload = void 0;
4
+ const format_bytes_1 = require("./format-bytes");
5
+ const log_1 = require("./log");
6
+ const makeOnDownload = ({ indent, logLevel, updatesDontOverwrite, downloads, updateRenderProgress, }) => {
7
+ return (src) => {
8
+ const id = Math.random();
9
+ const download = {
10
+ id,
11
+ name: src,
12
+ progress: 0,
13
+ downloaded: 0,
14
+ totalBytes: null,
15
+ };
16
+ const nextDownloadIndex = downloads.length;
17
+ downloads.push(download);
18
+ log_1.Log.verboseAdvanced({ indent, logLevel }, `Starting download [${nextDownloadIndex}]:`, src);
19
+ updateRenderProgress({
20
+ newline: false,
21
+ printToConsole: !updatesDontOverwrite,
22
+ });
23
+ let lastUpdate = Date.now();
24
+ return ({ percent, downloaded, totalSize }) => {
25
+ download.progress = percent;
26
+ download.totalBytes = totalSize;
27
+ download.downloaded = downloaded;
28
+ if (lastUpdate + 1000 > Date.now() && updatesDontOverwrite) {
29
+ return;
30
+ }
31
+ lastUpdate = Date.now();
32
+ log_1.Log.verboseAdvanced({ indent, logLevel }, `Download [${nextDownloadIndex}]:`, percent ? `${(percent * 100).toFixed(1)}%` : (0, format_bytes_1.formatBytes)(downloaded));
33
+ updateRenderProgress({
34
+ newline: false,
35
+ printToConsole: !updatesDontOverwrite,
36
+ });
37
+ };
38
+ };
39
+ };
40
+ exports.makeOnDownload = makeOnDownload;
@@ -11,6 +11,7 @@ type CommandLineOptions = {
11
11
  ['every-nth-frame']: number;
12
12
  ['number-of-gif-loops']: number;
13
13
  ['number-of-shared-audio-tags']: number;
14
+ version: string;
14
15
  codec: Codec;
15
16
  concurrency: number;
16
17
  timeout: number;
@@ -11,5 +11,5 @@ type Range = {
11
11
  type Ranges = Range[] & {
12
12
  type?: string;
13
13
  };
14
- export declare function parseRange(size: number, str: string | string[]): -1 | -2 | Ranges;
14
+ export declare function parseRange(size: number, str: string | string[]): -1 | Ranges | -2;
15
15
  export {};
@@ -37,7 +37,7 @@ const processStill = async ({ job, remotionRoot, entryPoint, onProgress, addClea
37
37
  imageFormatFromUi: job.imageFormat,
38
38
  logLevel: job.verbose ? 'verbose' : 'info',
39
39
  onProgress,
40
- indentOutput: true,
40
+ indent: true,
41
41
  addCleanupCallback,
42
42
  cancelSignal: job.cancelToken.cancelSignal,
43
43
  outputLocationFromUi: job.outName,
@@ -5,6 +5,7 @@ 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 format_bytes_1 = require("./format-bytes");
8
9
  const make_progress_bar_1 = require("./make-progress-bar");
9
10
  const truthy_1 = require("./truthy");
10
11
  const createOverwriteableCliOutput = (options) => {
@@ -171,13 +172,7 @@ const getGuiProgressSubtitle = (progress) => {
171
172
  return `Bundling ${Math.round(progress.bundling.progress * 100)}%`;
172
173
  }
173
174
  if (progress.copyingState.doneIn === null) {
174
- const bytes = new Intl.NumberFormat('en', {
175
- notation: 'compact',
176
- style: 'unit',
177
- unit: 'byte',
178
- unitDisplay: 'narrow',
179
- });
180
- return `Copying public dir ${bytes.format(progress.copyingState.bytes)}`;
175
+ return `Copying public dir ${(0, format_bytes_1.formatBytes)(progress.copyingState.bytes)}`;
181
176
  }
182
177
  if (!progress.rendering) {
183
178
  return `Getting compositions`;
@@ -40,6 +40,7 @@ const get_filename_1 = require("../get-filename");
40
40
  const get_final_output_codec_1 = require("../get-final-output-codec");
41
41
  const image_formats_1 = require("../image-formats");
42
42
  const log_1 = require("../log");
43
+ const make_on_download_1 = require("../make-on-download");
43
44
  const parse_command_line_1 = require("../parse-command-line");
44
45
  const progress_bar_1 = require("../progress-bar");
45
46
  const setup_cache_1 = require("../setup-cache");
@@ -83,7 +84,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
83
84
  bytes: 0,
84
85
  doneIn: null,
85
86
  };
86
- const updateRenderProgress = (newline) => {
87
+ const updateRenderProgress = ({ newline, printToConsole, }) => {
87
88
  const aggregateRenderProgress = {
88
89
  rendering: renderingProgress,
89
90
  stitching: shouldOutputImageSequence ? null : stitchingProgress,
@@ -97,7 +98,9 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
97
98
  stitchingStep: steps.indexOf('stitching'),
98
99
  });
99
100
  onProgress({ message, value: progress, ...aggregateRenderProgress });
100
- return renderProgress.update(updatesDontOverwrite ? message : output, newline);
101
+ if (printToConsole) {
102
+ renderProgress.update(updatesDontOverwrite ? message : output, newline);
103
+ }
101
104
  };
102
105
  const { urlOrBundle, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
103
106
  fullPath: fullEntryPoint,
@@ -106,7 +109,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
106
109
  onProgress: ({ bundling, copying }) => {
107
110
  bundlingProgress = bundling;
108
111
  copyingState = copying;
109
- updateRenderProgress(false);
112
+ updateRenderProgress({ newline: false, printToConsole: true });
110
113
  },
111
114
  indentOutput: indent,
112
115
  logLevel,
@@ -118,24 +121,13 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
118
121
  quietProgress: updatesDontOverwrite,
119
122
  });
120
123
  addCleanupCallback(() => cleanupBundle());
121
- const onDownload = (src) => {
122
- const id = Math.random();
123
- const download = {
124
- id,
125
- name: src,
126
- progress: 0,
127
- downloaded: 0,
128
- totalBytes: null,
129
- };
130
- downloads.push(download);
131
- updateRenderProgress(false);
132
- return ({ percent, downloaded, totalSize }) => {
133
- download.progress = percent;
134
- download.totalBytes = totalSize;
135
- download.downloaded = downloaded;
136
- updateRenderProgress(false);
137
- };
138
- };
124
+ const onDownload = (0, make_on_download_1.makeOnDownload)({
125
+ downloads,
126
+ indent,
127
+ logLevel,
128
+ updateRenderProgress,
129
+ updatesDontOverwrite,
130
+ });
139
131
  const puppeteerInstance = await browserInstance;
140
132
  addCleanupCallback(() => puppeteerInstance.close(false, logLevel, indent));
141
133
  const actualConcurrency = renderer_1.RenderInternals.getActualConcurrency(concurrency);
@@ -220,7 +212,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
220
212
  serializedInputPropsWithCustomSchema,
221
213
  onFrameUpdate: (rendered) => {
222
214
  renderingProgress.frames = rendered;
223
- updateRenderProgress(false);
215
+ updateRenderProgress({ newline: false, printToConsole: true });
224
216
  },
225
217
  onStart: () => undefined,
226
218
  onDownload,
@@ -251,7 +243,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
251
243
  data: config.props,
252
244
  }).serializedString,
253
245
  });
254
- updateRenderProgress(true);
246
+ updateRenderProgress({ newline: true, printToConsole: true });
255
247
  log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`▶ ${absoluteOutputFile}`));
256
248
  return;
257
249
  }
@@ -303,7 +295,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
303
295
  update.renderedDoneIn;
304
296
  renderingProgress.frames =
305
297
  update.renderedFrames;
306
- updateRenderProgress(false);
298
+ updateRenderProgress({ newline: false, printToConsole: true });
307
299
  },
308
300
  puppeteerInstance,
309
301
  onDownload,
@@ -323,7 +315,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
323
315
  staticBase: null,
324
316
  }).serializedString,
325
317
  });
326
- updateRenderProgress(true);
318
+ updateRenderProgress({ newline: true, printToConsole: true });
327
319
  log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputFile}`));
328
320
  log_1.Log.verboseAdvanced({ indent, logLevel }, `Slowest frames:`);
329
321
  slowestFrames.forEach(({ frame, time }) => {
@@ -1,6 +1,6 @@
1
1
  import type { Browser, BrowserExecutable, CancelSignal, ChromiumOptions, LogLevel, StillImageFormat } from '@remotion/renderer';
2
2
  import type { JobProgressCallback } from '../preview-server/render-queue/job';
3
- export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indentOutput, addCleanupCallback, cancelSignal, outputLocationFromUi, }: {
3
+ export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indent, addCleanupCallback, cancelSignal, outputLocationFromUi, }: {
4
4
  remotionRoot: string;
5
5
  fullEntryPoint: string;
6
6
  entryPointReason: string;
@@ -23,7 +23,7 @@ export declare const renderStillFlow: ({ remotionRoot, fullEntryPoint, entryPoin
23
23
  imageFormatFromUi: StillImageFormat | null;
24
24
  logLevel: LogLevel;
25
25
  onProgress: JobProgressCallback;
26
- indentOutput: boolean;
26
+ indent: boolean;
27
27
  addCleanupCallback: (cb: () => void) => void;
28
28
  cancelSignal: CancelSignal | null;
29
29
  outputLocationFromUi: string | null;
@@ -16,6 +16,7 @@ const determine_image_format_1 = require("../determine-image-format");
16
16
  const get_cli_options_1 = require("../get-cli-options");
17
17
  const get_composition_with_dimension_override_1 = require("../get-composition-with-dimension-override");
18
18
  const log_1 = require("../log");
19
+ const make_on_download_1 = require("../make-on-download");
19
20
  const parse_command_line_1 = require("../parse-command-line");
20
21
  const progress_bar_1 = require("../progress-bar");
21
22
  const progress_types_1 = require("../progress-types");
@@ -23,36 +24,40 @@ const setup_cache_1 = require("../setup-cache");
23
24
  const should_use_non_overlaying_logger_1 = require("../should-use-non-overlaying-logger");
24
25
  const truthy_1 = require("../truthy");
25
26
  const user_passed_output_location_1 = require("../user-passed-output-location");
26
- const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indentOutput, addCleanupCallback, cancelSignal, outputLocationFromUi, }) => {
27
+ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason, remainingArgs, browser, browserExecutable, chromiumOptions, envVariables, height, serializedInputPropsWithCustomSchema, overwrite, port, publicDir, puppeteerTimeout, jpegQuality, scale, stillFrame, width, compositionIdFromUi, imageFormatFromUi, logLevel, onProgress, indent, addCleanupCallback, cancelSignal, outputLocationFromUi, }) => {
27
28
  var _a, _b;
28
- const downloads = [];
29
29
  const aggregate = (0, progress_types_1.initialAggregateRenderProgress)();
30
30
  const updatesDontOverwrite = (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel });
31
- let renderProgress = null;
31
+ const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
32
+ quiet: (0, parse_command_line_1.quietFlagProvided)(),
33
+ cancelSignal,
34
+ updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
35
+ indent,
36
+ });
32
37
  const steps = [
33
38
  renderer_1.RenderInternals.isServeUrl(fullEntryPoint) ? null : 'bundling',
34
39
  'rendering',
35
40
  ].filter(truthy_1.truthy);
36
- const updateProgress = (newline) => {
41
+ const updateRenderProgress = ({ newline, printToConsole, }) => {
37
42
  const { output, progress, message } = (0, progress_bar_1.makeRenderingAndStitchingProgress)({
38
43
  prog: aggregate,
39
44
  steps: steps.length,
40
45
  stitchingStep: steps.indexOf('stitching'),
41
46
  });
42
- if (renderProgress) {
47
+ if (printToConsole) {
43
48
  renderProgress.update(updatesDontOverwrite ? message : output, newline);
44
49
  }
45
50
  onProgress({ message, value: progress, ...aggregate });
46
51
  };
47
52
  if (browserExecutable) {
48
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, 'Browser executable: ', browserExecutable);
53
+ log_1.Log.verboseAdvanced({ indent, logLevel }, 'Browser executable: ', browserExecutable);
49
54
  }
50
55
  const browserInstance = renderer_1.RenderInternals.internalOpenBrowser({
51
56
  browser,
52
57
  browserExecutable,
53
58
  chromiumOptions,
54
59
  forceDeviceScaleFactor: scale,
55
- indent: indentOutput,
60
+ indent,
56
61
  viewport: null,
57
62
  logLevel,
58
63
  });
@@ -64,9 +69,9 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
64
69
  onProgress: ({ copying, bundling }) => {
65
70
  aggregate.bundling = bundling;
66
71
  aggregate.copyingState = copying;
67
- updateProgress(false);
72
+ updateRenderProgress({ newline: false, printToConsole: true });
68
73
  },
69
- indentOutput,
74
+ indentOutput: indent,
70
75
  logLevel,
71
76
  bundlingStep: steps.indexOf('bundling'),
72
77
  onDirectoryCreated: (dir) => {
@@ -78,7 +83,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
78
83
  });
79
84
  const server = await renderer_1.RenderInternals.prepareServer({
80
85
  concurrency: 1,
81
- indent: indentOutput,
86
+ indent,
82
87
  port,
83
88
  remotionRoot,
84
89
  logLevel,
@@ -87,7 +92,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
87
92
  addCleanupCallback(() => server.closeServer(false));
88
93
  addCleanupCallback(() => cleanupBundle());
89
94
  const puppeteerInstance = await browserInstance;
90
- addCleanupCallback(() => puppeteerInstance.close(false, logLevel, indentOutput));
95
+ addCleanupCallback(() => puppeteerInstance.close(false, logLevel, indent));
91
96
  const { compositionId, config, reason, argsAfterComposition } = await (0, get_composition_with_dimension_override_1.getCompositionWithDimensionOverride)({
92
97
  height,
93
98
  width,
@@ -96,7 +101,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
96
101
  browserExecutable,
97
102
  chromiumOptions,
98
103
  envVariables,
99
- indent: indentOutput,
104
+ indent,
100
105
  serializedInputPropsWithCustomSchema,
101
106
  port,
102
107
  puppeteerInstance,
@@ -125,14 +130,8 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
125
130
  (0, node_fs_1.mkdirSync)(node_path_1.default.join(absoluteOutputLocation, '..'), {
126
131
  recursive: true,
127
132
  });
128
- log_1.Log.verboseAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
129
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`));
130
- renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
131
- quiet: (0, parse_command_line_1.quietFlagProvided)(),
132
- cancelSignal,
133
- updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
134
- indent: indentOutput,
135
- });
133
+ log_1.Log.verboseAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Entry point = ${fullEntryPoint} (${entryPointReason})`));
134
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.gray(`Composition = ${compositionId} (${reason}), Format = ${imageFormat} (${source}), Output = ${relativeOutputLocation}`));
136
135
  const renderStart = Date.now();
137
136
  aggregate.rendering = {
138
137
  frames: 0,
@@ -141,23 +140,14 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
141
140
  steps,
142
141
  totalFrames: 1,
143
142
  };
144
- updateProgress(false);
145
- const onDownload = (src) => {
146
- const id = Math.random();
147
- const download = {
148
- id,
149
- name: src,
150
- progress: 0,
151
- downloaded: 0,
152
- totalBytes: null,
153
- };
154
- downloads.push(download);
155
- updateProgress(false);
156
- return ({ percent }) => {
157
- download.progress = percent;
158
- updateProgress(false);
159
- };
160
- };
143
+ updateRenderProgress({ newline: false, printToConsole: true });
144
+ const onDownload = (0, make_on_download_1.makeOnDownload)({
145
+ downloads: aggregate.downloads,
146
+ indent,
147
+ logLevel,
148
+ updateRenderProgress,
149
+ updatesDontOverwrite,
150
+ });
161
151
  await renderer_1.RenderInternals.internalRenderStill({
162
152
  composition: config,
163
153
  frame: stillFrame,
@@ -177,7 +167,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
177
167
  puppeteerInstance,
178
168
  server: await server,
179
169
  cancelSignal,
180
- indent: indentOutput,
170
+ indent,
181
171
  onBrowserLog: null,
182
172
  logLevel,
183
173
  serializedResolvedPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
@@ -193,7 +183,7 @@ const renderStillFlow = async ({ remotionRoot, fullEntryPoint, entryPointReason,
193
183
  steps,
194
184
  totalFrames: 1,
195
185
  };
196
- updateProgress(true);
197
- log_1.Log.infoAdvanced({ indent: indentOutput, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputLocation}`));
186
+ updateRenderProgress({ newline: true, printToConsole: true });
187
+ log_1.Log.infoAdvanced({ indent, logLevel }, chalk_1.chalk.blue(`${exists ? '○' : '+'} ${absoluteOutputLocation}`));
198
188
  };
199
189
  exports.renderStillFlow = renderStillFlow;
package/dist/still.js CHANGED
@@ -54,7 +54,7 @@ const still = async (remotionRoot, args) => {
54
54
  imageFormatFromUi: null,
55
55
  logLevel,
56
56
  onProgress: () => undefined,
57
- indentOutput: false,
57
+ indent: false,
58
58
  addCleanupCallback: (c) => {
59
59
  (0, cleanup_before_quit_1.registerCleanupJob)(c);
60
60
  },
package/dist/upgrade.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const upgrade: (remotionRoot: string, packageManager: string | undefined) => Promise<void>;
1
+ export declare const upgrade: (remotionRoot: string, packageManager: string | undefined, version: string | undefined) => Promise<void>;
package/dist/upgrade.js CHANGED
@@ -20,7 +20,7 @@ const getUpgradeCommand = ({ manager, packages, version, }) => {
20
20
  };
21
21
  return commands[manager];
22
22
  };
23
- const upgrade = async (remotionRoot, packageManager) => {
23
+ const upgrade = async (remotionRoot, packageManager, version) => {
24
24
  var _a, _b, _c, _d;
25
25
  const packageJsonFilePath = node_path_1.default.join(remotionRoot, 'package.json');
26
26
  const packageJson = require(packageJsonFilePath);
@@ -28,8 +28,15 @@ const upgrade = async (remotionRoot, packageManager) => {
28
28
  const devDependencies = Object.keys((_a = packageJson.devDependencies) !== null && _a !== void 0 ? _a : {});
29
29
  const optionalDependencies = Object.keys((_b = packageJson.optionalDependencies) !== null && _b !== void 0 ? _b : {});
30
30
  const peerDependencies = Object.keys((_c = packageJson.peerDependencies) !== null && _c !== void 0 ? _c : {});
31
- const latestRemotionVersion = await (0, get_latest_remotion_version_1.getLatestRemotionVersion)();
32
- log_1.Log.info('Newest Remotion version is', latestRemotionVersion);
31
+ let targetVersion;
32
+ if (version) {
33
+ targetVersion = version;
34
+ log_1.Log.info('Upgrading to specified version: ' + version);
35
+ }
36
+ else {
37
+ targetVersion = await (0, get_latest_remotion_version_1.getLatestRemotionVersion)();
38
+ log_1.Log.info('Newest Remotion version is', targetVersion);
39
+ }
33
40
  const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot, packageManager);
34
41
  if (manager === 'unknown') {
35
42
  throw new Error(`No lockfile was found in your project (one of ${get_package_manager_1.lockFilePaths
@@ -43,7 +50,7 @@ const upgrade = async (remotionRoot, packageManager) => {
43
50
  const prom = renderer_1.RenderInternals.execa(manager.manager, getUpgradeCommand({
44
51
  manager: manager.manager,
45
52
  packages: toUpgrade,
46
- version: latestRemotionVersion,
53
+ version: targetVersion,
47
54
  }), {
48
55
  stdio: 'inherit',
49
56
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.14",
3
+ "version": "4.0.15",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -35,11 +35,11 @@
35
35
  "prompts": "2.4.1",
36
36
  "semver": "7.5.3",
37
37
  "source-map": "0.6.1",
38
- "@remotion/bundler": "4.0.14",
39
- "@remotion/media-utils": "4.0.14",
40
- "@remotion/player": "4.0.14",
41
- "@remotion/renderer": "4.0.14",
42
- "remotion": "4.0.14"
38
+ "@remotion/bundler": "4.0.15",
39
+ "@remotion/media-utils": "4.0.15",
40
+ "remotion": "4.0.15",
41
+ "@remotion/renderer": "4.0.15",
42
+ "@remotion/player": "4.0.15"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -65,8 +65,8 @@
65
65
  "typescript": "4.9.5",
66
66
  "vitest": "0.31.1",
67
67
  "zod": "^3.21.4",
68
- "@remotion/zod-types": "4.0.14",
69
- "@remotion/tailwind": "4.0.14"
68
+ "@remotion/zod-types": "4.0.15",
69
+ "@remotion/tailwind": "4.0.15"
70
70
  },
71
71
  "keywords": [
72
72
  "remotion",