@remotion/cli 3.3.58 → 3.3.60

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.
package/dist/benchmark.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.benchmarkCommand = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
5
  const chalk_1 = require("./chalk");
6
+ const cleanup_before_quit_1 = require("./cleanup-before-quit");
6
7
  const config_1 = require("./config");
7
8
  const entry_point_1 = require("./entry-point");
8
9
  const get_cli_options_1 = require("./get-cli-options");
@@ -111,6 +112,7 @@ const benchmarkCommand = async (remotionRoot, args) => {
111
112
  remotionRoot,
112
113
  steps: ['bundling'],
113
114
  });
115
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => cleanupBundle());
114
116
  const puppeteerInstance = await browserInstance;
115
117
  const comps = await (0, renderer_1.getCompositions)(bundleLocation, {
116
118
  inputProps,
@@ -176,6 +178,5 @@ const benchmarkCommand = async (remotionRoot, args) => {
176
178
  }
177
179
  }
178
180
  log_1.Log.info();
179
- await cleanupBundle();
180
181
  };
181
182
  exports.benchmarkCommand = benchmarkCommand;
@@ -0,0 +1,3 @@
1
+ export declare const cleanupBeforeQuit: () => void;
2
+ export declare const registerCleanupJob: (job: () => void) => void;
3
+ export declare const handleCtrlC: () => void;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleCtrlC = exports.registerCleanupJob = exports.cleanupBeforeQuit = void 0;
4
+ const log_1 = require("./log");
5
+ const cleanupJobs = [];
6
+ const cleanupBeforeQuit = () => {
7
+ for (const job of cleanupJobs) {
8
+ job();
9
+ }
10
+ };
11
+ exports.cleanupBeforeQuit = cleanupBeforeQuit;
12
+ const registerCleanupJob = (job) => {
13
+ cleanupJobs.push(job);
14
+ };
15
+ exports.registerCleanupJob = registerCleanupJob;
16
+ const handleCtrlC = () => {
17
+ process.on('SIGINT', () => {
18
+ log_1.Log.info();
19
+ (0, exports.cleanupBeforeQuit)();
20
+ process.exit(1);
21
+ });
22
+ };
23
+ exports.handleCtrlC = handleCtrlC;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listCompositionsCommand = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const cleanup_before_quit_1 = require("./cleanup-before-quit");
5
6
  const entry_point_1 = require("./entry-point");
6
7
  const get_cli_options_1 = require("./get-cli-options");
7
8
  const get_config_file_name_1 = require("./get-config-file-name");
@@ -18,6 +19,7 @@ const listCompositionsCommand = async (remotionRoot, args) => {
18
19
  }
19
20
  log_1.Log.verbose('Entry point:', file, 'reason:', reason);
20
21
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
22
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => renderer_1.RenderInternals.cleanDownloadMap(downloadMap));
21
23
  await (0, get_config_file_name_1.loadConfig)(remotionRoot);
22
24
  const { browserExecutable, ffmpegExecutable, ffprobeExecutable, chromiumOptions, envVariables, inputProps, puppeteerTimeout, port, publicDir, } = await (0, get_cli_options_1.getCliOptions)({
23
25
  isLambda: false,
@@ -30,6 +32,7 @@ const listCompositionsCommand = async (remotionRoot, args) => {
30
32
  steps: ['bundling'],
31
33
  publicDir,
32
34
  });
35
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => cleanupBundle());
33
36
  const compositions = await (0, renderer_1.getCompositions)(bundled, {
34
37
  browserExecutable,
35
38
  ffmpegExecutable,
@@ -42,8 +45,6 @@ const listCompositionsCommand = async (remotionRoot, args) => {
42
45
  downloadMap,
43
46
  });
44
47
  (0, print_compositions_1.printCompositions)(compositions);
45
- await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
46
- await cleanupBundle();
47
48
  log_1.Log.verbose('Cleaned up', downloadMap.assetDir);
48
49
  };
49
50
  exports.listCompositionsCommand = listCompositionsCommand;
@@ -1,3 +1,3 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
- export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
2
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
3
3
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
@@ -30,7 +30,7 @@ export declare const getCliOptions: (options: {
30
30
  browserExecutable: BrowserExecutable;
31
31
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
32
32
  ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
33
- logLevel: "error" | "verbose" | "info" | "warn";
33
+ logLevel: "verbose" | "info" | "warn" | "error";
34
34
  scale: number;
35
35
  chromiumOptions: ChromiumOptions;
36
36
  overwrite: boolean;
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ export declare const CliInternals: {
88
88
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
89
89
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
90
90
  ffprobeExecutable: import("@remotion/renderer").FfmpegExecutable;
91
- logLevel: "error" | "verbose" | "info" | "warn";
91
+ logLevel: "verbose" | "info" | "warn" | "error";
92
92
  scale: number;
93
93
  chromiumOptions: import("@remotion/renderer").ChromiumOptions;
94
94
  overwrite: boolean;
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ const renderer_1 = require("@remotion/renderer");
22
22
  const minimist_1 = __importDefault(require("minimist"));
23
23
  const benchmark_1 = require("./benchmark");
24
24
  const chalk_1 = require("./chalk");
25
+ const cleanup_before_quit_1 = require("./cleanup-before-quit");
25
26
  const compositions_1 = require("./compositions");
26
27
  const index_1 = require("./config/index");
27
28
  const determine_image_format_1 = require("./determine-image-format");
@@ -60,6 +61,7 @@ const cli = async () => {
60
61
  await (0, versions_1.validateVersionsBeforeCommand)(remotionRoot);
61
62
  }
62
63
  const errorSymbolicationLock = renderer_1.RenderInternals.registerErrorSymbolicationLock();
64
+ (0, cleanup_before_quit_1.handleCtrlC)();
63
65
  await (0, initialize_cli_1.initializeCli)(remotionRoot);
64
66
  try {
65
67
  if (command === 'compositions') {
@@ -104,10 +106,12 @@ const cli = async () => {
104
106
  catch (err) {
105
107
  log_1.Log.info();
106
108
  await (0, handle_common_errors_1.handleCommonError)(err);
109
+ (0, cleanup_before_quit_1.cleanupBeforeQuit)();
107
110
  process.exit(1);
108
111
  }
109
112
  finally {
110
113
  renderer_1.RenderInternals.unlockErrorSymbolicationLock(errorSymbolicationLock);
114
+ (0, cleanup_before_quit_1.cleanupBeforeQuit)();
111
115
  }
112
116
  };
113
117
  exports.cli = cli;
@@ -20,7 +20,7 @@ const lambdaCommand = async (remotionRoot, args) => {
20
20
  log_1.Log.error('Remotion Lambda is not installed.');
21
21
  log_1.Log.info('');
22
22
  log_1.Log.info('You can install it using:');
23
- log_1.Log.info(`${installCommand} i @remotion/lambda@${(0, update_available_1.getRemotionVersion)()}`);
23
+ log_1.Log.info(`${installCommand} @remotion/lambda@${(0, update_available_1.getRemotionVersion)()}`);
24
24
  process.exit(1);
25
25
  }
26
26
  };
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.loadConfigFile = void 0;
7
7
  const bundler_1 = require("@remotion/bundler");
8
8
  const fs_1 = __importDefault(require("fs"));
9
- const os_1 = __importDefault(require("os"));
10
9
  const path_1 = __importDefault(require("path"));
11
10
  const worker_threads_1 = require("worker_threads");
12
11
  const log_1 = require("./log");
@@ -18,7 +17,7 @@ const loadConfigFile = async (remotionRoot, configFileName, isJavascript) => {
18
17
  log_1.Log.error('The root directory is:', remotionRoot);
19
18
  process.exit(1);
20
19
  }
21
- const out = path_1.default.join(await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'remotion-')), 'bundle.js');
20
+ const virtualOutfile = 'bundle.js';
22
21
  const result = await bundler_1.BundlerInternals.esbuild.build({
23
22
  platform: 'node',
24
23
  target: 'node14',
@@ -26,7 +25,8 @@ const loadConfigFile = async (remotionRoot, configFileName, isJavascript) => {
26
25
  entryPoints: [resolved],
27
26
  tsconfig: isJavascript ? undefined : tsconfigJson,
28
27
  absWorkingDir: remotionRoot,
29
- outfile: out,
28
+ outfile: virtualOutfile,
29
+ write: false,
30
30
  packages: 'external',
31
31
  });
32
32
  if (result.errors.length > 0) {
@@ -36,7 +36,7 @@ const loadConfigFile = async (remotionRoot, configFileName, isJavascript) => {
36
36
  }
37
37
  process.exit(1);
38
38
  }
39
- const file = await fs_1.default.promises.readFile(out, 'utf8');
39
+ const str = new TextDecoder().decode(result.outputFiles[0].contents);
40
40
  const currentCwd = process.cwd();
41
41
  // The config file is always executed from the Remotion root, if `process.cwd()` is being used. We cannot enforce this in worker threads used for testing
42
42
  if (worker_threads_1.isMainThread) {
@@ -44,11 +44,10 @@ const loadConfigFile = async (remotionRoot, configFileName, isJavascript) => {
44
44
  }
45
45
  // Exectute the contents of the config file
46
46
  // eslint-disable-next-line no-eval
47
- eval(file);
47
+ eval(str);
48
48
  if (worker_threads_1.isMainThread) {
49
49
  process.chdir(currentCwd);
50
50
  }
51
- await fs_1.default.promises.unlink(out);
52
51
  return resolved;
53
52
  };
54
53
  exports.loadConfigFile = loadConfigFile;
@@ -4,8 +4,8 @@ const react_overlay_1 = require("./react-overlay");
4
4
  const remotion_overlay_1 = require("./remotion-overlay");
5
5
  const Overlay_1 = require("./remotion-overlay/Overlay");
6
6
  (0, react_overlay_1.startReportingRuntimeErrors)(() => {
7
- if (module.hot) {
8
- module.hot.addStatusHandler((status) => {
7
+ if (__webpack_module__.hot) {
8
+ __webpack_module__.hot.addStatusHandler((status) => {
9
9
  var _a;
10
10
  if (status === 'apply') {
11
11
  if ((0, react_overlay_1.didUnmountReactApp)()) {
@@ -5,4 +5,98 @@
5
5
  */
6
6
  import type { webpack } from '@remotion/bundler';
7
7
  import type { IncomingMessage, ServerResponse } from 'http';
8
+ declare global {
9
+ const __webpack_hash__: unknown;
10
+ interface HotNotifierInfo {
11
+ type: 'self-declined' | 'declined' | 'unaccepted' | 'accepted' | 'disposed' | 'accept-errored' | 'self-accept-errored' | 'self-accept-error-handler-errored';
12
+ /**
13
+ * The module in question.
14
+ */
15
+ moduleId: number;
16
+ /**
17
+ * For errors: the module id owning the accept handler.
18
+ */
19
+ dependencyId?: number | undefined;
20
+ /**
21
+ * For declined/accepted/unaccepted: the chain from where the update was propagated.
22
+ */
23
+ chain?: number[] | undefined;
24
+ /**
25
+ * For declined: the module id of the declining parent
26
+ */
27
+ parentId?: number | undefined;
28
+ /**
29
+ * For accepted: the modules that are outdated and will be disposed
30
+ */
31
+ outdatedModules?: number[] | undefined;
32
+ /**
33
+ * For accepted: The location of accept handlers that will handle the update
34
+ */
35
+ outdatedDependencies?: {
36
+ [dependencyId: number]: number[];
37
+ } | undefined;
38
+ /**
39
+ * For errors: the thrown error
40
+ */
41
+ error?: Error | undefined;
42
+ /**
43
+ * For self-accept-error-handler-errored: the error thrown by the module
44
+ * before the error handler tried to handle it.
45
+ */
46
+ originalError?: Error | undefined;
47
+ }
48
+ interface AcceptOptions {
49
+ /**
50
+ * If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
51
+ */
52
+ ignoreUnaccepted?: boolean | undefined;
53
+ /**
54
+ * Ignore changes made to declined modules.
55
+ */
56
+ ignoreDeclined?: boolean | undefined;
57
+ /**
58
+ * Ignore errors throw in accept handlers, error handlers and while reevaluating module.
59
+ */
60
+ ignoreErrored?: boolean | undefined;
61
+ /**
62
+ * Notifier for declined modules.
63
+ */
64
+ onDeclined?: ((info: HotNotifierInfo) => void) | undefined;
65
+ /**
66
+ * Notifier for unaccepted modules.
67
+ */
68
+ onUnaccepted?: ((info: HotNotifierInfo) => void) | undefined;
69
+ /**
70
+ * Notifier for accepted modules.
71
+ */
72
+ onAccepted?: ((info: HotNotifierInfo) => void) | undefined;
73
+ /**
74
+ * Notifier for disposed modules.
75
+ */
76
+ onDisposed?: ((info: HotNotifierInfo) => void) | undefined;
77
+ /**
78
+ * Notifier for errors.
79
+ */
80
+ onErrored?: ((info: HotNotifierInfo) => void) | undefined;
81
+ /**
82
+ * Indicates that apply() is automatically called by check function
83
+ */
84
+ autoApply?: boolean | undefined;
85
+ }
86
+ const __webpack_module__: {
87
+ id: string;
88
+ exports: unknown;
89
+ hot: {
90
+ accept: () => void;
91
+ dispose: (onDispose: (data: Record<string, unknown>) => void) => void;
92
+ invalidate: () => void;
93
+ data?: Record<string, unknown>;
94
+ addStatusHandler(callback: (status: string) => void): void;
95
+ status(): string;
96
+ apply(options?: AcceptOptions): Promise<ModuleId[]>;
97
+ check(autoApply?: boolean): Promise<null | ModuleId[]>;
98
+ };
99
+ };
100
+ type ModuleId = string | number;
101
+ }
8
102
  export declare const webpackHotMiddleware: (compiler: webpack.Compiler) => (req: IncomingMessage, res: ServerResponse, next: () => void) => void;
@@ -7,8 +7,7 @@
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.processUpdate = void 0;
10
- /* global __webpack_hash__ */
11
- if (!module.hot) {
10
+ if (!__webpack_module__.hot) {
12
11
  throw new Error('[Fast refresh] Hot Module Replacement is disabled.');
13
12
  }
14
13
  const hmrDocsUrl = 'https://webpack.js.org/concepts/hot-module-replacement/'; // eslint-disable-line max-len
@@ -44,7 +43,7 @@ function upToDate(hash) {
44
43
  const processUpdate = function (hash, moduleMap, options) {
45
44
  var _a;
46
45
  const { reload } = options;
47
- if (!upToDate(hash) && ((_a = module.hot) === null || _a === void 0 ? void 0 : _a.status()) === 'idle') {
46
+ if (!upToDate(hash) && ((_a = __webpack_module__.hot) === null || _a === void 0 ? void 0 : _a.status()) === 'idle') {
48
47
  check();
49
48
  }
50
49
  async function check() {
@@ -69,7 +68,7 @@ const processUpdate = function (hash, moduleMap, options) {
69
68
  }
70
69
  logUpdates(updatedModules, renewedModules);
71
70
  };
72
- const applyResult = (_a = module.hot) === null || _a === void 0 ? void 0 : _a.apply(applyOptions, applyCallback);
71
+ const applyResult = (_a = __webpack_module__.hot) === null || _a === void 0 ? void 0 : _a.apply(applyOptions);
73
72
  if (applyResult === null || applyResult === void 0 ? void 0 : applyResult.then) {
74
73
  // HotModuleReplacement.runtime.js refers to the result as `outdatedModules`
75
74
  applyResult
@@ -80,7 +79,7 @@ const processUpdate = function (hash, moduleMap, options) {
80
79
  }
81
80
  };
82
81
  try {
83
- const result = await ((_a = module.hot) === null || _a === void 0 ? void 0 : _a.check(false, cb));
82
+ const result = await ((_a = __webpack_module__.hot) === null || _a === void 0 ? void 0 : _a.check(false));
84
83
  cb(null, result);
85
84
  }
86
85
  catch (err) {
@@ -119,7 +118,7 @@ const processUpdate = function (hash, moduleMap, options) {
119
118
  }
120
119
  function handleError(err) {
121
120
  var _a, _b;
122
- if (((_b = (_a = module.hot) === null || _a === void 0 ? void 0 : _a.status()) !== null && _b !== void 0 ? _b : 'nope') in failureStatuses) {
121
+ if (((_b = (_a = __webpack_module__.hot) === null || _a === void 0 ? void 0 : _a.status()) !== null && _b !== void 0 ? _b : 'nope') in failureStatuses) {
123
122
  if (options.warn) {
124
123
  console.warn('[Fast refresh] Cannot check for update (Full reload needed)');
125
124
  console.warn('[Fast refresh] ' + (err.stack || err.message));
@@ -6,10 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.startServer = void 0;
7
7
  const bundler_1 = require("@remotion/bundler");
8
8
  const renderer_1 = require("@remotion/renderer");
9
- const fs_1 = __importDefault(require("fs"));
10
9
  const http_1 = __importDefault(require("http"));
11
- const os_1 = __importDefault(require("os"));
12
- const path_1 = __importDefault(require("path"));
13
10
  const config_1 = require("../config");
14
11
  const log_1 = require("../log");
15
12
  const dev_middleware_1 = require("./dev-middleware");
@@ -18,11 +15,10 @@ const live_events_1 = require("./live-events");
18
15
  const routes_1 = require("./routes");
19
16
  const startServer = async (options) => {
20
17
  var _a, _b, _c, _d;
21
- const tmpDir = await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-graphics'));
22
18
  const [, config] = bundler_1.BundlerInternals.webpackConfig({
23
19
  entry: options.entry,
24
20
  userDefinedComponent: options.userDefinedComponent,
25
- outDir: tmpDir,
21
+ outDir: null,
26
22
  environment: 'development',
27
23
  webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : config_1.ConfigInternals.getWebpackOverrideFn(),
28
24
  envVariables: (_b = options === null || options === void 0 ? void 0 : options.getEnvVariables()) !== null && _b !== void 0 ? _b : {},
package/dist/render.js CHANGED
@@ -10,6 +10,7 @@ const os_1 = __importDefault(require("os"));
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const remotion_1 = require("remotion");
12
12
  const chalk_1 = require("./chalk");
13
+ const cleanup_before_quit_1 = require("./cleanup-before-quit");
13
14
  const config_1 = require("./config");
14
15
  const entry_point_1 = require("./entry-point");
15
16
  const get_audio_codec_1 = require("./get-audio-codec");
@@ -33,6 +34,7 @@ const render = async (remotionRoot, args) => {
33
34
  process.exit(1);
34
35
  }
35
36
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
37
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => renderer_1.RenderInternals.cleanDownloadMap(downloadMap));
36
38
  if (parse_command_line_1.parsedCli.frame) {
37
39
  log_1.Log.error('--frame flag was passed to the `render` command. This flag only works with the `still` command. Did you mean `--frames`? See reference: https://www.remotion.dev/docs/cli/');
38
40
  process.exit(1);
@@ -66,6 +68,7 @@ const render = async (remotionRoot, args) => {
66
68
  steps,
67
69
  publicDir,
68
70
  });
71
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => cleanupBundle());
69
72
  const onDownload = (src) => {
70
73
  const id = Math.random();
71
74
  const download = {
@@ -122,9 +125,15 @@ const render = async (remotionRoot, args) => {
122
125
  log_1.Log.info(chalk_1.chalk.gray(`Entry point = ${path_1.default.relative(process.cwd(), file)} (${entryPointReason}), Composition = ${compositionId} (${reason}), Codec = ${codec} (${codecReason}), Output = ${relativeOutputLocation}`));
123
126
  const absoluteOutputFile = (0, get_cli_options_1.getAndValidateAbsoluteOutputFile)(relativeOutputLocation, overwrite);
124
127
  const outputDir = shouldOutputImageSequence
125
- ? absoluteOutputFile
126
- : await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-render'));
127
- log_1.Log.verbose('Output dir', outputDir);
128
+ ? { dir: absoluteOutputFile, cleanup: false }
129
+ : {
130
+ dir: await fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-render')),
131
+ cleanup: true,
132
+ };
133
+ if (outputDir.cleanup) {
134
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => renderer_1.RenderInternals.deleteDirectory(outputDir.dir));
135
+ }
136
+ log_1.Log.verbose('Output dir', outputDir.dir);
128
137
  const renderProgress = (0, progress_bar_1.createOverwriteableCliOutput)((0, parse_command_line_1.quietFlagProvided)());
129
138
  const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(config.durationInFrames, frameRange);
130
139
  const totalFrames = renderer_1.RenderInternals.getFramesToRender(realFrameRange, everyNthFrame);
@@ -186,7 +195,7 @@ const render = async (remotionRoot, args) => {
186
195
  log_1.Log.info('\nDownloading asset... ', src);
187
196
  }
188
197
  },
189
- outputDir,
198
+ outputDir: outputDir.dir,
190
199
  serveUrl: urlOrBundle,
191
200
  dumpBrowserLogs: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
192
201
  everyNthFrame,
@@ -231,7 +240,10 @@ const render = async (remotionRoot, args) => {
231
240
  },
232
241
  puppeteerInstance,
233
242
  onDownload,
234
- downloadMap,
243
+ internal: {
244
+ downloadMap,
245
+ onCtrlCExit: cleanup_before_quit_1.registerCleanupJob,
246
+ },
235
247
  onSlowestFrames: (slowestFrames) => {
236
248
  log_1.Log.verbose();
237
249
  log_1.Log.verbose(`Slowest frames:`);
@@ -250,16 +262,6 @@ const render = async (remotionRoot, args) => {
250
262
  ].join(' '));
251
263
  log_1.Log.info('-', 'Output can be found at:');
252
264
  log_1.Log.info(chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
253
- try {
254
- await cleanupBundle();
255
- await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
256
- log_1.Log.verbose('Cleaned up', downloadMap.assetDir);
257
- }
258
- catch (err) {
259
- log_1.Log.warn('Could not clean up directory.');
260
- log_1.Log.warn(err);
261
- log_1.Log.warn('Do you have minimum required Node.js version?');
262
- }
263
265
  log_1.Log.info(chalk_1.chalk.green(`\nYour ${codec === 'gif' ? 'GIF' : 'video'} is ready!`));
264
266
  if (renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose')) {
265
267
  renderer_1.RenderInternals.perf.logPerf();
@@ -6,7 +6,7 @@ export declare const bundleOnCliOrTakeServeUrl: ({ fullPath, remotionRoot, steps
6
6
  publicDir: string | null;
7
7
  }) => Promise<{
8
8
  urlOrBundle: string;
9
- cleanup: () => Promise<void>;
9
+ cleanup: () => void;
10
10
  }>;
11
11
  export declare const bundleOnCli: ({ fullPath, steps, remotionRoot, publicDir, }: {
12
12
  fullPath: string;
package/dist/still.js CHANGED
@@ -8,6 +8,7 @@ const renderer_1 = require("@remotion/renderer");
8
8
  const fs_1 = require("fs");
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const chalk_1 = require("./chalk");
11
+ const cleanup_before_quit_1 = require("./cleanup-before-quit");
11
12
  const config_1 = require("./config");
12
13
  const determine_image_format_1 = require("./determine-image-format");
13
14
  const entry_point_1 = require("./entry-point");
@@ -50,8 +51,10 @@ const still = async (remotionRoot, args) => {
50
51
  'rendering',
51
52
  ].filter(truthy_1.truthy);
52
53
  const { cleanup: cleanupBundle, urlOrBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({ fullPath: file, remotionRoot, steps, publicDir });
54
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => cleanupBundle());
53
55
  const puppeteerInstance = await browserInstance;
54
56
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
57
+ (0, cleanup_before_quit_1.registerCleanupJob)(() => renderer_1.RenderInternals.cleanDownloadMap(downloadMap));
55
58
  const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
56
59
  inputProps,
57
60
  puppeteerInstance,
@@ -157,8 +160,5 @@ const still = async (remotionRoot, args) => {
157
160
  log_1.Log.info('-', 'Output can be found at:');
158
161
  log_1.Log.info(chalk_1.chalk.cyan(`▶️ ${absoluteOutputLocation}`));
159
162
  await closeBrowserPromise;
160
- await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
161
- await cleanupBundle();
162
- log_1.Log.verbose('Cleaned up', downloadMap.assetDir);
163
163
  };
164
164
  exports.still = still;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.3.58",
3
+ "version": "3.3.60",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -22,16 +22,16 @@
22
22
  "author": "Jonny Burger <jonny@remotion.dev>",
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "dependencies": {
25
- "@remotion/bundler": "3.3.58",
26
- "@remotion/media-utils": "3.3.58",
27
- "@remotion/player": "3.3.58",
28
- "@remotion/renderer": "3.3.58",
25
+ "@remotion/bundler": "3.3.60",
26
+ "@remotion/media-utils": "3.3.60",
27
+ "@remotion/player": "3.3.60",
28
+ "@remotion/renderer": "3.3.60",
29
29
  "better-opn": "2.1.1",
30
30
  "dotenv": "9.0.2",
31
31
  "memfs": "3.4.3",
32
32
  "minimist": "1.2.6",
33
33
  "prompts": "2.4.1",
34
- "remotion": "3.3.58",
34
+ "remotion": "3.3.60",
35
35
  "semver": "7.3.5",
36
36
  "source-map": "0.6.1"
37
37
  },
@@ -47,7 +47,6 @@
47
47
  "@types/react": "18.0.26",
48
48
  "@types/react-dom": "18.0.10",
49
49
  "@types/semver": "^7.3.4",
50
- "@types/webpack-env": "^1.16.0",
51
50
  "@typescript-eslint/eslint-plugin": "5.18.0",
52
51
  "@typescript-eslint/parser": "5.18.0",
53
52
  "eslint": "8.25.0",
@@ -71,5 +70,5 @@
71
70
  "publishConfig": {
72
71
  "access": "public"
73
72
  },
74
- "gitHead": "13dc20d2ef36d2db62b64318687cce80ee0cc31b"
73
+ "gitHead": "60797b0861ef1017cec53ba656214cbc10db011b"
75
74
  }