@remotion/cli 4.0.0-alpha5 → 4.0.0-alpha6
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/better-opn/index.js +3 -3
- package/dist/cloudrun-command.d.ts +1 -0
- package/dist/cloudrun-command.js +27 -0
- package/dist/color-math.js +3 -1
- package/dist/convert-entry-point-to-serve-url.js +2 -2
- package/dist/editor/components/MenuToolbar.js +15 -3
- package/dist/editor/components/RenderModal/CliCopyButton.js +42 -9
- package/dist/editor/components/RenderModal/InfoTooltip.js +2 -1
- package/dist/editor/components/RenderModal/OptionExplainer.js +13 -3
- package/dist/editor/components/RenderModal/RenderModalPicture.js +1 -1
- package/dist/editor/components/SidebarCollapserControls.js +12 -6
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/dist/editor/helpers/colors.js +1 -1
- package/dist/entry-point.js +17 -17
- package/dist/ffmpeg.js +8 -3
- package/dist/file-watcher.js +5 -5
- package/dist/get-cli-options.js +4 -4
- package/dist/get-config-file-name.js +6 -6
- package/dist/get-env.js +10 -10
- package/dist/get-input-props.js +9 -9
- package/dist/get-network-address.js +2 -2
- package/dist/index.js +4 -0
- package/dist/load-config.js +8 -8
- package/dist/preview-server/api-types.d.ts +1 -1
- package/dist/preview-server/dev-middleware/compatible-api.d.ts +2 -2
- package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
- package/dist/preview-server/dev-middleware/middleware.js +7 -7
- package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.js +5 -5
- package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.js +17 -17
- package/dist/preview-server/file-existence-watchers.js +3 -3
- package/dist/preview-server/get-absolute-public-dir.js +3 -3
- package/dist/preview-server/get-package-manager.js +3 -3
- package/dist/preview-server/handler.d.ts +1 -1
- package/dist/preview-server/hot-middleware/index.d.ts +1 -1
- package/dist/preview-server/hot-middleware/index.js +2 -2
- package/dist/preview-server/live-events.d.ts +1 -1
- package/dist/preview-server/parse-body.d.ts +1 -1
- package/dist/preview-server/project-info.js +5 -5
- package/dist/preview-server/public-folder.js +8 -8
- package/dist/preview-server/render-queue/open-directory-in-finder.js +8 -8
- package/dist/preview-server/render-queue/queue.js +2 -2
- package/dist/preview-server/routes/can-update-default-props.js +2 -2
- package/dist/preview-server/routes/update-default-props.js +3 -3
- package/dist/preview-server/routes.d.ts +1 -1
- package/dist/preview-server/routes.js +8 -8
- package/dist/preview-server/serve-static.d.ts +1 -1
- package/dist/preview-server/serve-static.js +7 -7
- package/dist/preview-server/start-server.js +2 -2
- package/dist/preview.js +4 -4
- package/dist/render-flows/render.js +5 -5
- package/dist/render-flows/still.js +3 -3
- package/dist/resolve-from.js +5 -5
- package/dist/upgrade.js +2 -2
- package/dist/versions.js +2 -2
- package/package.json +7 -7
package/dist/better-opn/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copied from https://github.com/michaellzc/better-opn#readme
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.openBrowser = void 0;
|
|
5
|
-
const
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
6
|
const open = require("open");
|
|
7
7
|
const normalizeURLToMatch = (target) => {
|
|
8
8
|
// We may encounter URL parse error but want to fallback to default behavior
|
|
@@ -38,7 +38,7 @@ const startBrowserProcess = async ({ browser, url, args, }) => {
|
|
|
38
38
|
'Arc',
|
|
39
39
|
];
|
|
40
40
|
const processes = await new Promise((resolve, reject) => {
|
|
41
|
-
(0,
|
|
41
|
+
(0, node_child_process_1.exec)('ps cax', (err, stdout) => {
|
|
42
42
|
if (err) {
|
|
43
43
|
reject(err);
|
|
44
44
|
}
|
|
@@ -148,7 +148,7 @@ const startBrowserProcess = async ({ browser, url, args, }) => {
|
|
|
148
148
|
end lookupTabWithUrl
|
|
149
149
|
`.trim();
|
|
150
150
|
await new Promise((resolve, reject) => {
|
|
151
|
-
const proc = (0,
|
|
151
|
+
const proc = (0, node_child_process_1.exec)(`osascript -`, (error) => {
|
|
152
152
|
if (error) {
|
|
153
153
|
reject(error);
|
|
154
154
|
}
|
|
@@ -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;
|
package/dist/color-math.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.colorWithNewOpacity = void 0;
|
|
|
4
4
|
const colorWithNewOpacity = (color, opacity, zodTypes) => {
|
|
5
5
|
const { r, g, b } = zodTypes.ZodZypesInternals.parseColor(color);
|
|
6
6
|
if (opacity >= 255) {
|
|
7
|
-
return `#${r.toString(16)
|
|
7
|
+
return `#${r.toString(16).padStart(2, '0')}${g
|
|
8
|
+
.toString(16)
|
|
9
|
+
.padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
|
|
8
10
|
}
|
|
9
11
|
return `rgba(${r}, ${g}, ${b}, ${(opacity / 255).toFixed(2)})`;
|
|
10
12
|
};
|
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.convertEntryPointToServeUrl = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const convertEntryPointToServeUrl = (entryPoint) => {
|
|
10
10
|
const fullPath = renderer_1.RenderInternals.isServeUrl(entryPoint)
|
|
11
11
|
? entryPoint
|
|
12
|
-
:
|
|
12
|
+
: node_path_1.default.resolve(process.cwd(), entryPoint);
|
|
13
13
|
return fullPath;
|
|
14
14
|
};
|
|
15
15
|
exports.convertEntryPointToServeUrl = convertEntryPointToServeUrl;
|
|
@@ -21,6 +21,18 @@ const row = {
|
|
|
21
21
|
paddingRight: 10,
|
|
22
22
|
backgroundColor: colors_1.BACKGROUND,
|
|
23
23
|
};
|
|
24
|
+
const fixedWidthRight = {
|
|
25
|
+
minWidth: '350px',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'flex-end',
|
|
29
|
+
};
|
|
30
|
+
const fixedWidthLeft = {
|
|
31
|
+
minWidth: '350px',
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'flex-start',
|
|
35
|
+
};
|
|
24
36
|
const flex = {
|
|
25
37
|
flex: 1,
|
|
26
38
|
};
|
|
@@ -63,8 +75,8 @@ const MenuToolbar = () => {
|
|
|
63
75
|
const onItemQuit = (0, react_1.useCallback)(() => {
|
|
64
76
|
setSelected(null);
|
|
65
77
|
}, [setSelected]);
|
|
66
|
-
return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", className: "css-reset", style: row, children: [structure.map((s) => {
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { justify: "center", align: "center", className: "css-reset", style: row, children: [(0, jsx_runtime_1.jsxs)("div", { style: fixedWidthLeft, children: [structure.map((s) => {
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
|
|
80
|
+
}), (0, jsx_runtime_1.jsx)(UpdateCheck_1.UpdateCheck, {})] }), (0, jsx_runtime_1.jsx)("div", { style: flex }), (0, jsx_runtime_1.jsx)(MenuBuildIndicator_1.MenuBuildIndicator, {}), (0, jsx_runtime_1.jsx)("div", { style: flex }), (0, jsx_runtime_1.jsx)("div", { style: fixedWidthRight, children: (0, jsx_runtime_1.jsx)(SidebarCollapserControls_1.SidebarCollapserControls, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 })] }));
|
|
69
81
|
};
|
|
70
82
|
exports.MenuToolbar = MenuToolbar;
|
|
@@ -2,21 +2,54 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CliCopyButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
|
+
const svgStyle = {
|
|
8
|
+
width: 16,
|
|
9
|
+
height: 16,
|
|
10
|
+
verticalAlign: 'sub',
|
|
11
|
+
};
|
|
12
|
+
const copiedStyle = {
|
|
13
|
+
fontSize: '14px',
|
|
14
|
+
minHeight: '30px',
|
|
15
|
+
minWidth: '30px',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
};
|
|
5
20
|
const CliCopyButton = ({ valueToCopy, }) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
const
|
|
13
|
-
|
|
21
|
+
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
22
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
23
|
+
const fillColor = (0, react_1.useMemo)(() => {
|
|
24
|
+
return hovered ? 'white' : colors_1.LIGHT_TEXT;
|
|
25
|
+
}, [hovered]);
|
|
26
|
+
const clipboardIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: fillColor, d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
|
|
27
|
+
const checkSvg = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: fillColor, d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }) }));
|
|
28
|
+
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
29
|
+
setHovered(true);
|
|
30
|
+
}, []);
|
|
31
|
+
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
32
|
+
setHovered(false);
|
|
33
|
+
}, []);
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
if (!copied) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const handleClear = () => {
|
|
39
|
+
setCopied(false);
|
|
40
|
+
setHovered(false);
|
|
41
|
+
};
|
|
42
|
+
const to = setTimeout(() => handleClear(), 2000);
|
|
43
|
+
return () => clearTimeout(to);
|
|
44
|
+
}, [copied]);
|
|
45
|
+
return copied ? ((0, jsx_runtime_1.jsx)("span", { style: copiedStyle, children: checkSvg })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: {
|
|
14
46
|
width: '30px',
|
|
15
47
|
height: '30px',
|
|
16
48
|
border: 'none',
|
|
17
49
|
cursor: 'pointer',
|
|
18
50
|
}, onClick: () => {
|
|
19
51
|
navigator.clipboard.writeText(valueToCopy);
|
|
20
|
-
|
|
52
|
+
setCopied(true);
|
|
53
|
+
}, children: clipboardIcon }));
|
|
21
54
|
};
|
|
22
55
|
exports.CliCopyButton = CliCopyButton;
|
|
@@ -29,12 +29,13 @@ const InfoTooltip = ({ children, arrowDirection }) => {
|
|
|
29
29
|
border: '0.5px solid ' + colors_1.BORDER_COLOR,
|
|
30
30
|
maxHeight: 200,
|
|
31
31
|
overflow: 'auto',
|
|
32
|
+
borderRadius: '4px',
|
|
32
33
|
};
|
|
33
34
|
}, [arrowDirection]);
|
|
34
35
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
35
36
|
display: 'flex',
|
|
36
37
|
flexDirection: arrowDirection === 'up' ? 'column-reverse' : 'column',
|
|
37
38
|
alignItems: 'flex-start',
|
|
38
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: children }), arrowDirection === 'down' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowDown, children: (0, jsx_runtime_1.jsx)("path", { d: `M 14 0 L 7 7 L 0 0`, fill: colors_1.
|
|
39
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: children }), arrowDirection === 'down' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowDown, children: (0, jsx_runtime_1.jsx)("path", { d: `M 14 0 L 7 7 L 0 0`, fill: colors_1.INPUT_BACKGROUND, strokeLinecap: "butt", stroke: colors_1.BORDER_COLOR, strokeWidth: 0.5 }) })) : null, arrowDirection === 'up' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowUp, children: (0, jsx_runtime_1.jsx)("path", { d: `M 0 7 L 7 0 L 14 7`, fill: colors_1.INPUT_BACKGROUND, strokeLinecap: "butt", stroke: colors_1.BORDER_COLOR, strokeWidth: 0.5 }) })) : null] }));
|
|
39
40
|
};
|
|
40
41
|
exports.InfoTooltip = InfoTooltip;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OptionExplainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../../helpers/colors");
|
|
5
6
|
const layout_1 = require("../layout");
|
|
6
7
|
const MenuDivider_1 = require("../Menu/MenuDivider");
|
|
7
8
|
const CliCopyButton_1 = require("./CliCopyButton");
|
|
@@ -9,10 +10,11 @@ const container = {
|
|
|
9
10
|
fontSize: 14,
|
|
10
11
|
paddingTop: 10,
|
|
11
12
|
paddingBottom: 10,
|
|
13
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
12
14
|
};
|
|
13
15
|
const padding = {
|
|
14
|
-
paddingLeft:
|
|
15
|
-
paddingRight:
|
|
16
|
+
paddingLeft: 20,
|
|
17
|
+
paddingRight: 20,
|
|
16
18
|
};
|
|
17
19
|
const title = {
|
|
18
20
|
fontSize: 14,
|
|
@@ -39,7 +41,15 @@ const infoRowLabel = {
|
|
|
39
41
|
fontSize: 14,
|
|
40
42
|
color: 'white',
|
|
41
43
|
};
|
|
44
|
+
const flexSpacer = {
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flex: 1,
|
|
47
|
+
};
|
|
48
|
+
const copyWrapper = {
|
|
49
|
+
display: 'flex',
|
|
50
|
+
justifyContent: 'flex-end',
|
|
51
|
+
};
|
|
42
52
|
const OptionExplainer = ({ option }) => {
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "__remotion-info-button-container", children: [(0, jsx_runtime_1.jsxs)("div", { style: padding, children: [(0, jsx_runtime_1.
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "__remotion-info-button-container", children: [(0, jsx_runtime_1.jsxs)("div", { style: padding, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("strong", { style: title, children: option.name }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("a", { style: link, href: option.docLink, target: "_blank", children: "Docs" })] }), (0, jsx_runtime_1.jsx)("div", { style: description, children: option.description })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 0.5, block: true }), (0, jsx_runtime_1.jsx)(MenuDivider_1.MenuDivider, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 0.5, block: true }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: infoRow, children: [(0, jsx_runtime_1.jsx)("div", { style: infoRowLabel, children: "CLI flag" }), (0, jsx_runtime_1.jsx)("div", { style: flexSpacer }), (0, jsx_runtime_1.jsx)("code", { children: option.cliFlag }), (0, jsx_runtime_1.jsx)("div", { style: copyWrapper, children: (0, jsx_runtime_1.jsx)(CliCopyButton_1.CliCopyButton, { valueToCopy: option.cliFlag }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: infoRow, children: [(0, jsx_runtime_1.jsx)("div", { style: infoRowLabel, children: "Node.JS option" }), (0, jsx_runtime_1.jsx)("div", { style: flexSpacer }), (0, jsx_runtime_1.jsx)("code", { children: option.ssrName }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 3.75 })] }), (0, jsx_runtime_1.jsx)("div", { style: infoRow })] })] }));
|
|
44
54
|
};
|
|
45
55
|
exports.OptionExplainer = OptionExplainer;
|
|
@@ -49,6 +49,6 @@ const RenderModalPicture = ({ renderMode, scale, setScale, pixelFormat, setPixel
|
|
|
49
49
|
const onTargetVideoBitrateChanged = (0, react_1.useCallback)((e) => {
|
|
50
50
|
setCustomTargetVideoBitrateValue(e.target.value);
|
|
51
51
|
}, [setCustomTargetVideoBitrateValue]);
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Image Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: false }) })] })) : null, renderMode === 'video' && videoImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'still' && stillImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'video' && qualityControlType !== null ? ((0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})) : null, shouldDisplayQualityControlPicker && renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Quality control" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: qualityControlOptions, needsWrapping: true }) })] })) : null, qualityControlType === 'crf' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsx)(CrfSetting_1.CrfSetting, { crf: crf, min: minCrf, max: maxCrf, setCrf: setCrf, option: client_1.BrowserSafeApis.options.crfOption })) : null, qualityControlType === 'bitrate' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Image Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: false }) })] })) : null, renderMode === 'video' && videoImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'still' && stillImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'video' && qualityControlType !== null ? ((0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})) : null, shouldDisplayQualityControlPicker && renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Quality control" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: qualityControlOptions, needsWrapping: true }) })] })) : null, qualityControlType === 'crf' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsx)(CrfSetting_1.CrfSetting, { crf: crf, min: minCrf, max: maxCrf, setCrf: setCrf, option: client_1.BrowserSafeApis.options.crfOption })) : null, qualityControlType === 'bitrate' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Target video bitrate", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoBitrate }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetVideoBitrate, onChange: onTargetVideoBitrateChanged, status: "ok", rightAlign: true }) }) })] })) : null, renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, (0, jsx_runtime_1.jsx)(ScaleSetting_1.ScaleSetting, { scale: scale, setScale: setScale }), renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Pixel format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: pixelFormatOptions, selectedId: pixelFormat, title: "Pixel Format" }) })] })) : null] }));
|
|
53
53
|
};
|
|
54
54
|
exports.RenderModalPicture = RenderModalPicture;
|
|
@@ -7,11 +7,11 @@ const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-over
|
|
|
7
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
8
|
const sidebar_1 = require("../state/sidebar");
|
|
9
9
|
const InlineAction_1 = require("./InlineAction");
|
|
10
|
-
const layout_1 = require("./layout");
|
|
11
10
|
const TopPanel_1 = require("./TopPanel");
|
|
12
11
|
const style = {
|
|
13
12
|
width: 16,
|
|
14
13
|
height: 16,
|
|
14
|
+
minWidth: 16,
|
|
15
15
|
border: '1px solid currentColor',
|
|
16
16
|
borderRadius: 3,
|
|
17
17
|
color: 'currentColor',
|
|
@@ -118,12 +118,18 @@ const SidebarCollapserControls = () => {
|
|
|
118
118
|
const toggleRightTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
119
119
|
? 'Toggle Right Sidebar'
|
|
120
120
|
: `Toggle Right Sidebar (${ShortcutHint_1.cmdOrCtrlCharacter}+J)`;
|
|
121
|
+
const colorStyle = (0, react_1.useCallback)((color) => {
|
|
122
|
+
return {
|
|
123
|
+
...style,
|
|
124
|
+
color,
|
|
125
|
+
};
|
|
126
|
+
}, []);
|
|
121
127
|
const toggleLeftAction = (0, react_1.useCallback)((color) => {
|
|
122
|
-
return ((0, jsx_runtime_1.jsx)("div", { style:
|
|
123
|
-
}, [leftIcon, toggleLeftTooltip]);
|
|
128
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: colorStyle(color), title: toggleLeftTooltip, children: (0, jsx_runtime_1.jsx)("div", { style: leftIcon(color) }) }));
|
|
129
|
+
}, [colorStyle, leftIcon, toggleLeftTooltip]);
|
|
124
130
|
const toggleRightAction = (0, react_1.useCallback)((color) => {
|
|
125
|
-
return ((0, jsx_runtime_1.jsx)("div", { style:
|
|
126
|
-
}, [rightIcon, toggleRightTooltip]);
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
131
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: colorStyle(color), title: toggleRightTooltip, children: (0, jsx_runtime_1.jsx)("div", { style: rightIcon(color) }) }));
|
|
132
|
+
}, [colorStyle, rightIcon, toggleRightTooltip]);
|
|
133
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: toggleLeft, renderAction: toggleLeftAction }), (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: toggleRight, renderAction: toggleRightAction })] }));
|
|
128
134
|
};
|
|
129
135
|
exports.SidebarCollapserControls = SidebarCollapserControls;
|
|
@@ -3,7 +3,7 @@ export declare const INPUT_BACKGROUND = "#2f363d";
|
|
|
3
3
|
export declare const BORDER_COLOR = "#000";
|
|
4
4
|
export declare const LIGHT_COLOR = "#ddd";
|
|
5
5
|
export declare const SELECTED_BACKGROUND = "hsla(0, 0%, 100%, 0.15)";
|
|
6
|
-
export declare const LIGHT_TEXT = "
|
|
6
|
+
export declare const LIGHT_TEXT = "#A6A7A9";
|
|
7
7
|
export declare const VERY_LIGHT_TEXT = "rgba(255, 255, 255, 0.3)";
|
|
8
8
|
export declare const CLEAR_HOVER = "rgba(255, 255, 255, 0.06)";
|
|
9
9
|
export declare const INPUT_BORDER_COLOR_UNHOVERED = "rgba(0, 0, 0, 0.6)";
|
|
@@ -6,7 +6,7 @@ exports.INPUT_BACKGROUND = '#2f363d';
|
|
|
6
6
|
exports.BORDER_COLOR = '#000';
|
|
7
7
|
exports.LIGHT_COLOR = '#ddd';
|
|
8
8
|
exports.SELECTED_BACKGROUND = 'hsla(0, 0%, 100%, 0.15)';
|
|
9
|
-
exports.LIGHT_TEXT = '
|
|
9
|
+
exports.LIGHT_TEXT = '#A6A7A9';
|
|
10
10
|
exports.VERY_LIGHT_TEXT = 'rgba(255, 255, 255, 0.3)';
|
|
11
11
|
const SELECTED_HOVER_BACKGROUND = 'hsla(0, 0%, 100%, 0.25)';
|
|
12
12
|
exports.CLEAR_HOVER = 'rgba(255, 255, 255, 0.06)';
|
package/dist/entry-point.js
CHANGED
|
@@ -5,20 +5,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.findEntryPoint = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const config_1 = require("./config");
|
|
11
11
|
const log_1 = require("./log");
|
|
12
12
|
const candidates = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
node_path_1.default.join('src', 'index.ts'),
|
|
14
|
+
node_path_1.default.join('src', 'index.tsx'),
|
|
15
|
+
node_path_1.default.join('src', 'index.js'),
|
|
16
|
+
node_path_1.default.join('remotion', 'index.tsx'),
|
|
17
|
+
node_path_1.default.join('remotion', 'index.ts'),
|
|
18
|
+
node_path_1.default.join('remotion', 'index.js'),
|
|
19
19
|
];
|
|
20
20
|
const findCommonPath = (remotionRoot) => {
|
|
21
|
-
return candidates.find((candidate) => (0,
|
|
21
|
+
return candidates.find((candidate) => (0, node_fs_1.existsSync)(node_path_1.default.resolve(remotionRoot, candidate)));
|
|
22
22
|
};
|
|
23
23
|
const findEntryPoint = (args, remotionRoot) => {
|
|
24
24
|
const result = findEntryPointInner(args, remotionRoot);
|
|
@@ -28,10 +28,10 @@ const findEntryPoint = (args, remotionRoot) => {
|
|
|
28
28
|
if (renderer_1.RenderInternals.isServeUrl(result.file)) {
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
31
|
-
if (!(0,
|
|
31
|
+
if (!(0, node_fs_1.existsSync)(result.file)) {
|
|
32
32
|
throw new Error(`${result.file} was chosen as the entry point (reason = ${result.reason}) but it does not exist.`);
|
|
33
33
|
}
|
|
34
|
-
if ((0,
|
|
34
|
+
if ((0, node_fs_1.lstatSync)(result.file).isDirectory()) {
|
|
35
35
|
throw new Error(`${result.file} was chosen as the entry point (reason = ${result.reason}) but it is a directory - it needs to be a file.`);
|
|
36
36
|
}
|
|
37
37
|
return result;
|
|
@@ -42,10 +42,10 @@ const findEntryPointInner = (args, remotionRoot) => {
|
|
|
42
42
|
let file = args[0];
|
|
43
43
|
if (file) {
|
|
44
44
|
log_1.Log.verbose('Checking if', file, 'is the entry file');
|
|
45
|
-
const cwdResolution =
|
|
46
|
-
const remotionRootResolution =
|
|
45
|
+
const cwdResolution = node_path_1.default.resolve(process.cwd(), file);
|
|
46
|
+
const remotionRootResolution = node_path_1.default.resolve(remotionRoot, file);
|
|
47
47
|
// Checking if file was found in CWD
|
|
48
|
-
if ((0,
|
|
48
|
+
if ((0, node_fs_1.existsSync)(cwdResolution)) {
|
|
49
49
|
return {
|
|
50
50
|
file: cwdResolution,
|
|
51
51
|
remainingArgs: args.slice(1),
|
|
@@ -53,7 +53,7 @@ const findEntryPointInner = (args, remotionRoot) => {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
// Checking if file was found in remotion root
|
|
56
|
-
if ((0,
|
|
56
|
+
if ((0, node_fs_1.existsSync)(remotionRootResolution)) {
|
|
57
57
|
return {
|
|
58
58
|
file: remotionRootResolution,
|
|
59
59
|
remainingArgs: args.slice(1),
|
|
@@ -69,7 +69,7 @@ const findEntryPointInner = (args, remotionRoot) => {
|
|
|
69
69
|
if (file) {
|
|
70
70
|
log_1.Log.verbose('Entry point from config file is', file);
|
|
71
71
|
return {
|
|
72
|
-
file:
|
|
72
|
+
file: node_path_1.default.resolve(remotionRoot, file),
|
|
73
73
|
remainingArgs: args,
|
|
74
74
|
reason: 'config file',
|
|
75
75
|
};
|
|
@@ -77,7 +77,7 @@ const findEntryPointInner = (args, remotionRoot) => {
|
|
|
77
77
|
// 3rd priority: Common paths
|
|
78
78
|
const found = findCommonPath(remotionRoot);
|
|
79
79
|
if (found) {
|
|
80
|
-
const absolutePath =
|
|
80
|
+
const absolutePath = node_path_1.default.resolve(remotionRoot, found);
|
|
81
81
|
log_1.Log.verbose('Selected', absolutePath, 'as the entry point because file exists and is a common entry point and no entry point was explicitly selected');
|
|
82
82
|
return {
|
|
83
83
|
file: absolutePath,
|
package/dist/ffmpeg.js
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ffprobeCommand = exports.ffmpegCommand = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
6
7
|
const ffmpegCommand = (_root, args) => {
|
|
7
|
-
const
|
|
8
|
+
const binary = renderer_1.RenderInternals.getExecutablePath('ffmpeg');
|
|
9
|
+
(0, node_fs_1.chmodSync)(binary, 0o755);
|
|
10
|
+
const done = (0, node_child_process_1.spawnSync)(binary, args, {
|
|
8
11
|
...renderer_1.RenderInternals.dynamicLibraryPathOptions(),
|
|
9
12
|
stdio: 'inherit',
|
|
10
13
|
});
|
|
@@ -12,7 +15,9 @@ const ffmpegCommand = (_root, args) => {
|
|
|
12
15
|
};
|
|
13
16
|
exports.ffmpegCommand = ffmpegCommand;
|
|
14
17
|
const ffprobeCommand = (_root, args) => {
|
|
15
|
-
const
|
|
18
|
+
const binary = renderer_1.RenderInternals.getExecutablePath('ffprobe');
|
|
19
|
+
(0, node_fs_1.chmodSync)(binary, 0o755);
|
|
20
|
+
const done = (0, node_child_process_1.spawnSync)(binary, args, {
|
|
16
21
|
...renderer_1.RenderInternals.dynamicLibraryPathOptions(),
|
|
17
22
|
stdio: 'inherit',
|
|
18
23
|
});
|
package/dist/file-watcher.js
CHANGED
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.installFileWatcher = void 0;
|
|
7
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const installFileWatcher = ({ file, onChange, }) => {
|
|
9
|
-
const existedAtBeginning =
|
|
9
|
+
const existedAtBeginning = node_fs_1.default.existsSync(file);
|
|
10
10
|
let existedBefore = existedAtBeginning;
|
|
11
11
|
const listener = () => {
|
|
12
|
-
const existsNow =
|
|
12
|
+
const existsNow = node_fs_1.default.existsSync(file);
|
|
13
13
|
if (!existedBefore && existsNow) {
|
|
14
14
|
onChange('created');
|
|
15
15
|
existedBefore = true;
|
|
@@ -24,11 +24,11 @@ const installFileWatcher = ({ file, onChange, }) => {
|
|
|
24
24
|
onChange('changed');
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
node_fs_1.default.watchFile(file, { interval: 100 }, listener);
|
|
28
28
|
return {
|
|
29
29
|
exists: existedAtBeginning,
|
|
30
30
|
unwatch: () => {
|
|
31
|
-
|
|
31
|
+
node_fs_1.default.unwatchFile(file, listener);
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
};
|
package/dist/get-cli-options.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getCliOptions = exports.getAndValidateAbsoluteOutputFile = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const config_1 = require("./config");
|
|
11
11
|
const get_env_1 = require("./get-env");
|
|
12
12
|
const get_input_props_1 = require("./get-input-props");
|
|
@@ -22,8 +22,8 @@ const getAndValidateFrameRange = () => {
|
|
|
22
22
|
};
|
|
23
23
|
const getBrowser = () => { var _a; return (_a = config_1.ConfigInternals.getBrowser()) !== null && _a !== void 0 ? _a : renderer_1.RenderInternals.DEFAULT_BROWSER; };
|
|
24
24
|
const getAndValidateAbsoluteOutputFile = (relativeOutputLocation, overwrite) => {
|
|
25
|
-
const absoluteOutputFile =
|
|
26
|
-
if (
|
|
25
|
+
const absoluteOutputFile = node_path_1.default.resolve(process.cwd(), relativeOutputLocation);
|
|
26
|
+
if (node_fs_1.default.existsSync(absoluteOutputFile) && !overwrite) {
|
|
27
27
|
log_1.Log.error(`File at ${absoluteOutputFile} already exists. Use --overwrite to overwrite.`);
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.loadConfig = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const load_config_1 = require("./load-config");
|
|
10
10
|
const log_1 = require("./log");
|
|
11
11
|
const parse_command_line_1 = require("./parse-command-line");
|
|
@@ -13,8 +13,8 @@ const defaultConfigFileJavascript = 'remotion.config.js';
|
|
|
13
13
|
const defaultConfigFileTypescript = 'remotion.config.ts';
|
|
14
14
|
const loadConfig = (remotionRoot) => {
|
|
15
15
|
if (parse_command_line_1.parsedCli.config) {
|
|
16
|
-
const fullPath =
|
|
17
|
-
if (!(0,
|
|
16
|
+
const fullPath = node_path_1.default.resolve(process.cwd(), parse_command_line_1.parsedCli.config);
|
|
17
|
+
if (!(0, node_fs_1.existsSync)(fullPath)) {
|
|
18
18
|
log_1.Log.error(`You specified a config file location of "${parse_command_line_1.parsedCli.config}" but no file under ${fullPath} was found.`);
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
@@ -23,10 +23,10 @@ const loadConfig = (remotionRoot) => {
|
|
|
23
23
|
if (remotionRoot === null) {
|
|
24
24
|
return Promise.resolve(null);
|
|
25
25
|
}
|
|
26
|
-
if ((0,
|
|
26
|
+
if ((0, node_fs_1.existsSync)(node_path_1.default.resolve(remotionRoot, defaultConfigFileTypescript))) {
|
|
27
27
|
return (0, load_config_1.loadConfigFile)(remotionRoot, defaultConfigFileTypescript, false);
|
|
28
28
|
}
|
|
29
|
-
if ((0,
|
|
29
|
+
if ((0, node_fs_1.existsSync)(node_path_1.default.resolve(remotionRoot, defaultConfigFileJavascript))) {
|
|
30
30
|
return (0, load_config_1.loadConfigFile)(remotionRoot, defaultConfigFileJavascript, true);
|
|
31
31
|
}
|
|
32
32
|
return Promise.resolve(null);
|
package/dist/get-env.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getEnvironmentVariables = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
8
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
11
|
const chalk_1 = require("./chalk");
|
|
12
12
|
const config_1 = require("./config");
|
|
13
13
|
const file_watcher_1 = require("./file-watcher");
|
|
@@ -23,7 +23,7 @@ function getProcessEnv() {
|
|
|
23
23
|
}
|
|
24
24
|
const watchEnvFile = ({ processEnv, envFile, onUpdate, }) => {
|
|
25
25
|
const updateFile = async () => {
|
|
26
|
-
const file = await
|
|
26
|
+
const file = await node_fs_1.default.promises.readFile(envFile, 'utf-8');
|
|
27
27
|
onUpdate({
|
|
28
28
|
...processEnv,
|
|
29
29
|
...dotenv_1.default.parse(file),
|
|
@@ -54,7 +54,7 @@ const watchEnvFile = ({ processEnv, envFile, onUpdate, }) => {
|
|
|
54
54
|
};
|
|
55
55
|
const getEnvForEnvFile = async (processEnv, envFile, onUpdate) => {
|
|
56
56
|
try {
|
|
57
|
-
const envFileData = await
|
|
57
|
+
const envFileData = await node_fs_1.default.promises.readFile(envFile);
|
|
58
58
|
if (onUpdate) {
|
|
59
59
|
watchEnvFile({ processEnv, envFile, onUpdate });
|
|
60
60
|
}
|
|
@@ -72,8 +72,8 @@ const getEnvForEnvFile = async (processEnv, envFile, onUpdate) => {
|
|
|
72
72
|
const getEnvironmentVariables = (onUpdate) => {
|
|
73
73
|
const processEnv = getProcessEnv();
|
|
74
74
|
if (parse_command_line_1.parsedCli['env-file']) {
|
|
75
|
-
const envFile =
|
|
76
|
-
if (!
|
|
75
|
+
const envFile = node_path_1.default.resolve(process.cwd(), parse_command_line_1.parsedCli['env-file']);
|
|
76
|
+
if (!node_fs_1.default.existsSync(envFile)) {
|
|
77
77
|
log_1.Log.error('You passed a --env-file but it could not be found.');
|
|
78
78
|
log_1.Log.error('We looked for the file at:', envFile);
|
|
79
79
|
log_1.Log.error('Check that your path is correct and try again.');
|
|
@@ -84,8 +84,8 @@ const getEnvironmentVariables = (onUpdate) => {
|
|
|
84
84
|
const remotionRoot = renderer_1.RenderInternals.findRemotionRoot();
|
|
85
85
|
const configFileSetting = config_1.ConfigInternals.getDotEnvLocation();
|
|
86
86
|
if (configFileSetting) {
|
|
87
|
-
const envFile =
|
|
88
|
-
if (!
|
|
87
|
+
const envFile = node_path_1.default.resolve(remotionRoot, configFileSetting);
|
|
88
|
+
if (!node_fs_1.default.existsSync(envFile)) {
|
|
89
89
|
log_1.Log.error('You specified a custom .env file using `Config.setDotEnvLocation()` in the config file but it could not be found');
|
|
90
90
|
log_1.Log.error('We looked for the file at:', envFile);
|
|
91
91
|
log_1.Log.error('Check that your path is correct and try again.');
|
|
@@ -93,8 +93,8 @@ const getEnvironmentVariables = (onUpdate) => {
|
|
|
93
93
|
}
|
|
94
94
|
return getEnvForEnvFile(processEnv, envFile, onUpdate);
|
|
95
95
|
}
|
|
96
|
-
const defaultEnvFile =
|
|
97
|
-
if (!
|
|
96
|
+
const defaultEnvFile = node_path_1.default.resolve(remotionRoot, '.env');
|
|
97
|
+
if (!node_fs_1.default.existsSync(defaultEnvFile)) {
|
|
98
98
|
if (onUpdate) {
|
|
99
99
|
watchEnvFile({
|
|
100
100
|
processEnv,
|