@remotion/cli 3.2.38 → 3.2.40

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 (76) hide show
  1. package/dist/benchmark.js +7 -6
  2. package/dist/compositions.d.ts +1 -1
  3. package/dist/compositions.js +4 -3
  4. package/dist/config/entry-point.d.ts +2 -0
  5. package/dist/config/entry-point.js +12 -0
  6. package/dist/config/every-nth-frame.d.ts +1 -2
  7. package/dist/config/every-nth-frame.js +3 -11
  8. package/dist/config/height.d.ts +2 -2
  9. package/dist/config/height.js +6 -7
  10. package/dist/config/index.d.ts +5 -2
  11. package/dist/config/index.js +15 -8
  12. package/dist/config/number-of-gif-loops.d.ts +1 -2
  13. package/dist/config/number-of-gif-loops.js +3 -9
  14. package/dist/config/width.d.ts +2 -2
  15. package/dist/config/width.js +7 -6
  16. package/dist/editor/components/Canvas.js +3 -0
  17. package/dist/editor/components/Editor.js +1 -2
  18. package/dist/editor/components/GlobalKeybindings.js +9 -1
  19. package/dist/editor/components/KeyboardShortcutsExplainer.d.ts +2 -0
  20. package/dist/editor/components/KeyboardShortcutsExplainer.js +56 -0
  21. package/dist/editor/components/NewComposition/MenuContent.js +7 -0
  22. package/dist/editor/components/PlayPause.js +6 -0
  23. package/dist/editor/components/PlaybackKeyboardShortcutsManager.js +3 -0
  24. package/dist/editor/components/QuickSwitcher/AlgoliaCredit.d.ts +2 -0
  25. package/dist/editor/components/QuickSwitcher/AlgoliaCredit.js +11 -0
  26. package/dist/editor/components/QuickSwitcher/NoResults.d.ts +2 -2
  27. package/dist/editor/components/QuickSwitcher/NoResults.js +6 -1
  28. package/dist/editor/components/QuickSwitcher/QuickSwitcher.d.ts +5 -1
  29. package/dist/editor/components/QuickSwitcher/QuickSwitcher.js +2 -2
  30. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -1
  31. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +117 -27
  32. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
  33. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +27 -8
  34. package/dist/editor/components/QuickSwitcher/algolia-search.d.ts +29 -0
  35. package/dist/editor/components/QuickSwitcher/algolia-search.js +63 -0
  36. package/dist/editor/components/TimelineInOutToggle.js +3 -0
  37. package/dist/editor/helpers/use-keybinding.d.ts +1 -0
  38. package/dist/editor/helpers/use-keybinding.js +3 -1
  39. package/dist/editor/helpers/use-menu-structure.js +37 -9
  40. package/dist/editor/state/modals.d.ts +3 -2
  41. package/dist/editor/state/z-index.js +1 -0
  42. package/dist/entry-point.d.ts +5 -0
  43. package/dist/entry-point.js +46 -0
  44. package/dist/get-cli-options.d.ts +3 -3
  45. package/dist/get-cli-options.js +7 -25
  46. package/dist/get-composition-id.d.ts +2 -1
  47. package/dist/get-composition-id.js +8 -6
  48. package/dist/get-composition-with-dimension-override.d.ts +12 -0
  49. package/dist/get-composition-with-dimension-override.js +16 -0
  50. package/dist/get-filename.d.ts +2 -1
  51. package/dist/get-filename.js +2 -1
  52. package/dist/get-render-media-options.js +8 -3
  53. package/dist/index.d.ts +9 -5
  54. package/dist/index.js +11 -11
  55. package/dist/lambda-command.d.ts +1 -1
  56. package/dist/lambda-command.js +2 -3
  57. package/dist/list-of-remotion-packages.js +1 -0
  58. package/dist/parse-command-line.d.ts +2 -0
  59. package/dist/parse-command-line.js +6 -0
  60. package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.js +1 -0
  61. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +1 -0
  62. package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.js +1 -0
  63. package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -0
  64. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.d.ts +1 -0
  65. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.js +3 -3
  66. package/dist/preview.d.ts +1 -1
  67. package/dist/preview.js +4 -2
  68. package/dist/render.d.ts +1 -1
  69. package/dist/render.js +21 -12
  70. package/dist/still.d.ts +1 -1
  71. package/dist/still.js +26 -14
  72. package/dist/user-passed-output-location.d.ts +3 -2
  73. package/dist/user-passed-output-location.js +5 -7
  74. package/package.json +8 -8
  75. package/dist/editor/components/KeyboardShortcutsModal.d.ts +0 -2
  76. package/dist/editor/components/KeyboardShortcutsModal.js +0 -67
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
2
3
  import type { UpdateInfo } from '../components/UpdateCheck';
3
4
  export declare type CompType = 'composition' | 'still';
4
5
  export declare type ModalState = {
@@ -9,8 +10,8 @@ export declare type ModalState = {
9
10
  info: UpdateInfo;
10
11
  } | {
11
12
  type: 'quick-switcher';
12
- } | {
13
- type: 'shortcuts';
13
+ mode: QuickSwitcherMode;
14
+ invocationTimestamp: number;
14
15
  };
15
16
  export declare type ModalContextType = {
16
17
  selectedModal: ModalState | null;
@@ -17,6 +17,7 @@ const EscapeHook = ({ onEscape }) => {
17
17
  key: 'Escape',
18
18
  callback: onEscape,
19
19
  commandCtrlKey: false,
20
+ preventDefault: true,
20
21
  });
21
22
  return () => {
22
23
  escape.unregister();
@@ -0,0 +1,5 @@
1
+ export declare const findEntryPoint: (args: string[], remotionRoot: string) => {
2
+ file: string | null;
3
+ remainingArgs: string[];
4
+ reason: string;
5
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.findEntryPoint = void 0;
7
+ const fs_1 = require("fs");
8
+ const path_1 = __importDefault(require("path"));
9
+ const config_1 = require("./config");
10
+ const log_1 = require("./log");
11
+ const candidates = [
12
+ path_1.default.join('remotion', 'index.tsx'),
13
+ path_1.default.join('remotion', 'index.ts'),
14
+ path_1.default.join('remotion', 'index.js'),
15
+ path_1.default.join('src', 'index.tsx'),
16
+ path_1.default.join('src', 'index.ts'),
17
+ path_1.default.join('src', 'index.js'),
18
+ ];
19
+ const findCommonPath = (remotionRoot) => {
20
+ return candidates.find((candidate) => (0, fs_1.existsSync)(path_1.default.resolve(remotionRoot, candidate)));
21
+ };
22
+ const findEntryPoint = (args, remotionRoot) => {
23
+ // 1st priority: Explicitly passed entry point
24
+ let file = args[0];
25
+ if (file) {
26
+ log_1.Log.verbose('Checking if', file, 'is the entry file');
27
+ // Intentionally resolving CLI files to CWD, while resolving config file to remotionRoot
28
+ if ((0, fs_1.existsSync)(path_1.default.resolve(process.cwd(), file))) {
29
+ return { file, remainingArgs: args.slice(1), reason: 'argument passed' };
30
+ }
31
+ }
32
+ // 2nd priority: Config file
33
+ file = config_1.ConfigInternals.getEntryPoint();
34
+ if (file) {
35
+ log_1.Log.verbose('Entry point from config file is', file);
36
+ return { file, remainingArgs: args, reason: 'config file' };
37
+ }
38
+ // 3rd priority: Common paths
39
+ const found = findCommonPath(remotionRoot);
40
+ if (found) {
41
+ log_1.Log.verbose('Selected', found, 'as the entry point because file exists and is a common entry point and no entry point was explicitly selected');
42
+ return { file: found, remainingArgs: args, reason: 'common paths' };
43
+ }
44
+ return { file: null, remainingArgs: args, reason: 'none found' };
45
+ };
46
+ exports.findEntryPoint = findEntryPoint;
@@ -11,7 +11,6 @@ export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation:
11
11
  export declare const getCliOptions: (options: {
12
12
  isLambda: boolean;
13
13
  type: 'still' | 'series' | 'get-compositions';
14
- codec: Codec;
15
14
  }) => Promise<{
16
15
  puppeteerTimeout: number;
17
16
  concurrency: number | null;
@@ -23,10 +22,9 @@ export declare const getCliOptions: (options: {
23
22
  browser: import("@remotion/renderer").Browser;
24
23
  crf: import("@remotion/renderer").Crf | null;
25
24
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
26
- imageFormat: "png" | "jpeg" | "none";
27
25
  proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
28
26
  everyNthFrame: number;
29
- numberOfGifLoops: number | null;
27
+ numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
30
28
  stillFrame: number;
31
29
  browserExecutable: BrowserExecutable;
32
30
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
@@ -42,4 +40,6 @@ export declare const getCliOptions: (options: {
42
40
  ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
43
41
  audioBitrate: string | null;
44
42
  videoBitrate: string | null;
43
+ height: number | null;
44
+ width: number | null;
45
45
  }>;
@@ -11,7 +11,6 @@ const config_1 = require("./config");
11
11
  const get_env_1 = require("./get-env");
12
12
  const get_final_output_codec_1 = require("./get-final-output-codec");
13
13
  const get_input_props_1 = require("./get-input-props");
14
- const image_formats_1 = require("./image-formats");
15
14
  const log_1 = require("./log");
16
15
  const parse_command_line_1 = require("./parse-command-line");
17
16
  const getAndValidateFrameRange = () => {
@@ -86,20 +85,10 @@ const getCrf = (shouldOutputImageSequence) => {
86
85
  : config_1.ConfigInternals.getCrfOrUndefined();
87
86
  return crf;
88
87
  };
89
- const getAndValidatePixelFormat = (codec) => {
90
- const pixelFormat = config_1.ConfigInternals.getPixelFormat();
91
- renderer_1.RenderInternals.validateSelectedPixelFormatAndCodecCombination(pixelFormat, codec);
92
- return pixelFormat;
93
- };
94
88
  const getProResProfile = () => {
95
89
  const proResProfile = config_1.ConfigInternals.getProResProfile();
96
90
  return proResProfile;
97
91
  };
98
- const getAndValidateImageFormat = ({ shouldOutputImageSequence, codec, pixelFormat, }) => {
99
- const imageFormat = (0, image_formats_1.getImageFormat)(shouldOutputImageSequence ? undefined : codec);
100
- renderer_1.RenderInternals.validateSelectedPixelFormatAndImageFormatCombination(pixelFormat, imageFormat);
101
- return imageFormat;
102
- };
103
92
  const getAndValidateBrowser = async (browserExecutable) => {
104
93
  const browser = getBrowser();
105
94
  try {
@@ -126,17 +115,7 @@ const getCliOptions = async (options) => {
126
115
  });
127
116
  const crf = getCrf(shouldOutputImageSequence);
128
117
  const videoBitrate = config_1.ConfigInternals.getVideoBitrate();
129
- renderer_1.RenderInternals.validateQualitySettings({
130
- crf,
131
- codec: options.codec,
132
- videoBitrate,
133
- });
134
- const pixelFormat = getAndValidatePixelFormat(options.codec);
135
- const imageFormat = getAndValidateImageFormat({
136
- shouldOutputImageSequence,
137
- codec: options.codec,
138
- pixelFormat,
139
- });
118
+ const pixelFormat = config_1.ConfigInternals.getPixelFormat();
140
119
  const proResProfile = getProResProfile();
141
120
  const browserExecutable = config_1.ConfigInternals.getBrowserExecutable();
142
121
  const ffmpegExecutable = config_1.ConfigInternals.getCustomFfmpegExecutable();
@@ -149,9 +128,11 @@ const getCliOptions = async (options) => {
149
128
  headless: config_1.ConfigInternals.getChromiumHeadlessMode(),
150
129
  gl: (_a = config_1.ConfigInternals.getChromiumOpenGlRenderer()) !== null && _a !== void 0 ? _a : renderer_1.RenderInternals.DEFAULT_OPENGL_RENDERER,
151
130
  };
152
- const everyNthFrame = config_1.ConfigInternals.getAndValidateEveryNthFrame(options.codec);
153
- const numberOfGifLoops = config_1.ConfigInternals.getAndValidateNumberOfGifLoops(options.codec);
131
+ const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
132
+ const numberOfGifLoops = config_1.ConfigInternals.getNumberOfGifLoops();
154
133
  const concurrency = config_1.ConfigInternals.getConcurrency();
134
+ const height = config_1.ConfigInternals.getHeight();
135
+ const width = config_1.ConfigInternals.getWidth();
155
136
  renderer_1.RenderInternals.validateConcurrency(concurrency, 'concurrency');
156
137
  return {
157
138
  puppeteerTimeout: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
@@ -164,7 +145,6 @@ const getCliOptions = async (options) => {
164
145
  browser: await getAndValidateBrowser(browserExecutable),
165
146
  crf,
166
147
  pixelFormat,
167
- imageFormat,
168
148
  proResProfile,
169
149
  everyNthFrame,
170
150
  numberOfGifLoops,
@@ -183,6 +163,8 @@ const getCliOptions = async (options) => {
183
163
  ffmpegOverride: config_1.ConfigInternals.getFfmpegOverrideFunction(),
184
164
  audioBitrate: config_1.ConfigInternals.getAudioBitrate(),
185
165
  videoBitrate,
166
+ height,
167
+ width,
186
168
  };
187
169
  };
188
170
  exports.getCliOptions = getCliOptions;
@@ -1,6 +1,7 @@
1
1
  import type { TCompMetadata } from 'remotion';
2
- export declare const getCompositionId: (validCompositions: TCompMetadata[]) => Promise<{
2
+ export declare const getCompositionId: (validCompositions: TCompMetadata[], args: string[]) => Promise<{
3
3
  compositionId: string;
4
4
  reason: string;
5
5
  config: TCompMetadata;
6
+ argsAfterComposition: string[];
6
7
  }>;
@@ -2,20 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCompositionId = void 0;
4
4
  const log_1 = require("./log");
5
- const parse_command_line_1 = require("./parse-command-line");
6
5
  const select_composition_1 = require("./select-composition");
7
- const getCompositionId = async (validCompositions) => {
8
- if (parse_command_line_1.parsedCli._[2]) {
9
- const config = validCompositions.find((c) => c.id === parse_command_line_1.parsedCli._[2]);
6
+ const getCompositionId = async (validCompositions, args) => {
7
+ const [compName, ...remainingArgs] = args;
8
+ if (compName) {
9
+ const config = validCompositions.find((c) => c.id === compName);
10
10
  if (!config) {
11
- throw new Error(`Cannot find composition with ID "${parse_command_line_1.parsedCli._[2]}". Available composition: ${validCompositions
11
+ throw new Error(`Cannot find composition with ID "${compName}". Available composition: ${validCompositions
12
12
  .map((c) => c.id)
13
13
  .join(', ')}`);
14
14
  }
15
15
  return {
16
- compositionId: parse_command_line_1.parsedCli._[2],
16
+ compositionId: compName,
17
17
  reason: 'Passed as argument',
18
18
  config,
19
+ argsAfterComposition: remainingArgs,
19
20
  };
20
21
  }
21
22
  if (!process.env.CI) {
@@ -25,6 +26,7 @@ const getCompositionId = async (validCompositions) => {
25
26
  compositionId,
26
27
  reason,
27
28
  config: validCompositions.find((c) => c.id === compositionId),
29
+ argsAfterComposition: args,
28
30
  };
29
31
  }
30
32
  }
@@ -0,0 +1,12 @@
1
+ import type { TCompMetadata } from 'remotion';
2
+ export declare const getCompositionWithDimensionOverride: ({ validCompositions, height, width, args, }: {
3
+ validCompositions: TCompMetadata[];
4
+ height: number | null;
5
+ width: number | null;
6
+ args: string[];
7
+ }) => Promise<{
8
+ compositionId: string;
9
+ reason: string;
10
+ config: TCompMetadata;
11
+ argsAfterComposition: string[];
12
+ }>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCompositionWithDimensionOverride = void 0;
4
+ const get_composition_id_1 = require("./get-composition-id");
5
+ const getCompositionWithDimensionOverride = async ({ validCompositions, height, width, args, }) => {
6
+ const returnValue = await (0, get_composition_id_1.getCompositionId)(validCompositions, args);
7
+ return {
8
+ ...returnValue,
9
+ config: {
10
+ ...returnValue.config,
11
+ height: height !== null && height !== void 0 ? height : returnValue.config.height,
12
+ width: width !== null && width !== void 0 ? width : returnValue.config.width,
13
+ },
14
+ };
15
+ };
16
+ exports.getCompositionWithDimensionOverride = getCompositionWithDimensionOverride;
@@ -1,7 +1,8 @@
1
1
  import type { Codec } from '@remotion/renderer';
2
- export declare const getOutputFilename: ({ codec, imageSequence, compositionName, defaultExtension, }: {
2
+ export declare const getOutputFilename: ({ codec, imageSequence, compositionName, defaultExtension, args, }: {
3
3
  codec: Codec;
4
4
  imageSequence: boolean;
5
5
  compositionName: string;
6
6
  defaultExtension: string;
7
+ args: string[];
7
8
  }) => string;
@@ -4,10 +4,11 @@ exports.getOutputFilename = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
5
  const log_1 = require("./log");
6
6
  const user_passed_output_location_1 = require("./user-passed-output-location");
7
- const getOutputFilename = ({ codec, imageSequence, compositionName, defaultExtension, }) => {
7
+ const getOutputFilename = ({ codec, imageSequence, compositionName, defaultExtension, args, }) => {
8
8
  let filename = (0, user_passed_output_location_1.getOutputLocation)({
9
9
  compositionId: compositionName,
10
10
  defaultExtension,
11
+ args,
11
12
  });
12
13
  let extension = renderer_1.RenderInternals.getExtensionOfFilename(filename);
13
14
  if (imageSequence) {
@@ -4,15 +4,20 @@ exports.getRenderMediaOptions = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
5
  const config_1 = require("./config");
6
6
  const get_cli_options_1 = require("./get-cli-options");
7
+ const image_formats_1 = require("./image-formats");
7
8
  const getRenderMediaOptions = async ({ outputLocation, config, serveUrl, codec, }) => {
8
- const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, } = await (0, get_cli_options_1.getCliOptions)({
9
+ const { proResProfile, concurrency, frameRange, overwrite, inputProps, envVariables, quality, crf, pixelFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, height, width, } = await (0, get_cli_options_1.getCliOptions)({
9
10
  isLambda: false,
10
11
  type: 'series',
11
- codec,
12
12
  });
13
+ const imageFormat = (0, image_formats_1.getImageFormat)(codec);
13
14
  return {
14
15
  outputLocation,
15
- composition: config,
16
+ composition: {
17
+ ...config,
18
+ width: width !== null && width !== void 0 ? width : config.width,
19
+ height: height !== null && height !== void 0 ? height : config.height,
20
+ },
16
21
  crf,
17
22
  envVariables,
18
23
  ffmpegExecutable,
package/dist/index.d.ts CHANGED
@@ -66,11 +66,9 @@ export declare const CliInternals: {
66
66
  warn: (message?: any, ...optionalParams: any[]) => void;
67
67
  error: (message?: any, ...optionalParams: any[]) => void;
68
68
  };
69
- loadConfigFile: (remotionRoot: string, configFileName: string, isJavascript: boolean) => Promise<string | null>;
70
69
  getCliOptions: (options: {
71
70
  isLambda: boolean;
72
71
  type: "still" | "series" | "get-compositions";
73
- codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
74
72
  }) => Promise<{
75
73
  puppeteerTimeout: number;
76
74
  concurrency: number | null;
@@ -82,10 +80,9 @@ export declare const CliInternals: {
82
80
  browser: import("@remotion/renderer").Browser;
83
81
  crf: import("@remotion/renderer").Crf | null;
84
82
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
85
- imageFormat: "png" | "jpeg" | "none";
86
83
  proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
87
84
  everyNthFrame: number;
88
- numberOfGifLoops: number | null;
85
+ numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
89
86
  stillFrame: number;
90
87
  browserExecutable: import("@remotion/renderer").BrowserExecutable;
91
88
  ffmpegExecutable: import("@remotion/renderer").FfmpegExecutable;
@@ -101,8 +98,9 @@ export declare const CliInternals: {
101
98
  ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
102
99
  audioBitrate: string | null;
103
100
  videoBitrate: string | null;
101
+ height: number | null;
102
+ width: number | null;
104
103
  }>;
105
- parseCommandLine: () => void;
106
104
  loadConfig: (remotionRoot: string) => Promise<string | null>;
107
105
  initializeCli: (remotionRoot: string) => Promise<void>;
108
106
  BooleanFlags: string[];
@@ -139,4 +137,10 @@ export declare const CliInternals: {
139
137
  compositionId: string;
140
138
  reason: string;
141
139
  }>;
140
+ findEntryPoint: (args: string[], remotionRoot: string) => {
141
+ file: string | null;
142
+ remainingArgs: string[];
143
+ reason: string;
144
+ };
145
+ getImageFormat: (codec: import("@remotion/renderer").CodecOrUndefined) => "png" | "jpeg" | "none";
142
146
  };
package/dist/index.js CHANGED
@@ -26,14 +26,15 @@ const compositions_1 = require("./compositions");
26
26
  const index_1 = require("./config/index");
27
27
  const determine_image_format_1 = require("./determine-image-format");
28
28
  const download_progress_1 = require("./download-progress");
29
+ const entry_point_1 = require("./entry-point");
29
30
  const find_closest_package_json_1 = require("./find-closest-package-json");
30
31
  const format_bytes_1 = require("./format-bytes");
31
32
  const get_cli_options_1 = require("./get-cli-options");
32
33
  const get_config_file_name_1 = require("./get-config-file-name");
33
34
  const handle_common_errors_1 = require("./handle-common-errors");
35
+ const image_formats_1 = require("./image-formats");
34
36
  const initialize_cli_1 = require("./initialize-cli");
35
37
  const lambda_command_1 = require("./lambda-command");
36
- const load_config_1 = require("./load-config");
37
38
  const log_1 = require("./log");
38
39
  const make_progress_bar_1 = require("./make-progress-bar");
39
40
  const parse_command_line_1 = require("./parse-command-line");
@@ -47,8 +48,7 @@ const upgrade_1 = require("./upgrade");
47
48
  const versions_1 = require("./versions");
48
49
  const cli = async () => {
49
50
  (0, index_1.overrideRemotion)();
50
- const args = process.argv;
51
- const command = args[2];
51
+ const [command, ...args] = parse_command_line_1.parsedCli._;
52
52
  if (parse_command_line_1.parsedCli.help) {
53
53
  (0, print_help_1.printHelp)();
54
54
  process.exit(0);
@@ -61,19 +61,19 @@ const cli = async () => {
61
61
  await (0, initialize_cli_1.initializeCli)(remotionRoot);
62
62
  try {
63
63
  if (command === 'compositions') {
64
- await (0, compositions_1.listCompositionsCommand)(remotionRoot);
64
+ await (0, compositions_1.listCompositionsCommand)(remotionRoot, args);
65
65
  }
66
66
  else if (command === 'preview') {
67
- await (0, preview_1.previewCommand)(remotionRoot);
67
+ await (0, preview_1.previewCommand)(remotionRoot, args);
68
68
  }
69
69
  else if (command === 'lambda') {
70
- await (0, lambda_command_1.lambdaCommand)(remotionRoot);
70
+ await (0, lambda_command_1.lambdaCommand)(remotionRoot, args);
71
71
  }
72
72
  else if (command === 'render') {
73
- await (0, render_1.render)(remotionRoot);
73
+ await (0, render_1.render)(remotionRoot, args);
74
74
  }
75
75
  else if (command === 'still') {
76
- await (0, still_1.still)(remotionRoot);
76
+ await (0, still_1.still)(remotionRoot, args);
77
77
  }
78
78
  else if (command === 'upgrade') {
79
79
  await (0, upgrade_1.upgrade)(remotionRoot, parse_command_line_1.parsedCli['package-manager']);
@@ -82,7 +82,7 @@ const cli = async () => {
82
82
  await (0, versions_1.versionsCommand)(remotionRoot);
83
83
  }
84
84
  else if (command === 'benchmark') {
85
- await (0, benchmark_1.benchmarkCommand)(remotionRoot, parse_command_line_1.parsedCli._.slice(1));
85
+ await (0, benchmark_1.benchmarkCommand)(remotionRoot, args);
86
86
  }
87
87
  else if (command === 'help') {
88
88
  (0, print_help_1.printHelp)();
@@ -115,9 +115,7 @@ exports.CliInternals = {
115
115
  chalk: chalk_1.chalk,
116
116
  makeProgressBar: make_progress_bar_1.makeProgressBar,
117
117
  Log: log_1.Log,
118
- loadConfigFile: load_config_1.loadConfigFile,
119
118
  getCliOptions: get_cli_options_1.getCliOptions,
120
- parseCommandLine: parse_command_line_1.parseCommandLine,
121
119
  loadConfig: get_config_file_name_1.loadConfig,
122
120
  initializeCli: initialize_cli_1.initializeCli,
123
121
  BooleanFlags: parse_command_line_1.BooleanFlags,
@@ -131,4 +129,6 @@ exports.CliInternals = {
131
129
  determineFinalImageFormat: determine_image_format_1.determineFinalImageFormat,
132
130
  minimist: minimist_1.default,
133
131
  selectComposition: select_composition_1.selectComposition,
132
+ findEntryPoint: entry_point_1.findEntryPoint,
133
+ getImageFormat: image_formats_1.getImageFormat,
134
134
  };
@@ -1 +1 @@
1
- export declare const lambdaCommand: (remotionRoot: string) => Promise<never>;
1
+ export declare const lambdaCommand: (remotionRoot: string, args: string[]) => Promise<never>;
@@ -2,16 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lambdaCommand = void 0;
4
4
  const log_1 = require("./log");
5
- const parse_command_line_1 = require("./parse-command-line");
6
5
  const get_package_manager_1 = require("./preview-server/get-package-manager");
7
6
  const update_available_1 = require("./preview-server/update-available");
8
- const lambdaCommand = async (remotionRoot) => {
7
+ const lambdaCommand = async (remotionRoot, args) => {
9
8
  try {
10
9
  const path = require.resolve('@remotion/lambda', {
11
10
  paths: [remotionRoot],
12
11
  });
13
12
  const { LambdaInternals } = require(path);
14
- await LambdaInternals.executeCommand(parse_command_line_1.parsedCli._.slice(1));
13
+ await LambdaInternals.executeCommand(args, remotionRoot);
15
14
  process.exit(0);
16
15
  }
17
16
  catch (err) {
@@ -10,6 +10,7 @@ exports.listOfRemotionPackages = [
10
10
  '@remotion/lottie',
11
11
  '@remotion/media-utils',
12
12
  '@remotion/motion-blur',
13
+ '@remotion/google-fonts',
13
14
  '@remotion/noise',
14
15
  '@remotion/paths',
15
16
  '@remotion/babel-loader',
@@ -36,6 +36,8 @@ export declare type CommandLineOptions = {
36
36
  ['disable-headless']: boolean;
37
37
  ['disable-keyboard-shortcuts']: boolean;
38
38
  muted: boolean;
39
+ height: number;
40
+ width: number;
39
41
  ['enforce-audio-track']: boolean;
40
42
  gl: OpenGlRenderer;
41
43
  ['package-manager']: string;
@@ -80,6 +80,12 @@ const parseCommandLine = () => {
80
80
  if (exports.parsedCli.timeout) {
81
81
  config_1.Config.Puppeteer.setTimeoutInMilliseconds(exports.parsedCli.timeout);
82
82
  }
83
+ if (exports.parsedCli.height) {
84
+ config_1.Config.Output.overrideHeight(exports.parsedCli.height);
85
+ }
86
+ if (exports.parsedCli.width) {
87
+ config_1.Config.Output.overrideWidth(exports.parsedCli.width);
88
+ }
83
89
  if (exports.parsedCli.frames) {
84
90
  config_1.ConfigInternals.setFrameRangeFromCli(exports.parsedCli.frames);
85
91
  }
@@ -24,6 +24,7 @@ const AskOnDiscord = ({ canHaveKeyboardShortcuts }) => {
24
24
  key: 'd',
25
25
  callback: onEditor,
26
26
  commandCtrlKey: true,
27
+ preventDefault: true,
27
28
  });
28
29
  return () => unregister();
29
30
  }, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
@@ -27,6 +27,7 @@ const HelpLink = ({ canHaveKeyboardShortcuts, link }) => {
27
27
  key: 'h',
28
28
  callback: onEditor,
29
29
  commandCtrlKey: true,
30
+ preventDefault: true,
30
31
  });
31
32
  return () => unregister();
32
33
  }, [canHaveKeyboardShortcuts, openLink, registerKeybinding]);
@@ -87,6 +87,7 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
87
87
  key: 'o',
88
88
  callback: onEditor,
89
89
  commandCtrlKey: true,
90
+ preventDefault: true,
90
91
  });
91
92
  return () => unregister();
92
93
  }, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
@@ -23,6 +23,7 @@ const SearchGithubIssues = ({ message, canHaveKeyboardShortcuts }) => {
23
23
  key: 'g',
24
24
  callback: onEditor,
25
25
  commandCtrlKey: true,
26
+ preventDefault: true,
26
27
  });
27
28
  return () => unregister();
28
29
  }, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export declare const cmdOrCtrlCharacter: string;
2
3
  export declare const ShortcutHint: React.FC<{
3
4
  keyToPress: string;
4
5
  cmdOrCtrl: boolean;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShortcutHint = void 0;
3
+ exports.ShortcutHint = exports.cmdOrCtrlCharacter = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const cmdOrCtrlCharacter = window.navigator.platform.startsWith('Mac')
5
+ exports.cmdOrCtrlCharacter = window.navigator.platform.startsWith('Mac')
6
6
  ? '⌘'
7
7
  : 'Ctrl';
8
8
  const container = {
@@ -11,6 +11,6 @@ const container = {
11
11
  opacity: 0.6,
12
12
  };
13
13
  const ShortcutHint = ({ keyToPress, cmdOrCtrl }) => {
14
- return ((0, jsx_runtime_1.jsxs)("span", { style: container, children: [cmdOrCtrl ? `${cmdOrCtrlCharacter}+` : '', keyToPress.toUpperCase()] }));
14
+ return ((0, jsx_runtime_1.jsxs)("span", { style: container, children: [cmdOrCtrl ? `${exports.cmdOrCtrlCharacter}+` : '', keyToPress.toUpperCase()] }));
15
15
  };
16
16
  exports.ShortcutHint = ShortcutHint;
package/dist/preview.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const previewCommand: (remotionRoot: string) => Promise<void>;
1
+ export declare const previewCommand: (remotionRoot: string, args: string[]) => Promise<void>;
package/dist/preview.js CHANGED
@@ -8,6 +8,7 @@ const better_opn_1 = __importDefault(require("better-opn"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const chalk_1 = require("./chalk");
10
10
  const config_1 = require("./config");
11
+ const entry_point_1 = require("./entry-point");
11
12
  const get_env_1 = require("./get-env");
12
13
  const get_input_props_1 = require("./get-input-props");
13
14
  const get_network_address_1 = require("./get-network-address");
@@ -31,8 +32,9 @@ const waitForLiveEventsListener = () => {
31
32
  });
32
33
  });
33
34
  };
34
- const previewCommand = async (remotionRoot) => {
35
- const file = parse_command_line_1.parsedCli._[1];
35
+ const previewCommand = async (remotionRoot, args) => {
36
+ const { file, reason } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
37
+ log_1.Log.verbose('Entry point:', file, 'reason:', reason);
36
38
  if (!file) {
37
39
  log_1.Log.error('The preview command requires you to specify a root file. For example');
38
40
  log_1.Log.error(' npx remotion preview src/index.tsx');
package/dist/render.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const render: (remotionRoot: string) => Promise<void>;
1
+ export declare const render: (remotionRoot: string, args: string[]) => Promise<void>;