@remotion/cli 3.2.1 → 3.2.2
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/bundle.d.ts +1 -0
- package/dist/bundle.js +32 -0
- package/dist/config/bundle-out-dir.d.ts +2 -0
- package/dist/config/bundle-out-dir.js +12 -0
- package/dist/config/get-public-path.d.ts +2 -0
- package/dist/config/get-public-path.js +12 -0
- package/dist/editor/components/Notifications/ServerDisconnected.d.ts +5 -0
- package/dist/editor/components/Notifications/ServerDisconnected.js +56 -0
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/dist/event-source.js +6 -0
- package/dist/prepare-entry-point.d.ts +12 -0
- package/dist/prepare-entry-point.js +37 -0
- package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.js +9 -1
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +2 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorMessage.js +4 -2
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.js +3 -1
- package/dist/preview-server/get-package-manager.d.ts +1 -0
- package/dist/preview-server/get-package-manager.js +8 -1
- package/dist/preview-server/routes.js +3 -0
- package/dist/previewEntry.js +6 -0
- package/package.json +7 -7
- package/dist/config/drop-silent-audio-if-silent.d.ts +0 -2
- package/dist/config/drop-silent-audio-if-silent.js +0 -13
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bundleCommand: (remotionRoot: string) => Promise<void>;
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundleCommand = void 0;
|
|
4
|
+
const get_cli_options_1 = require("./get-cli-options");
|
|
5
|
+
const initialize_render_cli_1 = require("./initialize-render-cli");
|
|
6
|
+
const log_1 = require("./log");
|
|
7
|
+
const parse_command_line_1 = require("./parse-command-line");
|
|
8
|
+
const prepare_entry_point_1 = require("./prepare-entry-point");
|
|
9
|
+
const bundleCommand = async (remotionRoot) => {
|
|
10
|
+
const file = parse_command_line_1.parsedCli._[1];
|
|
11
|
+
if (!file) {
|
|
12
|
+
log_1.Log.error('No entry point specified. Pass more arguments:');
|
|
13
|
+
log_1.Log.error(' npx remotion bundle [entry-point]');
|
|
14
|
+
log_1.Log.error('Documentation: https://www.remotion.dev/docs/render');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'bundle');
|
|
18
|
+
const { publicPath, bundleOutDir } = await (0, get_cli_options_1.getCliOptions)({
|
|
19
|
+
isLambda: false,
|
|
20
|
+
type: 'get-compositions-or-bundle',
|
|
21
|
+
});
|
|
22
|
+
const { urlOrBundle } = await (0, prepare_entry_point_1.prepareEntryPoint)({
|
|
23
|
+
file,
|
|
24
|
+
otherSteps: [],
|
|
25
|
+
outDir: bundleOutDir,
|
|
26
|
+
publicPath,
|
|
27
|
+
remotionRoot,
|
|
28
|
+
});
|
|
29
|
+
log_1.Log.info();
|
|
30
|
+
log_1.Log.info(urlOrBundle);
|
|
31
|
+
};
|
|
32
|
+
exports.bundleCommand = bundleCommand;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setBundleOutDir = exports.getBundleOutDir = void 0;
|
|
4
|
+
let bundleOutDir = null;
|
|
5
|
+
const getBundleOutDir = () => {
|
|
6
|
+
return bundleOutDir;
|
|
7
|
+
};
|
|
8
|
+
exports.getBundleOutDir = getBundleOutDir;
|
|
9
|
+
const setBundleOutDir = (path) => {
|
|
10
|
+
bundleOutDir = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setBundleOutDir = setBundleOutDir;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPublicPath = exports.getPublicPath = void 0;
|
|
4
|
+
let publicPath = null;
|
|
5
|
+
const getPublicPath = () => {
|
|
6
|
+
return publicPath;
|
|
7
|
+
};
|
|
8
|
+
exports.getPublicPath = getPublicPath;
|
|
9
|
+
const setPublicPath = (path) => {
|
|
10
|
+
publicPath = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setPublicPath = setPublicPath;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerDisconnected = exports.serverDisconnectedRef = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const container = {
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
justifyContent: 'flex-end',
|
|
9
|
+
alignItems: 'flex-start',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
width: '100%',
|
|
12
|
+
height: '100%',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
padding: 30,
|
|
15
|
+
pointerEvents: 'none',
|
|
16
|
+
backgroundColor: 'transparent',
|
|
17
|
+
fontFamily: 'SF Pro, Arial, Helvetica, sans-serif',
|
|
18
|
+
};
|
|
19
|
+
const message = {
|
|
20
|
+
backgroundColor: '#e74c3c',
|
|
21
|
+
color: 'white',
|
|
22
|
+
paddingLeft: 20,
|
|
23
|
+
paddingRight: 20,
|
|
24
|
+
paddingTop: 12,
|
|
25
|
+
paddingBottom: 12,
|
|
26
|
+
borderRadius: 4,
|
|
27
|
+
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.4)',
|
|
28
|
+
lineHeight: 1.5,
|
|
29
|
+
};
|
|
30
|
+
const inlineCode = {
|
|
31
|
+
fontSize: 16,
|
|
32
|
+
fontFamily: 'monospace',
|
|
33
|
+
};
|
|
34
|
+
exports.serverDisconnectedRef = (0, react_1.createRef)();
|
|
35
|
+
let pageIsGoingToReload = false;
|
|
36
|
+
window.addEventListener('beforeunload', () => {
|
|
37
|
+
pageIsGoingToReload = true;
|
|
38
|
+
});
|
|
39
|
+
const ServerDisconnected = () => {
|
|
40
|
+
const [serverDisconnected, setServerDisconnected] = (0, react_1.useState)(false);
|
|
41
|
+
(0, react_1.useImperativeHandle)(exports.serverDisconnectedRef, () => {
|
|
42
|
+
return {
|
|
43
|
+
setServerDisconnected: () => {
|
|
44
|
+
setServerDisconnected(true);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
if (!serverDisconnected) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
if (pageIsGoingToReload) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsxs)("div", { style: message, children: ["The preview server has disconnected. ", (0, jsx_runtime_1.jsx)("br", {}), window.remotion_previewServerCommand ? ((0, jsx_runtime_1.jsxs)("span", { children: ["Run", ' ', (0, jsx_runtime_1.jsx)("code", { style: inlineCode, children: window.remotion_previewServerCommand }), ' ', "to run it again."] })) : ((0, jsx_runtime_1.jsx)("span", { children: "Fast refresh will not work." }))] }) }));
|
|
55
|
+
};
|
|
56
|
+
exports.ServerDisconnected = ServerDisconnected;
|
|
@@ -12,4 +12,4 @@ export declare const TIMELINE_BACKGROUND = "#111";
|
|
|
12
12
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
13
13
|
selected: boolean;
|
|
14
14
|
hovered: boolean;
|
|
15
|
-
}) => "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)"
|
|
15
|
+
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
|
package/dist/event-source.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.openEventSource = void 0;
|
|
4
|
+
const ServerDisconnected_1 = require("./editor/components/Notifications/ServerDisconnected");
|
|
4
5
|
let source = null;
|
|
5
6
|
const openEventSource = () => {
|
|
6
7
|
source = new EventSource('/events');
|
|
@@ -10,5 +11,10 @@ const openEventSource = () => {
|
|
|
10
11
|
window.location.reload();
|
|
11
12
|
}
|
|
12
13
|
});
|
|
14
|
+
source.addEventListener('error', () => {
|
|
15
|
+
var _a;
|
|
16
|
+
// Display an error message that the preview server has disconnected.
|
|
17
|
+
(_a = ServerDisconnected_1.serverDisconnectedRef.current) === null || _a === void 0 ? void 0 : _a.setServerDisconnected();
|
|
18
|
+
});
|
|
13
19
|
};
|
|
14
20
|
exports.openEventSource = openEventSource;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RenderStep } from './step';
|
|
2
|
+
export declare const prepareEntryPoint: ({ file, otherSteps, publicPath, outDir, remotionRoot, }: {
|
|
3
|
+
file: string;
|
|
4
|
+
otherSteps: RenderStep[];
|
|
5
|
+
outDir: string | null;
|
|
6
|
+
publicPath: string | null;
|
|
7
|
+
remotionRoot: string;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
urlOrBundle: string;
|
|
10
|
+
steps: RenderStep[];
|
|
11
|
+
shouldDelete: boolean;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.prepareEntryPoint = void 0;
|
|
7
|
+
const renderer_1 = require("@remotion/renderer");
|
|
8
|
+
const promises_1 = require("fs/promises");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const process_1 = require("process");
|
|
11
|
+
const log_1 = require("./log");
|
|
12
|
+
const setup_cache_1 = require("./setup-cache");
|
|
13
|
+
const prepareEntryPoint = async ({ file, otherSteps, publicPath, outDir, remotionRoot, }) => {
|
|
14
|
+
if (renderer_1.RenderInternals.isServeUrl(file)) {
|
|
15
|
+
return { urlOrBundle: file, steps: otherSteps, shouldDelete: false };
|
|
16
|
+
}
|
|
17
|
+
const joined = path_1.default.resolve(process.cwd(), file);
|
|
18
|
+
try {
|
|
19
|
+
const stats = await (0, promises_1.stat)(joined);
|
|
20
|
+
if (stats.isDirectory()) {
|
|
21
|
+
return { urlOrBundle: joined, steps: otherSteps, shouldDelete: false };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
log_1.Log.error(`No file or directory exists at ${joined}.`);
|
|
26
|
+
(0, process_1.exit)(1);
|
|
27
|
+
}
|
|
28
|
+
const urlOrBundle = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
|
|
29
|
+
fullPath: joined,
|
|
30
|
+
steps: ['bundling', ...otherSteps],
|
|
31
|
+
outDir,
|
|
32
|
+
publicPath,
|
|
33
|
+
remotionRoot,
|
|
34
|
+
});
|
|
35
|
+
return { urlOrBundle, steps: ['bundling', ...otherSteps], shouldDelete: true };
|
|
36
|
+
};
|
|
37
|
+
exports.prepareEntryPoint = prepareEntryPoint;
|
|
@@ -31,7 +31,15 @@ const crashWithFrames = (crash) => (error) => {
|
|
|
31
31
|
var _a;
|
|
32
32
|
const didHookOrderChange = error.message.startsWith('Rendered fewer hooks') ||
|
|
33
33
|
error.message.startsWith('Rendered more hooks');
|
|
34
|
-
|
|
34
|
+
const key = 'remotion.lastCrashBecauseOfHooks';
|
|
35
|
+
const previousCrashWasBecauseOfHooks = window.localStorage.getItem(key);
|
|
36
|
+
// When rendering conditional hooks, refreshing does not help.
|
|
37
|
+
// So we only refresh once.
|
|
38
|
+
const justRefreshedBecauseOfHooks = previousCrashWasBecauseOfHooks
|
|
39
|
+
? Date.now() - Number(previousCrashWasBecauseOfHooks) < 5000
|
|
40
|
+
: false;
|
|
41
|
+
window.localStorage.setItem('remotion.lastCrashBecauseOfHooks', String(Date.now()));
|
|
42
|
+
if (didHookOrderChange && !justRefreshedBecauseOfHooks) {
|
|
35
43
|
// eslint-disable-next-line no-console
|
|
36
44
|
console.log('Hook order changed. Reloading app...');
|
|
37
45
|
window.location.reload();
|
|
@@ -26,6 +26,6 @@ const Button = ({ children, onClick, disabled, style }) => {
|
|
|
26
26
|
...(style !== null && style !== void 0 ? style : {}),
|
|
27
27
|
};
|
|
28
28
|
}, [style]);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("button", { style: combined, type: "button", disabled: disabled, onClick: onClick, children: (0, jsx_runtime_1.jsx)("div", { style: buttonContainer, children: children }) }));
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("button", { style: combined, type: "button", disabled: disabled, onClick: onClick, children: (0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: buttonContainer, children: children }) }));
|
|
30
30
|
};
|
|
31
31
|
exports.Button = Button;
|
|
@@ -13,6 +13,8 @@ const lineNumber = {
|
|
|
13
13
|
paddingLeft: 10,
|
|
14
14
|
paddingRight: 12,
|
|
15
15
|
marginRight: 12,
|
|
16
|
+
color: 'inherit',
|
|
17
|
+
fontSize: 14,
|
|
16
18
|
};
|
|
17
19
|
const CodeFrame = ({ source, lineNumberWidth }) => {
|
|
18
20
|
return ((0, jsx_runtime_1.jsx)("div", { style: frame, children: source.map((s, j) => {
|
|
@@ -16,9 +16,11 @@ const container = {
|
|
|
16
16
|
marginBottom: 15,
|
|
17
17
|
};
|
|
18
18
|
const messageContainer = {
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
};
|
|
21
|
+
const textContainer = {
|
|
19
22
|
fontSize,
|
|
20
23
|
lineHeight,
|
|
21
|
-
overflow: 'hidden',
|
|
22
24
|
};
|
|
23
25
|
const moreLine = {
|
|
24
26
|
width: '100%',
|
|
@@ -62,6 +64,6 @@ const ErrorMessage = ({ message }) => {
|
|
|
62
64
|
const toggle = (0, react_1.useCallback)(() => {
|
|
63
65
|
setExpanded((e) => !e);
|
|
64
66
|
}, []);
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, children: message }) }), errorLines !== null && errorLines > maxLines ? ((0, jsx_runtime_1.jsx)("div", { style: moreLine, children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: toggle, style: moreButton, children: (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: expanded }) }) })) : null] }));
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, style: textContainer, children: message }) }), errorLines !== null && errorLines > maxLines ? ((0, jsx_runtime_1.jsx)("div", { style: moreLine, children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: toggle, style: moreButton, children: (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: expanded }) }) })) : null] }));
|
|
66
68
|
};
|
|
67
69
|
exports.ErrorMessage = ErrorMessage;
|
|
@@ -32,6 +32,6 @@ const spacer = {
|
|
|
32
32
|
width: 5,
|
|
33
33
|
};
|
|
34
34
|
const ErrorTitle = ({ name, message, symbolicating }) => {
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: title, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("span", { style: errName, children: name }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: row, children: [symbolicating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Symbolicating_1.Symbolicating, {}), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { message: message })] })] }), (0, react_overlay_1.didUnmountReactApp)() ? null : (0, jsx_runtime_1.jsx)(DismissButton_1.DismissButton, {})] }));
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: title, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("span", { style: errName, children: name }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: row, children: [symbolicating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Symbolicating_1.Symbolicating, {}), (0, jsx_runtime_1.jsx)("div", { style: spacer })] })) : null, (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { message: message })] })] }), (0, react_overlay_1.didUnmountReactApp)() ? null : (0, jsx_runtime_1.jsx)(DismissButton_1.DismissButton, {})] }));
|
|
36
36
|
};
|
|
37
37
|
exports.ErrorTitle = ErrorTitle;
|
|
@@ -10,6 +10,7 @@ const format_location_1 = require("./format-location");
|
|
|
10
10
|
const location = {
|
|
11
11
|
color: 'rgba(255, 255, 255, 0.6)',
|
|
12
12
|
fontFamily: 'monospace',
|
|
13
|
+
fontSize: 14,
|
|
13
14
|
};
|
|
14
15
|
const header = {
|
|
15
16
|
paddingLeft: 14,
|
|
@@ -28,6 +29,7 @@ const left = {
|
|
|
28
29
|
};
|
|
29
30
|
const fnName = {
|
|
30
31
|
fontSize: 14,
|
|
32
|
+
lineHeight: 1.5,
|
|
31
33
|
marginBottom: 3,
|
|
32
34
|
};
|
|
33
35
|
const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
|
|
@@ -41,7 +43,7 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
|
|
|
41
43
|
const toggleCodeFrame = (0, react_1.useCallback)(() => {
|
|
42
44
|
setShowCodeFrame((f) => !f);
|
|
43
45
|
}, []);
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: false }) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: false }) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
|
|
45
47
|
s.originalScriptCode.length > 0 &&
|
|
46
48
|
showCodeFrame ? ((0, jsx_runtime_1.jsx)(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })] }));
|
|
47
49
|
};
|
|
@@ -3,6 +3,7 @@ declare type LockfilePath = {
|
|
|
3
3
|
manager: PackageManager;
|
|
4
4
|
path: string;
|
|
5
5
|
installCommand: string;
|
|
6
|
+
startCommand: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const lockFilePaths: LockfilePath[];
|
|
8
9
|
export declare const getPackageManager: (remotionRoot: string) => LockfilePath | 'unknown';
|
|
@@ -7,16 +7,23 @@ exports.getPackageManager = exports.lockFilePaths = void 0;
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
exports.lockFilePaths = [
|
|
10
|
-
{
|
|
10
|
+
{
|
|
11
|
+
path: 'package-lock.json',
|
|
12
|
+
manager: 'npm',
|
|
13
|
+
installCommand: 'npm i',
|
|
14
|
+
startCommand: 'npm start',
|
|
15
|
+
},
|
|
11
16
|
{
|
|
12
17
|
path: 'yarn.lock',
|
|
13
18
|
manager: 'yarn',
|
|
14
19
|
installCommand: 'yarn add',
|
|
20
|
+
startCommand: 'yarn start',
|
|
15
21
|
},
|
|
16
22
|
{
|
|
17
23
|
path: 'pnpm-lock.yaml',
|
|
18
24
|
manager: 'pnpm',
|
|
19
25
|
installCommand: 'pnpm i',
|
|
26
|
+
startCommand: 'pnpm start',
|
|
20
27
|
},
|
|
21
28
|
];
|
|
22
29
|
const getPackageManager = (remotionRoot) => {
|
|
@@ -10,6 +10,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
10
10
|
const url_1 = require("url");
|
|
11
11
|
const get_file_source_1 = require("./error-overlay/react-overlay/utils/get-file-source");
|
|
12
12
|
const open_in_editor_1 = require("./error-overlay/react-overlay/utils/open-in-editor");
|
|
13
|
+
const get_package_manager_1 = require("./get-package-manager");
|
|
13
14
|
const project_info_1 = require("./project-info");
|
|
14
15
|
const serve_static_1 = require("./serve-static");
|
|
15
16
|
const update_available_1 = require("./update-available");
|
|
@@ -29,12 +30,14 @@ const handleFallback = async ({ remotionRoot, hash, response, getCurrentInputPro
|
|
|
29
30
|
const displayName = (0, open_in_editor_1.getDisplayNameForEditor)(edit ? edit.command : null);
|
|
30
31
|
response.setHeader('content-type', 'text/html');
|
|
31
32
|
response.writeHead(200);
|
|
33
|
+
const packageManager = (0, get_package_manager_1.getPackageManager)(remotionRoot);
|
|
32
34
|
response.end(bundler_1.BundlerInternals.indexHtml({
|
|
33
35
|
staticHash: hash,
|
|
34
36
|
baseDir: '/',
|
|
35
37
|
editorName: displayName,
|
|
36
38
|
inputProps: getCurrentInputProps(),
|
|
37
39
|
remotionRoot,
|
|
40
|
+
previewServerCommand: packageManager === 'unknown' ? null : packageManager.startCommand,
|
|
38
41
|
}));
|
|
39
42
|
};
|
|
40
43
|
const handleProjectInfo = async (remotionRoot, _, response) => {
|
package/dist/previewEntry.js
CHANGED
|
@@ -9,13 +9,19 @@ const client_1 = __importDefault(require("react-dom/client"));
|
|
|
9
9
|
const remotion_1 = require("remotion");
|
|
10
10
|
require("../styles/styles.css");
|
|
11
11
|
const Editor_1 = require("./editor/components/Editor");
|
|
12
|
+
const ServerDisconnected_1 = require("./editor/components/Notifications/ServerDisconnected");
|
|
12
13
|
const event_source_1 = require("./event-source");
|
|
13
14
|
remotion_1.Internals.CSSUtils.injectCSS(remotion_1.Internals.CSSUtils.makeDefaultCSS(null, '#1f2428'));
|
|
15
|
+
const getServerDisconnectedDomElement = () => {
|
|
16
|
+
return document.getElementById('server-disconnected-overlay');
|
|
17
|
+
};
|
|
14
18
|
const content = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { children: (0, jsx_runtime_1.jsx)(Editor_1.Editor, {}) }));
|
|
15
19
|
if (client_1.default.createRoot) {
|
|
16
20
|
client_1.default.createRoot(remotion_1.Internals.getPreviewDomElement()).render(content);
|
|
21
|
+
client_1.default.createRoot(getServerDisconnectedDomElement()).render((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}));
|
|
17
22
|
}
|
|
18
23
|
else {
|
|
19
24
|
client_1.default.render((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { children: (0, jsx_runtime_1.jsx)(Editor_1.Editor, {}) }), remotion_1.Internals.getPreviewDomElement());
|
|
25
|
+
client_1.default.render((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement());
|
|
20
26
|
}
|
|
21
27
|
(0, event_source_1.openEventSource)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/bundler": "3.2.
|
|
27
|
-
"@remotion/media-utils": "3.2.
|
|
28
|
-
"@remotion/player": "3.2.
|
|
29
|
-
"@remotion/renderer": "3.2.
|
|
26
|
+
"@remotion/bundler": "3.2.2",
|
|
27
|
+
"@remotion/media-utils": "3.2.2",
|
|
28
|
+
"@remotion/player": "3.2.2",
|
|
29
|
+
"@remotion/renderer": "3.2.2",
|
|
30
30
|
"better-opn": "2.1.1",
|
|
31
31
|
"dotenv": "9.0.2",
|
|
32
32
|
"memfs": "3.4.3",
|
|
33
33
|
"minimist": "1.2.6",
|
|
34
|
-
"remotion": "3.2.
|
|
34
|
+
"remotion": "3.2.2",
|
|
35
35
|
"semver": "7.3.5",
|
|
36
36
|
"source-map": "0.6.1"
|
|
37
37
|
},
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "8e5f2d05adf7ddd3824ea734fa888b4b4761f364"
|
|
75
75
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDropAudioIfSilent = exports.setDropAudioIfSilent = void 0;
|
|
4
|
-
const DEFAULT_DROP_AUDIO_IF_SILENT_STATE = true;
|
|
5
|
-
let mutedState = DEFAULT_DROP_AUDIO_IF_SILENT_STATE;
|
|
6
|
-
const setDropAudioIfSilent = (muted) => {
|
|
7
|
-
mutedState = muted;
|
|
8
|
-
};
|
|
9
|
-
exports.setDropAudioIfSilent = setDropAudioIfSilent;
|
|
10
|
-
const getDropAudioIfSilent = () => {
|
|
11
|
-
return mutedState;
|
|
12
|
-
};
|
|
13
|
-
exports.getDropAudioIfSilent = getDropAudioIfSilent;
|