@remotion/cli 4.0.17 → 4.0.18

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 Cloud Run 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;
@@ -0,0 +1,14 @@
1
+ export type SerializedJSONWithCustomFields = {
2
+ serializedString: string;
3
+ customDateUsed: boolean;
4
+ customFileUsed: boolean;
5
+ mapUsed: boolean;
6
+ setUsed: boolean;
7
+ };
8
+ export declare const FILE_TOKEN = "remotion-file:";
9
+ export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
10
+ data: unknown;
11
+ indent: number | undefined;
12
+ staticBase: string;
13
+ }) => SerializedJSONWithCustomFields;
14
+ export declare const deserializeJSONWithCustomFields: (data: string) => any;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
4
+ const DATE_TOKEN = 'remotion-date:';
5
+ exports.FILE_TOKEN = 'remotion-file:';
6
+ const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
7
+ let customDateUsed = false;
8
+ let customFileUsed = false;
9
+ let mapUsed = false;
10
+ let setUsed = false;
11
+ const serializedString = JSON.stringify(data, function (key, value) {
12
+ const item = this[key];
13
+ if (item instanceof Date) {
14
+ customDateUsed = true;
15
+ return `${DATE_TOKEN}${item.toISOString()}`;
16
+ }
17
+ if (item instanceof Map) {
18
+ mapUsed = true;
19
+ return value;
20
+ }
21
+ if (item instanceof Set) {
22
+ setUsed = true;
23
+ return value;
24
+ }
25
+ if (typeof item === 'string' && item.startsWith(staticBase)) {
26
+ customFileUsed = true;
27
+ return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
28
+ }
29
+ return value;
30
+ }, indent);
31
+ return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
32
+ };
33
+ exports.serializeJSONWithDate = serializeJSONWithDate;
34
+ const deserializeJSONWithCustomFields = (data) => {
35
+ return JSON.parse(data, (_, value) => {
36
+ if (typeof value === 'string' && value.startsWith(DATE_TOKEN)) {
37
+ return new Date(value.replace(DATE_TOKEN, ''));
38
+ }
39
+ return value;
40
+ });
41
+ };
42
+ exports.deserializeJSONWithCustomFields = deserializeJSONWithCustomFields;
@@ -4,10 +4,8 @@ exports.RightPanel = exports.rightSidebarTabs = exports.persistSelectedPanel = v
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
- const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
8
7
  const colors_1 = require("../helpers/colors");
9
8
  const DataEditor_1 = require("./RenderModal/DataEditor");
10
- const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
11
9
  const RenderQueue_1 = require("./RenderQueue");
12
10
  const RendersTab_1 = require("./RendersTab");
13
11
  const Tabs_1 = require("./Tabs");
@@ -18,10 +16,17 @@ const container = {
18
16
  display: 'flex',
19
17
  flexDirection: 'column',
20
18
  };
21
- const circle = {
22
- width: 8,
23
- height: 8,
24
- borderRadius: 4,
19
+ const PropsEditor = ({ composition }) => {
20
+ const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
21
+ const setInputProps = (0, react_1.useCallback)((newProps) => {
22
+ updateProps({
23
+ id: composition.id,
24
+ defaultProps: composition.defaultProps,
25
+ newProps,
26
+ });
27
+ }, [composition.defaultProps, composition.id, updateProps]);
28
+ const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
29
+ return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
25
30
  };
26
31
  const localStorageKey = 'remotion.sidebarPanel';
27
32
  const getSelectedPanel = () => {
@@ -40,8 +45,6 @@ const persistSelectedPanel = (panel) => {
40
45
  exports.persistSelectedPanel = persistSelectedPanel;
41
46
  exports.rightSidebarTabs = (0, react_1.createRef)();
42
47
  const RightPanel = () => {
43
- const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
44
- const [saving, setSaving] = (0, react_1.useState)(false);
45
48
  const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
46
49
  const onCompositionsSelected = (0, react_1.useCallback)(() => {
47
50
  setPanel('input-props');
@@ -60,14 +63,6 @@ const RightPanel = () => {
60
63
  };
61
64
  }, []);
62
65
  const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
63
- const circleStyle = (0, react_1.useMemo)(() => {
64
- const onTabColor = saving ? colors_1.LIGHT_TEXT : 'white';
65
- return {
66
- ...circle,
67
- backgroundColor: panel === 'input-props' ? onTabColor : colors_1.LIGHT_TEXT,
68
- cursor: 'help',
69
- };
70
- }, [panel, saving]);
71
66
  const composition = (0, react_1.useMemo)(() => {
72
67
  for (const comp of compositions) {
73
68
  if (comp.id === currentComposition) {
@@ -76,37 +71,9 @@ const RightPanel = () => {
76
71
  }
77
72
  return null;
78
73
  }, [compositions, currentComposition]);
79
- const saveToolTip = (0, react_1.useMemo)(() => {
80
- return process.env.KEYBOARD_SHORTCUTS_ENABLED
81
- ? `Save using ${ShortcutHint_1.cmdOrCtrlCharacter}+S`
82
- : 'There are unsaved changes';
83
- }, []);
84
- const setInputProps = (0, react_1.useCallback)((newProps) => {
85
- if (composition === null) {
86
- return;
87
- }
88
- updateProps({
89
- id: composition.id,
90
- defaultProps: composition.defaultProps,
91
- newProps,
92
- });
93
- }, [composition, updateProps]);
94
- const actualProps = (0, react_1.useMemo)(() => {
95
- var _a, _b;
96
- if (composition === null) {
97
- return {};
98
- }
99
- return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {};
100
- }, [composition, props]);
101
- const unsavedChangesExist = (0, react_1.useMemo)(() => {
102
- if (composition === null || composition.defaultProps === undefined) {
103
- return false;
104
- }
105
- return !(0, deep_equal_1.deepEqual)(composition.defaultProps, actualProps);
106
- }, [actualProps, composition]);
107
74
  if (composition === null) {
108
75
  return null;
109
76
  }
110
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onCompositionsSelected, style: { justifyContent: 'space-between' }, children: ["Props", unsavedChangesExist ? ((0, jsx_runtime_1.jsx)("div", { title: saveToolTip, style: circleStyle })) : null] }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props", saving: saving, setSaving: setSaving }, composition.id))] }));
77
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onCompositionsSelected, children: "Props" }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(PropsEditor, { composition: composition }))] }));
111
78
  };
112
79
  exports.RightPanel = RightPanel;
@@ -12,7 +12,7 @@ export declare const getCliOptions: (options: {
12
12
  inputProps: Record<string, unknown>;
13
13
  envVariables: Record<string, string>;
14
14
  jpegQuality: number;
15
- browser: import("@remotion/renderer").Browser;
15
+ browser: "chrome";
16
16
  crf: import("@remotion/renderer").Crf | null;
17
17
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
18
18
  proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
@@ -47,7 +47,7 @@ const getProResProfile = () => {
47
47
  const getAndValidateBrowser = async (browserExecutable) => {
48
48
  const browser = getBrowser();
49
49
  try {
50
- await renderer_1.RenderInternals.ensureLocalBrowser(browser, browserExecutable);
50
+ await renderer_1.RenderInternals.ensureLocalBrowser(browserExecutable);
51
51
  }
52
52
  catch (err) {
53
53
  log_1.Log.error('Could not download a browser for rendering frames.');
package/dist/index.d.ts CHANGED
@@ -97,7 +97,7 @@ export declare const CliInternals: {
97
97
  inputProps: Record<string, unknown>;
98
98
  envVariables: Record<string, string>;
99
99
  jpegQuality: number;
100
- browser: import("@remotion/renderer").Browser;
100
+ browser: "chrome";
101
101
  crf: import("@remotion/renderer").Crf | null;
102
102
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
103
103
  proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ const minimist_1 = __importDefault(require("minimist"));
23
23
  const benchmark_1 = require("./benchmark");
24
24
  const chalk_1 = require("./chalk");
25
25
  const cleanup_before_quit_1 = require("./cleanup-before-quit");
26
+ const cloudrun_command_1 = require("./cloudrun-command");
26
27
  const compositions_1 = require("./compositions");
27
28
  const config_1 = require("./config");
28
29
  const determine_image_format_1 = require("./determine-image-format");
@@ -77,6 +78,9 @@ const cli = async () => {
77
78
  else if (command === 'lambda') {
78
79
  await (0, lambda_command_1.lambdaCommand)(remotionRoot, args);
79
80
  }
81
+ else if (command === 'cloudrun') {
82
+ await (0, cloudrun_command_1.cloudrunCommand)(remotionRoot, args);
83
+ }
80
84
  else if (command === 'render') {
81
85
  await (0, render_1.render)(remotionRoot, args);
82
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.17",
3
+ "version": "4.0.18",
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.17",
39
- "remotion": "4.0.17",
40
- "@remotion/renderer": "4.0.17",
41
- "@remotion/media-utils": "4.0.17",
42
- "@remotion/player": "4.0.17"
38
+ "@remotion/media-utils": "4.0.18",
39
+ "@remotion/player": "4.0.18",
40
+ "@remotion/renderer": "4.0.18",
41
+ "remotion": "4.0.18",
42
+ "@remotion/bundler": "4.0.18"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -62,11 +62,10 @@
62
62
  "prettier-plugin-organize-imports": "^3.2.2",
63
63
  "react": "^18.0.0",
64
64
  "react-dom": "^18.0.0",
65
- "typescript": "4.9.5",
66
65
  "vitest": "0.31.1",
67
66
  "zod": "^3.21.4",
68
- "@remotion/zod-types": "4.0.17",
69
- "@remotion/tailwind": "4.0.17"
67
+ "@remotion/tailwind": "4.0.18",
68
+ "@remotion/zod-types": "4.0.18"
70
69
  },
71
70
  "keywords": [
72
71
  "remotion",