@remotion/bundler 3.1.11 → 3.2.0
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/package.json +3 -3
- package/dist/bundler.d.ts +0 -7
- package/dist/bundler.js +0 -76
- package/dist/dev-middleware/compatible-api.d.ts +0 -10
- package/dist/dev-middleware/compatible-api.js +0 -44
- package/dist/dev-middleware/get-filename-from-url.d.ts +0 -2
- package/dist/dev-middleware/get-filename-from-url.js +0 -92
- package/dist/dev-middleware/get-paths.d.ts +0 -7
- package/dist/dev-middleware/get-paths.js +0 -19
- package/dist/dev-middleware/index.d.ts +0 -3
- package/dist/dev-middleware/index.js +0 -57
- package/dist/dev-middleware/is-color-supported.d.ts +0 -1
- package/dist/dev-middleware/is-color-supported.js +0 -37
- package/dist/dev-middleware/middleware.d.ts +0 -4
- package/dist/dev-middleware/middleware.js +0 -141
- package/dist/dev-middleware/range-parser.d.ts +0 -15
- package/dist/dev-middleware/range-parser.js +0 -96
- package/dist/dev-middleware/ready.d.ts +0 -5
- package/dist/dev-middleware/ready.js +0 -13
- package/dist/dev-middleware/setup-hooks.d.ts +0 -2
- package/dist/dev-middleware/setup-hooks.js +0 -44
- package/dist/dev-middleware/setup-output-filesystem.d.ts +0 -2
- package/dist/dev-middleware/setup-output-filesystem.js +0 -13
- package/dist/dev-middleware/types.d.ts +0 -11
- package/dist/dev-middleware/types.js +0 -2
- package/dist/error-overlay/entry-basic.d.ts +0 -1
- package/dist/error-overlay/entry-basic.js +0 -21
- package/dist/error-overlay/react-overlay/effects/format-warning.d.ts +0 -11
- package/dist/error-overlay/react-overlay/effects/format-warning.js +0 -41
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts +0 -7
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js +0 -46
- package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts +0 -24
- package/dist/error-overlay/react-overlay/effects/proxy-console.js +0 -63
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts +0 -3
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +0 -31
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts +0 -3
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js +0 -43
- package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts +0 -4
- package/dist/error-overlay/react-overlay/effects/unhandled-error.js +0 -45
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +0 -4
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js +0 -41
- package/dist/error-overlay/react-overlay/index.d.ts +0 -2
- package/dist/error-overlay/react-overlay/index.js +0 -21
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +0 -8
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +0 -78
- package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts +0 -1
- package/dist/error-overlay/react-overlay/utils/get-file-source.js +0 -21
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts +0 -14
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js +0 -24
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +0 -13
- package/dist/error-overlay/react-overlay/utils/get-source-map.js +0 -58
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +0 -2
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +0 -27
- package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts +0 -12
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js +0 -459
- package/dist/error-overlay/react-overlay/utils/parser.d.ts +0 -2
- package/dist/error-overlay/react-overlay/utils/parser.js +0 -117
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +0 -40
- package/dist/error-overlay/react-overlay/utils/stack-frame.js +0 -31
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +0 -2
- package/dist/error-overlay/react-overlay/utils/unmapper.js +0 -64
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts +0 -2
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +0 -14
- package/dist/error-overlay/remotion-overlay/Button.d.ts +0 -6
- package/dist/error-overlay/remotion-overlay/Button.js +0 -24
- package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts +0 -6
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +0 -28
- package/dist/error-overlay/remotion-overlay/DismissButton.d.ts +0 -2
- package/dist/error-overlay/remotion-overlay/DismissButton.js +0 -23
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +0 -5
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +0 -45
- package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts +0 -4
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +0 -61
- package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts +0 -6
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +0 -41
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +0 -5
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +0 -90
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts +0 -14
- package/dist/error-overlay/remotion-overlay/Overlay.js +0 -49
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts +0 -4
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +0 -13
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +0 -8
- package/dist/error-overlay/remotion-overlay/StackFrame.js +0 -48
- package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts +0 -2
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +0 -8
- package/dist/error-overlay/remotion-overlay/carets.d.ts +0 -3
- package/dist/error-overlay/remotion-overlay/carets.js +0 -12
- package/dist/error-overlay/remotion-overlay/format-location.d.ts +0 -1
- package/dist/error-overlay/remotion-overlay/format-location.js +0 -10
- package/dist/error-overlay/remotion-overlay/index.d.ts +0 -1
- package/dist/error-overlay/remotion-overlay/index.js +0 -18
- package/dist/get-latest-remotion-version.d.ts +0 -1
- package/dist/get-latest-remotion-version.js +0 -31
- package/dist/get-package-manager.d.ts +0 -8
- package/dist/get-package-manager.js +0 -38
- package/dist/get-port.d.ts +0 -1
- package/dist/get-port.js +0 -80
- package/dist/hot-middleware/client.d.ts +0 -19
- package/dist/hot-middleware/client.js +0 -206
- package/dist/hot-middleware/index.d.ts +0 -13
- package/dist/hot-middleware/index.js +0 -180
- package/dist/hot-middleware/process-update.d.ts +0 -12
- package/dist/hot-middleware/process-update.js +0 -147
- package/dist/hot-middleware/strip-ansi.d.ts +0 -1
- package/dist/hot-middleware/strip-ansi.js +0 -21
- package/dist/hot-middleware/types.d.ts +0 -37
- package/dist/hot-middleware/types.js +0 -17
- package/dist/is-path-inside.d.ts +0 -1
- package/dist/is-path-inside.js +0 -27
- package/dist/p-limit.d.ts +0 -1
- package/dist/p-limit.js +0 -57
- package/dist/project-info.d.ts +0 -5
- package/dist/project-info.js +0 -22
- package/dist/routes.d.ts +0 -2
- package/dist/routes.js +0 -121
- package/dist/serve-static.d.ts +0 -9
- package/dist/serve-static.js +0 -81
- package/dist/start-server-pure.d.ts +0 -8
- package/dist/start-server-pure.js +0 -68
- package/dist/start-server.d.ts +0 -8
- package/dist/start-server.js +0 -132
- package/dist/static-preview.d.ts +0 -1
- package/dist/static-preview.js +0 -40
- package/dist/test/expect-to-throw.d.ts +0 -1
- package/dist/test/expect-to-throw.js +0 -14
- package/dist/test/latest-remotion-version.test.d.ts +0 -1
- package/dist/test/latest-remotion-version.test.js +0 -6
- package/dist/test/parse-error-stack.test.d.ts +0 -1
- package/dist/test/parse-error-stack.test.js +0 -17
- package/dist/test/parse-module-not-found.test.d.ts +0 -1
- package/dist/test/parse-module-not-found.test.js +0 -17
- package/dist/test/secure-source-read.test.d.ts +0 -1
- package/dist/test/secure-source-read.test.js +0 -8
- package/dist/ts-alias-plugin.d.ts +0 -4
- package/dist/ts-alias-plugin.js +0 -21
- package/dist/update-available.d.ts +0 -10
- package/dist/update-available.js +0 -36
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Overlay = exports.setErrorsRef = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const ErrorLoader_1 = require("./ErrorLoader");
|
|
8
|
-
exports.setErrorsRef = (0, react_1.createRef)();
|
|
9
|
-
const errorsAreTheSame = (first, second) => {
|
|
10
|
-
return first.stack === second.stack && first.message === second.message;
|
|
11
|
-
};
|
|
12
|
-
const BACKGROUND_COLOR = '#1f2428';
|
|
13
|
-
const Overlay = () => {
|
|
14
|
-
const [errors, setErrors] = (0, react_1.useState)({ type: 'clear' });
|
|
15
|
-
const addError = (0, react_1.useCallback)((err) => {
|
|
16
|
-
setErrors((state) => {
|
|
17
|
-
if (state.type === 'errors') {
|
|
18
|
-
if (state.errors.some((e) => errorsAreTheSame(e, err))) {
|
|
19
|
-
return state;
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
...state,
|
|
23
|
-
errors: [...state.errors, err],
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
type: 'errors',
|
|
28
|
-
errors: [err],
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}, []);
|
|
32
|
-
(0, react_1.useImperativeHandle)(exports.setErrorsRef, () => {
|
|
33
|
-
return { setErrors, addError };
|
|
34
|
-
}, [addError]);
|
|
35
|
-
if (errors.type === 'clear') {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
if (errors.errors.length === 0) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
42
|
-
backgroundColor: BACKGROUND_COLOR,
|
|
43
|
-
overflow: 'auto',
|
|
44
|
-
color: 'white',
|
|
45
|
-
}, children: errors.errors.map((err) => {
|
|
46
|
-
return (0, jsx_runtime_1.jsx)(ErrorLoader_1.ErrorLoader, { error: err }, err.stack);
|
|
47
|
-
}) }));
|
|
48
|
-
};
|
|
49
|
-
exports.Overlay = Overlay;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchGithubIssues = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const Button_1 = require("./Button");
|
|
7
|
-
const SearchGithubIssues = ({ message }) => {
|
|
8
|
-
const openInBrowser = (0, react_1.useCallback)(() => {
|
|
9
|
-
window.open(`https://github.com/remotion-dev/remotion/issues?q=${encodeURIComponent(message)}`, '_blank');
|
|
10
|
-
}, [message]);
|
|
11
|
-
return (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, children: "Search GitHub Issues" });
|
|
12
|
-
};
|
|
13
|
-
exports.SearchGithubIssues = SearchGithubIssues;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SymbolicatedStackFrame } from '../react-overlay/utils/stack-frame';
|
|
3
|
-
export declare const StackElement: React.FC<{
|
|
4
|
-
s: SymbolicatedStackFrame;
|
|
5
|
-
lineNumberWidth: number;
|
|
6
|
-
isFirst: boolean;
|
|
7
|
-
defaultFunctionName: string;
|
|
8
|
-
}>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StackElement = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const Button_1 = require("./Button");
|
|
7
|
-
const carets_1 = require("./carets");
|
|
8
|
-
const CodeFrame_1 = require("./CodeFrame");
|
|
9
|
-
const format_location_1 = require("./format-location");
|
|
10
|
-
const location = {
|
|
11
|
-
color: 'rgba(255, 255, 255, 0.6)',
|
|
12
|
-
fontFamily: 'monospace',
|
|
13
|
-
};
|
|
14
|
-
const header = {
|
|
15
|
-
paddingLeft: 14,
|
|
16
|
-
paddingTop: 10,
|
|
17
|
-
paddingBottom: 10,
|
|
18
|
-
paddingRight: 14,
|
|
19
|
-
display: 'flex',
|
|
20
|
-
flexDirection: 'row',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
borderBottom: '1px solid rgb(66, 144, 245)',
|
|
23
|
-
backgroundColor: 'black',
|
|
24
|
-
};
|
|
25
|
-
const left = {
|
|
26
|
-
paddingRight: 14,
|
|
27
|
-
flex: 1,
|
|
28
|
-
};
|
|
29
|
-
const fnName = {
|
|
30
|
-
fontSize: 14,
|
|
31
|
-
marginBottom: 3,
|
|
32
|
-
};
|
|
33
|
-
const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
|
|
34
|
-
var _a;
|
|
35
|
-
const [showCodeFrame, setShowCodeFrame] = (0, react_1.useState)(() => {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
return (!((_a = s.originalFileName) === null || _a === void 0 ? void 0 : _a.includes('node_modules')) &&
|
|
38
|
-
!((_b = s.originalFileName) === null || _b === void 0 ? void 0 : _b.startsWith('webpack/'))) ||
|
|
39
|
-
isFirst;
|
|
40
|
-
});
|
|
41
|
-
const toggleCodeFrame = (0, react_1.useCallback)(() => {
|
|
42
|
-
setShowCodeFrame((f) => !f);
|
|
43
|
-
}, []);
|
|
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, {}) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
|
|
45
|
-
s.originalScriptCode.length > 0 &&
|
|
46
|
-
showCodeFrame ? ((0, jsx_runtime_1.jsx)(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })] }));
|
|
47
|
-
};
|
|
48
|
-
exports.StackElement = StackElement;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Symbolicating = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Symbolicating = (props) => {
|
|
6
|
-
return ((0, jsx_runtime_1.jsxs)("svg", { id: "loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: "16", height: "16", fill: "white", ...props, children: [(0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(0 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(45 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.125s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(90 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.25s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(135 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.375s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(180 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.5s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(225 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.675s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(270 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.75s" }) }), (0, jsx_runtime_1.jsx)("path", { opacity: ".1", d: "M14 0 H18 V8 H14 z", transform: "rotate(315 16 16)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "opacity", from: "1", to: ".1", dur: "1s", repeatCount: "indefinite", begin: "0.875s" }) })] }));
|
|
7
|
-
};
|
|
8
|
-
exports.Symbolicating = Symbolicating;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CaretDown = exports.CaretRight = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const CaretRight = () => {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("svg", { style: { height: 20 }, "aria-hidden": "true", focusable: "false", role: "img", viewBox: "0 0 192 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }) }));
|
|
7
|
-
};
|
|
8
|
-
exports.CaretRight = CaretRight;
|
|
9
|
-
const CaretDown = () => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: 20 }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
|
|
11
|
-
};
|
|
12
|
-
exports.CaretDown = CaretDown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const formatLocation: (location: string) => string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatLocation = void 0;
|
|
4
|
-
const formatLocation = (location) => {
|
|
5
|
-
if (location.startsWith('webpack://')) {
|
|
6
|
-
return location.replace('webpack://', '');
|
|
7
|
-
}
|
|
8
|
-
return location;
|
|
9
|
-
};
|
|
10
|
-
exports.formatLocation = formatLocation;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mountRemotionOverlay: () => void;
|
|
@@ -1,18 +0,0 @@
|
|
|
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.mountRemotionOverlay = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const client_1 = __importDefault(require("react-dom/client"));
|
|
9
|
-
const Overlay_1 = require("./Overlay");
|
|
10
|
-
const mountRemotionOverlay = () => {
|
|
11
|
-
if (client_1.default.createRoot) {
|
|
12
|
-
client_1.default.createRoot(document.getElementById('remotion-error-overlay')).render((0, jsx_runtime_1.jsx)(Overlay_1.Overlay, {}));
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
client_1.default.render((0, jsx_runtime_1.jsx)(Overlay_1.Overlay, {}), document.getElementById('remotion-error-overlay'));
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
exports.mountRemotionOverlay = mountRemotionOverlay;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getLatestRemotionVersion: () => Promise<any>;
|
|
@@ -1,31 +0,0 @@
|
|
|
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.getLatestRemotionVersion = void 0;
|
|
7
|
-
const https_1 = __importDefault(require("https"));
|
|
8
|
-
const getPackageJsonForRemotion = () => {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
const req = https_1.default.get('https://registry.npmjs.org/remotion', {
|
|
11
|
-
headers: {
|
|
12
|
-
accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
|
|
13
|
-
},
|
|
14
|
-
}, (res) => {
|
|
15
|
-
let data = '';
|
|
16
|
-
res.on('data', (d) => {
|
|
17
|
-
data += d;
|
|
18
|
-
});
|
|
19
|
-
res.on('end', () => resolve(data));
|
|
20
|
-
});
|
|
21
|
-
req.on('error', (error) => {
|
|
22
|
-
reject(error);
|
|
23
|
-
});
|
|
24
|
-
req.end();
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
const getLatestRemotionVersion = async () => {
|
|
28
|
-
const pkgJson = await getPackageJsonForRemotion();
|
|
29
|
-
return JSON.parse(pkgJson)['dist-tags'].latest;
|
|
30
|
-
};
|
|
31
|
-
exports.getLatestRemotionVersion = getLatestRemotionVersion;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare type PackageManager = 'npm' | 'yarn' | 'pnpm';
|
|
2
|
-
declare type LockfilePath = {
|
|
3
|
-
manager: PackageManager;
|
|
4
|
-
path: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const lockFilePaths: LockfilePath[];
|
|
7
|
-
export declare const getPackageManager: () => PackageManager | 'unknown';
|
|
8
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
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.getPackageManager = exports.lockFilePaths = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
exports.lockFilePaths = [
|
|
10
|
-
{ path: 'package-lock.json', manager: 'npm' },
|
|
11
|
-
{
|
|
12
|
-
path: 'yarn.lock',
|
|
13
|
-
manager: 'yarn',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
path: 'pnpm-lock.yaml',
|
|
17
|
-
manager: 'pnpm',
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
const getPackageManager = () => {
|
|
21
|
-
const existingPkgManagers = exports.lockFilePaths.filter((p) => fs_1.default.existsSync(path_1.default.join(process.cwd(), p.path)));
|
|
22
|
-
if (existingPkgManagers.length === 0) {
|
|
23
|
-
return 'unknown';
|
|
24
|
-
}
|
|
25
|
-
if (existingPkgManagers.length > 1) {
|
|
26
|
-
const error = [
|
|
27
|
-
`Found multiple lockfiles:`,
|
|
28
|
-
...existingPkgManagers.map((m) => {
|
|
29
|
-
return `- ${m.path}`;
|
|
30
|
-
}),
|
|
31
|
-
'',
|
|
32
|
-
'This can lead to bugs, delete all but one of these files and run this command again.',
|
|
33
|
-
].join('\n');
|
|
34
|
-
throw new Error(error);
|
|
35
|
-
}
|
|
36
|
-
return existingPkgManagers[0].manager;
|
|
37
|
-
};
|
|
38
|
-
exports.getPackageManager = getPackageManager;
|
package/dist/get-port.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDesiredPort: (desiredPort: number | undefined, from: number, to: number) => Promise<number>;
|
package/dist/get-port.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
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.getDesiredPort = void 0;
|
|
7
|
-
const net_1 = __importDefault(require("net"));
|
|
8
|
-
const p_limit_1 = require("./p-limit");
|
|
9
|
-
const getAvailablePort = (portToTry) => new Promise((resolve) => {
|
|
10
|
-
let status = 'unavailable';
|
|
11
|
-
const host = '127.0.0.1';
|
|
12
|
-
const socket = new net_1.default.Socket();
|
|
13
|
-
socket.on('connect', () => {
|
|
14
|
-
status = 'unavailable';
|
|
15
|
-
socket.destroy();
|
|
16
|
-
});
|
|
17
|
-
socket.setTimeout(1000);
|
|
18
|
-
socket.on('timeout', () => {
|
|
19
|
-
status = 'unavailable';
|
|
20
|
-
socket.destroy();
|
|
21
|
-
resolve(status);
|
|
22
|
-
});
|
|
23
|
-
socket.on('error', () => {
|
|
24
|
-
status = 'available';
|
|
25
|
-
});
|
|
26
|
-
socket.on('close', () => resolve(status));
|
|
27
|
-
socket.connect(portToTry, host);
|
|
28
|
-
});
|
|
29
|
-
const portCheckSequence = function* (ports) {
|
|
30
|
-
if (ports) {
|
|
31
|
-
yield* ports;
|
|
32
|
-
}
|
|
33
|
-
yield 0; // Fall back to 0 if anything else failed
|
|
34
|
-
};
|
|
35
|
-
const getPort = async (from, to) => {
|
|
36
|
-
const ports = makeRange(from, to);
|
|
37
|
-
for (const port of portCheckSequence(ports)) {
|
|
38
|
-
if ((await getAvailablePort(port)) === 'available') {
|
|
39
|
-
return port;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
throw new Error('No available ports found');
|
|
43
|
-
};
|
|
44
|
-
const getDesiredPortUnlimited = async (desiredPort, from, to) => {
|
|
45
|
-
if (typeof desiredPort !== 'undefined' &&
|
|
46
|
-
(await getAvailablePort(desiredPort)) === 'available') {
|
|
47
|
-
return desiredPort;
|
|
48
|
-
}
|
|
49
|
-
const actualPort = await getPort(from, to);
|
|
50
|
-
// If did specify a port but did not get that one, fail hard.
|
|
51
|
-
if (desiredPort && desiredPort !== actualPort) {
|
|
52
|
-
throw new Error(`You specified port ${desiredPort} to be used for the HTTP server, but it is not available. Choose a different port or remove the setting to let Remotion automatically select a free port.`);
|
|
53
|
-
}
|
|
54
|
-
return actualPort;
|
|
55
|
-
};
|
|
56
|
-
const limit = (0, p_limit_1.pLimit)(1);
|
|
57
|
-
const getDesiredPort = (desiredPort, from, to) => {
|
|
58
|
-
return limit(getDesiredPortUnlimited, desiredPort, from, to);
|
|
59
|
-
};
|
|
60
|
-
exports.getDesiredPort = getDesiredPort;
|
|
61
|
-
const makeRange = (from, to) => {
|
|
62
|
-
if (!Number.isInteger(from) || !Number.isInteger(to)) {
|
|
63
|
-
throw new TypeError('`from` and `to` must be integer numbers');
|
|
64
|
-
}
|
|
65
|
-
if (from < 1024 || from > 65535) {
|
|
66
|
-
throw new RangeError('`from` must be between 1024 and 65535');
|
|
67
|
-
}
|
|
68
|
-
if (to < 1024 || to > 65536) {
|
|
69
|
-
throw new RangeError('`to` must be between 1024 and 65536');
|
|
70
|
-
}
|
|
71
|
-
if (to < from) {
|
|
72
|
-
throw new RangeError('`to` must be greater than or equal to `from`');
|
|
73
|
-
}
|
|
74
|
-
const generator = function* (f, t) {
|
|
75
|
-
for (let port = f; port <= t; port++) {
|
|
76
|
-
yield port;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
return generator(from, to);
|
|
80
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HotMiddlewareMessage } from './types';
|
|
2
|
-
declare function eventSourceWrapper(): {
|
|
3
|
-
addMessageListener(fn: (msg: MessageEvent) => void): void;
|
|
4
|
-
};
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
__whmEventSourceWrapper: {
|
|
8
|
-
[key: string]: ReturnType<typeof eventSourceWrapper>;
|
|
9
|
-
};
|
|
10
|
-
__webpack_hot_middleware_reporter__: Reporter;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
declare type Reporter = ReturnType<typeof createReporter>;
|
|
14
|
-
declare function createReporter(): {
|
|
15
|
-
cleanProblemsCache(): void;
|
|
16
|
-
problems(type: 'errors' | 'warnings', obj: HotMiddlewareMessage): boolean;
|
|
17
|
-
success: () => undefined;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Source code is adapted from
|
|
5
|
-
* https://github.com/webpack-contrib/webpack-hot-middleware#readme
|
|
6
|
-
* and rewritten in TypeScript. This file is MIT licensed
|
|
7
|
-
*/
|
|
8
|
-
const process_update_1 = require("./process-update");
|
|
9
|
-
const strip_ansi_1 = require("./strip-ansi");
|
|
10
|
-
const types_1 = require("./types");
|
|
11
|
-
if (typeof window === 'undefined') {
|
|
12
|
-
// do nothing
|
|
13
|
-
}
|
|
14
|
-
else if (typeof window.EventSource === 'undefined') {
|
|
15
|
-
console.warn('Unsupported browser: You need a browser that supports EventSource ');
|
|
16
|
-
}
|
|
17
|
-
else if (types_1.hotMiddlewareOptions.autoConnect) {
|
|
18
|
-
connect();
|
|
19
|
-
}
|
|
20
|
-
function setOptionsAndConnect() {
|
|
21
|
-
connect();
|
|
22
|
-
}
|
|
23
|
-
function eventSourceWrapper() {
|
|
24
|
-
let source;
|
|
25
|
-
let lastActivity = Date.now();
|
|
26
|
-
const listeners = [];
|
|
27
|
-
init();
|
|
28
|
-
const timer = setInterval(() => {
|
|
29
|
-
if (Date.now() - lastActivity > types_1.hotMiddlewareOptions.timeout) {
|
|
30
|
-
handleDisconnect();
|
|
31
|
-
}
|
|
32
|
-
}, types_1.hotMiddlewareOptions.timeout / 2);
|
|
33
|
-
function init() {
|
|
34
|
-
source = new window.EventSource(types_1.hotMiddlewareOptions.path);
|
|
35
|
-
source.onopen = handleOnline;
|
|
36
|
-
source.onerror = handleDisconnect;
|
|
37
|
-
source.onmessage = handleMessage;
|
|
38
|
-
}
|
|
39
|
-
function handleOnline() {
|
|
40
|
-
lastActivity = Date.now();
|
|
41
|
-
}
|
|
42
|
-
function handleMessage(event) {
|
|
43
|
-
lastActivity = Date.now();
|
|
44
|
-
for (let i = 0; i < listeners.length; i++) {
|
|
45
|
-
listeners[i](event);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function handleDisconnect() {
|
|
49
|
-
clearInterval(timer);
|
|
50
|
-
source.close();
|
|
51
|
-
setTimeout(init, types_1.hotMiddlewareOptions.timeout);
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
addMessageListener(fn) {
|
|
55
|
-
listeners.push(fn);
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function getEventSourceWrapper() {
|
|
60
|
-
if (!window.__whmEventSourceWrapper) {
|
|
61
|
-
window.__whmEventSourceWrapper = {};
|
|
62
|
-
}
|
|
63
|
-
if (!window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path]) {
|
|
64
|
-
// cache the wrapper for other entries loaded on
|
|
65
|
-
// the same page with the same hotMiddlewareOptions.path
|
|
66
|
-
window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path] =
|
|
67
|
-
eventSourceWrapper();
|
|
68
|
-
}
|
|
69
|
-
return window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path];
|
|
70
|
-
}
|
|
71
|
-
function connect() {
|
|
72
|
-
getEventSourceWrapper().addMessageListener(handleMessage);
|
|
73
|
-
function handleMessage(event) {
|
|
74
|
-
if (event.data === '\uD83D\uDC93') {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
try {
|
|
78
|
-
processMessage(JSON.parse(event.data));
|
|
79
|
-
}
|
|
80
|
-
catch (ex) {
|
|
81
|
-
if (types_1.hotMiddlewareOptions.warn) {
|
|
82
|
-
console.warn('Invalid HMR message: ' + event.data + '\n' + ex);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
// the reporter needs to be a singleton on the page
|
|
88
|
-
// in case the client is being used by multiple bundles
|
|
89
|
-
// we only want to report once.
|
|
90
|
-
// all the errors will go to all clients
|
|
91
|
-
const singletonKey = '__webpack_hot_middleware_reporter__';
|
|
92
|
-
let reporter;
|
|
93
|
-
if (typeof window !== 'undefined') {
|
|
94
|
-
if (!window[singletonKey]) {
|
|
95
|
-
window[singletonKey] = createReporter();
|
|
96
|
-
}
|
|
97
|
-
reporter = window[singletonKey];
|
|
98
|
-
}
|
|
99
|
-
function createReporter() {
|
|
100
|
-
const styles = {
|
|
101
|
-
errors: 'color: #ff0000;',
|
|
102
|
-
warnings: 'color: #999933;',
|
|
103
|
-
};
|
|
104
|
-
let previousProblems = null;
|
|
105
|
-
function log(type, obj) {
|
|
106
|
-
if (obj.action === 'building') {
|
|
107
|
-
console.log('[Fast Refresh] Building');
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const newProblems = obj[type]
|
|
111
|
-
.map((msg) => {
|
|
112
|
-
return (0, strip_ansi_1.stripAnsi)(msg);
|
|
113
|
-
})
|
|
114
|
-
.join('\n');
|
|
115
|
-
if (previousProblems === newProblems) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
previousProblems = newProblems;
|
|
119
|
-
const style = styles[type];
|
|
120
|
-
const name = obj.name ? "'" + obj.name + "' " : '';
|
|
121
|
-
const title = '[Fast Refresh] bundle ' + name + 'has ' + obj[type].length + ' ' + type;
|
|
122
|
-
// NOTE: console.warn or console.error will print the stack trace
|
|
123
|
-
// which isn't helpful here, so using console.log to escape it.
|
|
124
|
-
if (console.group && console.groupEnd) {
|
|
125
|
-
console.group('%c' + title, style);
|
|
126
|
-
console.log('%c' + newProblems, style);
|
|
127
|
-
console.groupEnd();
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
console.log('%c' + title + '\n\t%c' + newProblems.replace(/\n/g, '\n\t'), style + 'font-weight: bold;', style + 'font-weight: normal;');
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
cleanProblemsCache() {
|
|
135
|
-
previousProblems = null;
|
|
136
|
-
},
|
|
137
|
-
problems(type, obj) {
|
|
138
|
-
if (types_1.hotMiddlewareOptions.warn) {
|
|
139
|
-
log(type, obj);
|
|
140
|
-
}
|
|
141
|
-
return true;
|
|
142
|
-
},
|
|
143
|
-
success: () => undefined,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
let customHandler;
|
|
147
|
-
let subscribeAllHandler;
|
|
148
|
-
function processMessage(obj) {
|
|
149
|
-
switch (obj.action) {
|
|
150
|
-
case 'building':
|
|
151
|
-
console.log('[Fast refresh] bundle ' +
|
|
152
|
-
(obj.name ? "'" + obj.name + "' " : '') +
|
|
153
|
-
'rebuilding');
|
|
154
|
-
break;
|
|
155
|
-
case 'built':
|
|
156
|
-
console.log('[Fast refresh] bundle ' +
|
|
157
|
-
(obj.name ? "'" + obj.name + "' " : '') +
|
|
158
|
-
'rebuilt in ' +
|
|
159
|
-
obj.time +
|
|
160
|
-
'ms');
|
|
161
|
-
// fall through
|
|
162
|
-
case 'sync': {
|
|
163
|
-
if (obj.name &&
|
|
164
|
-
types_1.hotMiddlewareOptions.name &&
|
|
165
|
-
obj.name !== types_1.hotMiddlewareOptions.name) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
let applyUpdate = true;
|
|
169
|
-
if (obj.errors.length > 0) {
|
|
170
|
-
if (reporter)
|
|
171
|
-
reporter.problems('errors', obj);
|
|
172
|
-
applyUpdate = false;
|
|
173
|
-
}
|
|
174
|
-
else if (obj.warnings.length > 0) {
|
|
175
|
-
if (reporter) {
|
|
176
|
-
const overlayShown = reporter.problems('warnings', obj);
|
|
177
|
-
applyUpdate = overlayShown;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else if (reporter) {
|
|
181
|
-
reporter.cleanProblemsCache();
|
|
182
|
-
reporter.success();
|
|
183
|
-
}
|
|
184
|
-
if (applyUpdate) {
|
|
185
|
-
(0, process_update_1.processUpdate)(obj.hash, obj.modules, types_1.hotMiddlewareOptions);
|
|
186
|
-
}
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
default:
|
|
190
|
-
if (customHandler) {
|
|
191
|
-
customHandler(obj);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
if (subscribeAllHandler) {
|
|
195
|
-
subscribeAllHandler(obj);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
module.exports = {
|
|
199
|
-
subscribeAll(handler) {
|
|
200
|
-
subscribeAllHandler = handler;
|
|
201
|
-
},
|
|
202
|
-
subscribe(handler) {
|
|
203
|
-
customHandler = handler;
|
|
204
|
-
},
|
|
205
|
-
setOptionsAndConnect,
|
|
206
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Source code is adapted from
|
|
3
|
-
* https://github.com/webpack-contrib/webpack-hot-middleware#readme
|
|
4
|
-
* and rewritten in TypeScript. This file is MIT licensed
|
|
5
|
-
*/
|
|
6
|
-
import { Request, Response } from 'express';
|
|
7
|
-
import webpack from 'webpack';
|
|
8
|
-
import { HotMiddlewareMessage } from './types';
|
|
9
|
-
export declare const webpackHotMiddleware: (compiler: webpack.Compiler) => {
|
|
10
|
-
(req: Request, res: Response, next: () => void): void;
|
|
11
|
-
publish(payload: HotMiddlewareMessage): void;
|
|
12
|
-
close(): void;
|
|
13
|
-
};
|